@constructor-io/constructorio-client-javascript 2.54.0 → 2.55.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/lib/modules/autocomplete.js +3 -3
- package/lib/modules/browse.js +14 -14
- package/lib/modules/quizzes.js +7 -7
- package/lib/modules/recommendations.js +3 -3
- package/lib/modules/search.js +10 -10
- package/lib/modules/tracker.js +6 -5
- package/lib/utils/botlist.js +1 -1
- package/lib/utils/store.js +24 -11
- package/lib/version.js +1 -1
- package/package.json +9 -7
|
@@ -144,14 +144,14 @@ var Autocomplete = /*#__PURE__*/function () {
|
|
|
144
144
|
* @param {object} [parameters.filters] - Key / value mapping (dictionary) of filters used to refine results
|
|
145
145
|
* @param {object} [parameters.filtersPerSection] - Filters used to refine results per section
|
|
146
146
|
* @param {object} [parameters.resultsPerSection] - Number of results to return (value) per section (key)
|
|
147
|
-
* @param {object} [parameters.preFilterExpression] - Faceting expression to scope autocomplete results. Please refer to https://docs.constructor.
|
|
147
|
+
* @param {object} [parameters.preFilterExpression] - Faceting expression to scope autocomplete results. Please refer to https://docs.constructor.com/reference/configuration-collections for details
|
|
148
148
|
* @param {string[]} [parameters.hiddenFields] - Hidden metadata fields to return
|
|
149
|
-
* @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.
|
|
149
|
+
* @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.com/reference/shared-variations-mapping for details
|
|
150
150
|
* @param {object} [parameters.qsParam] - object of additional query parameters to be appended to requests for results
|
|
151
151
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
152
152
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
153
153
|
* @returns {Promise}
|
|
154
|
-
* @see https://docs.constructor.
|
|
154
|
+
* @see https://docs.constructor.com/reference/autocomplete-autocomplete-results
|
|
155
155
|
* @example
|
|
156
156
|
* constructorio.autocomplete.getAutocompleteResults('t-shirt', {
|
|
157
157
|
* resultsPerSection: {
|
package/lib/modules/browse.js
CHANGED
|
@@ -227,16 +227,16 @@ var Browse = /*#__PURE__*/function () {
|
|
|
227
227
|
* @param {string} [parameters.sortBy='relevance'] - The sort method for results
|
|
228
228
|
* @param {string} [parameters.sortOrder='descending'] - The sort order for results
|
|
229
229
|
* @param {string} [parameters.section='Products'] - The section name for results
|
|
230
|
-
* @param {object} [parameters.fmtOptions] - The format options used to refine result groups. Please refer to https://docs.constructor.
|
|
231
|
-
* @param {object} [parameters.preFilterExpression] - Faceting expression to scope browse results. Please refer to https://docs.constructor.
|
|
230
|
+
* @param {object} [parameters.fmtOptions] - The format options used to refine result groups. Please refer to https://docs.constructor.com/reference/browse-browse-results for details
|
|
231
|
+
* @param {object} [parameters.preFilterExpression] - Faceting expression to scope browse results. Please refer to https://docs.constructor.com/reference/configuration-collections
|
|
232
232
|
* @param {string[]} [parameters.hiddenFields] - Hidden metadata fields to return
|
|
233
233
|
* @param {string[]} [parameters.hiddenFacets] - Hidden facets to return
|
|
234
|
-
* @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.
|
|
235
|
-
* @param {object} [parameters.qsParam] - Parameters listed above can be serialized into a JSON object and parsed through this parameter. Please refer to https://docs.constructor.
|
|
234
|
+
* @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.com/reference/shared-variations-mapping for details
|
|
235
|
+
* @param {object} [parameters.qsParam] - Parameters listed above can be serialized into a JSON object and parsed through this parameter. Please refer to https://docs.constructor.com/reference/browse-browse-results
|
|
236
236
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
237
237
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
238
238
|
* @returns {Promise}
|
|
239
|
-
* @see https://docs.constructor.
|
|
239
|
+
* @see https://docs.constructor.com/reference/shared-results-response-structure
|
|
240
240
|
* @example
|
|
241
241
|
* constructorio.browse.getBrowseResults('group_id', 't-shirts', {
|
|
242
242
|
* resultsPerPage: 40,
|
|
@@ -296,14 +296,14 @@ var Browse = /*#__PURE__*/function () {
|
|
|
296
296
|
* @param {string} [parameters.sortBy='relevance'] - The sort method for results
|
|
297
297
|
* @param {string} [parameters.sortOrder='descending'] - The sort order for results
|
|
298
298
|
* @param {string} [parameters.section='Products'] - The section name for results
|
|
299
|
-
* @param {object} [parameters.fmtOptions] - The format options used to refine result groups. Please refer to https://docs.constructor.
|
|
299
|
+
* @param {object} [parameters.fmtOptions] - The format options used to refine result groups. Please refer to https://docs.constructor.com/reference/browse-browse-results for details
|
|
300
300
|
* @param {string[]} [parameters.hiddenFields] - Hidden metadata fields to return
|
|
301
301
|
* @param {string[]} [parameters.hiddenFacets] - Hidden facets to return
|
|
302
|
-
* @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.
|
|
302
|
+
* @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.com/reference/shared-variations-mapping for details
|
|
303
303
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
304
304
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
305
305
|
* @returns {Promise}
|
|
306
|
-
* @see https://docs.constructor.
|
|
306
|
+
* @see https://docs.constructor.com/reference/v1-browse-get-browse-items-results
|
|
307
307
|
* @example
|
|
308
308
|
* constructorio.browse.getBrowseResultsForItemIds(['shirt-123', 'shirt-456', 'shirt-789'], {
|
|
309
309
|
* filters: {
|
|
@@ -355,11 +355,11 @@ var Browse = /*#__PURE__*/function () {
|
|
|
355
355
|
* @function getBrowseGroups
|
|
356
356
|
* @param {object} [parameters.filters] - Filters used to refine results
|
|
357
357
|
* @param {string} [parameters.section='Products'] - The section name for results
|
|
358
|
-
* @param {object} [parameters.fmtOptions] - The format options used to refine result groups. Please refer to https://docs.constructor.
|
|
358
|
+
* @param {object} [parameters.fmtOptions] - The format options used to refine result groups. Please refer to https://docs.constructor.com/reference/v1-browse-get-browse-groups/ for details
|
|
359
359
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
360
360
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
361
361
|
* @returns {Promise}
|
|
362
|
-
* @see https://docs.constructor.
|
|
362
|
+
* @see https://docs.constructor.com/reference/v1-browse-get-browse-groups
|
|
363
363
|
* @example
|
|
364
364
|
* constructorio.browse.getBrowseGroups({
|
|
365
365
|
* filters: {
|
|
@@ -408,12 +408,12 @@ var Browse = /*#__PURE__*/function () {
|
|
|
408
408
|
* @param {number} [parameters.page] - The page number of the results (Can't be used together with offset)
|
|
409
409
|
* @param {number} [parameters.offset] - The number of results to skip from the beginning (Can't be used together with page)
|
|
410
410
|
* @param {string} [parameters.section='Products'] - The section name for results
|
|
411
|
-
* @param {object} [parameters.fmtOptions] - The format options used to refine result groups. Please refer to https://docs.constructor.
|
|
411
|
+
* @param {object} [parameters.fmtOptions] - The format options used to refine result groups. Please refer to https://docs.constructor.com/reference/browse-browse-facets/ for details
|
|
412
412
|
* @param {number} [parameters.resultsPerPage] - The number of results per page to return
|
|
413
413
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
414
414
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
415
415
|
* @returns {Promise}
|
|
416
|
-
* @see https://docs.constructor.
|
|
416
|
+
* @see https://docs.constructor.com/reference/browse-browse-facets
|
|
417
417
|
* @example
|
|
418
418
|
* constructorio.browse.getBrowseFacets({
|
|
419
419
|
* page: 1,
|
|
@@ -459,10 +459,10 @@ var Browse = /*#__PURE__*/function () {
|
|
|
459
459
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
460
460
|
* @param {object} [parameters] - Additional parameters to refine result set
|
|
461
461
|
* @param {string} [parameters.section='Products'] - The section name for results
|
|
462
|
-
* @param {object} [parameters.fmtOptions] - The format options used to refine result groups. Please refer to https://docs.constructor.
|
|
462
|
+
* @param {object} [parameters.fmtOptions] - The format options used to refine result groups. Please refer to https://docs.constructor.com/reference/v1-browse-get-browse-facet-options for details
|
|
463
463
|
* @param {}
|
|
464
464
|
* @returns {Promise}
|
|
465
|
-
* @see https://docs.constructor.
|
|
465
|
+
* @see https://docs.constructor.com/reference/v1-browse-get-browse-facet-options
|
|
466
466
|
* @example
|
|
467
467
|
* constructorio.browse.getBrowseFacetOptions('price', {
|
|
468
468
|
* });
|
package/lib/modules/quizzes.js
CHANGED
|
@@ -134,12 +134,12 @@ var Quizzes = /*#__PURE__*/function () {
|
|
|
134
134
|
* @param {string} [parameters] - Additional parameters to refine result set
|
|
135
135
|
* @param {string} [parameters.section] - Product catalog section
|
|
136
136
|
* @param {array} [parameters.answers] - An array of answers in the format [[1,2],[1]]
|
|
137
|
-
* @param {string} [parameters.quizVersionId] - Version identifier for the quiz. Version ID will be returned with the first request and it should be passed with subsequent requests. More information can be found: https://docs.constructor.
|
|
138
|
-
* @param {string} [parameters.quizSessionId] - Session identifier for the quiz. Session ID will be returned with the first request and it should be passed with subsequent requests. More information can be found: https://docs.constructor.
|
|
137
|
+
* @param {string} [parameters.quizVersionId] - Version identifier for the quiz. Version ID will be returned with the first request and it should be passed with subsequent requests. More information can be found: https://docs.constructor.com/reference/configuration-quizzes
|
|
138
|
+
* @param {string} [parameters.quizSessionId] - Session identifier for the quiz. Session ID will be returned with the first request and it should be passed with subsequent requests. More information can be found: https://docs.constructor.com/reference/configuration-quizzes
|
|
139
139
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
140
140
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
141
141
|
* @returns {Promise}
|
|
142
|
-
* @see https://docs.constructor.
|
|
142
|
+
* @see https://docs.constructor.com/reference/v1-quizzes-get-quiz-results
|
|
143
143
|
* @example
|
|
144
144
|
* constructorio.quizzes.getQuizNextQuestion('quizId', {
|
|
145
145
|
* answers: [[1,2],[1]],
|
|
@@ -185,8 +185,8 @@ var Quizzes = /*#__PURE__*/function () {
|
|
|
185
185
|
* @param {string} parameters - Additional parameters to refine result set
|
|
186
186
|
* @param {array} parameters.answers - An array of answers in the format [[1,2],[1]]
|
|
187
187
|
* @param {string} [parameters.section] - Product catalog section
|
|
188
|
-
* @param {string} [parameters.quizVersionId] - Version identifier for the quiz. Version ID will be returned with the first request and it should be passed with subsequent requests. More information can be found: https://docs.constructor.
|
|
189
|
-
* @param {string} [parameters.quizSessionId] - Session identifier for the quiz. Session ID will be returned with the first request and it should be passed with subsequent requests. More information can be found: https://docs.constructor.
|
|
188
|
+
* @param {string} [parameters.quizVersionId] - Version identifier for the quiz. Version ID will be returned with the first request and it should be passed with subsequent requests. More information can be found: https://docs.constructor.com/reference/configuration-quizzes
|
|
189
|
+
* @param {string} [parameters.quizSessionId] - Session identifier for the quiz. Session ID will be returned with the first request and it should be passed with subsequent requests. More information can be found: https://docs.constructor.com/reference/configuration-quizzes
|
|
190
190
|
* @param {number} [parameters.page] - The page number of the results
|
|
191
191
|
* @param {number} [parameters.resultsPerPage] - The number of results per page to return
|
|
192
192
|
* @param {object} [parameters.filters] - Key / value mapping (dictionary) of filters used to refine results
|
|
@@ -195,7 +195,7 @@ var Quizzes = /*#__PURE__*/function () {
|
|
|
195
195
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
196
196
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
197
197
|
* @returns {Promise}
|
|
198
|
-
* @see https://docs.constructor.
|
|
198
|
+
* @see https://docs.constructor.com/reference/v1-quizzes-get-quiz-results
|
|
199
199
|
* @example
|
|
200
200
|
* constructorio.quizzes.getQuizResults('quizId', {
|
|
201
201
|
* answers: [[1,2],[1]],
|
|
@@ -240,7 +240,7 @@ var Quizzes = /*#__PURE__*/function () {
|
|
|
240
240
|
* @param {string} quizId - The identifier of the quiz
|
|
241
241
|
* @param {string} parameters - Additional parameters
|
|
242
242
|
* @param {string} [parameters.section] - Product catalog section
|
|
243
|
-
* @param {string} [parameters.quizVersionId] - Version identifier for the quiz. Version ID will be returned with the first request and it should be passed with subsequent requests. More information can be found: https://docs.constructor.
|
|
243
|
+
* @param {string} [parameters.quizVersionId] - Version identifier for the quiz. Version ID will be returned with the first request and it should be passed with subsequent requests. More information can be found: https://docs.constructor.com/reference/configuration-quizzes
|
|
244
244
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
245
245
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
246
246
|
* @returns {Promise}
|
|
@@ -124,13 +124,13 @@ var Recommendations = /*#__PURE__*/function () {
|
|
|
124
124
|
* @param {string} [parameters.section] - The section to return results from
|
|
125
125
|
* @param {string} [parameters.term] - The term to use to refine results (strategy specific)
|
|
126
126
|
* @param {object} [parameters.filters] - Key / value mapping of filters used to refine results
|
|
127
|
-
* @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.
|
|
128
|
-
* @param {object} [parameters.preFilterExpression] - Faceting expression to scope search results. Please refer to https://docs.constructor.
|
|
127
|
+
* @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.com/reference/shared-variations-mapping for details
|
|
128
|
+
* @param {object} [parameters.preFilterExpression] - Faceting expression to scope search results. Please refer to https://docs.constructor.com/reference/configuration-collections
|
|
129
129
|
* @param {string[]} [parameters.hiddenFields] - Hidden metadata fields to return
|
|
130
130
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
131
131
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
132
132
|
* @returns {Promise}
|
|
133
|
-
* @see https://docs.constructor.
|
|
133
|
+
* @see https://docs.constructor.com/reference/recommendations-recommendation-results
|
|
134
134
|
* @example
|
|
135
135
|
* constructorio.recommendations.getRecommendations('t-shirt-best-sellers', {
|
|
136
136
|
* numResults: 5,
|
package/lib/modules/search.js
CHANGED
|
@@ -175,16 +175,16 @@ var Search = /*#__PURE__*/function () {
|
|
|
175
175
|
* @param {string} [parameters.sortBy='relevance'] - The sort method for results
|
|
176
176
|
* @param {string} [parameters.sortOrder='descending'] - The sort order for results
|
|
177
177
|
* @param {string} [parameters.section='Products'] - The section name for results
|
|
178
|
-
* @param {object} [parameters.fmtOptions] - The format options used to refine result groups. Please refer to https://docs.constructor.
|
|
179
|
-
* @param {object} [parameters.preFilterExpression] - Faceting expression to scope search results. Please refer to https://docs.constructor.
|
|
178
|
+
* @param {object} [parameters.fmtOptions] - The format options used to refine result groups. Please refer to https://docs.constructor.com/reference/search-search-resultsqueries for details
|
|
179
|
+
* @param {object} [parameters.preFilterExpression] - Faceting expression to scope search results. Please refer to https://docs.constructor.com/reference/configuration-collections
|
|
180
180
|
* @param {string[]} [parameters.hiddenFields] - Hidden metadata fields to return
|
|
181
181
|
* @param {string[]} [parameters.hiddenFacets] - Hidden facets to return
|
|
182
|
-
* @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.
|
|
183
|
-
* @param {object} [parameters.qsParam] - Parameters listed above can be serialized into a JSON object and parsed through this parameter. Please refer to https://docs.constructor.
|
|
182
|
+
* @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.com/reference/shared-variations-mapping for details
|
|
183
|
+
* @param {object} [parameters.qsParam] - Parameters listed above can be serialized into a JSON object and parsed through this parameter. Please refer to https://docs.constructor.com/reference/v1-search-get-search-results
|
|
184
184
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
185
185
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
186
186
|
* @returns {Promise}
|
|
187
|
-
* @see https://docs.constructor.
|
|
187
|
+
* @see https://docs.constructor.com/reference/search-search-results
|
|
188
188
|
* @example
|
|
189
189
|
* constructorio.search.getSearchResults('t-shirt', {
|
|
190
190
|
* resultsPerPage: 40,
|
|
@@ -249,16 +249,16 @@ var Search = /*#__PURE__*/function () {
|
|
|
249
249
|
* @param {number} [parameters.offset] - The number of results to skip from the beginning (Can't be used together with page)
|
|
250
250
|
* @param {number} [parameters.resultsPerPage] - The number of results per page to return
|
|
251
251
|
* @param {string} [parameters.section='Products'] - The section name for results
|
|
252
|
-
* @param {object} [parameters.fmtOptions] - The format options used to refine result groups. Please refer to https://docs.constructor.
|
|
253
|
-
* @param {object} [parameters.preFilterExpression] - Faceting expression to scope search results. Please refer to https://docs.constructor.
|
|
254
|
-
* @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.
|
|
252
|
+
* @param {object} [parameters.fmtOptions] - The format options used to refine result groups. Please refer to https://docs.constructor.com/reference/search-search-resultsqueries for details
|
|
253
|
+
* @param {object} [parameters.preFilterExpression] - Faceting expression to scope search results. Please refer to https://docs.constructor.com/reference/configuration-collections
|
|
254
|
+
* @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.com/reference/shared-variations-mapping for details
|
|
255
255
|
* @param {string[]} [parameters.hiddenFields] - Hidden metadata fields to return
|
|
256
256
|
* @param {string[]} [parameters.hiddenFacets] - Hidden facets to return
|
|
257
|
-
* @param {object} [parameters.qsParam] - Parameters listed above can be serialized into a JSON object and parsed through this parameter. Please refer to https://docs.constructor.
|
|
257
|
+
* @param {object} [parameters.qsParam] - Parameters listed above can be serialized into a JSON object and parsed through this parameter. Please refer to https://docs.constructor.com/reference/v1-search-get-search-results
|
|
258
258
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
259
259
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
260
260
|
* @returns {Promise}
|
|
261
|
-
* @see https://docs.constructor.
|
|
261
|
+
* @see https://docs.constructor.com/docs/products-search-learn-about-search
|
|
262
262
|
* @example
|
|
263
263
|
* constructorio.search.getVoiceSearchResults('show me lipstick');
|
|
264
264
|
*/
|
package/lib/modules/tracker.js
CHANGED
|
@@ -7,6 +7,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
|
|
|
7
7
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
8
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
9
9
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
10
|
+
/* eslint-disable max-len */
|
|
10
11
|
/* eslint-disable object-curly-newline, no-underscore-dangle, camelcase, no-unneeded-ternary */
|
|
11
12
|
var EventEmitter = require('../utils/events');
|
|
12
13
|
var helpers = require('../utils/helpers');
|
|
@@ -277,7 +278,7 @@ var Tracker = /*#__PURE__*/function () {
|
|
|
277
278
|
* @param {string} [parameters.tr] - Trigger used to select the item (click, etc.)
|
|
278
279
|
* @param {string} [parameters.itemId] - Item id of the selected item
|
|
279
280
|
* @param {string} [parameters.variationId] - Variation id of the selected item
|
|
280
|
-
* @param {string} [parameters.groupId] - Group identifier of
|
|
281
|
+
* @param {string} [parameters.groupId] - Group identifier of the group to search within. Only required if searching within a group, i.e. "Pumpkin in Canned Goods"
|
|
281
282
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
282
283
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
283
284
|
* @returns {(true|Error)}
|
|
@@ -361,7 +362,7 @@ var Tracker = /*#__PURE__*/function () {
|
|
|
361
362
|
* @param {string} parameters.originalQuery - The current autocomplete search query
|
|
362
363
|
* @param {string} parameters.section - Section the selected item resides within
|
|
363
364
|
* @param {string} [parameters.tr] - Trigger used to select the item (click, etc.)
|
|
364
|
-
* @param {string} [parameters.groupId] - Group identifier of
|
|
365
|
+
* @param {string} [parameters.groupId] - Group identifier of the group to search within. Only required if searching within a group, i.e. "Pumpkin in Canned Goods"
|
|
365
366
|
* @param {string} [parameters.displayName] - Display name of group of selected item
|
|
366
367
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
367
368
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
@@ -436,7 +437,7 @@ var Tracker = /*#__PURE__*/function () {
|
|
|
436
437
|
* @param {string} searchTerm - Term of submitted autocomplete event
|
|
437
438
|
* @param {object} parameters - Additional parameters to be sent with request
|
|
438
439
|
* @param {string} parameters.userInput - The current autocomplete search query
|
|
439
|
-
* @param {string} [parameters.groupId] - Group identifier of
|
|
440
|
+
* @param {string} [parameters.groupId] - Group identifier of the group to search within. Only required if searching within a group, i.e. "Pumpkin in Canned Goods"
|
|
440
441
|
* @param {string} [parameters.section] - The section name for the item Ex. "Products"
|
|
441
442
|
* @param {object} [parameters.analyticsTags] - Pass additional analytics data
|
|
442
443
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
@@ -513,7 +514,7 @@ var Tracker = /*#__PURE__*/function () {
|
|
|
513
514
|
* @param {string} term - Term of submitted autocomplete event
|
|
514
515
|
* @param {object} parameters - Additional parameters to be sent with request
|
|
515
516
|
* @param {string} parameters.originalQuery - The current autocomplete search query
|
|
516
|
-
* @param {string} [parameters.groupId] - Group identifier of
|
|
517
|
+
* @param {string} [parameters.groupId] - Group identifier of the group to search within. Only required if searching within a group, i.e. "Pumpkin in Canned Goods"
|
|
517
518
|
* @param {string} [parameters.displayName] - Display name of group of selected item
|
|
518
519
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
519
520
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
@@ -961,7 +962,7 @@ var Tracker = /*#__PURE__*/function () {
|
|
|
961
962
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
962
963
|
* @returns {(true|Error)}
|
|
963
964
|
* @description User performed an action indicating interest in an item (add to cart, add to wishlist, etc.)
|
|
964
|
-
* @see https://docs.constructor.
|
|
965
|
+
* @see https://docs.constructor.com/docs/integrating-with-constructor-behavioral-tracking-data-driven-event-tracking
|
|
965
966
|
* @example
|
|
966
967
|
* constructorio.tracker.trackConversion(
|
|
967
968
|
* 'T-Shirt',
|
package/lib/utils/botlist.js
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
/* eslint-disable no-useless-escape */
|
|
4
4
|
/* cspell:disable */
|
|
5
5
|
|
|
6
|
-
module.exports = ['Googlebot\/', 'Googlebot-Mobile', 'Googlebot-Image', 'Googlebot-News', 'Googlebot-Video', 'AdsBot-Google([^-]|$)', 'AdsBot-Google-Mobile', 'Feedfetcher-Google', 'Mediapartners-Google', 'Mediapartners \\(Googlebot\\)', 'APIs-Google', 'bingbot', 'Slurp', '[wW]get', 'curl', 'LinkedInBot', 'Python-urllib', 'python-requests', 'libwww', 'httpunit', 'nutch', 'Go-http-client', 'phpcrawl', 'msnbot', 'jyxobot', 'FAST-WebCrawler', 'FAST Enterprise Crawler', 'BIGLOTRON', 'Teoma', 'convera', 'seekbot', 'Gigabot', 'Gigablast', 'exabot', 'ia_archiver', 'GingerCrawler', 'webmon ', 'HTTrack', 'grub\\.org', 'UsineNouvelleCrawler', 'antibot', 'netresearchserver', 'speedy', 'fluffy', 'bibnum\\.bnf', 'findlink', 'msrbot', 'panscient', 'yacybot', 'AISearchBot', 'ips-agent', 'tagoobot', 'MJ12bot', 'woriobot', 'yanga', 'buzzbot', 'mlbot', 'YandexBot', 'yandex\\.com\/bots', 'purebot', 'Linguee Bot', 'CyberPatrol', 'voilabot', 'Baiduspider', 'citeseerxbot', 'spbot', 'twengabot', 'postrank', 'turnitinbot', 'scribdbot', 'page2rss', 'sitebot', 'linkdex', 'Adidxbot', 'blekkobot', 'ezooms', 'dotbot', 'Mail\\.RU_Bot', 'discobot', 'heritrix', 'findthatfile', 'europarchive\\.org', 'NerdByNature\\.Bot', 'sistrix crawler', 'Ahrefs(Bot|SiteAudit)', 'fuelbot', 'CrunchBot', 'centurybot9', 'IndeedBot', 'mappydata', 'woobot', 'ZoominfoBot', 'PrivacyAwareBot', 'Multiviewbot', 'SWIMGBot', 'Grobbot', 'eright', 'Apercite', 'semanticbot', 'Aboundex', 'domaincrawler', 'wbsearchbot', 'summify', 'CCBot', 'edisterbot', 'seznambot', 'ec2linkfinder', 'gslfbot', 'aiHitBot', 'intelium_bot', 'facebookexternalhit', 'Yeti', 'RetrevoPageAnalyzer', 'lb-spider', 'Sogou', 'lssbot', 'careerbot', 'wotbox', 'wocbot', 'ichiro', 'DuckDuckBot', 'lssrocketcrawler', 'drupact', 'webcompanycrawler', 'acoonbot', 'openindexspider', 'gnam gnam spider', 'web-archive-net\\.com\\.bot', 'backlinkcrawler', 'coccoc', 'integromedb', 'content crawler spider', 'toplistbot', 'it2media-domain-crawler', 'ip-web-crawler\\.com', 'siteexplorer\\.info', 'elisabot', 'proximic', 'changedetection', 'arabot', 'WeSEE:Search', 'niki-bot', 'CrystalSemanticsBot', 'rogerbot', '360Spider', 'psbot', 'InterfaxScanBot', 'CC Metadata Scaper', 'g00g1e\\.net', 'GrapeshotCrawler', 'urlappendbot', 'brainobot', 'fr-crawler', 'binlar', 'SimpleCrawler', 'Twitterbot', 'cXensebot', 'smtbot', 'bnf\\.fr_bot', 'A6-Indexer', 'ADmantX', 'Facebot', 'OrangeBot\/', 'memorybot', 'AdvBot', 'MegaIndex', 'SemanticScholarBot', 'ltx71', 'nerdybot', 'xovibot', 'BUbiNG', 'Qwantify', 'archive\\.org_bot', 'Applebot', 'TweetmemeBot', 'crawler4j', 'findxbot', 'S[eE][mM]rushBot', 'yoozBot', 'lipperhey', 'Y!J', 'Domain Re-Animator Bot', 'AddThis', 'Screaming Frog SEO Spider', 'MetaURI', 'Scrapy', 'Livelap[bB]ot', 'OpenHoseBot', 'CapsuleChecker', 'collection@infegy\\.com', 'IstellaBot', 'DeuSu\/', 'betaBot', 'Cliqzbot\/', 'MojeekBot\/', 'netEstate NE Crawler', 'SafeSearch microdata crawler', 'Gluten Free Crawler\/', 'Sonic', 'Sysomos', 'Trove', 'deadlinkchecker', 'Slack-ImgProxy', 'Embedly', 'RankActiveLinkBot', 'iskanie', 'SafeDNSBot', 'SkypeUriPreview', 'Veoozbot', 'Slackbot', 'redditbot', 'datagnionbot', 'Google-Adwords-Instant', 'adbeat_bot', 'WhatsApp', 'contxbot', 'pinterest', 'electricmonk', 'GarlikCrawler', 'BingPreview\/', 'vebidoobot', 'FemtosearchBot', 'Yahoo Link Preview', 'MetaJobBot', 'DomainStatsBot', 'mindUpBot', 'Daum\/', 'Jugendschutzprogramm-Crawler', 'Xenu Link Sleuth', 'Pcore-HTTP', 'moatbot', 'KosmioBot', 'pingdom', 'PhantomJS', 'Gowikibot', 'PiplBot', 'Discordbot', 'TelegramBot', 'Jetslide', 'newsharecounts', 'James BOT', 'Barkrowler', 'TinEye', 'SocialRankIOBot', 'trendictionbot', 'Ocarinabot', 'epicbot', 'Primalbot', 'DuckDuckGo-Favicons-Bot', 'GnowitNewsbot', 'Leikibot', 'LinkArchiver', 'YaK\/', 'PaperLiBot', 'Digg Deeper', 'dcrawl', 'Snacktory', 'AndersPinkBot', 'Fyrebot', 'EveryoneSocialBot', 'Mediatoolkitbot', 'Luminator-robots', 'ExtLinksBot', 'SurveyBot', 'NING\/', 'okhttp', 'Nuzzel', 'omgili', 'PocketParser', 'YisouSpider', 'um-LN', 'ToutiaoSpider', 'MuckRack', "Jamie's Spider", 'AHC\/', 'NetcraftSurveyAgent', 'Laserlikebot', 'Apache-HttpClient', 'AppEngine-Google', 'Jetty', 'Upflow', 'Thinklab', 'Traackr\\.com', 'Twurly', 'Mastodon', 'http_get', 'DnyzBot', 'botify', '007ac9 Crawler', 'BehloolBot', 'BrandVerity', 'check_http', 'BDCbot', 'ZumBot', 'EZID', 'ICC-Crawler', 'ArchiveBot', '^LCC ', 'filterdb\\.iss\\.net\/crawler', 'BLP_bbot', 'BomboraBot', 'Buck\/', 'Companybook-Crawler', 'Genieo', 'magpie-crawler', 'MeltwaterNews', 'Moreover', 'newspaper\/', 'ScoutJet', '(^| )sentry\/', 'StorygizeBot', 'UptimeRobot', 'OutclicksBot', 'seoscanners', 'Hatena', 'Google Web Preview', 'MauiBot', 'AlphaBot', 'SBL-BOT', 'IAS crawler', 'adscanner', 'Netvibes', 'acapbot', 'Baidu-YunGuanCe', 'bitlybot', 'blogmuraBot', 'Bot\\.AraTurka\\.com', 'bot-pge\\.chlooe\\.com', 'BoxcarBot', 'BTWebClient', 'ContextAd Bot', 'Digincore bot', 'Disqus', 'Feedly', 'Fetch\/', 'Fever', 'Flamingo_SearchEngine', 'FlipboardProxy', 'g2reader-bot', 'imrbot', 'K7MLWCBot', 'Kemvibot', 'Landau-Media-Spider', 'linkapediabot', 'vkShare', 'Siteimprove\\.com', 'BLEXBot\/', 'DareBoost', 'ZuperlistBot\/', 'Miniflux\/', 'Feedspotbot\/', 'Diffbot\/', 'SEOkicks', 'tracemyfile', 'Nimbostratus-Bot', 'Bytespider'];
|
|
6
|
+
module.exports = ['Googlebot\/', 'Googlebot-Mobile', 'Googlebot-Image', 'Googlebot-News', 'Googlebot-Video', 'AdsBot-Google([^-]|$)', 'AdsBot-Google-Mobile', 'Feedfetcher-Google', 'Mediapartners-Google', 'Mediapartners \\(Googlebot\\)', 'APIs-Google', 'bingbot', 'Slurp', '[wW]get', 'curl', 'LinkedInBot', 'Python-urllib', 'python-requests', 'libwww', 'httpunit', 'nutch', 'Go-http-client', 'phpcrawl', 'msnbot', 'jyxobot', 'FAST-WebCrawler', 'FAST Enterprise Crawler', 'BIGLOTRON', 'Teoma', 'convera', 'seekbot', 'Gigabot', 'Gigablast', 'exabot', 'ia_archiver', 'GingerCrawler', 'webmon ', 'HTTrack', 'grub\\.org', 'UsineNouvelleCrawler', 'antibot', 'netresearchserver', 'speedy', 'fluffy', 'bibnum\\.bnf', 'findlink', 'msrbot', 'panscient', 'yacybot', 'AISearchBot', 'ips-agent', 'tagoobot', 'MJ12bot', 'woriobot', 'yanga', 'buzzbot', 'mlbot', 'YandexBot', 'yandex\\.com\/bots', 'purebot', 'Linguee Bot', 'CyberPatrol', 'voilabot', 'Baiduspider', 'citeseerxbot', 'spbot', 'twengabot', 'postrank', 'turnitinbot', 'scribdbot', 'page2rss', 'sitebot', 'linkdex', 'Adidxbot', 'blekkobot', 'ezooms', 'dotbot', 'Mail\\.RU_Bot', 'discobot', 'heritrix', 'findthatfile', 'europarchive\\.org', 'NerdByNature\\.Bot', 'sistrix crawler', 'Ahrefs(Bot|SiteAudit)', 'fuelbot', 'CrunchBot', 'centurybot9', 'IndeedBot', 'mappydata', 'woobot', 'ZoominfoBot', 'PrivacyAwareBot', 'Multiviewbot', 'SWIMGBot', 'Grobbot', 'eright', 'Apercite', 'semanticbot', 'Aboundex', 'domaincrawler', 'wbsearchbot', 'summify', 'CCBot', 'edisterbot', 'seznambot', 'ec2linkfinder', 'gslfbot', 'aiHitBot', 'intelium_bot', 'facebookexternalhit', 'Yeti', 'RetrevoPageAnalyzer', 'lb-spider', 'Sogou', 'lssbot', 'careerbot', 'wotbox', 'wocbot', 'ichiro', 'DuckDuckBot', 'lssrocketcrawler', 'drupact', 'webcompanycrawler', 'acoonbot', 'openindexspider', 'gnam gnam spider', 'web-archive-net\\.com\\.bot', 'backlinkcrawler', 'coccoc', 'integromedb', 'content crawler spider', 'toplistbot', 'it2media-domain-crawler', 'ip-web-crawler\\.com', 'siteexplorer\\.info', 'elisabot', 'proximic', 'changedetection', 'arabot', 'WeSEE:Search', 'niki-bot', 'CrystalSemanticsBot', 'rogerbot', '360Spider', 'psbot', 'InterfaxScanBot', 'CC Metadata Scaper', 'g00g1e\\.net', 'GrapeshotCrawler', 'urlappendbot', 'brainobot', 'fr-crawler', 'binlar', 'SimpleCrawler', 'Twitterbot', 'cXensebot', 'smtbot', 'bnf\\.fr_bot', 'A6-Indexer', 'ADmantX', 'Facebot', 'OrangeBot\/', 'memorybot', 'AdvBot', 'MegaIndex', 'SemanticScholarBot', 'ltx71', 'nerdybot', 'xovibot', 'BUbiNG', 'Qwantify', 'archive\\.org_bot', 'Applebot', 'TweetmemeBot', 'crawler4j', 'findxbot', 'S[eE][mM]rushBot', 'yoozBot', 'lipperhey', 'Y!J', 'Domain Re-Animator Bot', 'AddThis', 'Screaming Frog SEO Spider', 'MetaURI', 'Scrapy', 'Livelap[bB]ot', 'OpenHoseBot', 'CapsuleChecker', 'collection@infegy\\.com', 'IstellaBot', 'DeuSu\/', 'betaBot', 'Cliqzbot\/', 'MojeekBot\/', 'netEstate NE Crawler', 'SafeSearch microdata crawler', 'Gluten Free Crawler\/', 'Sonic', 'Sysomos', 'Trove', 'deadlinkchecker', 'Slack-ImgProxy', 'Embedly', 'RankActiveLinkBot', 'iskanie', 'SafeDNSBot', 'SkypeUriPreview', 'Veoozbot', 'Slackbot', 'redditbot', 'datagnionbot', 'Google-Adwords-Instant', 'adbeat_bot', 'WhatsApp', 'contxbot', 'pinterest', 'electricmonk', 'GarlikCrawler', 'BingPreview\/', 'vebidoobot', 'FemtosearchBot', 'Yahoo Link Preview', 'MetaJobBot', 'DomainStatsBot', 'mindUpBot', 'Daum\/', 'Jugendschutzprogramm-Crawler', 'Xenu Link Sleuth', 'Pcore-HTTP', 'moatbot', 'KosmioBot', 'pingdom', 'PhantomJS', 'Gowikibot', 'PiplBot', 'Discordbot', 'TelegramBot', 'Jetslide', 'newsharecounts', 'James BOT', 'Barkrowler', 'TinEye', 'SocialRankIOBot', 'trendictionbot', 'Ocarinabot', 'epicbot', 'Primalbot', 'DuckDuckGo-Favicons-Bot', 'GnowitNewsbot', 'Leikibot', 'LinkArchiver', 'YaK\/', 'PaperLiBot', 'Digg Deeper', 'dcrawl', 'Snacktory', 'AndersPinkBot', 'Fyrebot', 'EveryoneSocialBot', 'Mediatoolkitbot', 'Luminator-robots', 'ExtLinksBot', 'SurveyBot', 'NING\/', 'okhttp', 'Nuzzel', 'omgili', 'PocketParser', 'YisouSpider', 'um-LN', 'ToutiaoSpider', 'MuckRack', "Jamie's Spider", 'AHC\/', 'NetcraftSurveyAgent', 'Laserlikebot', 'Apache-HttpClient', 'AppEngine-Google', 'Jetty', 'Upflow', 'Thinklab', 'Traackr\\.com', 'Twurly', 'Mastodon', 'http_get', 'DnyzBot', 'botify', '007ac9 Crawler', 'BehloolBot', 'BrandVerity', 'check_http', 'BDCbot', 'ZumBot', 'EZID', 'ICC-Crawler', 'ArchiveBot', '^LCC ', 'filterdb\\.iss\\.net\/crawler', 'BLP_bbot', 'BomboraBot', 'Buck\/', 'Companybook-Crawler', 'Genieo', 'magpie-crawler', 'MeltwaterNews', 'Moreover', 'newspaper\/', 'ScoutJet', '(^| )sentry\/', 'StorygizeBot', 'UptimeRobot', 'OutclicksBot', 'seoscanners', 'Hatena', 'Google Web Preview', 'MauiBot', 'AlphaBot', 'SBL-BOT', 'IAS crawler', 'adscanner', 'Netvibes', 'acapbot', 'Baidu-YunGuanCe', 'bitlybot', 'blogmuraBot', 'Bot\\.AraTurka\\.com', 'bot-pge\\.chlooe\\.com', 'BoxcarBot', 'BTWebClient', 'ContextAd Bot', 'Digincore bot', 'Disqus', 'Feedly', 'Fetch\/', 'Fever', 'Flamingo_SearchEngine', 'FlipboardProxy', 'g2reader-bot', 'imrbot', 'K7MLWCBot', 'Kemvibot', 'Landau-Media-Spider', 'linkapediabot', 'vkShare', 'Siteimprove\\.com', 'BLEXBot\/', 'DareBoost', 'ZuperlistBot\/', 'Miniflux\/', 'Feedspotbot\/', 'Diffbot\/', 'SEOkicks', 'tracemyfile', 'Nimbostratus-Bot', 'Bytespider', 'BTTAgent'];
|
package/lib/utils/store.js
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function canUseStorage(type) {
|
|
4
|
+
var storage;
|
|
5
|
+
try {
|
|
6
|
+
storage = window[type];
|
|
7
|
+
var x = '__storage_test__';
|
|
8
|
+
storage.setItem(x, x);
|
|
9
|
+
storage.removeItem(x);
|
|
10
|
+
return true;
|
|
11
|
+
} catch (e) {
|
|
12
|
+
return e instanceof DOMException && (e.name === 'QuotaExceededError' || e.name === 'QUOTA_EXCEEDED_ERR' || e.name === 'NS_ERROR_DOM_QUOTA_REACHED' || e.toString().indexOf('QUOTA_EXCEEDED_ERR') !== -1 || e.toString().indexOf('QuotaExceededError') !== -1) && storage && storage.length !== 0;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
3
15
|
var session = {
|
|
4
16
|
overflow: {},
|
|
5
17
|
get: function get(key) {
|
|
@@ -8,7 +20,7 @@ var session = {
|
|
|
8
20
|
if (valueFromOverflow) {
|
|
9
21
|
return valueFromOverflow;
|
|
10
22
|
}
|
|
11
|
-
if (
|
|
23
|
+
if (!canUseStorage('sessionStorage')) {
|
|
12
24
|
return null;
|
|
13
25
|
}
|
|
14
26
|
var valueFromSession = sessionStorage.getItem(key);
|
|
@@ -35,13 +47,13 @@ var session = {
|
|
|
35
47
|
if ((_this$overflow = this.overflow) !== null && _this$overflow !== void 0 && _this$overflow[key]) {
|
|
36
48
|
delete this.overflow[key];
|
|
37
49
|
}
|
|
38
|
-
if (
|
|
50
|
+
if (canUseStorage('sessionStorage')) {
|
|
39
51
|
sessionStorage.removeItem(key);
|
|
40
52
|
}
|
|
41
53
|
},
|
|
42
54
|
key: function key(i) {
|
|
43
55
|
var _sessionStorage, _sessionStorage2;
|
|
44
|
-
if (
|
|
56
|
+
if (!canUseStorage('sessionStorage')) {
|
|
45
57
|
var _Object$keys;
|
|
46
58
|
return (_Object$keys = Object.keys(this.overflow)) === null || _Object$keys === void 0 ? void 0 : _Object$keys[i];
|
|
47
59
|
}
|
|
@@ -56,14 +68,14 @@ var session = {
|
|
|
56
68
|
},
|
|
57
69
|
length: function length() {
|
|
58
70
|
var overflowLength = Object.keys(this.overflow).length;
|
|
59
|
-
if (
|
|
71
|
+
if (!canUseStorage('sessionStorage')) {
|
|
60
72
|
return overflowLength;
|
|
61
73
|
}
|
|
62
74
|
return sessionStorage.length + overflowLength;
|
|
63
75
|
},
|
|
64
76
|
clear: function clear() {
|
|
65
77
|
this.overflow = {};
|
|
66
|
-
if (
|
|
78
|
+
if (canUseStorage('sessionStorage')) {
|
|
67
79
|
sessionStorage.clear();
|
|
68
80
|
}
|
|
69
81
|
}
|
|
@@ -76,7 +88,7 @@ var local = {
|
|
|
76
88
|
if (valueFromOverflow) {
|
|
77
89
|
return valueFromOverflow;
|
|
78
90
|
}
|
|
79
|
-
if (
|
|
91
|
+
if (!canUseStorage('localStorage')) {
|
|
80
92
|
return null;
|
|
81
93
|
}
|
|
82
94
|
var valueFromLocal = localStorage.getItem(key);
|
|
@@ -103,13 +115,13 @@ var local = {
|
|
|
103
115
|
if ((_this$overflow2 = this.overflow) !== null && _this$overflow2 !== void 0 && _this$overflow2[key]) {
|
|
104
116
|
delete this.overflow[key];
|
|
105
117
|
}
|
|
106
|
-
if (
|
|
118
|
+
if (canUseStorage('localStorage')) {
|
|
107
119
|
localStorage.removeItem(key);
|
|
108
120
|
}
|
|
109
121
|
},
|
|
110
122
|
key: function key(i) {
|
|
111
123
|
var _localStorage, _localStorage2;
|
|
112
|
-
if (
|
|
124
|
+
if (!canUseStorage('localStorage')) {
|
|
113
125
|
var _Object$keys3;
|
|
114
126
|
return (_Object$keys3 = Object.keys(this.overflow)) === null || _Object$keys3 === void 0 ? void 0 : _Object$keys3[i];
|
|
115
127
|
}
|
|
@@ -124,20 +136,21 @@ var local = {
|
|
|
124
136
|
},
|
|
125
137
|
length: function length() {
|
|
126
138
|
var overflowLength = Object.keys(this.overflow).length;
|
|
127
|
-
if (
|
|
139
|
+
if (!canUseStorage('localStorage')) {
|
|
128
140
|
return overflowLength;
|
|
129
141
|
}
|
|
130
142
|
return localStorage.length + overflowLength;
|
|
131
143
|
},
|
|
132
144
|
clear: function clear() {
|
|
133
145
|
this.overflow = {};
|
|
134
|
-
if (
|
|
146
|
+
if (canUseStorage('localStorage')) {
|
|
135
147
|
localStorage.clear();
|
|
136
148
|
}
|
|
137
149
|
}
|
|
138
150
|
};
|
|
139
151
|
var store = {
|
|
140
152
|
local: local,
|
|
141
|
-
session: session
|
|
153
|
+
session: session,
|
|
154
|
+
canUseStorage: canUseStorage
|
|
142
155
|
};
|
|
143
156
|
module.exports = store;
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructor-io/constructorio-client-javascript",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.55.1",
|
|
4
4
|
"description": "Constructor.io JavaScript client",
|
|
5
5
|
"main": "lib/constructorio.js",
|
|
6
6
|
"types": "lib/types/index.d.ts",
|
|
@@ -10,13 +10,14 @@
|
|
|
10
10
|
"check-license": "license-checker --production --onlyAllow 'Apache-2.0;BSD-3-Clause;MIT;0BSD;BSD-2-Clause'",
|
|
11
11
|
"verify-node-version": "chmod +x ./scripts/verify-node-version.sh && ./scripts/verify-node-version.sh",
|
|
12
12
|
"lint": "eslint 'src/**/*.js' 'spec/**/*.js' 'src/**/*.d.ts'",
|
|
13
|
-
"
|
|
13
|
+
"pretest": "npm run compile && npm run generate-test-folder",
|
|
14
|
+
"test": "mocha --retries 3 ./spec/*",
|
|
14
15
|
"test:types": "tsd .",
|
|
15
|
-
"test:parallel": "npm run
|
|
16
|
+
"test:parallel": "npm run pretest && mocha --parallel --retries 3 ./spec/*",
|
|
16
17
|
"test:src": "mkdir -p test && cp -rf src/* test && mocha --retries 3 ./spec/*",
|
|
17
18
|
"test:src:parallel": "mkdir -p test && cp -rf src/* test && mocha --parallel --retries 3 ./spec/*",
|
|
18
|
-
"test:bundled": "npm run bundle && BUNDLED=true PACKAGE_VERSION=$(echo $npm_package_version) mocha --retries 3 ./spec/*",
|
|
19
|
-
"test:bundled:parallel": "npm run bundle && BUNDLED=true PACKAGE_VERSION=$(echo $npm_package_version) mocha --parallel --retries 3 ./spec/*",
|
|
19
|
+
"test:bundled": "npm run bundle && npm run generate-test-folder && BUNDLED=true PACKAGE_VERSION=$(echo $npm_package_version) mocha --retries 3 ./spec/*",
|
|
20
|
+
"test:bundled:parallel": "npm run bundle && npm run generate-test-folder && BUNDLED=true PACKAGE_VERSION=$(echo $npm_package_version) mocha --parallel --retries 3 ./spec/*",
|
|
20
21
|
"test:all": "npm run test && npm run test:bundled",
|
|
21
22
|
"test:all:parallel": "npm run test:parallel && npm run test:bundled:parallel",
|
|
22
23
|
"precoverage": "rm -rf ./coverage && rm -rf ./.nyc_output",
|
|
@@ -26,7 +27,8 @@
|
|
|
26
27
|
"compile": "rm -rf ./lib/* && babel src/ -d lib/ --copy-files && rm -rf ./lib/types/tests",
|
|
27
28
|
"prepublish": "npm run compile",
|
|
28
29
|
"bundle": "rm -rf ./dist/* && npm run compile && node bundle.js",
|
|
29
|
-
"prepare": "husky install"
|
|
30
|
+
"prepare": "husky install",
|
|
31
|
+
"generate-test-folder": "mkdir -p test && cp -rf lib/* test"
|
|
30
32
|
},
|
|
31
33
|
"repository": {
|
|
32
34
|
"type": "git",
|
|
@@ -73,7 +75,7 @@
|
|
|
73
75
|
"web-streams-polyfill": "^4.0.0"
|
|
74
76
|
},
|
|
75
77
|
"dependencies": {
|
|
76
|
-
"@constructor-io/constructorio-id": "^2.
|
|
78
|
+
"@constructor-io/constructorio-id": "^2.6.0",
|
|
77
79
|
"crc-32": "^1.2.2"
|
|
78
80
|
},
|
|
79
81
|
"peerDependencies": {
|