@constructor-io/constructorio-node 4.5.1 → 4.5.2
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/package.json
CHANGED
package/src/types/index.d.ts
CHANGED
|
@@ -22,8 +22,8 @@ export interface ConstructorClientOptions {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export interface UserParameters {
|
|
25
|
-
sessionId?:
|
|
26
|
-
clientId?:
|
|
25
|
+
sessionId?: number;
|
|
26
|
+
clientId?: string;
|
|
27
27
|
userId?: string;
|
|
28
28
|
segments?: string;
|
|
29
29
|
testCells?: Record<string, any>;
|
|
@@ -32,8 +32,8 @@ export interface UserParameters {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export interface FmtOptions extends Record<string, any> {
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
groups_max_depth?: number;
|
|
36
|
+
groups_start?: 'current' | 'top';
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export interface RequestFeature extends Record<string, any> {
|
|
@@ -80,11 +80,6 @@ export interface Feature extends Record<string, any> {
|
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
export interface FmtOption extends Record<string, any> {
|
|
84
|
-
groups_start: string;
|
|
85
|
-
groups_max_depth: number;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
83
|
export type Facet = RangeFacet | OptionFacet;
|
|
89
84
|
|
|
90
85
|
export interface BaseFacet extends Record<string, any> {
|
|
@@ -22,6 +22,10 @@ declare class Recommendations {
|
|
|
22
22
|
userParameters?: UserParameters,
|
|
23
23
|
networkParameters?: NetworkParameters
|
|
24
24
|
): Promise<RecommendationsResponse>;
|
|
25
|
+
|
|
26
|
+
getRecommendationPods(
|
|
27
|
+
networkParameters?: NetworkParameters
|
|
28
|
+
): Promise<RecommendationPodsResponse>;
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
/* Recommendations results returned from server */
|
|
@@ -62,3 +66,22 @@ export interface RecommendationsResultType extends Record<string, any> {
|
|
|
62
66
|
[key: string]: any;
|
|
63
67
|
};
|
|
64
68
|
}
|
|
69
|
+
|
|
70
|
+
export interface RecommendationPodsResponse extends Record<string, any> {
|
|
71
|
+
pods: RecommendationPod[];
|
|
72
|
+
total_count: number;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface PodStrategy extends Record<string, any> {
|
|
76
|
+
id: string;
|
|
77
|
+
display_name: string;
|
|
78
|
+
}
|
|
79
|
+
export interface RecommendationPod extends Record<string, any> {
|
|
80
|
+
strategy: PodStrategy;
|
|
81
|
+
id: string;
|
|
82
|
+
display_name: string;
|
|
83
|
+
name: string;
|
|
84
|
+
created_at: string;
|
|
85
|
+
updated_at: string;
|
|
86
|
+
metadata_json: Record<string, any>;
|
|
87
|
+
}
|
package/src/types/search.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
Facet,
|
|
4
4
|
Feature,
|
|
5
5
|
FilterExpression,
|
|
6
|
-
|
|
6
|
+
FmtOptions,
|
|
7
7
|
Group,
|
|
8
8
|
NetworkParameters,
|
|
9
9
|
RequestFeature,
|
|
@@ -22,7 +22,7 @@ export interface SearchParameters {
|
|
|
22
22
|
sortBy?: string;
|
|
23
23
|
sortOrder?: string;
|
|
24
24
|
section?: string;
|
|
25
|
-
fmtOptions?:
|
|
25
|
+
fmtOptions?: FmtOptions;
|
|
26
26
|
preFilterExpression?: FilterExpression;
|
|
27
27
|
hiddenFields?: string[];
|
|
28
28
|
hiddenFacets?: string[];
|
|
@@ -74,8 +74,8 @@ export interface SearchRequestType extends Record<string, any> {
|
|
|
74
74
|
section: string;
|
|
75
75
|
blacklist_rules: boolean;
|
|
76
76
|
term: string;
|
|
77
|
+
fmt_options: FmtOptions;
|
|
77
78
|
original_query?: string;
|
|
78
|
-
fmt_options: Partial<FmtOption>;
|
|
79
79
|
sort_by: string;
|
|
80
80
|
sort_order: string;
|
|
81
81
|
features: Partial<RequestFeature>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { expectAssignable } from 'tsd';
|
|
2
|
+
import { RecommendationPodsResponse } from '..';
|
|
2
3
|
import { RecommendationsResponse } from '../recommendations.d';
|
|
3
4
|
|
|
4
5
|
expectAssignable<RecommendationsResponse>({
|
|
@@ -43,3 +44,31 @@ expectAssignable<RecommendationsResponse>({
|
|
|
43
44
|
},
|
|
44
45
|
result_id: '618c2aa1-b851-451f-b228-61d02bf7e3c5',
|
|
45
46
|
});
|
|
47
|
+
|
|
48
|
+
expectAssignable<RecommendationPodsResponse>({
|
|
49
|
+
pods: [
|
|
50
|
+
{
|
|
51
|
+
strategy: {
|
|
52
|
+
id: 'recently_viewed_items', display_name: 'Recently Viewed',
|
|
53
|
+
},
|
|
54
|
+
id: 'recently-viewed',
|
|
55
|
+
display_name: 'Recently Viewed',
|
|
56
|
+
name: 'Recently viewed',
|
|
57
|
+
created_at: '2023-03-24T20:00:12',
|
|
58
|
+
updated_at: '2023-03-24T20:00:12',
|
|
59
|
+
metadata_json: {},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
strategy: {
|
|
63
|
+
id: 'recently_viewed_items', display_name: 'Recently Viewed',
|
|
64
|
+
},
|
|
65
|
+
id: 'you-may-also-like',
|
|
66
|
+
display_name: 'You May Also Like',
|
|
67
|
+
name: 'You may also like',
|
|
68
|
+
created_at: '2023-03-23T15:25:59',
|
|
69
|
+
updated_at: '2023-03-23T15:32:48',
|
|
70
|
+
metadata_json: {},
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
total_count: 2,
|
|
74
|
+
});
|
package/src/types/tracker.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { ConstructorClientOptions, NetworkParameters } from '.';
|
|
|
4
4
|
export default Tracker;
|
|
5
5
|
|
|
6
6
|
export interface TrackerUserParameters {
|
|
7
|
-
sessionId:
|
|
8
|
-
clientId:
|
|
7
|
+
sessionId: number;
|
|
8
|
+
clientId: string;
|
|
9
9
|
userId?: string;
|
|
10
10
|
segments?: string;
|
|
11
11
|
testCells?: Record<string, any>;
|