Skip to content

Commit 9478225

Browse files
committed
Support recommending and searching the Item Segments
1 parent 128dbde commit 9478225

24 files changed

+1091
-176
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The library is [UMD](https://github.com/umdjs/umd) compatible.
1515
You can download [recombee-api-client.min.js](./dist/recombee-api-client.min.js) and host it at your site, or use a CDN such as [jsDelivr](https://www.jsdelivr.com/) CDN:
1616

1717
```js
18-
<script src="https://cdn.jsdelivr.net/gh/recombee/js-api-client@4.0.0/dist/recombee-api-client.min.js"></script>
18+
<script src="https://cdn.jsdelivr.net/gh/recombee/js-api-client@4.1.0/dist/recombee-api-client.min.js"></script>
1919
```
2020

2121
### npm
@@ -189,7 +189,7 @@ Let's assume we want to show recommendations at product page of pants `product-2
189189
</div>
190190
</div>
191191

192-
<script src="https://cdn.jsdelivr.net/gh/recombee/js-api-client@4.0.0/dist/recombee-api-client.min.js"></script>
192+
<script src="https://cdn.jsdelivr.net/gh/recombee/js-api-client@4.1.0/dist/recombee-api-client.min.js"></script>
193193

194194
<script type="text/javascript">
195195

dist/recombee-api-client.js

Lines changed: 533 additions & 85 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/recombee-api-client.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/recombee-api-client.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/recombee-api-client.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "recombee-js-api-client",
3-
"version": "4.0.0",
3+
"version": "4.1.0",
44
"description": "Client-side js library for easy use of the Recombee recommendation API",
55
"browser": "./src/index.js",
66
"repository": {

src/api-client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class ApiClient {
7171
var xmlhttp = new XMLHttpRequest();
7272
xmlhttp.open("POST", url, this.async);
7373
xmlhttp.setRequestHeader("Accept", "application/json");
74-
xmlhttp.setRequestHeader("Content-Type", "text/plain");
74+
xmlhttp.setRequestHeader("Content-Type", "application/json");
7575

7676
if ( this.async )
7777
xmlhttp.timeout = request.timeout;

src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@ exports.SetViewPortion = require("./requests/set-view-portion").SetViewPortion;
1717
exports.RecommendItemsToUser = require("./requests/recommend-items-to-user").RecommendItemsToUser;
1818
exports.RecommendItemsToItem = require("./requests/recommend-items-to-item").RecommendItemsToItem;
1919
exports.RecommendNextItems = require("./requests/recommend-next-items").RecommendNextItems;
20+
exports.RecommendItemSegmentsToUser = require("./requests/recommend-item-segments-to-user").RecommendItemSegmentsToUser;
21+
exports.RecommendItemSegmentsToItem = require("./requests/recommend-item-segments-to-item").RecommendItemSegmentsToItem;
22+
exports.RecommendItemSegmentsToItemSegment = require("./requests/recommend-item-segments-to-item-segment").RecommendItemSegmentsToItemSegment;
2023
exports.SearchItems = require("./requests/search-items").SearchItems;
24+
exports.SearchItemSegments = require("./requests/search-item-segments").SearchItemSegments;

src/requests/add-bookmark.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
const rqs = require("./request");
77

88
/**
9-
* Adds a bookmark of a given item made by a given user.
9+
* Adds a bookmark of the given item made by the given user.
1010
*/
1111
class AddBookmark extends rqs.Request {
1212

src/requests/add-cart-addition.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
const rqs = require("./request");
77

88
/**
9-
* Adds a cart addition of a given item made by a given user.
9+
* Adds a cart addition of the given item made by the given user.
1010
*/
1111
class AddCartAddition extends rqs.Request {
1212

@@ -24,10 +24,10 @@ class AddCartAddition extends rqs.Request {
2424
* - Description: Sets whether the given user/item should be created if not present in the database.
2525
* - *amount*
2626
* - Type: number
27-
* - Description: Amount (number) added to cart. The default is 1. For example if `user-x` adds two `item-y` during a single order (session...), the `amount` should equal to 2.
27+
* - Description: Amount (number) added to cart. The default is 1. For example, if `user-x` adds two `item-y` during a single order (session...), the `amount` should equal 2.
2828
* - *price*
2929
* - Type: number
30-
* - Description: Price of the added item. If `amount` is greater than 1, sum of prices of all the items should be given.
30+
* - Description: Price of the added item. If `amount` is greater than 1, the sum of prices of all the items should be given.
3131
* - *recommId*
3232
* - Type: string
3333
* - Description: If this cart addition is based on a recommendation request, `recommId` is the id of the clicked recommendation.

0 commit comments

Comments
 (0)