@coveo/quantic 3.30.4-pre.fbe332fd49 → 3.30.5-pre.0c1931ccff
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/staticresources/coveoheadless/case-assist/headless.js +8 -8
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/api-client-utils.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/common/request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/recommendations/recommendations-request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/search/query-suggest/query-suggest-request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/stream-answer-api.d.ts +7 -6
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/case-assist/get-case-classifications/get-case-classifications-request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/case-assist/get-document-suggestions/get-document-suggestions-request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/insight/get-interface/get-interface-config-request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/insight/query/query-request.d.ts +4 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/insight/user-actions/user-actions-request.d.ts +2 -2
- 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 +6 -78
- 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/search/legacy/search-request.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search/search-request.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/cart/headless-cart.ssr.d.ts +1 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/context/headless-context.ssr.d.ts +1 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/parameter-manager/headless-core-parameter-manager.ssr.d.ts +1 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/engine/commerce-engine.ssr.d.ts +5 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/factories/build-factory.d.ts +20 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/types/controller-definitions.d.ts +9 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/types/engine.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/common/types/engine.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-commerce.index.d.ts +2 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/cart/headless-cart.ssr.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/context/headless-context.ssr.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/parameter-manager/headless-core-parameter-manager.ssr.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/build.d.ts +4 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/state/state-sections.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/utils/facet-utils.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/headless.js +9 -9
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +6 -6
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +7 -7
- package/package.json +2 -10
- package/scripts/npm/check-sfdx-project.js +1 -1
- package/scripts/npm/setup-quantic.js +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/knowledge/generated-answer/headless-answerapi-generated-answer-mocks.d.ts +0 -8318
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/knowledge/generated-answer/utils/testingUtils.d.ts +0 -8
package/force-app/main/default/staticresources/coveoheadless/definitions/api/api-client-utils.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import type { BaseParam } from './platform-service-params.js';
|
|
|
3
3
|
import type { AllSearchAPIResponse } from './search/search-api-client.js';
|
|
4
4
|
import type { SearchAPIErrorWithStatusCode } from './search/search-api-error-response.js';
|
|
5
5
|
import type { AuthenticationParam } from './search/search-api-params.js';
|
|
6
|
-
export declare function pickNonBaseParams<Params extends BaseParam & AuthenticationParam>(req: Params): Omit<Params, "accessToken" | "
|
|
6
|
+
export declare function pickNonBaseParams<Params extends BaseParam & AuthenticationParam>(req: Params): Omit<Params, "accessToken" | "organizationId" | "url" | "authentication">;
|
|
7
7
|
export declare const unwrapError: (payload: PlatformResponse<AllSearchAPIResponse>) => SearchAPIErrorWithStatusCode;
|
|
@@ -29,10 +29,10 @@ export declare const getRequestOptions: (req: FilterableCommerceAPIRequest, path
|
|
|
29
29
|
sort: import("./sort.js").SortOption | undefined;
|
|
30
30
|
};
|
|
31
31
|
accessToken: string;
|
|
32
|
-
method: import("../../platform-client.js").HttpMethods;
|
|
33
|
-
contentType: import("../../platform-client.js").HTTPContentType;
|
|
34
32
|
url: string;
|
|
33
|
+
method: import("../../platform-client.js").HttpMethods;
|
|
35
34
|
origin: import("../../preprocess-request.js").PlatformClientOrigin;
|
|
35
|
+
contentType: import("../../platform-client.js").HTTPContentType;
|
|
36
36
|
requestMetadata?: import("../../preprocess-request.js").RequestMetadata | undefined;
|
|
37
37
|
};
|
|
38
38
|
export declare const baseRequest: (req: BaseParam, path: CommerceApiMethod) => Pick<PlatformClientCallOptions, "accessToken" | "method" | "contentType" | "url" | "origin" | "requestMetadata">;
|
|
@@ -25,9 +25,9 @@ export declare const buildRecommendationsRequest: (req: CommerceRecommendationsR
|
|
|
25
25
|
perPage: number | undefined;
|
|
26
26
|
};
|
|
27
27
|
accessToken: string;
|
|
28
|
-
method: import("../../platform-client.js").HttpMethods;
|
|
29
|
-
contentType: import("../../platform-client.js").HTTPContentType;
|
|
30
28
|
url: string;
|
|
29
|
+
method: import("../../platform-client.js").HttpMethods;
|
|
31
30
|
origin: import("../../preprocess-request.js").PlatformClientOrigin;
|
|
31
|
+
contentType: import("../../platform-client.js").HTTPContentType;
|
|
32
32
|
requestMetadata?: import("../../preprocess-request.js").RequestMetadata | undefined;
|
|
33
33
|
};
|
|
@@ -22,9 +22,9 @@ export declare const getQuerySuggestRequestOptions: (req: QuerySuggestRequest) =
|
|
|
22
22
|
currency: string;
|
|
23
23
|
};
|
|
24
24
|
accessToken: string;
|
|
25
|
-
method: import("../../../platform-client.js").HttpMethods;
|
|
26
|
-
contentType: import("../../../platform-client.js").HTTPContentType;
|
|
27
25
|
url: string;
|
|
26
|
+
method: import("../../../platform-client.js").HttpMethods;
|
|
28
27
|
origin: import("../../../preprocess-request.js").PlatformClientOrigin;
|
|
28
|
+
contentType: import("../../../platform-client.js").HTTPContentType;
|
|
29
29
|
requestMetadata?: import("../../../preprocess-request.js").RequestMetadata | undefined;
|
|
30
30
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
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
|
+
export declare const buildAnswerEndpoint: (platformEndpoint: string, organizationId: string, answerConfigurationId: string, insightId?: string) => string;
|
|
7
8
|
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<
|
|
9
|
+
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
10
|
}, "answer", never, typeof import("@reduxjs/toolkit/query").coreModuleName>;
|
|
10
|
-
export declare const fetchAnswer: (fetchAnswerParams:
|
|
11
|
+
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
12
|
export declare const selectAnswer: (state: StreamAnswerAPIState) => ({
|
|
12
13
|
status: import("@reduxjs/toolkit/query").QueryStatus.uninitialized;
|
|
13
14
|
originalArgs?: undefined | undefined;
|
|
@@ -27,7 +28,7 @@ export declare const selectAnswer: (state: StreamAnswerAPIState) => ({
|
|
|
27
28
|
status: import("@reduxjs/toolkit/query").QueryStatus.fulfilled;
|
|
28
29
|
error: undefined;
|
|
29
30
|
endpointName: string;
|
|
30
|
-
originalArgs:
|
|
31
|
+
originalArgs: AnswerApiQueryParams;
|
|
31
32
|
requestId: string;
|
|
32
33
|
startedTimeStamp: number;
|
|
33
34
|
data: GeneratedAnswerStream;
|
|
@@ -40,7 +41,7 @@ export declare const selectAnswer: (state: StreamAnswerAPIState) => ({
|
|
|
40
41
|
isError: false;
|
|
41
42
|
}) | ({
|
|
42
43
|
status: import("@reduxjs/toolkit/query").QueryStatus.pending;
|
|
43
|
-
originalArgs:
|
|
44
|
+
originalArgs: AnswerApiQueryParams;
|
|
44
45
|
requestId: string;
|
|
45
46
|
data?: GeneratedAnswerStream | undefined;
|
|
46
47
|
error?: import("@reduxjs/toolkit").SerializedError | import("@reduxjs/toolkit/query").FetchBaseQueryError | undefined;
|
|
@@ -58,7 +59,7 @@ export declare const selectAnswer: (state: StreamAnswerAPIState) => ({
|
|
|
58
59
|
data?: GeneratedAnswerStream | undefined;
|
|
59
60
|
endpointName: string;
|
|
60
61
|
fulfilledTimeStamp?: number | undefined;
|
|
61
|
-
originalArgs:
|
|
62
|
+
originalArgs: AnswerApiQueryParams;
|
|
62
63
|
requestId: string;
|
|
63
64
|
startedTimeStamp: number;
|
|
64
65
|
error: import("@reduxjs/toolkit").SerializedError | import("@reduxjs/toolkit/query").FetchBaseQueryError;
|
|
@@ -12,8 +12,8 @@ export declare const buildGetCaseClassificationsRequest: (req: GetCaseClassifica
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
accessToken: string;
|
|
15
|
-
method: import("../../../platform-client.js").HttpMethods;
|
|
16
|
-
contentType: import("../../../platform-client.js").HTTPContentType;
|
|
17
15
|
url: string;
|
|
16
|
+
method: import("../../../platform-client.js").HttpMethods;
|
|
18
17
|
origin: import("../../../preprocess-request.js").PlatformClientOrigin;
|
|
18
|
+
contentType: import("../../../platform-client.js").HTTPContentType;
|
|
19
19
|
};
|
|
@@ -29,8 +29,8 @@ export declare const buildGetDocumentSuggestionsRequest: (req: GetDocumentSugges
|
|
|
29
29
|
} | undefined;
|
|
30
30
|
};
|
|
31
31
|
accessToken: string;
|
|
32
|
-
method: import("../../../platform-client.js").HttpMethods;
|
|
33
|
-
contentType: import("../../../platform-client.js").HTTPContentType;
|
|
34
32
|
url: string;
|
|
33
|
+
method: import("../../../platform-client.js").HttpMethods;
|
|
35
34
|
origin: import("../../../preprocess-request.js").PlatformClientOrigin;
|
|
35
|
+
contentType: import("../../../platform-client.js").HTTPContentType;
|
|
36
36
|
};
|
|
@@ -4,8 +4,8 @@ export type GetInsightInterfaceConfigRequest = BaseParam & InsightIdParam;
|
|
|
4
4
|
export declare const buildGetInsightInterfaceConfigRequest: (req: GetInsightInterfaceConfigRequest) => {
|
|
5
5
|
requestParams: {};
|
|
6
6
|
accessToken: string;
|
|
7
|
-
method: import("../../../platform-client.js").HttpMethods;
|
|
8
|
-
contentType: import("../../../platform-client.js").HTTPContentType;
|
|
9
7
|
url: string;
|
|
8
|
+
method: import("../../../platform-client.js").HttpMethods;
|
|
10
9
|
origin: import("../../../preprocess-request.js").PlatformClientOrigin;
|
|
10
|
+
contentType: import("../../../platform-client.js").HTTPContentType;
|
|
11
11
|
};
|
|
@@ -9,17 +9,17 @@ interface CaseContextParam {
|
|
|
9
9
|
export declare const buildInsightQueryRequest: (req: InsightQueryRequest) => {
|
|
10
10
|
requestParams: {};
|
|
11
11
|
accessToken: string;
|
|
12
|
-
method: import("../../../platform-client.js").HttpMethods;
|
|
13
|
-
contentType: import("../../../platform-client.js").HTTPContentType;
|
|
14
12
|
url: string;
|
|
13
|
+
method: import("../../../platform-client.js").HttpMethods;
|
|
15
14
|
origin: import("../../../preprocess-request.js").PlatformClientOrigin;
|
|
15
|
+
contentType: import("../../../platform-client.js").HTTPContentType;
|
|
16
16
|
};
|
|
17
17
|
export declare const buildInsightQuerySuggestRequest: (req: InsightQuerySuggestRequest) => {
|
|
18
18
|
requestParams: {};
|
|
19
19
|
accessToken: string;
|
|
20
|
-
method: import("../../../platform-client.js").HttpMethods;
|
|
21
|
-
contentType: import("../../../platform-client.js").HTTPContentType;
|
|
22
20
|
url: string;
|
|
21
|
+
method: import("../../../platform-client.js").HttpMethods;
|
|
23
22
|
origin: import("../../../preprocess-request.js").PlatformClientOrigin;
|
|
23
|
+
contentType: import("../../../platform-client.js").HTTPContentType;
|
|
24
24
|
};
|
|
25
25
|
export {};
|
|
@@ -11,9 +11,9 @@ export declare const buildInsightUserActionsRequest: (req: InsightUserActionsReq
|
|
|
11
11
|
objectId: string;
|
|
12
12
|
};
|
|
13
13
|
accessToken: string;
|
|
14
|
-
method: import("../../../platform-client.js").HttpMethods;
|
|
15
|
-
contentType: import("../../../platform-client.js").HTTPContentType;
|
|
16
14
|
url: string;
|
|
15
|
+
method: import("../../../platform-client.js").HttpMethods;
|
|
17
16
|
origin: import("../../../preprocess-request.js").PlatformClientOrigin;
|
|
17
|
+
contentType: import("../../../platform-client.js").HTTPContentType;
|
|
18
18
|
};
|
|
19
19
|
export {};
|
|
@@ -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<import("./generated-answer-request.js").AnswerApiQueryParams, 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,85 +1,13 @@
|
|
|
1
1
|
import type { GeneratedAnswerStreamRequest } from '../../api/generated-answer/generated-answer-request.js';
|
|
2
2
|
import type { StreamAnswerAPIState } from '../../api/knowledge/stream-answer-api-state.js';
|
|
3
|
+
import type { BaseParam } from '../../api/platform-service-params.js';
|
|
4
|
+
import type { SearchRequest } from '../../api/search/search/search-request.js';
|
|
5
|
+
import type { AuthenticationParam, AutomaticFacetsParams } from '../../api/search/search-api-params.js';
|
|
3
6
|
import type { NavigatorContext } from '../../app/navigator-context-provider.js';
|
|
4
7
|
import type { ConfigurationSection, GeneratedAnswerSection, SearchSection } from '../../state/state-sections.js';
|
|
5
8
|
type StateNeededByGeneratedAnswerStream = ConfigurationSection & SearchSection & GeneratedAnswerSection;
|
|
9
|
+
export interface AnswerApiQueryParams extends Omit<SearchRequest, keyof (BaseParam & AuthenticationParam & AutomaticFacetsParams)> {
|
|
10
|
+
}
|
|
6
11
|
export declare const buildStreamingRequest: (state: StateNeededByGeneratedAnswerStream) => Promise<GeneratedAnswerStreamRequest>;
|
|
7
|
-
export declare const constructAnswerAPIQueryParams: (state: StreamAnswerAPIState, navigatorContext: NavigatorContext) =>
|
|
8
|
-
analytics?: {
|
|
9
|
-
actionCause?: string;
|
|
10
|
-
customData?: object;
|
|
11
|
-
clientId: string;
|
|
12
|
-
deviceId?: string;
|
|
13
|
-
pageId?: string;
|
|
14
|
-
clientTimestamp: string;
|
|
15
|
-
documentReferrer: string | null;
|
|
16
|
-
originContext: string;
|
|
17
|
-
userDisplayName?: string;
|
|
18
|
-
documentLocation?: string | null;
|
|
19
|
-
trackingId?: string;
|
|
20
|
-
capture?: boolean;
|
|
21
|
-
source?: string[];
|
|
22
|
-
};
|
|
23
|
-
facetOptions?: {
|
|
24
|
-
freezeFacetOrder: boolean;
|
|
25
|
-
} | undefined;
|
|
26
|
-
sortCriteria: string | undefined;
|
|
27
|
-
dictionaryFieldContext?: import("../dictionary-field-context/dictionary-field-context-state.js").DictionaryFieldContextPayload | undefined;
|
|
28
|
-
excerptLength?: number | undefined;
|
|
29
|
-
filterField?: string | undefined;
|
|
30
|
-
childField?: string | undefined;
|
|
31
|
-
parentField?: string | undefined;
|
|
32
|
-
filterFieldRange?: number | undefined;
|
|
33
|
-
actionsHistory: import("../../api/analytics/coveo.analytics/history-store.js").HistoryElement[];
|
|
34
|
-
referrer: string;
|
|
35
|
-
debug?: boolean | undefined;
|
|
36
|
-
tab: string;
|
|
37
|
-
locale: string;
|
|
38
|
-
timezone: string;
|
|
39
|
-
numberOfResults?: number | undefined;
|
|
40
|
-
firstResult?: number | undefined;
|
|
41
|
-
queryCorrection?: {
|
|
42
|
-
enabled: boolean;
|
|
43
|
-
options: {
|
|
44
|
-
automaticallyCorrect: "never" | "whenNoResults";
|
|
45
|
-
};
|
|
46
|
-
} | undefined;
|
|
47
|
-
enableDidYouMean?: boolean | undefined;
|
|
48
|
-
fieldsToInclude?: string[] | undefined;
|
|
49
|
-
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 | {
|
|
50
|
-
currentValues: {
|
|
51
|
-
start: string;
|
|
52
|
-
end: string;
|
|
53
|
-
endInclusive: boolean;
|
|
54
|
-
state: import("../../ssr.index.js").FacetValueState;
|
|
55
|
-
previousState?: import("../../ssr.index.js").FacetValueState;
|
|
56
|
-
}[];
|
|
57
|
-
sortCriteria: import("../../ssr.index.js").RangeFacetSortCriterion;
|
|
58
|
-
rangeAlgorithm: import("../../ssr.index.js").RangeFacetRangeAlgorithm;
|
|
59
|
-
facetId: string;
|
|
60
|
-
field: string;
|
|
61
|
-
filterFacetCount: boolean;
|
|
62
|
-
injectionDepth: number;
|
|
63
|
-
numberOfValues: number;
|
|
64
|
-
preventAutoSelect: boolean;
|
|
65
|
-
resultsMustMatch: import("../../ssr.index.js").FacetResultsMustMatch;
|
|
66
|
-
generateAutomaticRanges: boolean;
|
|
67
|
-
type: "dateRange";
|
|
68
|
-
})[] | undefined;
|
|
69
|
-
pipeline?: string | undefined;
|
|
70
|
-
searchHub?: string | undefined;
|
|
71
|
-
pipelineRuleParameters: {
|
|
72
|
-
mlGenerativeQuestionAnswering: {
|
|
73
|
-
responseFormat: import("./generated-response-format.js").GeneratedResponseFormat;
|
|
74
|
-
citationsFieldToInclude: string[];
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
context?: import("../context/context-state.js").ContextPayload | undefined;
|
|
78
|
-
enableQuerySyntax?: boolean | undefined;
|
|
79
|
-
lq?: string | undefined;
|
|
80
|
-
dq?: string | undefined;
|
|
81
|
-
cq?: string | undefined;
|
|
82
|
-
aq?: string | undefined;
|
|
83
|
-
q: string | undefined;
|
|
84
|
-
};
|
|
12
|
+
export declare const constructAnswerAPIQueryParams: (state: StreamAnswerAPIState, navigatorContext: NavigatorContext) => AnswerApiQueryParams;
|
|
85
13
|
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,7 +24,7 @@ export declare const buildSearchRequest: (state: StateNeededBySearchRequest, eve
|
|
|
24
24
|
facetOptions?: import("../../facet-options/facet-options.js").FacetOptions;
|
|
25
25
|
numberOfResults?: number;
|
|
26
26
|
firstResult?: number;
|
|
27
|
-
facets?: (import("../../facets/facet-set/interfaces/request.js").FacetRequest | import("../../facets/category-facet-set/interfaces/request.js").CategoryFacetRequest | import("../../facets/range-facets/
|
|
27
|
+
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 | import("../../facets/range-facets/date-facet-set/interfaces/request.js").DateFacetRequest)[] | undefined;
|
|
28
28
|
cq?: string;
|
|
29
29
|
queryCorrection?: {
|
|
30
30
|
enabled?: boolean;
|
|
@@ -25,7 +25,7 @@ export declare const buildSearchRequest: (state: StateNeededBySearchRequest, nav
|
|
|
25
25
|
facetOptions?: import("../facet-options/facet-options.js").FacetOptions;
|
|
26
26
|
numberOfResults?: number;
|
|
27
27
|
firstResult?: number;
|
|
28
|
-
facets?: (import("../facets/facet-set/interfaces/request.js").FacetRequest | import("../facets/category-facet-set/interfaces/request.js").CategoryFacetRequest | import("../facets/range-facets/
|
|
28
|
+
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 | import("../facets/range-facets/date-facet-set/interfaces/request.js").DateFacetRequest)[] | undefined;
|
|
29
29
|
cq?: string;
|
|
30
30
|
queryCorrection?: {
|
|
31
31
|
enabled?: boolean;
|
|
@@ -7,6 +7,7 @@ export interface CartBuildProps {
|
|
|
7
7
|
export interface CartDefinition extends UniversalControllerDefinitionWithProps<Cart, CartBuildProps> {
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
+
* @deprecated In the future, the context controller will be included by default in the engine definition. You will no longer need to define it manually
|
|
10
11
|
* Defines a `Cart` controller instance.
|
|
11
12
|
* @group Definers
|
|
12
13
|
*
|
|
@@ -4,6 +4,7 @@ export type { Context, ContextProps, ContextState, View, UserLocation, ContextOp
|
|
|
4
4
|
export interface ContextDefinition extends UniversalControllerDefinitionWithProps<Context, ContextOptions> {
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
|
+
* @deprecated In the future, the context controller will be included by default in the engine definition. You will no longer need to define it manually
|
|
7
8
|
* Defines a `Context` controller instance.
|
|
8
9
|
* @group Definers
|
|
9
10
|
*
|
|
@@ -5,6 +5,7 @@ import type { CommerceSearchParameters } from '../../../../features/commerce/sea
|
|
|
5
5
|
import type { ControllerDefinitionOption, SubControllerDefinitionWithProps } from '../../types/controller-definitions.js';
|
|
6
6
|
export type { ParameterManager, ParameterManagerProps, ParameterManagerState, Parameters, ProductListingParameters, CommerceSearchParameters, };
|
|
7
7
|
/**
|
|
8
|
+
* @deprecated In the future, the parameterManager controller will be included by default in the engine definition. You will no longer need to define it manually
|
|
8
9
|
* Defines a `ParameterManager` controller instance.
|
|
9
10
|
* @group Definers
|
|
10
11
|
*
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Utility functions to be used for Commerce Server Side Rendering.
|
|
3
3
|
*/
|
|
4
|
-
import type { CommerceEngineOptions } from '../../../app/commerce-engine/commerce-engine.js';
|
|
4
|
+
import type { CommerceEngineOptions as OriginalCommerceEngineOptions } from '../../../app/commerce-engine/commerce-engine.js';
|
|
5
5
|
import type { Controller } from '../../../controllers/controller/headless-controller.js';
|
|
6
6
|
import { type CommerceEngineDefinitionOptions } from '../factories/build-factory.js';
|
|
7
7
|
import { SolutionType } from '../types/controller-constants.js';
|
|
8
8
|
import type { ControllerDefinitionsMap } from '../types/controller-definitions.js';
|
|
9
9
|
import type { EngineDefinition } from '../types/engine.js';
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated use `SSRCommerceEngineOptions` type instead.
|
|
12
|
+
*/
|
|
13
|
+
export type CommerceEngineOptions = OriginalCommerceEngineOptions;
|
|
10
14
|
export interface CommerceEngineDefinition<TControllers extends ControllerDefinitionsMap<Controller>, TSolutionType extends SolutionType> extends EngineDefinition<TControllers, CommerceEngineOptions, TSolutionType> {
|
|
11
15
|
}
|
|
12
16
|
/**
|
|
@@ -15,7 +15,26 @@ export interface SSRCommerceEngine extends CommerceEngine {
|
|
|
15
15
|
*/
|
|
16
16
|
waitForRequestCompletedAction(): Promise<Action>[];
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* SSR-specific commerce engine options with deprecated context property.
|
|
20
|
+
*/
|
|
21
|
+
export type SSRCommerceEngineOptions = Omit<CommerceEngineOptions, 'configuration'> & {
|
|
22
|
+
configuration: Omit<CommerceEngineOptions['configuration'], 'context'> & {
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated In the future major release, context should be provided through `fetchStaticState` rather than in the engine definition.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* engineDefinition = defineCommerceEngine({...});
|
|
29
|
+
* engineDefinition.fetchStaticState({
|
|
30
|
+
* context: {...},
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
context: CommerceEngineOptions['configuration']['context'];
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export type CommerceEngineDefinitionOptions<TControllers extends ControllerDefinitionsMap<Controller> = ControllerDefinitionsMap<Controller>> = EngineDefinitionOptions<SSRCommerceEngineOptions, TControllers>;
|
|
19
38
|
export declare const buildFactory: <TControllerDefinitions extends CommerceControllerDefinitionsMap>(controllerDefinitions: TControllerDefinitions | undefined, options: CommerceEngineDefinitionOptions<TControllerDefinitions>) => <T extends SolutionType>(solutionType: T) => (...[buildOptions]: BuildParameters<TControllerDefinitions>) => Promise<{
|
|
20
39
|
engine: SSRCommerceEngine;
|
|
21
40
|
controllers: import("../types/controller-inference.js").InferControllersMapFromDefinition<TControllerDefinitions, T>;
|
|
@@ -12,9 +12,18 @@ import type { Kind } from './kind.js';
|
|
|
12
12
|
export type { EngineDefinitionBuildResult, HydratedState, OptionsTuple, InferControllerStaticStateFromController, InferControllerStaticStateMapFromControllers, };
|
|
13
13
|
export type RecommendationControllerSettings = {
|
|
14
14
|
/**
|
|
15
|
+
* @deprecated In the next major version, recommendation controllers will be enabled by simply including their names in the `recommendations` array when calling `fetchStaticState`, rather than using this `enabled` property.
|
|
16
|
+
*
|
|
15
17
|
* Toggle to enable or disable the recommendation controller.
|
|
16
18
|
* When set to `true`, the controller will perform a recommendation request server-side.
|
|
17
19
|
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* await recommendationEngineDefinition.fetchStaticState({
|
|
23
|
+
* recommendations: ['popularBought', 'popularViewed']
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
18
27
|
* @default false
|
|
19
28
|
*/
|
|
20
29
|
enabled?: boolean;
|
|
@@ -39,6 +39,8 @@ export interface EngineDefinition<TControllers extends ControllerDefinitionsMap<
|
|
|
39
39
|
*/
|
|
40
40
|
hydrateStaticState: HydrateStaticState<InferControllersMapFromDefinition<TControllers, TSolutionType>, UnknownAction, InferControllerPropsMapFromDefinitions<TControllers>, TControllers, TSolutionType>;
|
|
41
41
|
/**
|
|
42
|
+
* @deprecated This method is deprecated and will be removed in a future major version. Use the `fetchStaticState` method instead.
|
|
43
|
+
*
|
|
42
44
|
* Builds an engine and its controllers from an engine definition.
|
|
43
45
|
*/
|
|
44
46
|
build: Build<TEngineOptions, InferControllersMapFromDefinition<TControllers, TSolutionType>, InferControllerPropsMapFromDefinitions<TControllers>, TControllers, TSolutionType>;
|