recombee-api-client
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -47,3 +47,3 @@ 'use strict'; | ||
'Content-Type': 'application/json', | ||
'User-Agent': 'recombee-node-api-client/2.2.0'}, | ||
'User-Agent': 'recombee-node-api-client/2.3.0'}, | ||
timeout: request.timeout, | ||
@@ -50,0 +50,0 @@ resolveWithFullResponse: true, |
@@ -28,2 +28,5 @@ /* | ||
* - Description: If this bookmark is based on a recommendation request, `recommId` is the id of the clicked recommendation. | ||
* - *additionalData* | ||
* - Type: | ||
* - Description: A dictionary of additional data for the interaction. | ||
*/ | ||
@@ -38,2 +41,3 @@ constructor(userId, itemId, optional) { | ||
this.recommId = optional.recommId; | ||
this.additionalData = optional.additionalData; | ||
} | ||
@@ -59,2 +63,5 @@ | ||
if(this.additionalData !== undefined) | ||
params.additionalData = this.additionalData; | ||
return params; | ||
@@ -61,0 +68,0 @@ } |
@@ -34,2 +34,5 @@ /* | ||
* - Description: If this cart addition is based on a recommendation request, `recommId` is the id of the clicked recommendation. | ||
* - *additionalData* | ||
* - Type: | ||
* - Description: A dictionary of additional data for the interaction. | ||
*/ | ||
@@ -46,2 +49,3 @@ constructor(userId, itemId, optional) { | ||
this.recommId = optional.recommId; | ||
this.additionalData = optional.additionalData; | ||
} | ||
@@ -73,2 +77,5 @@ | ||
if(this.additionalData !== undefined) | ||
params.additionalData = this.additionalData; | ||
return params; | ||
@@ -75,0 +82,0 @@ } |
@@ -31,2 +31,5 @@ /* | ||
* - Description: If this detail view is based on a recommendation request, `recommId` is the id of the clicked recommendation. | ||
* - *additionalData* | ||
* - Type: | ||
* - Description: A dictionary of additional data for the interaction. | ||
*/ | ||
@@ -42,2 +45,3 @@ constructor(userId, itemId, optional) { | ||
this.recommId = optional.recommId; | ||
this.additionalData = optional.additionalData; | ||
} | ||
@@ -66,2 +70,5 @@ | ||
if(this.additionalData !== undefined) | ||
params.additionalData = this.additionalData; | ||
return params; | ||
@@ -68,0 +75,0 @@ } |
@@ -37,2 +37,5 @@ /* | ||
* - Description: If this purchase is based on a recommendation request, `recommId` is the id of the clicked recommendation. | ||
* - *additionalData* | ||
* - Type: | ||
* - Description: A dictionary of additional data for the interaction. | ||
*/ | ||
@@ -50,2 +53,3 @@ constructor(userId, itemId, optional) { | ||
this.recommId = optional.recommId; | ||
this.additionalData = optional.additionalData; | ||
} | ||
@@ -80,2 +84,5 @@ | ||
if(this.additionalData !== undefined) | ||
params.additionalData = this.additionalData; | ||
return params; | ||
@@ -82,0 +89,0 @@ } |
@@ -29,2 +29,5 @@ /* | ||
* - Description: If this rating is based on a recommendation request, `recommId` is the id of the clicked recommendation. | ||
* - *additionalData* | ||
* - Type: | ||
* - Description: A dictionary of additional data for the interaction. | ||
*/ | ||
@@ -40,2 +43,3 @@ constructor(userId, itemId, rating, optional) { | ||
this.recommId = optional.recommId; | ||
this.additionalData = optional.additionalData; | ||
} | ||
@@ -62,2 +66,5 @@ | ||
if(this.additionalData !== undefined) | ||
params.additionalData = this.additionalData; | ||
return params; | ||
@@ -64,0 +71,0 @@ } |
@@ -11,2 +11,3 @@ /* | ||
* It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters. | ||
* The returned items are sorted by relevancy (first item being the most relevant). | ||
*/ | ||
@@ -120,2 +121,5 @@ class RecommendItemsToItem extends rqs.Request { | ||
* - Description: Dictionary of custom options. | ||
* - *returnAbGroup* | ||
* - Type: boolean | ||
* - Description: If there is a custom AB-testing running, return name of group to which the request belongs. | ||
*/ | ||
@@ -140,2 +144,3 @@ constructor(itemId, targetUserId, count, optional) { | ||
this.expertSettings = optional.expertSettings; | ||
this.returnAbGroup = optional.returnAbGroup; | ||
} | ||
@@ -188,2 +193,5 @@ | ||
if(this.returnAbGroup !== undefined) | ||
params.returnAbGroup = this.returnAbGroup; | ||
return params; | ||
@@ -190,0 +198,0 @@ } |
@@ -11,2 +11,3 @@ /* | ||
* It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters. | ||
* The returned items are sorted by relevancy (first item being the most relevant). | ||
*/ | ||
@@ -104,2 +105,5 @@ class RecommendItemsToUser extends rqs.Request { | ||
* - Description: Dictionary of custom options. | ||
* - *returnAbGroup* | ||
* - Type: boolean | ||
* - Description: If there is a custom AB-testing running, return name of group to which the request belongs. | ||
*/ | ||
@@ -122,2 +126,3 @@ constructor(userId, count, optional) { | ||
this.expertSettings = optional.expertSettings; | ||
this.returnAbGroup = optional.returnAbGroup; | ||
} | ||
@@ -166,2 +171,5 @@ | ||
if(this.returnAbGroup !== undefined) | ||
params.returnAbGroup = this.returnAbGroup; | ||
return params; | ||
@@ -168,0 +176,0 @@ } |
@@ -11,2 +11,3 @@ /* | ||
* It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters. | ||
* The returned users are sorted by predicted interest in the item (first user being the most interested). | ||
*/ | ||
@@ -89,2 +90,5 @@ class RecommendUsersToItem extends rqs.Request { | ||
* - Description: Dictionary of custom options. | ||
* - *returnAbGroup* | ||
* - Type: boolean | ||
* - Description: If there is a custom AB-testing running, return name of group to which the request belongs. | ||
*/ | ||
@@ -104,2 +108,3 @@ constructor(itemId, count, optional) { | ||
this.expertSettings = optional.expertSettings; | ||
this.returnAbGroup = optional.returnAbGroup; | ||
} | ||
@@ -139,2 +144,5 @@ | ||
if(this.returnAbGroup !== undefined) | ||
params.returnAbGroup = this.returnAbGroup; | ||
return params; | ||
@@ -141,0 +149,0 @@ } |
@@ -11,2 +11,3 @@ /* | ||
* It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters. | ||
* The returned users are sorted by similarity (first user being the most similar). | ||
*/ | ||
@@ -98,2 +99,5 @@ class RecommendUsersToUser extends rqs.Request { | ||
* - Description: Dictionary of custom options. | ||
* - *returnAbGroup* | ||
* - Type: boolean | ||
* - Description: If there is a custom AB-testing running, return name of group to which the request belongs. | ||
*/ | ||
@@ -116,2 +120,3 @@ constructor(userId, count, optional) { | ||
this.expertSettings = optional.expertSettings; | ||
this.returnAbGroup = optional.returnAbGroup; | ||
} | ||
@@ -160,2 +165,5 @@ | ||
if(this.returnAbGroup !== undefined) | ||
params.returnAbGroup = this.returnAbGroup; | ||
return params; | ||
@@ -162,0 +170,0 @@ } |
@@ -33,2 +33,5 @@ /* | ||
* - Description: If this view portion is based on a recommendation request, `recommId` is the id of the clicked recommendation. | ||
* - *additionalData* | ||
* - Type: | ||
* - Description: A dictionary of additional data for the interaction. | ||
*/ | ||
@@ -45,2 +48,3 @@ constructor(userId, itemId, portion, optional) { | ||
this.recommId = optional.recommId; | ||
this.additionalData = optional.additionalData; | ||
} | ||
@@ -70,2 +74,5 @@ | ||
if(this.additionalData !== undefined) | ||
params.additionalData = this.additionalData; | ||
return params; | ||
@@ -72,0 +79,0 @@ } |
{ | ||
"name": "recombee-api-client", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "Node.js client (SDK) for easy use of the Recombee recommendation API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# Recombee API Client | ||
A Node.js client (SDK) for easy use of the [Recombee](https://www.recombee.com/) recommendation API. | ||
If you don't have an account at Recombee yet, you can create a free account [here](https://www.recombee.com/). | ||
@@ -9,2 +8,4 @@ | ||
For client side (browser, mobile apps ...) .js library please see [this repository](https://github.com/recombee/js-api-client). | ||
## Installation | ||
@@ -47,3 +48,3 @@ | ||
var client = new recombee.ApiClient('--my-database-id--', '--my-secret-token--'); | ||
var client = new recombee.ApiClient('--my-database-id--', '--db-private-token--'); | ||
@@ -94,3 +95,3 @@ // Prepare some userIDs and itemIDs | ||
var client = new recombee.ApiClient('--my-database-id--', '--my-secret-token--'); | ||
var client = new recombee.ApiClient('--my-database-id--', '--db-private-token--'); | ||
const NUM = 100; | ||
@@ -97,0 +98,0 @@ |
@@ -24,3 +24,3 @@ /* | ||
let requests = [ | ||
new rqs.AddBookmark('u_id','i_id',{'cascadeCreate': true}), | ||
new rqs.AddBookmark('u_id','i_id',{'cascadeCreate': true,'additionalData': {'answer': 42}}), | ||
new rqs.AddBookmark('entity_id','entity_id'), | ||
@@ -27,0 +27,0 @@ new rqs.AddBookmark('entity_id','entity_id',{'timestamp': '2013-10-29T09:38:41.341Z'}), |
@@ -25,3 +25,3 @@ /* | ||
let req, req2, resp; | ||
req = new rqs.AddBookmark('u_id','i_id',{'cascadeCreate': true}); | ||
req = new rqs.AddBookmark('u_id','i_id',{'cascadeCreate': true,'additionalData': {'answer': 42}}); | ||
env.client.send(req,((err,res) => { | ||
@@ -28,0 +28,0 @@ if(err) { |
@@ -25,3 +25,3 @@ /* | ||
let req, req2, resp; | ||
req = new rqs.AddBookmark('u_id','i_id',{'cascadeCreate': true}); | ||
req = new rqs.AddBookmark('u_id','i_id',{'cascadeCreate': true,'additionalData': {'answer': 42}}); | ||
env.client.send(req) | ||
@@ -28,0 +28,0 @@ .then((res) => { |
@@ -24,3 +24,3 @@ /* | ||
let requests = [ | ||
new rqs.AddCartAddition('u_id','i_id',{'cascadeCreate': true}), | ||
new rqs.AddCartAddition('u_id','i_id',{'cascadeCreate': true,'additionalData': {'answer': 42}}), | ||
new rqs.AddCartAddition('entity_id','entity_id'), | ||
@@ -27,0 +27,0 @@ new rqs.AddCartAddition('entity_id','entity_id',{'timestamp': '2013-10-29T09:38:41.341Z'}), |
@@ -25,3 +25,3 @@ /* | ||
let req, req2, resp; | ||
req = new rqs.AddCartAddition('u_id','i_id',{'cascadeCreate': true}); | ||
req = new rqs.AddCartAddition('u_id','i_id',{'cascadeCreate': true,'additionalData': {'answer': 42}}); | ||
env.client.send(req,((err,res) => { | ||
@@ -28,0 +28,0 @@ if(err) { |
@@ -25,3 +25,3 @@ /* | ||
let req, req2, resp; | ||
req = new rqs.AddCartAddition('u_id','i_id',{'cascadeCreate': true}); | ||
req = new rqs.AddCartAddition('u_id','i_id',{'cascadeCreate': true,'additionalData': {'answer': 42}}); | ||
env.client.send(req) | ||
@@ -28,0 +28,0 @@ .then((res) => { |
@@ -24,3 +24,3 @@ /* | ||
let requests = [ | ||
new rqs.AddDetailView('u_id','i_id',{'cascadeCreate': true}), | ||
new rqs.AddDetailView('u_id','i_id',{'cascadeCreate': true,'additionalData': {'answer': 42}}), | ||
new rqs.AddDetailView('entity_id','entity_id'), | ||
@@ -27,0 +27,0 @@ new rqs.AddDetailView('entity_id','entity_id',{'timestamp': '2013-10-29T09:38:41.341Z'}), |
@@ -25,3 +25,3 @@ /* | ||
let req, req2, resp; | ||
req = new rqs.AddDetailView('u_id','i_id',{'cascadeCreate': true}); | ||
req = new rqs.AddDetailView('u_id','i_id',{'cascadeCreate': true,'additionalData': {'answer': 42}}); | ||
env.client.send(req,((err,res) => { | ||
@@ -28,0 +28,0 @@ if(err) { |
@@ -25,3 +25,3 @@ /* | ||
let req, req2, resp; | ||
req = new rqs.AddDetailView('u_id','i_id',{'cascadeCreate': true}); | ||
req = new rqs.AddDetailView('u_id','i_id',{'cascadeCreate': true,'additionalData': {'answer': 42}}); | ||
env.client.send(req) | ||
@@ -28,0 +28,0 @@ .then((res) => { |
@@ -24,3 +24,3 @@ /* | ||
let requests = [ | ||
new rqs.AddPurchase('u_id','i_id',{'cascadeCreate': true}), | ||
new rqs.AddPurchase('u_id','i_id',{'cascadeCreate': true,'additionalData': {'answer': 42}}), | ||
new rqs.AddPurchase('entity_id','entity_id'), | ||
@@ -27,0 +27,0 @@ new rqs.AddPurchase('entity_id','entity_id',{'timestamp': '2013-10-29T09:38:41.341Z'}), |
@@ -25,3 +25,3 @@ /* | ||
let req, req2, resp; | ||
req = new rqs.AddPurchase('u_id','i_id',{'cascadeCreate': true}); | ||
req = new rqs.AddPurchase('u_id','i_id',{'cascadeCreate': true,'additionalData': {'answer': 42}}); | ||
env.client.send(req,((err,res) => { | ||
@@ -28,0 +28,0 @@ if(err) { |
@@ -25,3 +25,3 @@ /* | ||
let req, req2, resp; | ||
req = new rqs.AddPurchase('u_id','i_id',{'cascadeCreate': true}); | ||
req = new rqs.AddPurchase('u_id','i_id',{'cascadeCreate': true,'additionalData': {'answer': 42}}); | ||
env.client.send(req) | ||
@@ -28,0 +28,0 @@ .then((res) => { |
@@ -24,3 +24,3 @@ /* | ||
let requests = [ | ||
new rqs.AddRating('u_id','i_id',1,{'cascadeCreate': true}), | ||
new rqs.AddRating('u_id','i_id',1,{'cascadeCreate': true,'additionalData': {'answer': 42}}), | ||
new rqs.AddRating('entity_id','entity_id',0), | ||
@@ -27,0 +27,0 @@ new rqs.AddRating('entity_id','nonex_id',-1), |
@@ -25,3 +25,3 @@ /* | ||
let req, req2, resp; | ||
req = new rqs.AddRating('u_id','i_id',1,{'cascadeCreate': true}); | ||
req = new rqs.AddRating('u_id','i_id',1,{'cascadeCreate': true,'additionalData': {'answer': 42}}); | ||
env.client.send(req,((err,res) => { | ||
@@ -28,0 +28,0 @@ if(err) { |
@@ -25,3 +25,3 @@ /* | ||
let req, req2, resp; | ||
req = new rqs.AddRating('u_id','i_id',1,{'cascadeCreate': true}); | ||
req = new rqs.AddRating('u_id','i_id',1,{'cascadeCreate': true,'additionalData': {'answer': 42}}); | ||
env.client.send(req) | ||
@@ -28,0 +28,0 @@ .then((res) => { |
@@ -24,3 +24,3 @@ /* | ||
let requests = [ | ||
new rqs.SetViewPortion('u_id','i_id',1,{'cascadeCreate': true}), | ||
new rqs.SetViewPortion('u_id','i_id',1,{'cascadeCreate': true,'additionalData': {'answer': 42}}), | ||
new rqs.SetViewPortion('entity_id','entity_id',0), | ||
@@ -27,0 +27,0 @@ new rqs.SetViewPortion('entity_id','nonex_id',1), |
@@ -25,3 +25,3 @@ /* | ||
let req, req2, resp; | ||
req = new rqs.SetViewPortion('u_id','i_id',1,{'cascadeCreate': true}); | ||
req = new rqs.SetViewPortion('u_id','i_id',1,{'cascadeCreate': true,'additionalData': {'answer': 42}}); | ||
env.client.send(req,((err,res) => { | ||
@@ -28,0 +28,0 @@ if(err) { |
@@ -25,3 +25,3 @@ /* | ||
let req, req2, resp; | ||
req = new rqs.SetViewPortion('u_id','i_id',1,{'cascadeCreate': true}); | ||
req = new rqs.SetViewPortion('u_id','i_id',1,{'cascadeCreate': true,'additionalData': {'answer': 42}}); | ||
env.client.send(req) | ||
@@ -28,0 +28,0 @@ .then((res) => { |
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
370313
12036
189