coveo.analytics 2.30.43 → 2.30.45

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.
@@ -728,7 +728,7 @@
728
728
  const v5 = v35('v5', 0x50, sha1);
729
729
  var uuidv5 = v5;
730
730
 
731
- var libVersion = "2.30.43" ;
731
+ var libVersion = "2.30.45" ;
732
732
 
733
733
  var getFormattedLocation = function (location) {
734
734
  return "".concat(location.protocol, "//").concat(location.hostname).concat(location.pathname.indexOf('/') === 0 ? location.pathname : "/".concat(location.pathname)).concat(location.search);
@@ -4392,7 +4392,8 @@
4392
4392
  CaseAssistActions["enterInterface"] = "ticket_create_start";
4393
4393
  CaseAssistActions["fieldUpdate"] = "ticket_field_update";
4394
4394
  CaseAssistActions["fieldSuggestionClick"] = "ticket_classification_click";
4395
- CaseAssistActions["suggestionClick"] = "suggestion_click";
4395
+ CaseAssistActions["documentSuggestionClick"] = "documentSuggestionClick";
4396
+ CaseAssistActions["documentSuggestionQuickview"] = "documentSuggestionQuickview";
4396
4397
  CaseAssistActions["suggestionRate"] = "suggestion_rate";
4397
4398
  CaseAssistActions["nextCaseStep"] = "ticket_next_stage";
4398
4399
  CaseAssistActions["caseCancelled"] = "ticket_cancel";
@@ -4440,9 +4441,16 @@
4440
4441
  return this.sendClickEvent();
4441
4442
  };
4442
4443
  CaseAssistClient.prototype.logSelectDocumentSuggestion = function (meta) {
4443
- this.svc.setAction(CaseAssistActions.suggestionClick, meta.suggestion);
4444
- this.svc.setTicket(meta.ticket);
4445
- return this.sendClickEvent();
4444
+ return this.logClickEvent(CaseAssistActions.documentSuggestionClick, meta.suggestion.suggestion, {
4445
+ contentIDKey: 'permanentId',
4446
+ contentIDValue: meta.suggestion.permanentId,
4447
+ });
4448
+ };
4449
+ CaseAssistClient.prototype.logQuickviewDocumentSuggestion = function (meta) {
4450
+ return this.logClickEvent(CaseAssistActions.documentSuggestionQuickview, meta.suggestion.suggestion, {
4451
+ contentIDKey: 'permanentId',
4452
+ contentIDValue: meta.suggestion.permanentId,
4453
+ });
4446
4454
  };
4447
4455
  CaseAssistClient.prototype.logRateDocumentSuggestion = function (meta) {
4448
4456
  this.svc.setAction(CaseAssistActions.suggestionRate, __assign({ rate: meta.rating }, meta.suggestion));
@@ -4489,6 +4497,53 @@
4489
4497
  }
4490
4498
  : null);
4491
4499
  };
4500
+ CaseAssistClient.prototype.getBaseEventRequest = function (metadata) {
4501
+ var _a, _b;
4502
+ return __awaiter(this, void 0, void 0, function () {
4503
+ var customData, _c;
4504
+ var _d;
4505
+ return __generator(this, function (_e) {
4506
+ switch (_e.label) {
4507
+ case 0:
4508
+ customData = __assign({}, metadata);
4509
+ _c = [__assign({}, this.getOrigins())];
4510
+ _d = { customData: customData, language: (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getLanguage(), anonymous: (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getIsAnonymous() };
4511
+ return [4, this.getClientId()];
4512
+ case 1: return [2, __assign.apply(void 0, _c.concat([(_d.clientId = _e.sent(), _d)]))];
4513
+ }
4514
+ });
4515
+ });
4516
+ };
4517
+ CaseAssistClient.prototype.getClientId = function () {
4518
+ return this.coveoAnalyticsClient instanceof CoveoAnalyticsClient
4519
+ ? this.coveoAnalyticsClient.getCurrentVisitorId()
4520
+ : undefined;
4521
+ };
4522
+ CaseAssistClient.prototype.getOrigins = function () {
4523
+ var _a, _b, _c, _d, _e;
4524
+ return {
4525
+ originContext: (_b = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getOriginContext) === null || _b === void 0 ? void 0 : _b.call(_a),
4526
+ originLevel1: (_c = this.provider) === null || _c === void 0 ? void 0 : _c.getOriginLevel1(),
4527
+ originLevel2: (_d = this.provider) === null || _d === void 0 ? void 0 : _d.getOriginLevel2(),
4528
+ originLevel3: (_e = this.provider) === null || _e === void 0 ? void 0 : _e.getOriginLevel3(),
4529
+ };
4530
+ };
4531
+ CaseAssistClient.prototype.logClickEvent = function (event, info, identifier, metadata) {
4532
+ var _a, _b;
4533
+ return __awaiter(this, void 0, void 0, function () {
4534
+ var payload, _c;
4535
+ return __generator(this, function (_d) {
4536
+ switch (_d.label) {
4537
+ case 0:
4538
+ _c = [__assign({}, info)];
4539
+ return [4, this.getBaseEventRequest(__assign(__assign({}, identifier), metadata))];
4540
+ case 1:
4541
+ payload = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_d.sent())])), { searchQueryUid: (_b = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSearchUID()) !== null && _b !== void 0 ? _b : '', actionCause: event }]);
4542
+ return [2, this.coveoAnalyticsClient.sendClickEvent(payload)];
4543
+ }
4544
+ });
4545
+ });
4546
+ };
4492
4547
  return CaseAssistClient;
4493
4548
  }());
4494
4549