Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

recombee-api-client

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

recombee-api-client - npm Package Compare versions

Comparing version 1.6.0 to 2.0.0

2

lib/api-client.js

@@ -47,3 +47,3 @@ 'use strict';

'Content-Type': 'application/json',
'User-Agent': 'recombee-node-api-client/1.6.0'},
'User-Agent': 'recombee-node-api-client/2.0.0'},
timeout: request.timeout,

@@ -50,0 +50,0 @@ resolveWithFullResponse: true,

@@ -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.
* @deprecated Deprecated since version 2.0.0. Use RecommendItemsToItem request instead.
*/

@@ -13,0 +14,0 @@ class ItemBasedRecommendation extends rqs.Request {

@@ -9,3 +9,2 @@ /*

/**
* This feature is currently in beta.
* Recommends set of items that are somehow related to one given item, *X*. Typical scenario is when user *A* is viewing *X*. Then you may display items to the user that he might be also interested in. Recommend items to item request gives you Top-N such items, optionally taking the target user *A* into account.

@@ -29,4 +28,4 @@ * It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.

* Do not create some special dummy user for getting recommendations,
* as it could cause mislead the recommendation models,
* leading to wrong recommendations.
* as it could mislead the recommendation models,
* and result in wrong recommendations.
* For anonymous/unregistered users it is possible to use for example their session ID.

@@ -57,3 +56,3 @@ * @param {number} count - Number of items to be recommended (N for the top-N recommendation).

* {
* "recommId": "8ac80708afe9148130528757ebf6aaba",
* "recommId": "0c6189e7-dc1a-429a-b613-192696309361",
* "recomms":

@@ -88,3 +87,3 @@ * [

* {
* "recommId": "c7dbfc503d262b80b77b4949ee9855fb",
* "recommId": "6842c725-a79f-4537-a02c-f34d668a3f80",
* "recomms":

@@ -91,0 +90,0 @@ * [

@@ -9,3 +9,2 @@ /*

/**
* This feature is currently in beta.
* Based on user's past interactions (purchases, ratings, etc.) with the items, recommends top-N items that are most likely to be of high value for a given user.

@@ -40,3 +39,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.

* {
* "recommId": "1644e7b31759a08480da5f3b0a13045b",
* "recommId": "ce52ada4-e4d9-4885-943c-407db2dee837",
* "recomms":

@@ -71,3 +70,3 @@ * [

* {
* "recommId": "e3ba43af1a4e59dd08a00adced1729a7",
* "recommId": "a86ee8d5-cd8e-46d1-886c-8b3771d0520b",
* "recomms":

@@ -74,0 +73,0 @@ * [

@@ -9,3 +9,2 @@ /*

/**
* This feature is currently in beta.
* Recommend users that are likely to be interested in a given item.

@@ -40,3 +39,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.

* {
* "recommId": "9eeebc318508302529e3241f4570834d",
* "recommId": "039b71dc-b9cc-4645-a84f-62b841eecfce",
* "recomms":

@@ -67,3 +66,3 @@ * [

* {
* "recommId": "d4c826635efc3e01a83470008c5697f1",
* "recommId": "b2b355dd-972a-4728-9c6b-2dc229db0678",
* "recomms":

@@ -94,3 +93,3 @@ * [

constructor(itemId, count, optional) {
super('POST', `/recomms/items/${itemId}/users/`, 3000, false);
super('POST', `/recomms/items/${itemId}/users/`, 50000, false);
this.itemId = itemId;

@@ -97,0 +96,0 @@ this.count = count;

@@ -9,3 +9,2 @@ /*

/**
* This feature is currently in beta.
* Get similar users as some given user, based on the user's past interactions (purchases, ratings, etc.) and values of properties.

@@ -40,3 +39,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.

* {
* "recommId": "32fc671480eb29d843e47def43503992",
* "recommId": "9cb9c55d-50ba-4478-84fd-ab456136156e",
* "recomms":

@@ -67,3 +66,3 @@ * [

* {
* "recommId": "27d81ade643621f45cc6ba5d30d7d683",
* "recommId": "b326d82d-5d57-4b45-b362-c9d6f0895855",
* "recomms":

@@ -103,3 +102,3 @@ * [

constructor(userId, count, optional) {
super('POST', `/recomms/users/${userId}/users/`, 3000, false);
super('POST', `/recomms/users/${userId}/users/`, 50000, false);
this.userId = userId;

@@ -106,0 +105,0 @@ this.count = count;

@@ -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.
* @deprecated Deprecated since version 2.0.0. Use RecommendItemsToUser request instead.
*/

@@ -13,0 +14,0 @@ class UserBasedRecommendation extends rqs.Request {

{
"name": "recombee-api-client",
"version": "1.6.0",
"version": "2.0.0",
"description": "Node.js client (SDK) for easy use of the Recombee recommendation API",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -75,5 +75,5 @@ # Recombee API Client

//Get 5 recommended items for user 'user-25'
client.send(new rqs.UserBasedRecommendation('user-25', 5))
client.send(new rqs.RecommendItemsToUser('user-25', 5))
.then((recommended) => {
console.log(`Recommended items for user-25: ${recommended}`);
console.log("Recommended items for user-25: %j", recommended);
});

@@ -85,3 +85,2 @@ })

});
```

@@ -157,27 +156,22 @@

// Get 5 recommendations for user-42, who is currently viewing computer-6
return client.send(new rqs.ItemBasedRecommendation('computer-6', 5,
{'targetUserId': 'user-42'}));
return client.send(new rqs.RecommendItemsToItem('computer-6', 'user-42', 5));
})
.then((recommended) => {
console.log(`Recommended items: ${recommended}`);
console.log("Recommended items: %j", recommended);
// Get 5 recommendations for user-42, but recommend only computers that
// have at least 3 cores
return client.send(new rqs.ItemBasedRecommendation('computer-6', 5,
{'targetUserId': 'user-42',
'filter': "'num-cores'>=3"
}));
// Recommend only computers that have at least 3 cores
return client.send(new rqs.RecommendItemsToItem('computer-6', 'user-42', 5,
{'filter': "'num-cores'>=3"}
));
})
.then((recommended) => {
console.log(`Recommended items with at least 3 processor cores: ${recommended}`);
console.log("Recommended items with at least 3 processor cores: %j", recommended);
// Get 5 recommendations for user-42, but recommend only items that
// are more expensive then currently viewed item (up-sell)
return client.send(new rqs.ItemBasedRecommendation('computer-6', 5,
{'targetUserId': 'user-42',
'filter': "'num-cores'>=3"
}));
// Recommend only items that are more expensive then currently viewed item (up-sell)
return client.send(new rqs.RecommendItemsToItem('computer-6', 'user-42', 5,
{'filter': "'num-cores'>=3"}
));
})
.then((recommended) => {
console.log(`Recommended up-sell items: ${recommended}`)
console.log("Recommended up-sell items: %j", recommended)
})

@@ -184,0 +178,0 @@ .catch((error) => {

@@ -25,3 +25,3 @@ /*

new rqs.AddGroup('valid_id'),
new rqs.AddGroup('...not_valid...'),
new rqs.AddGroup('$$$not_valid$$$'),
new rqs.AddGroup('valid_id2'),

@@ -28,0 +28,0 @@ new rqs.AddGroup('valid_id2')

@@ -38,3 +38,3 @@ /*

let req, req2, resp;
req = new rqs.AddGroup('...not_valid...');
req = new rqs.AddGroup('$$$not_valid$$$');
env.client.send(req,((err,res) => {

@@ -41,0 +41,0 @@ if(err) {

@@ -34,3 +34,3 @@ /*

let req, req2, resp;
req = new rqs.AddGroup('...not_valid...');
req = new rqs.AddGroup('$$$not_valid$$$');
env.client.send(req)

@@ -37,0 +37,0 @@ .then((res) => {

@@ -25,3 +25,3 @@ /*

new rqs.AddItem('valid_id'),
new rqs.AddItem('...not_valid...'),
new rqs.AddItem('$$$not_valid$$$'),
new rqs.AddItem('valid_id2'),

@@ -28,0 +28,0 @@ new rqs.AddItem('valid_id2')

@@ -38,3 +38,3 @@ /*

let req, req2, resp;
req = new rqs.AddItem('...not_valid...');
req = new rqs.AddItem('$$$not_valid$$$');
env.client.send(req,((err,res) => {

@@ -41,0 +41,0 @@ if(err) {

@@ -34,3 +34,3 @@ /*

let req, req2, resp;
req = new rqs.AddItem('...not_valid...');
req = new rqs.AddItem('$$$not_valid$$$');
env.client.send(req)

@@ -37,0 +37,0 @@ .then((res) => {

@@ -25,3 +25,3 @@ /*

new rqs.AddSeries('valid_id'),
new rqs.AddSeries('...not_valid...'),
new rqs.AddSeries('$$$not_valid$$$'),
new rqs.AddSeries('valid_id2'),

@@ -28,0 +28,0 @@ new rqs.AddSeries('valid_id2')

@@ -38,3 +38,3 @@ /*

let req, req2, resp;
req = new rqs.AddSeries('...not_valid...');
req = new rqs.AddSeries('$$$not_valid$$$');
env.client.send(req,((err,res) => {

@@ -41,0 +41,0 @@ if(err) {

@@ -34,3 +34,3 @@ /*

let req, req2, resp;
req = new rqs.AddSeries('...not_valid...');
req = new rqs.AddSeries('$$$not_valid$$$');
env.client.send(req)

@@ -37,0 +37,0 @@ .then((res) => {

@@ -25,3 +25,3 @@ /*

new rqs.AddUser('valid_id'),
new rqs.AddUser('...not_valid...'),
new rqs.AddUser('$$$not_valid$$$'),
new rqs.AddUser('valid_id2'),

@@ -28,0 +28,0 @@ new rqs.AddUser('valid_id2')

@@ -38,3 +38,3 @@ /*

let req, req2, resp;
req = new rqs.AddUser('...not_valid...');
req = new rqs.AddUser('$$$not_valid$$$');
env.client.send(req,((err,res) => {

@@ -41,0 +41,0 @@ if(err) {

@@ -34,3 +34,3 @@ /*

let req, req2, resp;
req = new rqs.AddUser('...not_valid...');
req = new rqs.AddUser('$$$not_valid$$$');
env.client.send(req)

@@ -37,0 +37,0 @@ .then((res) => {

@@ -26,3 +26,3 @@ /*

new rqs.DeleteGroup('entity_id'),
new rqs.DeleteGroup('...not_valid...'),
new rqs.DeleteGroup('$$$not_valid$$$'),
new rqs.DeleteGroup('valid_id')

@@ -29,0 +29,0 @@ ];

@@ -47,3 +47,3 @@ /*

let req, req2, resp;
req = new rqs.DeleteGroup('...not_valid...');
req = new rqs.DeleteGroup('$$$not_valid$$$');
env.client.send(req,((err,res) => {

@@ -50,0 +50,0 @@ if(err) {

@@ -42,3 +42,3 @@ /*

let req, req2, resp;
req = new rqs.DeleteGroup('...not_valid...');
req = new rqs.DeleteGroup('$$$not_valid$$$');
env.client.send(req)

@@ -45,0 +45,0 @@ .then((res) => {

@@ -26,3 +26,3 @@ /*

new rqs.DeleteItem('entity_id'),
new rqs.DeleteItem('...not_valid...'),
new rqs.DeleteItem('$$$not_valid$$$'),
new rqs.DeleteItem('valid_id')

@@ -29,0 +29,0 @@ ];

@@ -47,3 +47,3 @@ /*

let req, req2, resp;
req = new rqs.DeleteItem('...not_valid...');
req = new rqs.DeleteItem('$$$not_valid$$$');
env.client.send(req,((err,res) => {

@@ -50,0 +50,0 @@ if(err) {

@@ -26,3 +26,3 @@ /*

new rqs.DeleteItemProperty('int_property'),
new rqs.DeleteItemProperty('...not_valid...'),
new rqs.DeleteItemProperty('$$$not_valid$$$'),
new rqs.DeleteItemProperty('not_existing')

@@ -29,0 +29,0 @@ ];

@@ -47,3 +47,3 @@ /*

let req, req2, resp;
req = new rqs.DeleteItemProperty('...not_valid...');
req = new rqs.DeleteItemProperty('$$$not_valid$$$');
env.client.send(req,((err,res) => {

@@ -50,0 +50,0 @@ if(err) {

@@ -42,3 +42,3 @@ /*

let req, req2, resp;
req = new rqs.DeleteItemProperty('...not_valid...');
req = new rqs.DeleteItemProperty('$$$not_valid$$$');
env.client.send(req)

@@ -45,0 +45,0 @@ .then((res) => {

@@ -42,3 +42,3 @@ /*

let req, req2, resp;
req = new rqs.DeleteItem('...not_valid...');
req = new rqs.DeleteItem('$$$not_valid$$$');
env.client.send(req)

@@ -45,0 +45,0 @@ .then((res) => {

@@ -26,3 +26,3 @@ /*

new rqs.DeleteSeries('entity_id'),
new rqs.DeleteSeries('...not_valid...'),
new rqs.DeleteSeries('$$$not_valid$$$'),
new rqs.DeleteSeries('valid_id')

@@ -29,0 +29,0 @@ ];

@@ -47,3 +47,3 @@ /*

let req, req2, resp;
req = new rqs.DeleteSeries('...not_valid...');
req = new rqs.DeleteSeries('$$$not_valid$$$');
env.client.send(req,((err,res) => {

@@ -50,0 +50,0 @@ if(err) {

@@ -42,3 +42,3 @@ /*

let req, req2, resp;
req = new rqs.DeleteSeries('...not_valid...');
req = new rqs.DeleteSeries('$$$not_valid$$$');
env.client.send(req)

@@ -45,0 +45,0 @@ .then((res) => {

@@ -26,3 +26,3 @@ /*

new rqs.DeleteUser('entity_id'),
new rqs.DeleteUser('...not_valid...'),
new rqs.DeleteUser('$$$not_valid$$$'),
new rqs.DeleteUser('valid_id')

@@ -29,0 +29,0 @@ ];

@@ -47,3 +47,3 @@ /*

let req, req2, resp;
req = new rqs.DeleteUser('...not_valid...');
req = new rqs.DeleteUser('$$$not_valid$$$');
env.client.send(req,((err,res) => {

@@ -50,0 +50,0 @@ if(err) {

@@ -26,3 +26,3 @@ /*

new rqs.DeleteUserProperty('int_property'),
new rqs.DeleteUserProperty('...not_valid...'),
new rqs.DeleteUserProperty('$$$not_valid$$$'),
new rqs.DeleteUserProperty('not_existing')

@@ -29,0 +29,0 @@ ];

@@ -47,3 +47,3 @@ /*

let req, req2, resp;
req = new rqs.DeleteUserProperty('...not_valid...');
req = new rqs.DeleteUserProperty('$$$not_valid$$$');
env.client.send(req,((err,res) => {

@@ -50,0 +50,0 @@ if(err) {

@@ -42,3 +42,3 @@ /*

let req, req2, resp;
req = new rqs.DeleteUserProperty('...not_valid...');
req = new rqs.DeleteUserProperty('$$$not_valid$$$');
env.client.send(req)

@@ -45,0 +45,0 @@ .then((res) => {

@@ -42,3 +42,3 @@ /*

let req, req2, resp;
req = new rqs.DeleteUser('...not_valid...');
req = new rqs.DeleteUser('$$$not_valid$$$');
env.client.send(req)

@@ -45,0 +45,0 @@ .then((res) => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc