recombee-api-client 6.0.0 → 6.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/lib/api-client.js +1 -1
- package/lib/index.d.ts +16 -0
- package/lib/requests/recommend-item-segments-to-item-segment.js +39 -0
- package/lib/requests/recommend-item-segments-to-item.js +39 -0
- package/lib/requests/recommend-item-segments-to-user.js +39 -0
- package/lib/requests/search-item-segments.js +39 -0
- package/package.json +1 -1
package/lib/api-client.js
CHANGED
|
@@ -43,7 +43,7 @@ class ApiClient {
|
|
|
43
43
|
method: request.method,
|
|
44
44
|
headers: {'Accept': 'application/json',
|
|
45
45
|
'Content-Type': 'application/json',
|
|
46
|
-
'User-Agent': 'recombee-node-api-client/6.
|
|
46
|
+
'User-Agent': 'recombee-node-api-client/6.1.0'},
|
|
47
47
|
timeout: request.timeout,
|
|
48
48
|
agent: this.options.agent
|
|
49
49
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -2404,6 +2404,8 @@ declare module "recombee-api-client" {
|
|
|
2404
2404
|
expertSettings?: Record<string, unknown>;
|
|
2405
2405
|
/** If there is a custom AB-testing running, return the name of the group to which the request belongs. */
|
|
2406
2406
|
returnAbGroup?: boolean;
|
|
2407
|
+
/** A dictionary of [ReQL](https://docs.recombee.com/reql) expressions that will be executed for each recommended Item Segment. */
|
|
2408
|
+
reqlExpressions?: Record<string, string>;
|
|
2407
2409
|
}
|
|
2408
2410
|
);
|
|
2409
2411
|
|
|
@@ -2416,6 +2418,7 @@ declare module "recombee-api-client" {
|
|
|
2416
2418
|
logic?: string | object;
|
|
2417
2419
|
expertSettings?: Record<string, unknown>;
|
|
2418
2420
|
returnAbGroup?: boolean;
|
|
2421
|
+
reqlExpressions?: Record<string, string>;
|
|
2419
2422
|
protected __response_type: RecommendationResponse;
|
|
2420
2423
|
|
|
2421
2424
|
bodyParameters(): {
|
|
@@ -2427,6 +2430,7 @@ declare module "recombee-api-client" {
|
|
|
2427
2430
|
logic?: string | object;
|
|
2428
2431
|
expertSettings?: Record<string, unknown>;
|
|
2429
2432
|
returnAbGroup?: boolean;
|
|
2433
|
+
reqlExpressions?: Record<string, string>;
|
|
2430
2434
|
};
|
|
2431
2435
|
|
|
2432
2436
|
queryParameters(): {
|
|
@@ -2482,6 +2486,8 @@ declare module "recombee-api-client" {
|
|
|
2482
2486
|
expertSettings?: Record<string, unknown>;
|
|
2483
2487
|
/** If there is a custom AB-testing running, return the name of the group to which the request belongs. */
|
|
2484
2488
|
returnAbGroup?: boolean;
|
|
2489
|
+
/** A dictionary of [ReQL](https://docs.recombee.com/reql) expressions that will be executed for each recommended Item Segment. */
|
|
2490
|
+
reqlExpressions?: Record<string, string>;
|
|
2485
2491
|
}
|
|
2486
2492
|
);
|
|
2487
2493
|
|
|
@@ -2495,6 +2501,7 @@ declare module "recombee-api-client" {
|
|
|
2495
2501
|
logic?: string | object;
|
|
2496
2502
|
expertSettings?: Record<string, unknown>;
|
|
2497
2503
|
returnAbGroup?: boolean;
|
|
2504
|
+
reqlExpressions?: Record<string, string>;
|
|
2498
2505
|
protected __response_type: RecommendationResponse;
|
|
2499
2506
|
|
|
2500
2507
|
bodyParameters(): {
|
|
@@ -2507,6 +2514,7 @@ declare module "recombee-api-client" {
|
|
|
2507
2514
|
logic?: string | object;
|
|
2508
2515
|
expertSettings?: Record<string, unknown>;
|
|
2509
2516
|
returnAbGroup?: boolean;
|
|
2517
|
+
reqlExpressions?: Record<string, string>;
|
|
2510
2518
|
};
|
|
2511
2519
|
|
|
2512
2520
|
queryParameters(): {
|
|
@@ -2561,6 +2569,8 @@ declare module "recombee-api-client" {
|
|
|
2561
2569
|
expertSettings?: Record<string, unknown>;
|
|
2562
2570
|
/** If there is a custom AB-testing running, return the name of the group to which the request belongs. */
|
|
2563
2571
|
returnAbGroup?: boolean;
|
|
2572
|
+
/** A dictionary of [ReQL](https://docs.recombee.com/reql) expressions that will be executed for each recommended Item Segment. */
|
|
2573
|
+
reqlExpressions?: Record<string, string>;
|
|
2564
2574
|
}
|
|
2565
2575
|
);
|
|
2566
2576
|
|
|
@@ -2574,6 +2584,7 @@ declare module "recombee-api-client" {
|
|
|
2574
2584
|
logic?: string | object;
|
|
2575
2585
|
expertSettings?: Record<string, unknown>;
|
|
2576
2586
|
returnAbGroup?: boolean;
|
|
2587
|
+
reqlExpressions?: Record<string, string>;
|
|
2577
2588
|
protected __response_type: RecommendationResponse;
|
|
2578
2589
|
|
|
2579
2590
|
bodyParameters(): {
|
|
@@ -2587,6 +2598,7 @@ declare module "recombee-api-client" {
|
|
|
2587
2598
|
logic?: string | object;
|
|
2588
2599
|
expertSettings?: Record<string, unknown>;
|
|
2589
2600
|
returnAbGroup?: boolean;
|
|
2601
|
+
reqlExpressions?: Record<string, string>;
|
|
2590
2602
|
};
|
|
2591
2603
|
|
|
2592
2604
|
queryParameters(): {
|
|
@@ -2788,6 +2800,8 @@ declare module "recombee-api-client" {
|
|
|
2788
2800
|
expertSettings?: Record<string, unknown>;
|
|
2789
2801
|
/** If there is a custom AB-testing running, return the name of the group to which the request belongs. */
|
|
2790
2802
|
returnAbGroup?: boolean;
|
|
2803
|
+
/** A dictionary of [ReQL](https://docs.recombee.com/reql) expressions that will be executed for each recommended Item Segment. */
|
|
2804
|
+
reqlExpressions?: Record<string, string>;
|
|
2791
2805
|
}
|
|
2792
2806
|
);
|
|
2793
2807
|
|
|
@@ -2801,6 +2815,7 @@ declare module "recombee-api-client" {
|
|
|
2801
2815
|
logic?: string | object;
|
|
2802
2816
|
expertSettings?: Record<string, unknown>;
|
|
2803
2817
|
returnAbGroup?: boolean;
|
|
2818
|
+
reqlExpressions?: Record<string, string>;
|
|
2804
2819
|
protected __response_type: SearchResponse;
|
|
2805
2820
|
|
|
2806
2821
|
bodyParameters(): {
|
|
@@ -2813,6 +2828,7 @@ declare module "recombee-api-client" {
|
|
|
2813
2828
|
logic?: string | object;
|
|
2814
2829
|
expertSettings?: Record<string, unknown>;
|
|
2815
2830
|
returnAbGroup?: boolean;
|
|
2831
|
+
reqlExpressions?: Record<string, string>;
|
|
2816
2832
|
};
|
|
2817
2833
|
|
|
2818
2834
|
queryParameters(): {
|
|
@@ -62,6 +62,41 @@ class RecommendItemSegmentsToItemSegment extends rqs.Request {
|
|
|
62
62
|
* - *returnAbGroup*
|
|
63
63
|
* - Type: boolean
|
|
64
64
|
* - Description: If there is a custom AB-testing running, return the name of the group to which the request belongs.
|
|
65
|
+
* - *reqlExpressions*
|
|
66
|
+
* - Type: object
|
|
67
|
+
* - Description: A dictionary of [ReQL](https://docs.recombee.com/reql) expressions that will be executed for each recommended Item Segment.
|
|
68
|
+
* This can be used to compute additional properties of the recommended Item Segments.
|
|
69
|
+
* The keys are the names of the expressions, and the values are the actual ReQL expressions.
|
|
70
|
+
* Example request:
|
|
71
|
+
* ```json
|
|
72
|
+
* {
|
|
73
|
+
* "reqlExpressions": {
|
|
74
|
+
* "countItems": "size(segment_items(\"categories\", 'segmentId'))"
|
|
75
|
+
* }
|
|
76
|
+
* }
|
|
77
|
+
* ```
|
|
78
|
+
* Example response:
|
|
79
|
+
* ```json
|
|
80
|
+
* {
|
|
81
|
+
* "recommId": "a7ac55a4-8d6e-4f19-addc-abac4164d8a8",
|
|
82
|
+
* "recomms":
|
|
83
|
+
* [
|
|
84
|
+
* {
|
|
85
|
+
* "id": "category-fantasy-books",
|
|
86
|
+
* "reqlEvaluations": {
|
|
87
|
+
* "countItems": 486
|
|
88
|
+
* }
|
|
89
|
+
* },
|
|
90
|
+
* {
|
|
91
|
+
* "id": "category-sci-fi-costumes",
|
|
92
|
+
* "reqlEvaluations": {
|
|
93
|
+
* "countItems": 19
|
|
94
|
+
* }
|
|
95
|
+
* }
|
|
96
|
+
* ],
|
|
97
|
+
* "numberNextRecommsCalls": 0
|
|
98
|
+
* }
|
|
99
|
+
* ```
|
|
65
100
|
*/
|
|
66
101
|
constructor(contextSegmentId, targetUserId, count, optional) {
|
|
67
102
|
super('POST', '/recomms/item-segments/item-segments/', 3000, false);
|
|
@@ -76,6 +111,7 @@ class RecommendItemSegmentsToItemSegment extends rqs.Request {
|
|
|
76
111
|
this.logic = optional.logic;
|
|
77
112
|
this.expertSettings = optional.expertSettings;
|
|
78
113
|
this.returnAbGroup = optional.returnAbGroup;
|
|
114
|
+
this.reqlExpressions = optional.reqlExpressions;
|
|
79
115
|
}
|
|
80
116
|
|
|
81
117
|
/**
|
|
@@ -109,6 +145,9 @@ class RecommendItemSegmentsToItemSegment extends rqs.Request {
|
|
|
109
145
|
if(this.returnAbGroup !== undefined)
|
|
110
146
|
params.returnAbGroup = this.returnAbGroup;
|
|
111
147
|
|
|
148
|
+
if(this.reqlExpressions !== undefined)
|
|
149
|
+
params.reqlExpressions = this.reqlExpressions;
|
|
150
|
+
|
|
112
151
|
return params;
|
|
113
152
|
}
|
|
114
153
|
|
|
@@ -63,6 +63,41 @@ class RecommendItemSegmentsToItem extends rqs.Request {
|
|
|
63
63
|
* - *returnAbGroup*
|
|
64
64
|
* - Type: boolean
|
|
65
65
|
* - Description: If there is a custom AB-testing running, return the name of the group to which the request belongs.
|
|
66
|
+
* - *reqlExpressions*
|
|
67
|
+
* - Type: object
|
|
68
|
+
* - Description: A dictionary of [ReQL](https://docs.recombee.com/reql) expressions that will be executed for each recommended Item Segment.
|
|
69
|
+
* This can be used to compute additional properties of the recommended Item Segments.
|
|
70
|
+
* The keys are the names of the expressions, and the values are the actual ReQL expressions.
|
|
71
|
+
* Example request:
|
|
72
|
+
* ```json
|
|
73
|
+
* {
|
|
74
|
+
* "reqlExpressions": {
|
|
75
|
+
* "countItems": "size(segment_items(\"categories\", 'segmentId'))"
|
|
76
|
+
* }
|
|
77
|
+
* }
|
|
78
|
+
* ```
|
|
79
|
+
* Example response:
|
|
80
|
+
* ```json
|
|
81
|
+
* {
|
|
82
|
+
* "recommId": "a7ac55a4-8d6e-4f19-addc-abac4164d8a8",
|
|
83
|
+
* "recomms":
|
|
84
|
+
* [
|
|
85
|
+
* {
|
|
86
|
+
* "id": "category-fantasy-books",
|
|
87
|
+
* "reqlEvaluations": {
|
|
88
|
+
* "countItems": 486
|
|
89
|
+
* }
|
|
90
|
+
* },
|
|
91
|
+
* {
|
|
92
|
+
* "id": "category-sci-fi-costumes",
|
|
93
|
+
* "reqlEvaluations": {
|
|
94
|
+
* "countItems": 19
|
|
95
|
+
* }
|
|
96
|
+
* }
|
|
97
|
+
* ],
|
|
98
|
+
* "numberNextRecommsCalls": 0
|
|
99
|
+
* }
|
|
100
|
+
* ```
|
|
66
101
|
*/
|
|
67
102
|
constructor(itemId, targetUserId, count, optional) {
|
|
68
103
|
super('POST', `/recomms/items/${itemId}/item-segments/`, 3000, false);
|
|
@@ -77,6 +112,7 @@ class RecommendItemSegmentsToItem extends rqs.Request {
|
|
|
77
112
|
this.logic = optional.logic;
|
|
78
113
|
this.expertSettings = optional.expertSettings;
|
|
79
114
|
this.returnAbGroup = optional.returnAbGroup;
|
|
115
|
+
this.reqlExpressions = optional.reqlExpressions;
|
|
80
116
|
}
|
|
81
117
|
|
|
82
118
|
/**
|
|
@@ -109,6 +145,9 @@ class RecommendItemSegmentsToItem extends rqs.Request {
|
|
|
109
145
|
if(this.returnAbGroup !== undefined)
|
|
110
146
|
params.returnAbGroup = this.returnAbGroup;
|
|
111
147
|
|
|
148
|
+
if(this.reqlExpressions !== undefined)
|
|
149
|
+
params.reqlExpressions = this.reqlExpressions;
|
|
150
|
+
|
|
112
151
|
return params;
|
|
113
152
|
}
|
|
114
153
|
|
|
@@ -50,6 +50,41 @@ class RecommendItemSegmentsToUser extends rqs.Request {
|
|
|
50
50
|
* - *returnAbGroup*
|
|
51
51
|
* - Type: boolean
|
|
52
52
|
* - Description: If there is a custom AB-testing running, return the name of the group to which the request belongs.
|
|
53
|
+
* - *reqlExpressions*
|
|
54
|
+
* - Type: object
|
|
55
|
+
* - Description: A dictionary of [ReQL](https://docs.recombee.com/reql) expressions that will be executed for each recommended Item Segment.
|
|
56
|
+
* This can be used to compute additional properties of the recommended Item Segments.
|
|
57
|
+
* The keys are the names of the expressions, and the values are the actual ReQL expressions.
|
|
58
|
+
* Example request:
|
|
59
|
+
* ```json
|
|
60
|
+
* {
|
|
61
|
+
* "reqlExpressions": {
|
|
62
|
+
* "countItems": "size(segment_items(\"categories\", 'segmentId'))"
|
|
63
|
+
* }
|
|
64
|
+
* }
|
|
65
|
+
* ```
|
|
66
|
+
* Example response:
|
|
67
|
+
* ```json
|
|
68
|
+
* {
|
|
69
|
+
* "recommId": "a7ac55a4-8d6e-4f19-addc-abac4164d8a8",
|
|
70
|
+
* "recomms":
|
|
71
|
+
* [
|
|
72
|
+
* {
|
|
73
|
+
* "id": "category-fantasy-books",
|
|
74
|
+
* "reqlEvaluations": {
|
|
75
|
+
* "countItems": 486
|
|
76
|
+
* }
|
|
77
|
+
* },
|
|
78
|
+
* {
|
|
79
|
+
* "id": "category-sci-fi-costumes",
|
|
80
|
+
* "reqlEvaluations": {
|
|
81
|
+
* "countItems": 19
|
|
82
|
+
* }
|
|
83
|
+
* }
|
|
84
|
+
* ],
|
|
85
|
+
* "numberNextRecommsCalls": 0
|
|
86
|
+
* }
|
|
87
|
+
* ```
|
|
53
88
|
*/
|
|
54
89
|
constructor(userId, count, optional) {
|
|
55
90
|
super('POST', `/recomms/users/${userId}/item-segments/`, 3000, false);
|
|
@@ -63,6 +98,7 @@ class RecommendItemSegmentsToUser extends rqs.Request {
|
|
|
63
98
|
this.logic = optional.logic;
|
|
64
99
|
this.expertSettings = optional.expertSettings;
|
|
65
100
|
this.returnAbGroup = optional.returnAbGroup;
|
|
101
|
+
this.reqlExpressions = optional.reqlExpressions;
|
|
66
102
|
}
|
|
67
103
|
|
|
68
104
|
/**
|
|
@@ -94,6 +130,9 @@ class RecommendItemSegmentsToUser extends rqs.Request {
|
|
|
94
130
|
if(this.returnAbGroup !== undefined)
|
|
95
131
|
params.returnAbGroup = this.returnAbGroup;
|
|
96
132
|
|
|
133
|
+
if(this.reqlExpressions !== undefined)
|
|
134
|
+
params.reqlExpressions = this.reqlExpressions;
|
|
135
|
+
|
|
97
136
|
return params;
|
|
98
137
|
}
|
|
99
138
|
|
|
@@ -50,6 +50,41 @@ class SearchItemSegments extends rqs.Request {
|
|
|
50
50
|
* - *returnAbGroup*
|
|
51
51
|
* - Type: boolean
|
|
52
52
|
* - Description: If there is a custom AB-testing running, return the name of the group to which the request belongs.
|
|
53
|
+
* - *reqlExpressions*
|
|
54
|
+
* - Type: object
|
|
55
|
+
* - Description: A dictionary of [ReQL](https://docs.recombee.com/reql) expressions that will be executed for each recommended Item Segment.
|
|
56
|
+
* This can be used to compute additional properties of the recommended Item Segments.
|
|
57
|
+
* The keys are the names of the expressions, and the values are the actual ReQL expressions.
|
|
58
|
+
* Example request:
|
|
59
|
+
* ```json
|
|
60
|
+
* {
|
|
61
|
+
* "reqlExpressions": {
|
|
62
|
+
* "countItems": "size(segment_items(\"categories\", 'segmentId'))"
|
|
63
|
+
* }
|
|
64
|
+
* }
|
|
65
|
+
* ```
|
|
66
|
+
* Example response:
|
|
67
|
+
* ```json
|
|
68
|
+
* {
|
|
69
|
+
* "recommId": "a7ac55a4-8d6e-4f19-addc-abac4164d8a8",
|
|
70
|
+
* "recomms":
|
|
71
|
+
* [
|
|
72
|
+
* {
|
|
73
|
+
* "id": "category-fantasy-books",
|
|
74
|
+
* "reqlEvaluations": {
|
|
75
|
+
* "countItems": 486
|
|
76
|
+
* }
|
|
77
|
+
* },
|
|
78
|
+
* {
|
|
79
|
+
* "id": "category-sci-fi-costumes",
|
|
80
|
+
* "reqlEvaluations": {
|
|
81
|
+
* "countItems": 19
|
|
82
|
+
* }
|
|
83
|
+
* }
|
|
84
|
+
* ],
|
|
85
|
+
* "numberNextRecommsCalls": 0
|
|
86
|
+
* }
|
|
87
|
+
* ```
|
|
53
88
|
*/
|
|
54
89
|
constructor(userId, searchQuery, count, optional) {
|
|
55
90
|
super('POST', `/search/users/${userId}/item-segments/`, 3000, false);
|
|
@@ -64,6 +99,7 @@ class SearchItemSegments extends rqs.Request {
|
|
|
64
99
|
this.logic = optional.logic;
|
|
65
100
|
this.expertSettings = optional.expertSettings;
|
|
66
101
|
this.returnAbGroup = optional.returnAbGroup;
|
|
102
|
+
this.reqlExpressions = optional.reqlExpressions;
|
|
67
103
|
}
|
|
68
104
|
|
|
69
105
|
/**
|
|
@@ -96,6 +132,9 @@ class SearchItemSegments extends rqs.Request {
|
|
|
96
132
|
if(this.returnAbGroup !== undefined)
|
|
97
133
|
params.returnAbGroup = this.returnAbGroup;
|
|
98
134
|
|
|
135
|
+
if(this.reqlExpressions !== undefined)
|
|
136
|
+
params.reqlExpressions = this.reqlExpressions;
|
|
137
|
+
|
|
99
138
|
return params;
|
|
100
139
|
}
|
|
101
140
|
|