recombee-api-client 4.0.0 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api-client.js +4 -3
- package/lib/index.d.ts +3202 -0
- package/lib/requests/add-bookmark.js +3 -3
- package/lib/requests/add-cart-addition.js +5 -5
- package/lib/requests/add-detail-view.js +3 -3
- package/lib/requests/add-group.js +1 -1
- package/lib/requests/add-item-property.js +1 -1
- package/lib/requests/add-item.js +2 -2
- package/lib/requests/add-manual-reql-segment.js +58 -0
- package/lib/requests/add-purchase.js +6 -6
- package/lib/requests/add-rating.js +3 -3
- package/lib/requests/add-series.js +1 -1
- package/lib/requests/add-user-property.js +2 -2
- package/lib/requests/create-auto-reql-segmentation.js +66 -0
- package/lib/requests/create-manual-reql-segmentation.js +63 -0
- package/lib/requests/create-property-based-segmentation.js +67 -0
- package/lib/requests/delete-bookmark.js +3 -3
- package/lib/requests/delete-cart-addition.js +3 -3
- package/lib/requests/delete-detail-view.js +3 -3
- package/lib/requests/delete-group.js +2 -2
- package/lib/requests/delete-item.js +2 -2
- package/lib/requests/delete-manual-reql-segment.js +44 -0
- package/lib/requests/delete-more-items.js +4 -4
- package/lib/requests/delete-purchase.js +3 -3
- package/lib/requests/delete-rating.js +2 -2
- package/lib/requests/delete-search-synonym.js +1 -1
- package/lib/requests/delete-segmentation.js +42 -0
- package/lib/requests/delete-series.js +1 -1
- package/lib/requests/delete-user-property.js +1 -1
- package/lib/requests/delete-user.js +1 -1
- package/lib/requests/get-item-values.js +2 -2
- package/lib/requests/get-segmentation.js +42 -0
- package/lib/requests/get-user-values.js +2 -2
- package/lib/requests/index.js +16 -0
- package/lib/requests/insert-to-group.js +2 -2
- package/lib/requests/insert-to-series.js +2 -2
- package/lib/requests/list-group-items.js +1 -1
- package/lib/requests/list-item-bookmarks.js +2 -2
- package/lib/requests/list-item-cart-additions.js +2 -2
- package/lib/requests/list-item-detail-views.js +2 -2
- package/lib/requests/list-item-purchases.js +2 -2
- package/lib/requests/list-item-ratings.js +2 -2
- package/lib/requests/list-item-view-portions.js +2 -2
- package/lib/requests/list-items.js +1 -1
- package/lib/requests/list-segmentations.js +43 -0
- package/lib/requests/list-series-items.js +2 -2
- package/lib/requests/list-user-bookmarks.js +1 -1
- package/lib/requests/list-user-cart-additions.js +1 -1
- package/lib/requests/list-user-detail-views.js +1 -1
- package/lib/requests/list-user-purchases.js +1 -1
- package/lib/requests/list-user-ratings.js +1 -1
- package/lib/requests/list-user-view-portions.js +1 -1
- package/lib/requests/list-users.js +1 -1
- package/lib/requests/merge-users.js +2 -2
- package/lib/requests/recommend-item-segments-to-item-segment.js +125 -0
- package/lib/requests/recommend-item-segments-to-item.js +125 -0
- package/lib/requests/recommend-item-segments-to-user.js +110 -0
- package/lib/requests/recommend-items-to-item.js +28 -28
- package/lib/requests/recommend-items-to-user.js +25 -25
- package/lib/requests/recommend-next-items.js +2 -2
- package/lib/requests/recommend-users-to-item.js +20 -20
- package/lib/requests/recommend-users-to-user.js +23 -23
- package/lib/requests/request.js +0 -1
- package/lib/requests/reset-database.js +1 -1
- package/lib/requests/search-item-segments.js +112 -0
- package/lib/requests/search-items.js +19 -19
- package/lib/requests/set-user-values.js +0 -1
- package/lib/requests/set-view-portion.js +5 -5
- package/lib/requests/update-auto-reql-segmentation.js +66 -0
- package/lib/requests/update-manual-reql-segment.js +57 -0
- package/lib/requests/update-manual-reql-segmentation.js +59 -0
- package/lib/requests/update-more-items.js +4 -4
- package/lib/requests/update-property-based-segmentation.js +66 -0
- package/package.json +2 -1
- package/test/add-manual-reql-segment-batch_test.js +40 -0
- package/test/add-manual-reql-segment-callback_test.js +43 -0
- package/test/add-manual-reql-segment-test.js +35 -0
- package/test/create-auto-reql-segmentation-batch_test.js +35 -0
- package/test/create-auto-reql-segmentation-callback_test.js +45 -0
- package/test/create-auto-reql-segmentation-test.js +43 -0
- package/test/create-manual-reql-segmentation-batch_test.js +35 -0
- package/test/create-manual-reql-segmentation-callback_test.js +45 -0
- package/test/create-manual-reql-segmentation-test.js +43 -0
- package/test/create-property-based-segmentation-batch_test.js +35 -0
- package/test/create-property-based-segmentation-callback_test.js +45 -0
- package/test/create-property-based-segmentation-test.js +43 -0
- package/test/delete-manual-reql-segment-batch_test.js +47 -0
- package/test/delete-manual-reql-segment-callback_test.js +51 -0
- package/test/delete-manual-reql-segment-test.js +39 -0
- package/test/delete-segmentation-batch_test.js +42 -0
- package/test/delete-segmentation-callback_test.js +53 -0
- package/test/delete-segmentation-test.js +47 -0
- package/test/get-segmentation-batch_test.js +41 -0
- package/test/get-segmentation-callback_test.js +44 -0
- package/test/get-segmentation-test.js +36 -0
- package/test/list-segmentations-batch_test.js +41 -0
- package/test/list-segmentations-callback_test.js +44 -0
- package/test/list-segmentations-test.js +36 -0
- package/test/recommend-item-segments-to-item-batch_test.js +33 -0
- package/test/recommend-item-segments-to-item-callback_test.js +37 -0
- package/test/recommend-item-segments-to-item-segment-batch_test.js +33 -0
- package/test/recommend-item-segments-to-item-segment-callback_test.js +37 -0
- package/test/recommend-item-segments-to-item-segment-test.js +39 -0
- package/test/recommend-item-segments-to-item-test.js +39 -0
- package/test/recommend-item-segments-to-user-batch_test.js +33 -0
- package/test/recommend-item-segments-to-user-callback_test.js +37 -0
- package/test/recommend-item-segments-to-user-test.js +39 -0
- package/test/search-item-segments-batch_test.js +33 -0
- package/test/search-item-segments-callback_test.js +37 -0
- package/test/search-item-segments-test.js +39 -0
- package/test/update-auto-reql-segmentation-batch_test.js +40 -0
- package/test/update-auto-reql-segmentation-callback_test.js +43 -0
- package/test/update-auto-reql-segmentation-test.js +35 -0
- package/test/update-manual-reql-segment-batch_test.js +47 -0
- package/test/update-manual-reql-segment-callback_test.js +51 -0
- package/test/update-manual-reql-segment-test.js +39 -0
- package/test/update-manual-reql-segmentation-batch_test.js +40 -0
- package/test/update-manual-reql-segmentation-callback_test.js +43 -0
- package/test/update-manual-reql-segmentation-test.js +35 -0
- package/test/update-property-based-segmentation-batch_test.js +40 -0
- package/test/update-property-based-segmentation-callback_test.js +43 -0
- package/test/update-property-based-segmentation-test.js +35 -0
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const rqs = require("./request");
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Adds a bookmark of
|
|
9
|
+
* Adds a bookmark of the given item made by the given user.
|
|
10
10
|
*/
|
|
11
11
|
class AddBookmark extends rqs.Request {
|
|
12
12
|
|
|
@@ -17,7 +17,7 @@ class AddBookmark extends rqs.Request {
|
|
|
17
17
|
* @param {Object} optional - Optional parameters given as an object with structure name of the parameter: value
|
|
18
18
|
* - Allowed parameters:
|
|
19
19
|
* - *timestamp*
|
|
20
|
-
* - Type: string|number
|
|
20
|
+
* - Type: string | number
|
|
21
21
|
* - Description: UTC timestamp of the bookmark as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
|
|
22
22
|
* - *cascadeCreate*
|
|
23
23
|
* - Type: boolean
|
|
@@ -26,7 +26,7 @@ class AddBookmark extends rqs.Request {
|
|
|
26
26
|
* - Type: string
|
|
27
27
|
* - Description: If this bookmark is based on a recommendation request, `recommId` is the id of the clicked recommendation.
|
|
28
28
|
* - *additionalData*
|
|
29
|
-
* - Type:
|
|
29
|
+
* - Type: object
|
|
30
30
|
* - Description: A dictionary of additional data for the interaction.
|
|
31
31
|
*/
|
|
32
32
|
constructor(userId, itemId, optional) {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const rqs = require("./request");
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Adds a cart addition of
|
|
9
|
+
* Adds a cart addition of the given item made by the given user.
|
|
10
10
|
*/
|
|
11
11
|
class AddCartAddition extends rqs.Request {
|
|
12
12
|
|
|
@@ -17,22 +17,22 @@ class AddCartAddition extends rqs.Request {
|
|
|
17
17
|
* @param {Object} optional - Optional parameters given as an object with structure name of the parameter: value
|
|
18
18
|
* - Allowed parameters:
|
|
19
19
|
* - *timestamp*
|
|
20
|
-
* - Type: string|number
|
|
20
|
+
* - Type: string | number
|
|
21
21
|
* - Description: UTC timestamp of the cart addition as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
|
|
22
22
|
* - *cascadeCreate*
|
|
23
23
|
* - Type: boolean
|
|
24
24
|
* - Description: Sets whether the given user/item should be created if not present in the database.
|
|
25
25
|
* - *amount*
|
|
26
26
|
* - 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
|
|
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.
|
|
28
28
|
* - *price*
|
|
29
29
|
* - 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.
|
|
31
31
|
* - *recommId*
|
|
32
32
|
* - Type: string
|
|
33
33
|
* - Description: If this cart addition is based on a recommendation request, `recommId` is the id of the clicked recommendation.
|
|
34
34
|
* - *additionalData*
|
|
35
|
-
* - Type:
|
|
35
|
+
* - Type: object
|
|
36
36
|
* - Description: A dictionary of additional data for the interaction.
|
|
37
37
|
*/
|
|
38
38
|
constructor(userId, itemId, optional) {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const rqs = require("./request");
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Adds a detail view of
|
|
9
|
+
* Adds a detail view of the given item made by the given user.
|
|
10
10
|
*/
|
|
11
11
|
class AddDetailView extends rqs.Request {
|
|
12
12
|
|
|
@@ -17,7 +17,7 @@ class AddDetailView extends rqs.Request {
|
|
|
17
17
|
* @param {Object} optional - Optional parameters given as an object with structure name of the parameter: value
|
|
18
18
|
* - Allowed parameters:
|
|
19
19
|
* - *timestamp*
|
|
20
|
-
* - Type: string|number
|
|
20
|
+
* - Type: string | number
|
|
21
21
|
* - Description: UTC timestamp of the view as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
|
|
22
22
|
* - *duration*
|
|
23
23
|
* - Type: number
|
|
@@ -29,7 +29,7 @@ class AddDetailView extends rqs.Request {
|
|
|
29
29
|
* - Type: string
|
|
30
30
|
* - Description: If this detail view is based on a recommendation request, `recommId` is the id of the clicked recommendation.
|
|
31
31
|
* - *additionalData*
|
|
32
|
-
* - Type:
|
|
32
|
+
* - Type: object
|
|
33
33
|
* - Description: A dictionary of additional data for the interaction.
|
|
34
34
|
*/
|
|
35
35
|
constructor(userId, itemId, optional) {
|
|
@@ -12,7 +12,7 @@ class AddItemProperty extends rqs.Request {
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Construct the request
|
|
15
|
-
* @param {string} propertyName - Name of the item property to be created. Currently, the following names are reserved
|
|
15
|
+
* @param {string} propertyName - Name of the item property to be created. Currently, the following names are reserved: `id`, `itemid`, case-insensitively. Also, the length of the property name must not exceed 63 characters.
|
|
16
16
|
* @param {string} type - Value type of the item property to be created. One of: `int`, `double`, `string`, `boolean`, `timestamp`, `set`, `image` or `imageList`.
|
|
17
17
|
* * `int`- Signed integer number.
|
|
18
18
|
* * `double` - Floating point number. It uses 64-bit base-2 format (IEEE 754 standard).
|
package/lib/requests/add-item.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
const rqs = require("./request");
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Adds new item of given `itemId` to the items catalog.
|
|
10
|
-
* All the item properties for the newly created items are set null.
|
|
9
|
+
* Adds new item of the given `itemId` to the items catalog.
|
|
10
|
+
* All the item properties for the newly created items are set to null.
|
|
11
11
|
*/
|
|
12
12
|
class AddItem extends rqs.Request {
|
|
13
13
|
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
This file is auto-generated, do not edit
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
'use strict';
|
|
6
|
+
const rqs = require("./request");
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Adds a new Segment into a Manual ReQL Segmentation.
|
|
10
|
+
* The new Segment is defined by a [ReQL](https://docs.recombee.com/reql.html) filter that returns `true` for an item in case that this item belongs to the segment.
|
|
11
|
+
*/
|
|
12
|
+
class AddManualReqlSegment extends rqs.Request {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Construct the request
|
|
16
|
+
* @param {string} segmentationId - ID of the Segmentation to which the new Segment should be added
|
|
17
|
+
* @param {string} segmentId - ID of the newly created Segment
|
|
18
|
+
* @param {string} filter - ReQL filter that returns `true` for items that belong to this Segment. Otherwise returns `false`.
|
|
19
|
+
* @param {Object} optional - Optional parameters given as an object with structure name of the parameter: value
|
|
20
|
+
* - Allowed parameters:
|
|
21
|
+
* - *title*
|
|
22
|
+
* - Type: string
|
|
23
|
+
* - Description: Human-readable name of the Segment that is shown in the Recombee Admin UI.
|
|
24
|
+
*/
|
|
25
|
+
constructor(segmentationId, segmentId, filter, optional) {
|
|
26
|
+
super('PUT', `/segmentations/manual-reql/${segmentationId}/segments/${segmentId}`, 10000, false);
|
|
27
|
+
this.segmentationId = segmentationId;
|
|
28
|
+
this.segmentId = segmentId;
|
|
29
|
+
this.filter = filter;
|
|
30
|
+
optional = optional || {};
|
|
31
|
+
this.title = optional.title;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Get body parameters
|
|
36
|
+
* @return {Object} The values of body parameters (name of parameter: value of the parameter)
|
|
37
|
+
*/
|
|
38
|
+
bodyParameters() {
|
|
39
|
+
let params = {};
|
|
40
|
+
params.filter = this.filter;
|
|
41
|
+
|
|
42
|
+
if(this.title !== undefined)
|
|
43
|
+
params.title = this.title;
|
|
44
|
+
|
|
45
|
+
return params;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get query parameters
|
|
50
|
+
* @return {Object} The values of query parameters (name of parameter: value of the parameter)
|
|
51
|
+
*/
|
|
52
|
+
queryParameters() {
|
|
53
|
+
let params = {};
|
|
54
|
+
return params;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
exports.AddManualReqlSegment = AddManualReqlSegment
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const rqs = require("./request");
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Adds a purchase of
|
|
9
|
+
* Adds a purchase of the given item made by the given user.
|
|
10
10
|
*/
|
|
11
11
|
class AddPurchase extends rqs.Request {
|
|
12
12
|
|
|
@@ -17,25 +17,25 @@ class AddPurchase extends rqs.Request {
|
|
|
17
17
|
* @param {Object} optional - Optional parameters given as an object with structure name of the parameter: value
|
|
18
18
|
* - Allowed parameters:
|
|
19
19
|
* - *timestamp*
|
|
20
|
-
* - Type: string|number
|
|
20
|
+
* - Type: string | number
|
|
21
21
|
* - Description: UTC timestamp of the purchase as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
|
|
22
22
|
* - *cascadeCreate*
|
|
23
23
|
* - Type: boolean
|
|
24
24
|
* - Description: Sets whether the given user/item should be created if not present in the database.
|
|
25
25
|
* - *amount*
|
|
26
26
|
* - Type: number
|
|
27
|
-
* - Description: Amount (number) of purchased items. The default is 1. For example if `user-x` purchases two `item-y` during a single order (session...), the `amount` should equal
|
|
27
|
+
* - Description: Amount (number) of purchased items. The default is 1. For example, if `user-x` purchases two `item-y` during a single order (session...), the `amount` should equal 2.
|
|
28
28
|
* - *price*
|
|
29
29
|
* - Type: number
|
|
30
|
-
* - Description: Price paid by the user for the item. If `amount` is greater than 1, sum of prices of all the items should be given.
|
|
30
|
+
* - Description: Price paid by the user for the item. If `amount` is greater than 1, the sum of prices of all the items should be given.
|
|
31
31
|
* - *profit*
|
|
32
32
|
* - Type: number
|
|
33
|
-
* - Description: Your profit from the purchased item. The profit is natural in e-commerce domain (for example if `user-x` purchases `item-y` for $100 and the gross margin is 30 %, then the profit is $30)
|
|
33
|
+
* - Description: Your profit from the purchased item. The profit is natural in the e-commerce domain (for example, if `user-x` purchases `item-y` for $100 and the gross margin is 30 %, then the profit is $30) but is also applicable in other domains (for example, at a news company it may be income from a displayed advertisement on article page). If `amount` is greater than 1, the sum of profit of all the items should be given.
|
|
34
34
|
* - *recommId*
|
|
35
35
|
* - Type: string
|
|
36
36
|
* - Description: If this purchase is based on a recommendation request, `recommId` is the id of the clicked recommendation.
|
|
37
37
|
* - *additionalData*
|
|
38
|
-
* - Type:
|
|
38
|
+
* - Type: object
|
|
39
39
|
* - Description: A dictionary of additional data for the interaction.
|
|
40
40
|
*/
|
|
41
41
|
constructor(userId, itemId, optional) {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const rqs = require("./request");
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Adds a rating of given item made by
|
|
9
|
+
* Adds a rating of the given item made by the given user.
|
|
10
10
|
*/
|
|
11
11
|
class AddRating extends rqs.Request {
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ class AddRating extends rqs.Request {
|
|
|
18
18
|
* @param {Object} optional - Optional parameters given as an object with structure name of the parameter: value
|
|
19
19
|
* - Allowed parameters:
|
|
20
20
|
* - *timestamp*
|
|
21
|
-
* - Type: string|number
|
|
21
|
+
* - Type: string | number
|
|
22
22
|
* - Description: UTC timestamp of the rating as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
|
|
23
23
|
* - *cascadeCreate*
|
|
24
24
|
* - Type: boolean
|
|
@@ -27,7 +27,7 @@ class AddRating extends rqs.Request {
|
|
|
27
27
|
* - Type: string
|
|
28
28
|
* - Description: If this rating is based on a recommendation request, `recommId` is the id of the clicked recommendation.
|
|
29
29
|
* - *additionalData*
|
|
30
|
-
* - Type:
|
|
30
|
+
* - Type: object
|
|
31
31
|
* - Description: A dictionary of additional data for the interaction.
|
|
32
32
|
*/
|
|
33
33
|
constructor(userId, itemId, rating, optional) {
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
const rqs = require("./request");
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Adding
|
|
9
|
+
* Adding a user property is somehow equivalent to adding a column to the table of users. The users may be characterized by various properties of different types.
|
|
10
10
|
*/
|
|
11
11
|
class AddUserProperty extends rqs.Request {
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Construct the request
|
|
15
|
-
* @param {string} propertyName - Name of the user property to be created. Currently, the following names are reserved
|
|
15
|
+
* @param {string} propertyName - Name of the user property to be created. Currently, the following names are reserved: `id`, `userid`, case-insensitively. Also, the length of the property name must not exceed 63 characters.
|
|
16
16
|
* @param {string} type - Value type of the user property to be created. One of: `int`, `double`, `string`, `boolean`, `timestamp`, `set`.
|
|
17
17
|
* * `int` - Signed integer number.
|
|
18
18
|
* * `double` - Floating point number. It uses 64-bit base-2 format (IEEE 754 standard).
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/*
|
|
2
|
+
This file is auto-generated, do not edit
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
'use strict';
|
|
6
|
+
const rqs = require("./request");
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Segment the items using a [ReQL](https://docs.recombee.com/reql.html) expression.
|
|
10
|
+
* For each item, the expression should return a set that contains IDs of segments to which the item belongs to.
|
|
11
|
+
*/
|
|
12
|
+
class CreateAutoReqlSegmentation extends rqs.Request {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Construct the request
|
|
16
|
+
* @param {string} segmentationId - ID of the newly created Segmentation
|
|
17
|
+
* @param {string} sourceType - What type of data should be segmented. Currently only `items` are supported.
|
|
18
|
+
* @param {string} expression - ReQL expression that returns for each item a set with IDs of segments to which the item belongs
|
|
19
|
+
* @param {Object} optional - Optional parameters given as an object with structure name of the parameter: value
|
|
20
|
+
* - Allowed parameters:
|
|
21
|
+
* - *title*
|
|
22
|
+
* - Type: string
|
|
23
|
+
* - Description: Human-readable name that is shown in the Recombee Admin UI.
|
|
24
|
+
* - *description*
|
|
25
|
+
* - Type: string
|
|
26
|
+
* - Description: Description that is shown in the Recombee Admin UI.
|
|
27
|
+
*/
|
|
28
|
+
constructor(segmentationId, sourceType, expression, optional) {
|
|
29
|
+
super('PUT', `/segmentations/auto-reql/${segmentationId}`, 10000, false);
|
|
30
|
+
this.segmentationId = segmentationId;
|
|
31
|
+
this.sourceType = sourceType;
|
|
32
|
+
this.expression = expression;
|
|
33
|
+
optional = optional || {};
|
|
34
|
+
this.title = optional.title;
|
|
35
|
+
this.description = optional.description;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Get body parameters
|
|
40
|
+
* @return {Object} The values of body parameters (name of parameter: value of the parameter)
|
|
41
|
+
*/
|
|
42
|
+
bodyParameters() {
|
|
43
|
+
let params = {};
|
|
44
|
+
params.sourceType = this.sourceType;
|
|
45
|
+
params.expression = this.expression;
|
|
46
|
+
|
|
47
|
+
if(this.title !== undefined)
|
|
48
|
+
params.title = this.title;
|
|
49
|
+
|
|
50
|
+
if(this.description !== undefined)
|
|
51
|
+
params.description = this.description;
|
|
52
|
+
|
|
53
|
+
return params;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Get query parameters
|
|
58
|
+
* @return {Object} The values of query parameters (name of parameter: value of the parameter)
|
|
59
|
+
*/
|
|
60
|
+
queryParameters() {
|
|
61
|
+
let params = {};
|
|
62
|
+
return params;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
exports.CreateAutoReqlSegmentation = CreateAutoReqlSegmentation
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
This file is auto-generated, do not edit
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
'use strict';
|
|
6
|
+
const rqs = require("./request");
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Segment the items using multiple [ReQL](https://docs.recombee.com/reql.html) filters.
|
|
10
|
+
* Use the Add Manual ReQL Items Segment endpoint to create the individual segments.
|
|
11
|
+
*/
|
|
12
|
+
class CreateManualReqlSegmentation extends rqs.Request {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Construct the request
|
|
16
|
+
* @param {string} segmentationId - ID of the newly created Segmentation
|
|
17
|
+
* @param {string} sourceType - What type of data should be segmented. Currently only `items` are supported.
|
|
18
|
+
* @param {Object} optional - Optional parameters given as an object with structure name of the parameter: value
|
|
19
|
+
* - Allowed parameters:
|
|
20
|
+
* - *title*
|
|
21
|
+
* - Type: string
|
|
22
|
+
* - Description: Human-readable name that is shown in the Recombee Admin UI.
|
|
23
|
+
* - *description*
|
|
24
|
+
* - Type: string
|
|
25
|
+
* - Description: Description that is shown in the Recombee Admin UI.
|
|
26
|
+
*/
|
|
27
|
+
constructor(segmentationId, sourceType, optional) {
|
|
28
|
+
super('PUT', `/segmentations/manual-reql/${segmentationId}`, 10000, false);
|
|
29
|
+
this.segmentationId = segmentationId;
|
|
30
|
+
this.sourceType = sourceType;
|
|
31
|
+
optional = optional || {};
|
|
32
|
+
this.title = optional.title;
|
|
33
|
+
this.description = optional.description;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Get body parameters
|
|
38
|
+
* @return {Object} The values of body parameters (name of parameter: value of the parameter)
|
|
39
|
+
*/
|
|
40
|
+
bodyParameters() {
|
|
41
|
+
let params = {};
|
|
42
|
+
params.sourceType = this.sourceType;
|
|
43
|
+
|
|
44
|
+
if(this.title !== undefined)
|
|
45
|
+
params.title = this.title;
|
|
46
|
+
|
|
47
|
+
if(this.description !== undefined)
|
|
48
|
+
params.description = this.description;
|
|
49
|
+
|
|
50
|
+
return params;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Get query parameters
|
|
55
|
+
* @return {Object} The values of query parameters (name of parameter: value of the parameter)
|
|
56
|
+
*/
|
|
57
|
+
queryParameters() {
|
|
58
|
+
let params = {};
|
|
59
|
+
return params;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
exports.CreateManualReqlSegmentation = CreateManualReqlSegmentation
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*
|
|
2
|
+
This file is auto-generated, do not edit
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
'use strict';
|
|
6
|
+
const rqs = require("./request");
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Creates a Segmentation that splits the items into segments based on values of a particular item property.
|
|
10
|
+
* A segment is created for each unique value of the property.
|
|
11
|
+
* In case of `set` properties, a segment is created for each value in the set. Item belongs to all these segments.
|
|
12
|
+
*/
|
|
13
|
+
class CreatePropertyBasedSegmentation extends rqs.Request {
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Construct the request
|
|
17
|
+
* @param {string} segmentationId - ID of the newly created Segmentation
|
|
18
|
+
* @param {string} sourceType - What type of data should be segmented. Currently only `items` are supported.
|
|
19
|
+
* @param {string} propertyName - Name of the property on which the Segmentation should be based
|
|
20
|
+
* @param {Object} optional - Optional parameters given as an object with structure name of the parameter: value
|
|
21
|
+
* - Allowed parameters:
|
|
22
|
+
* - *title*
|
|
23
|
+
* - Type: string
|
|
24
|
+
* - Description: Human-readable name that is shown in the Recombee Admin UI.
|
|
25
|
+
* - *description*
|
|
26
|
+
* - Type: string
|
|
27
|
+
* - Description: Description that is shown in the Recombee Admin UI.
|
|
28
|
+
*/
|
|
29
|
+
constructor(segmentationId, sourceType, propertyName, optional) {
|
|
30
|
+
super('PUT', `/segmentations/property-based/${segmentationId}`, 10000, false);
|
|
31
|
+
this.segmentationId = segmentationId;
|
|
32
|
+
this.sourceType = sourceType;
|
|
33
|
+
this.propertyName = propertyName;
|
|
34
|
+
optional = optional || {};
|
|
35
|
+
this.title = optional.title;
|
|
36
|
+
this.description = optional.description;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Get body parameters
|
|
41
|
+
* @return {Object} The values of body parameters (name of parameter: value of the parameter)
|
|
42
|
+
*/
|
|
43
|
+
bodyParameters() {
|
|
44
|
+
let params = {};
|
|
45
|
+
params.sourceType = this.sourceType;
|
|
46
|
+
params.propertyName = this.propertyName;
|
|
47
|
+
|
|
48
|
+
if(this.title !== undefined)
|
|
49
|
+
params.title = this.title;
|
|
50
|
+
|
|
51
|
+
if(this.description !== undefined)
|
|
52
|
+
params.description = this.description;
|
|
53
|
+
|
|
54
|
+
return params;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Get query parameters
|
|
59
|
+
* @return {Object} The values of query parameters (name of parameter: value of the parameter)
|
|
60
|
+
*/
|
|
61
|
+
queryParameters() {
|
|
62
|
+
let params = {};
|
|
63
|
+
return params;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
exports.CreatePropertyBasedSegmentation = CreatePropertyBasedSegmentation
|
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
const rqs = require("./request");
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Deletes a bookmark uniquely specified by `userId`, `itemId`, and `timestamp` or all the bookmarks with given `userId` and `itemId` if `timestamp` is omitted.
|
|
9
|
+
* Deletes a bookmark uniquely specified by `userId`, `itemId`, and `timestamp` or all the bookmarks with the given `userId` and `itemId` if `timestamp` is omitted.
|
|
10
10
|
*/
|
|
11
11
|
class DeleteBookmark extends rqs.Request {
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Construct the request
|
|
15
15
|
* @param {string} userId - ID of the user who made the bookmark.
|
|
16
|
-
* @param {string} itemId - ID of the item
|
|
16
|
+
* @param {string} itemId - ID of the item which was bookmarked.
|
|
17
17
|
* @param {Object} optional - Optional parameters given as an object with structure name of the parameter: value
|
|
18
18
|
* - Allowed parameters:
|
|
19
19
|
* - *timestamp*
|
|
20
20
|
* - Type: number
|
|
21
|
-
* - Description: Unix timestamp of the bookmark. If the `timestamp` is omitted, then all the bookmarks with given `userId` and `itemId` are deleted.
|
|
21
|
+
* - Description: Unix timestamp of the bookmark. If the `timestamp` is omitted, then all the bookmarks with the given `userId` and `itemId` are deleted.
|
|
22
22
|
*/
|
|
23
23
|
constructor(userId, itemId, optional) {
|
|
24
24
|
super('DELETE', '/bookmarks/', 1000, false);
|
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
const rqs = require("./request");
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Deletes an existing cart addition uniquely specified by `userId`, `itemId`, and `timestamp` or all the cart additions with given `userId` and `itemId` if `timestamp` is omitted.
|
|
9
|
+
* Deletes an existing cart addition uniquely specified by `userId`, `itemId`, and `timestamp` or all the cart additions with the given `userId` and `itemId` if `timestamp` is omitted.
|
|
10
10
|
*/
|
|
11
11
|
class DeleteCartAddition extends rqs.Request {
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Construct the request
|
|
15
15
|
* @param {string} userId - ID of the user who made the cart addition.
|
|
16
|
-
* @param {string} itemId - ID of the item
|
|
16
|
+
* @param {string} itemId - ID of the item which was added to the cart.
|
|
17
17
|
* @param {Object} optional - Optional parameters given as an object with structure name of the parameter: value
|
|
18
18
|
* - Allowed parameters:
|
|
19
19
|
* - *timestamp*
|
|
20
20
|
* - Type: number
|
|
21
|
-
* - Description: Unix timestamp of the cart addition. If the `timestamp` is omitted, then all the cart additions with given `userId` and `itemId` are deleted.
|
|
21
|
+
* - Description: Unix timestamp of the cart addition. If the `timestamp` is omitted, then all the cart additions with the given `userId` and `itemId` are deleted.
|
|
22
22
|
*/
|
|
23
23
|
constructor(userId, itemId, optional) {
|
|
24
24
|
super('DELETE', '/cartadditions/', 1000, false);
|
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
const rqs = require("./request");
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Deletes an existing detail view uniquely specified by (`userId`, `itemId`, and `timestamp`) or all the detail views with given `userId` and `itemId` if `timestamp` is omitted.
|
|
9
|
+
* Deletes an existing detail view uniquely specified by (`userId`, `itemId`, and `timestamp`) or all the detail views with the given `userId` and `itemId` if `timestamp` is omitted.
|
|
10
10
|
*/
|
|
11
11
|
class DeleteDetailView extends rqs.Request {
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Construct the request
|
|
15
15
|
* @param {string} userId - ID of the user who made the detail view.
|
|
16
|
-
* @param {string} itemId - ID of the item
|
|
16
|
+
* @param {string} itemId - ID of the item whose details were viewed.
|
|
17
17
|
* @param {Object} optional - Optional parameters given as an object with structure name of the parameter: value
|
|
18
18
|
* - Allowed parameters:
|
|
19
19
|
* - *timestamp*
|
|
20
20
|
* - Type: number
|
|
21
|
-
* - Description: Unix timestamp of the detail view. If the `timestamp` is omitted, then all the detail views with given `userId` and `itemId` are deleted.
|
|
21
|
+
* - Description: Unix timestamp of the detail view. If the `timestamp` is omitted, then all the detail views with the given `userId` and `itemId` are deleted.
|
|
22
22
|
*/
|
|
23
23
|
constructor(userId, itemId, optional) {
|
|
24
24
|
super('DELETE', '/detailviews/', 1000, false);
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
const rqs = require("./request");
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Deletes the group of given `groupId` from the database.
|
|
10
|
-
* Deleting a group will only delete assignment of items to it, not the items themselves!
|
|
9
|
+
* Deletes the group of the given `groupId` from the database.
|
|
10
|
+
* Deleting a group will only delete the assignment of items to it, not the items themselves!
|
|
11
11
|
*/
|
|
12
12
|
class DeleteGroup extends rqs.Request {
|
|
13
13
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
const rqs = require("./request");
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Deletes an item of given `itemId` from the catalog.
|
|
10
|
-
* If there are any *purchases*, *ratings*, *bookmarks*, *cart additions
|
|
9
|
+
* Deletes an item of the given `itemId` from the catalog.
|
|
10
|
+
* If there are any *purchases*, *ratings*, *bookmarks*, *cart additions*, or *detail views* of the item present in the database, they will be deleted in cascade as well. Also, if the item is present in some *series*, it will be removed from all the *series* where present.
|
|
11
11
|
* If an item becomes obsolete/no longer available, it is meaningful to keep it in the catalog (along with all the interaction data, which are very useful), and **only exclude the item from recommendations**. In such a case, use [ReQL filter](https://docs.recombee.com/reql.html) instead of deleting the item completely.
|
|
12
12
|
*/
|
|
13
13
|
class DeleteItem extends rqs.Request {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
This file is auto-generated, do not edit
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
'use strict';
|
|
6
|
+
const rqs = require("./request");
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Delete a Segment from a Manual ReQL Segmentation.
|
|
10
|
+
*/
|
|
11
|
+
class DeleteManualReqlSegment extends rqs.Request {
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Construct the request
|
|
15
|
+
* @param {string} segmentationId - ID of the Segmentation from which the Segment should be deleted
|
|
16
|
+
* @param {string} segmentId - ID of the Segment that should be deleted
|
|
17
|
+
*/
|
|
18
|
+
constructor(segmentationId, segmentId) {
|
|
19
|
+
super('DELETE', `/segmentations/manual-reql/${segmentationId}/segments/${segmentId}`, 10000, false);
|
|
20
|
+
this.segmentationId = segmentationId;
|
|
21
|
+
this.segmentId = segmentId;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Get body parameters
|
|
26
|
+
* @return {Object} The values of body parameters (name of parameter: value of the parameter)
|
|
27
|
+
*/
|
|
28
|
+
bodyParameters() {
|
|
29
|
+
let params = {};
|
|
30
|
+
|
|
31
|
+
return params;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Get query parameters
|
|
36
|
+
* @return {Object} The values of query parameters (name of parameter: value of the parameter)
|
|
37
|
+
*/
|
|
38
|
+
queryParameters() {
|
|
39
|
+
let params = {};
|
|
40
|
+
return params;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
exports.DeleteManualReqlSegment = DeleteManualReqlSegment
|
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
const rqs = require("./request");
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* If an item becomes obsolete/no longer available, it is meaningful to **keep it in the catalog** (along with all the interaction data, which are very useful)
|
|
9
|
+
* Deletes all the items that pass the filter.
|
|
10
|
+
* If an item becomes obsolete/no longer available, it is meaningful to **keep it in the catalog** (along with all the interaction data, which are very useful) and **only exclude the item from recommendations**. In such a case, use [ReQL filter](https://docs.recombee.com/reql.html) instead of deleting the item completely.
|
|
11
11
|
*/
|
|
12
12
|
class DeleteMoreItems extends rqs.Request {
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Construct the request
|
|
16
|
-
* @param {string} filter - A [ReQL](https://docs.recombee.com/reql.html) expression, which
|
|
16
|
+
* @param {string} filter - A [ReQL](https://docs.recombee.com/reql.html) expression, which returns `true` for the items that shall be updated.
|
|
17
17
|
*/
|
|
18
18
|
constructor(filter) {
|
|
19
|
-
super('DELETE', '/more-items/',
|
|
19
|
+
super('DELETE', '/more-items/', 100000, false);
|
|
20
20
|
this.filter = filter;
|
|
21
21
|
}
|
|
22
22
|
|