@coveo/quantic 3.30.0-pre.e3bf4d7bb2 → 3.30.0-pre.ea0fa3a1da
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/analytics/analytics-relay-client.d.ts +18 -3
- 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 +5 -5
- 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-loader.d.ts +9 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-actions.d.ts +25 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/insight.index.d.ts +1 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/common/types/hydrate-static-state.d.ts +0 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/engine.d.ts +6 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/fetch-static-state.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/common/types/engine.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/search/controller-utils.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/search/types/hydrate-static-state.d.ts +1 -1
- 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/api/knowledge/stream-answer-actions.d.ts +0 -15
|
@@ -6,14 +6,29 @@ export declare const getRelayInstanceFromState: ((state: StateNeededByRelay, nav
|
|
|
6
6
|
resultsCount: () => number;
|
|
7
7
|
resetResultsCount: () => void;
|
|
8
8
|
} & {
|
|
9
|
-
resultFunc: (resultFuncArgs_0: string, resultFuncArgs_1: "dev" | "stg" | "hipaa" | "prod", resultFuncArgs_2: string, resultFuncArgs_3: import("../../features/configuration/configuration-state.js").CoreAnalyticsState | import("../../features/configuration/configuration-state.js").AnalyticsState, resultFuncArgs_4: string[], resultFuncArgs_5:
|
|
10
|
-
|
|
9
|
+
resultFunc: (resultFuncArgs_0: string, resultFuncArgs_1: "dev" | "stg" | "hipaa" | "prod", resultFuncArgs_2: string, resultFuncArgs_3: import("../../features/configuration/configuration-state.js").CoreAnalyticsState | import("../../features/configuration/configuration-state.js").AnalyticsState, resultFuncArgs_4: string[], resultFuncArgs_5: {
|
|
10
|
+
getLocation: () => string | null;
|
|
11
|
+
getReferrer: () => string | null;
|
|
12
|
+
getUserAgent: () => string | null;
|
|
13
|
+
generateUUID: () => string;
|
|
14
|
+
} | undefined) => import("@coveo/relay").Relay;
|
|
15
|
+
memoizedResultFunc: ((resultFuncArgs_0: string, resultFuncArgs_1: "dev" | "stg" | "hipaa" | "prod", resultFuncArgs_2: string, resultFuncArgs_3: import("../../features/configuration/configuration-state.js").CoreAnalyticsState | import("../../features/configuration/configuration-state.js").AnalyticsState, resultFuncArgs_4: string[], resultFuncArgs_5: {
|
|
16
|
+
getLocation: () => string | null;
|
|
17
|
+
getReferrer: () => string | null;
|
|
18
|
+
getUserAgent: () => string | null;
|
|
19
|
+
generateUUID: () => string;
|
|
20
|
+
} | undefined) => import("@coveo/relay").Relay) & {
|
|
11
21
|
clearCache: () => void;
|
|
12
22
|
resultsCount: () => number;
|
|
13
23
|
resetResultsCount: () => void;
|
|
14
24
|
};
|
|
15
25
|
lastResult: () => import("@coveo/relay").Relay;
|
|
16
|
-
dependencies: [(state: StateNeededByRelay) => string, (state: StateNeededByRelay) => "dev" | "stg" | "hipaa" | "prod", (state: StateNeededByRelay) => string, (state: StateNeededByRelay) => import("../../features/configuration/configuration-state.js").CoreAnalyticsState | import("../../features/configuration/configuration-state.js").AnalyticsState, (state: StateNeededByRelay) => string[], (_state: StateNeededByRelay, navigatorContextProvider?: NavigatorContextProvider) =>
|
|
26
|
+
dependencies: [(state: StateNeededByRelay) => string, (state: StateNeededByRelay) => "dev" | "stg" | "hipaa" | "prod", (state: StateNeededByRelay) => string, (state: StateNeededByRelay) => import("../../features/configuration/configuration-state.js").CoreAnalyticsState | import("../../features/configuration/configuration-state.js").AnalyticsState, (state: StateNeededByRelay) => string[], (_state: StateNeededByRelay, navigatorContextProvider?: NavigatorContextProvider) => {
|
|
27
|
+
getLocation: () => string | null;
|
|
28
|
+
getReferrer: () => string | null;
|
|
29
|
+
getUserAgent: () => string | null;
|
|
30
|
+
generateUUID: () => string;
|
|
31
|
+
} | undefined];
|
|
17
32
|
recomputations: () => number;
|
|
18
33
|
resetRecomputations: () => void;
|
|
19
34
|
dependencyRecomputations: () => number;
|
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
|
};
|
|
@@ -75,7 +75,7 @@ export declare const constructAnswerQueryParams: (state: StreamAnswerAPIState, u
|
|
|
75
75
|
queryCorrection?: {
|
|
76
76
|
enabled: boolean;
|
|
77
77
|
options: {
|
|
78
|
-
automaticallyCorrect: "
|
|
78
|
+
automaticallyCorrect: "whenNoResults" | "never";
|
|
79
79
|
};
|
|
80
80
|
} | undefined;
|
|
81
81
|
enableDidYouMean?: boolean | undefined;
|
|
@@ -116,9 +116,9 @@ export declare const selectAnswer: (state: StreamAnswerAPIState, navigatorContex
|
|
|
116
116
|
}) | ({
|
|
117
117
|
status: import("@reduxjs/toolkit/query").QueryStatus.fulfilled;
|
|
118
118
|
error: undefined;
|
|
119
|
-
requestId: string;
|
|
120
|
-
originalArgs: Partial<SearchRequest>;
|
|
121
119
|
endpointName: string;
|
|
120
|
+
originalArgs: Partial<SearchRequest>;
|
|
121
|
+
requestId: string;
|
|
122
122
|
startedTimeStamp: number;
|
|
123
123
|
data: GeneratedAnswerStream;
|
|
124
124
|
fulfilledTimeStamp: number;
|
|
@@ -145,11 +145,11 @@ export declare const selectAnswer: (state: StreamAnswerAPIState, navigatorContex
|
|
|
145
145
|
isError: false;
|
|
146
146
|
}) | ({
|
|
147
147
|
status: import("@reduxjs/toolkit/query").QueryStatus.rejected;
|
|
148
|
-
requestId: string;
|
|
149
148
|
data?: GeneratedAnswerStream | undefined;
|
|
149
|
+
endpointName: string;
|
|
150
150
|
fulfilledTimeStamp?: number | undefined;
|
|
151
151
|
originalArgs: Partial<SearchRequest>;
|
|
152
|
-
|
|
152
|
+
requestId: string;
|
|
153
153
|
startedTimeStamp: number;
|
|
154
154
|
error: import("@reduxjs/toolkit").SerializedError | import("@reduxjs/toolkit/query").FetchBaseQueryError;
|
|
155
155
|
} & {
|
|
@@ -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 {};
|
|
@@ -7,6 +7,15 @@ import type { CoreEngine } from '../../app/engine.js';
|
|
|
7
7
|
* @category GeneratedAnswer
|
|
8
8
|
*/
|
|
9
9
|
export interface GeneratedAnswerActionCreators {
|
|
10
|
+
/**
|
|
11
|
+
* Generates a new answer using the Answer API.
|
|
12
|
+
*
|
|
13
|
+
* This action requires an answer configuration ID to be set in the engine configuration.
|
|
14
|
+
* When present, it will use the Answer API service for enhanced answer generation.
|
|
15
|
+
*
|
|
16
|
+
* @returns A dispatchable action.
|
|
17
|
+
*/
|
|
18
|
+
generateAnswer(): void;
|
|
10
19
|
/**
|
|
11
20
|
* Resets the generated answer state to a clean slate.
|
|
12
21
|
*
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { GeneratedAnswerCitationsPayload, GeneratedAnswerMessagePayload } from '../../api/generated-answer/generated-answer-event-payload.js';
|
|
2
|
+
import type { StreamAnswerAPIState } from '../../api/knowledge/stream-answer-api-state.js';
|
|
3
|
+
import type { SearchThunkExtraArguments } from '../../app/search-thunk-extra-arguments.js';
|
|
2
4
|
import type { ConfigurationSection, DebugSection, GeneratedAnswerSection, SearchSection } from '../../state/state-sections.js';
|
|
3
5
|
import { type GeneratedResponseFormat } from './generated-response-format.js';
|
|
4
6
|
type StateNeededByGeneratedAnswerStream = ConfigurationSection & SearchSection & GeneratedAnswerSection & DebugSection;
|
|
@@ -45,4 +47,27 @@ export declare const streamAnswer: import("@reduxjs/toolkit").AsyncThunk<void, S
|
|
|
45
47
|
fulfilledMeta?: unknown;
|
|
46
48
|
rejectedMeta?: unknown;
|
|
47
49
|
}>;
|
|
50
|
+
/**
|
|
51
|
+
* Thunk to handle the sequence of actions required to generate a new answer
|
|
52
|
+
* after a search request.
|
|
53
|
+
*
|
|
54
|
+
* ⚠️ This action only works when an **answer configuration ID** is present
|
|
55
|
+
* in the engine configuration. In that case, the **Answer API** will be used
|
|
56
|
+
* instead of the regular search pipeline.
|
|
57
|
+
*
|
|
58
|
+
* Flow:
|
|
59
|
+
* 1. Reset any existing answer state.
|
|
60
|
+
* 2. Fetch a new answer from the Answer API using the provided configuration.
|
|
61
|
+
* 3. Update the search action metadata.
|
|
62
|
+
*/
|
|
63
|
+
export declare const generateAnswer: import("@reduxjs/toolkit").AsyncThunk<void, void, {
|
|
64
|
+
state: StreamAnswerAPIState;
|
|
65
|
+
extra: SearchThunkExtraArguments;
|
|
66
|
+
dispatch?: import("redux-thunk").ThunkDispatch<unknown, unknown, import("redux").UnknownAction> | undefined;
|
|
67
|
+
rejectValue?: unknown;
|
|
68
|
+
serializedErrorType?: unknown;
|
|
69
|
+
pendingMeta?: unknown;
|
|
70
|
+
fulfilledMeta?: unknown;
|
|
71
|
+
rejectedMeta?: unknown;
|
|
72
|
+
}>;
|
|
48
73
|
export {};
|
|
@@ -104,6 +104,7 @@ export type { NumericFacetValue } from './features/facets/range-facets/numeric-f
|
|
|
104
104
|
export * from './features/facets/range-facets/numeric-facet-set/numeric-facet-actions-loader.js';
|
|
105
105
|
export * from './features/fields/fields-actions-loader.js';
|
|
106
106
|
export * from './features/folding/insight-folding-actions-loader.js';
|
|
107
|
+
export * from './features/generated-answer/generated-answer-actions-loader.js';
|
|
107
108
|
export * from './features/insight-interface/insight-interface-actions-loader.js';
|
|
108
109
|
export type { InsightInterfaceState } from './features/insight-interface/insight-interface-state.js';
|
|
109
110
|
export * from './features/insight-search/insight-query-set-actions-loader.js';
|
|
@@ -5,10 +5,6 @@ import type { EngineDefinitionBuildResult, EngineDefinitionControllersPropsOptio
|
|
|
5
5
|
import type { FromBuildResult } from './from-build-result.js';
|
|
6
6
|
import type { OptionsTuple } from './utilities.js';
|
|
7
7
|
interface HydrateStaticStateOptions<TSearchAction> {
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated The `searchAction` property will be replaced with `searchActions` in the next major release.
|
|
10
|
-
* The new property will accept an array of actions instead of a single action to support multiple search operations (e.g. search and recommendation).
|
|
11
|
-
*/
|
|
12
8
|
searchAction: TSearchAction;
|
|
13
9
|
}
|
|
14
10
|
export interface HydratedState<TEngine extends CoreEngine | CoreEngineNext, TControllers extends ControllersMap> extends EngineDefinitionBuildResult<TEngine, TControllers> {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { UnknownAction } from '@reduxjs/toolkit';
|
|
2
2
|
import type { NavigatorContextProvider } from '../../../app/navigator-context-provider.js';
|
|
3
3
|
import type { Controller } from '../../../controllers/controller/headless-controller.js';
|
|
4
|
-
import type { ControllersMap } from '../../common/types/controllers.js';
|
|
5
|
-
import type { EngineStaticState } from '../../common/types/engine.js';
|
|
4
|
+
import type { ControllerStaticStateMap, ControllersMap } from '../../common/types/controllers.js';
|
|
6
5
|
import type { SSRCommerceEngine } from '../factories/build-factory.js';
|
|
7
6
|
import type { SSRCommerceEngineOptions } from './build.js';
|
|
8
7
|
import type { SolutionType } from './controller-constants.js';
|
|
@@ -10,7 +9,11 @@ import type { BakedInControllers, ControllerDefinitionsMap } from './controller-
|
|
|
10
9
|
import type { InferControllerPropsMapFromDefinitions, InferControllerStaticStateMapFromDefinitionsWithSolutionType, InferControllersMapFromDefinition } from './controller-inference.js';
|
|
11
10
|
import type { FetchStaticState } from './fetch-static-state.js';
|
|
12
11
|
import type { HydrateStaticState, HydrateStaticStateOptions } from './hydrate-static-state.js';
|
|
13
|
-
export type { HydrateStaticState, HydrateStaticStateOptions, FetchStaticState
|
|
12
|
+
export type { HydrateStaticState, HydrateStaticStateOptions, FetchStaticState };
|
|
13
|
+
export interface EngineStaticState<TSearchAction extends UnknownAction, TControllers extends ControllerStaticStateMap> {
|
|
14
|
+
searchActions: TSearchAction[];
|
|
15
|
+
controllers: TControllers;
|
|
16
|
+
}
|
|
14
17
|
type ReservedControllerNames = 'context' | 'parameterManager' | 'cart';
|
|
15
18
|
type ValidateControllerNames<T extends ControllerDefinitionsMap<Controller>> = {
|
|
16
19
|
[K in keyof T]: K extends ReservedControllerNames ? `ERROR: Controller name "${K & string}" is reserved and cannot be used. Reserved names are: context, parameterManager, cart. Please choose a different controller name.` : T[K];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { UnknownAction } from '@reduxjs/toolkit';
|
|
2
2
|
import type { Controller } from '../../../controllers/controller/headless-controller.js';
|
|
3
3
|
import type { ControllerStaticStateMap, ControllersPropsMap } from '../../common/types/controllers.js';
|
|
4
|
-
import type { EngineStaticState } from '../../common/types/engine.js';
|
|
5
4
|
import type { BuildConfig } from './build.js';
|
|
6
5
|
import type { SolutionType } from './controller-constants.js';
|
|
7
6
|
import type { CommerceEngineDefinitionControllersPropsOption, ControllerDefinitionsMap, FilteredBakedInControllers, OptionsTuple } from './controller-definitions.js';
|
|
7
|
+
import type { EngineStaticState } from './engine.js';
|
|
8
8
|
/**
|
|
9
9
|
* Executes only the initial search for a given configuration, then returns a resumable snapshot of engine state along with the state of the controllers.
|
|
10
10
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { UnknownAction } from '@reduxjs/toolkit';
|
|
2
2
|
import type { ControllerStaticStateMap } from './controllers.js';
|
|
3
3
|
export interface EngineStaticState<TSearchAction extends UnknownAction, TControllers extends ControllerStaticStateMap> {
|
|
4
|
-
|
|
4
|
+
searchAction: TSearchAction;
|
|
5
5
|
controllers: TControllers;
|
|
6
6
|
}
|
|
7
7
|
export type InferStaticState<T extends {
|
|
@@ -9,7 +9,7 @@ export declare function buildControllerDefinitions<TControllerDefinitionsMap ext
|
|
|
9
9
|
engine: TEngine;
|
|
10
10
|
propsMap?: InferControllerPropsMapFromDefinitions<TControllerDefinitionsMap>;
|
|
11
11
|
}): InferControllersMapFromDefinition<TControllerDefinitionsMap>;
|
|
12
|
-
export declare function createStaticState<TSearchAction extends UnknownAction, TControllerDefinitions extends ControllerDefinitionsMap<CoreEngine | CoreEngineNext, Controller>>({
|
|
13
|
-
|
|
12
|
+
export declare function createStaticState<TSearchAction extends UnknownAction, TControllerDefinitions extends ControllerDefinitionsMap<CoreEngine | CoreEngineNext, Controller>>({ searchAction, controllers, }: {
|
|
13
|
+
searchAction: TSearchAction;
|
|
14
14
|
controllers: InferControllersMapFromDefinition<TControllerDefinitions>;
|
|
15
15
|
}): EngineStaticState<TSearchAction, InferControllerStaticStateMapFromDefinitions<TControllerDefinitions>>;
|
|
@@ -5,7 +5,7 @@ import type { OptionsTuple } from '../../common/types/utilities.js';
|
|
|
5
5
|
import type { SearchEngineDefinitionBuildResult, SearchEngineDefinitionControllersPropsOption } from './engine.js';
|
|
6
6
|
export type HydratedState<TEngine extends CoreEngine | CoreEngineNext, TControllers extends ControllersMap> = SearchEngineDefinitionBuildResult<TEngine, TControllers>;
|
|
7
7
|
interface HydrateStaticStateOptions<TSearchAction> {
|
|
8
|
-
|
|
8
|
+
searchAction: TSearchAction;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Creates a new engine from the snapshot of the engine created in SSR with fetchStaticState.
|