coveo.analytics 2.23.10 → 2.25.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/dist/coveoua.browser.js +1 -1
- package/dist/coveoua.browser.js.map +1 -1
- package/dist/coveoua.debug.js +330 -56
- package/dist/coveoua.debug.js.map +1 -1
- package/dist/coveoua.js +1 -1
- package/dist/coveoua.js.map +1 -1
- package/dist/definitions/client/analytics.d.ts +3 -0
- package/dist/definitions/client/noopAnalytics.d.ts +1 -0
- package/dist/definitions/cookieutils.d.ts +1 -1
- package/dist/definitions/coveoua/simpleanalytics.d.ts +1 -0
- package/dist/definitions/plugins/BasePlugin.d.ts +1 -1
- package/dist/definitions/src/coveoua/simpleanalytics.d.ts +1 -0
- package/dist/definitions/storage.d.ts +1 -1
- package/dist/definitions/version.d.ts +1 -0
- package/dist/library.es.js +309 -53
- package/dist/library.js +324 -53
- package/dist/react-native.es.js +81819 -59
- package/package.json +5 -2
- package/src/client/analytics.spec.ts +42 -12
- package/src/client/analytics.ts +22 -1
- package/src/client/analyticsBeaconClient.spec.ts +1 -1
- package/src/client/noopAnalytics.ts +4 -0
- package/src/cookieutils.ts +21 -42
- package/src/coveoua/browser.ts +2 -2
- package/src/coveoua/plugins.ts +1 -1
- package/src/coveoua/simpleanalytics.spec.ts +11 -5
- package/src/coveoua/simpleanalytics.ts +6 -0
- package/src/plugins/BasePlugin.ts +3 -4
- package/src/plugins/ec.spec.ts +1 -1
- package/src/plugins/ec.ts +1 -1
- package/src/plugins/svc.spec.ts +1 -1
- package/src/plugins/svc.ts +1 -1
- package/src/react-native/react-native-runtime.ts +1 -1
- package/src/storage.spec.ts +8 -0
- package/src/storage.ts +3 -3
- package/src/version.ts +1 -0
- package/dist/definitions/client/crypto.d.ts +0 -1
- package/src/client/crypto.ts +0 -21
package/dist/library.js
CHANGED
|
@@ -157,12 +157,6 @@ function hasSessionStorage() {
|
|
|
157
157
|
}
|
|
158
158
|
function hasCookieStorage() {
|
|
159
159
|
return hasNavigator() && navigator.cookieEnabled;
|
|
160
|
-
}
|
|
161
|
-
function hasCrypto() {
|
|
162
|
-
return typeof crypto !== 'undefined';
|
|
163
|
-
}
|
|
164
|
-
function hasCryptoRandomValues() {
|
|
165
|
-
return hasCrypto() && typeof crypto.getRandomValues !== 'undefined';
|
|
166
160
|
}
|
|
167
161
|
|
|
168
162
|
var eventTypesForDefaultValues = [EventType.click, EventType.custom, EventType.search, EventType.view];
|
|
@@ -174,29 +168,20 @@ var addDefaultValues = function (eventType, payload) {
|
|
|
174
168
|
var Cookie = (function () {
|
|
175
169
|
function Cookie() {
|
|
176
170
|
}
|
|
177
|
-
Cookie.set = function (name, value,
|
|
178
|
-
var domain,
|
|
179
|
-
if (
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
expires = '; expires=' + date.toGMTString();
|
|
183
|
-
}
|
|
184
|
-
else {
|
|
185
|
-
expires = '';
|
|
171
|
+
Cookie.set = function (name, value, expire) {
|
|
172
|
+
var domain, expirationDate, domainParts, host;
|
|
173
|
+
if (expire) {
|
|
174
|
+
expirationDate = new Date();
|
|
175
|
+
expirationDate.setTime(expirationDate.getTime() + expire);
|
|
186
176
|
}
|
|
187
177
|
host = window.location.hostname;
|
|
188
178
|
if (host.indexOf('.') === -1) {
|
|
189
|
-
|
|
179
|
+
writeCookie(name, value, expirationDate);
|
|
190
180
|
}
|
|
191
181
|
else {
|
|
192
182
|
domainParts = host.split('.');
|
|
193
|
-
domainParts.
|
|
194
|
-
|
|
195
|
-
writeCookie({ name: name, value: value, expires: expires, domain: domain });
|
|
196
|
-
if (Cookie.get(name) == null || Cookie.get(name) != value) {
|
|
197
|
-
domain = '.' + host;
|
|
198
|
-
writeCookie({ name: name, value: value, expires: expires, domain: domain });
|
|
199
|
-
}
|
|
183
|
+
domain = domainParts[domainParts.length - 2] + '.' + domainParts[domainParts.length - 1];
|
|
184
|
+
writeCookie(name, value, expirationDate, domain);
|
|
200
185
|
}
|
|
201
186
|
};
|
|
202
187
|
Cookie.get = function (name) {
|
|
@@ -205,7 +190,7 @@ var Cookie = (function () {
|
|
|
205
190
|
for (var i = 0; i < cookieArray.length; i++) {
|
|
206
191
|
var cookie = cookieArray[i];
|
|
207
192
|
cookie = cookie.replace(/^\s+/, '');
|
|
208
|
-
if (cookie.
|
|
193
|
+
if (cookie.lastIndexOf(cookiePrefix, 0) === 0) {
|
|
209
194
|
return cookie.substring(cookiePrefix.length, cookie.length);
|
|
210
195
|
}
|
|
211
196
|
}
|
|
@@ -216,9 +201,12 @@ var Cookie = (function () {
|
|
|
216
201
|
};
|
|
217
202
|
return Cookie;
|
|
218
203
|
}());
|
|
219
|
-
function writeCookie(
|
|
220
|
-
|
|
221
|
-
|
|
204
|
+
function writeCookie(name, value, expirationDate, domain) {
|
|
205
|
+
document.cookie =
|
|
206
|
+
name + "=" + value +
|
|
207
|
+
(expirationDate ? ";expires=" + expirationDate.toUTCString() : '') +
|
|
208
|
+
(domain ? ";domain=" + domain : '') +
|
|
209
|
+
';SameSite=Lax';
|
|
222
210
|
}
|
|
223
211
|
|
|
224
212
|
var preferredStorage = null;
|
|
@@ -243,8 +231,8 @@ var CookieStorage = (function () {
|
|
|
243
231
|
CookieStorage.prototype.removeItem = function (key) {
|
|
244
232
|
Cookie.erase("" + CookieStorage.prefix + key);
|
|
245
233
|
};
|
|
246
|
-
CookieStorage.prototype.setItem = function (key, data) {
|
|
247
|
-
Cookie.set("" + CookieStorage.prefix + key, data);
|
|
234
|
+
CookieStorage.prototype.setItem = function (key, data, expire) {
|
|
235
|
+
Cookie.set("" + CookieStorage.prefix + key, data, expire);
|
|
248
236
|
};
|
|
249
237
|
CookieStorage.prefix = 'coveo_';
|
|
250
238
|
return CookieStorage;
|
|
@@ -262,7 +250,7 @@ var CookieAndLocalStorage = (function () {
|
|
|
262
250
|
};
|
|
263
251
|
CookieAndLocalStorage.prototype.setItem = function (key, data) {
|
|
264
252
|
localStorage.setItem(key, data);
|
|
265
|
-
this.cookieStorage.setItem(key, data);
|
|
253
|
+
this.cookieStorage.setItem(key, data, 31556926000);
|
|
266
254
|
};
|
|
267
255
|
return CookieAndLocalStorage;
|
|
268
256
|
}());
|
|
@@ -487,25 +475,273 @@ var addPageViewToHistory = function (pageViewValue) { return __awaiter(void 0, v
|
|
|
487
475
|
});
|
|
488
476
|
}); };
|
|
489
477
|
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
478
|
+
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
479
|
+
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
480
|
+
// generators (like Math.random()).
|
|
481
|
+
let getRandomValues;
|
|
482
|
+
const rnds8 = new Uint8Array(16);
|
|
483
|
+
function rng() {
|
|
484
|
+
// lazy load so that environments that need to polyfill have a chance to do so
|
|
485
|
+
if (!getRandomValues) {
|
|
486
|
+
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
|
487
|
+
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
488
|
+
|
|
489
|
+
if (!getRandomValues) {
|
|
490
|
+
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
return getRandomValues(rnds8);
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
498
|
+
|
|
499
|
+
function validate(uuid) {
|
|
500
|
+
return typeof uuid === 'string' && REGEX.test(uuid);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Convert array of 16 byte values to UUID string format of the form:
|
|
505
|
+
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
506
|
+
*/
|
|
507
|
+
|
|
508
|
+
const byteToHex = [];
|
|
509
|
+
|
|
510
|
+
for (let i = 0; i < 256; ++i) {
|
|
511
|
+
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
function unsafeStringify(arr, offset = 0) {
|
|
515
|
+
// Note: Be careful editing this code! It's been tuned for performance
|
|
516
|
+
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
517
|
+
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
function parse(uuid) {
|
|
521
|
+
if (!validate(uuid)) {
|
|
522
|
+
throw TypeError('Invalid UUID');
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
let v;
|
|
526
|
+
const arr = new Uint8Array(16); // Parse ########-....-....-....-............
|
|
527
|
+
|
|
528
|
+
arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
|
|
529
|
+
arr[1] = v >>> 16 & 0xff;
|
|
530
|
+
arr[2] = v >>> 8 & 0xff;
|
|
531
|
+
arr[3] = v & 0xff; // Parse ........-####-....-....-............
|
|
532
|
+
|
|
533
|
+
arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
|
|
534
|
+
arr[5] = v & 0xff; // Parse ........-....-####-....-............
|
|
535
|
+
|
|
536
|
+
arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
|
|
537
|
+
arr[7] = v & 0xff; // Parse ........-....-....-####-............
|
|
538
|
+
|
|
539
|
+
arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
|
|
540
|
+
arr[9] = v & 0xff; // Parse ........-....-....-....-############
|
|
541
|
+
// (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
|
|
542
|
+
|
|
543
|
+
arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
|
|
544
|
+
arr[11] = v / 0x100000000 & 0xff;
|
|
545
|
+
arr[12] = v >>> 24 & 0xff;
|
|
546
|
+
arr[13] = v >>> 16 & 0xff;
|
|
547
|
+
arr[14] = v >>> 8 & 0xff;
|
|
548
|
+
arr[15] = v & 0xff;
|
|
549
|
+
return arr;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
function stringToBytes(str) {
|
|
553
|
+
str = unescape(encodeURIComponent(str)); // UTF8 escape
|
|
554
|
+
|
|
555
|
+
const bytes = [];
|
|
556
|
+
|
|
557
|
+
for (let i = 0; i < str.length; ++i) {
|
|
558
|
+
bytes.push(str.charCodeAt(i));
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
return bytes;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
|
|
565
|
+
const URL$1 = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
|
|
566
|
+
function v35(name, version, hashfunc) {
|
|
567
|
+
function generateUUID(value, namespace, buf, offset) {
|
|
568
|
+
var _namespace;
|
|
569
|
+
|
|
570
|
+
if (typeof value === 'string') {
|
|
571
|
+
value = stringToBytes(value);
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
if (typeof namespace === 'string') {
|
|
575
|
+
namespace = parse(namespace);
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
|
|
579
|
+
throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
|
|
580
|
+
} // Compute hash of namespace and value, Per 4.3
|
|
581
|
+
// Future: Use spread syntax when supported on all platforms, e.g. `bytes =
|
|
582
|
+
// hashfunc([...namespace, ... value])`
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
let bytes = new Uint8Array(16 + value.length);
|
|
586
|
+
bytes.set(namespace);
|
|
587
|
+
bytes.set(value, namespace.length);
|
|
588
|
+
bytes = hashfunc(bytes);
|
|
589
|
+
bytes[6] = bytes[6] & 0x0f | version;
|
|
590
|
+
bytes[8] = bytes[8] & 0x3f | 0x80;
|
|
591
|
+
|
|
592
|
+
if (buf) {
|
|
593
|
+
offset = offset || 0;
|
|
594
|
+
|
|
595
|
+
for (let i = 0; i < 16; ++i) {
|
|
596
|
+
buf[offset + i] = bytes[i];
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
return buf;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
return unsafeStringify(bytes);
|
|
603
|
+
} // Function#name is not settable on some platforms (#270)
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
try {
|
|
607
|
+
generateUUID.name = name; // eslint-disable-next-line no-empty
|
|
608
|
+
} catch (err) {} // For CommonJS default export support
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
generateUUID.DNS = DNS;
|
|
612
|
+
generateUUID.URL = URL$1;
|
|
613
|
+
return generateUUID;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
617
|
+
var native = {
|
|
618
|
+
randomUUID
|
|
507
619
|
};
|
|
508
620
|
|
|
621
|
+
function v4(options, buf, offset) {
|
|
622
|
+
if (native.randomUUID && !buf && !options) {
|
|
623
|
+
return native.randomUUID();
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
options = options || {};
|
|
627
|
+
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
628
|
+
|
|
629
|
+
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
630
|
+
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
631
|
+
|
|
632
|
+
if (buf) {
|
|
633
|
+
offset = offset || 0;
|
|
634
|
+
|
|
635
|
+
for (let i = 0; i < 16; ++i) {
|
|
636
|
+
buf[offset + i] = rnds[i];
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
return buf;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
return unsafeStringify(rnds);
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
// Adapted from Chris Veness' SHA1 code at
|
|
646
|
+
// http://www.movable-type.co.uk/scripts/sha1.html
|
|
647
|
+
function f(s, x, y, z) {
|
|
648
|
+
switch (s) {
|
|
649
|
+
case 0:
|
|
650
|
+
return x & y ^ ~x & z;
|
|
651
|
+
|
|
652
|
+
case 1:
|
|
653
|
+
return x ^ y ^ z;
|
|
654
|
+
|
|
655
|
+
case 2:
|
|
656
|
+
return x & y ^ x & z ^ y & z;
|
|
657
|
+
|
|
658
|
+
case 3:
|
|
659
|
+
return x ^ y ^ z;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
function ROTL(x, n) {
|
|
664
|
+
return x << n | x >>> 32 - n;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
function sha1(bytes) {
|
|
668
|
+
const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
|
|
669
|
+
const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];
|
|
670
|
+
|
|
671
|
+
if (typeof bytes === 'string') {
|
|
672
|
+
const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
|
673
|
+
|
|
674
|
+
bytes = [];
|
|
675
|
+
|
|
676
|
+
for (let i = 0; i < msg.length; ++i) {
|
|
677
|
+
bytes.push(msg.charCodeAt(i));
|
|
678
|
+
}
|
|
679
|
+
} else if (!Array.isArray(bytes)) {
|
|
680
|
+
// Convert Array-like to Array
|
|
681
|
+
bytes = Array.prototype.slice.call(bytes);
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
bytes.push(0x80);
|
|
685
|
+
const l = bytes.length / 4 + 2;
|
|
686
|
+
const N = Math.ceil(l / 16);
|
|
687
|
+
const M = new Array(N);
|
|
688
|
+
|
|
689
|
+
for (let i = 0; i < N; ++i) {
|
|
690
|
+
const arr = new Uint32Array(16);
|
|
691
|
+
|
|
692
|
+
for (let j = 0; j < 16; ++j) {
|
|
693
|
+
arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3];
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
M[i] = arr;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);
|
|
700
|
+
M[N - 1][14] = Math.floor(M[N - 1][14]);
|
|
701
|
+
M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;
|
|
702
|
+
|
|
703
|
+
for (let i = 0; i < N; ++i) {
|
|
704
|
+
const W = new Uint32Array(80);
|
|
705
|
+
|
|
706
|
+
for (let t = 0; t < 16; ++t) {
|
|
707
|
+
W[t] = M[i][t];
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
for (let t = 16; t < 80; ++t) {
|
|
711
|
+
W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
let a = H[0];
|
|
715
|
+
let b = H[1];
|
|
716
|
+
let c = H[2];
|
|
717
|
+
let d = H[3];
|
|
718
|
+
let e = H[4];
|
|
719
|
+
|
|
720
|
+
for (let t = 0; t < 80; ++t) {
|
|
721
|
+
const s = Math.floor(t / 20);
|
|
722
|
+
const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0;
|
|
723
|
+
e = d;
|
|
724
|
+
d = c;
|
|
725
|
+
c = ROTL(b, 30) >>> 0;
|
|
726
|
+
b = a;
|
|
727
|
+
a = T;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
H[0] = H[0] + a >>> 0;
|
|
731
|
+
H[1] = H[1] + b >>> 0;
|
|
732
|
+
H[2] = H[2] + c >>> 0;
|
|
733
|
+
H[3] = H[3] + d >>> 0;
|
|
734
|
+
H[4] = H[4] + e >>> 0;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
const v5 = v35('v5', 0x50, sha1);
|
|
741
|
+
var uuidv5 = v5;
|
|
742
|
+
|
|
743
|
+
var libVersion = "2.25.1" ;
|
|
744
|
+
|
|
509
745
|
var keysOf = Object.keys;
|
|
510
746
|
function isObject(o) {
|
|
511
747
|
return o !== null && typeof o === 'object' && !Array.isArray(o);
|
|
@@ -82545,6 +82781,7 @@ function buildBaseUrl(endpoint, apiVersion) {
|
|
|
82545
82781
|
var endpointIsCoveoProxy = endpoint.indexOf('.cloud.coveo.com') !== -1;
|
|
82546
82782
|
return "" + endpoint + (endpointIsCoveoProxy ? '' : '/rest') + "/" + apiVersion;
|
|
82547
82783
|
}
|
|
82784
|
+
var COVEO_NAMESPACE = '38824e1f-37f5-42d3-8372-a4b8fa9df946';
|
|
82548
82785
|
var CoveoAnalyticsClient = (function () {
|
|
82549
82786
|
function CoveoAnalyticsClient(opts) {
|
|
82550
82787
|
if (!opts) {
|
|
@@ -82581,6 +82818,13 @@ var CoveoAnalyticsClient = (function () {
|
|
|
82581
82818
|
enumerable: false,
|
|
82582
82819
|
configurable: true
|
|
82583
82820
|
});
|
|
82821
|
+
Object.defineProperty(CoveoAnalyticsClient.prototype, "version", {
|
|
82822
|
+
get: function () {
|
|
82823
|
+
return libVersion;
|
|
82824
|
+
},
|
|
82825
|
+
enumerable: false,
|
|
82826
|
+
configurable: true
|
|
82827
|
+
});
|
|
82584
82828
|
CoveoAnalyticsClient.prototype.initRuntime = function (clientsOptions) {
|
|
82585
82829
|
var _this = this;
|
|
82586
82830
|
if (hasWindow() && hasDocument()) {
|
|
@@ -82610,11 +82854,11 @@ var CoveoAnalyticsClient = (function () {
|
|
|
82610
82854
|
case 0:
|
|
82611
82855
|
_a.trys.push([0, 2, , 3]);
|
|
82612
82856
|
return [4, this.storage.getItem('visitorId')];
|
|
82613
|
-
case 1: return [2, (_a.sent()) ||
|
|
82857
|
+
case 1: return [2, (_a.sent()) || v4()];
|
|
82614
82858
|
case 2:
|
|
82615
82859
|
err_1 = _a.sent();
|
|
82616
82860
|
console.log('Could not get visitor ID from the current runtime environment storage. Using a random ID instead.', err_1);
|
|
82617
|
-
return [2,
|
|
82861
|
+
return [2, v4()];
|
|
82618
82862
|
case 3: return [2];
|
|
82619
82863
|
}
|
|
82620
82864
|
});
|
|
@@ -82653,6 +82897,22 @@ var CoveoAnalyticsClient = (function () {
|
|
|
82653
82897
|
});
|
|
82654
82898
|
});
|
|
82655
82899
|
};
|
|
82900
|
+
CoveoAnalyticsClient.prototype.setClientId = function (value, namespace) {
|
|
82901
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82902
|
+
return __generator(this, function (_a) {
|
|
82903
|
+
if (validate(value)) {
|
|
82904
|
+
this.setCurrentVisitorId(value);
|
|
82905
|
+
}
|
|
82906
|
+
else {
|
|
82907
|
+
if (!namespace) {
|
|
82908
|
+
throw Error('Cannot generate uuid client id without a specific namespace string.');
|
|
82909
|
+
}
|
|
82910
|
+
this.setCurrentVisitorId(uuidv5(value, uuidv5(namespace, COVEO_NAMESPACE)));
|
|
82911
|
+
}
|
|
82912
|
+
return [2];
|
|
82913
|
+
});
|
|
82914
|
+
});
|
|
82915
|
+
};
|
|
82656
82916
|
CoveoAnalyticsClient.prototype.getParameters = function (eventType) {
|
|
82657
82917
|
var payload = [];
|
|
82658
82918
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
@@ -82689,7 +82949,7 @@ var CoveoAnalyticsClient = (function () {
|
|
|
82689
82949
|
get: function () {
|
|
82690
82950
|
var visitorId = this.visitorId || this.storage.getItem('visitorId');
|
|
82691
82951
|
if (typeof visitorId !== 'string') {
|
|
82692
|
-
this.setCurrentVisitorId(
|
|
82952
|
+
this.setCurrentVisitorId(v4());
|
|
82693
82953
|
}
|
|
82694
82954
|
return this.visitorId;
|
|
82695
82955
|
},
|
|
@@ -83156,7 +83416,7 @@ var BasePluginEventTypes = {
|
|
|
83156
83416
|
};
|
|
83157
83417
|
var BasePlugin = (function () {
|
|
83158
83418
|
function BasePlugin(_a) {
|
|
83159
|
-
var client = _a.client, _b = _a.uuidGenerator, uuidGenerator = _b === void 0 ?
|
|
83419
|
+
var client = _a.client, _b = _a.uuidGenerator, uuidGenerator = _b === void 0 ? v4 : _b;
|
|
83160
83420
|
this.actionData = {};
|
|
83161
83421
|
this.client = client;
|
|
83162
83422
|
this.uuidGenerator = uuidGenerator;
|
|
@@ -83239,7 +83499,7 @@ var allECEventTypes = Object.keys(ECPluginEventTypes).map(function (key) { retur
|
|
|
83239
83499
|
var ECPlugin = (function (_super) {
|
|
83240
83500
|
__extends(ECPlugin, _super);
|
|
83241
83501
|
function ECPlugin(_a) {
|
|
83242
|
-
var client = _a.client, _b = _a.uuidGenerator, uuidGenerator = _b === void 0 ?
|
|
83502
|
+
var client = _a.client, _b = _a.uuidGenerator, uuidGenerator = _b === void 0 ? v4 : _b;
|
|
83243
83503
|
var _this = _super.call(this, { client: client, uuidGenerator: uuidGenerator }) || this;
|
|
83244
83504
|
_this.products = [];
|
|
83245
83505
|
_this.impressions = [];
|
|
@@ -83367,7 +83627,7 @@ var allSVCEventTypes = Object.keys(SVCPluginEventTypes).map(function (key) { ret
|
|
|
83367
83627
|
var SVCPlugin = (function (_super) {
|
|
83368
83628
|
__extends(SVCPlugin, _super);
|
|
83369
83629
|
function SVCPlugin(_a) {
|
|
83370
|
-
var client = _a.client, _b = _a.uuidGenerator, uuidGenerator = _b === void 0 ?
|
|
83630
|
+
var client = _a.client, _b = _a.uuidGenerator, uuidGenerator = _b === void 0 ? v4 : _b;
|
|
83371
83631
|
var _this = _super.call(this, { client: client, uuidGenerator: uuidGenerator }) || this;
|
|
83372
83632
|
_this.ticket = {};
|
|
83373
83633
|
return _this;
|
|
@@ -83595,6 +83855,9 @@ var CoveoUA = (function () {
|
|
|
83595
83855
|
this.plugins = new Plugins();
|
|
83596
83856
|
this.params = {};
|
|
83597
83857
|
};
|
|
83858
|
+
CoveoUA.prototype.version = function () {
|
|
83859
|
+
return libVersion;
|
|
83860
|
+
};
|
|
83598
83861
|
return CoveoUA;
|
|
83599
83862
|
}());
|
|
83600
83863
|
var coveoua = new CoveoUA();
|
|
@@ -83622,6 +83885,7 @@ var handleOneAnalyticsEvent = function (command) {
|
|
|
83622
83885
|
'reset',
|
|
83623
83886
|
'require',
|
|
83624
83887
|
'provide',
|
|
83888
|
+
'version',
|
|
83625
83889
|
];
|
|
83626
83890
|
throw new Error("The action \"" + command + "\" does not exist. Available actions: " + actions.join(', ') + ".");
|
|
83627
83891
|
}
|
|
@@ -83813,6 +84077,13 @@ var NoopAnalytics = (function () {
|
|
|
83813
84077
|
NoopAnalytics.prototype.registerBeforeSendEventHook = function () { };
|
|
83814
84078
|
NoopAnalytics.prototype.registerAfterSendEventHook = function () { };
|
|
83815
84079
|
NoopAnalytics.prototype.addEventTypeMapping = function () { };
|
|
84080
|
+
Object.defineProperty(NoopAnalytics.prototype, "version", {
|
|
84081
|
+
get: function () {
|
|
84082
|
+
return libVersion;
|
|
84083
|
+
},
|
|
84084
|
+
enumerable: false,
|
|
84085
|
+
configurable: true
|
|
84086
|
+
});
|
|
83816
84087
|
return NoopAnalytics;
|
|
83817
84088
|
}());
|
|
83818
84089
|
|