coveo.analytics 2.20.9 → 2.20.10
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.js +1 -1
- package/dist/coveoua.js.map +1 -1
- package/dist/definitions/client/analytics.d.ts +1 -0
- package/dist/definitions/client/analyticsBeaconClient.d.ts +1 -0
- package/dist/definitions/client/analyticsFetchClient.d.ts +1 -0
- package/dist/definitions/client/analyticsRequestClient.d.ts +2 -0
- package/dist/library.es.js +18 -0
- package/dist/library.js +29 -0
- package/dist/react-native.es.js +7 -0
- package/package.json +1 -1
- package/src/client/analytics.ts +4 -0
- package/src/client/analyticsBeaconClient.ts +4 -0
- package/src/client/analyticsFetchClient.ts +6 -0
- package/src/client/analyticsRequestClient.ts +5 -0
|
@@ -68,6 +68,7 @@ export declare class CoveoAnalyticsClient implements AnalyticsClient, VisitorIdP
|
|
|
68
68
|
private deferExecution;
|
|
69
69
|
private sendFromBufferWithFetch;
|
|
70
70
|
clear(): void;
|
|
71
|
+
deleteHttpOnlyVisitorId(): void;
|
|
71
72
|
sendSearchEvent(request: SearchEventRequest): Promise<SearchEventResponse | void>;
|
|
72
73
|
sendClickEvent(request: ClickEventRequest): Promise<ClickEventResponse | void>;
|
|
73
74
|
sendCustomEvent(request: CustomEventRequest): Promise<CustomEventResponse | void>;
|
|
@@ -4,6 +4,7 @@ export declare class AnalyticsBeaconClient implements AnalyticsRequestClient {
|
|
|
4
4
|
private opts;
|
|
5
5
|
constructor(opts: IAnalyticsClientOptions);
|
|
6
6
|
sendEvent(eventType: EventType, payload: IRequestPayload): Promise<void>;
|
|
7
|
+
deleteHttpCookieVisitorId(): Promise<void>;
|
|
7
8
|
private encodeForEventType;
|
|
8
9
|
private getQueryParamsForEventType;
|
|
9
10
|
private isEventTypeLegacy;
|
|
@@ -4,6 +4,7 @@ export declare class AnalyticsFetchClient implements AnalyticsRequestClient {
|
|
|
4
4
|
private opts;
|
|
5
5
|
constructor(opts: IAnalyticsClientOptions);
|
|
6
6
|
sendEvent(eventType: EventType, payload: IRequestPayload): Promise<AnyEventResponse>;
|
|
7
|
+
deleteHttpCookieVisitorId(): Promise<void>;
|
|
7
8
|
private shouldAppendVisitorId;
|
|
8
9
|
private getVisitorIdParam;
|
|
9
10
|
private getHeaders;
|
|
@@ -5,6 +5,7 @@ export interface VisitorIdProvider {
|
|
|
5
5
|
}
|
|
6
6
|
export interface AnalyticsRequestClient {
|
|
7
7
|
sendEvent(eventType: string, payload: IRequestPayload): Promise<AnyEventResponse | void>;
|
|
8
|
+
deleteHttpCookieVisitorId: () => Promise<void>;
|
|
8
9
|
}
|
|
9
10
|
export interface IAnalyticsClientOptions {
|
|
10
11
|
baseUrl: string;
|
|
@@ -19,4 +20,5 @@ export interface IAnalyticsRequestOptions extends RequestInit {
|
|
|
19
20
|
}
|
|
20
21
|
export declare class NoopAnalyticsClient implements AnalyticsRequestClient {
|
|
21
22
|
sendEvent(_: EventType, __: IRequestPayload): Promise<void>;
|
|
23
|
+
deleteHttpCookieVisitorId(): Promise<void>;
|
|
22
24
|
}
|
package/dist/library.es.js
CHANGED
|
@@ -594,6 +594,9 @@ class AnalyticsBeaconClient {
|
|
|
594
594
|
return;
|
|
595
595
|
});
|
|
596
596
|
}
|
|
597
|
+
deleteHttpCookieVisitorId() {
|
|
598
|
+
return Promise.resolve();
|
|
599
|
+
}
|
|
597
600
|
encodeForEventType(eventType, payload) {
|
|
598
601
|
return this.isEventTypeLegacy(eventType)
|
|
599
602
|
? this.encodeForLegacyType(eventType, payload)
|
|
@@ -637,6 +640,11 @@ class NoopAnalyticsClient {
|
|
|
637
640
|
return Promise.resolve();
|
|
638
641
|
});
|
|
639
642
|
}
|
|
643
|
+
deleteHttpCookieVisitorId() {
|
|
644
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
645
|
+
return Promise.resolve();
|
|
646
|
+
});
|
|
647
|
+
}
|
|
640
648
|
}
|
|
641
649
|
|
|
642
650
|
const fetch$1 = window.fetch;
|
|
@@ -677,6 +685,13 @@ class AnalyticsFetchClient {
|
|
|
677
685
|
}
|
|
678
686
|
});
|
|
679
687
|
}
|
|
688
|
+
deleteHttpCookieVisitorId() {
|
|
689
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
690
|
+
const { baseUrl } = this.opts;
|
|
691
|
+
const url = `${baseUrl}/analytics/visit`;
|
|
692
|
+
yield fetch$1(url, { headers: this.getHeaders(), method: 'DELETE' });
|
|
693
|
+
});
|
|
694
|
+
}
|
|
680
695
|
shouldAppendVisitorId(eventType) {
|
|
681
696
|
return [EventType.click, EventType.custom, EventType.search, EventType.view].indexOf(eventType) !== -1;
|
|
682
697
|
}
|
|
@@ -938,6 +953,9 @@ class CoveoAnalyticsClient {
|
|
|
938
953
|
const store = new HistoryStore();
|
|
939
954
|
store.clear();
|
|
940
955
|
}
|
|
956
|
+
deleteHttpOnlyVisitorId() {
|
|
957
|
+
this.runtime.client.deleteHttpCookieVisitorId();
|
|
958
|
+
}
|
|
941
959
|
sendSearchEvent(request) {
|
|
942
960
|
return __awaiter(this, void 0, void 0, function* () {
|
|
943
961
|
return this.sendEvent(EventType.search, request);
|
package/dist/library.js
CHANGED
|
@@ -792,6 +792,9 @@ var AnalyticsBeaconClient = (function () {
|
|
|
792
792
|
});
|
|
793
793
|
});
|
|
794
794
|
};
|
|
795
|
+
AnalyticsBeaconClient.prototype.deleteHttpCookieVisitorId = function () {
|
|
796
|
+
return Promise.resolve();
|
|
797
|
+
};
|
|
795
798
|
AnalyticsBeaconClient.prototype.encodeForEventType = function (eventType, payload) {
|
|
796
799
|
return this.isEventTypeLegacy(eventType)
|
|
797
800
|
? this.encodeForLegacyType(eventType, payload)
|
|
@@ -849,6 +852,13 @@ var NoopAnalyticsClient = (function () {
|
|
|
849
852
|
});
|
|
850
853
|
});
|
|
851
854
|
};
|
|
855
|
+
NoopAnalyticsClient.prototype.deleteHttpCookieVisitorId = function () {
|
|
856
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
857
|
+
return __generator(this, function (_a) {
|
|
858
|
+
return [2, Promise.resolve()];
|
|
859
|
+
});
|
|
860
|
+
});
|
|
861
|
+
};
|
|
852
862
|
return NoopAnalyticsClient;
|
|
853
863
|
}());
|
|
854
864
|
|
|
@@ -82413,6 +82423,22 @@ var AnalyticsFetchClient = (function () {
|
|
|
82413
82423
|
});
|
|
82414
82424
|
});
|
|
82415
82425
|
};
|
|
82426
|
+
AnalyticsFetchClient.prototype.deleteHttpCookieVisitorId = function () {
|
|
82427
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82428
|
+
var baseUrl, url;
|
|
82429
|
+
return __generator(this, function (_a) {
|
|
82430
|
+
switch (_a.label) {
|
|
82431
|
+
case 0:
|
|
82432
|
+
baseUrl = this.opts.baseUrl;
|
|
82433
|
+
url = baseUrl + "/analytics/visit";
|
|
82434
|
+
return [4, nodePonyfill.exports.fetch(url, { headers: this.getHeaders(), method: 'DELETE' })];
|
|
82435
|
+
case 1:
|
|
82436
|
+
_a.sent();
|
|
82437
|
+
return [2];
|
|
82438
|
+
}
|
|
82439
|
+
});
|
|
82440
|
+
});
|
|
82441
|
+
};
|
|
82416
82442
|
AnalyticsFetchClient.prototype.shouldAppendVisitorId = function (eventType) {
|
|
82417
82443
|
return [EventType.click, EventType.custom, EventType.search, EventType.view].indexOf(eventType) !== -1;
|
|
82418
82444
|
};
|
|
@@ -82841,6 +82867,9 @@ var CoveoAnalyticsClient = (function () {
|
|
|
82841
82867
|
var store = new HistoryStore();
|
|
82842
82868
|
store.clear();
|
|
82843
82869
|
};
|
|
82870
|
+
CoveoAnalyticsClient.prototype.deleteHttpOnlyVisitorId = function () {
|
|
82871
|
+
this.runtime.client.deleteHttpCookieVisitorId();
|
|
82872
|
+
};
|
|
82844
82873
|
CoveoAnalyticsClient.prototype.sendSearchEvent = function (request) {
|
|
82845
82874
|
return __awaiter(this, void 0, void 0, function () {
|
|
82846
82875
|
return __generator(this, function (_a) {
|
package/dist/react-native.es.js
CHANGED
|
@@ -83,6 +83,13 @@ class AnalyticsFetchClient {
|
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
+
deleteHttpCookieVisitorId() {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
const { baseUrl } = this.opts;
|
|
89
|
+
const url = `${baseUrl}/analytics/visit`;
|
|
90
|
+
yield fetch(url, { headers: this.getHeaders(), method: 'DELETE' });
|
|
91
|
+
});
|
|
92
|
+
}
|
|
86
93
|
shouldAppendVisitorId(eventType) {
|
|
87
94
|
return [EventType.click, EventType.custom, EventType.search, EventType.view].indexOf(eventType) !== -1;
|
|
88
95
|
}
|
package/package.json
CHANGED
package/src/client/analytics.ts
CHANGED
|
@@ -303,6 +303,10 @@ export class CoveoAnalyticsClient implements AnalyticsClient, VisitorIdProvider
|
|
|
303
303
|
store.clear();
|
|
304
304
|
}
|
|
305
305
|
|
|
306
|
+
public deleteHttpOnlyVisitorId() {
|
|
307
|
+
this.runtime.client.deleteHttpCookieVisitorId();
|
|
308
|
+
}
|
|
309
|
+
|
|
306
310
|
async sendSearchEvent(request: SearchEventRequest): Promise<SearchEventResponse | void> {
|
|
307
311
|
return this.sendEvent(EventType.search, request);
|
|
308
312
|
}
|
|
@@ -31,6 +31,10 @@ export class AnalyticsBeaconClient implements AnalyticsRequestClient {
|
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
public deleteHttpCookieVisitorId() {
|
|
35
|
+
return Promise.resolve();
|
|
36
|
+
}
|
|
37
|
+
|
|
34
38
|
private encodeForEventType(eventType: EventType, payload: IRequestPayload): string {
|
|
35
39
|
return this.isEventTypeLegacy(eventType)
|
|
36
40
|
? this.encodeForLegacyType(eventType, payload)
|
|
@@ -44,6 +44,12 @@ export class AnalyticsFetchClient implements AnalyticsRequestClient {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
public async deleteHttpCookieVisitorId() {
|
|
48
|
+
const {baseUrl} = this.opts;
|
|
49
|
+
const url = `${baseUrl}/analytics/visit`;
|
|
50
|
+
await fetch(url, {headers: this.getHeaders(), method: 'DELETE'});
|
|
51
|
+
}
|
|
52
|
+
|
|
47
53
|
private shouldAppendVisitorId(eventType: EventType) {
|
|
48
54
|
return [EventType.click, EventType.custom, EventType.search, EventType.view].indexOf(eventType) !== -1;
|
|
49
55
|
}
|
|
@@ -7,6 +7,7 @@ export interface VisitorIdProvider {
|
|
|
7
7
|
|
|
8
8
|
export interface AnalyticsRequestClient {
|
|
9
9
|
sendEvent(eventType: string, payload: IRequestPayload): Promise<AnyEventResponse | void>;
|
|
10
|
+
deleteHttpCookieVisitorId: () => Promise<void>;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export interface IAnalyticsClientOptions {
|
|
@@ -31,4 +32,8 @@ export class NoopAnalyticsClient implements AnalyticsRequestClient {
|
|
|
31
32
|
public async sendEvent(_: EventType, __: IRequestPayload): Promise<void> {
|
|
32
33
|
return Promise.resolve();
|
|
33
34
|
}
|
|
35
|
+
|
|
36
|
+
public async deleteHttpCookieVisitorId() {
|
|
37
|
+
return Promise.resolve();
|
|
38
|
+
}
|
|
34
39
|
}
|