@constructor-io/constructorio-client-javascript 2.35.10 → 2.35.12
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/modules/recommendations.js +14 -1
- package/lib/modules/tracker.js +747 -530
- package/lib/types/recommendations.d.ts +1 -0
- package/lib/types/tracker.d.ts +83 -83
- package/lib/utils/helpers.js +14 -0
- package/package.json +1 -1
package/lib/types/tracker.d.ts
CHANGED
|
@@ -19,9 +19,9 @@ declare class Tracker {
|
|
|
19
19
|
|
|
20
20
|
trackItemDetailLoad(
|
|
21
21
|
parameters: {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
itemName: string;
|
|
23
|
+
itemId: string;
|
|
24
|
+
variationId?: string;
|
|
25
25
|
},
|
|
26
26
|
networkParameters?: NetworkParameters
|
|
27
27
|
): true | Error;
|
|
@@ -29,11 +29,11 @@ declare class Tracker {
|
|
|
29
29
|
trackAutocompleteSelect(
|
|
30
30
|
term: string,
|
|
31
31
|
parameters: {
|
|
32
|
-
|
|
32
|
+
originalQuery: string;
|
|
33
33
|
section: string;
|
|
34
34
|
tr?: string;
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
groupId?: string;
|
|
36
|
+
displayName?: string;
|
|
37
37
|
},
|
|
38
38
|
networkParameters?: NetworkParameters
|
|
39
39
|
): true | Error;
|
|
@@ -41,9 +41,9 @@ declare class Tracker {
|
|
|
41
41
|
trackSearchSubmit(
|
|
42
42
|
term: string,
|
|
43
43
|
parameters: {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
originalQuery: string;
|
|
45
|
+
groupId?: string;
|
|
46
|
+
displayName?: string;
|
|
47
47
|
},
|
|
48
48
|
networkParameters?: NetworkParameters
|
|
49
49
|
): true | Error;
|
|
@@ -51,8 +51,8 @@ declare class Tracker {
|
|
|
51
51
|
trackSearchResultsLoaded(
|
|
52
52
|
term: string,
|
|
53
53
|
parameters: {
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
numResults: number;
|
|
55
|
+
itemIds?: string[];
|
|
56
56
|
},
|
|
57
57
|
networkParameters?: NetworkParameters
|
|
58
58
|
): true | Error;
|
|
@@ -60,11 +60,11 @@ declare class Tracker {
|
|
|
60
60
|
trackSearchResultClick(
|
|
61
61
|
term: string,
|
|
62
62
|
parameters: {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
itemName: string;
|
|
64
|
+
itemId: string;
|
|
65
|
+
variationId?: string;
|
|
66
|
+
resultId?: string;
|
|
67
|
+
itemIsConvertible?: string;
|
|
68
68
|
section?: string;
|
|
69
69
|
},
|
|
70
70
|
networkParameters?: NetworkParameters
|
|
@@ -73,14 +73,14 @@ declare class Tracker {
|
|
|
73
73
|
trackConversion(
|
|
74
74
|
term?: string,
|
|
75
75
|
parameters: {
|
|
76
|
-
|
|
76
|
+
itemId: string;
|
|
77
77
|
revenue?: number;
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
itemName?: string;
|
|
79
|
+
variationId?: string;
|
|
80
80
|
type?: string;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
isCustomType?: boolean;
|
|
82
|
+
displayName?: string;
|
|
83
|
+
resultId?: string;
|
|
84
84
|
section?: string;
|
|
85
85
|
},
|
|
86
86
|
networkParameters?: NetworkParameters
|
|
@@ -90,7 +90,7 @@ declare class Tracker {
|
|
|
90
90
|
parameters: {
|
|
91
91
|
items: object[];
|
|
92
92
|
revenue: number;
|
|
93
|
-
|
|
93
|
+
orderId?: string;
|
|
94
94
|
section?: string;
|
|
95
95
|
},
|
|
96
96
|
networkParameters?: NetworkParameters
|
|
@@ -99,12 +99,12 @@ declare class Tracker {
|
|
|
99
99
|
trackRecommendationView(
|
|
100
100
|
parameters: {
|
|
101
101
|
url: string;
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
podId: string;
|
|
103
|
+
numResultsViewed: number;
|
|
104
104
|
items?: object[];
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
resultCount?: number;
|
|
106
|
+
resultPage?: number;
|
|
107
|
+
resultId?: string;
|
|
108
108
|
section?: string;
|
|
109
109
|
},
|
|
110
110
|
networkParameters?: NetworkParameters
|
|
@@ -112,17 +112,17 @@ declare class Tracker {
|
|
|
112
112
|
|
|
113
113
|
trackRecommendationClick(
|
|
114
114
|
parameters: {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
115
|
+
podId: string;
|
|
116
|
+
strategyId: string;
|
|
117
|
+
itemId: string;
|
|
118
|
+
itemName: string;
|
|
119
|
+
variationId?: string;
|
|
120
120
|
section?: string;
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
resultId?: string;
|
|
122
|
+
resultCount?: number;
|
|
123
|
+
resultPage?: number;
|
|
124
|
+
resultPositionOnPage?: number;
|
|
125
|
+
numResultsPerPage?: number;
|
|
126
126
|
},
|
|
127
127
|
networkParameters?: NetworkParameters
|
|
128
128
|
): true | Error;
|
|
@@ -130,15 +130,15 @@ declare class Tracker {
|
|
|
130
130
|
trackBrowseResultsLoaded(
|
|
131
131
|
parameters: {
|
|
132
132
|
url: string;
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
filterName: string;
|
|
134
|
+
filterValue: string;
|
|
135
135
|
section?: string;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
136
|
+
resultCount?: number;
|
|
137
|
+
resultPage?: number;
|
|
138
|
+
resultId?: string;
|
|
139
|
+
selectedFilters?: object;
|
|
140
|
+
sortOrder?: string;
|
|
141
|
+
sortBy?: string;
|
|
142
142
|
items?: object[];
|
|
143
143
|
},
|
|
144
144
|
networkParameters?: NetworkParameters
|
|
@@ -146,26 +146,26 @@ declare class Tracker {
|
|
|
146
146
|
|
|
147
147
|
trackBrowseResultClick(
|
|
148
148
|
parameters: {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
filterName: string;
|
|
150
|
+
filterValue: string;
|
|
151
|
+
itemId: string;
|
|
152
152
|
section?: string;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
153
|
+
variationId?: string;
|
|
154
|
+
resultId?: string;
|
|
155
|
+
resultCount?: number;
|
|
156
|
+
resultPage?: number;
|
|
157
|
+
resultPositionOnPage?: number;
|
|
158
|
+
numResultsPerPage?: number;
|
|
159
|
+
selectedFilters?: object;
|
|
160
160
|
},
|
|
161
161
|
networkParameters?: NetworkParameters
|
|
162
162
|
): true | Error;
|
|
163
163
|
|
|
164
164
|
trackGenericResultClick(
|
|
165
165
|
parameters: {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
itemId: string;
|
|
167
|
+
itemName?: string;
|
|
168
|
+
variationId?: string;
|
|
169
169
|
section?: string;
|
|
170
170
|
},
|
|
171
171
|
networkParameters?: NetworkParameters
|
|
@@ -173,48 +173,48 @@ declare class Tracker {
|
|
|
173
173
|
|
|
174
174
|
trackQuizResultsLoaded(
|
|
175
175
|
parameters: {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
176
|
+
quizId: string;
|
|
177
|
+
quizVersionId: string;
|
|
178
|
+
quizSessionId: string;
|
|
179
179
|
url: string;
|
|
180
180
|
section?: string;
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
resultCount?: number;
|
|
182
|
+
resultPage?: number;
|
|
183
|
+
resultId?: string;
|
|
184
184
|
},
|
|
185
185
|
networkParameters?: NetworkParameters
|
|
186
186
|
): true | Error;
|
|
187
187
|
|
|
188
188
|
trackQuizResultClick(
|
|
189
189
|
parameters: {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
190
|
+
quizId: string;
|
|
191
|
+
quizVersionId: string;
|
|
192
|
+
quizSessionId: string;
|
|
193
|
+
itemId?: string;
|
|
194
|
+
itemName?: string;
|
|
195
195
|
section?: string;
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
196
|
+
resultCount?: number;
|
|
197
|
+
resultPage?: number;
|
|
198
|
+
resultId?: string;
|
|
199
|
+
resultPositionOnPage?: number;
|
|
200
|
+
numResultsPerPage?: number;
|
|
201
201
|
},
|
|
202
202
|
networkParameters?: NetworkParameters
|
|
203
203
|
): true | Error;
|
|
204
204
|
|
|
205
205
|
trackQuizConversion(
|
|
206
206
|
parameters: {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
207
|
+
quizId: string;
|
|
208
|
+
quizVersionId: string;
|
|
209
|
+
quizSessionId: string;
|
|
210
|
+
itemId?: string;
|
|
211
|
+
itemName?: string;
|
|
212
212
|
section?: string;
|
|
213
|
-
|
|
213
|
+
variationId?: string;
|
|
214
214
|
revenue?: string;
|
|
215
215
|
type?: string;
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
isCustomType?: boolean;
|
|
217
|
+
displayName?: string;
|
|
218
218
|
},
|
|
219
219
|
networkParameters?: NetworkParameters
|
|
220
220
|
): true | Error;
|
package/lib/utils/helpers.js
CHANGED
|
@@ -183,6 +183,20 @@ var utils = {
|
|
|
183
183
|
}
|
|
184
184
|
});
|
|
185
185
|
return allValues.join('&');
|
|
186
|
+
},
|
|
187
|
+
toSnakeCase: function toSnakeCase(camelCasedStr) {
|
|
188
|
+
return camelCasedStr.replace(/[A-Z]/g, function (prefix) {
|
|
189
|
+
return "_".concat(prefix.toLowerCase());
|
|
190
|
+
});
|
|
191
|
+
},
|
|
192
|
+
toSnakeCaseKeys: function toSnakeCaseKeys(camelCasedObj) {
|
|
193
|
+
var toRecurse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
194
|
+
var snakeCasedObj = {};
|
|
195
|
+
Object.keys(camelCasedObj).forEach(function (key) {
|
|
196
|
+
var newKey = utils.toSnakeCase(key);
|
|
197
|
+
snakeCasedObj[newKey] = toRecurse && (0, _typeof2["default"])(camelCasedObj[key]) === 'object' && !Array.isArray(camelCasedObj[key]) ? utils.toSnakeCaseKeys(camelCasedObj[key], toRecurse) : camelCasedObj[key];
|
|
198
|
+
});
|
|
199
|
+
return snakeCasedObj;
|
|
186
200
|
}
|
|
187
201
|
};
|
|
188
202
|
module.exports = utils;
|
package/package.json
CHANGED