@algolia/recommend 5.0.0-alpha.110 → 5.0.0-alpha.112
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/builds/browser.d.ts +1 -1
- package/dist/builds/node.d.ts +1 -1
- package/dist/model/autoFacetFilter.d.ts +14 -0
- package/dist/model/autoFacetFilter.d.ts.map +1 -0
- package/dist/model/baseRecommendRequest.d.ts +6 -4
- package/dist/model/baseRecommendRequest.d.ts.map +1 -1
- package/dist/model/baseSearchParamsWithoutQuery.d.ts +5 -4
- package/dist/model/baseSearchParamsWithoutQuery.d.ts.map +1 -1
- package/dist/model/boughtTogetherQuery.d.ts +4 -0
- package/dist/model/boughtTogetherQuery.d.ts.map +1 -0
- package/dist/model/clientMethodProps.d.ts +5 -5
- package/dist/model/condition.d.ts +5 -12
- package/dist/model/condition.d.ts.map +1 -1
- package/dist/model/consequence.d.ts +9 -17
- package/dist/model/consequence.d.ts.map +1 -1
- package/dist/model/deletedAtResponse.d.ts +1 -1
- package/dist/model/exactOnSingleWordQuery.d.ts +1 -1
- package/dist/model/fallbackParams.d.ts +3 -0
- package/dist/model/fallbackParams.d.ts.map +1 -0
- package/dist/model/fbtModel.d.ts +5 -0
- package/dist/model/fbtModel.d.ts.map +1 -0
- package/dist/model/frequentlyBoughtTogether.d.ts +9 -0
- package/dist/model/frequentlyBoughtTogether.d.ts.map +1 -0
- package/dist/model/getRecommendationsParams.d.ts +2 -2
- package/dist/model/hideConsequenceObject.d.ts +10 -0
- package/dist/model/hideConsequenceObject.d.ts.map +1 -0
- package/dist/model/index.d.ts +20 -23
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/indexSettingsAsSearchParams.d.ts +10 -10
- package/dist/model/lookingSimilar.d.ts +11 -0
- package/dist/model/lookingSimilar.d.ts.map +1 -0
- package/dist/model/lookingSimilarModel.d.ts +5 -0
- package/dist/model/lookingSimilarModel.d.ts.map +1 -0
- package/dist/model/lookingSimilarQuery.d.ts +4 -0
- package/dist/model/lookingSimilarQuery.d.ts.map +1 -0
- package/dist/model/paramsConsequence.d.ts +19 -0
- package/dist/model/paramsConsequence.d.ts.map +1 -0
- package/dist/model/promoteConsequenceObject.d.ts +14 -0
- package/dist/model/promoteConsequenceObject.d.ts.map +1 -0
- package/dist/model/reRankingApplyFilter.d.ts +1 -1
- package/dist/model/recommendRule.d.ts +24 -0
- package/dist/model/recommendRule.d.ts.map +1 -0
- package/dist/model/recommendRuleMetadata.d.ts +10 -0
- package/dist/model/recommendRuleMetadata.d.ts.map +1 -0
- package/dist/model/recommendationsHits.d.ts +0 -8
- package/dist/model/recommendationsHits.d.ts.map +1 -1
- package/dist/model/recommendationsRequest.d.ts +4 -2
- package/dist/model/recommendationsRequest.d.ts.map +1 -1
- package/dist/model/recommendedForYou.d.ts +7 -0
- package/dist/model/recommendedForYou.d.ts.map +1 -0
- package/dist/model/recommendedForYouModel.d.ts +1 -1
- package/dist/model/recommendedForYouQuery.d.ts +2 -2
- package/dist/model/recommendedForYouQuery.d.ts.map +1 -1
- package/dist/model/relatedModel.d.ts +5 -0
- package/dist/model/relatedModel.d.ts.map +1 -0
- package/dist/model/relatedProducts.d.ts +11 -0
- package/dist/model/relatedProducts.d.ts.map +1 -0
- package/dist/model/relatedQuery.d.ts +4 -0
- package/dist/model/relatedQuery.d.ts.map +1 -0
- package/dist/model/removeWordsIfNoResults.d.ts +1 -1
- package/dist/model/searchParams.d.ts +3 -0
- package/dist/model/searchParams.d.ts.map +1 -0
- package/dist/model/searchParamsObject.d.ts +3 -0
- package/dist/model/searchParamsObject.d.ts.map +1 -1
- package/dist/model/searchRecommendRulesParams.d.ts +16 -4
- package/dist/model/searchRecommendRulesParams.d.ts.map +1 -1
- package/dist/model/searchRecommendRulesResponse.d.ts +3 -3
- package/dist/model/searchRecommendRulesResponse.d.ts.map +1 -1
- package/dist/model/sortRemainingBy.d.ts +1 -1
- package/dist/model/trendingFacetHit.d.ts +2 -2
- package/dist/model/trendingFacets.d.ts +11 -0
- package/dist/model/trendingFacets.d.ts.map +1 -0
- package/dist/model/trendingFacetsModel.d.ts +1 -1
- package/dist/model/trendingFacetsQuery.d.ts +2 -2
- package/dist/model/trendingFacetsQuery.d.ts.map +1 -1
- package/dist/model/trendingItems.d.ts +15 -0
- package/dist/model/trendingItems.d.ts.map +1 -0
- package/dist/model/trendingItemsModel.d.ts +1 -1
- package/dist/model/trendingItemsQuery.d.ts +2 -2
- package/dist/model/trendingItemsQuery.d.ts.map +1 -1
- package/dist/recommend.cjs +11 -11
- package/dist/recommend.esm.browser.js +13 -16
- package/dist/recommend.esm.node.js +11 -11
- package/dist/recommend.umd.js +2 -2
- package/dist/src/recommendClient.d.ts +13 -13
- package/dist/src/recommendClient.d.ts.map +1 -1
- package/model/autoFacetFilter.ts +16 -0
- package/model/baseRecommendRequest.ts +8 -4
- package/model/baseSearchParamsWithoutQuery.ts +5 -4
- package/model/{recommendationsQuery.ts → boughtTogetherQuery.ts} +3 -3
- package/model/clientMethodProps.ts +5 -5
- package/model/condition.ts +5 -16
- package/model/consequence.ts +9 -19
- package/model/deletedAtResponse.ts +1 -1
- package/model/exactOnSingleWordQuery.ts +1 -1
- package/model/{editType.ts → fallbackParams.ts} +3 -4
- package/model/fbtModel.ts +6 -0
- package/model/{consequenceHide.ts → frequentlyBoughtTogether.ts} +5 -4
- package/model/getRecommendationsParams.ts +2 -2
- package/model/{promoteObjectID.ts → hideConsequenceObject.ts} +3 -8
- package/model/index.ts +20 -23
- package/model/indexSettingsAsSearchParams.ts +10 -10
- package/model/lookingSimilar.ts +15 -0
- package/model/lookingSimilarModel.ts +6 -0
- package/model/lookingSimilarQuery.ts +6 -0
- package/model/paramsConsequence.ts +23 -0
- package/model/promoteConsequenceObject.ts +16 -0
- package/model/reRankingApplyFilter.ts +1 -1
- package/model/{ruleResponse.ts → recommendRule.ts} +7 -10
- package/model/{ruleResponseMetadata.ts → recommendRuleMetadata.ts} +5 -2
- package/model/recommendationsHits.ts +0 -10
- package/model/recommendationsRequest.ts +6 -2
- package/model/{baseRecommendedForYouQuery.ts → recommendedForYou.ts} +3 -5
- package/model/recommendedForYouModel.ts +1 -1
- package/model/recommendedForYouQuery.ts +2 -3
- package/model/relatedModel.ts +6 -0
- package/model/relatedProducts.ts +15 -0
- package/model/relatedQuery.ts +6 -0
- package/model/removeWordsIfNoResults.ts +1 -1
- package/model/{recommendationModels.ts → searchParams.ts} +3 -4
- package/model/searchParamsObject.ts +3 -0
- package/model/searchRecommendRulesParams.ts +19 -4
- package/model/searchRecommendRulesResponse.ts +3 -3
- package/model/sortRemainingBy.ts +1 -1
- package/model/trendingFacetHit.ts +2 -2
- package/model/{baseTrendingFacetsQuery.ts → trendingFacets.ts} +7 -4
- package/model/trendingFacetsModel.ts +1 -1
- package/model/trendingFacetsQuery.ts +2 -3
- package/model/trendingItems.ts +20 -0
- package/model/trendingItemsModel.ts +1 -1
- package/model/trendingItemsQuery.ts +2 -2
- package/package.json +7 -7
- package/dist/model/anchoring.d.ts +0 -5
- package/dist/model/anchoring.d.ts.map +0 -1
- package/dist/model/automaticFacetFilter.d.ts +0 -18
- package/dist/model/automaticFacetFilter.d.ts.map +0 -1
- package/dist/model/automaticFacetFilters.d.ts +0 -6
- package/dist/model/automaticFacetFilters.d.ts.map +0 -1
- package/dist/model/baseRecommendationsQuery.d.ts +0 -12
- package/dist/model/baseRecommendationsQuery.d.ts.map +0 -1
- package/dist/model/baseRecommendedForYouQuery.d.ts +0 -8
- package/dist/model/baseRecommendedForYouQuery.d.ts.map +0 -1
- package/dist/model/baseRecommendedForYouQueryParameters.d.ts +0 -7
- package/dist/model/baseRecommendedForYouQueryParameters.d.ts.map +0 -1
- package/dist/model/baseTrendingFacetsQuery.d.ts +0 -9
- package/dist/model/baseTrendingFacetsQuery.d.ts.map +0 -1
- package/dist/model/baseTrendingItemsQuery.d.ts +0 -16
- package/dist/model/baseTrendingItemsQuery.d.ts.map +0 -1
- package/dist/model/consequenceHide.d.ts +0 -10
- package/dist/model/consequenceHide.d.ts.map +0 -1
- package/dist/model/consequenceParams.d.ts +0 -5
- package/dist/model/consequenceParams.d.ts.map +0 -1
- package/dist/model/consequenceQuery.d.ts +0 -6
- package/dist/model/consequenceQuery.d.ts.map +0 -1
- package/dist/model/consequenceQueryObject.d.ts +0 -12
- package/dist/model/consequenceQueryObject.d.ts.map +0 -1
- package/dist/model/edit.d.ts +0 -13
- package/dist/model/edit.d.ts.map +0 -1
- package/dist/model/editType.d.ts +0 -5
- package/dist/model/editType.d.ts.map +0 -1
- package/dist/model/params.d.ts +0 -13
- package/dist/model/params.d.ts.map +0 -1
- package/dist/model/promote.d.ts +0 -4
- package/dist/model/promote.d.ts.map +0 -1
- package/dist/model/promoteObjectID.d.ts +0 -14
- package/dist/model/promoteObjectID.d.ts.map +0 -1
- package/dist/model/promoteObjectIDs.d.ts +0 -14
- package/dist/model/promoteObjectIDs.d.ts.map +0 -1
- package/dist/model/recommendationModels.d.ts +0 -5
- package/dist/model/recommendationModels.d.ts.map +0 -1
- package/dist/model/recommendationsQuery.d.ts +0 -4
- package/dist/model/recommendationsQuery.d.ts.map +0 -1
- package/dist/model/recommendedForYouQueryParameters.d.ts +0 -4
- package/dist/model/recommendedForYouQueryParameters.d.ts.map +0 -1
- package/dist/model/ruleResponse.d.ts +0 -27
- package/dist/model/ruleResponse.d.ts.map +0 -1
- package/dist/model/ruleResponseMetadata.d.ts +0 -7
- package/dist/model/ruleResponseMetadata.d.ts.map +0 -1
- package/model/anchoring.ts +0 -6
- package/model/automaticFacetFilter.ts +0 -21
- package/model/automaticFacetFilters.ts +0 -8
- package/model/baseRecommendationsQuery.ts +0 -17
- package/model/baseRecommendedForYouQueryParameters.ts +0 -8
- package/model/baseTrendingItemsQuery.ts +0 -22
- package/model/consequenceParams.ts +0 -9
- package/model/consequenceQuery.ts +0 -8
- package/model/consequenceQueryObject.ts +0 -15
- package/model/edit.ts +0 -17
- package/model/params.ts +0 -18
- package/model/promote.ts +0 -6
- package/model/promoteObjectIDs.ts +0 -16
- package/model/recommendedForYouQueryParameters.ts +0 -7
|
@@ -460,16 +460,13 @@ function createTransporter({
|
|
|
460
460
|
if (host === undefined) {
|
|
461
461
|
throw new RetryError(stackTraceWithoutCredentials(stackTrace));
|
|
462
462
|
}
|
|
463
|
-
let responseTimeout = requestOptions.
|
|
464
|
-
if (responseTimeout === undefined) {
|
|
465
|
-
responseTimeout = isRead ? timeouts.read : timeouts.write;
|
|
466
|
-
}
|
|
463
|
+
let responseTimeout = isRead ? requestOptions.timeouts?.read || timeouts.read : requestOptions.timeouts?.write || timeouts.write;
|
|
467
464
|
const payload = {
|
|
468
465
|
data,
|
|
469
466
|
headers,
|
|
470
467
|
method: request.method,
|
|
471
468
|
url: serializeUrl(host, request.path, queryParameters),
|
|
472
|
-
connectTimeout: getTimeout(timeoutsCount, timeouts.connect),
|
|
469
|
+
connectTimeout: getTimeout(timeoutsCount, requestOptions.timeouts?.connect || timeouts.connect),
|
|
473
470
|
responseTimeout: getTimeout(timeoutsCount, responseTimeout)
|
|
474
471
|
};
|
|
475
472
|
/**
|
|
@@ -697,7 +694,7 @@ function createXhrRequester() {
|
|
|
697
694
|
}
|
|
698
695
|
|
|
699
696
|
// 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.
|
|
700
|
-
const apiClientVersion = '5.0.0-alpha.
|
|
697
|
+
const apiClientVersion = '5.0.0-alpha.112';
|
|
701
698
|
function getDefaultHosts(appId) {
|
|
702
699
|
return [
|
|
703
700
|
{
|
|
@@ -876,14 +873,14 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
876
873
|
return transporter.request(request, requestOptions);
|
|
877
874
|
},
|
|
878
875
|
/**
|
|
879
|
-
*
|
|
876
|
+
* Deletes a Recommend rule from a recommendation scenario.
|
|
880
877
|
*
|
|
881
878
|
* Required API Key ACLs:
|
|
882
879
|
* - editSettings.
|
|
883
880
|
*
|
|
884
881
|
* @param deleteRecommendRule - The deleteRecommendRule object.
|
|
885
882
|
* @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.
|
|
886
|
-
* @param deleteRecommendRule.model - [Recommend
|
|
883
|
+
* @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
887
884
|
* @param deleteRecommendRule.objectID - Unique record identifier.
|
|
888
885
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
889
886
|
*/
|
|
@@ -912,14 +909,14 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
912
909
|
return transporter.request(request, requestOptions);
|
|
913
910
|
},
|
|
914
911
|
/**
|
|
915
|
-
*
|
|
912
|
+
* Retrieves a Recommend rule that you previously created in the Algolia dashboard.
|
|
916
913
|
*
|
|
917
914
|
* Required API Key ACLs:
|
|
918
915
|
* - settings.
|
|
919
916
|
*
|
|
920
917
|
* @param getRecommendRule - The getRecommendRule object.
|
|
921
918
|
* @param getRecommendRule.indexName - Name of the index on which to perform the operation.
|
|
922
|
-
* @param getRecommendRule.model - [Recommend
|
|
919
|
+
* @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
923
920
|
* @param getRecommendRule.objectID - Unique record identifier.
|
|
924
921
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
925
922
|
*/
|
|
@@ -948,15 +945,15 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
948
945
|
return transporter.request(request, requestOptions);
|
|
949
946
|
},
|
|
950
947
|
/**
|
|
951
|
-
*
|
|
948
|
+
* Checks the status of a given task. Deleting a Recommend rule is asynchronous. When you delete a rule, a task is created on a queue and completed depending on the load on the server. The API response includes a task ID that you can use to check the status.
|
|
952
949
|
*
|
|
953
950
|
* Required API Key ACLs:
|
|
954
951
|
* - editSettings.
|
|
955
952
|
*
|
|
956
953
|
* @param getRecommendStatus - The getRecommendStatus object.
|
|
957
954
|
* @param getRecommendStatus.indexName - Name of the index on which to perform the operation.
|
|
958
|
-
* @param getRecommendStatus.model - [Recommend
|
|
959
|
-
* @param getRecommendStatus.taskID - Unique
|
|
955
|
+
* @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
956
|
+
* @param getRecommendStatus.taskID - Unique task identifier.
|
|
960
957
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
961
958
|
*/
|
|
962
959
|
getRecommendStatus({ indexName, model, taskID }, requestOptions) {
|
|
@@ -984,7 +981,7 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
984
981
|
return transporter.request(request, requestOptions);
|
|
985
982
|
},
|
|
986
983
|
/**
|
|
987
|
-
*
|
|
984
|
+
* Retrieves recommendations from selected AI models.
|
|
988
985
|
*
|
|
989
986
|
* Required API Key ACLs:
|
|
990
987
|
* - search.
|
|
@@ -1014,14 +1011,14 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1014
1011
|
return transporter.request(request, requestOptions);
|
|
1015
1012
|
},
|
|
1016
1013
|
/**
|
|
1017
|
-
*
|
|
1014
|
+
* Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.
|
|
1018
1015
|
*
|
|
1019
1016
|
* Required API Key ACLs:
|
|
1020
1017
|
* - settings.
|
|
1021
1018
|
*
|
|
1022
1019
|
* @param searchRecommendRules - The searchRecommendRules object.
|
|
1023
1020
|
* @param searchRecommendRules.indexName - Name of the index on which to perform the operation.
|
|
1024
|
-
* @param searchRecommendRules.model - [Recommend
|
|
1021
|
+
* @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
1025
1022
|
* @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.
|
|
1026
1023
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1027
1024
|
*/
|
|
@@ -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.112';
|
|
6
6
|
function getDefaultHosts(appId) {
|
|
7
7
|
return [
|
|
8
8
|
{
|
|
@@ -181,14 +181,14 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
181
181
|
return transporter.request(request, requestOptions);
|
|
182
182
|
},
|
|
183
183
|
/**
|
|
184
|
-
*
|
|
184
|
+
* Deletes a Recommend rule from a recommendation scenario.
|
|
185
185
|
*
|
|
186
186
|
* Required API Key ACLs:
|
|
187
187
|
* - editSettings.
|
|
188
188
|
*
|
|
189
189
|
* @param deleteRecommendRule - The deleteRecommendRule object.
|
|
190
190
|
* @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.
|
|
191
|
-
* @param deleteRecommendRule.model - [Recommend
|
|
191
|
+
* @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
192
192
|
* @param deleteRecommendRule.objectID - Unique record identifier.
|
|
193
193
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
194
194
|
*/
|
|
@@ -217,14 +217,14 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
217
217
|
return transporter.request(request, requestOptions);
|
|
218
218
|
},
|
|
219
219
|
/**
|
|
220
|
-
*
|
|
220
|
+
* Retrieves a Recommend rule that you previously created in the Algolia dashboard.
|
|
221
221
|
*
|
|
222
222
|
* Required API Key ACLs:
|
|
223
223
|
* - settings.
|
|
224
224
|
*
|
|
225
225
|
* @param getRecommendRule - The getRecommendRule object.
|
|
226
226
|
* @param getRecommendRule.indexName - Name of the index on which to perform the operation.
|
|
227
|
-
* @param getRecommendRule.model - [Recommend
|
|
227
|
+
* @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
228
228
|
* @param getRecommendRule.objectID - Unique record identifier.
|
|
229
229
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
230
230
|
*/
|
|
@@ -253,15 +253,15 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
253
253
|
return transporter.request(request, requestOptions);
|
|
254
254
|
},
|
|
255
255
|
/**
|
|
256
|
-
*
|
|
256
|
+
* Checks the status of a given task. Deleting a Recommend rule is asynchronous. When you delete a rule, a task is created on a queue and completed depending on the load on the server. The API response includes a task ID that you can use to check the status.
|
|
257
257
|
*
|
|
258
258
|
* Required API Key ACLs:
|
|
259
259
|
* - editSettings.
|
|
260
260
|
*
|
|
261
261
|
* @param getRecommendStatus - The getRecommendStatus object.
|
|
262
262
|
* @param getRecommendStatus.indexName - Name of the index on which to perform the operation.
|
|
263
|
-
* @param getRecommendStatus.model - [Recommend
|
|
264
|
-
* @param getRecommendStatus.taskID - Unique
|
|
263
|
+
* @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
264
|
+
* @param getRecommendStatus.taskID - Unique task identifier.
|
|
265
265
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
266
266
|
*/
|
|
267
267
|
getRecommendStatus({ indexName, model, taskID }, requestOptions) {
|
|
@@ -289,7 +289,7 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
289
289
|
return transporter.request(request, requestOptions);
|
|
290
290
|
},
|
|
291
291
|
/**
|
|
292
|
-
*
|
|
292
|
+
* Retrieves recommendations from selected AI models.
|
|
293
293
|
*
|
|
294
294
|
* Required API Key ACLs:
|
|
295
295
|
* - search.
|
|
@@ -319,14 +319,14 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
319
319
|
return transporter.request(request, requestOptions);
|
|
320
320
|
},
|
|
321
321
|
/**
|
|
322
|
-
*
|
|
322
|
+
* Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.
|
|
323
323
|
*
|
|
324
324
|
* Required API Key ACLs:
|
|
325
325
|
* - settings.
|
|
326
326
|
*
|
|
327
327
|
* @param searchRecommendRules - The searchRecommendRules object.
|
|
328
328
|
* @param searchRecommendRules.indexName - Name of the index on which to perform the operation.
|
|
329
|
-
* @param searchRecommendRules.model - [Recommend
|
|
329
|
+
* @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
330
330
|
* @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.
|
|
331
331
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
332
332
|
*/
|
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)||"{}")}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){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 l extends c{constructor(e,t,r){super(e,r),i(this,"stackTrace",void 0),this.stackTrace=t}}class u extends l{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 l{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 o=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${"/"===t.charAt(0)?t.substring(1):t}`;return a.length&&(o+=`?${a}`),o}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:o,timeouts:n,requester:i,requestsCache:c,responsesCache:l}){async function f(c,l,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,l),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,l.headers),q="GET"===c.method?{...c.data,...l.data}:{},b={...a,...c.queryParameters,...q};if(o.value&&(b["x-algolia-agent"]=o.value),l&&l.queryParameters)for(const e of Object.keys(l.queryParameters))l.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(l.queryParameters[e])?b[e]=l.queryParameters[e].toString():b[e]=l.queryParameters[e];let v=0;const R=async(e,r)=>{const a=e.pop();if(void 0===a)throw new u(function(e){return e.map((e=>g(e)))}(w));let o=l.timeout;void 0===o&&(o=f?n.read:n.write);const q={data:y,headers:P,method:c.method,url:p(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},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 o=T(O);return O.isTimedOut&&v++,console.log("Retryable failure",g(o)),await t.set(a,s(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(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([...O.hosts].reverse(),O.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 l.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=>l.set(n,e)})},requestsCache:c,responsesCache:l}}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-alpha.110";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)),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=y,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=f({hosts:P(e),...o,algoliaAgent:w({algoliaAgents:a,client:"Recommend",version:y}),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)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:`${y}-${e}`}),a()]}),...s})}}));
|
|
1
|
+
/*! recommend.umd.js | 5.0.0-alpha.112 | © 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 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 l extends c{constructor(e,t,r){super(e,r),i(this,"stackTrace",void 0),this.stackTrace=t}}class u extends l{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 l{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:l}){async function f(c,l,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,l),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,l.headers),q="GET"===c.method?{...c.data,...l.data}:{},b={...a,...c.queryParameters,...q};if(s.value&&(b["x-algolia-agent"]=s.value),l&&l.queryParameters)for(const e of Object.keys(l.queryParameters))l.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(l.queryParameters[e])?b[e]=l.queryParameters[e].toString():b[e]=l.queryParameters[e];let v=0;const R=async(e,r)=>{const a=e.pop();if(void 0===a)throw new u(function(e){return e.map((e=>g(e)))}(w));let s=f?l.timeouts?.read||n.read:l.timeouts?.write||n.write;const q={data:y,headers:P,method:c.method,url:p(a,c.path,b),connectTimeout:r(v,l.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 l.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=>l.set(n,e)})},requestsCache:c,responsesCache:l}}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-alpha.112";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})}}));
|
|
@@ -4,9 +4,9 @@ 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
|
-
import type {
|
|
7
|
+
import type { RecommendRule } from '../model/recommendRule';
|
|
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.112";
|
|
10
10
|
export declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
|
11
11
|
transporter: import("@algolia/client-common").Transporter;
|
|
12
12
|
/**
|
|
@@ -67,46 +67,46 @@ export declare function createRecommendClient({ appId: appIdOption, apiKey: apiK
|
|
|
67
67
|
*/
|
|
68
68
|
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
70
|
+
* Deletes a Recommend rule from a recommendation scenario.
|
|
71
71
|
*
|
|
72
72
|
* Required API Key ACLs:
|
|
73
73
|
* - editSettings.
|
|
74
74
|
*
|
|
75
75
|
* @param deleteRecommendRule - The deleteRecommendRule object.
|
|
76
76
|
* @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.
|
|
77
|
-
* @param deleteRecommendRule.model - [Recommend
|
|
77
|
+
* @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
78
78
|
* @param deleteRecommendRule.objectID - Unique record identifier.
|
|
79
79
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
80
80
|
*/
|
|
81
81
|
deleteRecommendRule({ indexName, model, objectID }: DeleteRecommendRuleProps, requestOptions?: RequestOptions): Promise<DeletedAtResponse>;
|
|
82
82
|
/**
|
|
83
|
-
*
|
|
83
|
+
* Retrieves a Recommend rule that you previously created in the Algolia dashboard.
|
|
84
84
|
*
|
|
85
85
|
* Required API Key ACLs:
|
|
86
86
|
* - settings.
|
|
87
87
|
*
|
|
88
88
|
* @param getRecommendRule - The getRecommendRule object.
|
|
89
89
|
* @param getRecommendRule.indexName - Name of the index on which to perform the operation.
|
|
90
|
-
* @param getRecommendRule.model - [Recommend
|
|
90
|
+
* @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
91
91
|
* @param getRecommendRule.objectID - Unique record identifier.
|
|
92
92
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
93
93
|
*/
|
|
94
|
-
getRecommendRule({ indexName, model, objectID }: GetRecommendRuleProps, requestOptions?: RequestOptions): Promise<
|
|
94
|
+
getRecommendRule({ indexName, model, objectID }: GetRecommendRuleProps, requestOptions?: RequestOptions): Promise<RecommendRule>;
|
|
95
95
|
/**
|
|
96
|
-
*
|
|
96
|
+
* Checks the status of a given task. Deleting a Recommend rule is asynchronous. When you delete a rule, a task is created on a queue and completed depending on the load on the server. The API response includes a task ID that you can use to check the status.
|
|
97
97
|
*
|
|
98
98
|
* Required API Key ACLs:
|
|
99
99
|
* - editSettings.
|
|
100
100
|
*
|
|
101
101
|
* @param getRecommendStatus - The getRecommendStatus object.
|
|
102
102
|
* @param getRecommendStatus.indexName - Name of the index on which to perform the operation.
|
|
103
|
-
* @param getRecommendStatus.model - [Recommend
|
|
104
|
-
* @param getRecommendStatus.taskID - Unique
|
|
103
|
+
* @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
104
|
+
* @param getRecommendStatus.taskID - Unique task identifier.
|
|
105
105
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
106
106
|
*/
|
|
107
107
|
getRecommendStatus({ indexName, model, taskID }: GetRecommendStatusProps, requestOptions?: RequestOptions): Promise<GetRecommendTaskResponse>;
|
|
108
108
|
/**
|
|
109
|
-
*
|
|
109
|
+
* Retrieves recommendations from selected AI models.
|
|
110
110
|
*
|
|
111
111
|
* Required API Key ACLs:
|
|
112
112
|
* - search.
|
|
@@ -116,14 +116,14 @@ export declare function createRecommendClient({ appId: appIdOption, apiKey: apiK
|
|
|
116
116
|
*/
|
|
117
117
|
getRecommendations(getRecommendationsParams: GetRecommendationsParams, 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
|
*
|
|
121
121
|
* Required API Key ACLs:
|
|
122
122
|
* - settings.
|
|
123
123
|
*
|
|
124
124
|
* @param searchRecommendRules - The searchRecommendRules object.
|
|
125
125
|
* @param searchRecommendRules.indexName - Name of the index on which to perform the operation.
|
|
126
|
-
* @param searchRecommendRules.model - [Recommend
|
|
126
|
+
* @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
127
127
|
* @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.
|
|
128
128
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
129
129
|
*/
|
|
@@ -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,
|
|
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,oBAAoB,CAAC;AAsClD,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,YAAY,EACpB,QAAQ,EACR,aAAa,EACb,GAAG,OAAO,EACX,EAAE,mBAAmB;;IAwBlB;;OAEG;;IAGH;;OAEG;kBACW,QAAQ,IAAI,CAAC;IAO3B;;OAEG;;IAKH;;;;;OAKG;6BACsB,MAAM,YAAY,MAAM,GAAG,IAAI;IAIxD;;;;;;;OAOG;uCAEqB,iBAAiB,mBACtB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAqB/B;;;;;;;OAOG;oCAEqB,cAAc,mBACnB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAqB/B;;;;;;;;OAQG;2CAE2B,eAAe,mBAC1B,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAsB/B;;;;;;;;OAQG;0CAE2B,cAAc,mBACzB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAsB/B;;;;;;;;;;;OAWG;wDAE+B,wBAAwB,mBACvC,cAAc,GAC9B,QAAQ,iBAAiB,CAAC;IAqC7B;;;;;;;;;;;OAWG;qDAE+B,qBAAqB,mBACpC,cAAc,GAC9B,QAAQ,aAAa,CAAC;IAqCzB;;;;;;;;;;;OAWG;qDAE6B,uBAAuB,mBACpC,cAAc,GAC9B,QAAQ,wBAAwB,CAAC;IAoCpC;;;;;;;;OAQG;iDAEyB,wBAAwB,mBACjC,cAAc,GAC9B,QAAQ,0BAA0B,CAAC;IA8BtC;;;;;;;;;;;OAWG;4EAME,yBAAyB,mBACX,cAAc,GAC9B,QAAQ,4BAA4B,CAAC;EAiC3C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Facet attribute. Only recommendations with the same value (or only recommendations with a different value) as the original viewed item are included.
|
|
5
|
+
*/
|
|
6
|
+
export type AutoFacetFilter = {
|
|
7
|
+
/**
|
|
8
|
+
* Facet attribute.
|
|
9
|
+
*/
|
|
10
|
+
facet?: string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Whether the filter is negative. If true, recommendations must not have the same value for the `facet` attribute. If false, recommendations must have the same value for the `facet` attribute.
|
|
14
|
+
*/
|
|
15
|
+
negative?: boolean;
|
|
16
|
+
};
|
|
@@ -1,18 +1,22 @@
|
|
|
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 { SearchParams } from './searchParams';
|
|
4
|
+
|
|
3
5
|
export type BaseRecommendRequest = {
|
|
4
6
|
/**
|
|
5
|
-
* Index name.
|
|
7
|
+
* Index name (case-sensitive).
|
|
6
8
|
*/
|
|
7
9
|
indexName: string;
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
|
-
*
|
|
12
|
+
* Minimum score a recommendation must have to be included in the response.
|
|
11
13
|
*/
|
|
12
|
-
threshold
|
|
14
|
+
threshold: number;
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
|
-
* Maximum number of recommendations to retrieve.
|
|
17
|
+
* Maximum number of recommendations to retrieve. By default, all recommendations are returned and no fallback request is made. Depending on the available recommendations and the other request parameters, the actual number of recommendations may be lower than this value.
|
|
16
18
|
*/
|
|
17
19
|
maxRecommendations?: number;
|
|
20
|
+
|
|
21
|
+
queryParameters?: SearchParams;
|
|
18
22
|
};
|
|
@@ -5,6 +5,7 @@ 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 { SupportedLanguage } from './supportedLanguage';
|
|
8
9
|
import type { TagFilters } from './tagFilters';
|
|
9
10
|
|
|
10
11
|
export type BaseSearchParamsWithoutQuery = {
|
|
@@ -14,7 +15,7 @@ export type BaseSearchParamsWithoutQuery = {
|
|
|
14
15
|
similarQuery?: string;
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
|
-
* Filter
|
|
18
|
+
* Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>` where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>` where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can\'t use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can\'t combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/).
|
|
18
19
|
*/
|
|
19
20
|
filters?: string;
|
|
20
21
|
|
|
@@ -32,7 +33,7 @@ export type BaseSearchParamsWithoutQuery = {
|
|
|
32
33
|
sumOrFiltersScores?: boolean;
|
|
33
34
|
|
|
34
35
|
/**
|
|
35
|
-
* Restricts a search to a subset of your searchable attributes.
|
|
36
|
+
* Restricts a search to a subset of your searchable attributes. Attribute names are case-sensitive.
|
|
36
37
|
*/
|
|
37
38
|
restrictSearchableAttributes?: string[];
|
|
38
39
|
|
|
@@ -86,14 +87,14 @@ export type BaseSearchParamsWithoutQuery = {
|
|
|
86
87
|
insideBoundingBox?: number[][];
|
|
87
88
|
|
|
88
89
|
/**
|
|
89
|
-
* Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored
|
|
90
|
+
* Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`.
|
|
90
91
|
*/
|
|
91
92
|
insidePolygon?: number[][];
|
|
92
93
|
|
|
93
94
|
/**
|
|
94
95
|
* ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`.
|
|
95
96
|
*/
|
|
96
|
-
naturalLanguages?:
|
|
97
|
+
naturalLanguages?: SupportedLanguage[];
|
|
97
98
|
|
|
98
99
|
/**
|
|
99
100
|
* Assigns a rule context to the search query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import type { BaseRecommendRequest } from './baseRecommendRequest';
|
|
4
|
-
import type {
|
|
4
|
+
import type { FrequentlyBoughtTogether } from './frequentlyBoughtTogether';
|
|
5
5
|
|
|
6
|
-
export type
|
|
7
|
-
|
|
6
|
+
export type BoughtTogetherQuery = BaseRecommendRequest &
|
|
7
|
+
FrequentlyBoughtTogether;
|
|
@@ -76,7 +76,7 @@ export type DeleteRecommendRuleProps = {
|
|
|
76
76
|
*/
|
|
77
77
|
indexName: string;
|
|
78
78
|
/**
|
|
79
|
-
* [Recommend
|
|
79
|
+
* [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
80
80
|
*/
|
|
81
81
|
model: RecommendModels;
|
|
82
82
|
/**
|
|
@@ -94,7 +94,7 @@ export type GetRecommendRuleProps = {
|
|
|
94
94
|
*/
|
|
95
95
|
indexName: string;
|
|
96
96
|
/**
|
|
97
|
-
* [Recommend
|
|
97
|
+
* [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
98
98
|
*/
|
|
99
99
|
model: RecommendModels;
|
|
100
100
|
/**
|
|
@@ -112,11 +112,11 @@ export type GetRecommendStatusProps = {
|
|
|
112
112
|
*/
|
|
113
113
|
indexName: string;
|
|
114
114
|
/**
|
|
115
|
-
* [Recommend
|
|
115
|
+
* [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
116
116
|
*/
|
|
117
117
|
model: RecommendModels;
|
|
118
118
|
/**
|
|
119
|
-
* Unique
|
|
119
|
+
* Unique task identifier.
|
|
120
120
|
*/
|
|
121
121
|
taskID: number;
|
|
122
122
|
};
|
|
@@ -130,7 +130,7 @@ export type SearchRecommendRulesProps = {
|
|
|
130
130
|
*/
|
|
131
131
|
indexName: string;
|
|
132
132
|
/**
|
|
133
|
-
* [Recommend
|
|
133
|
+
* [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
134
134
|
*/
|
|
135
135
|
model: RecommendModels;
|
|
136
136
|
searchRecommendRulesParams?: SearchRecommendRulesParams;
|
package/model/condition.ts
CHANGED
|
@@ -1,27 +1,16 @@
|
|
|
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
|
-
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Condition that triggers the rule. If not specified, the rule is triggered for all recommendations.
|
|
5
|
+
*/
|
|
5
6
|
export type Condition = {
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
pattern?: string;
|
|
10
|
-
|
|
11
|
-
anchoring?: Anchoring;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Whether the pattern should match plurals, synonyms, and typos.
|
|
8
|
+
* Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>` where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>` where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can\'t use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can\'t combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/).
|
|
15
9
|
*/
|
|
16
|
-
|
|
10
|
+
filters?: string;
|
|
17
11
|
|
|
18
12
|
/**
|
|
19
13
|
* An additional restriction that only triggers the rule, when the search has the same value as `ruleContexts` parameter. For example, if `context: mobile`, the rule is only triggered when the search request has a matching `ruleContexts: mobile`. A rule context must only contain alphanumeric characters.
|
|
20
14
|
*/
|
|
21
15
|
context?: string;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Filters that trigger the rule. You can add add filters using the syntax `facet:value` so that the rule is triggered, when the specific filter is selected. You can use `filters` on its own or combine it with the `pattern` parameter.
|
|
25
|
-
*/
|
|
26
|
-
filters?: string;
|
|
27
16
|
};
|
package/model/consequence.ts
CHANGED
|
@@ -1,32 +1,22 @@
|
|
|
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 {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
3
|
+
import type { HideConsequenceObject } from './hideConsequenceObject';
|
|
4
|
+
import type { ParamsConsequence } from './paramsConsequence';
|
|
5
|
+
import type { PromoteConsequenceObject } from './promoteConsequenceObject';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Effect of the rule.
|
|
8
|
+
* Effect of the rule.
|
|
9
9
|
*/
|
|
10
10
|
export type Consequence = {
|
|
11
|
-
params?: ConsequenceParams;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Records you want to pin to a specific position in the search results. You can promote up to 300 records, either individually, or as groups of up to 100 records each.
|
|
15
|
-
*/
|
|
16
|
-
promote?: Promote[];
|
|
17
|
-
|
|
18
11
|
/**
|
|
19
|
-
*
|
|
12
|
+
* Exclude items from recommendations.
|
|
20
13
|
*/
|
|
21
|
-
|
|
14
|
+
hide?: HideConsequenceObject[];
|
|
22
15
|
|
|
23
16
|
/**
|
|
24
|
-
*
|
|
17
|
+
* Place items at specific positions in the list of recommendations.
|
|
25
18
|
*/
|
|
26
|
-
|
|
19
|
+
promote?: PromoteConsequenceObject[];
|
|
27
20
|
|
|
28
|
-
|
|
29
|
-
* A JSON object with custom data that will be appended to the `userData` array in the response. This object isn\'t interpreted by the API and is limited to 1 kB of minified JSON.
|
|
30
|
-
*/
|
|
31
|
-
userData?: any | null;
|
|
21
|
+
params?: ParamsConsequence;
|
|
32
22
|
};
|