@algolia/recommend 5.0.0-alpha.9 → 5.0.0-alpha.90
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 +5 -5
- package/dist/builds/node.d.ts +5 -5
- package/dist/model/advancedSyntaxFeatures.d.ts +1 -1
- package/dist/model/advancedSyntaxFeatures.d.ts.map +1 -1
- package/dist/model/alternativesAsExact.d.ts +1 -1
- package/dist/model/alternativesAsExact.d.ts.map +1 -1
- package/dist/model/anchoring.d.ts +5 -0
- package/dist/model/anchoring.d.ts.map +1 -0
- package/dist/model/aroundPrecision.d.ts +6 -0
- package/dist/model/aroundPrecision.d.ts.map +1 -0
- package/dist/model/aroundPrecisionFromValueInner.d.ts +5 -0
- package/dist/model/aroundPrecisionFromValueInner.d.ts.map +1 -0
- package/dist/model/aroundRadius.d.ts +5 -5
- package/dist/model/aroundRadius.d.ts.map +1 -1
- package/dist/model/aroundRadiusAll.d.ts +1 -1
- package/dist/model/aroundRadiusAll.d.ts.map +1 -1
- package/dist/model/automaticFacetFilter.d.ts +18 -0
- package/dist/model/automaticFacetFilter.d.ts.map +1 -0
- package/dist/model/automaticFacetFilters.d.ts +6 -0
- package/dist/model/automaticFacetFilters.d.ts.map +1 -0
- package/dist/model/baseRecommendRequest.d.ts +14 -17
- package/dist/model/baseRecommendRequest.d.ts.map +1 -1
- package/dist/model/baseRecommendationsQuery.d.ts +12 -0
- package/dist/model/baseRecommendationsQuery.d.ts.map +1 -0
- package/dist/model/baseSearchParams.d.ts +3 -3
- package/dist/model/baseSearchParams.d.ts.map +1 -1
- package/dist/model/baseSearchParamsWithoutQuery.d.ts +118 -122
- package/dist/model/baseSearchParamsWithoutQuery.d.ts.map +1 -1
- package/dist/model/baseSearchResponse.d.ts +105 -101
- package/dist/model/baseSearchResponse.d.ts.map +1 -1
- package/dist/model/baseTrendingFacetsQuery.d.ts +9 -0
- package/dist/model/baseTrendingFacetsQuery.d.ts.map +1 -0
- package/dist/model/baseTrendingItemsQuery.d.ts +16 -0
- package/dist/model/baseTrendingItemsQuery.d.ts.map +1 -0
- package/dist/model/clientMethodProps.d.ts +127 -60
- package/dist/model/clientMethodProps.d.ts.map +1 -1
- package/dist/model/condition.d.ts +17 -0
- package/dist/model/condition.d.ts.map +1 -0
- package/dist/model/consequence.d.ts +26 -0
- package/dist/model/consequence.d.ts.map +1 -0
- package/dist/model/consequenceHide.d.ts +10 -0
- package/dist/model/consequenceHide.d.ts.map +1 -0
- package/dist/model/consequenceParams.d.ts +5 -0
- package/dist/model/consequenceParams.d.ts.map +1 -0
- package/dist/model/consequenceQuery.d.ts +6 -0
- package/dist/model/consequenceQuery.d.ts.map +1 -0
- package/dist/model/consequenceQueryObject.d.ts +12 -0
- package/dist/model/consequenceQueryObject.d.ts.map +1 -0
- package/dist/model/deletedAtResponse.d.ts +14 -0
- package/dist/model/deletedAtResponse.d.ts.map +1 -0
- package/dist/model/distinct.d.ts +4 -4
- package/dist/model/distinct.d.ts.map +1 -1
- package/dist/model/edit.d.ts +13 -0
- package/dist/model/edit.d.ts.map +1 -0
- package/dist/model/editType.d.ts +5 -0
- package/dist/model/editType.d.ts.map +1 -0
- package/dist/model/errorBase.d.ts +6 -6
- package/dist/model/errorBase.d.ts.map +1 -1
- package/dist/model/exactOnSingleWordQuery.d.ts +4 -4
- package/dist/model/exactOnSingleWordQuery.d.ts.map +1 -1
- package/dist/model/exhaustive.d.ts +26 -0
- package/dist/model/exhaustive.d.ts.map +1 -0
- package/dist/model/facetFilters.d.ts +5 -5
- package/dist/model/facetFilters.d.ts.map +1 -1
- package/dist/model/facetOrdering.d.ts +12 -12
- package/dist/model/facetOrdering.d.ts.map +1 -1
- package/dist/model/facets.d.ts +9 -9
- package/dist/model/facets.d.ts.map +1 -1
- package/dist/model/facetsStats.d.ts +18 -18
- package/dist/model/facetsStats.d.ts.map +1 -1
- package/dist/model/getRecommendTaskResponse.d.ts +5 -0
- package/dist/model/getRecommendTaskResponse.d.ts.map +1 -0
- package/dist/model/getRecommendationsParams.d.ts +10 -10
- package/dist/model/getRecommendationsParams.d.ts.map +1 -1
- package/dist/model/getRecommendationsResponse.d.ts +4 -4
- package/dist/model/getRecommendationsResponse.d.ts.map +1 -1
- package/dist/model/highlightResult.d.ts +2 -2
- package/dist/model/highlightResult.d.ts.map +1 -1
- package/dist/model/highlightResultOption.d.ts +19 -19
- package/dist/model/highlightResultOption.d.ts.map +1 -1
- package/dist/model/ignorePlurals.d.ts +4 -4
- package/dist/model/ignorePlurals.d.ts.map +1 -1
- package/dist/model/index.d.ts +87 -53
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/indexSettingsAsSearchParams.d.ts +162 -160
- package/dist/model/indexSettingsAsSearchParams.d.ts.map +1 -1
- package/dist/model/matchLevel.d.ts +4 -4
- package/dist/model/matchLevel.d.ts.map +1 -1
- package/dist/model/matchedGeoLocation.d.ts +14 -14
- package/dist/model/matchedGeoLocation.d.ts.map +1 -1
- package/dist/model/mixedSearchFilters.d.ts +1 -1
- package/dist/model/mixedSearchFilters.d.ts.map +1 -1
- package/dist/model/mode.d.ts +5 -0
- package/dist/model/mode.d.ts.map +1 -0
- package/dist/model/numericFilters.d.ts +5 -5
- package/dist/model/numericFilters.d.ts.map +1 -1
- package/dist/model/optionalFilters.d.ts +5 -5
- package/dist/model/optionalFilters.d.ts.map +1 -1
- package/dist/model/params.d.ts +13 -0
- package/dist/model/params.d.ts.map +1 -0
- package/dist/model/personalization.d.ts +14 -14
- package/dist/model/personalization.d.ts.map +1 -1
- package/dist/model/promote.d.ts +4 -0
- package/dist/model/promote.d.ts.map +1 -0
- package/dist/model/promoteObjectID.d.ts +14 -0
- package/dist/model/promoteObjectID.d.ts.map +1 -0
- package/dist/model/promoteObjectIDs.d.ts +14 -0
- package/dist/model/promoteObjectIDs.d.ts.map +1 -0
- package/dist/model/queryType.d.ts +4 -4
- package/dist/model/queryType.d.ts.map +1 -1
- package/dist/model/rankingInfo.d.ts +50 -50
- package/dist/model/rankingInfo.d.ts.map +1 -1
- package/dist/model/reRankingApplyFilter.d.ts +5 -5
- package/dist/model/reRankingApplyFilter.d.ts.map +1 -1
- package/dist/model/recommendHit.d.ts +26 -26
- package/dist/model/recommendHit.d.ts.map +1 -1
- package/dist/model/recommendHits.d.ts +12 -4
- package/dist/model/recommendHits.d.ts.map +1 -1
- package/dist/model/recommendModels.d.ts +2 -0
- package/dist/model/recommendModels.d.ts.map +1 -0
- package/dist/model/recommendationModels.d.ts +4 -4
- package/dist/model/recommendationModels.d.ts.map +1 -1
- package/dist/model/recommendationsQuery.d.ts +4 -0
- package/dist/model/recommendationsQuery.d.ts.map +1 -0
- package/dist/model/recommendationsRequest.d.ts +4 -3
- package/dist/model/recommendationsRequest.d.ts.map +1 -1
- package/dist/model/recommendationsResponse.d.ts +3 -3
- package/dist/model/recommendationsResponse.d.ts.map +1 -1
- package/dist/model/redirect.d.ts +8 -0
- package/dist/model/redirect.d.ts.map +1 -0
- package/dist/model/redirectRuleIndexMetadata.d.ts +21 -0
- package/dist/model/redirectRuleIndexMetadata.d.ts.map +1 -0
- package/dist/model/redirectRuleIndexMetadataData.d.ts +7 -0
- package/dist/model/redirectRuleIndexMetadataData.d.ts.map +1 -0
- package/dist/model/removeStopWords.d.ts +4 -4
- package/dist/model/removeStopWords.d.ts.map +1 -1
- package/dist/model/removeWordsIfNoResults.d.ts +4 -4
- package/dist/model/removeWordsIfNoResults.d.ts.map +1 -1
- package/dist/model/renderingContent.d.ts +7 -7
- package/dist/model/renderingContent.d.ts.map +1 -1
- package/dist/model/ruleResponse.d.ts +27 -0
- package/dist/model/ruleResponse.d.ts.map +1 -0
- package/dist/model/ruleResponseMetadata.d.ts +7 -0
- package/dist/model/ruleResponseMetadata.d.ts.map +1 -0
- package/dist/model/searchParamsObject.d.ts +3 -3
- package/dist/model/searchParamsObject.d.ts.map +1 -1
- package/dist/model/searchParamsQuery.d.ts +6 -6
- package/dist/model/searchParamsQuery.d.ts.map +1 -1
- package/dist/model/searchRecommendRulesParams.d.ts +30 -0
- package/dist/model/searchRecommendRulesParams.d.ts.map +1 -0
- package/dist/model/searchRecommendRulesResponse.d.ts +20 -0
- package/dist/model/searchRecommendRulesResponse.d.ts.map +1 -0
- package/dist/model/semanticSearch.d.ts +10 -0
- package/dist/model/semanticSearch.d.ts.map +1 -0
- package/dist/model/snippetResult.d.ts +2 -2
- package/dist/model/snippetResult.d.ts.map +1 -1
- package/dist/model/snippetResultOption.d.ts +11 -11
- package/dist/model/snippetResultOption.d.ts.map +1 -1
- package/dist/model/sortRemainingBy.d.ts +4 -4
- package/dist/model/sortRemainingBy.d.ts.map +1 -1
- package/dist/model/tagFilters.d.ts +5 -5
- package/dist/model/tagFilters.d.ts.map +1 -1
- package/dist/model/taskStatus.d.ts +5 -0
- package/dist/model/taskStatus.d.ts.map +1 -0
- package/dist/model/trendingFacetsModel.d.ts +5 -0
- package/dist/model/trendingFacetsModel.d.ts.map +1 -0
- package/dist/model/trendingFacetsQuery.d.ts +4 -0
- package/dist/model/trendingFacetsQuery.d.ts.map +1 -0
- package/dist/model/trendingItemsModel.d.ts +5 -0
- package/dist/model/trendingItemsModel.d.ts.map +1 -0
- package/dist/model/trendingItemsQuery.d.ts +4 -0
- package/dist/model/trendingItemsQuery.d.ts.map +1 -0
- package/dist/model/typoTolerance.d.ts +5 -5
- package/dist/model/typoTolerance.d.ts.map +1 -1
- package/dist/model/typoToleranceEnum.d.ts +1 -1
- package/dist/model/typoToleranceEnum.d.ts.map +1 -1
- package/dist/model/value.d.ts +8 -8
- package/dist/model/value.d.ts.map +1 -1
- package/dist/recommend.cjs +381 -0
- package/dist/recommend.esm.browser.js +552 -469
- package/dist/recommend.esm.node.js +370 -235
- package/dist/recommend.umd.js +2 -2
- package/dist/src/recommendClient.d.ts +129 -81
- package/dist/src/recommendClient.d.ts.map +1 -1
- package/index.js +1 -1
- package/model/advancedSyntaxFeatures.ts +1 -1
- package/model/alternativesAsExact.ts +1 -1
- package/model/anchoring.ts +6 -0
- package/model/aroundPrecision.ts +8 -0
- package/model/aroundPrecisionFromValueInner.ts +7 -0
- package/model/aroundRadius.ts +2 -2
- package/model/aroundRadiusAll.ts +1 -1
- package/model/automaticFacetFilter.ts +21 -0
- package/model/automaticFacetFilters.ts +8 -0
- package/model/baseRecommendRequest.ts +5 -11
- package/model/baseRecommendationsQuery.ts +17 -0
- package/model/baseSearchParams.ts +1 -1
- package/model/baseSearchParamsWithoutQuery.ts +40 -45
- package/model/baseSearchResponse.ts +37 -31
- package/model/baseTrendingFacetsQuery.ts +12 -0
- package/model/baseTrendingItemsQuery.ts +22 -0
- package/model/clientMethodProps.ts +83 -11
- package/model/condition.ts +22 -0
- package/model/consequence.ts +32 -0
- package/model/consequenceHide.ts +11 -0
- package/model/consequenceParams.ts +9 -0
- package/model/consequenceQuery.ts +8 -0
- package/model/consequenceQueryObject.ts +15 -0
- package/model/deletedAtResponse.ts +16 -0
- package/model/distinct.ts +2 -2
- package/model/edit.ts +17 -0
- package/model/editType.ts +6 -0
- package/model/errorBase.ts +1 -1
- package/model/exactOnSingleWordQuery.ts +2 -2
- package/model/exhaustive.ts +31 -0
- package/model/facetFilters.ts +2 -2
- package/model/facetOrdering.ts +3 -3
- package/model/facets.ts +2 -2
- package/model/facetsStats.ts +5 -5
- package/model/getRecommendTaskResponse.ts +7 -0
- package/model/getRecommendationsParams.ts +3 -3
- package/model/getRecommendationsResponse.ts +1 -1
- package/model/highlightResult.ts +1 -1
- package/model/highlightResultOption.ts +2 -2
- package/model/ignorePlurals.ts +2 -2
- package/model/index.ts +40 -6
- package/model/indexSettingsAsSearchParams.ts +51 -47
- package/model/matchLevel.ts +1 -1
- package/model/matchedGeoLocation.ts +1 -1
- package/model/mixedSearchFilters.ts +1 -1
- package/model/mode.ts +6 -0
- package/model/numericFilters.ts +2 -2
- package/model/optionalFilters.ts +2 -2
- package/model/params.ts +18 -0
- package/model/personalization.ts +1 -1
- package/model/promote.ts +6 -0
- package/model/promoteObjectID.ts +16 -0
- package/model/promoteObjectIDs.ts +16 -0
- package/model/queryType.ts +2 -2
- package/model/rankingInfo.ts +1 -1
- package/model/reRankingApplyFilter.ts +2 -2
- package/model/recommendHit.ts +4 -4
- package/model/recommendHits.ts +11 -1
- package/model/recommendModels.ts +7 -0
- package/model/recommendationModels.ts +2 -2
- package/model/recommendationsQuery.ts +7 -0
- package/model/recommendationsRequest.ts +8 -4
- package/model/recommendationsResponse.ts +1 -1
- package/model/redirect.ts +10 -0
- package/model/redirectRuleIndexMetadata.ts +27 -0
- package/model/redirectRuleIndexMetadataData.ts +8 -0
- package/model/removeStopWords.ts +2 -2
- package/model/removeWordsIfNoResults.ts +2 -2
- package/model/renderingContent.ts +2 -2
- package/model/ruleResponse.ts +34 -0
- package/model/ruleResponseMetadata.ts +8 -0
- package/model/searchParamsObject.ts +1 -1
- package/model/searchParamsQuery.ts +2 -2
- package/model/searchRecommendRulesParams.ts +36 -0
- package/model/searchRecommendRulesResponse.ts +25 -0
- package/model/semanticSearch.ts +11 -0
- package/model/snippetResult.ts +1 -1
- package/model/snippetResultOption.ts +2 -2
- package/model/sortRemainingBy.ts +2 -2
- package/model/tagFilters.ts +2 -2
- package/model/taskStatus.ts +6 -0
- package/model/trendingFacetsModel.ts +6 -0
- package/model/trendingFacetsQuery.ts +7 -0
- package/model/trendingItemsModel.ts +6 -0
- package/model/trendingItemsQuery.ts +6 -0
- package/model/typoTolerance.ts +2 -2
- package/model/typoToleranceEnum.ts +1 -1
- package/model/value.ts +1 -1
- package/package.json +30 -13
- package/dist/model/baseRecommendationRequest.d.ts +0 -9
- package/dist/model/baseRecommendationRequest.d.ts.map +0 -1
- package/dist/model/baseTrendingRequest.d.ts +0 -13
- package/dist/model/baseTrendingRequest.d.ts.map +0 -1
- package/dist/model/recommendationRequest.d.ts +0 -4
- package/dist/model/recommendationRequest.d.ts.map +0 -1
- package/dist/model/trendingModels.d.ts +0 -5
- package/dist/model/trendingModels.d.ts.map +0 -1
- package/dist/model/trendingRequest.d.ts +0 -4
- package/dist/model/trendingRequest.d.ts.map +0 -1
- package/dist/recommend.cjs.js +0 -248
- package/model/baseRecommendationRequest.ts +0 -12
- package/model/baseTrendingRequest.ts +0 -17
- package/model/recommendationRequest.ts +0 -7
- package/model/trendingModels.ts +0 -6
- package/model/trendingRequest.ts +0 -6
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { TrendingModels } from './trendingModels';
|
|
2
|
-
export declare type BaseTrendingRequest = {
|
|
3
|
-
model: TrendingModels;
|
|
4
|
-
/**
|
|
5
|
-
* The facet name to use for trending models.
|
|
6
|
-
*/
|
|
7
|
-
facetName?: string;
|
|
8
|
-
/**
|
|
9
|
-
* The facet value to use for trending models.
|
|
10
|
-
*/
|
|
11
|
-
facetValue?: string;
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=baseTrendingRequest.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"baseTrendingRequest.d.ts","sourceRoot":"","sources":["../../model/baseTrendingRequest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,oBAAY,mBAAmB,GAAG;IAChC,KAAK,EAAE,cAAc,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { BaseRecommendRequest } from './baseRecommendRequest';
|
|
2
|
-
import type { BaseRecommendationRequest } from './baseRecommendationRequest';
|
|
3
|
-
export declare type RecommendationRequest = BaseRecommendationRequest & BaseRecommendRequest;
|
|
4
|
-
//# sourceMappingURL=recommendationRequest.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"recommendationRequest.d.ts","sourceRoot":"","sources":["../../model/recommendationRequest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAE7E,oBAAY,qBAAqB,GAAG,yBAAyB,GAC3D,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trendingModels.d.ts","sourceRoot":"","sources":["../../model/trendingModels.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,oBAAY,cAAc,GAAG,iBAAiB,GAAG,gBAAgB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trendingRequest.d.ts","sourceRoot":"","sources":["../../model/trendingRequest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,oBAAY,eAAe,GAAG,oBAAoB,GAAG,mBAAmB,CAAC"}
|
package/dist/recommend.cjs.js
DELETED
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var clientCommon = require('@algolia/client-common');
|
|
6
|
-
var requesterNodeHttp = require('@algolia/requester-node-http');
|
|
7
|
-
|
|
8
|
-
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
|
|
9
|
-
const apiClientVersion = '5.0.0-alpha.9';
|
|
10
|
-
function getDefaultHosts(appId) {
|
|
11
|
-
return [
|
|
12
|
-
{
|
|
13
|
-
url: `${appId}-dsn.algolia.net`,
|
|
14
|
-
accept: 'read',
|
|
15
|
-
protocol: 'https',
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
url: `${appId}.algolia.net`,
|
|
19
|
-
accept: 'write',
|
|
20
|
-
protocol: 'https',
|
|
21
|
-
},
|
|
22
|
-
].concat(clientCommon.shuffle([
|
|
23
|
-
{
|
|
24
|
-
url: `${appId}-1.algolianet.com`,
|
|
25
|
-
accept: 'readWrite',
|
|
26
|
-
protocol: 'https',
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
url: `${appId}-2.algolianet.com`,
|
|
30
|
-
accept: 'readWrite',
|
|
31
|
-
protocol: 'https',
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
url: `${appId}-3.algolianet.com`,
|
|
35
|
-
accept: 'readWrite',
|
|
36
|
-
protocol: 'https',
|
|
37
|
-
},
|
|
38
|
-
]));
|
|
39
|
-
}
|
|
40
|
-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
41
|
-
function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }) {
|
|
42
|
-
const auth = clientCommon.createAuth(appIdOption, apiKeyOption, authMode);
|
|
43
|
-
const transporter = clientCommon.createTransporter({
|
|
44
|
-
hosts: getDefaultHosts(appIdOption),
|
|
45
|
-
...options,
|
|
46
|
-
algoliaAgent: clientCommon.getAlgoliaAgent({
|
|
47
|
-
algoliaAgents,
|
|
48
|
-
client: 'Recommend',
|
|
49
|
-
version: apiClientVersion,
|
|
50
|
-
}),
|
|
51
|
-
baseHeaders: {
|
|
52
|
-
'content-type': 'text/plain',
|
|
53
|
-
...auth.headers(),
|
|
54
|
-
...options.baseHeaders,
|
|
55
|
-
},
|
|
56
|
-
baseQueryParameters: {
|
|
57
|
-
...auth.queryParameters(),
|
|
58
|
-
...options.baseQueryParameters,
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
return {
|
|
62
|
-
transporter,
|
|
63
|
-
/**
|
|
64
|
-
* The `appId` currently in use.
|
|
65
|
-
*/
|
|
66
|
-
appId: appIdOption,
|
|
67
|
-
/**
|
|
68
|
-
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
69
|
-
*/
|
|
70
|
-
clearCache() {
|
|
71
|
-
return Promise.all([
|
|
72
|
-
transporter.requestsCache.clear(),
|
|
73
|
-
transporter.responsesCache.clear(),
|
|
74
|
-
]).then(() => undefined);
|
|
75
|
-
},
|
|
76
|
-
/**
|
|
77
|
-
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
78
|
-
*/
|
|
79
|
-
get _ua() {
|
|
80
|
-
return transporter.algoliaAgent.value;
|
|
81
|
-
},
|
|
82
|
-
/**
|
|
83
|
-
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
84
|
-
*
|
|
85
|
-
* @param segment - The algolia agent (user-agent) segment to add.
|
|
86
|
-
* @param version - The version of the agent.
|
|
87
|
-
*/
|
|
88
|
-
addAlgoliaAgent(segment, version) {
|
|
89
|
-
transporter.algoliaAgent.add({ segment, version });
|
|
90
|
-
},
|
|
91
|
-
/**
|
|
92
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
93
|
-
*
|
|
94
|
-
* @summary Send requests to the Algolia REST API.
|
|
95
|
-
* @param del - The del object.
|
|
96
|
-
* @param del.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
|
|
97
|
-
* @param del.parameters - Query parameters to be applied to the current query.
|
|
98
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
99
|
-
*/
|
|
100
|
-
del({ path, parameters }, requestOptions) {
|
|
101
|
-
if (!path) {
|
|
102
|
-
throw new Error('Parameter `path` is required when calling `del`.');
|
|
103
|
-
}
|
|
104
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
105
|
-
const headers = {};
|
|
106
|
-
const queryParameters = parameters ? parameters : {};
|
|
107
|
-
const request = {
|
|
108
|
-
method: 'DELETE',
|
|
109
|
-
path: requestPath,
|
|
110
|
-
queryParameters,
|
|
111
|
-
headers,
|
|
112
|
-
};
|
|
113
|
-
return transporter.request(request, requestOptions);
|
|
114
|
-
},
|
|
115
|
-
/**
|
|
116
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
117
|
-
*
|
|
118
|
-
* @summary Send requests to the Algolia REST API.
|
|
119
|
-
* @param get - The get object.
|
|
120
|
-
* @param get.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
|
|
121
|
-
* @param get.parameters - Query parameters to be applied to the current query.
|
|
122
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
123
|
-
*/
|
|
124
|
-
get({ path, parameters }, requestOptions) {
|
|
125
|
-
if (!path) {
|
|
126
|
-
throw new Error('Parameter `path` is required when calling `get`.');
|
|
127
|
-
}
|
|
128
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
129
|
-
const headers = {};
|
|
130
|
-
const queryParameters = parameters ? parameters : {};
|
|
131
|
-
const request = {
|
|
132
|
-
method: 'GET',
|
|
133
|
-
path: requestPath,
|
|
134
|
-
queryParameters,
|
|
135
|
-
headers,
|
|
136
|
-
};
|
|
137
|
-
return transporter.request(request, requestOptions);
|
|
138
|
-
},
|
|
139
|
-
/**
|
|
140
|
-
* Returns recommendations or trending results, for a specific model and `objectID`.
|
|
141
|
-
*
|
|
142
|
-
* @summary Get results.
|
|
143
|
-
* @param getRecommendationsParams - The getRecommendationsParams object.
|
|
144
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
145
|
-
*/
|
|
146
|
-
getRecommendations(getRecommendationsParams, requestOptions) {
|
|
147
|
-
if (!getRecommendationsParams) {
|
|
148
|
-
throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');
|
|
149
|
-
}
|
|
150
|
-
if (!getRecommendationsParams.requests) {
|
|
151
|
-
throw new Error('Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.');
|
|
152
|
-
}
|
|
153
|
-
const requestPath = '/1/indexes/*/recommendations';
|
|
154
|
-
const headers = {};
|
|
155
|
-
const queryParameters = {};
|
|
156
|
-
const request = {
|
|
157
|
-
method: 'POST',
|
|
158
|
-
path: requestPath,
|
|
159
|
-
queryParameters,
|
|
160
|
-
headers,
|
|
161
|
-
data: getRecommendationsParams,
|
|
162
|
-
useReadTransporter: true,
|
|
163
|
-
cacheable: true,
|
|
164
|
-
};
|
|
165
|
-
return transporter.request(request, requestOptions);
|
|
166
|
-
},
|
|
167
|
-
/**
|
|
168
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
169
|
-
*
|
|
170
|
-
* @summary Send requests to the Algolia REST API.
|
|
171
|
-
* @param post - The post object.
|
|
172
|
-
* @param post.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
|
|
173
|
-
* @param post.parameters - Query parameters to be applied to the current query.
|
|
174
|
-
* @param post.body - The parameters to send with the custom request.
|
|
175
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
176
|
-
*/
|
|
177
|
-
post({ path, parameters, body }, requestOptions) {
|
|
178
|
-
if (!path) {
|
|
179
|
-
throw new Error('Parameter `path` is required when calling `post`.');
|
|
180
|
-
}
|
|
181
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
182
|
-
const headers = {};
|
|
183
|
-
const queryParameters = parameters ? parameters : {};
|
|
184
|
-
const request = {
|
|
185
|
-
method: 'POST',
|
|
186
|
-
path: requestPath,
|
|
187
|
-
queryParameters,
|
|
188
|
-
headers,
|
|
189
|
-
data: body ? body : {},
|
|
190
|
-
};
|
|
191
|
-
return transporter.request(request, requestOptions);
|
|
192
|
-
},
|
|
193
|
-
/**
|
|
194
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
195
|
-
*
|
|
196
|
-
* @summary Send requests to the Algolia REST API.
|
|
197
|
-
* @param put - The put object.
|
|
198
|
-
* @param put.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
|
|
199
|
-
* @param put.parameters - Query parameters to be applied to the current query.
|
|
200
|
-
* @param put.body - The parameters to send with the custom request.
|
|
201
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
202
|
-
*/
|
|
203
|
-
put({ path, parameters, body }, requestOptions) {
|
|
204
|
-
if (!path) {
|
|
205
|
-
throw new Error('Parameter `path` is required when calling `put`.');
|
|
206
|
-
}
|
|
207
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
208
|
-
const headers = {};
|
|
209
|
-
const queryParameters = parameters ? parameters : {};
|
|
210
|
-
const request = {
|
|
211
|
-
method: 'PUT',
|
|
212
|
-
path: requestPath,
|
|
213
|
-
queryParameters,
|
|
214
|
-
headers,
|
|
215
|
-
data: body ? body : {},
|
|
216
|
-
};
|
|
217
|
-
return transporter.request(request, requestOptions);
|
|
218
|
-
},
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
|
|
223
|
-
function recommendClient(appId, apiKey, options) {
|
|
224
|
-
if (!appId || typeof appId !== 'string') {
|
|
225
|
-
throw new Error('`appId` is missing.');
|
|
226
|
-
}
|
|
227
|
-
if (!apiKey || typeof apiKey !== 'string') {
|
|
228
|
-
throw new Error('`apiKey` is missing.');
|
|
229
|
-
}
|
|
230
|
-
return createRecommendClient({
|
|
231
|
-
appId,
|
|
232
|
-
apiKey,
|
|
233
|
-
timeouts: {
|
|
234
|
-
connect: clientCommon.DEFAULT_CONNECT_TIMEOUT_NODE,
|
|
235
|
-
read: clientCommon.DEFAULT_READ_TIMEOUT_NODE,
|
|
236
|
-
write: clientCommon.DEFAULT_WRITE_TIMEOUT_NODE,
|
|
237
|
-
},
|
|
238
|
-
requester: requesterNodeHttp.createHttpRequester(),
|
|
239
|
-
algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
|
|
240
|
-
responsesCache: clientCommon.createNullCache(),
|
|
241
|
-
requestsCache: clientCommon.createNullCache(),
|
|
242
|
-
hostsCache: clientCommon.createMemoryCache(),
|
|
243
|
-
...options,
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
exports.apiClientVersion = apiClientVersion;
|
|
248
|
-
exports.recommendClient = recommendClient;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
|
|
2
|
-
|
|
3
|
-
import type { RecommendationModels } from './recommendationModels';
|
|
4
|
-
|
|
5
|
-
export type BaseRecommendationRequest = {
|
|
6
|
-
model: RecommendationModels;
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Unique identifier of the object.
|
|
10
|
-
*/
|
|
11
|
-
objectID: string;
|
|
12
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
|
|
2
|
-
|
|
3
|
-
import type { TrendingModels } from './trendingModels';
|
|
4
|
-
|
|
5
|
-
export type BaseTrendingRequest = {
|
|
6
|
-
model: TrendingModels;
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The facet name to use for trending models.
|
|
10
|
-
*/
|
|
11
|
-
facetName?: string;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* The facet value to use for trending models.
|
|
15
|
-
*/
|
|
16
|
-
facetValue?: string;
|
|
17
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
|
|
2
|
-
|
|
3
|
-
import type { BaseRecommendRequest } from './baseRecommendRequest';
|
|
4
|
-
import type { BaseRecommendationRequest } from './baseRecommendationRequest';
|
|
5
|
-
|
|
6
|
-
export type RecommendationRequest = BaseRecommendationRequest &
|
|
7
|
-
BaseRecommendRequest;
|
package/model/trendingModels.ts
DELETED
package/model/trendingRequest.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
|
|
2
|
-
|
|
3
|
-
import type { BaseRecommendRequest } from './baseRecommendRequest';
|
|
4
|
-
import type { BaseTrendingRequest } from './baseTrendingRequest';
|
|
5
|
-
|
|
6
|
-
export type TrendingRequest = BaseRecommendRequest & BaseTrendingRequest;
|