@coveo/quantic 3.30.0-pre.7fbcdbbb29 → 3.30.0-pre.80b4cd73f4
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 +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/commerce/types/build.d.ts +5 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/types/controller-definitions.d.ts +3 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/types/kind.d.ts +3 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/common/types/build.d.ts +7 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/common/types/hydrate-static-state.d.ts +4 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-commerce-next.index.d.ts +9 -10
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controller-utils.d.ts +7 -6
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/breadcrumb-manager/headless-core-breadcrumb-manager.ssr.d.ts +3 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/cart/headless-cart.ssr.d.ts +1 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/context/headless-context.ssr.d.ts +2 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/did-you-mean/headless-did-you-mean.ssr.d.ts +2 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/filter-suggestions/headless-filter-suggestions-generator.ssr.d.ts +1 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/generator/headless-commerce-facet-generator.ssr.d.ts +3 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/instant-products/headless-instant-products.ssr.d.ts +1 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/pagination/headless-core-commerce-pagination.ssr.d.ts +3 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/parameter-manager/headless-core-parameter-manager.ssr.d.ts +3 -13
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/product-list/headless-product-list.ssr.d.ts +3 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/product-view/headless-product-view.ssr.d.ts +1 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/recent-queries-list/headless-recent-queries-list.ssr.d.ts +1 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/recommendations/headless-recommendations.ssr.d.ts +4 -8
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/search-box/headless-search-box.ssr.d.ts +1 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/sort/headless-core-commerce-sort.ssr.d.ts +3 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/standalone-search-box/headless-standalone-search-box.ssr.d.ts +1 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/summary/headless-core-summary.ssr.d.ts +3 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/triggers/headless-notify-trigger.ssr.d.ts +1 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/triggers/headless-query-trigger.ssr.d.ts +1 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/triggers/headless-redirection-trigger.ssr.d.ts +1 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/factories/build-factory.d.ts +5 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/factories/hydrated-state-factory.d.ts +5 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/factories/recommendation-hydrated-state-factory.d.ts +3 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/factories/recommendation-static-state-factory.d.ts +12 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/factories/static-state-factory.d.ts +7 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/build.d.ts +2 -8
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/controller-definitions.d.ts +4 -53
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/controller-scopes.d.ts +0 -6
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/engine.d.ts +9 -18
- 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/commerce/utils/recommendation-filter.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/common/builders/static-controller-builder.d.ts +1 -6
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/common/errors.d.ts +0 -3
- 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/common/types/utilities.d.ts +0 -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/build.d.ts +2 -6
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/search/types/engine.d.ts +1 -1
- 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/definitions/test/mock-ssr-controller-definitions.d.ts +0 -3
- package/force-app/main/default/staticresources/coveoheadless/headless.js +11 -11
- 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
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/kind.d.ts +0 -9
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,14 +5,16 @@ import type { SSRCommerceEngine } from '../factories/build-factory.js';
|
|
|
5
5
|
import type { SolutionType } from './controller-constants.js';
|
|
6
6
|
import type { ControllerDefinitionsMap, EngineDefinitionBuildResult, EngineDefinitionControllersPropsOption } from './controller-definitions.js';
|
|
7
7
|
/**
|
|
8
|
-
* @deprecated This type should not be used directly.
|
|
9
|
-
* @internal
|
|
8
|
+
* @deprecated This type should not be used directly. This interface will be removed in the next major release
|
|
10
9
|
*/
|
|
11
10
|
export interface BuildOptions<TEngineOptions> {
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated This option will be removed in the next major version.
|
|
13
|
+
*/
|
|
12
14
|
extend?: OptionsExtender<TEngineOptions>;
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
15
|
-
*
|
|
17
|
+
* This type should not be used directly.
|
|
16
18
|
* @internal
|
|
17
19
|
*/
|
|
18
20
|
export type Build<TEngineOptions, TControllersMap extends ControllersMap, TControllersProps extends ControllersPropsMap, TControllersDefinitionsMap extends ControllerDefinitionsMap<Controller>, TSolutionType extends SolutionType> = (...params: OptionsTuple<BuildOptions<TEngineOptions> & EngineDefinitionControllersPropsOption<TControllersDefinitionsMap, TControllersProps, TSolutionType>>) => Promise<EngineDefinitionBuildResult<SSRCommerceEngine, TControllersMap>>;
|
|
@@ -170,6 +170,9 @@ type DefaultControllerProps<TControllers extends ControllerDefinitionsMap<Contro
|
|
|
170
170
|
[I in keyof TControllersPropsMap as I extends K ? I : never]: TControllersPropsMap[I];
|
|
171
171
|
};
|
|
172
172
|
type ConditionalControllerProps<TControllers extends ControllerDefinitionsMap<Controller>, TControllersPropsMap extends ControllersPropsMap, TSolutionType extends SolutionType, K extends keyof TControllers> = TSolutionType extends SolutionType.recommendation ? RecommendationControllerProps<TControllers, TControllersPropsMap, K> : DefaultControllerProps<TControllers, TControllersPropsMap, K>;
|
|
173
|
+
/**
|
|
174
|
+
* @deprecated This interface is no longer used and will be removed in next major version.
|
|
175
|
+
*/
|
|
173
176
|
export interface ControllerDefinitionOption {
|
|
174
177
|
/**
|
|
175
178
|
* Whether the controller will be used in a product listing context.
|
package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/common/types/build.d.ts
CHANGED
|
@@ -2,11 +2,18 @@ import type { CoreEngine, CoreEngineNext } from '../../../app/engine.js';
|
|
|
2
2
|
import type { ControllersMap, ControllersPropsMap } from './controllers.js';
|
|
3
3
|
import type { EngineDefinitionBuildResult, EngineDefinitionControllersPropsOption } from './engine.js';
|
|
4
4
|
import type { OptionsExtender, OptionsTuple } from './utilities.js';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated This type should not be used directly. This interface will be removed in the next major release
|
|
7
|
+
*/
|
|
5
8
|
interface BuildOptions<TEngineOptions> {
|
|
6
9
|
/**
|
|
7
10
|
* @deprecated This option will be removed in the next major version.
|
|
8
11
|
*/
|
|
9
12
|
extend?: OptionsExtender<TEngineOptions>;
|
|
10
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* This type should not be used directly.
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
11
18
|
export type Build<TEngine extends CoreEngine | CoreEngineNext, TEngineOptions, TControllersMap extends ControllersMap, TControllersProps extends ControllersPropsMap> = (...params: OptionsTuple<BuildOptions<TEngineOptions> & EngineDefinitionControllersPropsOption<TControllersProps>>) => Promise<EngineDefinitionBuildResult<TEngine, TControllersMap>>;
|
|
12
19
|
export {};
|
|
@@ -5,6 +5,10 @@ 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
|
+
*/
|
|
8
12
|
searchAction: TSearchAction;
|
|
9
13
|
}
|
|
10
14
|
export interface HydratedState<TEngine extends CoreEngine | CoreEngineNext, TControllers extends ControllersMap> extends EngineDefinitionBuildResult<TEngine, TControllers> {
|
|
@@ -76,27 +76,27 @@ export type { LoggerOptions, LogLevel } from './app/logger.js';
|
|
|
76
76
|
export type { BrowserNavigatorContextProvider, NavigatorContext, NavigatorContextProvider, } from './app/navigator-context-provider.js';
|
|
77
77
|
export type { InteractiveProduct, InteractiveProductOptions, InteractiveProductProps, } from './controllers/commerce/core/interactive-product/headless-core-interactive-product.js';
|
|
78
78
|
export type { Controller, Subscribable, } from './controllers/controller/headless-controller.js';
|
|
79
|
-
export type { BreadcrumbManager, BreadcrumbManagerState, } from './ssr-next/commerce/controllers/breadcrumb-manager/headless-core-breadcrumb-manager.ssr.js';
|
|
79
|
+
export type { BreadcrumbManager, BreadcrumbManagerDefinition, BreadcrumbManagerState, } from './ssr-next/commerce/controllers/breadcrumb-manager/headless-core-breadcrumb-manager.ssr.js';
|
|
80
80
|
export { defineBreadcrumbManager } from './ssr-next/commerce/controllers/breadcrumb-manager/headless-core-breadcrumb-manager.ssr.js';
|
|
81
81
|
export type { Cart, CartBuildProps, CartDefinition, CartInitialState, CartItem, CartProps, CartState, } from './ssr-next/commerce/controllers/cart/headless-cart.ssr.js';
|
|
82
82
|
export { defineCart } from './ssr-next/commerce/controllers/cart/headless-cart.ssr.js';
|
|
83
83
|
export type { Context, ContextDefinition, ContextOptions, ContextProps, ContextState, UserLocation, View, } from './ssr-next/commerce/controllers/context/headless-context.ssr.js';
|
|
84
84
|
export { defineContext } from './ssr-next/commerce/controllers/context/headless-context.ssr.js';
|
|
85
|
-
export type { DidYouMean, DidYouMeanState, } from './ssr-next/commerce/controllers/did-you-mean/headless-did-you-mean.ssr.js';
|
|
85
|
+
export type { DidYouMean, DidYouMeanDefinition, DidYouMeanState, } from './ssr-next/commerce/controllers/did-you-mean/headless-did-you-mean.ssr.js';
|
|
86
86
|
export { defineDidYouMean } from './ssr-next/commerce/controllers/did-you-mean/headless-did-you-mean.ssr.js';
|
|
87
87
|
export type { CategoryFilterSuggestions, CategoryFilterSuggestionsState, FieldSuggestionsFacet, FilterSuggestions, FilterSuggestionsGenerator, FilterSuggestionsGeneratorDefinition, FilterSuggestionsState, GeneratedFilterSuggestionsControllers, } from './ssr-next/commerce/controllers/filter-suggestions/headless-filter-suggestions-generator.ssr.js';
|
|
88
88
|
export { defineFilterSuggestionsGenerator } from './ssr-next/commerce/controllers/filter-suggestions/headless-filter-suggestions-generator.ssr.js';
|
|
89
|
-
export type { BaseFacetSearchResult, CategoryFacet, CategoryFacetSearchResult, CategoryFacetState, CategoryFacetValue, CoreCommerceFacet, DateFacet, DateFacetState, DateFacetValue, FacetGenerator, FacetGeneratorState, FacetType, LocationFacet, LocationFacetState, LocationFacetValue, MappedFacetState, MappedFacetStates, MappedGeneratedFacetController, NumericFacet, NumericFacetState, NumericFacetValue, RegularFacet, RegularFacetState, RegularFacetValue, } from './ssr-next/commerce/controllers/generator/headless-commerce-facet-generator.ssr.js';
|
|
89
|
+
export type { BaseFacetSearchResult, CategoryFacet, CategoryFacetSearchResult, CategoryFacetState, CategoryFacetValue, CoreCommerceFacet, DateFacet, DateFacetState, DateFacetValue, FacetGenerator, FacetGeneratorDefinition, FacetGeneratorState, FacetType, LocationFacet, LocationFacetState, LocationFacetValue, MappedFacetState, MappedFacetStates, MappedGeneratedFacetController, NumericFacet, NumericFacetState, NumericFacetValue, RegularFacet, RegularFacetState, RegularFacetValue, } from './ssr-next/commerce/controllers/generator/headless-commerce-facet-generator.ssr.js';
|
|
90
90
|
export { defineFacetGenerator } from './ssr-next/commerce/controllers/generator/headless-commerce-facet-generator.ssr.js';
|
|
91
91
|
export type { InstantProducts, InstantProductsDefinition, InstantProductsOptions, InstantProductsProps, InstantProductsState, } from './ssr-next/commerce/controllers/instant-products/headless-instant-products.ssr.js';
|
|
92
92
|
export { defineInstantProducts } from './ssr-next/commerce/controllers/instant-products/headless-instant-products.ssr.js';
|
|
93
|
-
export type { CorePaginationOptions, Pagination, PaginationOptions, PaginationProps, PaginationState, } from './ssr-next/commerce/controllers/pagination/headless-core-commerce-pagination.ssr.js';
|
|
93
|
+
export type { CorePaginationOptions, Pagination, PaginationDefinition, PaginationOptions, PaginationProps, PaginationState, } from './ssr-next/commerce/controllers/pagination/headless-core-commerce-pagination.ssr.js';
|
|
94
94
|
export { definePagination } from './ssr-next/commerce/controllers/pagination/headless-core-commerce-pagination.ssr.js';
|
|
95
95
|
export type { CommerceSearchParameters, ParameterManager, ParameterManagerDefinition, ParameterManagerProps, ParameterManagerState, Parameters, ProductListingParameters, SSRParameterManagerProps, } from './ssr-next/commerce/controllers/parameter-manager/headless-core-parameter-manager.ssr.js';
|
|
96
96
|
export { defineParameterManager } from './ssr-next/commerce/controllers/parameter-manager/headless-core-parameter-manager.ssr.js';
|
|
97
|
-
export type { ProductList, ProductListing, ProductListState, Search, } from './ssr-next/commerce/controllers/product-list/headless-product-list.ssr.js';
|
|
97
|
+
export type { ProductList, ProductListDefinition, ProductListing, ProductListState, Search, } from './ssr-next/commerce/controllers/product-list/headless-product-list.ssr.js';
|
|
98
98
|
export { defineProductList } from './ssr-next/commerce/controllers/product-list/headless-product-list.ssr.js';
|
|
99
|
-
export type { ProductView } from './ssr-next/commerce/controllers/product-view/headless-product-view.ssr.js';
|
|
99
|
+
export type { ProductView, ProductViewDefinition, } from './ssr-next/commerce/controllers/product-view/headless-product-view.ssr.js';
|
|
100
100
|
export { defineProductView } from './ssr-next/commerce/controllers/product-view/headless-product-view.ssr.js';
|
|
101
101
|
export type { RecentQueriesList, RecentQueriesListDefinition, RecentQueriesListInitialState, RecentQueriesListOptions, RecentQueriesListProps, RecentQueriesState, } from './ssr-next/commerce/controllers/recent-queries-list/headless-recent-queries-list.ssr.js';
|
|
102
102
|
export { defineRecentQueriesList } from './ssr-next/commerce/controllers/recent-queries-list/headless-recent-queries-list.ssr.js';
|
|
@@ -104,11 +104,11 @@ export type { Recommendations, RecommendationsDefinition, RecommendationsState,
|
|
|
104
104
|
export { defineRecommendations } from './ssr-next/commerce/controllers/recommendations/headless-recommendations.ssr.js';
|
|
105
105
|
export type { CoreSearchBox, SearchBox, SearchBoxDefinition, SearchBoxOptions, SearchBoxProps, SearchBoxState, Suggestion, } from './ssr-next/commerce/controllers/search-box/headless-search-box.ssr.js';
|
|
106
106
|
export { defineSearchBox } from './ssr-next/commerce/controllers/search-box/headless-search-box.ssr.js';
|
|
107
|
-
export type { Sort, SortProps, SortState, } from './ssr-next/commerce/controllers/sort/headless-core-commerce-sort.ssr.js';
|
|
107
|
+
export type { Sort, SortDefinition, SortProps, SortState, } from './ssr-next/commerce/controllers/sort/headless-core-commerce-sort.ssr.js';
|
|
108
108
|
export { defineSort } from './ssr-next/commerce/controllers/sort/headless-core-commerce-sort.ssr.js';
|
|
109
109
|
export type { StandaloneSearchBox, StandaloneSearchBoxDefinition, StandaloneSearchBoxProps, StandaloneSearchBoxState, } from './ssr-next/commerce/controllers/standalone-search-box/headless-standalone-search-box.ssr.js';
|
|
110
110
|
export { defineStandaloneSearchBox } from './ssr-next/commerce/controllers/standalone-search-box/headless-standalone-search-box.ssr.js';
|
|
111
|
-
export type { ProductListingSummaryState, RecommendationsSummaryState, SearchSummaryState, Summary, SummaryState, } from './ssr-next/commerce/controllers/summary/headless-core-summary.ssr.js';
|
|
111
|
+
export type { ProductListingSummaryState, RecommendationsSummaryState, SearchSummaryState, Summary, SummaryDefinition, SummaryState, } from './ssr-next/commerce/controllers/summary/headless-core-summary.ssr.js';
|
|
112
112
|
export { defineSummary } from './ssr-next/commerce/controllers/summary/headless-core-summary.ssr.js';
|
|
113
113
|
export type { NotifyTrigger, NotifyTriggerDefinition, NotifyTriggerState, } from './ssr-next/commerce/controllers/triggers/headless-notify-trigger.ssr.js';
|
|
114
114
|
export { defineNotifyTrigger } from './ssr-next/commerce/controllers/triggers/headless-notify-trigger.ssr.js';
|
|
@@ -120,10 +120,9 @@ export { defineCommerceEngine } from './ssr-next/commerce/engine/commerce-engine
|
|
|
120
120
|
export type { SSRCommerceEngine as CommerceEngine } from './ssr-next/commerce/factories/build-factory.js';
|
|
121
121
|
export type { BuildConfig, SSRCommerceEngineOptions, } from './ssr-next/commerce/types/build.js';
|
|
122
122
|
export { SolutionType } from './ssr-next/commerce/types/controller-constants.js';
|
|
123
|
-
export type { CommerceEngineDefinitionControllersPropsOption as EngineDefinitionControllersPropsOption, ControllerDefinition, ControllerDefinitionsMap,
|
|
123
|
+
export type { CommerceEngineDefinitionControllersPropsOption as EngineDefinitionControllersPropsOption, ControllerDefinition, ControllerDefinitionsMap, HydratedState, InferControllerStaticStateFromController, InferControllerStaticStateMapFromControllers, OptionsTuple, } from './ssr-next/commerce/types/controller-definitions.js';
|
|
124
124
|
export type { InferControllerFromDefinition, InferControllerPropsMapFromDefinitions, InferControllerStaticStateMapFromDefinitionsWithSolutionType, InferControllersMapFromDefinition, InferHydratedState, InferStaticState, } from './ssr-next/commerce/types/controller-inference.js';
|
|
125
125
|
export type { CommerceEngineDefinition, CommerceEngineDefinitionBuildResult, CommerceEngineDefinitionOptions, EngineStaticState, FetchStaticState, HydrateStaticState, HydrateStaticStateOptions, } from './ssr-next/commerce/types/engine.js';
|
|
126
|
-
export { Kind } from './ssr-next/commerce/types/kind.js';
|
|
127
126
|
export type { CommerceAppState, CommerceProductListingParametersState, CommerceSearchParametersState, } from './state/commerce-app-state.js';
|
|
128
127
|
export * from './features/commerce/configuration/configuration-actions-loader.js';
|
|
129
128
|
export * from './features/commerce/context/cart/cart-actions-loader.js';
|
|
@@ -2,17 +2,18 @@ import type { UnknownAction } from '@reduxjs/toolkit';
|
|
|
2
2
|
import type { Controller } from '../../controllers/controller/headless-controller.js';
|
|
3
3
|
import type { SSRCommerceEngine } from './factories/build-factory.js';
|
|
4
4
|
import type { SolutionType } from './types/controller-constants.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { ControllerDefinitionsMap, FilteredBakedInControllers } from './types/controller-definitions.js';
|
|
6
6
|
import type { InferControllerPropsMapFromDefinitions, InferControllerStaticStateMapFromDefinitionsWithSolutionType, InferControllersMapFromDefinition } from './types/controller-inference.js';
|
|
7
|
-
|
|
8
|
-
export declare function createStaticState<TSearchAction extends UnknownAction, TControllerDefinitions extends ControllerDefinitionsMap<Controller>>({ searchActions, controllers, }: {
|
|
7
|
+
export declare function createStaticState<TSearchAction extends UnknownAction, TControllerDefinitions extends ControllerDefinitionsMap<Controller>, TSolutionType extends SolutionType>({ searchActions, controllers, }: {
|
|
9
8
|
searchActions: TSearchAction[];
|
|
10
|
-
controllers:
|
|
11
|
-
}):
|
|
9
|
+
controllers: Record<string, Controller>;
|
|
10
|
+
}): {
|
|
11
|
+
controllers: InferControllerStaticStateMapFromDefinitionsWithSolutionType<TControllerDefinitions, TSolutionType> & FilteredBakedInControllers<TSolutionType>;
|
|
12
|
+
searchActions: TSearchAction[];
|
|
13
|
+
};
|
|
12
14
|
export declare function buildControllerDefinitions<TControllerDefinitionsMap extends ControllerDefinitionsMap<Controller>, TSolutionType extends SolutionType>({ definitionsMap, engine, solutionType, propsMap, }: {
|
|
13
15
|
definitionsMap: TControllerDefinitionsMap;
|
|
14
16
|
engine: SSRCommerceEngine;
|
|
15
17
|
solutionType: TSolutionType;
|
|
16
18
|
propsMap?: InferControllerPropsMapFromDefinitions<TControllerDefinitionsMap>;
|
|
17
19
|
}): InferControllersMapFromDefinition<TControllerDefinitionsMap, TSolutionType>;
|
|
18
|
-
export declare function ensureAtLeastOneSolutionType(options?: ControllerDefinitionOption): void;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { BreadcrumbManager, BreadcrumbManagerState } from '../../../../controllers/commerce/core/breadcrumb-manager/headless-core-breadcrumb-manager.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SearchAndListingControllerDefinitionWithoutProps } from '../../types/controller-definitions.js';
|
|
3
3
|
export type { BreadcrumbManager, BreadcrumbManagerState };
|
|
4
|
+
export type BreadcrumbManagerDefinition = SearchAndListingControllerDefinitionWithoutProps<BreadcrumbManager>;
|
|
4
5
|
/**
|
|
5
6
|
* Defines a `BreadcrumbManager` controller instance.
|
|
6
7
|
* @group Definers
|
|
7
8
|
*
|
|
8
9
|
* @returns The `BreadcrumbManager` controller definition.
|
|
9
10
|
*/
|
|
10
|
-
export declare function defineBreadcrumbManager
|
|
11
|
+
export declare function defineBreadcrumbManager(): BreadcrumbManagerDefinition;
|
|
@@ -4,8 +4,7 @@ export type { Cart, CartInitialState, CartItem, CartProps, CartState };
|
|
|
4
4
|
export interface CartBuildProps {
|
|
5
5
|
initialState: CartInitialState;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
8
|
-
}
|
|
7
|
+
export type CartDefinition = UniversalControllerDefinitionWithProps<Cart, CartBuildProps>;
|
|
9
8
|
/**
|
|
10
9
|
* Defines a `Cart` controller instance.
|
|
11
10
|
* @group Definers
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { type Context, type ContextOptions, type ContextProps, type ContextState, type UserLocation, type View } from '../../../../controllers/commerce/context/headless-context.js';
|
|
2
2
|
import type { UniversalControllerDefinitionWithProps } from '../../types/controller-definitions.js';
|
|
3
3
|
export type { Context, ContextProps, ContextState, View, UserLocation, ContextOptions, };
|
|
4
|
-
export
|
|
4
|
+
export type ContextDefinition = UniversalControllerDefinitionWithProps<Context, {
|
|
5
5
|
initialState: ContextOptions;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
6
|
+
}>;
|
|
8
7
|
/**
|
|
9
8
|
* Defines a `Context` controller instance.
|
|
10
9
|
* @group Definers
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { DidYouMean, DidYouMeanState } from '../../../../controllers/commerce/search/did-you-mean/headless-did-you-mean.js';
|
|
2
2
|
import type { SearchOnlyControllerDefinitionWithoutProps } from '../../types/controller-definitions.js';
|
|
3
3
|
export type { DidYouMean, DidYouMeanState };
|
|
4
|
+
export type DidYouMeanDefinition = SearchOnlyControllerDefinitionWithoutProps<DidYouMean>;
|
|
4
5
|
/**
|
|
5
6
|
* Defines a `DidYouMean` controller instance.
|
|
6
7
|
* @group Definers
|
|
7
8
|
*
|
|
8
9
|
* @returns The `DidYouMean` controller definition.
|
|
9
10
|
*/
|
|
10
|
-
export declare function defineDidYouMean():
|
|
11
|
+
export declare function defineDidYouMean(): DidYouMeanDefinition;
|
|
@@ -4,8 +4,7 @@ import type { FilterSuggestions, FilterSuggestionsState } from '../../../../cont
|
|
|
4
4
|
import { type FilterSuggestionsGenerator, type GeneratedFilterSuggestionsControllers } from '../../../../controllers/commerce/filter-suggestions/headless-filter-suggestions-generator.js';
|
|
5
5
|
import type { NonRecommendationControllerDefinitionWithoutProps } from '../../types/controller-definitions.js';
|
|
6
6
|
export type { FilterSuggestionsGenerator, GeneratedFilterSuggestionsControllers, FieldSuggestionsFacet, CategoryFilterSuggestions, CategoryFilterSuggestionsState, FilterSuggestions, FilterSuggestionsState, };
|
|
7
|
-
export
|
|
8
|
-
}
|
|
7
|
+
export type FilterSuggestionsGeneratorDefinition = NonRecommendationControllerDefinitionWithoutProps<FilterSuggestionsGenerator>;
|
|
9
8
|
/**
|
|
10
9
|
* Defines the `FilterSuggestionsGenerator` controller for the purpose of server-side rendering.
|
|
11
10
|
* @group Definers
|
|
@@ -10,7 +10,7 @@ import type { NumericFacet, NumericFacetState, NumericFacetValue } from '../../.
|
|
|
10
10
|
import type { RegularFacet, RegularFacetState } from '../../../../controllers/commerce/core/facets/regular/headless-commerce-regular-facet.js';
|
|
11
11
|
import type { LocationFacetValue, RegularFacetValue } from '../../../../features/commerce/facets/facet-set/interfaces/response.js';
|
|
12
12
|
import { SolutionType } from '../../types/controller-constants.js';
|
|
13
|
-
import type {
|
|
13
|
+
import type { SearchAndListingControllerDefinitionWithoutProps } from '../../types/controller-definitions.js';
|
|
14
14
|
export type { BaseFacetSearchResult, CategoryFacet, CategoryFacetState, CategoryFacetValue, CategoryFacetSearchResult, CoreCommerceFacet, DateFacet, DateFacetValue, DateFacetState, NumericFacet, NumericFacetValue, NumericFacetState, RegularFacet, RegularFacetState, RegularFacetValue, LocationFacet, LocationFacetState, LocationFacetValue, MappedGeneratedFacetController, };
|
|
15
15
|
export type FacetGeneratorState = MappedFacetStates;
|
|
16
16
|
export type MappedFacetStates = Array<MappedFacetState[FacetType]>;
|
|
@@ -18,10 +18,11 @@ export type { FacetType };
|
|
|
18
18
|
export type MappedFacetState = {
|
|
19
19
|
[T in FacetType]: T extends 'numericalRange' ? NumericFacetState : T extends 'regular' ? RegularFacetState : T extends 'dateRange' ? DateFacetState : T extends 'hierarchical' ? CategoryFacetState : T extends 'location' ? LocationFacetState : never;
|
|
20
20
|
};
|
|
21
|
+
export type FacetGeneratorDefinition = SearchAndListingControllerDefinitionWithoutProps<FacetGenerator>;
|
|
21
22
|
/**
|
|
22
23
|
* @group Definers
|
|
23
24
|
*/
|
|
24
|
-
export declare function defineFacetGenerator
|
|
25
|
+
export declare function defineFacetGenerator(): FacetGeneratorDefinition;
|
|
25
26
|
/**
|
|
26
27
|
* The `FacetGenerator` headless sub-controller creates commerce facet sub-controllers from the Commerce API search or
|
|
27
28
|
* product listing response.
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type InstantProducts, type InstantProductsOptions, type InstantProductsProps, type InstantProductsState } from '../../../../controllers/commerce/instant-products/headless-instant-products.js';
|
|
2
2
|
import type { NonRecommendationControllerDefinitionWithoutProps } from '../../types/controller-definitions.js';
|
|
3
3
|
export type { InstantProductsOptions, InstantProductsState, InstantProducts, InstantProductsProps, };
|
|
4
|
-
export
|
|
5
|
-
}
|
|
4
|
+
export type InstantProductsDefinition = NonRecommendationControllerDefinitionWithoutProps<InstantProducts>;
|
|
6
5
|
/**
|
|
7
6
|
* Defines the `InstantProducts` controller for the purpose of server-side rendering.
|
|
8
7
|
* @group Definers
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CorePaginationOptions, Pagination, PaginationOptions, PaginationProps, PaginationState } from '../../../../controllers/commerce/core/pagination/headless-core-commerce-pagination.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SearchAndListingControllerDefinitionWithoutProps } from '../../types/controller-definitions.js';
|
|
3
3
|
export type { Pagination, PaginationProps, PaginationState, PaginationOptions, CorePaginationOptions, };
|
|
4
|
+
export type PaginationDefinition = SearchAndListingControllerDefinitionWithoutProps<Pagination>;
|
|
4
5
|
/**
|
|
5
6
|
* Defines a `Pagination` controller instance.
|
|
6
7
|
* @group Definers
|
|
@@ -8,4 +9,4 @@ export type { Pagination, PaginationProps, PaginationState, PaginationOptions, C
|
|
|
8
9
|
* @param props - The configurable `Pagination` properties.
|
|
9
10
|
* @returns The `Pagination` controller definition.
|
|
10
11
|
*/
|
|
11
|
-
export declare function definePagination
|
|
12
|
+
export declare function definePagination(props?: PaginationProps): PaginationDefinition;
|
|
@@ -2,25 +2,15 @@ import type { ParameterManager, ParameterManagerProps, ParameterManagerState } f
|
|
|
2
2
|
import type { Parameters } from '../../../../features/commerce/parameters/parameters-actions.js';
|
|
3
3
|
import type { ProductListingParameters } from '../../../../features/commerce/product-listing-parameters/product-listing-parameters-actions.js';
|
|
4
4
|
import type { CommerceSearchParameters } from '../../../../features/commerce/search-parameters/search-parameters-actions.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { SearchAndListingControllerDefinitionWithProps } from '../../types/controller-definitions.js';
|
|
6
6
|
export type { ParameterManager, ParameterManagerProps, ParameterManagerState, Parameters, ProductListingParameters, CommerceSearchParameters, };
|
|
7
|
-
export type ParameterManagerDefinition
|
|
7
|
+
export type ParameterManagerDefinition = SearchAndListingControllerDefinitionWithProps<ParameterManager<ProductListingParameters | CommerceSearchParameters>, SSRParameterManagerProps<ProductListingParameters | CommerceSearchParameters>>;
|
|
8
8
|
/**
|
|
9
9
|
* Defines a `ParameterManager` controller instance.
|
|
10
10
|
* @group Definers
|
|
11
11
|
*
|
|
12
12
|
* @returns The `ParameterManager` controller definition.
|
|
13
13
|
*/
|
|
14
|
-
export declare function defineParameterManager
|
|
14
|
+
export declare function defineParameterManager(): ParameterManagerDefinition;
|
|
15
15
|
export interface SSRParameterManagerProps<T extends Parameters> extends Omit<ParameterManagerProps<T>, 'excludeDefaultParameters'> {
|
|
16
16
|
}
|
|
17
|
-
type MappedParameterTypes<TOptions extends ControllerDefinitionOption | undefined> = TOptions extends {
|
|
18
|
-
listing: true;
|
|
19
|
-
search: true;
|
|
20
|
-
} | undefined ? ProductListingParameters | CommerceSearchParameters : TOptions extends {
|
|
21
|
-
listing: true;
|
|
22
|
-
search: false;
|
|
23
|
-
} ? ProductListingParameters : TOptions extends {
|
|
24
|
-
listing: false;
|
|
25
|
-
search: true;
|
|
26
|
-
} ? CommerceSearchParameters : never;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { type ProductListing, type ProductListingState } from '../../../../controllers/commerce/product-listing/headless-product-listing.js';
|
|
2
2
|
import { type Search } from '../../../../controllers/commerce/search/headless-search.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { SearchAndListingControllerDefinitionWithoutProps } from '../../types/controller-definitions.js';
|
|
4
4
|
export type { Search, ProductListing, ProductListingState as ProductListState };
|
|
5
5
|
export type ProductList = Pick<ProductListing | Search, 'state' | 'subscribe' | 'interactiveProduct' | 'promoteChildToParent'>;
|
|
6
|
+
export type ProductListDefinition = SearchAndListingControllerDefinitionWithoutProps<ProductList>;
|
|
6
7
|
/**
|
|
7
8
|
* Defines a `ProductList` controller instance.
|
|
8
9
|
* @group Definers
|
|
9
10
|
*
|
|
10
11
|
* @returns The `ProductList` controller definition.
|
|
11
12
|
*/
|
|
12
|
-
export declare function defineProductList
|
|
13
|
+
export declare function defineProductList(): ProductListDefinition;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type ProductView as BaseProductView } from '../../../../controllers/commerce/product-view/headless-product-view.js';
|
|
2
2
|
import { type Controller } from '../../../../controllers/controller/headless-controller.js';
|
|
3
3
|
import type { NonRecommendationControllerDefinitionWithoutProps } from '../../types/controller-definitions.js';
|
|
4
|
-
|
|
5
|
-
}
|
|
4
|
+
export type ProductViewDefinition = NonRecommendationControllerDefinitionWithoutProps<ProductView>;
|
|
6
5
|
/**
|
|
7
6
|
* Defines a `ProductView` controller instance.
|
|
8
7
|
*
|
|
@@ -17,4 +16,3 @@ interface ProductViewDefinition extends NonRecommendationControllerDefinitionWit
|
|
|
17
16
|
export declare function defineProductView(): ProductViewDefinition;
|
|
18
17
|
export interface ProductView extends BaseProductView, Controller {
|
|
19
18
|
}
|
|
20
|
-
export {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type RecentQueriesList, type RecentQueriesListInitialState, type RecentQueriesListOptions, type RecentQueriesListProps, type RecentQueriesState } from '../../../../controllers/commerce/recent-queries-list/headless-recent-queries-list.js';
|
|
2
2
|
import type { NonRecommendationControllerDefinitionWithoutProps } from '../../types/controller-definitions.js';
|
|
3
3
|
export type { RecentQueriesListInitialState, RecentQueriesListOptions, RecentQueriesState, RecentQueriesList, RecentQueriesListProps, };
|
|
4
|
-
export
|
|
5
|
-
}
|
|
4
|
+
export type RecentQueriesListDefinition = NonRecommendationControllerDefinitionWithoutProps<RecentQueriesList>;
|
|
6
5
|
/**
|
|
7
6
|
* Defines the `RecentQueriesList` controller for the purpose of server-side rendering.
|
|
8
7
|
* @group Definers
|