coveo.analytics 2.30.52 → 2.30.54
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 +1 -1
- package/dist/coveoua.browser.js +1 -1
- package/dist/coveoua.browser.js.map +1 -1
- package/dist/coveoua.debug.js +1 -1
- package/dist/coveoua.debug.js.map +1 -1
- package/dist/coveoua.js +1 -1
- package/dist/coveoua.js.map +1 -1
- package/dist/definitions/events.d.ts +1 -0
- package/dist/definitions/searchPage/searchPageEvents.d.ts +8 -1
- package/dist/definitions/version.d.ts +1 -1
- package/dist/library.cjs +1 -1
- package/dist/library.es.js +1 -1
- package/dist/library.js +1 -1
- package/dist/library.mjs +1 -1
- package/dist/react-native.es.js +1 -1
- package/package.json +1 -1
- package/src/events.ts +1 -0
- package/src/insight/insightClient.spec.ts +1 -0
- package/src/searchPage/searchPageClient.spec.ts +88 -0
- package/src/searchPage/searchPageEvents.ts +12 -1
|
@@ -199,12 +199,19 @@ export type PartialDocumentInformation = Omit<DocumentInformation, 'actionCause'
|
|
|
199
199
|
interface AnswerGeneratedWithAnswerAPI {
|
|
200
200
|
answerAPIStreamId: string;
|
|
201
201
|
generativeQuestionAnsweringId?: never;
|
|
202
|
+
conversationId?: never;
|
|
202
203
|
}
|
|
203
204
|
interface AnswerGeneratedWithSearchAPI {
|
|
204
205
|
answerAPIStreamId?: never;
|
|
205
206
|
generativeQuestionAnsweringId: string;
|
|
207
|
+
conversationId?: never;
|
|
206
208
|
}
|
|
207
|
-
|
|
209
|
+
interface AnswerGeneratedWithAgent {
|
|
210
|
+
answerAPIStreamId?: never;
|
|
211
|
+
generativeQuestionAnsweringId: string;
|
|
212
|
+
conversationId: string;
|
|
213
|
+
}
|
|
214
|
+
export type GeneratedAnswerBaseMeta = AnswerGeneratedWithAnswerAPI | AnswerGeneratedWithSearchAPI | AnswerGeneratedWithAgent;
|
|
208
215
|
export type GeneratedAnswerStreamEndMeta = GeneratedAnswerBaseMeta & {
|
|
209
216
|
answerGenerated: boolean;
|
|
210
217
|
answerTextIsEmpty?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const libVersion = "2.30.
|
|
1
|
+
export declare const libVersion = "2.30.54";
|
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.54";
|
|
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);
|
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.54";
|
|
607
607
|
|
|
608
608
|
const getFormattedLocation = (location) => `${location.protocol}//${location.hostname}${location.pathname.indexOf('/') === 0 ? location.pathname : `/${location.pathname}`}${location.search}`;
|
|
609
609
|
|
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.54";
|
|
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);
|
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.54";
|
|
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);
|
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.54";
|
|
676
676
|
|
|
677
677
|
const getFormattedLocation = (location) => `${location.protocol}//${location.hostname}${location.pathname.indexOf('/') === 0 ? location.pathname : `/${location.pathname}`}${location.search}`;
|
|
678
678
|
|
package/package.json
CHANGED
package/src/events.ts
CHANGED
|
@@ -26,6 +26,7 @@ const {fetchMock, fetchMockBeforeEach} = mockFetch();
|
|
|
26
26
|
describe('SearchPageClient', () => {
|
|
27
27
|
const fakeDocInfo = {
|
|
28
28
|
collectionName: 'collection',
|
|
29
|
+
documentCategory: 'category',
|
|
29
30
|
documentAuthor: 'author',
|
|
30
31
|
documentPosition: 1,
|
|
31
32
|
documentTitle: 'title',
|
|
@@ -57,6 +58,7 @@ describe('SearchPageClient', () => {
|
|
|
57
58
|
];
|
|
58
59
|
|
|
59
60
|
const fakeStreamId = 'some-stream-id-123';
|
|
61
|
+
const fakeConversationId = 'some-conversation-id-123';
|
|
60
62
|
|
|
61
63
|
let client: CoveoSearchPageClient;
|
|
62
64
|
|
|
@@ -1450,6 +1452,12 @@ describe('SearchPageClient', () => {
|
|
|
1450
1452
|
expectMatchCustomEventPayload(SearchPageEvents.likeGeneratedAnswer, meta);
|
|
1451
1453
|
});
|
|
1452
1454
|
|
|
1455
|
+
it('should send proper payload for #logLikeGeneratedAnswer with agent metadata', async () => {
|
|
1456
|
+
const meta = {generativeQuestionAnsweringId: fakeStreamId, conversationId: fakeConversationId};
|
|
1457
|
+
await client.logLikeGeneratedAnswer(meta);
|
|
1458
|
+
expectMatchCustomEventPayload(SearchPageEvents.likeGeneratedAnswer, meta);
|
|
1459
|
+
});
|
|
1460
|
+
|
|
1453
1461
|
it('should send proper payload for #makeLikeGeneratedAnswer', async () => {
|
|
1454
1462
|
const meta = {generativeQuestionAnsweringId: fakeStreamId};
|
|
1455
1463
|
const built = await client.makeLikeGeneratedAnswer(meta);
|
|
@@ -1464,6 +1472,12 @@ describe('SearchPageClient', () => {
|
|
|
1464
1472
|
expectMatchCustomEventPayload(SearchPageEvents.dislikeGeneratedAnswer, meta);
|
|
1465
1473
|
});
|
|
1466
1474
|
|
|
1475
|
+
it('should send proper payload for #logDislikeGeneratedAnswer with agent metadata', async () => {
|
|
1476
|
+
const meta = {generativeQuestionAnsweringId: fakeStreamId, conversationId: fakeConversationId};
|
|
1477
|
+
await client.logDislikeGeneratedAnswer(meta);
|
|
1478
|
+
expectMatchCustomEventPayload(SearchPageEvents.dislikeGeneratedAnswer, meta);
|
|
1479
|
+
});
|
|
1480
|
+
|
|
1467
1481
|
it('should send proper payload for #makeDislikeGeneratedAnswer', async () => {
|
|
1468
1482
|
const meta = {generativeQuestionAnsweringId: fakeStreamId};
|
|
1469
1483
|
const built = await client.makeDislikeGeneratedAnswer(meta);
|
|
@@ -1482,6 +1496,17 @@ describe('SearchPageClient', () => {
|
|
|
1482
1496
|
expectMatchCustomEventPayload(SearchPageEvents.openGeneratedAnswerSource, meta);
|
|
1483
1497
|
});
|
|
1484
1498
|
|
|
1499
|
+
it('should send proper payload for #logOpenGeneratedAnswerSource with agent metadata', async () => {
|
|
1500
|
+
const meta = {
|
|
1501
|
+
generativeQuestionAnsweringId: fakeStreamId,
|
|
1502
|
+
conversationId: fakeConversationId,
|
|
1503
|
+
citationId: 'some-document-id',
|
|
1504
|
+
permanentId: 'perm-id',
|
|
1505
|
+
};
|
|
1506
|
+
await client.logOpenGeneratedAnswerSource(meta);
|
|
1507
|
+
expectMatchCustomEventPayload(SearchPageEvents.openGeneratedAnswerSource, meta);
|
|
1508
|
+
});
|
|
1509
|
+
|
|
1485
1510
|
it('should send proper payload for #makeOpenGeneratedAnswerSource', async () => {
|
|
1486
1511
|
const meta = {
|
|
1487
1512
|
generativeQuestionAnsweringId: fakeStreamId,
|
|
@@ -1509,6 +1534,22 @@ describe('SearchPageClient', () => {
|
|
|
1509
1534
|
});
|
|
1510
1535
|
});
|
|
1511
1536
|
|
|
1537
|
+
it('should send proper payload for #logGeneratedAnswerCitationClick with agent metadata', async () => {
|
|
1538
|
+
const meta = {
|
|
1539
|
+
generativeQuestionAnsweringId: fakeStreamId,
|
|
1540
|
+
conversationId: fakeConversationId,
|
|
1541
|
+
citationId: 'some-document-id',
|
|
1542
|
+
documentId: {contentIdKey: 'permanentid', contentIdValue: 'foo'},
|
|
1543
|
+
};
|
|
1544
|
+
|
|
1545
|
+
await client.logGeneratedAnswerCitationClick(fakeDocInfo, meta);
|
|
1546
|
+
expectMatchDocumentPayload(SearchPageEvents.generatedAnswerCitationClick, fakeDocInfo, {
|
|
1547
|
+
...meta,
|
|
1548
|
+
contentIDKey: meta.documentId.contentIdKey,
|
|
1549
|
+
contentIDValue: meta.documentId.contentIdValue,
|
|
1550
|
+
});
|
|
1551
|
+
});
|
|
1552
|
+
|
|
1512
1553
|
it('should send proper payload for #makeGeneratedAnswerCitationClick', async () => {
|
|
1513
1554
|
const meta = {
|
|
1514
1555
|
generativeQuestionAnsweringId: fakeStreamId,
|
|
@@ -1529,6 +1570,17 @@ describe('SearchPageClient', () => {
|
|
|
1529
1570
|
expectMatchCustomEventPayload(SearchPageEvents.generatedAnswerStreamEnd, meta);
|
|
1530
1571
|
});
|
|
1531
1572
|
|
|
1573
|
+
it('should send proper payload for #logGeneratedAnswerStreamEnd with agent metadata', async () => {
|
|
1574
|
+
const meta = {
|
|
1575
|
+
generativeQuestionAnsweringId: fakeStreamId,
|
|
1576
|
+
conversationId: fakeConversationId,
|
|
1577
|
+
answerGenerated: true,
|
|
1578
|
+
answerTextIsEmpty: false,
|
|
1579
|
+
};
|
|
1580
|
+
await client.logGeneratedAnswerStreamEnd(meta);
|
|
1581
|
+
expectMatchCustomEventPayload(SearchPageEvents.generatedAnswerStreamEnd, meta);
|
|
1582
|
+
});
|
|
1583
|
+
|
|
1532
1584
|
it('should send proper payload for #makeGeneratedAnswerStreamEnd', async () => {
|
|
1533
1585
|
const meta = {generativeQuestionAnsweringId: fakeStreamId, answerGenerated: true, answerTextIsEmpty: false};
|
|
1534
1586
|
const built = await client.makeGeneratedAnswerStreamEnd(meta);
|
|
@@ -1548,6 +1600,18 @@ describe('SearchPageClient', () => {
|
|
|
1548
1600
|
expectMatchCustomEventPayload(SearchPageEvents.generatedAnswerSourceHover, meta);
|
|
1549
1601
|
});
|
|
1550
1602
|
|
|
1603
|
+
it('should send proper payload for #logGeneratedAnswerSourceHover with agent metadata', async () => {
|
|
1604
|
+
const meta = {
|
|
1605
|
+
generativeQuestionAnsweringId: fakeStreamId,
|
|
1606
|
+
conversationId: fakeConversationId,
|
|
1607
|
+
citationId: 'some-document-id',
|
|
1608
|
+
permanentId: 'perm-id',
|
|
1609
|
+
citationHoverTimeMs: 100,
|
|
1610
|
+
};
|
|
1611
|
+
await client.logGeneratedAnswerSourceHover(meta);
|
|
1612
|
+
expectMatchCustomEventPayload(SearchPageEvents.generatedAnswerSourceHover, meta);
|
|
1613
|
+
});
|
|
1614
|
+
|
|
1551
1615
|
it('should send proper payload for #makeGeneratedAnswerSourceHover', async () => {
|
|
1552
1616
|
const meta = {
|
|
1553
1617
|
generativeQuestionAnsweringId: fakeStreamId,
|
|
@@ -1567,6 +1631,12 @@ describe('SearchPageClient', () => {
|
|
|
1567
1631
|
expectMatchCustomEventPayload(SearchPageEvents.generatedAnswerCopyToClipboard, meta);
|
|
1568
1632
|
});
|
|
1569
1633
|
|
|
1634
|
+
it('should send proper payload for #logGeneratedAnswerCopyToClipboard with agent metadata', async () => {
|
|
1635
|
+
const meta = {generativeQuestionAnsweringId: fakeStreamId, conversationId: fakeConversationId};
|
|
1636
|
+
await client.logGeneratedAnswerCopyToClipboard(meta);
|
|
1637
|
+
expectMatchCustomEventPayload(SearchPageEvents.generatedAnswerCopyToClipboard, meta);
|
|
1638
|
+
});
|
|
1639
|
+
|
|
1570
1640
|
it('should send proper payload for #makeGeneratedAnswerCopyToClipboard', async () => {
|
|
1571
1641
|
const meta = {generativeQuestionAnsweringId: fakeStreamId};
|
|
1572
1642
|
const built = await client.makeGeneratedAnswerCopyToClipboard(meta);
|
|
@@ -1581,6 +1651,12 @@ describe('SearchPageClient', () => {
|
|
|
1581
1651
|
expectMatchCustomEventPayload(SearchPageEvents.generatedAnswerHideAnswers, meta);
|
|
1582
1652
|
});
|
|
1583
1653
|
|
|
1654
|
+
it('should send proper payload for #logGeneratedAnswerHideAnswers with agent metadata', async () => {
|
|
1655
|
+
const meta = {generativeQuestionAnsweringId: fakeStreamId, conversationId: fakeConversationId};
|
|
1656
|
+
await client.logGeneratedAnswerHideAnswers(meta);
|
|
1657
|
+
expectMatchCustomEventPayload(SearchPageEvents.generatedAnswerHideAnswers, meta);
|
|
1658
|
+
});
|
|
1659
|
+
|
|
1584
1660
|
it('should send proper payload for #makeGeneratedAnswerHideAnswers', async () => {
|
|
1585
1661
|
const meta = {generativeQuestionAnsweringId: fakeStreamId};
|
|
1586
1662
|
const built = await client.makeGeneratedAnswerHideAnswers(meta);
|
|
@@ -1595,6 +1671,12 @@ describe('SearchPageClient', () => {
|
|
|
1595
1671
|
expectMatchCustomEventPayload(SearchPageEvents.generatedAnswerShowAnswers, meta);
|
|
1596
1672
|
});
|
|
1597
1673
|
|
|
1674
|
+
it('should send proper payload for #logGeneratedAnswerShowAnswers with agent metadata', async () => {
|
|
1675
|
+
const meta = {generativeQuestionAnsweringId: fakeStreamId, conversationId: fakeConversationId};
|
|
1676
|
+
await client.logGeneratedAnswerShowAnswers(meta);
|
|
1677
|
+
expectMatchCustomEventPayload(SearchPageEvents.generatedAnswerShowAnswers, meta);
|
|
1678
|
+
});
|
|
1679
|
+
|
|
1598
1680
|
it('should send proper payload for #makeGeneratedAnswerShowAnswers', async () => {
|
|
1599
1681
|
const meta = {generativeQuestionAnsweringId: fakeStreamId};
|
|
1600
1682
|
const built = await client.makeGeneratedAnswerShowAnswers(meta);
|
|
@@ -1609,6 +1691,12 @@ describe('SearchPageClient', () => {
|
|
|
1609
1691
|
expectMatchCustomEventPayload(SearchPageEvents.generatedAnswerExpand, meta);
|
|
1610
1692
|
});
|
|
1611
1693
|
|
|
1694
|
+
it('should send proper payload for #logGeneratedAnswerExpand with agent metadata', async () => {
|
|
1695
|
+
const meta = {generativeQuestionAnsweringId: fakeStreamId, conversationId: fakeConversationId};
|
|
1696
|
+
await client.logGeneratedAnswerExpand(meta);
|
|
1697
|
+
expectMatchCustomEventPayload(SearchPageEvents.generatedAnswerExpand, meta);
|
|
1698
|
+
});
|
|
1699
|
+
|
|
1612
1700
|
it('should send proper payload for #makeGeneratedAnswerExpand', async () => {
|
|
1613
1701
|
const meta = {generativeQuestionAnsweringId: fakeStreamId};
|
|
1614
1702
|
const built = await client.makeGeneratedAnswerExpand(meta);
|
|
@@ -551,14 +551,25 @@ export type PartialDocumentInformation = Omit<DocumentInformation, 'actionCause'
|
|
|
551
551
|
interface AnswerGeneratedWithAnswerAPI {
|
|
552
552
|
answerAPIStreamId: string;
|
|
553
553
|
generativeQuestionAnsweringId?: never;
|
|
554
|
+
conversationId?: never;
|
|
554
555
|
}
|
|
555
556
|
|
|
556
557
|
interface AnswerGeneratedWithSearchAPI {
|
|
557
558
|
answerAPIStreamId?: never;
|
|
558
559
|
generativeQuestionAnsweringId: string;
|
|
560
|
+
conversationId?: never;
|
|
559
561
|
}
|
|
560
562
|
|
|
561
|
-
|
|
563
|
+
interface AnswerGeneratedWithAgent {
|
|
564
|
+
answerAPIStreamId?: never;
|
|
565
|
+
generativeQuestionAnsweringId: string;
|
|
566
|
+
conversationId: string;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
export type GeneratedAnswerBaseMeta =
|
|
570
|
+
| AnswerGeneratedWithAnswerAPI
|
|
571
|
+
| AnswerGeneratedWithSearchAPI
|
|
572
|
+
| AnswerGeneratedWithAgent;
|
|
562
573
|
|
|
563
574
|
export type GeneratedAnswerStreamEndMeta = GeneratedAnswerBaseMeta & {
|
|
564
575
|
answerGenerated: boolean;
|