@constructor-io/constructorio-client-javascript 2.33.1 → 2.33.3
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/tracker.js +7 -1
- package/lib/utils/request-queue.js +13 -1
- package/package.json +1 -1
package/lib/modules/tracker.js
CHANGED
|
@@ -449,6 +449,7 @@ var Tracker = /*#__PURE__*/function () {
|
|
|
449
449
|
* @param {string} [parameters.variation_id] - Product item variation unique identifier
|
|
450
450
|
* @param {string} [parameters.result_id] - Search result identifier (returned in response from Constructor)
|
|
451
451
|
* @param {string} [parameters.item_is_convertible] - Whether or not an item is available for a conversion
|
|
452
|
+
* @param {string} [parameters.section] - The section name for the item Ex. "Products"
|
|
452
453
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
453
454
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
454
455
|
* @returns {(true|Error)}
|
|
@@ -481,7 +482,8 @@ var Tracker = /*#__PURE__*/function () {
|
|
|
481
482
|
customer_id = parameters.customer_id,
|
|
482
483
|
variation_id = parameters.variation_id,
|
|
483
484
|
result_id = parameters.result_id,
|
|
484
|
-
item_is_convertible = parameters.item_is_convertible
|
|
485
|
+
item_is_convertible = parameters.item_is_convertible,
|
|
486
|
+
section = parameters.section; // Ensure support for both item_name and name as parameters
|
|
485
487
|
|
|
486
488
|
if (item_name) {
|
|
487
489
|
queryParams.name = item_name;
|
|
@@ -508,6 +510,10 @@ var Tracker = /*#__PURE__*/function () {
|
|
|
508
510
|
queryParams.item_is_convertible = item_is_convertible;
|
|
509
511
|
}
|
|
510
512
|
|
|
513
|
+
if (section) {
|
|
514
|
+
queryParams.section = section;
|
|
515
|
+
}
|
|
516
|
+
|
|
511
517
|
this.requests.queue("".concat(url).concat(applyParamsAsString(queryParams, this.options)), undefined, undefined, networkParameters);
|
|
512
518
|
this.requests.send();
|
|
513
519
|
return true;
|
|
@@ -141,6 +141,10 @@ var RequestQueue = /*#__PURE__*/function () {
|
|
|
141
141
|
message: 'ok'
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
|
+
|
|
145
|
+
_this2.requestPending = false;
|
|
146
|
+
|
|
147
|
+
_this2.send();
|
|
144
148
|
} // Request was successful, but returned a non-2XX status code
|
|
145
149
|
else {
|
|
146
150
|
response.json().then(function (json) {
|
|
@@ -151,6 +155,10 @@ var RequestQueue = /*#__PURE__*/function () {
|
|
|
151
155
|
message: json && json.message
|
|
152
156
|
});
|
|
153
157
|
}
|
|
158
|
+
|
|
159
|
+
_this2.requestPending = false;
|
|
160
|
+
|
|
161
|
+
_this2.send();
|
|
154
162
|
})["catch"](function (error) {
|
|
155
163
|
if (instance.eventemitter) {
|
|
156
164
|
instance.eventemitter.emit('error', {
|
|
@@ -159,6 +167,10 @@ var RequestQueue = /*#__PURE__*/function () {
|
|
|
159
167
|
message: error.type
|
|
160
168
|
});
|
|
161
169
|
}
|
|
170
|
+
|
|
171
|
+
_this2.requestPending = false;
|
|
172
|
+
|
|
173
|
+
_this2.send();
|
|
162
174
|
});
|
|
163
175
|
}
|
|
164
176
|
})["catch"](function (error) {
|
|
@@ -169,7 +181,7 @@ var RequestQueue = /*#__PURE__*/function () {
|
|
|
169
181
|
message: error && error.toString && error.toString()
|
|
170
182
|
});
|
|
171
183
|
}
|
|
172
|
-
|
|
184
|
+
|
|
173
185
|
_this2.requestPending = false;
|
|
174
186
|
|
|
175
187
|
_this2.send();
|