coveo.analytics 2.30.50 → 2.30.52
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 +8 -3
- package/dist/coveoua.browser.js +1 -1
- package/dist/coveoua.browser.js.map +1 -1
- package/dist/coveoua.debug.js +8 -3
- package/dist/coveoua.debug.js.map +1 -1
- package/dist/coveoua.js +1 -1
- package/dist/coveoua.js.map +1 -1
- package/dist/definitions/insight/insightClient.d.ts +2 -1
- package/dist/definitions/searchPage/searchPageEvents.d.ts +2 -1
- package/dist/definitions/version.d.ts +1 -1
- package/dist/library.cjs +8 -3
- package/dist/library.es.js +8 -3
- package/dist/library.js +8 -3
- package/dist/library.mjs +8 -3
- package/dist/react-native.es.js +8 -3
- package/package.json +1 -1
- package/src/insight/insightClient.spec.ts +53 -4
- package/src/insight/insightClient.ts +20 -5
- package/src/searchPage/searchPageEvents.ts +4 -0
|
@@ -63,7 +63,7 @@ export declare class CoveoInsightClient {
|
|
|
63
63
|
logFeedItemTextPost(info: PartialDocumentInformation, identifier: DocumentIdentifier, metadata?: CaseMetadata): Promise<void | import("../events").ClickEventResponse>;
|
|
64
64
|
logDocumentQuickview(info: PartialDocumentInformation, identifier: DocumentIdentifier, caseMetadata?: CaseMetadata): Promise<void | import("../events").ClickEventResponse>;
|
|
65
65
|
logCaseAttach(info: PartialDocumentInformation, identifier: DocumentIdentifier, caseMetadata?: CaseMetadata): Promise<void | import("../events").ClickEventResponse>;
|
|
66
|
-
logCaseDetach(resultUriHash: string, metadata?: CaseMetadata): Promise<void | import("../events").CustomEventResponse>;
|
|
66
|
+
logCaseDetach(resultUriHash: string, metadata?: CaseMetadata, permanentId?: string): Promise<void | import("../events").CustomEventResponse>;
|
|
67
67
|
logLikeSmartSnippet(metadata?: CaseMetadata): Promise<void | import("../events").CustomEventResponse>;
|
|
68
68
|
logDislikeSmartSnippet(metadata?: CaseMetadata): Promise<void | import("../events").CustomEventResponse>;
|
|
69
69
|
logExpandSmartSnippet(metadata?: CaseMetadata): Promise<void | import("../events").CustomEventResponse>;
|
|
@@ -92,6 +92,7 @@ export declare class CoveoInsightClient {
|
|
|
92
92
|
logRephraseGeneratedAnswer(generatedAnswerRephraseMetadata: GeneratedAnswerRephraseMeta, metadata?: CaseMetadata): Promise<void | import("../events").SearchEventResponse>;
|
|
93
93
|
logRetryGeneratedAnswer(metadata?: CaseMetadata): Promise<void | import("../events").SearchEventResponse>;
|
|
94
94
|
logGeneratedAnswerStreamEnd(generatedAnswerStreamEndMetadata: GeneratedAnswerStreamEndMeta, metadata?: CaseMetadata): Promise<void | import("../events").CustomEventResponse>;
|
|
95
|
+
logGeneratedAnswerCitationDocumentAttach(info: PartialDocumentInformation, citation: GeneratedAnswerCitationClickMeta, metadata?: CaseMetadata): Promise<void | import("../events").ClickEventResponse>;
|
|
95
96
|
logCustomEvent(event: SearchPageEvents | InsightEvents, metadata?: Record<string, any>): Promise<void | import("../events").CustomEventResponse>;
|
|
96
97
|
logSearchEvent(event: SearchPageEvents | InsightEvents, metadata?: Record<string, any>): Promise<void | import("../events").SearchEventResponse>;
|
|
97
98
|
logClickEvent(event: SearchPageEvents, info: PartialDocumentInformation, identifier: DocumentIdentifier, metadata?: Record<string, any>): Promise<void | import("../events").ClickEventResponse>;
|
|
@@ -87,7 +87,8 @@ export declare enum SearchPageEvents {
|
|
|
87
87
|
generatedAnswerFeedbackSubmit = "generatedAnswerFeedbackSubmit",
|
|
88
88
|
rephraseGeneratedAnswer = "rephraseGeneratedAnswer",
|
|
89
89
|
generatedAnswerFeedbackSubmitV2 = "generatedAnswerFeedbackSubmitV2",
|
|
90
|
-
generatedAnswerCitationClick = "generatedAnswerCitationClick"
|
|
90
|
+
generatedAnswerCitationClick = "generatedAnswerCitationClick",
|
|
91
|
+
generatedAnswerCitationDocumentAttach = "generatedAnswerCitationDocumentAttach"
|
|
91
92
|
}
|
|
92
93
|
export declare const CustomEventsTypes: Partial<Record<SearchPageEvents | InsightEvents, string>>;
|
|
93
94
|
export interface StaticFilterMetadata {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const libVersion = "2.30.
|
|
1
|
+
export declare const libVersion = "2.30.52";
|
package/dist/library.cjs
CHANGED
|
@@ -736,7 +736,7 @@ function sha1(bytes) {
|
|
|
736
736
|
const v5 = v35('v5', 0x50, sha1);
|
|
737
737
|
var uuidv5 = v5;
|
|
738
738
|
|
|
739
|
-
var libVersion = "2.30.
|
|
739
|
+
var libVersion = "2.30.52";
|
|
740
740
|
|
|
741
741
|
var getFormattedLocation = function (location) {
|
|
742
742
|
return "".concat(location.protocol, "//").concat(location.hostname).concat(location.pathname.indexOf('/') === 0 ? location.pathname : "/".concat(location.pathname)).concat(location.search);
|
|
@@ -84436,6 +84436,7 @@ exports.SearchPageEvents = void 0;
|
|
|
84436
84436
|
SearchPageEvents["rephraseGeneratedAnswer"] = "rephraseGeneratedAnswer";
|
|
84437
84437
|
SearchPageEvents["generatedAnswerFeedbackSubmitV2"] = "generatedAnswerFeedbackSubmitV2";
|
|
84438
84438
|
SearchPageEvents["generatedAnswerCitationClick"] = "generatedAnswerCitationClick";
|
|
84439
|
+
SearchPageEvents["generatedAnswerCitationDocumentAttach"] = "generatedAnswerCitationDocumentAttach";
|
|
84439
84440
|
})(exports.SearchPageEvents || (exports.SearchPageEvents = {}));
|
|
84440
84441
|
var CustomEventsTypes = (_a = {},
|
|
84441
84442
|
_a[exports.SearchPageEvents.triggerNotify] = 'queryPipelineTriggers',
|
|
@@ -86356,8 +86357,9 @@ var CoveoInsightClient = (function () {
|
|
|
86356
86357
|
};
|
|
86357
86358
|
return this.logClickEvent(exports.SearchPageEvents.caseAttach, info, identifier, caseMetadata ? __assign(__assign({}, generateMetadataToSend(caseMetadata, false)), metadata) : metadata);
|
|
86358
86359
|
};
|
|
86359
|
-
CoveoInsightClient.prototype.logCaseDetach = function (resultUriHash, metadata) {
|
|
86360
|
-
|
|
86360
|
+
CoveoInsightClient.prototype.logCaseDetach = function (resultUriHash, metadata, permanentId) {
|
|
86361
|
+
var generatedMetadata = __assign(__assign(__assign({}, (metadata && generateMetadataToSend(metadata, false))), (permanentId && { permanentId: permanentId })), { resultUriHash: resultUriHash });
|
|
86362
|
+
return this.logCustomEvent(exports.SearchPageEvents.caseDetach, generatedMetadata);
|
|
86361
86363
|
};
|
|
86362
86364
|
CoveoInsightClient.prototype.logLikeSmartSnippet = function (metadata) {
|
|
86363
86365
|
return this.logCustomEvent(exports.SearchPageEvents.likeSmartSnippet, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
@@ -86461,6 +86463,9 @@ var CoveoInsightClient = (function () {
|
|
|
86461
86463
|
return this.logCustomEvent(exports.SearchPageEvents.generatedAnswerStreamEnd, metadata
|
|
86462
86464
|
? __assign(__assign({}, generateMetadataToSend(metadata, false)), generatedAnswerStreamEndMetadata) : generatedAnswerStreamEndMetadata);
|
|
86463
86465
|
};
|
|
86466
|
+
CoveoInsightClient.prototype.logGeneratedAnswerCitationDocumentAttach = function (info, citation, metadata) {
|
|
86467
|
+
return this.logClickEvent(exports.SearchPageEvents.generatedAnswerCitationDocumentAttach, __assign(__assign({}, info), { documentPosition: 1 }), { contentIDKey: citation.documentId.contentIdKey, contentIDValue: citation.documentId.contentIdValue }, metadata ? __assign(__assign({}, generateMetadataToSend(metadata, false)), citation) : citation);
|
|
86468
|
+
};
|
|
86464
86469
|
CoveoInsightClient.prototype.logCustomEvent = function (event, metadata) {
|
|
86465
86470
|
return __awaiter(this, void 0, void 0, function () {
|
|
86466
86471
|
var customData, payload, _a;
|
package/dist/library.es.js
CHANGED
|
@@ -603,7 +603,7 @@ function sha1(bytes) {
|
|
|
603
603
|
const v5 = v35('v5', 0x50, sha1);
|
|
604
604
|
var uuidv5 = v5;
|
|
605
605
|
|
|
606
|
-
const libVersion = "2.30.
|
|
606
|
+
const libVersion = "2.30.52";
|
|
607
607
|
|
|
608
608
|
const getFormattedLocation = (location) => `${location.protocol}//${location.hostname}${location.pathname.indexOf('/') === 0 ? location.pathname : `/${location.pathname}`}${location.search}`;
|
|
609
609
|
|
|
@@ -1833,6 +1833,7 @@ var SearchPageEvents;
|
|
|
1833
1833
|
SearchPageEvents["rephraseGeneratedAnswer"] = "rephraseGeneratedAnswer";
|
|
1834
1834
|
SearchPageEvents["generatedAnswerFeedbackSubmitV2"] = "generatedAnswerFeedbackSubmitV2";
|
|
1835
1835
|
SearchPageEvents["generatedAnswerCitationClick"] = "generatedAnswerCitationClick";
|
|
1836
|
+
SearchPageEvents["generatedAnswerCitationDocumentAttach"] = "generatedAnswerCitationDocumentAttach";
|
|
1836
1837
|
})(SearchPageEvents || (SearchPageEvents = {}));
|
|
1837
1838
|
const CustomEventsTypes = {
|
|
1838
1839
|
[SearchPageEvents.triggerNotify]: 'queryPipelineTriggers',
|
|
@@ -3241,8 +3242,9 @@ class CoveoInsightClient {
|
|
|
3241
3242
|
};
|
|
3242
3243
|
return this.logClickEvent(SearchPageEvents.caseAttach, info, identifier, caseMetadata ? Object.assign(Object.assign({}, generateMetadataToSend(caseMetadata, false)), metadata) : metadata);
|
|
3243
3244
|
}
|
|
3244
|
-
logCaseDetach(resultUriHash, metadata) {
|
|
3245
|
-
|
|
3245
|
+
logCaseDetach(resultUriHash, metadata, permanentId) {
|
|
3246
|
+
const generatedMetadata = Object.assign(Object.assign(Object.assign({}, (metadata && generateMetadataToSend(metadata, false))), (permanentId && { permanentId })), { resultUriHash });
|
|
3247
|
+
return this.logCustomEvent(SearchPageEvents.caseDetach, generatedMetadata);
|
|
3246
3248
|
}
|
|
3247
3249
|
logLikeSmartSnippet(metadata) {
|
|
3248
3250
|
return this.logCustomEvent(SearchPageEvents.likeSmartSnippet, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
@@ -3346,6 +3348,9 @@ class CoveoInsightClient {
|
|
|
3346
3348
|
return this.logCustomEvent(SearchPageEvents.generatedAnswerStreamEnd, metadata
|
|
3347
3349
|
? Object.assign(Object.assign({}, generateMetadataToSend(metadata, false)), generatedAnswerStreamEndMetadata) : generatedAnswerStreamEndMetadata);
|
|
3348
3350
|
}
|
|
3351
|
+
logGeneratedAnswerCitationDocumentAttach(info, citation, metadata) {
|
|
3352
|
+
return this.logClickEvent(SearchPageEvents.generatedAnswerCitationDocumentAttach, Object.assign(Object.assign({}, info), { documentPosition: 1 }), { contentIDKey: citation.documentId.contentIdKey, contentIDValue: citation.documentId.contentIdValue }, metadata ? Object.assign(Object.assign({}, generateMetadataToSend(metadata, false)), citation) : citation);
|
|
3353
|
+
}
|
|
3349
3354
|
logCustomEvent(event, metadata) {
|
|
3350
3355
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3351
3356
|
const customData = Object.assign(Object.assign({}, this.provider.getBaseMetadata()), metadata);
|
package/dist/library.js
CHANGED
|
@@ -736,7 +736,7 @@ function sha1(bytes) {
|
|
|
736
736
|
const v5 = v35('v5', 0x50, sha1);
|
|
737
737
|
var uuidv5 = v5;
|
|
738
738
|
|
|
739
|
-
var libVersion = "2.30.
|
|
739
|
+
var libVersion = "2.30.52";
|
|
740
740
|
|
|
741
741
|
var getFormattedLocation = function (location) {
|
|
742
742
|
return "".concat(location.protocol, "//").concat(location.hostname).concat(location.pathname.indexOf('/') === 0 ? location.pathname : "/".concat(location.pathname)).concat(location.search);
|
|
@@ -84436,6 +84436,7 @@ exports.SearchPageEvents = void 0;
|
|
|
84436
84436
|
SearchPageEvents["rephraseGeneratedAnswer"] = "rephraseGeneratedAnswer";
|
|
84437
84437
|
SearchPageEvents["generatedAnswerFeedbackSubmitV2"] = "generatedAnswerFeedbackSubmitV2";
|
|
84438
84438
|
SearchPageEvents["generatedAnswerCitationClick"] = "generatedAnswerCitationClick";
|
|
84439
|
+
SearchPageEvents["generatedAnswerCitationDocumentAttach"] = "generatedAnswerCitationDocumentAttach";
|
|
84439
84440
|
})(exports.SearchPageEvents || (exports.SearchPageEvents = {}));
|
|
84440
84441
|
var CustomEventsTypes = (_a = {},
|
|
84441
84442
|
_a[exports.SearchPageEvents.triggerNotify] = 'queryPipelineTriggers',
|
|
@@ -86356,8 +86357,9 @@ var CoveoInsightClient = (function () {
|
|
|
86356
86357
|
};
|
|
86357
86358
|
return this.logClickEvent(exports.SearchPageEvents.caseAttach, info, identifier, caseMetadata ? __assign(__assign({}, generateMetadataToSend(caseMetadata, false)), metadata) : metadata);
|
|
86358
86359
|
};
|
|
86359
|
-
CoveoInsightClient.prototype.logCaseDetach = function (resultUriHash, metadata) {
|
|
86360
|
-
|
|
86360
|
+
CoveoInsightClient.prototype.logCaseDetach = function (resultUriHash, metadata, permanentId) {
|
|
86361
|
+
var generatedMetadata = __assign(__assign(__assign({}, (metadata && generateMetadataToSend(metadata, false))), (permanentId && { permanentId: permanentId })), { resultUriHash: resultUriHash });
|
|
86362
|
+
return this.logCustomEvent(exports.SearchPageEvents.caseDetach, generatedMetadata);
|
|
86361
86363
|
};
|
|
86362
86364
|
CoveoInsightClient.prototype.logLikeSmartSnippet = function (metadata) {
|
|
86363
86365
|
return this.logCustomEvent(exports.SearchPageEvents.likeSmartSnippet, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
@@ -86461,6 +86463,9 @@ var CoveoInsightClient = (function () {
|
|
|
86461
86463
|
return this.logCustomEvent(exports.SearchPageEvents.generatedAnswerStreamEnd, metadata
|
|
86462
86464
|
? __assign(__assign({}, generateMetadataToSend(metadata, false)), generatedAnswerStreamEndMetadata) : generatedAnswerStreamEndMetadata);
|
|
86463
86465
|
};
|
|
86466
|
+
CoveoInsightClient.prototype.logGeneratedAnswerCitationDocumentAttach = function (info, citation, metadata) {
|
|
86467
|
+
return this.logClickEvent(exports.SearchPageEvents.generatedAnswerCitationDocumentAttach, __assign(__assign({}, info), { documentPosition: 1 }), { contentIDKey: citation.documentId.contentIdKey, contentIDValue: citation.documentId.contentIdValue }, metadata ? __assign(__assign({}, generateMetadataToSend(metadata, false)), citation) : citation);
|
|
86468
|
+
};
|
|
86464
86469
|
CoveoInsightClient.prototype.logCustomEvent = function (event, metadata) {
|
|
86465
86470
|
return __awaiter(this, void 0, void 0, function () {
|
|
86466
86471
|
var customData, payload, _a;
|
package/dist/library.mjs
CHANGED
|
@@ -734,7 +734,7 @@ function sha1(bytes) {
|
|
|
734
734
|
const v5 = v35('v5', 0x50, sha1);
|
|
735
735
|
var uuidv5 = v5;
|
|
736
736
|
|
|
737
|
-
var libVersion = "2.30.
|
|
737
|
+
var libVersion = "2.30.52";
|
|
738
738
|
|
|
739
739
|
var getFormattedLocation = function (location) {
|
|
740
740
|
return "".concat(location.protocol, "//").concat(location.hostname).concat(location.pathname.indexOf('/') === 0 ? location.pathname : "/".concat(location.pathname)).concat(location.search);
|
|
@@ -84434,6 +84434,7 @@ var SearchPageEvents;
|
|
|
84434
84434
|
SearchPageEvents["rephraseGeneratedAnswer"] = "rephraseGeneratedAnswer";
|
|
84435
84435
|
SearchPageEvents["generatedAnswerFeedbackSubmitV2"] = "generatedAnswerFeedbackSubmitV2";
|
|
84436
84436
|
SearchPageEvents["generatedAnswerCitationClick"] = "generatedAnswerCitationClick";
|
|
84437
|
+
SearchPageEvents["generatedAnswerCitationDocumentAttach"] = "generatedAnswerCitationDocumentAttach";
|
|
84437
84438
|
})(SearchPageEvents || (SearchPageEvents = {}));
|
|
84438
84439
|
var CustomEventsTypes = (_a = {},
|
|
84439
84440
|
_a[SearchPageEvents.triggerNotify] = 'queryPipelineTriggers',
|
|
@@ -86354,8 +86355,9 @@ var CoveoInsightClient = (function () {
|
|
|
86354
86355
|
};
|
|
86355
86356
|
return this.logClickEvent(SearchPageEvents.caseAttach, info, identifier, caseMetadata ? __assign(__assign({}, generateMetadataToSend(caseMetadata, false)), metadata) : metadata);
|
|
86356
86357
|
};
|
|
86357
|
-
CoveoInsightClient.prototype.logCaseDetach = function (resultUriHash, metadata) {
|
|
86358
|
-
|
|
86358
|
+
CoveoInsightClient.prototype.logCaseDetach = function (resultUriHash, metadata, permanentId) {
|
|
86359
|
+
var generatedMetadata = __assign(__assign(__assign({}, (metadata && generateMetadataToSend(metadata, false))), (permanentId && { permanentId: permanentId })), { resultUriHash: resultUriHash });
|
|
86360
|
+
return this.logCustomEvent(SearchPageEvents.caseDetach, generatedMetadata);
|
|
86359
86361
|
};
|
|
86360
86362
|
CoveoInsightClient.prototype.logLikeSmartSnippet = function (metadata) {
|
|
86361
86363
|
return this.logCustomEvent(SearchPageEvents.likeSmartSnippet, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
@@ -86459,6 +86461,9 @@ var CoveoInsightClient = (function () {
|
|
|
86459
86461
|
return this.logCustomEvent(SearchPageEvents.generatedAnswerStreamEnd, metadata
|
|
86460
86462
|
? __assign(__assign({}, generateMetadataToSend(metadata, false)), generatedAnswerStreamEndMetadata) : generatedAnswerStreamEndMetadata);
|
|
86461
86463
|
};
|
|
86464
|
+
CoveoInsightClient.prototype.logGeneratedAnswerCitationDocumentAttach = function (info, citation, metadata) {
|
|
86465
|
+
return this.logClickEvent(SearchPageEvents.generatedAnswerCitationDocumentAttach, __assign(__assign({}, info), { documentPosition: 1 }), { contentIDKey: citation.documentId.contentIdKey, contentIDValue: citation.documentId.contentIdValue }, metadata ? __assign(__assign({}, generateMetadataToSend(metadata, false)), citation) : citation);
|
|
86466
|
+
};
|
|
86462
86467
|
CoveoInsightClient.prototype.logCustomEvent = function (event, metadata) {
|
|
86463
86468
|
return __awaiter(this, void 0, void 0, function () {
|
|
86464
86469
|
var customData, payload, _a;
|
package/dist/react-native.es.js
CHANGED
|
@@ -672,7 +672,7 @@ const addPageViewToHistory = (pageViewValue) => __awaiter(void 0, void 0, void 0
|
|
|
672
672
|
yield store.addElementAsync(historyElement);
|
|
673
673
|
});
|
|
674
674
|
|
|
675
|
-
const libVersion = "2.30.
|
|
675
|
+
const libVersion = "2.30.52";
|
|
676
676
|
|
|
677
677
|
const getFormattedLocation = (location) => `${location.protocol}//${location.hostname}${location.pathname.indexOf('/') === 0 ? location.pathname : `/${location.pathname}`}${location.search}`;
|
|
678
678
|
|
|
@@ -1854,6 +1854,7 @@ var SearchPageEvents;
|
|
|
1854
1854
|
SearchPageEvents["rephraseGeneratedAnswer"] = "rephraseGeneratedAnswer";
|
|
1855
1855
|
SearchPageEvents["generatedAnswerFeedbackSubmitV2"] = "generatedAnswerFeedbackSubmitV2";
|
|
1856
1856
|
SearchPageEvents["generatedAnswerCitationClick"] = "generatedAnswerCitationClick";
|
|
1857
|
+
SearchPageEvents["generatedAnswerCitationDocumentAttach"] = "generatedAnswerCitationDocumentAttach";
|
|
1857
1858
|
})(SearchPageEvents || (SearchPageEvents = {}));
|
|
1858
1859
|
const CustomEventsTypes = {
|
|
1859
1860
|
[SearchPageEvents.triggerNotify]: 'queryPipelineTriggers',
|
|
@@ -3262,8 +3263,9 @@ class CoveoInsightClient {
|
|
|
3262
3263
|
};
|
|
3263
3264
|
return this.logClickEvent(SearchPageEvents.caseAttach, info, identifier, caseMetadata ? Object.assign(Object.assign({}, generateMetadataToSend(caseMetadata, false)), metadata) : metadata);
|
|
3264
3265
|
}
|
|
3265
|
-
logCaseDetach(resultUriHash, metadata) {
|
|
3266
|
-
|
|
3266
|
+
logCaseDetach(resultUriHash, metadata, permanentId) {
|
|
3267
|
+
const generatedMetadata = Object.assign(Object.assign(Object.assign({}, (metadata && generateMetadataToSend(metadata, false))), (permanentId && { permanentId })), { resultUriHash });
|
|
3268
|
+
return this.logCustomEvent(SearchPageEvents.caseDetach, generatedMetadata);
|
|
3267
3269
|
}
|
|
3268
3270
|
logLikeSmartSnippet(metadata) {
|
|
3269
3271
|
return this.logCustomEvent(SearchPageEvents.likeSmartSnippet, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
@@ -3367,6 +3369,9 @@ class CoveoInsightClient {
|
|
|
3367
3369
|
return this.logCustomEvent(SearchPageEvents.generatedAnswerStreamEnd, metadata
|
|
3368
3370
|
? Object.assign(Object.assign({}, generateMetadataToSend(metadata, false)), generatedAnswerStreamEndMetadata) : generatedAnswerStreamEndMetadata);
|
|
3369
3371
|
}
|
|
3372
|
+
logGeneratedAnswerCitationDocumentAttach(info, citation, metadata) {
|
|
3373
|
+
return this.logClickEvent(SearchPageEvents.generatedAnswerCitationDocumentAttach, Object.assign(Object.assign({}, info), { documentPosition: 1 }), { contentIDKey: citation.documentId.contentIdKey, contentIDValue: citation.documentId.contentIdValue }, metadata ? Object.assign(Object.assign({}, generateMetadataToSend(metadata, false)), citation) : citation);
|
|
3374
|
+
}
|
|
3370
3375
|
logCustomEvent(event, metadata) {
|
|
3371
3376
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3372
3377
|
const customData = Object.assign(Object.assign({}, this.provider.getBaseMetadata()), metadata);
|
package/package.json
CHANGED
|
@@ -383,10 +383,13 @@ describe('InsightClient', () => {
|
|
|
383
383
|
});
|
|
384
384
|
|
|
385
385
|
it('should send proper payload for #caseDetach', async () => {
|
|
386
|
+
const mockResultUriHash = fakeDocInfo.documentUriHash;
|
|
387
|
+
const mockPermanentId = fakeDocID.contentIDValue;
|
|
386
388
|
const expectedMetadata = {
|
|
387
|
-
resultUriHash:
|
|
389
|
+
resultUriHash: mockResultUriHash,
|
|
390
|
+
permanentId: mockPermanentId,
|
|
388
391
|
};
|
|
389
|
-
await client.logCaseDetach(
|
|
392
|
+
await client.logCaseDetach(mockResultUriHash, undefined, mockPermanentId);
|
|
390
393
|
expectMatchCustomEventPayload(SearchPageEvents.caseDetach, expectedMetadata);
|
|
391
394
|
});
|
|
392
395
|
|
|
@@ -671,6 +674,27 @@ describe('InsightClient', () => {
|
|
|
671
674
|
expectMatchCustomEventPayload(SearchPageEvents.generatedAnswerStreamEnd, exampleGeneratedAnswerMetadata);
|
|
672
675
|
});
|
|
673
676
|
|
|
677
|
+
it('should send proper payload for #generatedAnswerCitationDocumentAttach', async () => {
|
|
678
|
+
const meta = {
|
|
679
|
+
generativeQuestionAnsweringId: '123',
|
|
680
|
+
citationId: 'bar',
|
|
681
|
+
documentId: {contentIdKey: 'permanentid', contentIdValue: 'foo'},
|
|
682
|
+
};
|
|
683
|
+
|
|
684
|
+
const expectedMetadata = {
|
|
685
|
+
...meta,
|
|
686
|
+
contentIDKey: meta.documentId.contentIdKey,
|
|
687
|
+
contentIDValue: meta.documentId.contentIdValue,
|
|
688
|
+
};
|
|
689
|
+
|
|
690
|
+
await client.logGeneratedAnswerCitationDocumentAttach(fakeDocInfo, meta);
|
|
691
|
+
expectMatchDocumentPayload(
|
|
692
|
+
SearchPageEvents.generatedAnswerCitationDocumentAttach,
|
|
693
|
+
fakeDocInfo,
|
|
694
|
+
expectedMetadata,
|
|
695
|
+
);
|
|
696
|
+
});
|
|
697
|
+
|
|
674
698
|
it('should send proper payload for #createArticle', async () => {
|
|
675
699
|
const exampleCreateArticleMetadata = {
|
|
676
700
|
articleType: 'Knowledge__kav',
|
|
@@ -1173,12 +1197,15 @@ describe('InsightClient', () => {
|
|
|
1173
1197
|
|
|
1174
1198
|
it('should send proper payload for #caseDetach', async () => {
|
|
1175
1199
|
const metadata = baseCaseMetadata;
|
|
1200
|
+
const mockResultUriHash = fakeDocInfo.documentUriHash;
|
|
1201
|
+
const mockPermanentId = fakeDocID.contentIDValue;
|
|
1176
1202
|
|
|
1177
1203
|
const expectedMetadata = {
|
|
1178
1204
|
...expectedBaseCaseMetadata,
|
|
1179
|
-
resultUriHash:
|
|
1205
|
+
resultUriHash: mockResultUriHash,
|
|
1206
|
+
permanentId: mockPermanentId,
|
|
1180
1207
|
};
|
|
1181
|
-
await client.logCaseDetach(
|
|
1208
|
+
await client.logCaseDetach(mockResultUriHash, metadata, mockPermanentId);
|
|
1182
1209
|
expectMatchCustomEventPayload(SearchPageEvents.caseDetach, expectedMetadata);
|
|
1183
1210
|
});
|
|
1184
1211
|
|
|
@@ -1553,6 +1580,28 @@ describe('InsightClient', () => {
|
|
|
1553
1580
|
expectMatchCustomEventPayload(SearchPageEvents.generatedAnswerStreamEnd, expectedMetadata);
|
|
1554
1581
|
});
|
|
1555
1582
|
|
|
1583
|
+
it('should send proper payload for #generatedAnswerCitationDocumentAttach', async () => {
|
|
1584
|
+
const meta = {
|
|
1585
|
+
generativeQuestionAnsweringId: '123',
|
|
1586
|
+
citationId: 'bar',
|
|
1587
|
+
documentId: {contentIdKey: 'permanentid', contentIdValue: 'foo'},
|
|
1588
|
+
};
|
|
1589
|
+
|
|
1590
|
+
const expectedMetadata = {
|
|
1591
|
+
...meta,
|
|
1592
|
+
...expectedBaseCaseMetadata,
|
|
1593
|
+
contentIDKey: meta.documentId.contentIdKey,
|
|
1594
|
+
contentIDValue: meta.documentId.contentIdValue,
|
|
1595
|
+
};
|
|
1596
|
+
|
|
1597
|
+
await client.logGeneratedAnswerCitationDocumentAttach(fakeDocInfo, meta, baseCaseMetadata);
|
|
1598
|
+
expectMatchDocumentPayload(
|
|
1599
|
+
SearchPageEvents.generatedAnswerCitationDocumentAttach,
|
|
1600
|
+
fakeDocInfo,
|
|
1601
|
+
expectedMetadata,
|
|
1602
|
+
);
|
|
1603
|
+
});
|
|
1604
|
+
|
|
1556
1605
|
it('should send proper payload for #createArticle', async () => {
|
|
1557
1606
|
const exampleCreateArticleMetadata = {
|
|
1558
1607
|
articleType: 'Knowledge__kav',
|
|
@@ -373,11 +373,13 @@ export class CoveoInsightClient {
|
|
|
373
373
|
);
|
|
374
374
|
}
|
|
375
375
|
|
|
376
|
-
public logCaseDetach(resultUriHash: string, metadata?: CaseMetadata) {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
376
|
+
public logCaseDetach(resultUriHash: string, metadata?: CaseMetadata, permanentId?: string) {
|
|
377
|
+
const generatedMetadata = {
|
|
378
|
+
...(metadata && generateMetadataToSend(metadata, false)),
|
|
379
|
+
...(permanentId && {permanentId}),
|
|
380
|
+
resultUriHash,
|
|
381
|
+
};
|
|
382
|
+
return this.logCustomEvent(SearchPageEvents.caseDetach, generatedMetadata);
|
|
381
383
|
}
|
|
382
384
|
|
|
383
385
|
public logLikeSmartSnippet(metadata?: CaseMetadata) {
|
|
@@ -668,6 +670,19 @@ export class CoveoInsightClient {
|
|
|
668
670
|
);
|
|
669
671
|
}
|
|
670
672
|
|
|
673
|
+
public logGeneratedAnswerCitationDocumentAttach(
|
|
674
|
+
info: PartialDocumentInformation,
|
|
675
|
+
citation: GeneratedAnswerCitationClickMeta,
|
|
676
|
+
metadata?: CaseMetadata,
|
|
677
|
+
) {
|
|
678
|
+
return this.logClickEvent(
|
|
679
|
+
SearchPageEvents.generatedAnswerCitationDocumentAttach,
|
|
680
|
+
{...info, documentPosition: 1},
|
|
681
|
+
{contentIDKey: citation.documentId.contentIdKey, contentIDValue: citation.documentId.contentIdValue},
|
|
682
|
+
metadata ? {...generateMetadataToSend(metadata, false), ...citation} : citation,
|
|
683
|
+
);
|
|
684
|
+
}
|
|
685
|
+
|
|
671
686
|
public async logCustomEvent(event: SearchPageEvents | InsightEvents, metadata?: Record<string, any>) {
|
|
672
687
|
const customData = {...this.provider.getBaseMetadata(), ...metadata};
|
|
673
688
|
|
|
@@ -354,6 +354,10 @@ export enum SearchPageEvents {
|
|
|
354
354
|
* Identifies the click event that gets logged when the user clicks on a generated answer citation.
|
|
355
355
|
*/
|
|
356
356
|
generatedAnswerCitationClick = 'generatedAnswerCitationClick',
|
|
357
|
+
/**
|
|
358
|
+
* Identifies the click event that gets logged when a user clicks the Attach Citation action.
|
|
359
|
+
*/
|
|
360
|
+
generatedAnswerCitationDocumentAttach = 'generatedAnswerCitationDocumentAttach',
|
|
357
361
|
}
|
|
358
362
|
|
|
359
363
|
export const CustomEventsTypes: Partial<Record<SearchPageEvents | InsightEvents, string>> = {
|