@coveo/quantic 3.43.3 → 3.43.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.
Files changed (127) hide show
  1. package/force-app/main/default/classes/CaseAssistController.cls +18 -0
  2. package/force-app/main/default/classes/CaseAssistController.cls-meta.xml +5 -0
  3. package/force-app/main/default/classes/CaseAssistControllerTest.cls +15 -0
  4. package/force-app/main/default/classes/CaseAssistControllerTest.cls-meta.xml +5 -0
  5. package/force-app/main/default/classes/HeadlessControllerTest.cls +1 -1
  6. package/force-app/main/default/classes/InsightController.cls +4 -2
  7. package/force-app/main/default/classes/SampleCaseAssistTokenProvider.cls +19 -0
  8. package/force-app/main/default/classes/SampleCaseAssistTokenProvider.cls-meta.xml +5 -0
  9. package/force-app/main/default/classes/SampleCaseAssistTokenProviderTest.cls +15 -0
  10. package/force-app/main/default/classes/SampleCaseAssistTokenProviderTest.cls-meta.xml +5 -0
  11. package/force-app/main/default/classes/SampleInsightTokenProvider.cls +24 -0
  12. package/force-app/main/default/classes/SampleInsightTokenProvider.cls-meta.xml +5 -0
  13. package/force-app/main/default/classes/SampleInsightTokenProviderTest.cls +24 -0
  14. package/force-app/main/default/classes/SampleInsightTokenProviderTest.cls-meta.xml +5 -0
  15. package/force-app/main/default/classes/SampleTokenProvider.cls +2 -1
  16. package/force-app/main/default/classes/SampleTokenProviderTest.cls +1 -1
  17. package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/data.ts +130 -0
  18. package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/fixture.ts +25 -14
  19. package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/quanticBreadcrumbManager.e2e.ts +57 -16
  20. package/force-app/main/default/lwc/quanticCardContainer/quanticCardContainer.css +3 -4
  21. package/force-app/main/default/lwc/quanticCardContainer/quanticCardContainer.html +1 -1
  22. package/force-app/main/default/lwc/quanticCarousel/quanticCarousel.css +5 -5
  23. package/force-app/main/default/lwc/quanticCaseAssistInterface/quanticCaseAssistInterface.js +1 -1
  24. package/force-app/main/default/lwc/quanticCaseClassification/quanticCaseClassification.css +3 -3
  25. package/force-app/main/default/lwc/quanticCategoryFacet/quanticCategoryFacet.css +1 -1
  26. package/force-app/main/default/lwc/quanticCitation/quanticCitation.css +12 -11
  27. package/force-app/main/default/lwc/quanticDidYouMean/e2e/fixture.ts +6 -2
  28. package/force-app/main/default/lwc/quanticDocumentSuggestion/quanticDocumentSuggestion.css +2 -2
  29. package/force-app/main/default/lwc/quanticFacet/quanticFacet.css +1 -1
  30. package/force-app/main/default/lwc/quanticFacetManager/e2e/data.ts +59 -0
  31. package/force-app/main/default/lwc/quanticFacetManager/e2e/fixture.ts +26 -15
  32. package/force-app/main/default/lwc/quanticFacetManager/e2e/quanticFacetManager.e2e.ts +7 -7
  33. package/force-app/main/default/lwc/quanticFacetStyles/quanticFacetStyles.css +10 -10
  34. package/force-app/main/default/lwc/quanticFeedbackModalQna/templates/quanticFeedbackModalQna.css +1 -1
  35. package/force-app/main/default/lwc/quanticFoldedResultList/e2e/fixture.ts +6 -2
  36. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/agentData.ts +32 -1
  37. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/pageObject.ts +6 -0
  38. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/quanticGeneratedAnswerAgent.e2e.ts +66 -1
  39. package/force-app/main/default/lwc/quanticGeneratedAnswer/quanticGeneratedAnswer.css +1 -1
  40. package/force-app/main/default/lwc/quanticGeneratedAnswer/templates/generatedAnswer.css +3 -3
  41. package/force-app/main/default/lwc/quanticGeneratedAnswerBody/__tests__/quanticGeneratedAnswerBody.test.js +39 -0
  42. package/force-app/main/default/lwc/quanticGeneratedAnswerBody/quanticGeneratedAnswerBody.js +4 -1
  43. package/force-app/main/default/lwc/quanticGeneratedAnswerContent/templates/generatedMarkdownContent.css +21 -21
  44. package/force-app/main/default/lwc/quanticGeneratedAnswerContent/templates/generatedTextContent.css +2 -2
  45. package/force-app/main/default/lwc/quanticGeneratedAnswerFollowUpInput/quanticGeneratedAnswerFollowUpInput.css +9 -9
  46. package/force-app/main/default/lwc/quanticGeneratedAnswerStreamOfThought/quanticGeneratedAnswerStreamOfThought.css +2 -2
  47. package/force-app/main/default/lwc/quanticGeneratedAnswerThread/quanticGeneratedAnswerThread.css +8 -8
  48. package/force-app/main/default/lwc/quanticInsightSummary/quanticInsightSummary.css +2 -1
  49. package/force-app/main/default/lwc/quanticModal/quanticModal.css +3 -3
  50. package/force-app/main/default/lwc/quanticNotifications/e2e/fixture.ts +6 -2
  51. package/force-app/main/default/lwc/quanticNotifications/quanticNotifications.css +2 -2
  52. package/force-app/main/default/lwc/quanticPill/quanticPill.css +2 -2
  53. package/force-app/main/default/lwc/quanticPlaceholder/quanticPlaceholder.css +2 -6
  54. package/force-app/main/default/lwc/quanticPlaceholder/quanticPlaceholder.html +1 -1
  55. package/force-app/main/default/lwc/quanticRadioButtonsGroup/quanticRadioButtonsGroup.css +9 -9
  56. package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/fixture.ts +1 -0
  57. package/force-app/main/default/lwc/quanticRecentQueriesList/quanticRecentQueriesList.css +3 -7
  58. package/force-app/main/default/lwc/quanticRecentQueriesList/quanticRecentQueriesList.html +1 -1
  59. package/force-app/main/default/lwc/quanticRecentResultsList/e2e/fixture.ts +1 -0
  60. package/force-app/main/default/lwc/quanticRecentResultsList/quanticRecentResultsList.css +2 -6
  61. package/force-app/main/default/lwc/quanticRecentResultsList/quanticRecentResultsList.html +1 -1
  62. package/force-app/main/default/lwc/quanticRecommendationList/e2e/fixture.ts +1 -0
  63. package/force-app/main/default/lwc/quanticRecommendationList/quanticRecommendationList.css +1 -1
  64. package/force-app/main/default/lwc/quanticRefineToggle/quanticRefineToggle.css +4 -4
  65. package/force-app/main/default/lwc/quanticResultActionStyles/quanticResultActionStyles.css +2 -2
  66. package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/fixture.ts +5 -2
  67. package/force-app/main/default/lwc/quanticResultLink/quanticResultLink.css +1 -1
  68. package/force-app/main/default/lwc/quanticResultList/e2e/fixture.ts +6 -2
  69. package/force-app/main/default/lwc/quanticResultPrintableUri/quanticResultPrintableUri.css +1 -1
  70. package/force-app/main/default/lwc/quanticResultQuickview/e2e/fixture.ts +7 -3
  71. package/force-app/main/default/lwc/quanticResultQuickview/quanticResultQuickview.css +6 -6
  72. package/force-app/main/default/lwc/quanticResultTag/quanticResultTag.css +2 -0
  73. package/force-app/main/default/lwc/quanticResultTemplate/quanticResultTemplate.css +1 -1
  74. package/force-app/main/default/lwc/quanticResultsPerPage/e2e/fixture.ts +6 -2
  75. package/force-app/main/default/lwc/quanticSearchBox/e2e/fixture.ts +3 -1
  76. package/force-app/main/default/lwc/quanticSearchBoxInput/templates/defaultSearchBoxInput.css +1 -1
  77. package/force-app/main/default/lwc/quanticSearchBoxInput/templates/expandableSearchBoxInput.css +4 -12
  78. package/force-app/main/default/lwc/quanticSearchBoxInput/templates/expandableSearchBoxInput.html +2 -2
  79. package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/fixture.ts +3 -0
  80. package/force-app/main/default/lwc/quanticSmartSnippet/e2e/fixture.ts +6 -4
  81. package/force-app/main/default/lwc/quanticSmartSnippetSource/quanticSmartSnippetSource.css +1 -1
  82. package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/fixture.ts +6 -4
  83. package/force-app/main/default/lwc/quanticSort/e2e/pageObject.ts +6 -0
  84. package/force-app/main/default/lwc/quanticSort/quanticSort.css +3 -3
  85. package/force-app/main/default/lwc/quanticSourceCitations/quanticSourceCitations.css +1 -1
  86. package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/fixture.ts +2 -1
  87. package/force-app/main/default/lwc/quanticStatefulButton/quanticStatefulButton.css +2 -2
  88. package/force-app/main/default/lwc/quanticTab/e2e/fixture.ts +6 -2
  89. package/force-app/main/default/lwc/quanticTabBar/e2e/fixture.ts +6 -2
  90. package/force-app/main/default/lwc/quanticTabBar/e2e/quanticTabBar.e2e.ts +3 -2
  91. package/force-app/main/default/lwc/quanticThreadItem/quanticThreadItem.css +6 -6
  92. package/force-app/main/default/lwc/quanticThreadItem/quanticThreadItem.js +0 -1
  93. package/force-app/main/default/lwc/quanticTimeframeFacet/quanticTimeframeFacet.css +1 -1
  94. package/force-app/main/default/lwc/quanticTooltip/quanticTooltip.css +3 -3
  95. package/force-app/main/default/lwc/quanticUserAction/quanticUserAction.css +7 -7
  96. package/force-app/main/default/lwc/quanticUserActionsSession/quanticUserActionsSession.css +3 -3
  97. package/force-app/main/default/lwc/quanticUserActionsTimeline/templates/userActionsTimeline.css +2 -2
  98. package/force-app/main/default/lwc/searchBoxStyle/searchBoxStyle.css +10 -10
  99. package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +17 -17
  100. package/force-app/main/default/staticresources/coveoheadless/definitions/api/analytics/case-assist-analytics.d.ts +2 -1
  101. package/force-app/main/default/staticresources/coveoheadless/definitions/api/analytics/insight-analytics.d.ts +2 -1
  102. package/force-app/main/default/staticresources/coveoheadless/definitions/api/analytics/search-analytics.d.ts +2 -1
  103. package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/search/query-suggest/query-suggest-request.d.ts +6 -1
  104. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/stream-answer-api.d.ts +2 -1
  105. package/force-app/main/default/staticresources/coveoheadless/definitions/app/engine-configuration.d.ts +34 -0
  106. package/force-app/main/default/staticresources/coveoheadless/definitions/app/insight-thunk-extra-arguments.d.ts +2 -0
  107. package/force-app/main/default/staticresources/coveoheadless/definitions/app/search-thunk-extra-arguments.d.ts +2 -0
  108. package/force-app/main/default/staticresources/coveoheadless/definitions/app/thunk-extra-arguments.d.ts +9 -0
  109. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/search-box/headless-search-box-options.d.ts +9 -1
  110. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/standalone-search-box/headless-standalone-search-box-options.d.ts +1 -0
  111. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/generated-answer/headless-core-generated-answer.d.ts +1 -25
  112. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/generated-answer/headless-searchapi-generated-answer.d.ts +2 -1
  113. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/field-suggestions/facet/headless-field-suggestions.d.ts +1 -0
  114. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/knowledge/generated-answer/headless-answerapi-generated-answer.d.ts +2 -1
  115. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/knowledge/generated-answer/headless-generated-answer-with-follow-ups.d.ts +2 -1
  116. package/force-app/main/default/staticresources/coveoheadless/definitions/features/analytics/analytics-utils.d.ts +1 -0
  117. package/force-app/main/default/staticresources/coveoheadless/definitions/features/attached-results/attached-results-analytics-actions.d.ts +4 -0
  118. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/query-suggest/commerce-query-suggest-slice.d.ts +3 -2
  119. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/query-suggest/query-suggest-actions.d.ts +16 -5
  120. package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-analytics-client.d.ts +38 -0
  121. package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-insight-analytics-actions.d.ts +2 -2
  122. package/force-app/main/default/staticresources/coveoheadless/definitions/features/result/result-insight-analytics-actions.d.ts +1 -0
  123. package/force-app/main/default/staticresources/coveoheadless/headless.js +17 -17
  124. package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +16 -16
  125. package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +16 -16
  126. package/force-app/main/default/staticresources/dompurify/purify.min.js +2 -2
  127. package/package.json +8 -8
@@ -13,6 +13,7 @@ interface ConfigureCaseAssistAnalyticsOptions {
13
13
  analyticsClientMiddleware?: AnalyticsClientSendEventHook;
14
14
  preprocessRequest?: PreprocessRequest;
15
15
  provider?: CaseAssistClientProvider;
16
+ disableBrowserPrivacySignals?: boolean;
16
17
  }
17
- export declare const configureCaseAssistAnalytics: ({ logger, getState, analyticsClientMiddleware, preprocessRequest, provider, }: ConfigureCaseAssistAnalyticsOptions) => CaseAssistClient;
18
+ export declare const configureCaseAssistAnalytics: ({ logger, getState, analyticsClientMiddleware, preprocessRequest, provider, disableBrowserPrivacySignals, }: ConfigureCaseAssistAnalyticsOptions) => CaseAssistClient;
18
19
  export {};
@@ -27,6 +27,7 @@ interface ConfigureInsightAnalyticsOptions {
27
27
  preprocessRequest?: PreprocessRequest;
28
28
  provider?: InsightClientProvider;
29
29
  getState(): StateNeededByInsightAnalyticsProvider;
30
+ disableBrowserPrivacySignals?: boolean;
30
31
  }
31
- export declare const configureInsightAnalytics: ({ logger, getState, analyticsClientMiddleware, preprocessRequest, provider, }: ConfigureInsightAnalyticsOptions) => CoveoInsightClient;
32
+ export declare const configureInsightAnalytics: ({ logger, getState, analyticsClientMiddleware, preprocessRequest, provider, disableBrowserPrivacySignals, }: ConfigureInsightAnalyticsOptions) => CoveoInsightClient;
32
33
  export {};
@@ -96,8 +96,9 @@ interface LegacyConfigureAnalyticsOptions<State extends ConfigurationSection = S
96
96
  preprocessRequest?: PreprocessRequest;
97
97
  provider?: SearchPageClientProvider;
98
98
  getState(): State;
99
+ disableBrowserPrivacySignals?: boolean;
99
100
  }
100
- export declare const configureLegacyAnalytics: <State extends ConfigurationSection = StateNeededBySearchAnalyticsProvider>({ logger, getState, analyticsClientMiddleware, preprocessRequest, provider, }: LegacyConfigureAnalyticsOptions<State> & {
101
+ export declare const configureLegacyAnalytics: <State extends ConfigurationSection = StateNeededBySearchAnalyticsProvider>({ logger, getState, analyticsClientMiddleware, preprocessRequest, provider, disableBrowserPrivacySignals, }: LegacyConfigureAnalyticsOptions<State> & {
101
102
  provider: SearchPageClientProvider;
102
103
  }) => CoveoSearchPageClient;
103
104
  export declare const getPageID: () => string;
@@ -1,6 +1,9 @@
1
1
  import type { BaseParam } from '../../../platform-service-params.js';
2
2
  import type { ClientIdParam, ContextParam, CountryParam, CurrencyParam, LanguageParam, QueryParam, TrackingIdParam } from '../../commerce-api-params.js';
3
- export type QuerySuggestRequest = BaseParam & TrackingIdParam & LanguageParam & CountryParam & CurrencyParam & ClientIdParam & ContextParam & QueryParam;
3
+ interface CountParam {
4
+ count?: number;
5
+ }
6
+ export type QuerySuggestRequest = BaseParam & TrackingIdParam & LanguageParam & CountryParam & CurrencyParam & ClientIdParam & ContextParam & QueryParam & CountParam;
4
7
  export declare const getQuerySuggestRequestOptions: (req: QuerySuggestRequest) => {
5
8
  requestParams: {
6
9
  trackingId: string;
@@ -21,6 +24,7 @@ export declare const getQuerySuggestRequestOptions: (req: QuerySuggestRequest) =
21
24
  language: string;
22
25
  country: string;
23
26
  currency: string;
27
+ count: number | undefined;
24
28
  };
25
29
  accessToken: string;
26
30
  url: string;
@@ -29,3 +33,4 @@ export declare const getQuerySuggestRequestOptions: (req: QuerySuggestRequest) =
29
33
  origin: import("../../../preprocess-request.js").PlatformClientOrigin;
30
34
  requestMetadata?: import("../../../preprocess-request.js").RequestMetadata | undefined;
31
35
  };
36
+ export {};
@@ -1,9 +1,10 @@
1
1
  import type { ThunkDispatch, UnknownAction } from '@reduxjs/toolkit';
2
+ import type { GeneratedAnswerAnalyticsClient } from '../../features/generated-answer/generated-answer-analytics-client.js';
2
3
  import type { AnswerApiQueryParams } from '../../features/generated-answer/generated-answer-request.js';
3
4
  import type { EventSourceMessage } from '../../utils/fetch-event-source/parse.js';
4
5
  import type { GeneratedAnswerStream } from './generated-answer-stream.js';
5
6
  import type { StreamAnswerAPIState } from './stream-answer-api-state.js';
6
- export declare const updateCacheWithEvent: (event: EventSourceMessage, draft: GeneratedAnswerStream, dispatch: ThunkDispatch<StreamAnswerAPIState, unknown, UnknownAction>) => void;
7
+ export declare const updateCacheWithEvent: (event: EventSourceMessage, draft: GeneratedAnswerStream, dispatch: ThunkDispatch<StreamAnswerAPIState, unknown, UnknownAction>, generatedAnswerAnalyticsClient: GeneratedAnswerAnalyticsClient) => void;
7
8
  export declare const buildAnswerEndpoint: (platformEndpoint: string, organizationId: string, answerConfigurationId: string, insightId?: string) => string;
8
9
  export declare const answerApi: import("@reduxjs/toolkit/query").Api<import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {} & import("@reduxjs/toolkit/query").RetryOptions, {}>, {
9
10
  getAnswer: import("@reduxjs/toolkit/query").QueryDefinition<AnswerApiQueryParams, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {} & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GeneratedAnswerStream, "answer", unknown>;
@@ -138,6 +138,40 @@ export interface AnalyticsConfiguration {
138
138
  * See [Headless proxy: Analytics](https://docs.coveo.com/en/headless/latest/usage/proxy#analytics).
139
139
  */
140
140
  proxyBaseUrl?: string;
141
+ /**
142
+ * Whether to stop honoring browser privacy signals — Do Not Track (DNT) and
143
+ * Global Privacy Control (GPC) — when deciding whether to send **legacy**
144
+ * analytics (`analyticsMode: 'legacy'`).
145
+ *
146
+ * By default (`false`), Coveo libraries honor these signals: when the browser
147
+ * presents DNT or GPC, legacy analytics is automatically disabled. Setting this
148
+ * option to `true` is a deliberate choice that you configure in your own
149
+ * application code; legacy analytics events are then sent even when the browser
150
+ * presents a DNT or GPC signal.
151
+ *
152
+ * Coveo honors these signals by default and cannot determine whether overriding
153
+ * them is appropriate for your use case. If you enable this option, you are
154
+ * responsible for ensuring that doing so complies with the privacy laws and
155
+ * obligations that apply to you. Note that GPC is legally recognized as a valid
156
+ * opt-out mechanism in some jurisdictions (for example, under the California
157
+ * Consumer Privacy Act (CCPA) as amended by the California Privacy Rights Act
158
+ * (CPRA)).
159
+ *
160
+ * This option:
161
+ * - applies only when `analyticsMode` is explicitly set to `'legacy'`;
162
+ * - has no effect with `analyticsMode: 'next'`, which does not honor these signals;
163
+ * - does not override an explicit `enabled: false` or a runtime
164
+ * `disableAnalytics()` call, which always disable analytics.
165
+ *
166
+ * @deprecated Introduced as deprecated on purpose to signal that it is
167
+ * transitional. This option exists only to bridge legacy-analytics deployments
168
+ * where a browser privacy signal is enforced by policy, and it will be removed
169
+ * when legacy analytics is removed (see KIT-2844). Migrate to Event Protocol
170
+ * (`analyticsMode: 'next'`) rather than relying on this option long term.
171
+ *
172
+ * @defaultValue `false`
173
+ */
174
+ disableBrowserPrivacySignals?: boolean;
141
175
  }
142
176
  export type AnalyticsRuntimeEnvironment = IRuntimeEnvironment;
143
177
  export declare const engineConfigurationDefinitions: SchemaDefinition<EngineConfiguration>;
@@ -1,4 +1,6 @@
1
1
  import type { InsightAPIClient } from '../api/service/insight/insight-api-client.js';
2
+ import type { GeneratedAnswerAnalyticsClient } from '../features/generated-answer/generated-answer-analytics-client.js';
2
3
  import type { ClientThunkExtraArguments } from './thunk-extra-arguments.js';
3
4
  export interface InsightThunkExtraArguments extends ClientThunkExtraArguments<InsightAPIClient> {
5
+ generatedAnswerAnalyticsClient: GeneratedAnswerAnalyticsClient;
4
6
  }
@@ -1,5 +1,7 @@
1
1
  import type { GeneratedAnswerAPIClient } from '../api/generated-answer/generated-answer-client.js';
2
2
  import type { SearchAPIClient } from '../api/search/search-api-client.js';
3
+ import type { GeneratedAnswerAnalyticsClient } from '../features/generated-answer/generated-answer-analytics-client.js';
3
4
  import type { ClientThunkExtraArguments } from './thunk-extra-arguments.js';
4
5
  export interface SearchThunkExtraArguments extends ClientThunkExtraArguments<SearchAPIClient, GeneratedAnswerAPIClient> {
6
+ generatedAnswerAnalyticsClient: GeneratedAnswerAnalyticsClient;
5
7
  }
@@ -3,6 +3,7 @@ import type { AnalyticsClientSendEventHook } from 'coveo.analytics';
3
3
  import type { Logger } from 'pino';
4
4
  import type { GeneratedAnswerAPIClient } from '../api/generated-answer/generated-answer-client.js';
5
5
  import { type PreprocessRequest } from '../api/preprocess-request.js';
6
+ import type { GeneratedAnswerAnalyticsClient } from '../features/generated-answer/generated-answer-analytics-client.js';
6
7
  import { validatePayloadAndThrow } from '../utils/validate-payload.js';
7
8
  import type { EngineConfiguration } from './engine-configuration.js';
8
9
  import type { NavigatorContext } from './navigator-context-provider.js';
@@ -11,11 +12,19 @@ export interface ClientThunkExtraArguments<T, K = GeneratedAnswerAPIClient> exte
11
12
  streamingClient?: K;
12
13
  relay: Relay;
13
14
  navigatorContext: NavigatorContext;
15
+ generatedAnswerAnalyticsClient?: GeneratedAnswerAnalyticsClient;
14
16
  }
15
17
  export interface ThunkExtraArguments {
16
18
  preprocessRequest?: PreprocessRequest;
17
19
  analyticsClientMiddleware: AnalyticsClientSendEventHook;
18
20
  logger: Logger;
19
21
  validatePayload: typeof validatePayloadAndThrow;
22
+ /**
23
+ * Legacy-analytics-only, immutable engine policy. When `true`, browser privacy
24
+ * signals (Do Not Track and Global Privacy Control) are not honored. Sourced from
25
+ * the engine configuration at build time and intentionally kept out of Redux
26
+ * analytics state so it cannot be mutated at runtime.
27
+ */
28
+ disableBrowserPrivacySignals?: boolean;
20
29
  }
21
30
  export declare function buildThunkExtraArguments(configuration: EngineConfiguration, logger: Logger): ThunkExtraArguments;
@@ -1,6 +1,12 @@
1
- import { BooleanValue, Schema } from '@coveo/bueno';
1
+ import { BooleanValue, NumberValue, Schema } from '@coveo/bueno';
2
2
  import { type SearchBoxOptions as CoreSearchBoxOptions } from '../../core/search-box/headless-core-search-box-options.js';
3
3
  export type SearchBoxOptions = Pick<CoreSearchBoxOptions, 'id' | 'highlightOptions' | 'clearFilters'> & {
4
+ /**
5
+ * The number of query suggestions to request from the Coveo ML model (for example, `3`).
6
+ *
7
+ * When not specified, the API determines the number of suggestions returned.
8
+ */
9
+ numberOfSuggestions?: number;
4
10
  /**
5
11
  * When set to true, fills the `results` field rather than the `products` field
6
12
  * in the response. It may also include Spotlight Content in the results.
@@ -10,10 +16,12 @@ export type SearchBoxOptions = Pick<CoreSearchBoxOptions, 'id' | 'highlightOptio
10
16
  };
11
17
  type DefaultSearchBoxOptions = Pick<SearchBoxOptions, 'clearFilters' | 'enableResults'>;
12
18
  export declare const defaultSearchBoxOptions: Required<DefaultSearchBoxOptions>;
19
+ export type ResolvedSearchBoxOptions = Required<Omit<SearchBoxOptions, 'numberOfSuggestions'>> & Pick<SearchBoxOptions, 'numberOfSuggestions'>;
13
20
  export declare const searchBoxOptionDefinitions: {
14
21
  id: import("@coveo/bueno").StringValue<string>;
15
22
  highlightOptions: import("@coveo/bueno").RecordValue;
16
23
  clearFilters: BooleanValue;
24
+ numberOfSuggestions: NumberValue;
17
25
  enableResults: BooleanValue;
18
26
  };
19
27
  export declare const searchBoxOptionsSchema: Schema<Required<SearchBoxOptions>>;
@@ -11,4 +11,5 @@ export interface StandaloneSearchBoxOptions extends SearchBoxOptions {
11
11
  */
12
12
  overwrite?: boolean;
13
13
  }
14
+ export type ResolvedStandaloneSearchBoxOptions = Required<Omit<StandaloneSearchBoxOptions, 'numberOfSuggestions'>> & Pick<StandaloneSearchBoxOptions, 'numberOfSuggestions'>;
14
15
  export declare const standaloneSearchBoxSchema: Schema<Required<StandaloneSearchBoxOptions>>;
@@ -1,6 +1,6 @@
1
1
  import type { CoreEngine } from '../../../app/engine.js';
2
- import type { CustomAction, LegacySearchAction } from '../../../features/analytics/analytics-utils.js';
3
2
  import type { GeneratedAnswerFeedback } from '../../../features/generated-answer/generated-answer-analytics-actions.js';
3
+ import type { GeneratedAnswerAnalyticsClient } from '../../../features/generated-answer/generated-answer-analytics-client.js';
4
4
  import type { GeneratedAnswerState } from '../../../features/generated-answer/generated-answer-state.js';
5
5
  import type { GeneratedResponseFormat } from '../../../features/generated-answer/generated-response-format.js';
6
6
  import { type Controller } from '../../controller/headless-controller.js';
@@ -101,30 +101,6 @@ export interface GeneratedAnswer extends Controller {
101
101
  */
102
102
  logCitationHover(citationId: string, citationHoverTimeMs: number, answerId: string): void;
103
103
  }
104
- export interface GeneratedAnswerAnalyticsClient {
105
- /** @deprecated */
106
- logLikeGeneratedAnswer(): CustomAction;
107
- logLikeGeneratedAnswer(answerId?: string): CustomAction;
108
- /** @deprecated */
109
- logDislikeGeneratedAnswer(): CustomAction;
110
- logDislikeGeneratedAnswer(answerId?: string): CustomAction;
111
- logGeneratedAnswerFeedback: (feedback: GeneratedAnswerFeedback) => CustomAction;
112
- /** @deprecated */
113
- logOpenGeneratedAnswerSource(citationId: string): CustomAction;
114
- logOpenGeneratedAnswerSource(citationId: string, answerId?: string): CustomAction;
115
- logOpenGeneratedAnswerFollowUpSource?(citationId: string, answerId: string): CustomAction;
116
- /** @deprecated */
117
- logHoverCitation(citationId: string, citationHoverTimeMs: number): CustomAction;
118
- logHoverCitation(citationId: string, citationHoverTimeMs: number, answerId?: string): CustomAction;
119
- logGeneratedAnswerShowAnswers: () => CustomAction;
120
- logGeneratedAnswerHideAnswers: () => CustomAction;
121
- /** @deprecated */
122
- logCopyGeneratedAnswer(): CustomAction;
123
- logCopyGeneratedAnswer(answerId?: string): CustomAction;
124
- logRetryGeneratedAnswer: () => LegacySearchAction;
125
- logGeneratedAnswerExpand: () => CustomAction;
126
- logGeneratedAnswerCollapse: () => CustomAction;
127
- }
128
104
  export interface GeneratedAnswerPropsInitialState {
129
105
  initialState?: {
130
106
  /**
@@ -6,7 +6,8 @@ import type { SearchEngine } from '../../../app/search-engine/search-engine.js';
6
6
  import type { ClientThunkExtraArguments } from '../../../app/thunk-extra-arguments.js';
7
7
  import type { ConfigurationState } from '../../../features/configuration/configuration-state.js';
8
8
  import type { DebugSection, GeneratedAnswerSection, SearchSection } from '../../../state/state-sections.js';
9
- import { type GeneratedAnswer, type GeneratedAnswerAnalyticsClient, type GeneratedAnswerProps } from './headless-core-generated-answer.js';
9
+ import { type GeneratedAnswer, type GeneratedAnswerProps } from './headless-core-generated-answer.js';
10
+ import type { GeneratedAnswerAnalyticsClient } from '../../../features/generated-answer/generated-answer-analytics-client.js';
10
11
  interface SearchAPIGeneratedAnswer extends GeneratedAnswer {
11
12
  }
12
13
  interface SubscribeStateManager {
@@ -47,6 +47,7 @@ export interface FieldSuggestionsState {
47
47
  *
48
48
  * This controller is a wrapper around the basic facet controller search functionality, and thus exposes similar options and properties.
49
49
  *
50
+ * Example: [field-suggestions.tsx](https://github.com/coveo/ui-kit/blob/main/samples/headless/search-react/src/components/field-suggestions.tsx)
50
51
  *
51
52
  * @group Controllers
52
53
  * @category FieldSuggestions
@@ -1,7 +1,8 @@
1
1
  import type { InsightEngine } from '../../../app/insight-engine/insight-engine.js';
2
2
  import type { SearchEngine } from '../../../app/search-engine/search-engine.js';
3
3
  import type { GeneratedAnswerFeedback } from '../../../features/generated-answer/generated-answer-analytics-actions.js';
4
- import { type GeneratedAnswer, type GeneratedAnswerAnalyticsClient, type GeneratedAnswerProps } from '../../core/generated-answer/headless-core-generated-answer.js';
4
+ import { type GeneratedAnswer, type GeneratedAnswerProps } from '../../core/generated-answer/headless-core-generated-answer.js';
5
+ import type { GeneratedAnswerAnalyticsClient } from '../../../features/generated-answer/generated-answer-analytics-client.js';
5
6
  interface AnswerApiGeneratedAnswer extends Omit<GeneratedAnswer, 'sendFeedback'> {
6
7
  /**
7
8
  * Resets the last answer.
@@ -2,7 +2,8 @@ import type { InsightEngine } from '../../../app/insight-engine/insight-engine.j
2
2
  import type { SearchEngine } from '../../../app/search-engine/search-engine.js';
3
3
  import type { FollowUpAnswersState } from '../../../features/follow-up-answers/follow-up-answers-state.js';
4
4
  import type { GeneratedAnswerState } from '../../../index.js';
5
- import { type GeneratedAnswer, type GeneratedAnswerAnalyticsClient, type GeneratedAnswerProps } from '../../core/generated-answer/headless-core-generated-answer.js';
5
+ import { type GeneratedAnswer, type GeneratedAnswerProps } from '../../core/generated-answer/headless-core-generated-answer.js';
6
+ import type { GeneratedAnswerAnalyticsClient } from '../../../features/generated-answer/generated-answer-analytics-client.js';
6
7
  export interface GeneratedAnswerWithFollowUpsState extends GeneratedAnswerState {
7
8
  followUpAnswers: FollowUpAnswersState;
8
9
  }
@@ -21,6 +21,7 @@ type PreparableAnalyticsActionOptions<StateNeeded extends ConfigurationSection>
21
21
  preprocessRequest: PreprocessRequest | undefined;
22
22
  logger: Logger;
23
23
  getState(): StateNeeded;
24
+ disableBrowserPrivacySignals?: boolean;
24
25
  };
25
26
  export type AnalyticsAsyncThunk<StateNeeded extends ConfigurationSection = StateNeededBySearchAnalyticsProvider> = AsyncThunk<void, void, AsyncThunkAnalyticsOptions<StateNeeded>> & UnknownAction;
26
27
  export declare function makeBasicNewSearchAnalyticsAction(actionCause: string, getState: () => StateNeededBySearchAnalyticsProvider): {
@@ -47,6 +47,7 @@ export declare const logCaseAttach: (result: Result) => ((arg?: undefined, confi
47
47
  preprocessRequest: import("../../api/preprocess-request.js").PreprocessRequest | undefined;
48
48
  logger: import("pino").Logger;
49
49
  getState(): import("../../api/analytics/insight-analytics.js").StateNeededByInsightAnalyticsProvider;
50
+ disableBrowserPrivacySignals?: boolean;
50
51
  }) => Promise<{
51
52
  description?: import("coveo.analytics").EventDescription;
52
53
  action: import("../analytics/analytics-utils.js").AnalyticsAsyncThunk<import("../../api/analytics/insight-analytics.js").StateNeededByInsightAnalyticsProvider>;
@@ -99,6 +100,7 @@ export declare const logCaseDetach: (result: Result) => ((arg?: undefined, confi
99
100
  preprocessRequest: import("../../api/preprocess-request.js").PreprocessRequest | undefined;
100
101
  logger: import("pino").Logger;
101
102
  getState(): import("../../api/analytics/insight-analytics.js").StateNeededByInsightAnalyticsProvider;
103
+ disableBrowserPrivacySignals?: boolean;
102
104
  }) => Promise<{
103
105
  description?: import("coveo.analytics").EventDescription;
104
106
  action: import("../analytics/analytics-utils.js").AnalyticsAsyncThunk<import("../../api/analytics/insight-analytics.js").StateNeededByInsightAnalyticsProvider>;
@@ -151,6 +153,7 @@ export declare const logCitationDocumentAttach: (citation: GeneratedAnswerCitati
151
153
  preprocessRequest: import("../../api/preprocess-request.js").PreprocessRequest | undefined;
152
154
  logger: import("pino").Logger;
153
155
  getState(): import("../../api/analytics/insight-analytics.js").StateNeededByInsightAnalyticsProvider;
156
+ disableBrowserPrivacySignals?: boolean;
154
157
  }) => Promise<{
155
158
  description?: import("coveo.analytics").EventDescription;
156
159
  action: import("../analytics/analytics-utils.js").AnalyticsAsyncThunk<import("../../api/analytics/insight-analytics.js").StateNeededByInsightAnalyticsProvider>;
@@ -203,6 +206,7 @@ export declare const logCitationDocumentDetach: (citation: GeneratedAnswerCitati
203
206
  preprocessRequest: import("../../api/preprocess-request.js").PreprocessRequest | undefined;
204
207
  logger: import("pino").Logger;
205
208
  getState(): import("../../api/analytics/insight-analytics.js").StateNeededByInsightAnalyticsProvider;
209
+ disableBrowserPrivacySignals?: boolean;
206
210
  }) => Promise<{
207
211
  description?: import("coveo.analytics").EventDescription;
208
212
  action: import("../analytics/analytics-utils.js").AnalyticsAsyncThunk<import("../../api/analytics/insight-analytics.js").StateNeededByInsightAnalyticsProvider>;
@@ -1,3 +1,4 @@
1
- export declare const commerceQuerySuggestReducer: import("@reduxjs/toolkit").Reducer<import("../../query-suggest/query-suggest-state.js").QuerySuggestSet> & {
2
- getInitialState: () => import("../../query-suggest/query-suggest-state.js").QuerySuggestSet;
1
+ import { type QuerySuggestSet } from '../../query-suggest/query-suggest-state.js';
2
+ export declare const commerceQuerySuggestReducer: import("@reduxjs/toolkit").Reducer<QuerySuggestSet> & {
3
+ getInitialState: () => QuerySuggestSet;
3
4
  };
@@ -1,10 +1,10 @@
1
1
  import type { QuerySuggestSuccessResponse } from '../../../api/commerce/search/query-suggest/query-suggest-response.js';
2
- import type { CartSection, CommerceConfigurationSection, CommerceContextSection, CommerceQuerySection, QuerySetSection, VersionSection } from '../../../state/state-sections.js';
3
- import type { ClearQuerySuggestActionCreatorPayload, FetchQuerySuggestionsActionCreatorPayload, RegisterQuerySuggestActionCreatorPayload, SelectQuerySuggestionActionCreatorPayload } from '../../query-suggest/query-suggest-actions.js';
2
+ import type { CartSection, CommerceConfigurationSection, CommerceContextSection, CommerceQuerySection, QuerySetSection, QuerySuggestionSection, VersionSection } from '../../../state/state-sections.js';
3
+ import type { ClearQuerySuggestActionCreatorPayload, FetchQuerySuggestionsActionCreatorPayload, SelectQuerySuggestionActionCreatorPayload } from '../../query-suggest/query-suggest-actions.js';
4
4
  export type ClearQuerySuggestPayload = ClearQuerySuggestActionCreatorPayload;
5
5
  export declare const clearQuerySuggest: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: ClearQuerySuggestActionCreatorPayload], ClearQuerySuggestActionCreatorPayload, "commerce/querySuggest/clear", never, never>;
6
6
  export type FetchQuerySuggestionsPayload = FetchQuerySuggestionsActionCreatorPayload;
7
- export type StateNeededByQuerySuggest = CommerceConfigurationSection & CommerceContextSection & CartSection & QuerySetSection & CommerceQuerySection & Partial<VersionSection>;
7
+ export type StateNeededByQuerySuggest = CommerceConfigurationSection & CommerceContextSection & CartSection & QuerySetSection & CommerceQuerySection & Partial<QuerySuggestionSection & VersionSection>;
8
8
  export interface FetchQuerySuggestionsThunkReturn extends FetchQuerySuggestionsActionCreatorPayload, QuerySuggestSuccessResponse {
9
9
  /**
10
10
  * The query for which query suggestions were retrieved.
@@ -21,7 +21,18 @@ export declare const fetchQuerySuggestions: import("@reduxjs/toolkit").AsyncThun
21
21
  fulfilledMeta?: unknown;
22
22
  rejectedMeta?: unknown;
23
23
  }>;
24
- export type RegisterQuerySuggestPayload = RegisterQuerySuggestActionCreatorPayload;
25
- export declare const registerQuerySuggest: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: RegisterQuerySuggestActionCreatorPayload], RegisterQuerySuggestActionCreatorPayload, "commerce/querySuggest/register", never, never>;
24
+ export interface RegisterQuerySuggestPayload {
25
+ /**
26
+ * A unique identifier for the query suggest entity (for example, `b953ab2e-022b-4de4-903f-68b2c0682942`). Usually, this will be the ID of the search box controller that requests the query suggestions.
27
+ */
28
+ id: string;
29
+ /**
30
+ * The number of query suggestions to request from the API.
31
+ *
32
+ * When not specified, the API determines the default number of suggestions returned.
33
+ */
34
+ count?: number;
35
+ }
36
+ export declare const registerQuerySuggest: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: RegisterQuerySuggestPayload], RegisterQuerySuggestPayload, "commerce/querySuggest/register", never, never>;
26
37
  export type SelectQuerySuggestionPayload = SelectQuerySuggestionActionCreatorPayload;
27
38
  export declare const selectQuerySuggestion: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: SelectQuerySuggestionActionCreatorPayload], SelectQuerySuggestionActionCreatorPayload, "commerce/querySuggest/selectSuggestion", never, never>;
@@ -0,0 +1,38 @@
1
+ import type { CustomAction, LegacySearchAction } from '../analytics/analytics-utils.js';
2
+ import type { GeneratedAnswerFeedback } from './generated-answer-analytics-actions.js';
3
+ /**
4
+ * Defines the analytics actions that a `GeneratedAnswer` controller needs to log
5
+ * analytics events for generated answers.
6
+ *
7
+ * This interface is implemented separately for each use case (e.g., `generatedAnswerAnalyticsClient`
8
+ * for Search, `generatedAnswerInsightAnalyticsClient` for Insight), and the appropriate
9
+ * implementation is registered as a thunk extra argument at engine-build time.
10
+ *
11
+ * @group Controllers
12
+ * @category GeneratedAnswer
13
+ */
14
+ export interface GeneratedAnswerAnalyticsClient {
15
+ /** @deprecated */
16
+ logLikeGeneratedAnswer(): CustomAction;
17
+ logLikeGeneratedAnswer(answerId?: string): CustomAction;
18
+ /** @deprecated */
19
+ logDislikeGeneratedAnswer(): CustomAction;
20
+ logDislikeGeneratedAnswer(answerId?: string): CustomAction;
21
+ logGeneratedAnswerFeedback: (feedback: GeneratedAnswerFeedback) => CustomAction;
22
+ /** @deprecated */
23
+ logOpenGeneratedAnswerSource(citationId: string): CustomAction;
24
+ logOpenGeneratedAnswerSource(citationId: string, answerId?: string): CustomAction;
25
+ logOpenGeneratedAnswerFollowUpSource?(citationId: string, answerId: string): CustomAction;
26
+ /** @deprecated */
27
+ logHoverCitation(citationId: string, citationHoverTimeMs: number): CustomAction;
28
+ logHoverCitation(citationId: string, citationHoverTimeMs: number, answerId?: string): CustomAction;
29
+ logGeneratedAnswerShowAnswers: () => CustomAction;
30
+ logGeneratedAnswerHideAnswers: () => CustomAction;
31
+ /** @deprecated */
32
+ logCopyGeneratedAnswer(): CustomAction;
33
+ logCopyGeneratedAnswer(answerId?: string): CustomAction;
34
+ logRetryGeneratedAnswer: () => LegacySearchAction;
35
+ logGeneratedAnswerExpand: () => CustomAction;
36
+ logGeneratedAnswerCollapse: () => CustomAction;
37
+ logGeneratedAnswerStreamEnd(answerGenerated: boolean, answerId?: string, answerTextIsEmpty?: boolean): CustomAction;
38
+ }
@@ -6,7 +6,7 @@ export declare const logHoverCitation: (citationId: string, citationHoverTimeInM
6
6
  export declare const logLikeGeneratedAnswer: () => InsightAction;
7
7
  export declare const logDislikeGeneratedAnswer: () => InsightAction;
8
8
  export declare const logGeneratedAnswerFeedback: (feedback: GeneratedAnswerFeedback) => InsightAction;
9
- export declare const logGeneratedAnswerStreamEnd: (answerGenerated: boolean) => InsightAction;
9
+ export declare const logGeneratedAnswerStreamEnd: (answerGenerated: boolean, answerId?: string, answerTextIsEmpty?: boolean) => InsightAction;
10
10
  export declare const logGeneratedAnswerResponseLinked: () => InsightAction;
11
11
  export declare const logGeneratedAnswerShowAnswers: () => InsightAction;
12
12
  export declare const logGeneratedAnswerHideAnswers: () => InsightAction;
@@ -17,7 +17,7 @@ export declare const generatedAnswerInsightAnalyticsClient: {
17
17
  logCopyGeneratedAnswer: () => InsightAction;
18
18
  logGeneratedAnswerHideAnswers: () => InsightAction;
19
19
  logGeneratedAnswerShowAnswers: () => InsightAction;
20
- logGeneratedAnswerStreamEnd: (answerGenerated: boolean) => InsightAction;
20
+ logGeneratedAnswerStreamEnd: (answerGenerated: boolean, answerId?: string, answerTextIsEmpty?: boolean) => InsightAction;
21
21
  logGeneratedAnswerFeedback: (feedback: GeneratedAnswerFeedback) => InsightAction;
22
22
  logDislikeGeneratedAnswer: () => InsightAction;
23
23
  logLikeGeneratedAnswer: () => InsightAction;
@@ -46,6 +46,7 @@ export declare const logDocumentOpen: (result: Result) => ((arg?: undefined, con
46
46
  preprocessRequest: import("../../api/preprocess-request.js").PreprocessRequest | undefined;
47
47
  logger: import("pino").Logger;
48
48
  getState(): import("../../api/analytics/insight-analytics.js").StateNeededByInsightAnalyticsProvider;
49
+ disableBrowserPrivacySignals?: boolean;
49
50
  }) => Promise<{
50
51
  description?: import("coveo.analytics").EventDescription;
51
52
  action: import("../analytics/analytics-utils.js").AnalyticsAsyncThunk<import("../../api/analytics/insight-analytics.js").StateNeededByInsightAnalyticsProvider>;