addsearch-js-client
Advanced tools
Comparing version
{ | ||
"name": "addsearch-js-client", | ||
"version": "0.8.16", | ||
"version": "0.9.0", | ||
"description": "AddSearch API JavaScript client", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -6,3 +6,7 @@ 'use strict'; | ||
const statsInstance = axios.create(); | ||
const conversationalSearchInteractionsInstance = axios.create(); | ||
const RESPONSE_BAD_REQUEST = 400; | ||
const RESPONSE_SERVER_ERROR = 500; | ||
const setRequestInterceptor = (callback, requestType) => { | ||
@@ -28,3 +32,6 @@ const axiosInstance = requestType === 'searchApi' ? apiInstance : statsInstance; | ||
statsInstance, | ||
setRequestInterceptor | ||
conversationalSearchInteractionsInstance, | ||
setRequestInterceptor, | ||
RESPONSE_BAD_REQUEST, | ||
RESPONSE_SERVER_ERROR | ||
}; |
'use strict'; | ||
require('es6-promise').polyfill(); | ||
const apiInstance = require('./api').apiInstance; | ||
const RESPONSE_BAD_REQUEST = require('./api').RESPONSE_BAD_REQUEST; | ||
const RESPONSE_SERVER_ERROR = require('./api').RESPONSE_SERVER_ERROR; | ||
@@ -18,5 +20,2 @@ /** | ||
) { | ||
const RESPONSE_BAD_REQUEST = 400; | ||
const RESPONSE_SERVER_ERROR = 500; | ||
var settingToQueryParam = function (setting, key) { | ||
@@ -23,0 +22,0 @@ if (setting || setting === false) { |
@@ -6,2 +6,4 @@ 'use strict'; | ||
var sendStats = require('./stats'); | ||
var putSentimentClick = require('./conversational-search-interactions-api').putSentimentClick; | ||
var Settings = require('./settings'); | ||
@@ -100,2 +102,13 @@ var util = require('./util'); | ||
/** | ||
* Put a sentiment click value to the conversational search interactions API | ||
* | ||
* @param {string} conversationId Argument 1: Conversation ID | ||
* @param {('positive'|'negative'|'neutral')} sentimentValue Argument 2: Sentiment value (positive, negative, neutral) | ||
* @returns {Promise<boolean|Object>} Resolves to true if successful, rejects with an error object if unsuccessful | ||
*/ | ||
this.putSentimentClick = function (conversationId, sentimentValue) { | ||
return putSentimentClick(this.apiHostname, this.sitekey, conversationId, sentimentValue); | ||
}; | ||
/** | ||
* Fetch search suggestions | ||
@@ -102,0 +115,0 @@ * |
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
163199
1.81%15
7.14%1276
3.91%2
-33.33%