@coveo/quantic 3.30.3-pre.b400a05b95 → 3.30.3-pre.bfb80506e9
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/force-app/main/default/lwc/quanticUtils/markdownUtils.js +16 -3
- package/force-app/main/default/lwc/quanticUtils/quanticUtils.js +105 -17
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +8 -8
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/stream-answer-api.d.ts +9 -7
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/search/search-api-params.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/configuration/configuration-selectors.d.ts +51 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/dictionary-field-context/dictionary-field-context-selectors.d.ts +4 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/excerpt-length/excerpt-length-selectors.d.ts +26 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facet-options/facet-options-selectors.d.ts +7 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/folding/folding-selectors.d.ts +9 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-actions.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-mocks.d.ts +209 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-request.d.ts +46 -57
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-state.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/query/query-selectors.d.ts +25 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search/legacy/search-request.d.ts +1 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search/search-request.d.ts +1 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/sort-criteria/sort-criteria-selectors.d.ts +26 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/factories/build-factory.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/test/mock-search-request.d.ts +1 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/utils/utils.d.ts +3 -0
- package/force-app/main/default/staticresources/coveoheadless/headless.js +10 -10
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +9 -9
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +7 -7
- package/package.json +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/knowledge/generated-answer/headless-answerapi-generated-answer-mocks.d.ts +0 -9036
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/knowledge/generated-answer/utils/testingUtils.d.ts +0 -8
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import type { ThunkDispatch, UnknownAction } from '@reduxjs/toolkit';
|
|
2
|
+
import type { AnswerApiQueryParams } from '../../features/generated-answer/generated-answer-request.js';
|
|
2
3
|
import type { EventSourceMessage } from '../../utils/fetch-event-source/parse.js';
|
|
3
|
-
import type { SearchRequest } from '../search/search/search-request.js';
|
|
4
4
|
import type { GeneratedAnswerStream } from './generated-answer-stream.js';
|
|
5
5
|
import type { StreamAnswerAPIState } from './stream-answer-api-state.js';
|
|
6
6
|
export declare const updateCacheWithEvent: (event: EventSourceMessage, draft: GeneratedAnswerStream, dispatch: ThunkDispatch<StreamAnswerAPIState, unknown, UnknownAction>) => void;
|
|
7
7
|
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, {}>, {
|
|
8
|
-
getAnswer: import("@reduxjs/toolkit/query").QueryDefinition<
|
|
8
|
+
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">;
|
|
9
9
|
}, "answer", never, typeof import("@reduxjs/toolkit/query").coreModuleName>;
|
|
10
|
-
export declare const fetchAnswer: (fetchAnswerParams:
|
|
11
|
-
export declare const selectAnswer: (
|
|
10
|
+
export declare const fetchAnswer: (fetchAnswerParams: AnswerApiQueryParams) => import("redux-thunk").ThunkAction<import("@reduxjs/toolkit/query").QueryActionCreatorResult<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">>, any, any, UnknownAction>;
|
|
11
|
+
export declare const selectAnswer: (selectAnswerParams: AnswerApiQueryParams) => (state: import("@reduxjs/toolkit/query").RootState<{
|
|
12
|
+
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">;
|
|
13
|
+
}, never, "answer">) => ({
|
|
12
14
|
status: import("@reduxjs/toolkit/query").QueryStatus.uninitialized;
|
|
13
15
|
originalArgs?: undefined | undefined;
|
|
14
16
|
data?: undefined | undefined;
|
|
@@ -27,7 +29,7 @@ export declare const selectAnswer: (state: StreamAnswerAPIState) => ({
|
|
|
27
29
|
status: import("@reduxjs/toolkit/query").QueryStatus.fulfilled;
|
|
28
30
|
error: undefined;
|
|
29
31
|
endpointName: string;
|
|
30
|
-
originalArgs:
|
|
32
|
+
originalArgs: AnswerApiQueryParams;
|
|
31
33
|
requestId: string;
|
|
32
34
|
startedTimeStamp: number;
|
|
33
35
|
data: GeneratedAnswerStream;
|
|
@@ -40,7 +42,7 @@ export declare const selectAnswer: (state: StreamAnswerAPIState) => ({
|
|
|
40
42
|
isError: false;
|
|
41
43
|
}) | ({
|
|
42
44
|
status: import("@reduxjs/toolkit/query").QueryStatus.pending;
|
|
43
|
-
originalArgs:
|
|
45
|
+
originalArgs: AnswerApiQueryParams;
|
|
44
46
|
requestId: string;
|
|
45
47
|
data?: GeneratedAnswerStream | undefined;
|
|
46
48
|
error?: import("@reduxjs/toolkit").SerializedError | import("@reduxjs/toolkit/query").FetchBaseQueryError | undefined;
|
|
@@ -58,7 +60,7 @@ export declare const selectAnswer: (state: StreamAnswerAPIState) => ({
|
|
|
58
60
|
data?: GeneratedAnswerStream | undefined;
|
|
59
61
|
endpointName: string;
|
|
60
62
|
fulfilledTimeStamp?: number | undefined;
|
|
61
|
-
originalArgs:
|
|
63
|
+
originalArgs: AnswerApiQueryParams;
|
|
62
64
|
requestId: string;
|
|
63
65
|
startedTimeStamp: number;
|
|
64
66
|
error: import("@reduxjs/toolkit").SerializedError | import("@reduxjs/toolkit/query").FetchBaseQueryError;
|
|
@@ -110,7 +110,7 @@ type GenQAParameters = {
|
|
|
110
110
|
responseFormat: ResponseFormatParameters;
|
|
111
111
|
citationsFieldToInclude: string[];
|
|
112
112
|
};
|
|
113
|
-
type ResponseFormatParameters = {
|
|
113
|
+
export type ResponseFormatParameters = {
|
|
114
114
|
contentFormat?: GeneratedContentFormat[];
|
|
115
115
|
};
|
|
116
116
|
export declare const baseSearchRequest: (req: BaseParam & AuthenticationParam, method: HttpMethods, contentType: HTTPContentType, path: string) => Pick<PlatformClientCallOptions, "accessToken" | "method" | "contentType" | "url" | "origin">;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ConfigurationState } from './configuration-state.js';
|
|
2
|
+
export declare const selectLocale: ((state: {
|
|
3
|
+
configuration: ConfigurationState;
|
|
4
|
+
}) => string) & {
|
|
5
|
+
clearCache: () => void;
|
|
6
|
+
resultsCount: () => number;
|
|
7
|
+
resetResultsCount: () => void;
|
|
8
|
+
} & {
|
|
9
|
+
resultFunc: (resultFuncArgs_0: string) => string;
|
|
10
|
+
memoizedResultFunc: ((resultFuncArgs_0: string) => string) & {
|
|
11
|
+
clearCache: () => void;
|
|
12
|
+
resultsCount: () => number;
|
|
13
|
+
resetResultsCount: () => void;
|
|
14
|
+
};
|
|
15
|
+
lastResult: () => string;
|
|
16
|
+
dependencies: [(state: {
|
|
17
|
+
configuration: ConfigurationState;
|
|
18
|
+
}) => string];
|
|
19
|
+
recomputations: () => number;
|
|
20
|
+
resetRecomputations: () => void;
|
|
21
|
+
dependencyRecomputations: () => number;
|
|
22
|
+
resetDependencyRecomputations: () => void;
|
|
23
|
+
} & {
|
|
24
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
25
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
26
|
+
};
|
|
27
|
+
export declare const selectTimezone: ((state: {
|
|
28
|
+
configuration: ConfigurationState;
|
|
29
|
+
}) => string) & {
|
|
30
|
+
clearCache: () => void;
|
|
31
|
+
resultsCount: () => number;
|
|
32
|
+
resetResultsCount: () => void;
|
|
33
|
+
} & {
|
|
34
|
+
resultFunc: (resultFuncArgs_0: string) => string;
|
|
35
|
+
memoizedResultFunc: ((resultFuncArgs_0: string) => string) & {
|
|
36
|
+
clearCache: () => void;
|
|
37
|
+
resultsCount: () => number;
|
|
38
|
+
resetResultsCount: () => void;
|
|
39
|
+
};
|
|
40
|
+
lastResult: () => string;
|
|
41
|
+
dependencies: [(state: {
|
|
42
|
+
configuration: ConfigurationState;
|
|
43
|
+
}) => string];
|
|
44
|
+
recomputations: () => number;
|
|
45
|
+
resetRecomputations: () => void;
|
|
46
|
+
dependencyRecomputations: () => number;
|
|
47
|
+
resetDependencyRecomputations: () => void;
|
|
48
|
+
} & {
|
|
49
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
50
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
51
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DictionaryFieldContextState } from './dictionary-field-context-state.js';
|
|
2
|
+
export declare const selectDictionaryFieldContext: (state: {
|
|
3
|
+
dictionaryFieldContext?: DictionaryFieldContextState;
|
|
4
|
+
}) => import("./dictionary-field-context-state.js").DictionaryFieldContextPayload | undefined;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ExcerptLengthState } from './excerpt-length-state.js';
|
|
2
|
+
export declare const selectExcerptLength: ((state: {
|
|
3
|
+
excerptLength?: ExcerptLengthState;
|
|
4
|
+
}) => number | undefined) & {
|
|
5
|
+
clearCache: () => void;
|
|
6
|
+
resultsCount: () => number;
|
|
7
|
+
resetResultsCount: () => void;
|
|
8
|
+
} & {
|
|
9
|
+
resultFunc: (resultFuncArgs_0: number | undefined) => number | undefined;
|
|
10
|
+
memoizedResultFunc: ((resultFuncArgs_0: number | undefined) => number | undefined) & {
|
|
11
|
+
clearCache: () => void;
|
|
12
|
+
resultsCount: () => number;
|
|
13
|
+
resetResultsCount: () => void;
|
|
14
|
+
};
|
|
15
|
+
lastResult: () => number | undefined;
|
|
16
|
+
dependencies: [(state: {
|
|
17
|
+
excerptLength?: ExcerptLengthState;
|
|
18
|
+
}) => number | undefined];
|
|
19
|
+
recomputations: () => number;
|
|
20
|
+
resetRecomputations: () => void;
|
|
21
|
+
dependencyRecomputations: () => number;
|
|
22
|
+
resetDependencyRecomputations: () => void;
|
|
23
|
+
} & {
|
|
24
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
25
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
26
|
+
};
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
import type { FacetOptionsSection } from '../../state/state-sections.js';
|
|
2
2
|
export declare const isFacetEnabledSelector: (state: FacetOptionsSection, id: string) => boolean;
|
|
3
|
+
export declare const selectFacetOptions: (state: {
|
|
4
|
+
facetOptions?: {
|
|
5
|
+
freezeFacetOrder?: boolean;
|
|
6
|
+
};
|
|
7
|
+
}) => {
|
|
8
|
+
freezeFacetOrder: boolean;
|
|
9
|
+
} | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
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';
|
|
4
3
|
import type { SearchThunkExtraArguments } from '../../app/search-thunk-extra-arguments.js';
|
|
4
|
+
import type { AnswerApiQueryParams } from '../../features/generated-answer/generated-answer-request.js';
|
|
5
5
|
import type { ConfigurationSection, DebugSection, GeneratedAnswerSection, SearchSection } from '../../state/state-sections.js';
|
|
6
6
|
import { type GeneratedResponseFormat } from './generated-response-format.js';
|
|
7
7
|
type StateNeededByGeneratedAnswerStream = ConfigurationSection & SearchSection & GeneratedAnswerSection & DebugSection;
|
|
@@ -35,7 +35,7 @@ export declare const updateAnswerConfigurationId: import("@reduxjs/toolkit").Act
|
|
|
35
35
|
export declare const registerFieldsToIncludeInCitations: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: string[]], string[], "generatedAnswer/registerFieldsToIncludeInCitations", never, never>;
|
|
36
36
|
export declare const setIsAnswerGenerated: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: boolean], boolean, "generatedAnswer/setIsAnswerGenerated", never, never>;
|
|
37
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:
|
|
38
|
+
export declare const setAnswerApiQueryParams: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: AnswerApiQueryParams], unknown, "generatedAnswer/setAnswerApiQueryParams", never, never>;
|
|
39
39
|
interface StreamAnswerArgs {
|
|
40
40
|
setAbortControllerRef: (ref: AbortController) => void;
|
|
41
41
|
}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/** biome-ignore-all lint/suspicious/noExplicitAny: <mock> */
|
|
2
|
+
import type { StreamAnswerAPIState } from '../../api/knowledge/stream-answer-api-state.js';
|
|
3
|
+
export declare const streamAnswerAPIStateMock: StreamAnswerAPIState;
|
|
4
|
+
export declare const streamAnswerAPIStateMockWithATabWithAnExpression: StreamAnswerAPIState;
|
|
5
|
+
export declare const streamAnswerAPIStateMockWithoutAnyTab: StreamAnswerAPIState;
|
|
6
|
+
export declare const streamAnswerAPIStateMockWithStaticFiltersSelected: StreamAnswerAPIState;
|
|
7
|
+
export declare const streamAnswerAPIStateMockWithNonValidFilters: StreamAnswerAPIState;
|
|
8
|
+
export declare const streamAnswerAPIStateMockWithoutAnyFilters: StreamAnswerAPIState;
|
|
9
|
+
export declare const streamAnswerAPIStateMockWithStaticFiltersAndTabExpression: StreamAnswerAPIState;
|
|
10
|
+
export declare const streamAnswerAPIStateMockWithStaticFiltersAndTabExpressionWithEmptyCQ: {
|
|
11
|
+
advancedSearchQueries: {
|
|
12
|
+
cq: string;
|
|
13
|
+
cqWasSet: boolean;
|
|
14
|
+
aq: string;
|
|
15
|
+
aqWasSet: boolean;
|
|
16
|
+
lq: string;
|
|
17
|
+
lqWasSet: boolean;
|
|
18
|
+
dq: string;
|
|
19
|
+
dqWasSet: boolean;
|
|
20
|
+
defaultFilters: {
|
|
21
|
+
cq: string;
|
|
22
|
+
aq: string;
|
|
23
|
+
lq: string;
|
|
24
|
+
dq: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
searchHub: string;
|
|
28
|
+
pipeline: string;
|
|
29
|
+
answer: import("@reduxjs/toolkit/query").CombinedState<{
|
|
30
|
+
getAnswer: import("@reduxjs/toolkit/query").QueryDefinition<Partial<import("../../api/search/search/search-request.js").SearchRequest>, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {} & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, import("../../api/knowledge/generated-answer-stream.js").GeneratedAnswerStream, "answer">;
|
|
31
|
+
}, never, "answer">;
|
|
32
|
+
configuration: import("../configuration/configuration-state.js").ConfigurationState;
|
|
33
|
+
facetSet?: import("../facets/facet-set/facet-set-state.js").FacetSetState | undefined;
|
|
34
|
+
dateFacetSet?: import("../facets/range-facets/date-facet-set/date-facet-set-state.js").DateFacetSetState | undefined;
|
|
35
|
+
numericFacetSet?: import("../facets/range-facets/numeric-facet-set/numeric-facet-set-state.js").NumericFacetSetState | undefined;
|
|
36
|
+
categoryFacetSet?: import("../facets/category-facet-set/category-facet-set-state.js").CategoryFacetSetState | undefined;
|
|
37
|
+
automaticFacetSet?: import("../facets/automatic-facet-set/automatic-facet-set-state.js").AutomaticFacetSetState | undefined;
|
|
38
|
+
facetOptions?: import("../facet-options/facet-options-state.js").FacetOptionsState | undefined;
|
|
39
|
+
query?: import("../query/query-state.js").QueryState | undefined;
|
|
40
|
+
tabSet?: import("../tab-set/tab-set-state.js").TabSetState | undefined;
|
|
41
|
+
staticFilterSet?: import("../static-filter-set/static-filter-set-state.js").StaticFilterSetState | undefined;
|
|
42
|
+
pagination?: import("../pagination/pagination-state.js").PaginationState | undefined;
|
|
43
|
+
sortCriteria?: string | undefined;
|
|
44
|
+
context?: import("../context/context-state.js").ContextState | undefined;
|
|
45
|
+
dictionaryFieldContext?: import("../dictionary-field-context/dictionary-field-context-state.js").DictionaryFieldContextState | undefined;
|
|
46
|
+
querySet?: import("../query-set/query-set-state.js").QuerySetState | undefined;
|
|
47
|
+
debug?: boolean | undefined;
|
|
48
|
+
facetSearchSet?: import("../facets/facet-search-set/specific/specific-facet-search-set-state.js").SpecificFacetSearchSetState | undefined;
|
|
49
|
+
categoryFacetSearchSet?: import("../facets/facet-search-set/category/category-facet-search-set-state.js").CategoryFacetSearchSetState | undefined;
|
|
50
|
+
standaloneSearchBoxSet?: import("../standalone-search-box-set/standalone-search-box-set-state.js").StandaloneSearchBoxSetState | undefined;
|
|
51
|
+
querySuggest?: import("../query-suggest/query-suggest-state.js").QuerySuggestSet | undefined;
|
|
52
|
+
search?: import("../search/search-state.js").SearchState | undefined;
|
|
53
|
+
resultPreview?: import("../result-preview/result-preview-state.js").ResultPreviewState | undefined;
|
|
54
|
+
didYouMean?: import("../did-you-mean/did-you-mean-state.js").DidYouMeanState | undefined;
|
|
55
|
+
fields?: import("../fields/fields-state.js").FieldsState | undefined;
|
|
56
|
+
facetOrder?: import("../facets/facet-order/facet-order-state.js").FacetOrderState | undefined;
|
|
57
|
+
version?: string | undefined;
|
|
58
|
+
history?: import("../../app/undoable.js").StateWithHistory<import("../history/history-state.js").HistoryState> | undefined;
|
|
59
|
+
folding?: import("../folding/folding-state.js").FoldingState | undefined;
|
|
60
|
+
triggers?: import("../triggers/triggers-state.js").TriggerState | undefined;
|
|
61
|
+
questionAnswering?: import("../question-answering/question-answering-state.js").QuestionAnsweringState | undefined;
|
|
62
|
+
recentResults?: import("../recent-results/recent-results-state.js").RecentResultsState | undefined;
|
|
63
|
+
recentQueries?: import("../recent-queries/recent-queries-state.js").RecentQueriesState | undefined;
|
|
64
|
+
excerptLength?: import("../excerpt-length/excerpt-length-state.js").ExcerptLengthState | undefined;
|
|
65
|
+
generatedAnswer: import("./generated-answer-state.js").GeneratedAnswerState;
|
|
66
|
+
instantResults?: import("../instant-results/instant-results-state.js").InstantResultsState | undefined;
|
|
67
|
+
insightConfiguration?: import("../insight-configuration/insight-configuration-state.js").InsightConfigurationState | undefined;
|
|
68
|
+
};
|
|
69
|
+
export declare const streamAnswerAPIStateMockWithoutSearchAction: StreamAnswerAPIState;
|
|
70
|
+
export declare const streamAnswerAPIStateMockWithAnalyticsEnabled: StreamAnswerAPIState;
|
|
71
|
+
export declare const streamAnswerAPIStateMockWithFoldingDisabled: StreamAnswerAPIState;
|
|
72
|
+
export declare const streamAnswerAPIStateMockWithFoldingEnabled: StreamAnswerAPIState;
|
|
73
|
+
export declare const streamAnswerAPIStateMockWithDictionaryFieldContext: StreamAnswerAPIState;
|
|
74
|
+
export declare const streamAnswerAPIStateMockWithExcerptLength: StreamAnswerAPIState;
|
|
75
|
+
export declare const streamAnswerAPIStateMockWithQuerySyntaxEnabled: StreamAnswerAPIState;
|
|
76
|
+
export declare const expectedStreamAnswerAPIParam: {
|
|
77
|
+
q: string;
|
|
78
|
+
aq: string;
|
|
79
|
+
cq: string;
|
|
80
|
+
dq: string;
|
|
81
|
+
lq: string;
|
|
82
|
+
enableQuerySyntax: boolean;
|
|
83
|
+
context: {
|
|
84
|
+
testKey: string;
|
|
85
|
+
};
|
|
86
|
+
pipelineRuleParameters: {
|
|
87
|
+
mlGenerativeQuestionAnswering: {
|
|
88
|
+
responseFormat: {
|
|
89
|
+
contentFormat: string[];
|
|
90
|
+
};
|
|
91
|
+
citationsFieldToInclude: never[];
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
searchHub: string;
|
|
95
|
+
facets: ({
|
|
96
|
+
filterFacetCount: boolean;
|
|
97
|
+
injectionDepth: number;
|
|
98
|
+
numberOfValues: number;
|
|
99
|
+
sortCriteria: string;
|
|
100
|
+
resultsMustMatch: string;
|
|
101
|
+
type: string;
|
|
102
|
+
currentValues: never[];
|
|
103
|
+
freezeCurrentValues: boolean;
|
|
104
|
+
isFieldExpanded: boolean;
|
|
105
|
+
preventAutoSelect: boolean;
|
|
106
|
+
facetId: string;
|
|
107
|
+
field: string;
|
|
108
|
+
rangeAlgorithm?: undefined;
|
|
109
|
+
generateAutomaticRanges?: undefined;
|
|
110
|
+
delimitingCharacter?: undefined;
|
|
111
|
+
basePath?: undefined;
|
|
112
|
+
filterByBasePath?: undefined;
|
|
113
|
+
} | {
|
|
114
|
+
filterFacetCount: boolean;
|
|
115
|
+
injectionDepth: number;
|
|
116
|
+
numberOfValues: number;
|
|
117
|
+
sortCriteria: string;
|
|
118
|
+
rangeAlgorithm: string;
|
|
119
|
+
resultsMustMatch: string;
|
|
120
|
+
currentValues: {
|
|
121
|
+
start: string;
|
|
122
|
+
end: string;
|
|
123
|
+
endInclusive: boolean;
|
|
124
|
+
state: string;
|
|
125
|
+
}[];
|
|
126
|
+
preventAutoSelect: boolean;
|
|
127
|
+
type: string;
|
|
128
|
+
facetId: string;
|
|
129
|
+
field: string;
|
|
130
|
+
generateAutomaticRanges: boolean;
|
|
131
|
+
freezeCurrentValues?: undefined;
|
|
132
|
+
isFieldExpanded?: undefined;
|
|
133
|
+
delimitingCharacter?: undefined;
|
|
134
|
+
basePath?: undefined;
|
|
135
|
+
filterByBasePath?: undefined;
|
|
136
|
+
} | {
|
|
137
|
+
delimitingCharacter: string;
|
|
138
|
+
filterFacetCount: boolean;
|
|
139
|
+
injectionDepth: number;
|
|
140
|
+
numberOfValues: number;
|
|
141
|
+
sortCriteria: string;
|
|
142
|
+
basePath: never[];
|
|
143
|
+
filterByBasePath: boolean;
|
|
144
|
+
resultsMustMatch: string;
|
|
145
|
+
currentValues: never[];
|
|
146
|
+
preventAutoSelect: boolean;
|
|
147
|
+
type: string;
|
|
148
|
+
facetId: string;
|
|
149
|
+
field: string;
|
|
150
|
+
freezeCurrentValues?: undefined;
|
|
151
|
+
isFieldExpanded?: undefined;
|
|
152
|
+
rangeAlgorithm?: undefined;
|
|
153
|
+
generateAutomaticRanges?: undefined;
|
|
154
|
+
} | {
|
|
155
|
+
filterFacetCount: boolean;
|
|
156
|
+
injectionDepth: number;
|
|
157
|
+
numberOfValues: number;
|
|
158
|
+
sortCriteria: string;
|
|
159
|
+
rangeAlgorithm: string;
|
|
160
|
+
resultsMustMatch: string;
|
|
161
|
+
currentValues: {
|
|
162
|
+
endInclusive: boolean;
|
|
163
|
+
state: string;
|
|
164
|
+
start: number;
|
|
165
|
+
end: number;
|
|
166
|
+
}[];
|
|
167
|
+
preventAutoSelect: boolean;
|
|
168
|
+
type: string;
|
|
169
|
+
facetId: string;
|
|
170
|
+
field: string;
|
|
171
|
+
generateAutomaticRanges: boolean;
|
|
172
|
+
freezeCurrentValues?: undefined;
|
|
173
|
+
isFieldExpanded?: undefined;
|
|
174
|
+
delimitingCharacter?: undefined;
|
|
175
|
+
basePath?: undefined;
|
|
176
|
+
filterByBasePath?: undefined;
|
|
177
|
+
})[];
|
|
178
|
+
fieldsToInclude: string[];
|
|
179
|
+
queryCorrection: {
|
|
180
|
+
enabled: boolean;
|
|
181
|
+
options: {
|
|
182
|
+
automaticallyCorrect: string;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
enableDidYouMean: boolean;
|
|
186
|
+
numberOfResults: number;
|
|
187
|
+
firstResult: number;
|
|
188
|
+
tab: string;
|
|
189
|
+
locale: string;
|
|
190
|
+
timezone: string;
|
|
191
|
+
referrer: string;
|
|
192
|
+
debug: boolean;
|
|
193
|
+
actionsHistory: never[];
|
|
194
|
+
sortCriteria: string;
|
|
195
|
+
facetOptions: {
|
|
196
|
+
freezeFacetOrder: boolean;
|
|
197
|
+
};
|
|
198
|
+
analytics: {
|
|
199
|
+
actionCause: string;
|
|
200
|
+
capture: boolean;
|
|
201
|
+
clientId: string;
|
|
202
|
+
clientTimestamp: string;
|
|
203
|
+
customData: undefined;
|
|
204
|
+
documentLocation: string;
|
|
205
|
+
documentReferrer: string;
|
|
206
|
+
originContext: string;
|
|
207
|
+
source: string[];
|
|
208
|
+
};
|
|
209
|
+
};
|
|
@@ -1,69 +1,58 @@
|
|
|
1
|
+
import type { HistoryElement } from '../../api/analytics/coveo.analytics/history-store.js';
|
|
1
2
|
import type { GeneratedAnswerStreamRequest } from '../../api/generated-answer/generated-answer-request.js';
|
|
2
3
|
import type { StreamAnswerAPIState } from '../../api/knowledge/stream-answer-api-state.js';
|
|
4
|
+
import type { AnalyticsParam, ResponseFormatParameters } from '../../api/search/search-api-params.js';
|
|
3
5
|
import type { NavigatorContext } from '../../app/navigator-context-provider.js';
|
|
4
6
|
import type { ConfigurationSection, GeneratedAnswerSection, SearchSection } from '../../state/state-sections.js';
|
|
7
|
+
import type { ContextPayload } from '../context/context-state.js';
|
|
8
|
+
import type { FacetOptions } from '../facet-options/facet-options.js';
|
|
9
|
+
import type { AnyFacetRequest } from '../facets/generic/interfaces/generic-facet-request.js';
|
|
5
10
|
type StateNeededByGeneratedAnswerStream = ConfigurationSection & SearchSection & GeneratedAnswerSection;
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
trackingId?: string;
|
|
20
|
-
capture?: boolean;
|
|
21
|
-
source?: string[];
|
|
11
|
+
export interface AnswerApiQueryParams {
|
|
12
|
+
q?: string;
|
|
13
|
+
aq?: string;
|
|
14
|
+
cq?: string;
|
|
15
|
+
dq?: string;
|
|
16
|
+
lq?: string;
|
|
17
|
+
enableQuerySyntax?: boolean;
|
|
18
|
+
context?: ContextPayload;
|
|
19
|
+
pipelineRuleParameters?: {
|
|
20
|
+
mlGenerativeQuestionAnswering: {
|
|
21
|
+
responseFormat: ResponseFormatParameters;
|
|
22
|
+
citationsFieldToInclude: string[];
|
|
23
|
+
};
|
|
22
24
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
searchHub?: string;
|
|
26
|
+
pipeline?: string;
|
|
27
|
+
facets?: AnyFacetRequest[];
|
|
28
|
+
fieldsToInclude?: string[];
|
|
26
29
|
queryCorrection?: {
|
|
27
30
|
enabled: boolean;
|
|
28
31
|
options: {
|
|
29
|
-
automaticallyCorrect:
|
|
30
|
-
};
|
|
31
|
-
} | undefined;
|
|
32
|
-
enableDidYouMean?: boolean | undefined;
|
|
33
|
-
fieldsToInclude?: string[] | undefined;
|
|
34
|
-
facets?: (import("../facets/facet-set/interfaces/request.js").FacetRequest | import("../facets/category-facet-set/interfaces/request.js").CategoryFacetRequest | import("../facets/range-facets/numeric-facet-set/interfaces/request.js").NumericFacetRequest | {
|
|
35
|
-
currentValues: {
|
|
36
|
-
start: string;
|
|
37
|
-
end: string;
|
|
38
|
-
endInclusive: boolean;
|
|
39
|
-
state: import("../../ssr.index.js").FacetValueState;
|
|
40
|
-
previousState?: import("../../ssr.index.js").FacetValueState;
|
|
41
|
-
}[];
|
|
42
|
-
sortCriteria: import("../../ssr.index.js").RangeFacetSortCriterion;
|
|
43
|
-
rangeAlgorithm: import("../../ssr.index.js").RangeFacetRangeAlgorithm;
|
|
44
|
-
facetId: string;
|
|
45
|
-
field: string;
|
|
46
|
-
filterFacetCount: boolean;
|
|
47
|
-
injectionDepth: number;
|
|
48
|
-
numberOfValues: number;
|
|
49
|
-
preventAutoSelect: boolean;
|
|
50
|
-
resultsMustMatch: import("../../ssr.index.js").FacetResultsMustMatch;
|
|
51
|
-
generateAutomaticRanges: boolean;
|
|
52
|
-
type: "dateRange";
|
|
53
|
-
})[] | undefined;
|
|
54
|
-
pipeline?: string | undefined;
|
|
55
|
-
searchHub?: string | undefined;
|
|
56
|
-
pipelineRuleParameters: {
|
|
57
|
-
mlGenerativeQuestionAnswering: {
|
|
58
|
-
responseFormat: import("./generated-response-format.js").GeneratedResponseFormat;
|
|
59
|
-
citationsFieldToInclude: string[];
|
|
32
|
+
automaticallyCorrect: 'whenNoResults' | 'never';
|
|
60
33
|
};
|
|
61
34
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
35
|
+
enableDidYouMean?: boolean;
|
|
36
|
+
numberOfResults?: number;
|
|
37
|
+
firstResult?: number;
|
|
38
|
+
tab?: string;
|
|
39
|
+
locale?: string;
|
|
40
|
+
timezone?: string;
|
|
41
|
+
debug?: boolean;
|
|
42
|
+
referrer?: string;
|
|
43
|
+
actionsHistory?: HistoryElement[];
|
|
44
|
+
foldingParams?: {
|
|
45
|
+
filterField: string;
|
|
46
|
+
childField: string;
|
|
47
|
+
parentField: string;
|
|
48
|
+
filterFieldRange: number;
|
|
49
|
+
};
|
|
50
|
+
excerptLength?: number;
|
|
51
|
+
dictionaryFieldContext?: Record<string, string>;
|
|
52
|
+
sortCriteria?: string;
|
|
53
|
+
facetOptions?: FacetOptions;
|
|
54
|
+
analytics?: AnalyticsParam['analytics'];
|
|
55
|
+
}
|
|
56
|
+
export declare const buildStreamingRequest: (state: StateNeededByGeneratedAnswerStream) => Promise<GeneratedAnswerStreamRequest>;
|
|
57
|
+
export declare const constructAnswerAPIQueryParams: (state: StreamAnswerAPIState, navigatorContext: NavigatorContext) => AnswerApiQueryParams;
|
|
69
58
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GeneratedAnswerCitation } from '../../api/generated-answer/generated-answer-event-payload.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AnswerApiQueryParams } from '../../features/generated-answer/generated-answer-request.js';
|
|
3
3
|
import type { GeneratedContentFormat, GeneratedResponseFormat } from './generated-response-format.js';
|
|
4
4
|
/**
|
|
5
5
|
* A scoped and simplified part of the headless state that is relevant to the `GeneratedAnswer` component.
|
|
@@ -90,6 +90,6 @@ export interface GeneratedAnswerState {
|
|
|
90
90
|
/**
|
|
91
91
|
* The query parameters used for the answer API request cache key
|
|
92
92
|
*/
|
|
93
|
-
answerApiQueryParams?:
|
|
93
|
+
answerApiQueryParams?: AnswerApiQueryParams;
|
|
94
94
|
}
|
|
95
95
|
export declare function getGeneratedAnswerInitialState(): GeneratedAnswerState;
|
|
@@ -24,3 +24,28 @@ export declare const selectQuery: ((state: {
|
|
|
24
24
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
25
25
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
26
26
|
};
|
|
27
|
+
export declare const selectEnableQuerySyntax: ((state: {
|
|
28
|
+
query?: QueryState;
|
|
29
|
+
}) => boolean | undefined) & {
|
|
30
|
+
clearCache: () => void;
|
|
31
|
+
resultsCount: () => number;
|
|
32
|
+
resetResultsCount: () => void;
|
|
33
|
+
} & {
|
|
34
|
+
resultFunc: (resultFuncArgs_0: boolean | undefined) => boolean | undefined;
|
|
35
|
+
memoizedResultFunc: ((resultFuncArgs_0: boolean | undefined) => boolean | undefined) & {
|
|
36
|
+
clearCache: () => void;
|
|
37
|
+
resultsCount: () => number;
|
|
38
|
+
resetResultsCount: () => void;
|
|
39
|
+
};
|
|
40
|
+
lastResult: () => boolean | undefined;
|
|
41
|
+
dependencies: [(state: {
|
|
42
|
+
query?: QueryState;
|
|
43
|
+
}) => boolean | undefined];
|
|
44
|
+
recomputations: () => number;
|
|
45
|
+
resetRecomputations: () => void;
|
|
46
|
+
dependencyRecomputations: () => number;
|
|
47
|
+
resetDependencyRecomputations: () => void;
|
|
48
|
+
} & {
|
|
49
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
50
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
51
|
+
};
|
|
@@ -6,9 +6,7 @@ type StateNeededBySearchRequest = ConfigurationSection & Partial<SearchAppState>
|
|
|
6
6
|
export declare const buildSearchRequest: (state: StateNeededBySearchRequest, eventDescription?: EventDescription) => Promise<import("../search-mappings.js").MappedSearchRequest<{
|
|
7
7
|
pipelineRuleParameters?: {
|
|
8
8
|
mlGenerativeQuestionAnswering?: {
|
|
9
|
-
responseFormat:
|
|
10
|
-
contentFormat?: import("../../generated-answer/generated-response-format.js").GeneratedContentFormat[];
|
|
11
|
-
};
|
|
9
|
+
responseFormat: import("../../../api/search/search-api-params.js").ResponseFormatParameters;
|
|
12
10
|
citationsFieldToInclude: string[];
|
|
13
11
|
};
|
|
14
12
|
};
|
|
@@ -7,9 +7,7 @@ type StateNeededBySearchRequest = ConfigurationSection & Partial<SearchAppState>
|
|
|
7
7
|
export declare const buildSearchRequest: (state: StateNeededBySearchRequest, navigatorContext: NavigatorContext, eventDescription?: EventDescription) => Promise<import("./search-mappings.js").MappedSearchRequest<{
|
|
8
8
|
pipelineRuleParameters?: {
|
|
9
9
|
mlGenerativeQuestionAnswering?: {
|
|
10
|
-
responseFormat:
|
|
11
|
-
contentFormat?: import("../generated-answer/generated-response-format.js").GeneratedContentFormat[];
|
|
12
|
-
};
|
|
10
|
+
responseFormat: import("../../api/search/search-api-params.js").ResponseFormatParameters;
|
|
13
11
|
citationsFieldToInclude: string[];
|
|
14
12
|
};
|
|
15
13
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { SortCriteriaState } from './sort-criteria-state.js';
|
|
2
|
+
export declare const selectSortCriteria: ((state: {
|
|
3
|
+
sortCriteria?: SortCriteriaState;
|
|
4
|
+
}) => string | undefined) & {
|
|
5
|
+
clearCache: () => void;
|
|
6
|
+
resultsCount: () => number;
|
|
7
|
+
resetResultsCount: () => void;
|
|
8
|
+
} & {
|
|
9
|
+
resultFunc: (resultFuncArgs_0: string | undefined) => string | undefined;
|
|
10
|
+
memoizedResultFunc: ((resultFuncArgs_0: string | undefined) => string | undefined) & {
|
|
11
|
+
clearCache: () => void;
|
|
12
|
+
resultsCount: () => number;
|
|
13
|
+
resetResultsCount: () => void;
|
|
14
|
+
};
|
|
15
|
+
lastResult: () => string | undefined;
|
|
16
|
+
dependencies: [(state: {
|
|
17
|
+
sortCriteria?: SortCriteriaState;
|
|
18
|
+
}) => string | undefined];
|
|
19
|
+
recomputations: () => number;
|
|
20
|
+
resetRecomputations: () => void;
|
|
21
|
+
dependencyRecomputations: () => number;
|
|
22
|
+
resetDependencyRecomputations: () => void;
|
|
23
|
+
} & {
|
|
24
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
25
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
26
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Action } from '@reduxjs/toolkit';
|
|
2
2
|
import { type CommerceEngine } from '../../../app/commerce-engine/commerce-engine.js';
|
|
3
3
|
import { SolutionType } from '../types/controller-constants.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { BakedInControllers } from '../types/controller-definitions.js';
|
|
5
5
|
import type { InferControllersMapFromDefinition } from '../types/controller-inference.js';
|
|
6
6
|
import type { CommerceControllerDefinitionsMap, CommerceEngineDefinitionOptions, FetchStaticStateParameters, HydrateStaticStateParameters } from '../types/engine.js';
|
|
7
7
|
/**
|
|
@@ -15,7 +15,7 @@ export interface SSRCommerceEngine extends CommerceEngine {
|
|
|
15
15
|
*/
|
|
16
16
|
waitForRequestCompletedAction(): Promise<Action>[];
|
|
17
17
|
}
|
|
18
|
-
export declare const buildFactory: <TControllerDefinitions extends CommerceControllerDefinitionsMap>(controllerDefinitions:
|
|
18
|
+
export declare const buildFactory: <TControllerDefinitions extends CommerceControllerDefinitionsMap>(controllerDefinitions: TControllerDefinitions, options: CommerceEngineDefinitionOptions<TControllerDefinitions>) => <TSolutionType extends SolutionType>(solutionType: TSolutionType) => (...[buildOptions]: FetchStaticStateParameters<TControllerDefinitions, TSolutionType> | HydrateStaticStateParameters<TControllerDefinitions, TSolutionType>) => Promise<{
|
|
19
19
|
engine: SSRCommerceEngine;
|
|
20
20
|
controllers: InferControllersMapFromDefinition<TControllerDefinitions, TSolutionType> & BakedInControllers;
|
|
21
21
|
}>;
|
|
@@ -60,9 +60,7 @@ export declare function buildMockSearchRequest(config?: Partial<SearchRequest>):
|
|
|
60
60
|
};
|
|
61
61
|
pipelineRuleParameters?: {
|
|
62
62
|
mlGenerativeQuestionAnswering?: {
|
|
63
|
-
responseFormat:
|
|
64
|
-
contentFormat?: import("../index.js").GeneratedContentFormat[];
|
|
65
|
-
};
|
|
63
|
+
responseFormat: import("../api/search/search-api-params.js").ResponseFormatParameters;
|
|
66
64
|
citationsFieldToInclude: string[];
|
|
67
65
|
};
|
|
68
66
|
};
|