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.
Files changed (122) hide show
  1. package/lib/api-client.js +4 -3
  2. package/lib/index.d.ts +3202 -0
  3. package/lib/requests/add-bookmark.js +3 -3
  4. package/lib/requests/add-cart-addition.js +5 -5
  5. package/lib/requests/add-detail-view.js +3 -3
  6. package/lib/requests/add-group.js +1 -1
  7. package/lib/requests/add-item-property.js +1 -1
  8. package/lib/requests/add-item.js +2 -2
  9. package/lib/requests/add-manual-reql-segment.js +58 -0
  10. package/lib/requests/add-purchase.js +6 -6
  11. package/lib/requests/add-rating.js +3 -3
  12. package/lib/requests/add-series.js +1 -1
  13. package/lib/requests/add-user-property.js +2 -2
  14. package/lib/requests/create-auto-reql-segmentation.js +66 -0
  15. package/lib/requests/create-manual-reql-segmentation.js +63 -0
  16. package/lib/requests/create-property-based-segmentation.js +67 -0
  17. package/lib/requests/delete-bookmark.js +3 -3
  18. package/lib/requests/delete-cart-addition.js +3 -3
  19. package/lib/requests/delete-detail-view.js +3 -3
  20. package/lib/requests/delete-group.js +2 -2
  21. package/lib/requests/delete-item.js +2 -2
  22. package/lib/requests/delete-manual-reql-segment.js +44 -0
  23. package/lib/requests/delete-more-items.js +4 -4
  24. package/lib/requests/delete-purchase.js +3 -3
  25. package/lib/requests/delete-rating.js +2 -2
  26. package/lib/requests/delete-search-synonym.js +1 -1
  27. package/lib/requests/delete-segmentation.js +42 -0
  28. package/lib/requests/delete-series.js +1 -1
  29. package/lib/requests/delete-user-property.js +1 -1
  30. package/lib/requests/delete-user.js +1 -1
  31. package/lib/requests/get-item-values.js +2 -2
  32. package/lib/requests/get-segmentation.js +42 -0
  33. package/lib/requests/get-user-values.js +2 -2
  34. package/lib/requests/index.js +16 -0
  35. package/lib/requests/insert-to-group.js +2 -2
  36. package/lib/requests/insert-to-series.js +2 -2
  37. package/lib/requests/list-group-items.js +1 -1
  38. package/lib/requests/list-item-bookmarks.js +2 -2
  39. package/lib/requests/list-item-cart-additions.js +2 -2
  40. package/lib/requests/list-item-detail-views.js +2 -2
  41. package/lib/requests/list-item-purchases.js +2 -2
  42. package/lib/requests/list-item-ratings.js +2 -2
  43. package/lib/requests/list-item-view-portions.js +2 -2
  44. package/lib/requests/list-items.js +1 -1
  45. package/lib/requests/list-segmentations.js +43 -0
  46. package/lib/requests/list-series-items.js +2 -2
  47. package/lib/requests/list-user-bookmarks.js +1 -1
  48. package/lib/requests/list-user-cart-additions.js +1 -1
  49. package/lib/requests/list-user-detail-views.js +1 -1
  50. package/lib/requests/list-user-purchases.js +1 -1
  51. package/lib/requests/list-user-ratings.js +1 -1
  52. package/lib/requests/list-user-view-portions.js +1 -1
  53. package/lib/requests/list-users.js +1 -1
  54. package/lib/requests/merge-users.js +2 -2
  55. package/lib/requests/recommend-item-segments-to-item-segment.js +125 -0
  56. package/lib/requests/recommend-item-segments-to-item.js +125 -0
  57. package/lib/requests/recommend-item-segments-to-user.js +110 -0
  58. package/lib/requests/recommend-items-to-item.js +28 -28
  59. package/lib/requests/recommend-items-to-user.js +25 -25
  60. package/lib/requests/recommend-next-items.js +2 -2
  61. package/lib/requests/recommend-users-to-item.js +20 -20
  62. package/lib/requests/recommend-users-to-user.js +23 -23
  63. package/lib/requests/request.js +0 -1
  64. package/lib/requests/reset-database.js +1 -1
  65. package/lib/requests/search-item-segments.js +112 -0
  66. package/lib/requests/search-items.js +19 -19
  67. package/lib/requests/set-user-values.js +0 -1
  68. package/lib/requests/set-view-portion.js +5 -5
  69. package/lib/requests/update-auto-reql-segmentation.js +66 -0
  70. package/lib/requests/update-manual-reql-segment.js +57 -0
  71. package/lib/requests/update-manual-reql-segmentation.js +59 -0
  72. package/lib/requests/update-more-items.js +4 -4
  73. package/lib/requests/update-property-based-segmentation.js +66 -0
  74. package/package.json +2 -1
  75. package/test/add-manual-reql-segment-batch_test.js +40 -0
  76. package/test/add-manual-reql-segment-callback_test.js +43 -0
  77. package/test/add-manual-reql-segment-test.js +35 -0
  78. package/test/create-auto-reql-segmentation-batch_test.js +35 -0
  79. package/test/create-auto-reql-segmentation-callback_test.js +45 -0
  80. package/test/create-auto-reql-segmentation-test.js +43 -0
  81. package/test/create-manual-reql-segmentation-batch_test.js +35 -0
  82. package/test/create-manual-reql-segmentation-callback_test.js +45 -0
  83. package/test/create-manual-reql-segmentation-test.js +43 -0
  84. package/test/create-property-based-segmentation-batch_test.js +35 -0
  85. package/test/create-property-based-segmentation-callback_test.js +45 -0
  86. package/test/create-property-based-segmentation-test.js +43 -0
  87. package/test/delete-manual-reql-segment-batch_test.js +47 -0
  88. package/test/delete-manual-reql-segment-callback_test.js +51 -0
  89. package/test/delete-manual-reql-segment-test.js +39 -0
  90. package/test/delete-segmentation-batch_test.js +42 -0
  91. package/test/delete-segmentation-callback_test.js +53 -0
  92. package/test/delete-segmentation-test.js +47 -0
  93. package/test/get-segmentation-batch_test.js +41 -0
  94. package/test/get-segmentation-callback_test.js +44 -0
  95. package/test/get-segmentation-test.js +36 -0
  96. package/test/list-segmentations-batch_test.js +41 -0
  97. package/test/list-segmentations-callback_test.js +44 -0
  98. package/test/list-segmentations-test.js +36 -0
  99. package/test/recommend-item-segments-to-item-batch_test.js +33 -0
  100. package/test/recommend-item-segments-to-item-callback_test.js +37 -0
  101. package/test/recommend-item-segments-to-item-segment-batch_test.js +33 -0
  102. package/test/recommend-item-segments-to-item-segment-callback_test.js +37 -0
  103. package/test/recommend-item-segments-to-item-segment-test.js +39 -0
  104. package/test/recommend-item-segments-to-item-test.js +39 -0
  105. package/test/recommend-item-segments-to-user-batch_test.js +33 -0
  106. package/test/recommend-item-segments-to-user-callback_test.js +37 -0
  107. package/test/recommend-item-segments-to-user-test.js +39 -0
  108. package/test/search-item-segments-batch_test.js +33 -0
  109. package/test/search-item-segments-callback_test.js +37 -0
  110. package/test/search-item-segments-test.js +39 -0
  111. package/test/update-auto-reql-segmentation-batch_test.js +40 -0
  112. package/test/update-auto-reql-segmentation-callback_test.js +43 -0
  113. package/test/update-auto-reql-segmentation-test.js +35 -0
  114. package/test/update-manual-reql-segment-batch_test.js +47 -0
  115. package/test/update-manual-reql-segment-callback_test.js +51 -0
  116. package/test/update-manual-reql-segment-test.js +39 -0
  117. package/test/update-manual-reql-segmentation-batch_test.js +40 -0
  118. package/test/update-manual-reql-segmentation-callback_test.js +43 -0
  119. package/test/update-manual-reql-segmentation-test.js +35 -0
  120. package/test/update-property-based-segmentation-batch_test.js +40 -0
  121. package/test/update-property-based-segmentation-callback_test.js +43 -0
  122. package/test/update-property-based-segmentation-test.js +35 -0
@@ -6,9 +6,9 @@
6
6
  const rqs = require("./request");
7
7
 
8
8
  /**
9
- * Recommend users that are likely to be interested in a given item.
10
- * It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.
11
- * The returned users are sorted by predicted interest in the item (first user being the most interested).
9
+ * Recommends users that are likely to be interested in the given item.
10
+ * It is also possible to use POST HTTP method (for example in the case of a very long ReQL filter) - query parameters then become body parameters.
11
+ * The returned users are sorted by predicted interest in the item (the first user being the most interested).
12
12
  */
13
13
  class RecommendUsersToItem extends rqs.Request {
14
14
 
@@ -20,15 +20,15 @@ class RecommendUsersToItem extends rqs.Request {
20
20
  * - Allowed parameters:
21
21
  * - *scenario*
22
22
  * - Type: string
23
- * - Description: Scenario defines a particular application of recommendations. It can be for example "homepage", "cart" or "emailing".
24
- * You can set various settings to the [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com). You can also see performance of each scenario in the Admin UI separately, so you can check how well each application performs.
25
- * The AI which optimizes models in order to get the best results may optimize different scenarios separately, or even use different models in each of the scenarios.
23
+ * - Description: Scenario defines a particular application of recommendations. It can be, for example, "homepage", "cart", or "emailing".
24
+ * You can set various settings to the [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com). You can also see the performance of each scenario in the Admin UI separately, so you can check how well each application performs.
25
+ * The AI that optimizes models to get the best results may optimize different scenarios separately or even use different models in each of the scenarios.
26
26
  * - *cascadeCreate*
27
27
  * - Type: boolean
28
- * - Description: If item of given *itemId* doesn't exist in the database, it creates the missing item.
28
+ * - Description: If an item of the given *itemId* doesn't exist in the database, it creates the missing item.
29
29
  * - *returnProperties*
30
30
  * - Type: boolean
31
- * - Description: With `returnProperties=true`, property values of the recommended users are returned along with their IDs in a JSON dictionary. The acquired property values can be used for easy displaying the recommended users.
31
+ * - Description: With `returnProperties=true`, property values of the recommended users are returned along with their IDs in a JSON dictionary. The acquired property values can be used to easily display the recommended users.
32
32
  * Example response:
33
33
  * ```
34
34
  * {
@@ -55,7 +55,7 @@ class RecommendUsersToItem extends rqs.Request {
55
55
  * ```
56
56
  * - *includedProperties*
57
57
  * - Type: string[]
58
- * - Description: Allows to specify, which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
58
+ * - Description: Allows specifying which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
59
59
  * Example response for `includedProperties=country`:
60
60
  * ```
61
61
  * {
@@ -80,27 +80,27 @@ class RecommendUsersToItem extends rqs.Request {
80
80
  * ```
81
81
  * - *filter*
82
82
  * - Type: string
83
- * - Description: Boolean-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to filter recommended items based on the values of their attributes.
84
- * Filters can be also assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
83
+ * - Description: Boolean-returning [ReQL](https://docs.recombee.com/reql.html) expression, which allows you to filter recommended items based on the values of their attributes.
84
+ * Filters can also be assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
85
85
  * - *booster*
86
86
  * - Type: string
87
- * - Description: Number-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to boost recommendation rate of some items based on the values of their attributes.
88
- * Boosters can be also assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
87
+ * - Description: Number-returning [ReQL](https://docs.recombee.com/reql.html) expression, which allows you to boost the recommendation rate of some items based on the values of their attributes.
88
+ * Boosters can also be assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
89
89
  * - *logic*
90
- * - Type: string|
91
- * - Description: Logic specifies particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
92
- * See [this section](https://docs.recombee.com/recommendation_logics.html) for list of available logics and other details.
90
+ * - Type: string | object
91
+ * - Description: Logic specifies the particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
92
+ * See [this section](https://docs.recombee.com/recommendation_logics.html) for a list of available logics and other details.
93
93
  * The difference between `logic` and `scenario` is that `logic` specifies mainly behavior, while `scenario` specifies the place where recommendations are shown to the users.
94
- * Logic can be also set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
94
+ * Logic can also be set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
95
95
  * - *diversity*
96
96
  * - Type: number
97
- * - Description: **Expert option** Real number from [0.0, 1.0] which determines how much mutually dissimilar should the recommended items be. The default value is 0.0, i.e., no diversification. Value 1.0 means maximal diversification.
97
+ * - Description: **Expert option** Real number from [0.0, 1.0], which determines how mutually dissimilar the recommended items should be. The default value is 0.0, i.e., no diversification. Value 1.0 means maximal diversification.
98
98
  * - *expertSettings*
99
- * - Type:
99
+ * - Type: object
100
100
  * - Description: Dictionary of custom options.
101
101
  * - *returnAbGroup*
102
102
  * - Type: boolean
103
- * - Description: If there is a custom AB-testing running, return name of group to which the request belongs.
103
+ * - Description: If there is a custom AB-testing running, return the name of the group to which the request belongs.
104
104
  */
105
105
  constructor(itemId, count, optional) {
106
106
  super('POST', `/recomms/items/${itemId}/users/`, 50000, false);
@@ -6,9 +6,9 @@
6
6
  const rqs = require("./request");
7
7
 
8
8
  /**
9
- * Get similar users as some given user, based on the user's past interactions (purchases, ratings, etc.) and values of properties.
10
- * It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.
11
- * The returned users are sorted by similarity (first user being the most similar).
9
+ * Gets users similar to the given user, based on the user's past interactions (purchases, ratings, etc.) and values of properties.
10
+ * It is also possible to use POST HTTP method (for example in the case of a very long ReQL filter) - query parameters then become body parameters.
11
+ * The returned users are sorted by similarity (the first user being the most similar).
12
12
  */
13
13
  class RecommendUsersToUser extends rqs.Request {
14
14
 
@@ -20,15 +20,15 @@ class RecommendUsersToUser extends rqs.Request {
20
20
  * - Allowed parameters:
21
21
  * - *scenario*
22
22
  * - Type: string
23
- * - Description: Scenario defines a particular application of recommendations. It can be for example "homepage", "cart" or "emailing".
24
- * You can set various settings to the [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com). You can also see performance of each scenario in the Admin UI separately, so you can check how well each application performs.
25
- * The AI which optimizes models in order to get the best results may optimize different scenarios separately, or even use different models in each of the scenarios.
23
+ * - Description: Scenario defines a particular application of recommendations. It can be, for example, "homepage", "cart", or "emailing".
24
+ * You can set various settings to the [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com). You can also see the performance of each scenario in the Admin UI separately, so you can check how well each application performs.
25
+ * The AI that optimizes models to get the best results may optimize different scenarios separately or even use different models in each of the scenarios.
26
26
  * - *cascadeCreate*
27
27
  * - Type: boolean
28
- * - Description: If the user does not exist in the database, returns a list of non-personalized recommendations and creates the user in the database. This allows for example rotations in the following recommendations for that user, as the user will be already known to the system.
28
+ * - Description: If the user does not exist in the database, returns a list of non-personalized recommendations and creates the user in the database. This allows, for example, rotations in the following recommendations for that user, as the user will be already known to the system.
29
29
  * - *returnProperties*
30
30
  * - Type: boolean
31
- * - Description: With `returnProperties=true`, property values of the recommended users are returned along with their IDs in a JSON dictionary. The acquired property values can be used for easy displaying the recommended users.
31
+ * - Description: With `returnProperties=true`, property values of the recommended users are returned along with their IDs in a JSON dictionary. The acquired property values can be used to easily display the recommended users.
32
32
  * Example response:
33
33
  * ```
34
34
  * {
@@ -55,7 +55,7 @@ class RecommendUsersToUser extends rqs.Request {
55
55
  * ```
56
56
  * - *includedProperties*
57
57
  * - Type: string[]
58
- * - Description: Allows to specify, which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
58
+ * - Description: Allows specifying which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
59
59
  * Example response for `includedProperties=country`:
60
60
  * ```
61
61
  * {
@@ -80,36 +80,36 @@ class RecommendUsersToUser extends rqs.Request {
80
80
  * ```
81
81
  * - *filter*
82
82
  * - Type: string
83
- * - Description: Boolean-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to filter recommended items based on the values of their attributes.
84
- * Filters can be also assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
83
+ * - Description: Boolean-returning [ReQL](https://docs.recombee.com/reql.html) expression, which allows you to filter recommended items based on the values of their attributes.
84
+ * Filters can also be assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
85
85
  * - *booster*
86
86
  * - Type: string
87
- * - Description: Number-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to boost recommendation rate of some items based on the values of their attributes.
88
- * Boosters can be also assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
87
+ * - Description: Number-returning [ReQL](https://docs.recombee.com/reql.html) expression, which allows you to boost the recommendation rate of some items based on the values of their attributes.
88
+ * Boosters can also be assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
89
89
  * - *logic*
90
- * - Type: string|
91
- * - Description: Logic specifies particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
92
- * See [this section](https://docs.recombee.com/recommendation_logics.html) for list of available logics and other details.
90
+ * - Type: string | object
91
+ * - Description: Logic specifies the particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
92
+ * See [this section](https://docs.recombee.com/recommendation_logics.html) for a list of available logics and other details.
93
93
  * The difference between `logic` and `scenario` is that `logic` specifies mainly behavior, while `scenario` specifies the place where recommendations are shown to the users.
94
- * Logic can be also set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
94
+ * Logic can also be set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
95
95
  * - *diversity*
96
96
  * - Type: number
97
- * - Description: **Expert option** Real number from [0.0, 1.0] which determines how much mutually dissimilar should the recommended users be. The default value is 0.0, i.e., no diversification. Value 1.0 means maximal diversification.
97
+ * - Description: **Expert option** Real number from [0.0, 1.0], which determines how mutually dissimilar the recommended users should be. The default value is 0.0, i.e., no diversification. Value 1.0 means maximal diversification.
98
98
  * - *minRelevance*
99
99
  * - Type: string
100
- * - Description: **Expert option** Specifies the threshold of how much relevant must the recommended users be. Possible values one of: "low", "medium", "high".
100
+ * - Description: **Expert option** Specifies the threshold of how relevant must the recommended users be. Possible values one of: "low", "medium", "high".
101
101
  * - *rotationRate*
102
102
  * - Type: number
103
- * - Description: **Expert option** If your users browse the system in real-time, it may easily happen that you wish to offer them recommendations multiple times. Here comes the question: how much should the recommendations change? Should they remain the same, or should they rotate? Recombee API allows you to control this per-request in backward fashion. You may penalize an user for being recommended in the near past. For the specific user, `rotationRate=1` means maximal rotation, `rotationRate=0` means absolutely no rotation. You may also use, for example `rotationRate=0.2` for only slight rotation of recommended users.
103
+ * - Description: **Expert option** If your users browse the system in real-time, it may easily happen that you wish to offer them recommendations multiple times. Here comes the question: how much should the recommendations change? Should they remain the same, or should they rotate? Recombee API allows you to control this per request in a backward fashion. You may penalize a user for being recommended in the near past. For the specific user, `rotationRate=1` means maximal rotation, `rotationRate=0` means absolutely no rotation. You may also use, for example, `rotationRate=0.2` for only slight rotation of recommended users.
104
104
  * - *rotationTime*
105
105
  * - Type: number
106
- * - Description: **Expert option** Taking *rotationRate* into account, specifies how long time it takes to an user to recover from the penalization. For example, `rotationTime=7200.0` means that users recommended less than 2 hours ago are penalized.
106
+ * - Description: **Expert option** Taking *rotationRate* into account, specifies how long it takes for a user to recover from the penalization. For example, `rotationTime=7200.0` means that users recommended less than 2 hours ago are penalized.
107
107
  * - *expertSettings*
108
- * - Type:
108
+ * - Type: object
109
109
  * - Description: Dictionary of custom options.
110
110
  * - *returnAbGroup*
111
111
  * - Type: boolean
112
- * - Description: If there is a custom AB-testing running, return name of group to which the request belongs.
112
+ * - Description: If there is a custom AB-testing running, return the name of the group to which the request belongs.
113
113
  */
114
114
  constructor(userId, count, optional) {
115
115
  super('POST', `/recomms/users/${userId}/users/`, 50000, false);
@@ -4,7 +4,6 @@
4
4
  * Base class for all the requests
5
5
  */
6
6
  class Request {
7
-
8
7
  /**
9
8
  * Construct the basis of request
10
9
  * @param {string} method - GET/PUT/POST/DELETE
@@ -6,7 +6,7 @@
6
6
  const rqs = require("./request");
7
7
 
8
8
  /**
9
- * Completely erases all your data, including items, item properties, series, user database, purchases, ratings, detail views, and bookmarks. Make sure the request to be never executed in production environment! Resetting your database is irreversible.
9
+ * Completely erases all your data, including items, item properties, series, user database, purchases, ratings, detail views, and bookmarks. Make sure the request is never executed in the production environment! Resetting your database is irreversible.
10
10
  */
11
11
  class ResetDatabase extends rqs.Request {
12
12
 
@@ -0,0 +1,112 @@
1
+ /*
2
+ This file is auto-generated, do not edit
3
+ */
4
+
5
+ 'use strict';
6
+ const rqs = require("./request");
7
+
8
+ /**
9
+ * Full-text personalized search that returns Segments from a Segmentation. The results are based on the provided `searchQuery` and also on the user's past interactions (purchases, ratings, etc.).
10
+ * Based on the used Segmentation, this endpoint can be used for example for:
11
+ * - Searching within categories or brands
12
+ * - Searching within genres or artists
13
+ * For example if the user is searching for "iPhone" this endpoint can return "cell phones" category.
14
+ * You need to set the used Segmentation the Admin UI in the Scenario settings prior to using this endpoint.
15
+ * The returned segments are sorted by relevance (first segment being the most relevant).
16
+ * It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.
17
+ */
18
+ class SearchItemSegments extends rqs.Request {
19
+
20
+ /**
21
+ * Construct the request
22
+ * @param {string} userId - ID of the user for whom personalized search will be performed.
23
+ * @param {string} searchQuery - Search query provided by the user. It is used for the full-text search.
24
+ * @param {number} count - Number of segments to be returned (N for the top-N results).
25
+ * @param {Object} optional - Optional parameters given as an object with structure name of the parameter: value
26
+ * - Allowed parameters:
27
+ * - *scenario*
28
+ * - Type: string
29
+ * - Description: Scenario defines a particular application of recommendations. It can be, for example, "homepage", "cart", or "emailing".
30
+ * You can set various settings to the [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com). You can also see the performance of each scenario in the Admin UI separately, so you can check how well each application performs.
31
+ * The AI that optimizes models to get the best results may optimize different scenarios separately or even use different models in each of the scenarios.
32
+ * - *cascadeCreate*
33
+ * - Type: boolean
34
+ * - Description: If the user does not exist in the database, returns a list of non-personalized recommendations and creates the user in the database. This allows, for example, rotations in the following recommendations for that user, as the user will be already known to the system.
35
+ * - *filter*
36
+ * - Type: string
37
+ * - Description: Boolean-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to filter recommended segments based on the `segmentationId`.
38
+ * - *booster*
39
+ * - Type: string
40
+ * - Description: Number-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to boost recommendation rate of some segments based on the `segmentationId`.
41
+ * - *logic*
42
+ * - Type: string | object
43
+ * - Description: Logic specifies the particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
44
+ * See [this section](https://docs.recombee.com/recommendation_logics.html) for a list of available logics and other details.
45
+ * The difference between `logic` and `scenario` is that `logic` specifies mainly behavior, while `scenario` specifies the place where recommendations are shown to the users.
46
+ * Logic can also be set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
47
+ * - *expertSettings*
48
+ * - Type: object
49
+ * - Description: Dictionary of custom options.
50
+ * - *returnAbGroup*
51
+ * - Type: boolean
52
+ * - Description: If there is a custom AB-testing running, return the name of the group to which the request belongs.
53
+ */
54
+ constructor(userId, searchQuery, count, optional) {
55
+ super('POST', `/search/users/${userId}/item-segments/`, 3000, false);
56
+ this.userId = userId;
57
+ this.searchQuery = searchQuery;
58
+ this.count = count;
59
+ optional = optional || {};
60
+ this.scenario = optional.scenario;
61
+ this.cascadeCreate = optional.cascadeCreate;
62
+ this.filter = optional.filter;
63
+ this.booster = optional.booster;
64
+ this.logic = optional.logic;
65
+ this.expertSettings = optional.expertSettings;
66
+ this.returnAbGroup = optional.returnAbGroup;
67
+ }
68
+
69
+ /**
70
+ * Get body parameters
71
+ * @return {Object} The values of body parameters (name of parameter: value of the parameter)
72
+ */
73
+ bodyParameters() {
74
+ let params = {};
75
+ params.searchQuery = this.searchQuery;
76
+ params.count = this.count;
77
+
78
+ if(this.scenario !== undefined)
79
+ params.scenario = this.scenario;
80
+
81
+ if(this.cascadeCreate !== undefined)
82
+ params.cascadeCreate = this.cascadeCreate;
83
+
84
+ if(this.filter !== undefined)
85
+ params.filter = this.filter;
86
+
87
+ if(this.booster !== undefined)
88
+ params.booster = this.booster;
89
+
90
+ if(this.logic !== undefined)
91
+ params.logic = this.logic;
92
+
93
+ if(this.expertSettings !== undefined)
94
+ params.expertSettings = this.expertSettings;
95
+
96
+ if(this.returnAbGroup !== undefined)
97
+ params.returnAbGroup = this.returnAbGroup;
98
+
99
+ return params;
100
+ }
101
+
102
+ /**
103
+ * Get query parameters
104
+ * @return {Object} The values of query parameters (name of parameter: value of the parameter)
105
+ */
106
+ queryParameters() {
107
+ let params = {};
108
+ return params;
109
+ }
110
+ }
111
+
112
+ exports.SearchItemSegments = SearchItemSegments
@@ -8,12 +8,12 @@ const rqs = require("./request");
8
8
  /**
9
9
  * Full-text personalized search. The results are based on the provided `searchQuery` and also on the user's past interactions (purchases, ratings, etc.) with the items (items more suitable for the user are preferred in the results).
10
10
  * All the string and set item properties are indexed by the search engine.
11
- * This endpoint should be used in a search box at your website/app. It can be called multiple times as the user is typing the query in order to get the most viable suggestions based on current state of the query, or once after submitting the whole query.
12
- * The returned items are sorted by relevance (first item being the most relevant).
11
+ * This endpoint should be used in a search box on your website/app. It can be called multiple times as the user is typing the query in order to get the most viable suggestions based on the current state of the query, or once after submitting the whole query.
12
+ * The returned items are sorted by relevance (the first item being the most relevant).
13
13
  * Besides the recommended items, also a unique `recommId` is returned in the response. It can be used to:
14
- * - Let Recombee know that this search was successful (e.g. user clicked one of the recommended items). See [Reported metrics](https://docs.recombee.com/admin_ui.html#reported-metrics).
14
+ * - Let Recombee know that this search was successful (e.g., user clicked one of the recommended items). See [Reported metrics](https://docs.recombee.com/admin_ui.html#reported-metrics).
15
15
  * - Get subsequent search results when the user scrolls down or goes to the next page. See [Recommend Next Items](https://docs.recombee.com/api.html#recommend-next-items).
16
- * It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.
16
+ * It is also possible to use POST HTTP method (for example in the case of a very long ReQL filter) - query parameters then become body parameters.
17
17
  */
18
18
  class SearchItems extends rqs.Request {
19
19
 
@@ -27,14 +27,14 @@ class SearchItems extends rqs.Request {
27
27
  * - *scenario*
28
28
  * - Type: string
29
29
  * - Description: Scenario defines a particular search field in your user interface.
30
- * You can set various settings to the [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com). You can also see performance of each scenario in the Admin UI separately, so you can check how well each field performs.
31
- * The AI which optimizes models in order to get the best results may optimize different scenarios separately, or even use different models in each of the scenarios.
30
+ * You can set various settings to the [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com). You can also see the performance of each scenario in the Admin UI separately, so you can check how well each field performs.
31
+ * The AI that optimizes models to get the best results may optimize different scenarios separately, or even use different models in each of the scenarios.
32
32
  * - *cascadeCreate*
33
33
  * - Type: boolean
34
- * - Description: If the user does not exist in the database, returns a list of non-personalized search results and creates the user in the database. This allows for example rotations in the following recommendations for that user, as the user will be already known to the system.
34
+ * - Description: If the user does not exist in the database, returns a list of non-personalized search results and creates the user in the database. This allows, for example, rotations in the following recommendations for that user, as the user will be already known to the system.
35
35
  * - *returnProperties*
36
36
  * - Type: boolean
37
- * - Description: With `returnProperties=true`, property values of the recommended items are returned along with their IDs in a JSON dictionary. The acquired property values can be used for easy displaying of the recommended items to the user.
37
+ * - Description: With `returnProperties=true`, property values of the recommended items are returned along with their IDs in a JSON dictionary. The acquired property values can be used to easily display the recommended items to the user.
38
38
  * Example response:
39
39
  * ```
40
40
  * {
@@ -65,7 +65,7 @@ class SearchItems extends rqs.Request {
65
65
  * ```
66
66
  * - *includedProperties*
67
67
  * - Type: string[]
68
- * - Description: Allows to specify, which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
68
+ * - Description: Allows specifying which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
69
69
  * Example response for `includedProperties=description,price`:
70
70
  * ```
71
71
  * {
@@ -92,24 +92,24 @@ class SearchItems extends rqs.Request {
92
92
  * ```
93
93
  * - *filter*
94
94
  * - Type: string
95
- * - Description: Boolean-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to filter recommended items based on the values of their attributes.
96
- * Filters can be also assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
95
+ * - Description: Boolean-returning [ReQL](https://docs.recombee.com/reql.html) expression, which allows you to filter recommended items based on the values of their attributes.
96
+ * Filters can also be assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
97
97
  * - *booster*
98
98
  * - Type: string
99
- * - Description: Number-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to boost recommendation rate of some items based on the values of their attributes.
100
- * Boosters can be also assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
99
+ * - Description: Number-returning [ReQL](https://docs.recombee.com/reql.html) expression, which allows you to boost the recommendation rate of some items based on the values of their attributes.
100
+ * Boosters can also be assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
101
101
  * - *logic*
102
- * - Type: string|
103
- * - Description: Logic specifies particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
104
- * See [this section](https://docs.recombee.com/recommendation_logics.html) for list of available logics and other details.
102
+ * - Type: string | object
103
+ * - Description: Logic specifies the particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
104
+ * See [this section](https://docs.recombee.com/recommendation_logics.html) for a list of available logics and other details.
105
105
  * The difference between `logic` and `scenario` is that `logic` specifies mainly behavior, while `scenario` specifies the place where recommendations are shown to the users.
106
- * Logic can be also set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
106
+ * Logic can also be set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
107
107
  * - *expertSettings*
108
- * - Type:
108
+ * - Type: object
109
109
  * - Description: Dictionary of custom options.
110
110
  * - *returnAbGroup*
111
111
  * - Type: boolean
112
- * - Description: If there is a custom AB-testing running, return name of group to which the request belongs.
112
+ * - Description: If there is a custom AB-testing running, return the name of the group to which the request belongs.
113
113
  */
114
114
  constructor(userId, searchQuery, count, optional) {
115
115
  super('POST', `/search/users/${userId}/items/`, 3000, false);
@@ -5,7 +5,6 @@ const svr = require("./set-values");
5
5
  * Set/update (some) property values of a given user. The properties (columns) must be previously created by [Add user property](https://docs.recombee.com/api.html#add-user-property).
6
6
  */
7
7
  class SetUserValues extends svr.SetValues {
8
-
9
8
  /**
10
9
  * Construct the request
11
10
  * @param {string} userId - ID of the user which will be modified.
@@ -7,7 +7,7 @@ const rqs = require("./request");
7
7
 
8
8
  /**
9
9
  * Sets viewed portion of an item (for example a video or article) by a user (at a session).
10
- * If you send new request with the same (`userId`, `itemId`, `sessionId`), the portion gets updated.
10
+ * If you send a new request with the same (`userId`, `itemId`, `sessionId`), the portion gets updated.
11
11
  */
12
12
  class SetViewPortion extends rqs.Request {
13
13
 
@@ -15,14 +15,14 @@ class SetViewPortion extends rqs.Request {
15
15
  * Construct the request
16
16
  * @param {string} userId - User who viewed a portion of the item
17
17
  * @param {string} itemId - Viewed item
18
- * @param {number} portion - Viewed portion of the item (number between 0.0 (viewed nothing) and 1.0 (viewed full item) ). It should be the really viewed part of the item, no matter seeking, so for example if the user seeked immediately to half of the item and then viewed 10% of the item, the `portion` should still be `0.1`.
18
+ * @param {number} portion - Viewed portion of the item (number between 0.0 (viewed nothing) and 1.0 (viewed full item) ). It should be the actual viewed part of the item, no matter the seeking. For example, if the user seeked immediately to half of the item and then viewed 10% of the item, the `portion` should still be `0.1`.
19
19
  * @param {Object} optional - Optional parameters given as an object with structure name of the parameter: value
20
20
  * - Allowed parameters:
21
21
  * - *sessionId*
22
22
  * - Type: string
23
- * - Description: ID of session in which the user viewed the item. Default is `null` (`None`, `nil`, `NULL` etc. depending on language).
23
+ * - Description: ID of the session in which the user viewed the item. Default is `null` (`None`, `nil`, `NULL` etc., depending on the language).
24
24
  * - *timestamp*
25
- * - Type: string|number
25
+ * - Type: string | number
26
26
  * - Description: UTC timestamp of the rating as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
27
27
  * - *cascadeCreate*
28
28
  * - Type: boolean
@@ -31,7 +31,7 @@ class SetViewPortion extends rqs.Request {
31
31
  * - Type: string
32
32
  * - Description: If this view portion is based on a recommendation request, `recommId` is the id of the clicked recommendation.
33
33
  * - *additionalData*
34
- * - Type:
34
+ * - Type: object
35
35
  * - Description: A dictionary of additional data for the interaction.
36
36
  */
37
37
  constructor(userId, itemId, portion, optional) {
@@ -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
+ * Update an existing Segmentation.
10
+ */
11
+ class UpdateAutoReqlSegmentation extends rqs.Request {
12
+
13
+ /**
14
+ * Construct the request
15
+ * @param {string} segmentationId - ID of the updated Segmentation
16
+ * @param {Object} optional - Optional parameters given as an object with structure name of the parameter: value
17
+ * - Allowed parameters:
18
+ * - *expression*
19
+ * - Type: string
20
+ * - Description: ReQL expression that returns for each item a set with IDs of segments to which the item belongs
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, optional) {
29
+ super('POST', `/segmentations/auto-reql/${segmentationId}`, 10000, false);
30
+ this.segmentationId = segmentationId;
31
+ optional = optional || {};
32
+ this.expression = optional.expression;
33
+ this.title = optional.title;
34
+ this.description = optional.description;
35
+ }
36
+
37
+ /**
38
+ * Get body parameters
39
+ * @return {Object} The values of body parameters (name of parameter: value of the parameter)
40
+ */
41
+ bodyParameters() {
42
+ let params = {};
43
+
44
+ if(this.expression !== undefined)
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.UpdateAutoReqlSegmentation = UpdateAutoReqlSegmentation
@@ -0,0 +1,57 @@
1
+ /*
2
+ This file is auto-generated, do not edit
3
+ */
4
+
5
+ 'use strict';
6
+ const rqs = require("./request");
7
+
8
+ /**
9
+ * Update definition of the Segment.
10
+ */
11
+ class UpdateManualReqlSegment extends rqs.Request {
12
+
13
+ /**
14
+ * Construct the request
15
+ * @param {string} segmentationId - ID of the Segmentation to which the updated Segment belongs
16
+ * @param {string} segmentId - ID of the Segment that will be updated
17
+ * @param {string} filter - ReQL filter that returns `true` for items that belong to this Segment. Otherwise returns `false`.
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 of the Segment that is shown in the Recombee Admin UI.
23
+ */
24
+ constructor(segmentationId, segmentId, filter, optional) {
25
+ super('POST', `/segmentations/manual-reql/${segmentationId}/segments/${segmentId}`, 10000, false);
26
+ this.segmentationId = segmentationId;
27
+ this.segmentId = segmentId;
28
+ this.filter = filter;
29
+ optional = optional || {};
30
+ this.title = optional.title;
31
+ }
32
+
33
+ /**
34
+ * Get body parameters
35
+ * @return {Object} The values of body parameters (name of parameter: value of the parameter)
36
+ */
37
+ bodyParameters() {
38
+ let params = {};
39
+ params.filter = this.filter;
40
+
41
+ if(this.title !== undefined)
42
+ params.title = this.title;
43
+
44
+ return params;
45
+ }
46
+
47
+ /**
48
+ * Get query parameters
49
+ * @return {Object} The values of query parameters (name of parameter: value of the parameter)
50
+ */
51
+ queryParameters() {
52
+ let params = {};
53
+ return params;
54
+ }
55
+ }
56
+
57
+ exports.UpdateManualReqlSegment = UpdateManualReqlSegment
@@ -0,0 +1,59 @@
1
+ /*
2
+ This file is auto-generated, do not edit
3
+ */
4
+
5
+ 'use strict';
6
+ const rqs = require("./request");
7
+
8
+ /**
9
+ * Update an existing Segmentation.
10
+ */
11
+ class UpdateManualReqlSegmentation extends rqs.Request {
12
+
13
+ /**
14
+ * Construct the request
15
+ * @param {string} segmentationId - ID of the updated Segmentation
16
+ * @param {Object} optional - Optional parameters given as an object with structure name of the parameter: value
17
+ * - Allowed parameters:
18
+ * - *title*
19
+ * - Type: string
20
+ * - Description: Human-readable name that is shown in the Recombee Admin UI.
21
+ * - *description*
22
+ * - Type: string
23
+ * - Description: Description that is shown in the Recombee Admin UI.
24
+ */
25
+ constructor(segmentationId, optional) {
26
+ super('POST', `/segmentations/manual-reql/${segmentationId}`, 10000, false);
27
+ this.segmentationId = segmentationId;
28
+ optional = optional || {};
29
+ this.title = optional.title;
30
+ this.description = optional.description;
31
+ }
32
+
33
+ /**
34
+ * Get body parameters
35
+ * @return {Object} The values of body parameters (name of parameter: value of the parameter)
36
+ */
37
+ bodyParameters() {
38
+ let params = {};
39
+
40
+ if(this.title !== undefined)
41
+ params.title = this.title;
42
+
43
+ if(this.description !== undefined)
44
+ params.description = this.description;
45
+
46
+ return params;
47
+ }
48
+
49
+ /**
50
+ * Get query parameters
51
+ * @return {Object} The values of query parameters (name of parameter: value of the parameter)
52
+ */
53
+ queryParameters() {
54
+ let params = {};
55
+ return params;
56
+ }
57
+ }
58
+
59
+ exports.UpdateManualReqlSegmentation = UpdateManualReqlSegmentation