@algolia/recommend 5.0.0-beta.1 → 5.0.0-beta.10
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/LICENSE +21 -0
- package/dist/builds/browser.d.ts +10 -10
- package/dist/builds/node.d.ts +10 -10
- package/dist/model/baseSearchResponse.d.ts +2 -18
- package/dist/model/baseSearchResponse.d.ts.map +1 -1
- package/dist/model/clientMethodProps.d.ts +7 -0
- package/dist/model/clientMethodProps.d.ts.map +1 -1
- package/dist/model/facetFilters.d.ts +1 -2
- package/dist/model/facetFilters.d.ts.map +1 -1
- package/dist/model/index.d.ts +2 -1
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/numericFilters.d.ts +1 -2
- package/dist/model/numericFilters.d.ts.map +1 -1
- package/dist/model/optionalFilters.d.ts +1 -2
- package/dist/model/optionalFilters.d.ts.map +1 -1
- package/dist/model/rankingInfo.d.ts +3 -3
- package/dist/model/rankingInfo.d.ts.map +1 -1
- package/dist/model/reRankingApplyFilter.d.ts +1 -2
- package/dist/model/reRankingApplyFilter.d.ts.map +1 -1
- package/dist/model/recommendationsResults.d.ts +2 -1
- package/dist/model/recommendationsResults.d.ts.map +1 -1
- package/dist/model/redirect.d.ts +1 -1
- package/dist/model/redirectURL.d.ts +7 -0
- package/dist/model/redirectURL.d.ts.map +1 -0
- package/dist/model/renderingContent.d.ts +2 -0
- package/dist/model/renderingContent.d.ts.map +1 -1
- package/dist/model/searchPagination.d.ts +19 -0
- package/dist/model/searchPagination.d.ts.map +1 -0
- package/dist/model/tagFilters.d.ts +1 -2
- package/dist/model/tagFilters.d.ts.map +1 -1
- package/dist/model/value.d.ts +4 -0
- package/dist/model/value.d.ts.map +1 -1
- package/dist/recommend.cjs +8 -1
- package/dist/recommend.esm.browser.js +18 -18
- package/dist/recommend.esm.node.js +8 -1
- package/dist/recommend.umd.js +2 -2
- package/dist/src/recommendClient.d.ts +3 -3
- package/dist/src/recommendClient.d.ts.map +1 -1
- package/model/baseSearchResponse.ts +2 -22
- package/model/clientMethodProps.ts +8 -0
- package/model/facetFilters.ts +1 -3
- package/model/index.ts +2 -1
- package/model/numericFilters.ts +1 -3
- package/model/optionalFilters.ts +1 -3
- package/model/rankingInfo.ts +3 -3
- package/model/reRankingApplyFilter.ts +1 -3
- package/model/recommendationsResults.ts +4 -1
- package/model/redirect.ts +1 -1
- package/model/{mixedSearchFilters.ts → redirectURL.ts} +6 -1
- package/model/renderingContent.ts +3 -0
- package/model/searchPagination.ts +23 -0
- package/model/tagFilters.ts +1 -3
- package/model/value.ts +5 -0
- package/package.json +11 -8
- package/dist/model/mixedSearchFilters.d.ts +0 -2
- package/dist/model/mixedSearchFilters.d.ts.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2013-Present Algolia
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/builds/browser.d.ts
CHANGED
|
@@ -10,15 +10,15 @@ export declare function recommendClient(appId: string, apiKey: string, options?:
|
|
|
10
10
|
appId: string;
|
|
11
11
|
clearCache(): Promise<void>;
|
|
12
12
|
readonly _ua: string;
|
|
13
|
-
addAlgoliaAgent(segment: string, version?: string
|
|
14
|
-
customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
15
|
-
customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
16
|
-
customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
17
|
-
customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
18
|
-
deleteRecommendRule({ indexName, model, objectID }: import("../model").DeleteRecommendRuleProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
19
|
-
getRecommendRule({ indexName, model, objectID }: import("../model").GetRecommendRuleProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
20
|
-
getRecommendStatus({ indexName, model, taskID }: import("../model").GetRecommendStatusProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
21
|
-
getRecommendations(getRecommendationsParams: import("../model").GetRecommendationsParams, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
22
|
-
searchRecommendRules({ indexName, model, searchRecommendRulesParams, }: import("../model").SearchRecommendRulesProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
13
|
+
addAlgoliaAgent(segment: string, version?: string): void;
|
|
14
|
+
customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
15
|
+
customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
16
|
+
customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
17
|
+
customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
18
|
+
deleteRecommendRule({ indexName, model, objectID }: import("../model").DeleteRecommendRuleProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").DeletedAtResponse>;
|
|
19
|
+
getRecommendRule({ indexName, model, objectID }: import("../model").GetRecommendRuleProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").RecommendRule>;
|
|
20
|
+
getRecommendStatus({ indexName, model, taskID }: import("../model").GetRecommendStatusProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").GetRecommendTaskResponse>;
|
|
21
|
+
getRecommendations(getRecommendationsParams: import("../model").GetRecommendationsParams | import("../model").LegacyGetRecommendationsParams, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").GetRecommendationsResponse>;
|
|
22
|
+
searchRecommendRules({ indexName, model, searchRecommendRulesParams, }: import("../model").SearchRecommendRulesProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SearchRecommendRulesResponse>;
|
|
23
23
|
};
|
|
24
24
|
//# sourceMappingURL=browser.d.ts.map
|
package/dist/builds/node.d.ts
CHANGED
|
@@ -10,15 +10,15 @@ export declare function recommendClient(appId: string, apiKey: string, options?:
|
|
|
10
10
|
appId: string;
|
|
11
11
|
clearCache(): Promise<void>;
|
|
12
12
|
_ua: string;
|
|
13
|
-
addAlgoliaAgent(segment: string, version?: string
|
|
14
|
-
customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
15
|
-
customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
16
|
-
customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
17
|
-
customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
18
|
-
deleteRecommendRule({ indexName, model, objectID }: import("../model").DeleteRecommendRuleProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
19
|
-
getRecommendRule({ indexName, model, objectID }: import("../model").GetRecommendRuleProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
20
|
-
getRecommendStatus({ indexName, model, taskID }: import("../model").GetRecommendStatusProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
21
|
-
getRecommendations(getRecommendationsParams: import("../model").GetRecommendationsParams, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
22
|
-
searchRecommendRules({ indexName, model, searchRecommendRulesParams, }: import("../model").SearchRecommendRulesProps, requestOptions?: import("@algolia/client-common").RequestOptions
|
|
13
|
+
addAlgoliaAgent(segment: string, version?: string): void;
|
|
14
|
+
customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
15
|
+
customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
16
|
+
customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
17
|
+
customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
18
|
+
deleteRecommendRule({ indexName, model, objectID }: import("../model").DeleteRecommendRuleProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").DeletedAtResponse>;
|
|
19
|
+
getRecommendRule({ indexName, model, objectID }: import("../model").GetRecommendRuleProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").RecommendRule>;
|
|
20
|
+
getRecommendStatus({ indexName, model, taskID }: import("../model").GetRecommendStatusProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").GetRecommendTaskResponse>;
|
|
21
|
+
getRecommendations(getRecommendationsParams: import("../model").GetRecommendationsParams | import("../model").LegacyGetRecommendationsParams, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").GetRecommendationsResponse>;
|
|
22
|
+
searchRecommendRules({ indexName, model, searchRecommendRulesParams, }: import("../model").SearchRecommendRulesProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SearchRecommendRulesResponse>;
|
|
23
23
|
};
|
|
24
24
|
//# sourceMappingURL=node.d.ts.map
|
|
@@ -40,10 +40,6 @@ export type BaseSearchResponse = Record<string, any> & {
|
|
|
40
40
|
* Statistics for numerical facets.
|
|
41
41
|
*/
|
|
42
42
|
facets_stats?: Record<string, FacetsStats>;
|
|
43
|
-
/**
|
|
44
|
-
* Number of hits per page.
|
|
45
|
-
*/
|
|
46
|
-
hitsPerPage: number;
|
|
47
43
|
/**
|
|
48
44
|
* Index name used for the query.
|
|
49
45
|
*/
|
|
@@ -56,22 +52,10 @@ export type BaseSearchResponse = Record<string, any> & {
|
|
|
56
52
|
* Warnings about the query.
|
|
57
53
|
*/
|
|
58
54
|
message?: string;
|
|
59
|
-
/**
|
|
60
|
-
* Number of results (hits).
|
|
61
|
-
*/
|
|
62
|
-
nbHits: number;
|
|
63
|
-
/**
|
|
64
|
-
* Number of pages of results.
|
|
65
|
-
*/
|
|
66
|
-
nbPages: number;
|
|
67
55
|
/**
|
|
68
56
|
* Number of hits selected and sorted by the relevant sort algorithm.
|
|
69
57
|
*/
|
|
70
58
|
nbSortedHits?: number;
|
|
71
|
-
/**
|
|
72
|
-
* Page of search results to retrieve.
|
|
73
|
-
*/
|
|
74
|
-
page: number;
|
|
75
59
|
/**
|
|
76
60
|
* Post-[normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/#what-does-normalization-mean) query string that will be searched.
|
|
77
61
|
*/
|
|
@@ -99,9 +83,9 @@ export type BaseSearchResponse = Record<string, any> & {
|
|
|
99
83
|
*/
|
|
100
84
|
serverUsed?: string;
|
|
101
85
|
/**
|
|
102
|
-
* An object with custom data. You can store up to
|
|
86
|
+
* An object with custom data. You can store up to 32kB as custom data.
|
|
103
87
|
*/
|
|
104
|
-
userData?: any
|
|
88
|
+
userData?: Record<string, any>;
|
|
105
89
|
/**
|
|
106
90
|
* Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/).
|
|
107
91
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseSearchResponse.d.ts","sourceRoot":"","sources":["../../model/baseSearchResponse.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;IACrD;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAA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OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE1C;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAEpC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE/B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RecommendModels } from './recommendModels';
|
|
2
|
+
import type { RecommendationsRequest } from './recommendationsRequest';
|
|
2
3
|
import type { SearchRecommendRulesParams } from './searchRecommendRulesParams';
|
|
3
4
|
/**
|
|
4
5
|
* Properties for the `customDelete` method.
|
|
@@ -111,6 +112,12 @@ export type GetRecommendStatusProps = {
|
|
|
111
112
|
*/
|
|
112
113
|
taskID: number;
|
|
113
114
|
};
|
|
115
|
+
/**
|
|
116
|
+
* Recommend method signature compatible with the `algoliasearch` v4 package. When using this signature, extra computation will be required to make it match the new signature.
|
|
117
|
+
*
|
|
118
|
+
* @deprecated This signature will be removed from the next major version, we recommend using the `GetRecommendationsParams` type for performances and future proof reasons.
|
|
119
|
+
*/
|
|
120
|
+
export type LegacyGetRecommendationsParams = RecommendationsRequest[];
|
|
114
121
|
/**
|
|
115
122
|
* Properties for the `searchRecommendRules` method.
|
|
116
123
|
*/
|
|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Q,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,KAAK,EAAE,eAAe,CAAC;IACvB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,KAAK,EAAE,eAAe,CAAC;IACvB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,KAAK,EAAE,eAAe,CAAC;IACvB,0BAA0B,CAAC,EAAE,0BAA0B,CAAC;CACzD,CAAC"}
|
|
1
|
+
{"version":3,"file":"clientMethodProps.d.ts","sourceRoot":"","sources":["../../model/clientMethodProps.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE/E;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eA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AA0B,CAAC,EAAE,0BAA0B,CAAC;CACzD,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { MixedSearchFilters } from './mixedSearchFilters';
|
|
2
1
|
/**
|
|
3
2
|
* Filter the search by facet values, so that only records with the same facet values are retrieved. **Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.** - `[filter1, filter2]` is interpreted as `filter1 AND filter2`. - `[[filter1, filter2], filter3]` is interpreted as `filter1 OR filter2 AND filter3`. - `facet:-value` is interpreted as `NOT facet:value`. While it\'s best to avoid attributes that start with a `-`, you can still filter them by escaping with a backslash: `facet:\\-value`.
|
|
4
3
|
*/
|
|
5
|
-
export type FacetFilters =
|
|
4
|
+
export type FacetFilters = FacetFilters[] | string;
|
|
6
5
|
//# sourceMappingURL=facetFilters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facetFilters.d.ts","sourceRoot":"","sources":["../../model/facetFilters.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"facetFilters.d.ts","sourceRoot":"","sources":["../../model/facetFilters.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,YAAY,EAAE,GAAG,MAAM,CAAC"}
|
package/dist/model/index.d.ts
CHANGED
|
@@ -37,7 +37,6 @@ export * from './lookingSimilarModel';
|
|
|
37
37
|
export * from './lookingSimilarQuery';
|
|
38
38
|
export * from './matchLevel';
|
|
39
39
|
export * from './matchedGeoLocation';
|
|
40
|
-
export * from './mixedSearchFilters';
|
|
41
40
|
export * from './mode';
|
|
42
41
|
export * from './numericFilters';
|
|
43
42
|
export * from './optionalFilters';
|
|
@@ -61,12 +60,14 @@ export * from './recommendedForYouQuery';
|
|
|
61
60
|
export * from './redirect';
|
|
62
61
|
export * from './redirectRuleIndexMetadata';
|
|
63
62
|
export * from './redirectRuleIndexMetadataData';
|
|
63
|
+
export * from './redirectURL';
|
|
64
64
|
export * from './relatedModel';
|
|
65
65
|
export * from './relatedProducts';
|
|
66
66
|
export * from './relatedQuery';
|
|
67
67
|
export * from './removeStopWords';
|
|
68
68
|
export * from './removeWordsIfNoResults';
|
|
69
69
|
export * from './renderingContent';
|
|
70
|
+
export * from './searchPagination';
|
|
70
71
|
export * from './searchParams';
|
|
71
72
|
export * from './searchParamsObject';
|
|
72
73
|
export * from './searchParamsQuery';
|
|
@@ -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,mBAAmB,CAAC;AAClC,cAAc,iCAAiC,CAAC;AAChD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,+BAA+B,CAAC;AAC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AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { MixedSearchFilters } from './mixedSearchFilters';
|
|
2
1
|
/**
|
|
3
2
|
* Filter by numeric facets. **Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.** You can use numeric comparison operators: `<`, `<=`, `=`, `!=`, `>`, `>=`. Comparsions are precise up to 3 decimals. You can also provide ranges: `facet:<lower> TO <upper>`. The range includes the lower and upper boundaries. The same combination rules apply as for `facetFilters`.
|
|
4
3
|
*/
|
|
5
|
-
export type NumericFilters =
|
|
4
|
+
export type NumericFilters = NumericFilters[] | string;
|
|
6
5
|
//# sourceMappingURL=numericFilters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numericFilters.d.ts","sourceRoot":"","sources":["../../model/numericFilters.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"numericFilters.d.ts","sourceRoot":"","sources":["../../model/numericFilters.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,cAAc,EAAE,GAAG,MAAM,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { MixedSearchFilters } from './mixedSearchFilters';
|
|
2
1
|
/**
|
|
3
2
|
* Filters to promote or demote records in the search results. Optional filters work like facet filters, but they don\'t exclude records from the search results. Records that match the optional filter rank before records that don\'t match. If you\'re using a negative filter `facet:-value`, matching records rank after records that don\'t match. - Optional filters don\'t work on virtual replicas. - Optional filters are applied _after_ sort-by attributes. - Optional filters don\'t work with numeric attributes.
|
|
4
3
|
*/
|
|
5
|
-
export type OptionalFilters =
|
|
4
|
+
export type OptionalFilters = OptionalFilters[] | string;
|
|
6
5
|
//# sourceMappingURL=optionalFilters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optionalFilters.d.ts","sourceRoot":"","sources":["../../model/optionalFilters.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"optionalFilters.d.ts","sourceRoot":"","sources":["../../model/optionalFilters.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,eAAe,EAAE,GAAG,MAAM,CAAC"}
|
|
@@ -7,7 +7,7 @@ export type RankingInfo = {
|
|
|
7
7
|
/**
|
|
8
8
|
* Whether a filter matched the query.
|
|
9
9
|
*/
|
|
10
|
-
filters
|
|
10
|
+
filters?: number;
|
|
11
11
|
/**
|
|
12
12
|
* Position of the first matched word in the best matching attribute of the record.
|
|
13
13
|
*/
|
|
@@ -33,7 +33,7 @@ export type RankingInfo = {
|
|
|
33
33
|
/**
|
|
34
34
|
* Whether the record was promoted by a rule.
|
|
35
35
|
*/
|
|
36
|
-
promoted
|
|
36
|
+
promoted?: boolean;
|
|
37
37
|
/**
|
|
38
38
|
* Number of words between multiple matches in the query plus 1. For single word queries, `proximityDistance` is 0.
|
|
39
39
|
*/
|
|
@@ -45,7 +45,7 @@ export type RankingInfo = {
|
|
|
45
45
|
/**
|
|
46
46
|
* Number of matched words.
|
|
47
47
|
*/
|
|
48
|
-
words
|
|
48
|
+
words?: number;
|
|
49
49
|
/**
|
|
50
50
|
* Whether the record is re-ranked.
|
|
51
51
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rankingInfo.d.ts","sourceRoot":"","sources":["../../model/rankingInfo.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"rankingInfo.d.ts","sourceRoot":"","sources":["../../model/rankingInfo.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IAExC,eAAe,CAAC,EAAE,eAAe,CAAC;IAElC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { MixedSearchFilters } from './mixedSearchFilters';
|
|
2
1
|
/**
|
|
3
2
|
* Restrict [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/) to records that match these filters.
|
|
4
3
|
*/
|
|
5
|
-
export type ReRankingApplyFilter =
|
|
4
|
+
export type ReRankingApplyFilter = ReRankingApplyFilter[] | string;
|
|
6
5
|
//# sourceMappingURL=reRankingApplyFilter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reRankingApplyFilter.d.ts","sourceRoot":"","sources":["../../model/reRankingApplyFilter.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"reRankingApplyFilter.d.ts","sourceRoot":"","sources":["../../model/reRankingApplyFilter.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,EAAE,GAAG,MAAM,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BaseSearchResponse } from './baseSearchResponse';
|
|
2
2
|
import type { RecommendationsHits } from './recommendationsHits';
|
|
3
|
-
|
|
3
|
+
import type { SearchPagination } from './searchPagination';
|
|
4
|
+
export type RecommendationsResults = BaseSearchResponse & RecommendationsHits & SearchPagination;
|
|
4
5
|
//# sourceMappingURL=recommendationsResults.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recommendationsResults.d.ts","sourceRoot":"","sources":["../../model/recommendationsResults.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"recommendationsResults.d.ts","sourceRoot":"","sources":["../../model/recommendationsResults.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,GACrD,mBAAmB,GACnB,gBAAgB,CAAC"}
|
package/dist/model/redirect.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RedirectRuleIndexMetadata } from './redirectRuleIndexMetadata';
|
|
2
2
|
/**
|
|
3
|
-
* [Redirect results to a URL](https://www.algolia.com/doc/guides/managing-results/rules/merchandising-and-promoting/how-to/redirects/).
|
|
3
|
+
* [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.
|
|
4
4
|
*/
|
|
5
5
|
export type Redirect = {
|
|
6
6
|
index?: RedirectRuleIndexMetadata[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redirectURL.d.ts","sourceRoot":"","sources":["../../model/redirectURL.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { FacetOrdering } from './facetOrdering';
|
|
2
|
+
import type { RedirectURL } from './redirectURL';
|
|
2
3
|
/**
|
|
3
4
|
* 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.
|
|
4
5
|
*/
|
|
5
6
|
export type RenderingContent = {
|
|
6
7
|
facetOrdering?: FacetOrdering;
|
|
8
|
+
redirect?: RedirectURL;
|
|
7
9
|
};
|
|
8
10
|
//# sourceMappingURL=renderingContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderingContent.d.ts","sourceRoot":"","sources":["../../model/renderingContent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"renderingContent.d.ts","sourceRoot":"","sources":["../../model/renderingContent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B,QAAQ,CAAC,EAAE,WAAW,CAAC;CACxB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type SearchPagination = {
|
|
2
|
+
/**
|
|
3
|
+
* Page of search results to retrieve.
|
|
4
|
+
*/
|
|
5
|
+
page: number;
|
|
6
|
+
/**
|
|
7
|
+
* Number of results (hits).
|
|
8
|
+
*/
|
|
9
|
+
nbHits: number;
|
|
10
|
+
/**
|
|
11
|
+
* Number of pages of results.
|
|
12
|
+
*/
|
|
13
|
+
nbPages: number;
|
|
14
|
+
/**
|
|
15
|
+
* Number of hits per page.
|
|
16
|
+
*/
|
|
17
|
+
hitsPerPage: number;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=searchPagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"searchPagination.d.ts","sourceRoot":"","sources":["../../model/searchPagination.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { MixedSearchFilters } from './mixedSearchFilters';
|
|
2
1
|
/**
|
|
3
2
|
* 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`.
|
|
4
3
|
*/
|
|
5
|
-
export type TagFilters =
|
|
4
|
+
export type TagFilters = TagFilters[] | string;
|
|
6
5
|
//# sourceMappingURL=tagFilters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tagFilters.d.ts","sourceRoot":"","sources":["../../model/tagFilters.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"tagFilters.d.ts","sourceRoot":"","sources":["../../model/tagFilters.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,UAAU,EAAE,GAAG,MAAM,CAAC"}
|
package/dist/model/value.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"value.d.ts","sourceRoot":"","sources":["../../model/value.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,MAAM,KAAK,GAAG;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAEjB,eAAe,CAAC,EAAE,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"value.d.ts","sourceRoot":"","sources":["../../model/value.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,MAAM,KAAK,GAAG;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAEjB,eAAe,CAAC,EAAE,eAAe,CAAC;IAElC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC"}
|
package/dist/recommend.cjs
CHANGED
|
@@ -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-beta.
|
|
7
|
+
const apiClientVersion = '5.0.0-beta.10';
|
|
8
8
|
function getDefaultHosts(appId) {
|
|
9
9
|
return [
|
|
10
10
|
{
|
|
@@ -300,6 +300,13 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
300
300
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
301
301
|
*/
|
|
302
302
|
getRecommendations(getRecommendationsParams, requestOptions) {
|
|
303
|
+
if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
|
|
304
|
+
const newSignatureRequest = {
|
|
305
|
+
requests: getRecommendationsParams,
|
|
306
|
+
};
|
|
307
|
+
// eslint-disable-next-line no-param-reassign
|
|
308
|
+
getRecommendationsParams = newSignatureRequest;
|
|
309
|
+
}
|
|
303
310
|
if (!getRecommendationsParams) {
|
|
304
311
|
throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');
|
|
305
312
|
}
|
|
@@ -195,6 +195,14 @@ function createStatefulHost(host, status = 'up') {
|
|
|
195
195
|
};
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
+
function _defineProperty(e, r, t) {
|
|
199
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
200
|
+
value: t,
|
|
201
|
+
enumerable: !0,
|
|
202
|
+
configurable: !0,
|
|
203
|
+
writable: !0
|
|
204
|
+
}) : e[r] = t, e;
|
|
205
|
+
}
|
|
198
206
|
function _toPrimitive(t, r) {
|
|
199
207
|
if ("object" != typeof t || !t) return t;
|
|
200
208
|
var e = t[Symbol.toPrimitive];
|
|
@@ -209,20 +217,6 @@ function _toPropertyKey(t) {
|
|
|
209
217
|
var i = _toPrimitive(t, "string");
|
|
210
218
|
return "symbol" == typeof i ? i : i + "";
|
|
211
219
|
}
|
|
212
|
-
function _defineProperty(obj, key, value) {
|
|
213
|
-
key = _toPropertyKey(key);
|
|
214
|
-
if (key in obj) {
|
|
215
|
-
Object.defineProperty(obj, key, {
|
|
216
|
-
value: value,
|
|
217
|
-
enumerable: true,
|
|
218
|
-
configurable: true,
|
|
219
|
-
writable: true
|
|
220
|
-
});
|
|
221
|
-
} else {
|
|
222
|
-
obj[key] = value;
|
|
223
|
-
}
|
|
224
|
-
return obj;
|
|
225
|
-
}
|
|
226
220
|
|
|
227
221
|
class AlgoliaError extends Error {
|
|
228
222
|
constructor(message, name) {
|
|
@@ -243,7 +237,7 @@ class ErrorWithStackTrace extends AlgoliaError {
|
|
|
243
237
|
}
|
|
244
238
|
class RetryError extends ErrorWithStackTrace {
|
|
245
239
|
constructor(stackTrace) {
|
|
246
|
-
super('Unreachable hosts - your application id may be incorrect. If the error persists, please
|
|
240
|
+
super('Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.', stackTrace, 'RetryError');
|
|
247
241
|
}
|
|
248
242
|
}
|
|
249
243
|
class ApiError extends ErrorWithStackTrace {
|
|
@@ -288,8 +282,7 @@ function serializeUrl(host, path, queryParameters) {
|
|
|
288
282
|
return url;
|
|
289
283
|
}
|
|
290
284
|
function serializeQueryParameters(parameters) {
|
|
291
|
-
|
|
292
|
-
return Object.keys(parameters).map(key => `${key}=${encodeURIComponent(isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key]).replaceAll('+', '%20')}`).join('&');
|
|
285
|
+
return Object.keys(parameters).filter(key => parameters[key] !== undefined).sort().map(key => `${key}=${encodeURIComponent(Object.prototype.toString.call(parameters[key]) === '[object Array]' ? parameters[key].join(',') : parameters[key]).replaceAll('+', '%20')}`).join('&');
|
|
293
286
|
}
|
|
294
287
|
function serializeData(request, requestOptions) {
|
|
295
288
|
if (request.method === 'GET' || request.data === undefined && requestOptions.data === undefined) {
|
|
@@ -694,7 +687,7 @@ function createXhrRequester() {
|
|
|
694
687
|
}
|
|
695
688
|
|
|
696
689
|
// 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.
|
|
697
|
-
const apiClientVersion = '5.0.0-beta.
|
|
690
|
+
const apiClientVersion = '5.0.0-beta.10';
|
|
698
691
|
function getDefaultHosts(appId) {
|
|
699
692
|
return [
|
|
700
693
|
{
|
|
@@ -990,6 +983,13 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
990
983
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
991
984
|
*/
|
|
992
985
|
getRecommendations(getRecommendationsParams, requestOptions) {
|
|
986
|
+
if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
|
|
987
|
+
const newSignatureRequest = {
|
|
988
|
+
requests: getRecommendationsParams,
|
|
989
|
+
};
|
|
990
|
+
// eslint-disable-next-line no-param-reassign
|
|
991
|
+
getRecommendationsParams = newSignatureRequest;
|
|
992
|
+
}
|
|
993
993
|
if (!getRecommendationsParams) {
|
|
994
994
|
throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');
|
|
995
995
|
}
|
|
@@ -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-beta.
|
|
5
|
+
const apiClientVersion = '5.0.0-beta.10';
|
|
6
6
|
function getDefaultHosts(appId) {
|
|
7
7
|
return [
|
|
8
8
|
{
|
|
@@ -298,6 +298,13 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
298
298
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
299
299
|
*/
|
|
300
300
|
getRecommendations(getRecommendationsParams, requestOptions) {
|
|
301
|
+
if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
|
|
302
|
+
const newSignatureRequest = {
|
|
303
|
+
requests: getRecommendationsParams,
|
|
304
|
+
};
|
|
305
|
+
// eslint-disable-next-line no-param-reassign
|
|
306
|
+
getRecommendationsParams = newSignatureRequest;
|
|
307
|
+
}
|
|
301
308
|
if (!getRecommendationsParams) {
|
|
302
309
|
throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');
|
|
303
310
|
}
|
package/dist/recommend.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! recommend.umd.js | 5.0.0-beta.
|
|
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 s(){return JSON.parse(a().getItem(r)||"{}")}function o(e){a().setItem(r,JSON.stringify(e))}return{get:(t,r,a={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>(function(){const t=e.timeToLive?1e3*e.timeToLive:null,r=s(),a=Object.fromEntries(Object.entries(r).filter((([,e])=>void 0!==e.timestamp)));if(o(a),!t)return;o(Object.fromEntries(Object.entries(a).filter((([,e])=>{const r=(new Date).getTime();return!(e.timestamp+t<r)}))))}(),s()[JSON.stringify(t)]))).then((e=>Promise.all([e?e.value:r(),void 0!==e]))).then((([e,t])=>Promise.all([e,t||a.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const o=s();return o[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},a().setItem(r,JSON.stringify(o)),t})),delete:e=>Promise.resolve().then((()=>{const t=s();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,s,o={miss:()=>Promise.resolve()})=>a.get(e,s,o).catch((()=>r({caches:t}).get(e,s,o))),set:(e,s)=>a.set(e,s).catch((()=>r({caches:t}).set(e,s))),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,s={miss:()=>Promise.resolve()}){const o=JSON.stringify(r);if(o in t)return Promise.resolve(e.serializable?JSON.parse(t[o]):t[o]);const n=a();return n.then((e=>s.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 s=12e4;function o(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>s},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=s}}}function n(e){var t=function(e,t){if("object"!=typeof e||!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:t+""}function i(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class c extends Error{constructor(e,t){super(e),i(this,"name","AlgoliaError"),t&&(this.name=t)}}class u extends c{constructor(e,t,r){super(e,r),i(this,"stackTrace",void 0),this.stackTrace=t}}class l extends u{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, please create a ticket at https://support.algolia.com/ sharing steps we can use to reproduce the issue.",e,"RetryError")}}class m extends u{constructor(e,t,r,a="ApiError"){super(e,r,a),i(this,"status",void 0),this.status=t}}class d extends c{constructor(e,t){super(e,"DeserializationError"),i(this,"response",void 0),this.response=t}}class h extends m{constructor(e,t,r,a){super(e,t,a,"DetailedApiError"),i(this,"error",void 0),this.error=r}}function p(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]).replaceAll("+","%20")}`)).join("&")}(r);let s=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${"/"===t.charAt(0)?t.substring(1):t}`;return a.length&&(s+=`?${a}`),s}function g(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 f({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:a,algoliaAgent:s,timeouts:n,requester:i,requestsCache:c,responsesCache:u}){async function f(c,u,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,u),P=function(e,t,r){const a={Accept:"application/json",...e,...t,...r},s={};return Object.keys(a).forEach((e=>{const t=a[e];s[e.toLowerCase()]=t})),s}(r,c.headers,u.headers),q="GET"===c.method?{...c.data,...u.data}:{},b={...a,...c.queryParameters,...q};if(s.value&&(b["x-algolia-agent"]=s.value),u&&u.queryParameters)for(const e of Object.keys(u.queryParameters))u.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(u.queryParameters[e])?b[e]=u.queryParameters[e].toString():b[e]=u.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=>g(e)))}(w));let s=f?u.timeouts?.read||n.read:u.timeouts?.write||n.write;const q={data:y,headers:P,method:c.method,url:p(a,c.path,b),connectTimeout:r(v,u.timeouts?.connect||n.connect),responseTimeout:r(v,s)},T=t=>{const r={request:q,response:t,host:a,triesLeft:e.length};return w.push(r),r},O=await i.send(q);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&!~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(O)){const s=T(O);return O.isTimedOut&&v++,console.log("Retryable failure",g(s)),await t.set(a,o(a,O.isTimedOut?"timed out":"down")),R(e,r)}if(function({status:e}){return 2==~~(e/100)}(O))return function(e){try{return JSON.parse(e.content)}catch(t){throw new d(t.message,e)}}(O);throw T(O),function({content:e,status:t},r){try{const a=JSON.parse(e);return"error"in a?new h(a.message,t,a.error,r):new m(a.message,t,r)}catch(e){}return new m(e,t,r)}(O,w)},T=e.filter((e=>"readWrite"===e.accept||(f?"read"===e.accept:"write"===e.accept))),O=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(o(e))))))),a=r.filter((e=>e.isUp())),s=r.filter((e=>e.isTimedOut())),n=[...a,...s];return{hosts:n.length>0?n:e,getTimeout:(e,t)=>(0===s.length&&0===e?1:s.length+3+e)*t}}(T);return R([...O.hosts].reverse(),O.getTimeout)}return{hostsCache:t,requester:i,timeouts:n,algoliaAgent:s,baseHeaders:r,baseQueryParameters:a,hosts:e,request:function(e,t={}){const s=e.useReadTransporter||"GET"===e.method;if(!s)return f(e,t,s);const o=()=>f(e,t);if(!0!==(t.cacheable||e.cacheable))return o();const n={request:e,requestOptions:t,transporter:{queryParameters:a,headers:r}};return u.get(n,(()=>c.get(n,(()=>c.set(n,o()).then((e=>Promise.all([c.delete(n),e])),(e=>Promise.all([c.delete(n),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>u.set(n,e)})},requestsCache:c,responsesCache:u}}function w({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 y="5.0.0-beta.1";function P(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)),s=e[r];t[r]=e[a],t[a]=s}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=y,e.recommendClient=function(e,s,o){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!s||"string"!=typeof s)throw new Error("`apiKey` is missing.");return function({appId:e,apiKey:t,authMode:r,algoliaAgents:a,...s}){const o=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=f({hosts:P(e),...s,algoliaAgent:w({algoliaAgents:a,client:"Recommend",version:y}),baseHeaders:{"content-type":"text/plain",...o.headers(),...s.baseHeaders},baseQueryParameters:{...o.queryParameters(),...s.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})},customDelete({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const a={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return n.request(a,r)},customGet({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const a={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return n.request(a,r)},customPost({path:e,parameters:t,body:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const s={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(s,a)},customPut({path:e,parameters:t,body:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const s={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(s,a)},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 s={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(s,a)},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 s={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(s,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 s={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(s,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)},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 s={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(s,a)}}}({appId:e,apiKey:s,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),s=a(e.connectTimeout,"Connection timeout");let o;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===o&&(clearTimeout(s),o=a(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(s),clearTimeout(o),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(s),clearTimeout(o),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:`${y}-${e}`}),a()]}),...o})}}));
|
|
1
|
+
/*! recommend.umd.js | 5.0.0-beta.10 | © 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)||"{}")}function s(e){a().setItem(r,JSON.stringify(e))}return{get:(t,r,a={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>(function(){const t=e.timeToLive?1e3*e.timeToLive:null,r=o(),a=Object.fromEntries(Object.entries(r).filter((([,e])=>void 0!==e.timestamp)));if(s(a),!t)return;s(Object.fromEntries(Object.entries(a).filter((([,e])=>{const r=(new Date).getTime();return!(e.timestamp+t<r)}))))}(),o()[JSON.stringify(t)]))).then((e=>Promise.all([e?e.value:r(),void 0!==e]))).then((([e,t])=>Promise.all([e,t||a.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const s=o();return s[JSON.stringify(e)]={timestamp:(new Date).getTime(),value: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||!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: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, please reach out to the Algolia Support team: https://alg.li/support.",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=(o=r,Object.keys(o).filter((e=>void 0!==o[e])).sort().map((e=>`${e}=${encodeURIComponent("[object Array]"===Object.prototype.toString.call(o[e])?o[e].join(","):o[e]).replaceAll("+","%20")}`)).join("&"));var o;let s=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${"/"===t.charAt(0)?t.substring(1):t}`;return a.length&&(s+=`?${a}`),s}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}:{},v={...a,...c.queryParameters,...q};if(o.value&&(v["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])?v[e]=g.queryParameters[e].toString():v[e]=g.queryParameters[e];let b=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=f?g.timeouts?.read||n.read:g.timeouts?.write||n.write;const q={data:y,headers:P,method:c.method,url:h(a,c.path,v),connectTimeout:r(b,g.timeouts?.connect||n.connect),responseTimeout:r(b,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&&!~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(E)){const o=T(E);return E.isTimedOut&&b++,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-beta.10";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})},customDelete({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const a={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return n.request(a,r)},customGet({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const a={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return n.request(a,r)},customPost({path:e,parameters:t,body:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const o={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(o,a)},customPut({path:e,parameters:t,body:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const o={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(o,a)},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)},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&&Array.isArray(e)&&(e={requests:e}),!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)},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,12 +1,12 @@
|
|
|
1
1
|
import type { CreateClientOptions, RequestOptions } from '@algolia/client-common';
|
|
2
|
-
import type { CustomDeleteProps, CustomGetProps, CustomPostProps, CustomPutProps, DeleteRecommendRuleProps, GetRecommendRuleProps, GetRecommendStatusProps, SearchRecommendRulesProps } from '../model/clientMethodProps';
|
|
2
|
+
import type { CustomDeleteProps, CustomGetProps, CustomPostProps, CustomPutProps, DeleteRecommendRuleProps, GetRecommendRuleProps, GetRecommendStatusProps, LegacyGetRecommendationsParams, SearchRecommendRulesProps } from '../model/clientMethodProps';
|
|
3
3
|
import type { DeletedAtResponse } from '../model/deletedAtResponse';
|
|
4
4
|
import type { GetRecommendTaskResponse } from '../model/getRecommendTaskResponse';
|
|
5
5
|
import type { GetRecommendationsParams } from '../model/getRecommendationsParams';
|
|
6
6
|
import type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';
|
|
7
7
|
import type { RecommendRule } from '../model/recommendRule';
|
|
8
8
|
import type { SearchRecommendRulesResponse } from '../model/searchRecommendRulesResponse';
|
|
9
|
-
export declare const apiClientVersion = "5.0.0-beta.
|
|
9
|
+
export declare const apiClientVersion = "5.0.0-beta.10";
|
|
10
10
|
export declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
|
11
11
|
transporter: import("@algolia/client-common").Transporter;
|
|
12
12
|
/**
|
|
@@ -114,7 +114,7 @@ export declare function createRecommendClient({ appId: appIdOption, apiKey: apiK
|
|
|
114
114
|
* @param getRecommendationsParams - The getRecommendationsParams object.
|
|
115
115
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
116
116
|
*/
|
|
117
|
-
getRecommendations(getRecommendationsParams: GetRecommendationsParams, requestOptions?: RequestOptions): Promise<GetRecommendationsResponse>;
|
|
117
|
+
getRecommendations(getRecommendationsParams: GetRecommendationsParams | LegacyGetRecommendationsParams, requestOptions?: RequestOptions): Promise<GetRecommendationsResponse>;
|
|
118
118
|
/**
|
|
119
119
|
* Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.
|
|
120
120
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recommendClient.d.ts","sourceRoot":"","sources":["../../src/recommendClient.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,mBAAmB,EAKnB,cAAc,EACf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,cAAc,EACd,wBAAwB,EACxB,qBAAqB,EACrB,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAE1F,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"recommendClient.d.ts","sourceRoot":"","sources":["../../src/recommendClient.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,mBAAmB,EAKnB,cAAc,EACf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,iBAAiB,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,CAAC,CAAC;IAsB/B;;;;;;;;;;;OAWG;wDAE+B,wBAAwB,mBACvC,cAAc,GAC9B,OAAO,CAAC,iBAAiB,CAAC;IAqC7B;;;;;;;;;;;OAWG;qDAE+B,qBAAqB,mBACpC,cAAc,GAC9B,OAAO,CAAC,aAAa,CAAC;IAqCzB;;;;;;;;;;;OAWG;qDAE6B,uBAAuB,mBACpC,cAAc,GAC9B,OAAO,CAAC,wBAAwB,CAAC;IAoCpC;;;;;;;;OAQG;iDAGG,wBAAwB,GACxB,8BAA8B,mBACjB,cAAc,GAC9B,OAAO,CAAC,0BAA0B,CAAC;IAuCtC;;;;;;;;;;;OAWG;4EAME,yBAAyB,mBACX,cAAc,GAC9B,OAAO,CAAC,4BAA4B,CAAC;EAiC3C"}
|
|
@@ -53,11 +53,6 @@ export type BaseSearchResponse = Record<string, any> & {
|
|
|
53
53
|
*/
|
|
54
54
|
facets_stats?: Record<string, FacetsStats>;
|
|
55
55
|
|
|
56
|
-
/**
|
|
57
|
-
* Number of hits per page.
|
|
58
|
-
*/
|
|
59
|
-
hitsPerPage: number;
|
|
60
|
-
|
|
61
56
|
/**
|
|
62
57
|
* Index name used for the query.
|
|
63
58
|
*/
|
|
@@ -73,26 +68,11 @@ export type BaseSearchResponse = Record<string, any> & {
|
|
|
73
68
|
*/
|
|
74
69
|
message?: string;
|
|
75
70
|
|
|
76
|
-
/**
|
|
77
|
-
* Number of results (hits).
|
|
78
|
-
*/
|
|
79
|
-
nbHits: number;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Number of pages of results.
|
|
83
|
-
*/
|
|
84
|
-
nbPages: number;
|
|
85
|
-
|
|
86
71
|
/**
|
|
87
72
|
* Number of hits selected and sorted by the relevant sort algorithm.
|
|
88
73
|
*/
|
|
89
74
|
nbSortedHits?: number;
|
|
90
75
|
|
|
91
|
-
/**
|
|
92
|
-
* Page of search results to retrieve.
|
|
93
|
-
*/
|
|
94
|
-
page: number;
|
|
95
|
-
|
|
96
76
|
/**
|
|
97
77
|
* Post-[normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/#what-does-normalization-mean) query string that will be searched.
|
|
98
78
|
*/
|
|
@@ -128,9 +108,9 @@ export type BaseSearchResponse = Record<string, any> & {
|
|
|
128
108
|
serverUsed?: string;
|
|
129
109
|
|
|
130
110
|
/**
|
|
131
|
-
* An object with custom data. You can store up to
|
|
111
|
+
* An object with custom data. You can store up to 32kB as custom data.
|
|
132
112
|
*/
|
|
133
|
-
userData?: any
|
|
113
|
+
userData?: Record<string, any>;
|
|
134
114
|
|
|
135
115
|
/**
|
|
136
116
|
* Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/).
|
|
@@ -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 { RecommendModels } from './recommendModels';
|
|
4
|
+
import type { RecommendationsRequest } from './recommendationsRequest';
|
|
4
5
|
import type { SearchRecommendRulesParams } from './searchRecommendRulesParams';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -121,6 +122,13 @@ export type GetRecommendStatusProps = {
|
|
|
121
122
|
taskID: number;
|
|
122
123
|
};
|
|
123
124
|
|
|
125
|
+
/**
|
|
126
|
+
* Recommend method signature compatible with the `algoliasearch` v4 package. When using this signature, extra computation will be required to make it match the new signature.
|
|
127
|
+
*
|
|
128
|
+
* @deprecated This signature will be removed from the next major version, we recommend using the `GetRecommendationsParams` type for performances and future proof reasons.
|
|
129
|
+
*/
|
|
130
|
+
export type LegacyGetRecommendationsParams = RecommendationsRequest[];
|
|
131
|
+
|
|
124
132
|
/**
|
|
125
133
|
* Properties for the `searchRecommendRules` method.
|
|
126
134
|
*/
|
package/model/facetFilters.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
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
|
-
import type { MixedSearchFilters } from './mixedSearchFilters';
|
|
4
|
-
|
|
5
3
|
/**
|
|
6
4
|
* Filter the search by facet values, so that only records with the same facet values are retrieved. **Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.** - `[filter1, filter2]` is interpreted as `filter1 AND filter2`. - `[[filter1, filter2], filter3]` is interpreted as `filter1 OR filter2 AND filter3`. - `facet:-value` is interpreted as `NOT facet:value`. While it\'s best to avoid attributes that start with a `-`, you can still filter them by escaping with a backslash: `facet:\\-value`.
|
|
7
5
|
*/
|
|
8
|
-
export type FacetFilters =
|
|
6
|
+
export type FacetFilters = FacetFilters[] | string;
|
package/model/index.ts
CHANGED
|
@@ -39,7 +39,6 @@ export * from './lookingSimilarModel';
|
|
|
39
39
|
export * from './lookingSimilarQuery';
|
|
40
40
|
export * from './matchLevel';
|
|
41
41
|
export * from './matchedGeoLocation';
|
|
42
|
-
export * from './mixedSearchFilters';
|
|
43
42
|
export * from './mode';
|
|
44
43
|
export * from './numericFilters';
|
|
45
44
|
export * from './optionalFilters';
|
|
@@ -63,12 +62,14 @@ export * from './recommendedForYouQuery';
|
|
|
63
62
|
export * from './redirect';
|
|
64
63
|
export * from './redirectRuleIndexMetadata';
|
|
65
64
|
export * from './redirectRuleIndexMetadataData';
|
|
65
|
+
export * from './redirectURL';
|
|
66
66
|
export * from './relatedModel';
|
|
67
67
|
export * from './relatedProducts';
|
|
68
68
|
export * from './relatedQuery';
|
|
69
69
|
export * from './removeStopWords';
|
|
70
70
|
export * from './removeWordsIfNoResults';
|
|
71
71
|
export * from './renderingContent';
|
|
72
|
+
export * from './searchPagination';
|
|
72
73
|
export * from './searchParams';
|
|
73
74
|
export * from './searchParamsObject';
|
|
74
75
|
export * from './searchParamsQuery';
|
package/model/numericFilters.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
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
|
-
import type { MixedSearchFilters } from './mixedSearchFilters';
|
|
4
|
-
|
|
5
3
|
/**
|
|
6
4
|
* Filter by numeric facets. **Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.** You can use numeric comparison operators: `<`, `<=`, `=`, `!=`, `>`, `>=`. Comparsions are precise up to 3 decimals. You can also provide ranges: `facet:<lower> TO <upper>`. The range includes the lower and upper boundaries. The same combination rules apply as for `facetFilters`.
|
|
7
5
|
*/
|
|
8
|
-
export type NumericFilters =
|
|
6
|
+
export type NumericFilters = NumericFilters[] | string;
|
package/model/optionalFilters.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
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
|
-
import type { MixedSearchFilters } from './mixedSearchFilters';
|
|
4
|
-
|
|
5
3
|
/**
|
|
6
4
|
* Filters to promote or demote records in the search results. Optional filters work like facet filters, but they don\'t exclude records from the search results. Records that match the optional filter rank before records that don\'t match. If you\'re using a negative filter `facet:-value`, matching records rank after records that don\'t match. - Optional filters don\'t work on virtual replicas. - Optional filters are applied _after_ sort-by attributes. - Optional filters don\'t work with numeric attributes.
|
|
7
5
|
*/
|
|
8
|
-
export type OptionalFilters =
|
|
6
|
+
export type OptionalFilters = OptionalFilters[] | string;
|
package/model/rankingInfo.ts
CHANGED
|
@@ -10,7 +10,7 @@ export type RankingInfo = {
|
|
|
10
10
|
/**
|
|
11
11
|
* Whether a filter matched the query.
|
|
12
12
|
*/
|
|
13
|
-
filters
|
|
13
|
+
filters?: number;
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Position of the first matched word in the best matching attribute of the record.
|
|
@@ -44,7 +44,7 @@ export type RankingInfo = {
|
|
|
44
44
|
/**
|
|
45
45
|
* Whether the record was promoted by a rule.
|
|
46
46
|
*/
|
|
47
|
-
promoted
|
|
47
|
+
promoted?: boolean;
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Number of words between multiple matches in the query plus 1. For single word queries, `proximityDistance` is 0.
|
|
@@ -59,7 +59,7 @@ export type RankingInfo = {
|
|
|
59
59
|
/**
|
|
60
60
|
* Number of matched words.
|
|
61
61
|
*/
|
|
62
|
-
words
|
|
62
|
+
words?: number;
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* Whether the record is re-ranked.
|
|
@@ -1,8 +1,6 @@
|
|
|
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
|
-
import type { MixedSearchFilters } from './mixedSearchFilters';
|
|
4
|
-
|
|
5
3
|
/**
|
|
6
4
|
* Restrict [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/) to records that match these filters.
|
|
7
5
|
*/
|
|
8
|
-
export type ReRankingApplyFilter =
|
|
6
|
+
export type ReRankingApplyFilter = ReRankingApplyFilter[] | string;
|
|
@@ -2,5 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import type { BaseSearchResponse } from './baseSearchResponse';
|
|
4
4
|
import type { RecommendationsHits } from './recommendationsHits';
|
|
5
|
+
import type { SearchPagination } from './searchPagination';
|
|
5
6
|
|
|
6
|
-
export type RecommendationsResults = BaseSearchResponse &
|
|
7
|
+
export type RecommendationsResults = BaseSearchResponse &
|
|
8
|
+
RecommendationsHits &
|
|
9
|
+
SearchPagination;
|
package/model/redirect.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type { RedirectRuleIndexMetadata } from './redirectRuleIndexMetadata';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* [Redirect results to a URL](https://www.algolia.com/doc/guides/managing-results/rules/merchandising-and-promoting/how-to/redirects/).
|
|
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
9
|
index?: RedirectRuleIndexMetadata[];
|
|
@@ -1,3 +1,8 @@
|
|
|
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
|
+
* The redirect rule container.
|
|
5
|
+
*/
|
|
6
|
+
export type RedirectURL = {
|
|
7
|
+
url?: string;
|
|
8
|
+
};
|
|
@@ -1,10 +1,13 @@
|
|
|
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 { FacetOrdering } from './facetOrdering';
|
|
4
|
+
import type { RedirectURL } from './redirectURL';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* 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.
|
|
7
8
|
*/
|
|
8
9
|
export type RenderingContent = {
|
|
9
10
|
facetOrdering?: FacetOrdering;
|
|
11
|
+
|
|
12
|
+
redirect?: RedirectURL;
|
|
10
13
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
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 SearchPagination = {
|
|
4
|
+
/**
|
|
5
|
+
* Page of search results to retrieve.
|
|
6
|
+
*/
|
|
7
|
+
page: number;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Number of results (hits).
|
|
11
|
+
*/
|
|
12
|
+
nbHits: number;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Number of pages of results.
|
|
16
|
+
*/
|
|
17
|
+
nbPages: number;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Number of hits per page.
|
|
21
|
+
*/
|
|
22
|
+
hitsPerPage: number;
|
|
23
|
+
};
|
package/model/tagFilters.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
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
|
-
import type { MixedSearchFilters } from './mixedSearchFilters';
|
|
4
|
-
|
|
5
3
|
/**
|
|
6
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`.
|
|
7
5
|
*/
|
|
8
|
-
export type TagFilters =
|
|
6
|
+
export type TagFilters = TagFilters[] | string;
|
package/model/value.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@algolia/recommend",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.10",
|
|
4
4
|
"description": "JavaScript client for recommend",
|
|
5
|
-
"repository":
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/algolia/algoliasearch-client-javascript.git"
|
|
8
|
+
},
|
|
6
9
|
"license": "MIT",
|
|
7
10
|
"author": "Algolia",
|
|
8
11
|
"type": "module",
|
|
@@ -39,14 +42,14 @@
|
|
|
39
42
|
"clean": "rm -rf ./dist || true"
|
|
40
43
|
},
|
|
41
44
|
"dependencies": {
|
|
42
|
-
"@algolia/client-common": "5.0.0-beta.
|
|
43
|
-
"@algolia/requester-browser-xhr": "5.0.0-beta.
|
|
44
|
-
"@algolia/requester-node-http": "5.0.0-beta.
|
|
45
|
+
"@algolia/client-common": "5.0.0-beta.11",
|
|
46
|
+
"@algolia/requester-browser-xhr": "5.0.0-beta.11",
|
|
47
|
+
"@algolia/requester-node-http": "5.0.0-beta.11"
|
|
45
48
|
},
|
|
46
49
|
"devDependencies": {
|
|
47
|
-
"@types/node": "20.
|
|
48
|
-
"rollup": "4.
|
|
49
|
-
"typescript": "5.
|
|
50
|
+
"@types/node": "20.14.10",
|
|
51
|
+
"rollup": "4.18.0",
|
|
52
|
+
"typescript": "5.5.3"
|
|
50
53
|
},
|
|
51
54
|
"engines": {
|
|
52
55
|
"node": ">= 14.0.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mixedSearchFilters.d.ts","sourceRoot":"","sources":["../../model/mixedSearchFilters.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,kBAAkB,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC"}
|