@coveo/quantic 3.30.0 → 3.30.1-pre.0b6ca95bda

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 (28) hide show
  1. package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +10 -8
  2. package/force-app/main/default/staticresources/coveoheadless/definitions/api/api-client-utils.d.ts +1 -1
  3. package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/common/request.d.ts +2 -2
  4. package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/recommendations/recommendations-request.d.ts +2 -2
  5. package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/search/query-suggest/query-suggest-request.d.ts +2 -2
  6. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/stream-answer-api.d.ts +3 -93
  7. package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/case-assist/get-case-classifications/get-case-classifications-request.d.ts +2 -2
  8. package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/case-assist/get-document-suggestions/get-document-suggestions-request.d.ts +2 -2
  9. package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/insight/get-interface/get-interface-config-request.d.ts +2 -2
  10. package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/insight/query/query-request.d.ts +4 -4
  11. package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/insight/user-actions/user-actions-request.d.ts +2 -2
  12. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/knowledge/generated-answer/headless-answerapi-generated-answer-mocks.d.ts +2003 -0
  13. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/knowledge/generated-answer/utils/testingUtils.d.ts +8 -0
  14. package/force-app/main/default/staticresources/coveoheadless/definitions/features/attached-results/attached-results-actions-loader.d.ts +14 -1
  15. package/force-app/main/default/staticresources/coveoheadless/definitions/features/attached-results/attached-results-actions.d.ts +2 -9
  16. package/force-app/main/default/staticresources/coveoheadless/definitions/features/attached-results/attached-results-analytics-actions-loader.d.ts +35 -0
  17. package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/answer-api-selectors.d.ts +72 -0
  18. package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-actions.d.ts +2 -0
  19. package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-request.d.ts +2005 -0
  20. package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-state.d.ts +5 -0
  21. package/force-app/main/default/staticresources/coveoheadless/definitions/features/search/search-request.d.ts +2 -0
  22. package/force-app/main/default/staticresources/coveoheadless/definitions/insight.index.d.ts +1 -0
  23. package/force-app/main/default/staticresources/coveoheadless/headless.js +12 -10
  24. package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +11 -9
  25. package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +9 -7
  26. package/package.json +4 -3
  27. package/docs/out/quantic-docs.json +0 -6440
  28. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/tests/stream-answer-api-state-mock.d.ts +0 -1051
@@ -0,0 +1,8 @@
1
+ type DateRangeCurrentValues = {
2
+ start: string;
3
+ end: string;
4
+ endInclusive: boolean;
5
+ state: string;
6
+ };
7
+ export declare function addSecondsToFacetsTimestamps(facetsCurrentValues: DateRangeCurrentValues[], seconds: number): DateRangeCurrentValues[];
8
+ export {};
@@ -2,7 +2,6 @@ import type { PayloadAction } from '@reduxjs/toolkit';
2
2
  import type { InsightEngine } from '../../app/insight-engine/insight-engine.js';
3
3
  import { type SetAttachedResultsActionCreatorPayload } from './attached-results-actions.js';
4
4
  import type { AttachedResult } from './attached-results-state.js';
5
- export type { SetAttachedResultsActionCreatorPayload, AttachedResult };
6
5
  /**
7
6
  * The attached results action creators.
8
7
  *
@@ -27,6 +26,20 @@ export interface AttachedResultsActionCreators {
27
26
  * @returns A dispatchable action.
28
27
  */
29
28
  setAttachedResults(payload: SetAttachedResultsActionCreatorPayload): PayloadAction<SetAttachedResultsActionCreatorPayload>;
29
+ /**
30
+ * Creates an action that attaches a result to a case.
31
+ *
32
+ * @param payload - The action creator payload containing the result to attach.
33
+ * @returns A dispatchable action.
34
+ */
35
+ attachResult(payload: AttachedResult): PayloadAction<AttachedResult>;
36
+ /**
37
+ * Creates an action that detaches a result from a case.
38
+ *
39
+ * @param payload - The action creator payload containing the result to detach.
40
+ * @returns A dispatchable action.
41
+ */
42
+ detachResult(payload: AttachedResult): PayloadAction<AttachedResult>;
30
43
  }
31
44
  /**
32
45
  * Loads the `attachedResults` reducer and returns possible action creators.
@@ -9,13 +9,6 @@ export interface SetAttachedResultsActionCreatorPayload {
9
9
  */
10
10
  loading?: boolean;
11
11
  }
12
- interface SetAttachToCaseAttachActionCreatorPayload {
13
- result: AttachedResult;
14
- }
15
- interface SetAttachToCaseDetachActionCreatorPayload {
16
- result: AttachedResult;
17
- }
18
12
  export declare const setAttachedResults: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: SetAttachedResultsActionCreatorPayload], SetAttachedResultsActionCreatorPayload, "insight/attachToCase/setAttachedResults", never, never>;
19
- export declare const attachResult: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: SetAttachToCaseAttachActionCreatorPayload], SetAttachToCaseAttachActionCreatorPayload | SetAttachToCaseDetachActionCreatorPayload, "insight/attachToCase/attach", never, never>;
20
- export declare const detachResult: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: SetAttachToCaseDetachActionCreatorPayload], SetAttachToCaseAttachActionCreatorPayload | SetAttachToCaseDetachActionCreatorPayload, "insight/attachToCase/detach", never, never>;
21
- export {};
13
+ export declare const attachResult: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: AttachedResult], AttachedResult, "insight/attachToCase/attach", never, never>;
14
+ export declare const detachResult: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: AttachedResult], AttachedResult, "insight/attachToCase/detach", never, never>;
@@ -0,0 +1,35 @@
1
+ import type { Result } from '../../api/search/search/result.js';
2
+ import type { InsightEngine } from '../../app/insight-engine/insight-engine.js';
3
+ import type { InsightAction } from '../analytics/analytics-utils.js';
4
+ /**
5
+ * The attached results action creators.
6
+ *
7
+ * @group Actions
8
+ * @category AttachedResults
9
+ */
10
+ export interface AttachedResultsAnalyticsActionCreators {
11
+ /**
12
+ * Creates an analytics action for when a case attach event occurs.
13
+ *
14
+ * @param result - The result to attach.
15
+ * @returns A dispatchable action.
16
+ */
17
+ logCaseAttach(result: Result): InsightAction;
18
+ /**
19
+ * Creates an analytics action for when a case detach event occurs.
20
+ *
21
+ * @param result - The result to detach.
22
+ * @returns A dispatchable action.
23
+ */
24
+ logCaseDetach(result: Result): InsightAction;
25
+ }
26
+ /**
27
+ * Loads the `attachedResults` reducer and returns possible analytics action creators.
28
+ *
29
+ * @param engine - The headless engine.
30
+ * @returns An object holding the analytics action creators.
31
+ *
32
+ * @group Actions
33
+ * @category AttachedResults
34
+ */
35
+ export declare function loadAttachedResultsAnalyticsActions(engine: InsightEngine): AttachedResultsAnalyticsActionCreators;
@@ -0,0 +1,72 @@
1
+ export declare const selectAnswerTriggerParams: ((state: any, ...params: any[]) => {
2
+ q: any;
3
+ requestId: any;
4
+ cannotAnswer: any;
5
+ analyticsMode: any;
6
+ actionCause: any;
7
+ }) & {
8
+ clearCache: () => void;
9
+ resultsCount: () => number;
10
+ resetResultsCount: () => void;
11
+ } & {
12
+ resultFunc: (...resultFuncArgs: readonly any[]) => {
13
+ q: any;
14
+ requestId: any;
15
+ cannotAnswer: any;
16
+ analyticsMode: any;
17
+ actionCause: any;
18
+ };
19
+ memoizedResultFunc: ((...resultFuncArgs: readonly any[]) => {
20
+ q: any;
21
+ requestId: any;
22
+ cannotAnswer: any;
23
+ analyticsMode: any;
24
+ actionCause: any;
25
+ }) & {
26
+ clearCache: () => void;
27
+ resultsCount: () => number;
28
+ resetResultsCount: () => void;
29
+ };
30
+ lastResult: () => {
31
+ q: any;
32
+ requestId: any;
33
+ cannotAnswer: any;
34
+ analyticsMode: any;
35
+ actionCause: any;
36
+ };
37
+ dependencies: import("reselect").SelectorArray<any>;
38
+ recomputations: () => number;
39
+ resetRecomputations: () => void;
40
+ dependencyRecomputations: () => number;
41
+ resetDependencyRecomputations: () => void;
42
+ } & {
43
+ argsMemoize: typeof import("reselect").weakMapMemoize;
44
+ memoize: typeof import("reselect").weakMapMemoize;
45
+ };
46
+ /**
47
+ * If answer params are not available, returns `skipToken`, a special value from RTK Query
48
+ * that tells RTK Query to "skip" running a query or selector until the params are ready.
49
+ *
50
+ * @see https://redux-toolkit.js.org/rtk-query/usage-with-typescript#skipping-queries-with-typescript-using-skiptoken
51
+ */
52
+ export declare const selectAnswerApiQueryParams: ((state: any, ...params: any[]) => any) & {
53
+ clearCache: () => void;
54
+ resultsCount: () => number;
55
+ resetResultsCount: () => void;
56
+ } & {
57
+ resultFunc: (...resultFuncArgs: readonly any[]) => any;
58
+ memoizedResultFunc: ((...resultFuncArgs: readonly any[]) => any) & {
59
+ clearCache: () => void;
60
+ resultsCount: () => number;
61
+ resetResultsCount: () => void;
62
+ };
63
+ lastResult: () => any;
64
+ dependencies: import("reselect").SelectorArray<any>;
65
+ recomputations: () => number;
66
+ resetRecomputations: () => void;
67
+ dependencyRecomputations: () => number;
68
+ resetDependencyRecomputations: () => void;
69
+ } & {
70
+ argsMemoize: typeof import("reselect").weakMapMemoize;
71
+ memoize: typeof import("reselect").weakMapMemoize;
72
+ };
@@ -1,5 +1,6 @@
1
1
  import type { GeneratedAnswerCitationsPayload, GeneratedAnswerMessagePayload } from '../../api/generated-answer/generated-answer-event-payload.js';
2
2
  import type { StreamAnswerAPIState } from '../../api/knowledge/stream-answer-api-state.js';
3
+ import type { SearchRequest } from '../../api/search/search/search-request.js';
3
4
  import type { SearchThunkExtraArguments } from '../../app/search-thunk-extra-arguments.js';
4
5
  import type { ConfigurationSection, DebugSection, GeneratedAnswerSection, SearchSection } from '../../state/state-sections.js';
5
6
  import { type GeneratedResponseFormat } from './generated-response-format.js';
@@ -34,6 +35,7 @@ export declare const updateAnswerConfigurationId: import("@reduxjs/toolkit").Act
34
35
  export declare const registerFieldsToIncludeInCitations: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: string[]], string[], "generatedAnswer/registerFieldsToIncludeInCitations", never, never>;
35
36
  export declare const setIsAnswerGenerated: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: boolean], boolean, "generatedAnswer/setIsAnswerGenerated", never, never>;
36
37
  export declare const setCannotAnswer: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: boolean], boolean, "generatedAnswer/setCannotAnswer", never, never>;
38
+ export declare const setAnswerApiQueryParams: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: Partial<SearchRequest>], unknown, "generatedAnswer/setAnswerApiQueryParams", never, never>;
37
39
  interface StreamAnswerArgs {
38
40
  setAbortControllerRef: (ref: AbortController) => void;
39
41
  }