coveo.analytics 2.29.4 → 2.29.5
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/browser.mjs +9 -2
- package/dist/coveoua.browser.js +1 -1
- package/dist/coveoua.browser.js.map +1 -1
- package/dist/coveoua.debug.js +15 -6
- 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/analyticsFetchClient.d.ts +1 -1
- package/dist/definitions/version.d.ts +1 -1
- package/dist/library.cjs +15 -6
- package/dist/library.es.js +9 -2
- package/dist/library.js +15 -6
- package/dist/library.mjs +15 -6
- package/dist/react-native.es.js +9 -2
- package/package.json +1 -1
- package/src/client/analyticsFetchClient.ts +10 -2
|
@@ -3,7 +3,7 @@ import { AnyEventResponse, EventType, IRequestPayload } from '../events';
|
|
|
3
3
|
export declare class AnalyticsFetchClient implements AnalyticsRequestClient {
|
|
4
4
|
private opts;
|
|
5
5
|
constructor(opts: IAnalyticsClientOptions);
|
|
6
|
-
sendEvent(eventType: EventType, payload: IRequestPayload): Promise<AnyEventResponse>;
|
|
6
|
+
sendEvent(eventType: EventType, payload: IRequestPayload): Promise<AnyEventResponse | void>;
|
|
7
7
|
deleteHttpCookieVisitorId(): Promise<void>;
|
|
8
8
|
private shouldAppendVisitorId;
|
|
9
9
|
private getVisitorIdParam;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const libVersion = "2.29.
|
|
1
|
+
export declare const libVersion = "2.29.5";
|
package/dist/library.cjs
CHANGED
|
@@ -731,7 +731,7 @@ function sha1(bytes) {
|
|
|
731
731
|
const v5 = v35('v5', 0x50, sha1);
|
|
732
732
|
var uuidv5 = v5;
|
|
733
733
|
|
|
734
|
-
var libVersion = "2.29.
|
|
734
|
+
var libVersion = "2.29.5" ;
|
|
735
735
|
|
|
736
736
|
var getFormattedLocation = function (location) {
|
|
737
737
|
return "".concat(location.protocol, "//").concat(location.hostname).concat(location.pathname.indexOf('/') === 0 ? location.pathname : "/".concat(location.pathname)).concat(location.search);
|
|
@@ -82840,7 +82840,7 @@ var AnalyticsFetchClient = (function () {
|
|
|
82840
82840
|
}
|
|
82841
82841
|
AnalyticsFetchClient.prototype.sendEvent = function (eventType, payload) {
|
|
82842
82842
|
return __awaiter(this, void 0, void 0, function () {
|
|
82843
|
-
var _a, baseUrl, visitorIdProvider, preprocessRequest, visitorIdParam, _b, defaultOptions, _c, url, fetchData, _d, _e, response, visit;
|
|
82843
|
+
var _a, baseUrl, visitorIdProvider, preprocessRequest, visitorIdParam, _b, defaultOptions, _c, url, fetchData, _d, _e, response, error_1, visit;
|
|
82844
82844
|
return __generator(this, function (_f) {
|
|
82845
82845
|
switch (_f.label) {
|
|
82846
82846
|
case 0:
|
|
@@ -82874,18 +82874,27 @@ var AnalyticsFetchClient = (function () {
|
|
|
82874
82874
|
_f.label = 6;
|
|
82875
82875
|
case 6:
|
|
82876
82876
|
_c = __assign.apply(void 0, _d.concat([(_e)])), url = _c.url, fetchData = __rest(_c, ["url"]);
|
|
82877
|
-
|
|
82877
|
+
_f.label = 7;
|
|
82878
82878
|
case 7:
|
|
82879
|
+
_f.trys.push([7, 9, , 10]);
|
|
82880
|
+
return [4, nodePonyfillExports.fetch(url, fetchData)];
|
|
82881
|
+
case 8:
|
|
82879
82882
|
response = _f.sent();
|
|
82880
|
-
|
|
82883
|
+
return [3, 10];
|
|
82884
|
+
case 9:
|
|
82885
|
+
error_1 = _f.sent();
|
|
82886
|
+
console.error('An error has occured when sending the event.', error_1);
|
|
82887
|
+
return [2];
|
|
82888
|
+
case 10:
|
|
82889
|
+
if (!response.ok) return [3, 12];
|
|
82881
82890
|
return [4, response.json()];
|
|
82882
|
-
case
|
|
82891
|
+
case 11:
|
|
82883
82892
|
visit = (_f.sent());
|
|
82884
82893
|
if (visit.visitorId) {
|
|
82885
82894
|
visitorIdProvider.setCurrentVisitorId(visit.visitorId);
|
|
82886
82895
|
}
|
|
82887
82896
|
return [2, visit];
|
|
82888
|
-
case
|
|
82897
|
+
case 12:
|
|
82889
82898
|
try {
|
|
82890
82899
|
response.json();
|
|
82891
82900
|
}
|
package/dist/library.es.js
CHANGED
|
@@ -596,7 +596,7 @@ function sha1(bytes) {
|
|
|
596
596
|
const v5 = v35('v5', 0x50, sha1);
|
|
597
597
|
var uuidv5 = v5;
|
|
598
598
|
|
|
599
|
-
const libVersion = "2.29.
|
|
599
|
+
const libVersion = "2.29.5" ;
|
|
600
600
|
|
|
601
601
|
const getFormattedLocation = (location) => `${location.protocol}//${location.hostname}${location.pathname.indexOf('/') === 0 ? location.pathname : `/${location.pathname}`}${location.search}`;
|
|
602
602
|
|
|
@@ -1112,7 +1112,14 @@ class AnalyticsFetchClient {
|
|
|
1112
1112
|
body: JSON.stringify(payload),
|
|
1113
1113
|
};
|
|
1114
1114
|
const _a = Object.assign(Object.assign({}, defaultOptions), (preprocessRequest ? yield preprocessRequest(defaultOptions, 'analyticsFetch') : {})), { url } = _a, fetchData = __rest(_a, ["url"]);
|
|
1115
|
-
|
|
1115
|
+
let response;
|
|
1116
|
+
try {
|
|
1117
|
+
response = yield fetch$1(url, fetchData);
|
|
1118
|
+
}
|
|
1119
|
+
catch (error) {
|
|
1120
|
+
console.error('An error has occured when sending the event.', error);
|
|
1121
|
+
return;
|
|
1122
|
+
}
|
|
1116
1123
|
if (response.ok) {
|
|
1117
1124
|
const visit = (yield response.json());
|
|
1118
1125
|
if (visit.visitorId) {
|
package/dist/library.js
CHANGED
|
@@ -731,7 +731,7 @@ function sha1(bytes) {
|
|
|
731
731
|
const v5 = v35('v5', 0x50, sha1);
|
|
732
732
|
var uuidv5 = v5;
|
|
733
733
|
|
|
734
|
-
var libVersion = "2.29.
|
|
734
|
+
var libVersion = "2.29.5" ;
|
|
735
735
|
|
|
736
736
|
var getFormattedLocation = function (location) {
|
|
737
737
|
return "".concat(location.protocol, "//").concat(location.hostname).concat(location.pathname.indexOf('/') === 0 ? location.pathname : "/".concat(location.pathname)).concat(location.search);
|
|
@@ -82840,7 +82840,7 @@ var AnalyticsFetchClient = (function () {
|
|
|
82840
82840
|
}
|
|
82841
82841
|
AnalyticsFetchClient.prototype.sendEvent = function (eventType, payload) {
|
|
82842
82842
|
return __awaiter(this, void 0, void 0, function () {
|
|
82843
|
-
var _a, baseUrl, visitorIdProvider, preprocessRequest, visitorIdParam, _b, defaultOptions, _c, url, fetchData, _d, _e, response, visit;
|
|
82843
|
+
var _a, baseUrl, visitorIdProvider, preprocessRequest, visitorIdParam, _b, defaultOptions, _c, url, fetchData, _d, _e, response, error_1, visit;
|
|
82844
82844
|
return __generator(this, function (_f) {
|
|
82845
82845
|
switch (_f.label) {
|
|
82846
82846
|
case 0:
|
|
@@ -82874,18 +82874,27 @@ var AnalyticsFetchClient = (function () {
|
|
|
82874
82874
|
_f.label = 6;
|
|
82875
82875
|
case 6:
|
|
82876
82876
|
_c = __assign.apply(void 0, _d.concat([(_e)])), url = _c.url, fetchData = __rest(_c, ["url"]);
|
|
82877
|
-
|
|
82877
|
+
_f.label = 7;
|
|
82878
82878
|
case 7:
|
|
82879
|
+
_f.trys.push([7, 9, , 10]);
|
|
82880
|
+
return [4, nodePonyfillExports.fetch(url, fetchData)];
|
|
82881
|
+
case 8:
|
|
82879
82882
|
response = _f.sent();
|
|
82880
|
-
|
|
82883
|
+
return [3, 10];
|
|
82884
|
+
case 9:
|
|
82885
|
+
error_1 = _f.sent();
|
|
82886
|
+
console.error('An error has occured when sending the event.', error_1);
|
|
82887
|
+
return [2];
|
|
82888
|
+
case 10:
|
|
82889
|
+
if (!response.ok) return [3, 12];
|
|
82881
82890
|
return [4, response.json()];
|
|
82882
|
-
case
|
|
82891
|
+
case 11:
|
|
82883
82892
|
visit = (_f.sent());
|
|
82884
82893
|
if (visit.visitorId) {
|
|
82885
82894
|
visitorIdProvider.setCurrentVisitorId(visit.visitorId);
|
|
82886
82895
|
}
|
|
82887
82896
|
return [2, visit];
|
|
82888
|
-
case
|
|
82897
|
+
case 12:
|
|
82889
82898
|
try {
|
|
82890
82899
|
response.json();
|
|
82891
82900
|
}
|
package/dist/library.mjs
CHANGED
|
@@ -729,7 +729,7 @@ function sha1(bytes) {
|
|
|
729
729
|
const v5 = v35('v5', 0x50, sha1);
|
|
730
730
|
var uuidv5 = v5;
|
|
731
731
|
|
|
732
|
-
var libVersion = "2.29.
|
|
732
|
+
var libVersion = "2.29.5" ;
|
|
733
733
|
|
|
734
734
|
var getFormattedLocation = function (location) {
|
|
735
735
|
return "".concat(location.protocol, "//").concat(location.hostname).concat(location.pathname.indexOf('/') === 0 ? location.pathname : "/".concat(location.pathname)).concat(location.search);
|
|
@@ -82838,7 +82838,7 @@ var AnalyticsFetchClient = (function () {
|
|
|
82838
82838
|
}
|
|
82839
82839
|
AnalyticsFetchClient.prototype.sendEvent = function (eventType, payload) {
|
|
82840
82840
|
return __awaiter(this, void 0, void 0, function () {
|
|
82841
|
-
var _a, baseUrl, visitorIdProvider, preprocessRequest, visitorIdParam, _b, defaultOptions, _c, url, fetchData, _d, _e, response, visit;
|
|
82841
|
+
var _a, baseUrl, visitorIdProvider, preprocessRequest, visitorIdParam, _b, defaultOptions, _c, url, fetchData, _d, _e, response, error_1, visit;
|
|
82842
82842
|
return __generator(this, function (_f) {
|
|
82843
82843
|
switch (_f.label) {
|
|
82844
82844
|
case 0:
|
|
@@ -82872,18 +82872,27 @@ var AnalyticsFetchClient = (function () {
|
|
|
82872
82872
|
_f.label = 6;
|
|
82873
82873
|
case 6:
|
|
82874
82874
|
_c = __assign.apply(void 0, _d.concat([(_e)])), url = _c.url, fetchData = __rest(_c, ["url"]);
|
|
82875
|
-
|
|
82875
|
+
_f.label = 7;
|
|
82876
82876
|
case 7:
|
|
82877
|
+
_f.trys.push([7, 9, , 10]);
|
|
82878
|
+
return [4, nodePonyfillExports.fetch(url, fetchData)];
|
|
82879
|
+
case 8:
|
|
82877
82880
|
response = _f.sent();
|
|
82878
|
-
|
|
82881
|
+
return [3, 10];
|
|
82882
|
+
case 9:
|
|
82883
|
+
error_1 = _f.sent();
|
|
82884
|
+
console.error('An error has occured when sending the event.', error_1);
|
|
82885
|
+
return [2];
|
|
82886
|
+
case 10:
|
|
82887
|
+
if (!response.ok) return [3, 12];
|
|
82879
82888
|
return [4, response.json()];
|
|
82880
|
-
case
|
|
82889
|
+
case 11:
|
|
82881
82890
|
visit = (_f.sent());
|
|
82882
82891
|
if (visit.visitorId) {
|
|
82883
82892
|
visitorIdProvider.setCurrentVisitorId(visit.visitorId);
|
|
82884
82893
|
}
|
|
82885
82894
|
return [2, visit];
|
|
82886
|
-
case
|
|
82895
|
+
case 12:
|
|
82887
82896
|
try {
|
|
82888
82897
|
response.json();
|
|
82889
82898
|
}
|
package/dist/react-native.es.js
CHANGED
|
@@ -64,7 +64,14 @@ class AnalyticsFetchClient {
|
|
|
64
64
|
body: JSON.stringify(payload),
|
|
65
65
|
};
|
|
66
66
|
const _a = Object.assign(Object.assign({}, defaultOptions), (preprocessRequest ? yield preprocessRequest(defaultOptions, 'analyticsFetch') : {})), { url } = _a, fetchData = __rest(_a, ["url"]);
|
|
67
|
-
|
|
67
|
+
let response;
|
|
68
|
+
try {
|
|
69
|
+
response = yield fetch$1(url, fetchData);
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
console.error('An error has occured when sending the event.', error);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
68
75
|
if (response.ok) {
|
|
69
76
|
const visit = (yield response.json());
|
|
70
77
|
if (visit.visitorId) {
|
|
@@ -658,7 +665,7 @@ const addPageViewToHistory = (pageViewValue) => __awaiter(void 0, void 0, void 0
|
|
|
658
665
|
yield store.addElementAsync(historyElement);
|
|
659
666
|
});
|
|
660
667
|
|
|
661
|
-
const libVersion = "2.29.
|
|
668
|
+
const libVersion = "2.29.5" ;
|
|
662
669
|
|
|
663
670
|
const getFormattedLocation = (location) => `${location.protocol}//${location.hostname}${location.pathname.indexOf('/') === 0 ? location.pathname : `/${location.pathname}`}${location.search}`;
|
|
664
671
|
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import {fetch} from 'cross-fetch';
|
|
|
5
5
|
export class AnalyticsFetchClient implements AnalyticsRequestClient {
|
|
6
6
|
constructor(private opts: IAnalyticsClientOptions) {}
|
|
7
7
|
|
|
8
|
-
public async sendEvent(eventType: EventType, payload: IRequestPayload): Promise<AnyEventResponse> {
|
|
8
|
+
public async sendEvent(eventType: EventType, payload: IRequestPayload): Promise<AnyEventResponse | void> {
|
|
9
9
|
const {baseUrl, visitorIdProvider, preprocessRequest} = this.opts;
|
|
10
10
|
|
|
11
11
|
const visitorIdParam = this.shouldAppendVisitorId(eventType) ? await this.getVisitorIdParam() : '';
|
|
@@ -22,7 +22,15 @@ export class AnalyticsFetchClient implements AnalyticsRequestClient {
|
|
|
22
22
|
...(preprocessRequest ? await preprocessRequest(defaultOptions, 'analyticsFetch') : {}),
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
let response: Response;
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
response = await fetch(url, fetchData);
|
|
29
|
+
} catch (error) {
|
|
30
|
+
console.error('An error has occured when sending the event.', error);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
26
34
|
if (response.ok) {
|
|
27
35
|
const visit = (await response.json()) as AnyEventResponse;
|
|
28
36
|
|