addsearch-js-client
Advanced tools
Comparing version 0.8.10 to 0.8.11
{ | ||
"name": "addsearch-js-client", | ||
"version": "0.8.10", | ||
"version": "0.8.11", | ||
"description": "AddSearch API JavaScript client", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -416,3 +416,3 @@ # AddSearch Search API Client for JavaScript | ||
// Set API hostname (e.g. for dedicated environments) | ||
client.setApiHostname('api.addsearch.com'); | ||
client.setApiHostname('api.addsearch.com', option); | ||
``` | ||
@@ -419,0 +419,0 @@ |
@@ -149,2 +149,3 @@ 'use strict'; | ||
} | ||
api = 'https://' + apiHostname + '/v1/' + apiPath + '/' + sitekey + '?term=' + kw + qs; | ||
} | ||
@@ -158,2 +159,3 @@ | ||
kw = settings.suggestionsPrefix; | ||
api = 'https://' + apiHostname + '/v1/' + apiPath + '/' + sitekey + '?term=' + kw + qs; | ||
} | ||
@@ -167,14 +169,16 @@ | ||
kw = settings.autocomplete.prefix; | ||
api = 'https://' + apiHostname + '/v1/' + apiPath + '/' + sitekey + '?term=' + kw + qs; | ||
} | ||
else if (type === 'recommend') { | ||
apiPath = 'recommendations'; | ||
qs = settingToQueryParam(recommendOptions.itemId, 'itemId'); | ||
if (recommendOptions.type === 'RELATED_ITEMS') { | ||
qs = settingToQueryParam(recommendOptions.itemId, 'itemId'); | ||
apiPath = 'recommendations/index/' + sitekey + '/block/' + recommendOptions.blockId + '?' + qs; | ||
} else if (recommendOptions.type === 'FREQUENTLY_BOUGHT_TOGETHER') { | ||
qs = settingToQueryParam(recommendOptions.itemId, 'itemId'); | ||
apiPath = 'recommendations/' + sitekey + '?configurationKey=' + recommendOptions.configurationKey + qs; | ||
} | ||
api = 'https://' + apiHostname + '/v1/' + apiPath; | ||
} | ||
// Execute API call | ||
api = type === 'recommend' ? | ||
'https://' + apiHostname + '/v1/' + apiPath + '/' + sitekey + '?configurationKey=' + recommendOptions.configurationKey + qs : | ||
'https://' + apiHostname + '/v1/' + apiPath + '/' + sitekey + '?term=' + kw + qs; | ||
apiInstance.get(api) | ||
@@ -181,0 +185,0 @@ .then(function(response) { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
156504
1128