recombee-api-client 3.2.0 → 4.1.0
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/README.md +2 -2
- package/doc/AddBookmark.html +506 -0
- package/doc/AddCartAddition.html +512 -0
- package/doc/AddDetailView.html +509 -0
- package/doc/AddGroup.html +447 -0
- package/doc/AddItem.html +448 -0
- package/doc/AddItemProperty.html +478 -0
- package/doc/AddPurchase.html +515 -0
- package/doc/AddRating.html +529 -0
- package/doc/AddSearchSynonym.html +501 -0
- package/doc/AddSeries.html +447 -0
- package/doc/AddUser.html +447 -0
- package/doc/AddUserProperty.html +476 -0
- package/doc/ApiClient.html +433 -0
- package/doc/ApiError.html +170 -0
- package/doc/Batch.html +476 -0
- package/doc/DeleteAllSearchSynonyms.html +398 -0
- package/doc/DeleteBookmark.html +497 -0
- package/doc/DeleteCartAddition.html +497 -0
- package/doc/DeleteDetailView.html +497 -0
- package/doc/DeleteGroup.html +448 -0
- package/doc/DeleteItem.html +449 -0
- package/doc/DeleteItemProperty.html +447 -0
- package/doc/DeleteMoreItems.html +448 -0
- package/doc/DeletePurchase.html +497 -0
- package/doc/DeleteRating.html +497 -0
- package/doc/DeleteSearchSynonym.html +447 -0
- package/doc/DeleteSeries.html +448 -0
- package/doc/DeleteUser.html +448 -0
- package/doc/DeleteUserProperty.html +447 -0
- package/doc/DeleteViewPortion.html +497 -0
- package/doc/GetItemPropertyInfo.html +447 -0
- package/doc/GetItemValues.html +447 -0
- package/doc/GetUserPropertyInfo.html +447 -0
- package/doc/GetUserValues.html +447 -0
- package/doc/InsertToGroup.html +520 -0
- package/doc/InsertToSeries.html +543 -0
- package/doc/ListGroupItems.html +447 -0
- package/doc/ListGroups.html +398 -0
- package/doc/ListItemBookmarks.html +447 -0
- package/doc/ListItemCartAdditions.html +447 -0
- package/doc/ListItemDetailViews.html +447 -0
- package/doc/ListItemProperties.html +398 -0
- package/doc/ListItemPurchases.html +447 -0
- package/doc/ListItemRatings.html +447 -0
- package/doc/ListItemViewPortions.html +447 -0
- package/doc/ListItems.html +497 -0
- package/doc/ListSearchSynonyms.html +454 -0
- package/doc/ListSeries.html +398 -0
- package/doc/ListSeriesItems.html +447 -0
- package/doc/ListUserBookmarks.html +447 -0
- package/doc/ListUserCartAdditions.html +447 -0
- package/doc/ListUserDetailViews.html +447 -0
- package/doc/ListUserProperties.html +398 -0
- package/doc/ListUserPurchases.html +447 -0
- package/doc/ListUserRatings.html +447 -0
- package/doc/ListUserViewPortions.html +447 -0
- package/doc/ListUsers.html +491 -0
- package/doc/MergeUsers.html +498 -0
- package/doc/RecommendItemsToItem.html +635 -0
- package/doc/RecommendItemsToUser.html +598 -0
- package/doc/RecommendNextItems.html +480 -0
- package/doc/RecommendUsersToItem.html +579 -0
- package/doc/RecommendUsersToUser.html +588 -0
- package/doc/RemoveFromGroup.html +493 -0
- package/doc/RemoveFromSeries.html +516 -0
- package/doc/Request.html +292 -0
- package/doc/ResetDatabase.html +398 -0
- package/doc/ResponseError.html +269 -0
- package/doc/SearchItems.html +610 -0
- package/doc/SetItemValues.html +279 -0
- package/doc/SetUserValues.html +277 -0
- package/doc/SetValues.html +480 -0
- package/doc/SetViewPortion.html +533 -0
- package/doc/TimeoutError.html +246 -0
- package/doc/UpdateMoreItems.html +472 -0
- package/doc/api-client.js.html +248 -0
- package/doc/errors_api-error.js.html +71 -0
- package/doc/errors_response-error.js.html +72 -0
- package/doc/errors_timeout-error.js.html +71 -0
- package/doc/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/doc/fonts/OpenSans-Bold-webfont.svg +1830 -0
- package/doc/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/doc/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/doc/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
- package/doc/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/doc/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/doc/fonts/OpenSans-Italic-webfont.svg +1830 -0
- package/doc/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/doc/fonts/OpenSans-Light-webfont.eot +0 -0
- package/doc/fonts/OpenSans-Light-webfont.svg +1831 -0
- package/doc/fonts/OpenSans-Light-webfont.woff +0 -0
- package/doc/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/doc/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
- package/doc/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/doc/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/doc/fonts/OpenSans-Regular-webfont.svg +1831 -0
- package/doc/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/doc/index.html +65 -0
- package/doc/requests_add-bookmark.js.html +128 -0
- package/doc/requests_add-cart-addition.js.html +142 -0
- package/doc/requests_add-detail-view.js.html +135 -0
- package/doc/requests_add-group.js.html +93 -0
- package/doc/requests_add-item-property.js.html +104 -0
- package/doc/requests_add-item.js.html +94 -0
- package/doc/requests_add-purchase.js.html +149 -0
- package/doc/requests_add-rating.js.html +131 -0
- package/doc/requests_add-search-synonym.js.html +111 -0
- package/doc/requests_add-series.js.html +93 -0
- package/doc/requests_add-user-property.js.html +102 -0
- package/doc/requests_add-user.js.html +93 -0
- package/doc/requests_batch.js.html +121 -0
- package/doc/requests_delete-all-search-synonyms.js.html +91 -0
- package/doc/requests_delete-bookmark.js.html +106 -0
- package/doc/requests_delete-cart-addition.js.html +106 -0
- package/doc/requests_delete-detail-view.js.html +106 -0
- package/doc/requests_delete-group.js.html +94 -0
- package/doc/requests_delete-item-property.js.html +93 -0
- package/doc/requests_delete-item.js.html +95 -0
- package/doc/requests_delete-more-items.js.html +95 -0
- package/doc/requests_delete-purchase.js.html +106 -0
- package/doc/requests_delete-rating.js.html +106 -0
- package/doc/requests_delete-search-synonym.js.html +93 -0
- package/doc/requests_delete-series.js.html +94 -0
- package/doc/requests_delete-user-property.js.html +93 -0
- package/doc/requests_delete-user.js.html +94 -0
- package/doc/requests_delete-view-portion.js.html +106 -0
- package/doc/requests_get-item-property-info.js.html +93 -0
- package/doc/requests_get-item-values.js.html +93 -0
- package/doc/requests_get-user-property-info.js.html +93 -0
- package/doc/requests_get-user-values.js.html +93 -0
- package/doc/requests_insert-to-group.js.html +109 -0
- package/doc/requests_insert-to-series.js.html +112 -0
- package/doc/requests_list-group-items.js.html +93 -0
- package/doc/requests_list-groups.js.html +91 -0
- package/doc/requests_list-item-bookmarks.js.html +93 -0
- package/doc/requests_list-item-cart-additions.js.html +93 -0
- package/doc/requests_list-item-detail-views.js.html +93 -0
- package/doc/requests_list-item-properties.js.html +91 -0
- package/doc/requests_list-item-purchases.js.html +93 -0
- package/doc/requests_list-item-ratings.js.html +93 -0
- package/doc/requests_list-item-view-portions.js.html +93 -0
- package/doc/requests_list-items.js.html +158 -0
- package/doc/requests_list-search-synonyms.js.html +106 -0
- package/doc/requests_list-series-items.js.html +93 -0
- package/doc/requests_list-series.js.html +91 -0
- package/doc/requests_list-user-bookmarks.js.html +93 -0
- package/doc/requests_list-user-cart-additions.js.html +93 -0
- package/doc/requests_list-user-detail-views.js.html +93 -0
- package/doc/requests_list-user-properties.js.html +91 -0
- package/doc/requests_list-user-purchases.js.html +93 -0
- package/doc/requests_list-user-ratings.js.html +93 -0
- package/doc/requests_list-user-view-portions.js.html +93 -0
- package/doc/requests_list-users.js.html +152 -0
- package/doc/requests_merge-users.js.html +105 -0
- package/doc/requests_recommend-items-to-item.js.html +276 -0
- package/doc/requests_recommend-items-to-user.js.html +255 -0
- package/doc/requests_recommend-next-items.js.html +106 -0
- package/doc/requests_recommend-users-to-item.js.html +224 -0
- package/doc/requests_recommend-users-to-user.js.html +245 -0
- package/doc/requests_remove-from-group.js.html +99 -0
- package/doc/requests_remove-from-series.js.html +102 -0
- package/doc/requests_request.js.html +73 -0
- package/doc/requests_reset-database.js.html +91 -0
- package/doc/requests_search-items.js.html +231 -0
- package/doc/requests_set-item-values.js.html +80 -0
- package/doc/requests_set-user-values.js.html +79 -0
- package/doc/requests_set-values.js.html +102 -0
- package/doc/requests_set-view-portion.js.html +139 -0
- package/doc/requests_update-more-items.js.html +104 -0
- package/doc/scripts/linenumber.js +25 -0
- package/doc/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/doc/scripts/prettify/lang-css.js +2 -0
- package/doc/scripts/prettify/prettify.js +28 -0
- package/doc/styles/jsdoc-default.css +358 -0
- package/doc/styles/prettify-jsdoc.css +111 -0
- package/doc/styles/prettify-tomorrow.css +132 -0
- package/lib/api-client.js +49 -36
- package/lib/requests/add-bookmark.js +1 -1
- package/lib/requests/add-cart-addition.js +3 -3
- package/lib/requests/add-detail-view.js +1 -1
- 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 +4 -4
- package/lib/requests/add-rating.js +1 -1
- 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 +3 -3
- package/lib/requests/delete-manual-reql-segment.js +44 -0
- package/lib/requests/delete-more-items.js +44 -0
- 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 +2 -2
- 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 +18 -2
- 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 +26 -26
- package/lib/requests/recommend-items-to-user.js +23 -23
- package/lib/requests/recommend-next-items.js +2 -2
- package/lib/requests/recommend-users-to-item.js +18 -18
- package/lib/requests/recommend-users-to-user.js +21 -21
- package/lib/requests/reset-database.js +1 -1
- package/lib/requests/search-item-segments.js +112 -0
- package/lib/requests/search-items.js +17 -17
- package/lib/requests/set-view-portion.js +3 -3
- 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 +53 -0
- package/lib/requests/update-property-based-segmentation.js +66 -0
- package/package.json +2 -3
- package/test/add-bookmark-test.js +24 -12
- package/test/add-cart-addition-test.js +24 -12
- package/test/add-detail-view-test.js +24 -12
- package/test/add-group-test.js +12 -6
- package/test/add-item-property-test.js +12 -6
- package/test/add-item-test.js +12 -6
- 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/add-purchase-test.js +24 -12
- package/test/add-rating-test.js +30 -15
- package/test/add-search-synonym-test.js +6 -3
- package/test/add-series-test.js +12 -6
- package/test/add-user-property-test.js +12 -6
- package/test/add-user-test.js +12 -6
- 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-bookmark-test.js +6 -3
- package/test/delete-cart-addition-test.js +6 -3
- package/test/delete-detail-view-test.js +6 -3
- package/test/delete-group-test.js +18 -9
- package/test/delete-item-property-test.js +18 -9
- package/test/delete-item-test.js +18 -9
- 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/{user-based-recommendation-batch_test.js → delete-more-items-batch_test.js} +4 -10
- package/test/delete-more-items-callback_test.js +37 -0
- package/test/delete-more-items-test.js +33 -0
- package/test/delete-purchase-test.js +6 -3
- package/test/delete-rating-test.js +6 -3
- package/test/delete-search-synonym-test.js +6 -3
- 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/delete-series-test.js +18 -9
- package/test/delete-user-property-test.js +18 -9
- package/test/delete-user-test.js +18 -9
- package/test/delete-view-portion-test.js +6 -3
- 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/insert-to-group-test.js +6 -3
- package/test/insert-to-series-test.js +6 -3
- 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/merge-users-test.js +6 -3
- 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/remove-from-group-test.js +6 -3
- package/test/remove-from-series-test.js +12 -6
- 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/set-environment.js +6 -4
- package/test/set-item-values-test.js +6 -3
- package/test/set-user-values-test.js +6 -3
- package/test/set-view-portion-test.js +30 -15
- 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/{item-based-recommendation-batch_test.js → update-more-items-batch_test.js} +4 -10
- package/test/update-more-items-callback_test.js +37 -0
- package/test/update-more-items-test.js +33 -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
- package/lib/requests/item-based-recommendation.js +0 -187
- package/lib/requests/user-based-recommendation.js +0 -168
- package/test/item-based-recommendation-callback_test.js +0 -65
- package/test/item-based-recommendation-test.js +0 -53
- package/test/user-based-recommendation-callback_test.js +0 -65
- package/test/user-based-recommendation-test.js +0 -53
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
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.
|
|
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
|
|
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
108
|
* - Type:
|
|
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);
|
|
@@ -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,12 +15,12 @@ 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
|
|
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
|
|
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
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.
|
|
@@ -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
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
This file is auto-generated, do not edit
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
'use strict';
|
|
6
|
+
const rqs = require("./request");
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Updates (some) property values of all the items that pass the filter.
|
|
10
|
+
* Example: *Setting all the items that are older than a week as unavailable*
|
|
11
|
+
* ```
|
|
12
|
+
* {
|
|
13
|
+
* "filter": "'releaseDate' < now() - 7*24*3600",
|
|
14
|
+
* "changes": {"available": false}
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
class UpdateMoreItems extends rqs.Request {
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Construct the request
|
|
22
|
+
* @param {string} filter - A [ReQL](https://docs.recombee.com/reql.html) expression, which returns `true` for the items that shall be updated.
|
|
23
|
+
* @param {} changes - A dictionary where the keys are properties that shall be updated.
|
|
24
|
+
*/
|
|
25
|
+
constructor(filter, changes) {
|
|
26
|
+
super('POST', '/more-items/', 1000, false);
|
|
27
|
+
this.filter = filter;
|
|
28
|
+
this.changes = changes;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get body parameters
|
|
33
|
+
* @return {Object} The values of body parameters (name of parameter: value of the parameter)
|
|
34
|
+
*/
|
|
35
|
+
bodyParameters() {
|
|
36
|
+
let params = {};
|
|
37
|
+
params.filter = this.filter;
|
|
38
|
+
params.changes = this.changes;
|
|
39
|
+
|
|
40
|
+
return params;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Get query parameters
|
|
45
|
+
* @return {Object} The values of query parameters (name of parameter: value of the parameter)
|
|
46
|
+
*/
|
|
47
|
+
queryParameters() {
|
|
48
|
+
let params = {};
|
|
49
|
+
return params;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
exports.UpdateMoreItems = UpdateMoreItems
|
|
@@ -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
|
+
* Updates a Property Based Segmentation
|
|
10
|
+
*/
|
|
11
|
+
class UpdatePropertyBasedSegmentation 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
|
+
* - *propertyName*
|
|
19
|
+
* - Type: string
|
|
20
|
+
* - Description: Name of the property on which the Segmentation should be based
|
|
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/property-based/${segmentationId}`, 10000, false);
|
|
30
|
+
this.segmentationId = segmentationId;
|
|
31
|
+
optional = optional || {};
|
|
32
|
+
this.propertyName = optional.propertyName;
|
|
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.propertyName !== undefined)
|
|
45
|
+
params.propertyName = this.propertyName;
|
|
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.UpdatePropertyBasedSegmentation = UpdatePropertyBasedSegmentation
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "recombee-api-client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Node.js client (SDK) for easy use of the Recombee recommendation API",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -26,8 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"homepage": "https://github.com/Recombee/node-api-client#readme",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"
|
|
30
|
-
"request": "^2.88.0",
|
|
29
|
+
"got": "^11.8.2",
|
|
31
30
|
"jssha": "^2.3.0"
|
|
32
31
|
},
|
|
33
32
|
"devDependencies": {
|
|
@@ -55,9 +55,12 @@ describe('AddBookmark', function(){
|
|
|
55
55
|
chai.fail();
|
|
56
56
|
done();
|
|
57
57
|
})
|
|
58
|
-
.catch(
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
.catch((err) => {
|
|
59
|
+
if (err instanceof recombee.errors.ResponseError) {
|
|
60
|
+
chai.equal(err.statusCode, 404);
|
|
61
|
+
done();
|
|
62
|
+
}
|
|
63
|
+
throw err;
|
|
61
64
|
});
|
|
62
65
|
});
|
|
63
66
|
|
|
@@ -69,9 +72,12 @@ describe('AddBookmark', function(){
|
|
|
69
72
|
chai.fail();
|
|
70
73
|
done();
|
|
71
74
|
})
|
|
72
|
-
.catch(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
.catch((err) => {
|
|
76
|
+
if (err instanceof recombee.errors.ResponseError) {
|
|
77
|
+
chai.equal(err.statusCode, 404);
|
|
78
|
+
done();
|
|
79
|
+
}
|
|
80
|
+
throw err;
|
|
75
81
|
});
|
|
76
82
|
});
|
|
77
83
|
|
|
@@ -83,9 +89,12 @@ describe('AddBookmark', function(){
|
|
|
83
89
|
chai.fail();
|
|
84
90
|
done();
|
|
85
91
|
})
|
|
86
|
-
.catch(
|
|
87
|
-
|
|
88
|
-
|
|
92
|
+
.catch((err) => {
|
|
93
|
+
if (err instanceof recombee.errors.ResponseError) {
|
|
94
|
+
chai.equal(err.statusCode, 400);
|
|
95
|
+
done();
|
|
96
|
+
}
|
|
97
|
+
throw err;
|
|
89
98
|
});
|
|
90
99
|
});
|
|
91
100
|
|
|
@@ -99,9 +108,12 @@ describe('AddBookmark', function(){
|
|
|
99
108
|
chai.fail();
|
|
100
109
|
done();
|
|
101
110
|
})
|
|
102
|
-
.catch(
|
|
103
|
-
|
|
104
|
-
|
|
111
|
+
.catch((err) => {
|
|
112
|
+
if (err instanceof recombee.errors.ResponseError) {
|
|
113
|
+
chai.equal(err.statusCode, 409);
|
|
114
|
+
done();
|
|
115
|
+
}
|
|
116
|
+
throw err;
|
|
105
117
|
});
|
|
106
118
|
});
|
|
107
119
|
});
|
|
@@ -55,9 +55,12 @@ describe('AddCartAddition', function(){
|
|
|
55
55
|
chai.fail();
|
|
56
56
|
done();
|
|
57
57
|
})
|
|
58
|
-
.catch(
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
.catch((err) => {
|
|
59
|
+
if (err instanceof recombee.errors.ResponseError) {
|
|
60
|
+
chai.equal(err.statusCode, 404);
|
|
61
|
+
done();
|
|
62
|
+
}
|
|
63
|
+
throw err;
|
|
61
64
|
});
|
|
62
65
|
});
|
|
63
66
|
|
|
@@ -69,9 +72,12 @@ describe('AddCartAddition', function(){
|
|
|
69
72
|
chai.fail();
|
|
70
73
|
done();
|
|
71
74
|
})
|
|
72
|
-
.catch(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
.catch((err) => {
|
|
76
|
+
if (err instanceof recombee.errors.ResponseError) {
|
|
77
|
+
chai.equal(err.statusCode, 404);
|
|
78
|
+
done();
|
|
79
|
+
}
|
|
80
|
+
throw err;
|
|
75
81
|
});
|
|
76
82
|
});
|
|
77
83
|
|
|
@@ -83,9 +89,12 @@ describe('AddCartAddition', function(){
|
|
|
83
89
|
chai.fail();
|
|
84
90
|
done();
|
|
85
91
|
})
|
|
86
|
-
.catch(
|
|
87
|
-
|
|
88
|
-
|
|
92
|
+
.catch((err) => {
|
|
93
|
+
if (err instanceof recombee.errors.ResponseError) {
|
|
94
|
+
chai.equal(err.statusCode, 400);
|
|
95
|
+
done();
|
|
96
|
+
}
|
|
97
|
+
throw err;
|
|
89
98
|
});
|
|
90
99
|
});
|
|
91
100
|
|
|
@@ -99,9 +108,12 @@ describe('AddCartAddition', function(){
|
|
|
99
108
|
chai.fail();
|
|
100
109
|
done();
|
|
101
110
|
})
|
|
102
|
-
.catch(
|
|
103
|
-
|
|
104
|
-
|
|
111
|
+
.catch((err) => {
|
|
112
|
+
if (err instanceof recombee.errors.ResponseError) {
|
|
113
|
+
chai.equal(err.statusCode, 409);
|
|
114
|
+
done();
|
|
115
|
+
}
|
|
116
|
+
throw err;
|
|
105
117
|
});
|
|
106
118
|
});
|
|
107
119
|
});
|
|
@@ -55,9 +55,12 @@ describe('AddDetailView', function(){
|
|
|
55
55
|
chai.fail();
|
|
56
56
|
done();
|
|
57
57
|
})
|
|
58
|
-
.catch(
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
.catch((err) => {
|
|
59
|
+
if (err instanceof recombee.errors.ResponseError) {
|
|
60
|
+
chai.equal(err.statusCode, 404);
|
|
61
|
+
done();
|
|
62
|
+
}
|
|
63
|
+
throw err;
|
|
61
64
|
});
|
|
62
65
|
});
|
|
63
66
|
|
|
@@ -69,9 +72,12 @@ describe('AddDetailView', function(){
|
|
|
69
72
|
chai.fail();
|
|
70
73
|
done();
|
|
71
74
|
})
|
|
72
|
-
.catch(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
.catch((err) => {
|
|
76
|
+
if (err instanceof recombee.errors.ResponseError) {
|
|
77
|
+
chai.equal(err.statusCode, 404);
|
|
78
|
+
done();
|
|
79
|
+
}
|
|
80
|
+
throw err;
|
|
75
81
|
});
|
|
76
82
|
});
|
|
77
83
|
|
|
@@ -83,9 +89,12 @@ describe('AddDetailView', function(){
|
|
|
83
89
|
chai.fail();
|
|
84
90
|
done();
|
|
85
91
|
})
|
|
86
|
-
.catch(
|
|
87
|
-
|
|
88
|
-
|
|
92
|
+
.catch((err) => {
|
|
93
|
+
if (err instanceof recombee.errors.ResponseError) {
|
|
94
|
+
chai.equal(err.statusCode, 400);
|
|
95
|
+
done();
|
|
96
|
+
}
|
|
97
|
+
throw err;
|
|
89
98
|
});
|
|
90
99
|
});
|
|
91
100
|
|
|
@@ -99,9 +108,12 @@ describe('AddDetailView', function(){
|
|
|
99
108
|
chai.fail();
|
|
100
109
|
done();
|
|
101
110
|
})
|
|
102
|
-
.catch(
|
|
103
|
-
|
|
104
|
-
|
|
111
|
+
.catch((err) => {
|
|
112
|
+
if (err instanceof recombee.errors.ResponseError) {
|
|
113
|
+
chai.equal(err.statusCode, 409);
|
|
114
|
+
done();
|
|
115
|
+
}
|
|
116
|
+
throw err;
|
|
105
117
|
});
|
|
106
118
|
});
|
|
107
119
|
});
|
package/test/add-group-test.js
CHANGED
|
@@ -37,9 +37,12 @@ describe('AddGroup', function(){
|
|
|
37
37
|
chai.fail();
|
|
38
38
|
done();
|
|
39
39
|
})
|
|
40
|
-
.catch(
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
.catch((err) => {
|
|
41
|
+
if (err instanceof recombee.errors.ResponseError) {
|
|
42
|
+
chai.equal(err.statusCode, 400);
|
|
43
|
+
done();
|
|
44
|
+
}
|
|
45
|
+
throw err;
|
|
43
46
|
});
|
|
44
47
|
});
|
|
45
48
|
|
|
@@ -53,9 +56,12 @@ describe('AddGroup', function(){
|
|
|
53
56
|
chai.fail();
|
|
54
57
|
done();
|
|
55
58
|
})
|
|
56
|
-
.catch(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
.catch((err) => {
|
|
60
|
+
if (err instanceof recombee.errors.ResponseError) {
|
|
61
|
+
chai.equal(err.statusCode, 409);
|
|
62
|
+
done();
|
|
63
|
+
}
|
|
64
|
+
throw err;
|
|
59
65
|
});
|
|
60
66
|
});
|
|
61
67
|
});
|