@constructor-io/constructorio-node 4.2.1 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +12 -4
- package/src/.DS_Store +0 -0
- package/src/constructorio.js +2 -1
- package/src/modules/autocomplete.js +1 -2
- package/src/modules/browse.js +5 -6
- package/src/modules/catalog.js +62 -64
- package/src/modules/quizzes.js +7 -7
- package/src/modules/recommendations.js +2 -3
- package/src/modules/search.js +1 -2
- package/src/modules/tasks.js +2 -3
- package/src/modules/tracker.js +49 -13
- package/src/types/autocomplete.d.ts +56 -0
- package/src/types/browse.d.ts +140 -0
- package/src/types/catalog.d.ts +535 -0
- package/src/types/constructorio.d.ts +34 -0
- package/src/types/index.d.ts +277 -0
- package/src/types/quizzes.d.ts +73 -0
- package/src/types/recommendations.d.ts +64 -0
- package/src/types/search.d.ts +98 -0
- package/src/types/tasks.d.ts +70 -0
- package/src/types/tests/autocomplete.test-d.ts +59 -0
- package/src/types/tests/browse.test-d.ts +120 -0
- package/src/types/tests/catalog.test-d.ts +109 -0
- package/src/types/tests/quizzes.test-d.ts +82 -0
- package/src/types/tests/recommedations.test-d.ts +45 -0
- package/src/types/tests/search.test-d.ts +124 -0
- package/src/types/tests/tasks.test-d.ts +40 -0
- package/src/types/tracker.d.ts +203 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { EventEmitter } from 'events';
|
|
2
|
+
import { ConstructorClientOptions, NetworkParameters } from '.';
|
|
3
|
+
|
|
4
|
+
export default Tracker;
|
|
5
|
+
|
|
6
|
+
export interface TrackerUserParameters {
|
|
7
|
+
sessionId: Number;
|
|
8
|
+
clientId: Number;
|
|
9
|
+
userId?: string;
|
|
10
|
+
segments?: string;
|
|
11
|
+
testCells?: Record<string, any>;
|
|
12
|
+
originReferrer?: string;
|
|
13
|
+
referer?: string;
|
|
14
|
+
userIp?: string;
|
|
15
|
+
userAgent?: string;
|
|
16
|
+
acceptLanguage?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare class Tracker {
|
|
20
|
+
constructor(options: ConstructorClientOptions);
|
|
21
|
+
|
|
22
|
+
private options: ConstructorClientOptions;
|
|
23
|
+
|
|
24
|
+
private eventemitter: EventEmitter;
|
|
25
|
+
|
|
26
|
+
trackSessionStart(
|
|
27
|
+
userParameters: TrackerUserParameters,
|
|
28
|
+
networkParameters?: NetworkParameters
|
|
29
|
+
): true | Error;
|
|
30
|
+
|
|
31
|
+
trackInputFocus(
|
|
32
|
+
userParameters?: TrackerUserParameters,
|
|
33
|
+
networkParameters?: NetworkParameters
|
|
34
|
+
): true | Error;
|
|
35
|
+
|
|
36
|
+
trackItemDetailLoad(
|
|
37
|
+
parameters: {
|
|
38
|
+
item_name: string;
|
|
39
|
+
item_id: string;
|
|
40
|
+
variation_id?: string;
|
|
41
|
+
},
|
|
42
|
+
userParameters?: TrackerUserParameters,
|
|
43
|
+
networkParameters?: NetworkParameters
|
|
44
|
+
): true | Error;
|
|
45
|
+
|
|
46
|
+
trackAutocompleteSelect(
|
|
47
|
+
term: string,
|
|
48
|
+
parameters: {
|
|
49
|
+
original_query: string;
|
|
50
|
+
section: string;
|
|
51
|
+
tr?: string;
|
|
52
|
+
group_id?: string;
|
|
53
|
+
display_name?: string;
|
|
54
|
+
},
|
|
55
|
+
userParameters?: TrackerUserParameters,
|
|
56
|
+
networkParameters?: NetworkParameters
|
|
57
|
+
): true | Error;
|
|
58
|
+
|
|
59
|
+
trackSearchSubmit(
|
|
60
|
+
term: string,
|
|
61
|
+
parameters: {
|
|
62
|
+
original_query: string;
|
|
63
|
+
group_id?: string;
|
|
64
|
+
display_name?: string;
|
|
65
|
+
},
|
|
66
|
+
userParameters?: TrackerUserParameters,
|
|
67
|
+
networkParameters?: NetworkParameters
|
|
68
|
+
): true | Error;
|
|
69
|
+
|
|
70
|
+
trackSearchResultsLoaded(
|
|
71
|
+
term: string,
|
|
72
|
+
parameters: {
|
|
73
|
+
num_results: number;
|
|
74
|
+
item_ids?: string[];
|
|
75
|
+
},
|
|
76
|
+
userParameters?: TrackerUserParameters,
|
|
77
|
+
networkParameters?: NetworkParameters
|
|
78
|
+
): true | Error;
|
|
79
|
+
|
|
80
|
+
trackSearchResultClick(
|
|
81
|
+
term: string,
|
|
82
|
+
parameters: {
|
|
83
|
+
item_name: string;
|
|
84
|
+
item_id: string;
|
|
85
|
+
variation_id?: string;
|
|
86
|
+
result_id?: string;
|
|
87
|
+
item_is_convertible?: string;
|
|
88
|
+
section?: string;
|
|
89
|
+
},
|
|
90
|
+
userParameters?: TrackerUserParameters,
|
|
91
|
+
networkParameters?: NetworkParameters
|
|
92
|
+
): true | Error;
|
|
93
|
+
|
|
94
|
+
trackConversion(
|
|
95
|
+
term?: string,
|
|
96
|
+
parameters: {
|
|
97
|
+
item_id: string;
|
|
98
|
+
revenue?: number;
|
|
99
|
+
item_name?: string;
|
|
100
|
+
variation_id?: string;
|
|
101
|
+
type?: string;
|
|
102
|
+
is_custom_type?: boolean;
|
|
103
|
+
display_name?: string;
|
|
104
|
+
result_id?: string;
|
|
105
|
+
section?: string;
|
|
106
|
+
},
|
|
107
|
+
userParameters?: TrackerUserParameters,
|
|
108
|
+
networkParameters?: NetworkParameters
|
|
109
|
+
): true | Error;
|
|
110
|
+
|
|
111
|
+
trackPurchase(
|
|
112
|
+
parameters: {
|
|
113
|
+
items: object[];
|
|
114
|
+
revenue: number;
|
|
115
|
+
order_id?: string;
|
|
116
|
+
section?: string;
|
|
117
|
+
},
|
|
118
|
+
userParameters?: TrackerUserParameters,
|
|
119
|
+
networkParameters?: NetworkParameters
|
|
120
|
+
): true | Error;
|
|
121
|
+
|
|
122
|
+
trackRecommendationView(
|
|
123
|
+
parameters: {
|
|
124
|
+
url: string;
|
|
125
|
+
pod_id: string;
|
|
126
|
+
num_results_viewed: number;
|
|
127
|
+
items?: object[];
|
|
128
|
+
result_count?: number;
|
|
129
|
+
result_page?: number;
|
|
130
|
+
result_id?: string;
|
|
131
|
+
section?: string;
|
|
132
|
+
},
|
|
133
|
+
userParameters?: TrackerUserParameters,
|
|
134
|
+
networkParameters?: NetworkParameters
|
|
135
|
+
): true | Error;
|
|
136
|
+
|
|
137
|
+
trackRecommendationClick(
|
|
138
|
+
parameters: {
|
|
139
|
+
pod_id: string;
|
|
140
|
+
strategy_id: string;
|
|
141
|
+
item_id: string;
|
|
142
|
+
item_name: string;
|
|
143
|
+
variation_id?: string;
|
|
144
|
+
section?: string;
|
|
145
|
+
result_id?: string;
|
|
146
|
+
result_count?: number;
|
|
147
|
+
result_page?: number;
|
|
148
|
+
result_position_on_page?: number;
|
|
149
|
+
num_results_per_page?: number;
|
|
150
|
+
},
|
|
151
|
+
userParameters?: TrackerUserParameters,
|
|
152
|
+
networkParameters?: NetworkParameters
|
|
153
|
+
): true | Error;
|
|
154
|
+
|
|
155
|
+
trackBrowseResultsLoaded(
|
|
156
|
+
parameters: {
|
|
157
|
+
url: string;
|
|
158
|
+
filter_name: string;
|
|
159
|
+
filter_value: string;
|
|
160
|
+
section?: string;
|
|
161
|
+
result_count?: number;
|
|
162
|
+
result_page?: number;
|
|
163
|
+
result_id?: string;
|
|
164
|
+
selected_filters?: object;
|
|
165
|
+
sort_order?: string;
|
|
166
|
+
sort_by?: string;
|
|
167
|
+
items?: object[];
|
|
168
|
+
},
|
|
169
|
+
userParameters?: TrackerUserParameters,
|
|
170
|
+
networkParameters?: NetworkParameters
|
|
171
|
+
): true | Error;
|
|
172
|
+
|
|
173
|
+
trackBrowseResultClick(
|
|
174
|
+
parameters: {
|
|
175
|
+
filter_name: string;
|
|
176
|
+
filter_value: string;
|
|
177
|
+
item_id: string;
|
|
178
|
+
section?: string;
|
|
179
|
+
variation_id?: string;
|
|
180
|
+
result_id?: string;
|
|
181
|
+
result_count?: number;
|
|
182
|
+
result_page?: number;
|
|
183
|
+
result_position_on_page?: number;
|
|
184
|
+
num_results_per_page?: number;
|
|
185
|
+
selected_filters?: object;
|
|
186
|
+
},
|
|
187
|
+
userParameters?: TrackerUserParameters,
|
|
188
|
+
networkParameters?: NetworkParameters
|
|
189
|
+
): true | Error;
|
|
190
|
+
|
|
191
|
+
trackGenericResultClick(
|
|
192
|
+
parameters: {
|
|
193
|
+
item_id: string;
|
|
194
|
+
item_name?: string;
|
|
195
|
+
variation_id?: string;
|
|
196
|
+
section?: string;
|
|
197
|
+
},
|
|
198
|
+
userParameters?: TrackerUserParameters,
|
|
199
|
+
networkParameters?: NetworkParameters
|
|
200
|
+
): true | Error;
|
|
201
|
+
|
|
202
|
+
on(messageType: string, callback: Function): true | Error;
|
|
203
|
+
}
|