@coveo/quantic 3.11.0 → 3.12.0
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/README.md +1 -1
- package/docs/out/quantic-docs.json +27 -0
- package/force-app/main/default/lwc/quanticBreadcrumbManager/__tests__/quanticBreadcrumbManager.test.js +610 -0
- package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/fixture.ts +76 -0
- package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/pageObject.ts +282 -0
- package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/quanticBreadcrumbManager.e2e.ts +167 -0
- package/force-app/main/default/lwc/quanticBreadcrumbManager/quanticBreadcrumbManager.html +10 -10
- package/force-app/main/default/lwc/quanticBreadcrumbManager/quanticBreadcrumbManager.js +8 -8
- package/force-app/main/default/lwc/quanticFeedbackModalQna/templates/quanticFeedbackModalQna.html +1 -0
- package/force-app/main/default/lwc/quanticGeneratedAnswer/__tests__/quanticGeneratedAnswer.test.js +538 -21
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/data.ts +56 -0
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/fixture.ts +87 -0
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/pageObject.ts +279 -0
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/quanticGeneratedAnswer.e2e.ts +178 -0
- package/force-app/main/default/lwc/quanticGeneratedAnswer/templates/generatedAnswer.html +24 -10
- package/force-app/main/default/lwc/quanticGeneratedAnswer/templates/retryPrompt.html +2 -2
- package/force-app/main/default/lwc/quanticGeneratedAnswerToggle/quanticGeneratedAnswerToggle.html +1 -1
- package/force-app/main/default/lwc/quanticPager/e2e/fixture.ts +4 -4
- package/force-app/main/default/lwc/quanticPager/e2e/{pagerObject.ts → pageObject.ts} +1 -1
- package/force-app/main/default/lwc/quanticTab/__tests__/quanticTab.test.js +287 -0
- package/force-app/main/default/lwc/quanticTab/e2e/fixture.ts +62 -0
- package/force-app/main/default/lwc/quanticTab/e2e/pageObject.ts +67 -0
- package/force-app/main/default/lwc/quanticTab/e2e/quanticTab.e2e.ts +77 -0
- package/force-app/main/default/lwc/quanticTab/quanticTab.html +1 -1
- package/force-app/main/default/lwc/quanticTabBar/__tests__/quanticTabBar.test.js +331 -0
- package/force-app/main/default/lwc/quanticTabBar/e2e/fixture.ts +61 -0
- package/force-app/main/default/lwc/quanticTabBar/e2e/pageObject.ts +80 -0
- package/force-app/main/default/lwc/quanticTabBar/e2e/quanticTabBar.e2e.ts +173 -0
- package/force-app/main/default/lwc/quanticTabBar/quanticTabBar.html +30 -8
- package/force-app/main/default/lwc/quanticTabBar/quanticTabBar.js +5 -4
- package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/pageObject.ts +1 -1
- package/force-app/main/default/lwc/quanticUserActionsToggle/quanticUserActionsToggle.js +4 -0
- package/force-app/main/default/lwc/quanticUtils/__tests__/markdownUtils.test.js +1 -1
- package/force-app/main/default/staticresources/coveobueno/browser/bueno.js +4 -4
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +8 -10
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/analytics/instant-result-analytics.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/analytics/search-analytics.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/common/request.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/stream-answer-api.d.ts +4 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/search/search-api-params.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/case-assist/case-assist-params.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/insight/insight-params.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/app/commerce-engine/commerce-engine.ssr.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/app/commerce-ssr-engine/factories/build-factory.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/app/commerce-ssr-engine/factories/utils/recommendation-filter.d.ts +11 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/app/commerce-ssr-engine/types/common.d.ts +12 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/app/commerce-ssr-engine/types/kind.d.ts +9 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/app/undoable.d.ts +0 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/commerce.index.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/breadcrumb-manager/headless-core-breadcrumb-manager.ssr.d.ts +1 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/facets/generator/headless-commerce-facet-generator.ssr.d.ts +3 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/parameter-manager/headless-core-parameter-manager.d.ts +7 -6
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/parameter-manager/headless-core-parameter-manager.ssr.d.ts +3 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/sub-controller/headless-sub-controller.d.ts +1 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/sub-controller/headless-sub-controller.ssr.d.ts +2 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/url-manager/headless-core-url-manager.d.ts +11 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/product-list/headless-product-list.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/product-view/headless-product-view.ssr.d.ts +1 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/recommendations/headless-recommendations.d.ts +1 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/context/example-deleteme-headless-case-context.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/actions-history/ipx-actions-history-actions.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/analytics/analytics-utils.d.ts +3 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/parameters/parameters-actions.d.ts +22 -6
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/parameters/parameters-schema.d.ts +4 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/parameters/parameters-selectors.d.ts +0 -11
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/parameters/parameters-serializer.d.ts +8 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/parameters/parameters-serializer.ssr.d.ts +44 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/parameters/parameters-slice.d.ts +4 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/parameters/parameters-state.d.ts +4 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/recommendations/recommendations-actions.d.ts +1 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/recommendations/recommendations-state.d.ts +1 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/search/search-selectors.d.ts +0 -12
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/debug/debug-selectors.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-analytics-actions.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/history/history-actions.d.ts +3 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/pipeline/select-pipeline.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/query/query-selectors.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/question-answering/question-answering-document-id.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/question-answering/question-answering-selectors.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search/legacy/search-actions.d.ts +42 -42
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search/legacy/search-request.d.ts +44 -44
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search/search-actions.d.ts +42 -43
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search/search-mappings.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search/search-request.d.ts +44 -44
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search/search-selectors.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search-hub/search-hub-selectors.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search-parameters/search-parameter-serializer.d.ts +5 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/selectors/commerce-selectors.index.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-commerce.index.d.ts +4 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/state/commerce-app-state.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/state/state-sections.d.ts +4 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/test/mock-search-request.d.ts +44 -44
- package/force-app/main/default/staticresources/coveoheadless/definitions/tsdoc-metadata.json +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/utils/compare-utils.d.ts +2 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/utils/errors.d.ts +3 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/utils/utils.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/utils/validate-payload.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/headless.js +10 -12
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +9 -11
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +8 -10
- package/force-app/main/default/staticresources/dompurify/purify.min.js +2 -1339
- package/force-app/main/default/staticresources/marked/marked.min.js +3 -3
- package/package.json +12 -16
|
@@ -6,7 +6,7 @@ export declare class InstantResultsAnalyticsProvider extends SearchAnalyticsProv
|
|
|
6
6
|
constructor(getState: () => StateNeededByInstantResultsAnalyticsProvider);
|
|
7
7
|
private get activeInstantResultQuery();
|
|
8
8
|
private get activeInstantResultCache();
|
|
9
|
-
protected get results(): import("../../
|
|
9
|
+
protected get results(): import("../../ssr.index.js").Result[] | undefined;
|
|
10
10
|
protected get queryText(): string;
|
|
11
11
|
protected get responseTime(): number;
|
|
12
12
|
protected get numberOfResults(): number;
|
|
@@ -85,7 +85,7 @@ export declare class SearchAnalyticsProvider extends BaseAnalyticsProvider<State
|
|
|
85
85
|
};
|
|
86
86
|
getGeneratedAnswerMetadata(): Record<string, string | boolean>;
|
|
87
87
|
private get resultURIs();
|
|
88
|
-
protected get results(): import("../../
|
|
88
|
+
protected get results(): import("../../ssr.index.js").Result[] | undefined;
|
|
89
89
|
protected get queryText(): string;
|
|
90
90
|
protected get responseTime(): number;
|
|
91
91
|
protected get numberOfResults(): number;
|
|
@@ -24,4 +24,4 @@ export declare const buildRequest: (req: CommerceAPIRequest, path: CommerceApiMe
|
|
|
24
24
|
origin: import("../../preprocess-request.js").PlatformClientOrigin;
|
|
25
25
|
requestMetadata?: import("../../preprocess-request.js").RequestMetadata | undefined;
|
|
26
26
|
};
|
|
27
|
-
export declare const baseRequest: (req: BaseParam, path: CommerceApiMethod) => Pick<PlatformClientCallOptions,
|
|
27
|
+
export declare const baseRequest: (req: BaseParam, path: CommerceApiMethod) => Pick<PlatformClientCallOptions, "accessToken" | "method" | "contentType" | "url" | "origin" | "requestMetadata">;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EventSourceMessage } from '@microsoft/fetch-event-source';
|
|
2
|
+
import { ThunkDispatch, UnknownAction } from '@reduxjs/toolkit';
|
|
2
3
|
import { GeneratedContentFormat } from '../../features/generated-answer/generated-response-format.js';
|
|
3
4
|
import { SearchAppState } from '../../state/search-app-state.js';
|
|
4
5
|
import { ConfigurationSection, GeneratedAnswerSection, InsightConfigurationSection } from '../../state/state-sections.js';
|
|
@@ -22,6 +23,7 @@ export interface GeneratedAnswerStream {
|
|
|
22
23
|
code: number;
|
|
23
24
|
};
|
|
24
25
|
}
|
|
26
|
+
export declare const updateCacheWithEvent: (event: EventSourceMessage, draft: GeneratedAnswerStream, dispatch: ThunkDispatch<StateNeededByAnswerAPI, unknown, UnknownAction>) => void;
|
|
25
27
|
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, {}>, {
|
|
26
28
|
getAnswer: import("@reduxjs/toolkit/query").QueryDefinition<Partial<SearchRequest>, 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">;
|
|
27
29
|
}, "answer", never, typeof import("@reduxjs/toolkit/query").coreModuleName>;
|
|
@@ -58,7 +60,7 @@ export declare const selectAnswerTriggerParams: ((state: any, ...params: any[])
|
|
|
58
60
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
59
61
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
60
62
|
};
|
|
61
|
-
export declare const constructAnswerQueryParams: (state: StateNeededByAnswerAPI, usage:
|
|
63
|
+
export declare const constructAnswerQueryParams: (state: StateNeededByAnswerAPI, usage: "fetch" | "select") => {
|
|
62
64
|
tab: string;
|
|
63
65
|
numberOfResults?: number | undefined;
|
|
64
66
|
firstResult?: number | undefined;
|
|
@@ -127,6 +127,6 @@ export interface GenQAParameters {
|
|
|
127
127
|
export interface ResponseFormatParameters {
|
|
128
128
|
contentFormat?: GeneratedContentFormat[];
|
|
129
129
|
}
|
|
130
|
-
export declare const baseSearchRequest: (req: BaseParam & AuthenticationParam, method: HttpMethods, contentType: HTTPContentType, path: string) => Pick<PlatformClientCallOptions,
|
|
130
|
+
export declare const baseSearchRequest: (req: BaseParam & AuthenticationParam, method: HttpMethods, contentType: HTTPContentType, path: string) => Pick<PlatformClientCallOptions, "accessToken" | "method" | "contentType" | "url" | "origin">;
|
|
131
131
|
export declare const getOrganizationIdQueryParam: (req: BaseParam) => string;
|
|
132
132
|
export declare const getAuthenticationQueryParam: (req: AuthenticationParam) => string;
|
|
@@ -22,6 +22,6 @@ export type CaseAssistParam = BaseParam & CaseAssistIdParam;
|
|
|
22
22
|
* @param queryStringArguments - The arguments to pass in the query string.
|
|
23
23
|
* @returns The built request information.
|
|
24
24
|
*/
|
|
25
|
-
export declare const baseCaseAssistRequest: (req: CaseAssistParam, method: HttpMethods, contentType: HTTPContentType, path: string, queryStringArguments?: Record<string, string>) => Pick<PlatformClientCallOptions,
|
|
25
|
+
export declare const baseCaseAssistRequest: (req: CaseAssistParam, method: HttpMethods, contentType: HTTPContentType, path: string, queryStringArguments?: Record<string, string>) => Pick<PlatformClientCallOptions, "accessToken" | "method" | "contentType" | "url" | "origin">;
|
|
26
26
|
export declare const prepareSuggestionRequestFields: (fields: CaseFields) => CaseFields;
|
|
27
27
|
export declare const prepareContextFromFields: (fields: CaseFields) => Record<string, string | string[]>;
|
|
@@ -7,6 +7,6 @@ export interface InsightIdParam {
|
|
|
7
7
|
export type InsightParam = BaseParam & InsightIdParam;
|
|
8
8
|
export declare const baseInsightUrl: (req: InsightParam, path?: string) => string;
|
|
9
9
|
export declare const baseInsightUserActionsUrl: (req: InsightUserActionsRequest) => string;
|
|
10
|
-
export declare const baseInsightRequest: (req: InsightParam, method: HttpMethods, contentType: HTTPContentType, path: string) => Pick<PlatformClientCallOptions,
|
|
11
|
-
export declare const baseInsightUserActionRequest: (req: InsightUserActionsRequest, method: HttpMethods, contentType: HTTPContentType) => Pick<PlatformClientCallOptions,
|
|
10
|
+
export declare const baseInsightRequest: (req: InsightParam, method: HttpMethods, contentType: HTTPContentType, path: string) => Pick<PlatformClientCallOptions, "accessToken" | "method" | "contentType" | "url" | "origin">;
|
|
11
|
+
export declare const baseInsightUserActionRequest: (req: InsightUserActionsRequest, method: HttpMethods, contentType: HTTPContentType) => Pick<PlatformClientCallOptions, "accessToken" | "method" | "contentType" | "url" | "origin">;
|
|
12
12
|
export declare const pickNonInsightParams: (req: InsightParam) => {};
|
|
@@ -13,6 +13,8 @@ export interface CommerceEngineDefinition<TControllers extends ControllerDefinit
|
|
|
13
13
|
* @param options - The commerce engine definition
|
|
14
14
|
* @returns Three utility functions to fetch the initial state of the engine in SSR, hydrate the state in CSR,
|
|
15
15
|
* and a build function that can be used for edge cases requiring more control.
|
|
16
|
+
*
|
|
17
|
+
* @group Engine
|
|
16
18
|
*/
|
|
17
19
|
export declare function defineCommerceEngine<TControllerDefinitions extends ControllerDefinitionsMap<Controller>>(options: CommerceEngineDefinitionOptions<TControllerDefinitions>): {
|
|
18
20
|
listingEngineDefinition: CommerceEngineDefinition<TControllerDefinitions, SolutionType.listing>;
|
|
@@ -5,6 +5,8 @@ import { ControllerDefinitionsMap, SolutionType } from '../types/common.js';
|
|
|
5
5
|
import { BuildParameters, CommerceControllerDefinitionsMap, EngineDefinitionOptions } from '../types/core-engine.js';
|
|
6
6
|
/**
|
|
7
7
|
* The SSR commerce engine.
|
|
8
|
+
*
|
|
9
|
+
* @group Engine
|
|
8
10
|
*/
|
|
9
11
|
export interface SSRCommerceEngine extends CommerceEngine {
|
|
10
12
|
/**
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Controller } from '../../../../controllers/controller/headless-controller.js';
|
|
2
|
+
import { ControllerDefinitionsMap } from '../../types/common.js';
|
|
3
|
+
export declare function filterRecommendationControllers<TControllerDefinitions extends ControllerDefinitionsMap<Controller>>(controllers: Record<string, Controller>, controllerDefinitions: TControllerDefinitions): {
|
|
4
|
+
/**
|
|
5
|
+
* Go through all the controllers passed in argument and only refresh recommendation controllers.
|
|
6
|
+
*
|
|
7
|
+
* @param controllers - A record of all controllers where the key is the controller name and the value is the controller instance.
|
|
8
|
+
* @param controllerNames - A list of all recommendation controllers to refresh
|
|
9
|
+
*/
|
|
10
|
+
refresh(whitelist?: string[]): void;
|
|
11
|
+
};
|
|
@@ -3,6 +3,7 @@ import type { Controller } from '../../../controllers/controller/headless-contro
|
|
|
3
3
|
import type { InvalidControllerDefinition } from '../../../utils/errors.js';
|
|
4
4
|
import type { HasKey, InferControllerStaticStateMapFromControllers, InferControllerStaticStateFromController, ControllerStaticStateMap, EngineDefinitionBuildResult, HydratedState, OptionsTuple, ControllersPropsMap, HasKeys, HasRequiredKeys, HasOptionalKeys } from '../../ssr-engine/types/common.js';
|
|
5
5
|
import { SSRCommerceEngine } from '../factories/build-factory.js';
|
|
6
|
+
import { Kind } from './kind.js';
|
|
6
7
|
export type { EngineDefinitionBuildResult, HydratedState, OptionsTuple, InferControllerStaticStateFromController, InferControllerStaticStateMapFromControllers, };
|
|
7
8
|
export declare enum SolutionType {
|
|
8
9
|
search = "search",
|
|
@@ -30,6 +31,9 @@ export interface ControllerDefinitionWithoutProps<TController extends Controller
|
|
|
30
31
|
*/
|
|
31
32
|
build(engine: SSRCommerceEngine, solutionType?: SolutionType): TController;
|
|
32
33
|
}
|
|
34
|
+
export interface ControllerWithKind extends Controller {
|
|
35
|
+
_kind: Kind;
|
|
36
|
+
}
|
|
33
37
|
export interface ControllerDefinitionWithProps<TController extends Controller, TProps> {
|
|
34
38
|
/**
|
|
35
39
|
* Creates an instance of the given controller.
|
|
@@ -39,13 +43,19 @@ export interface ControllerDefinitionWithProps<TController extends Controller, T
|
|
|
39
43
|
* @param solutionType - The type of solution for which the controller should be built (e.g. search or listing). This option only applies to sub-controllers.
|
|
40
44
|
* @returns The created controller instance.
|
|
41
45
|
*/
|
|
42
|
-
buildWithProps(engine: SSRCommerceEngine, props: TProps, solutionType?: SolutionType): TController;
|
|
46
|
+
buildWithProps(engine: SSRCommerceEngine, props: TProps, solutionType?: SolutionType): TController & ControllerWithKind;
|
|
43
47
|
}
|
|
44
48
|
export interface EngineStaticState<TSearchAction extends UnknownAction, TControllers extends ControllerStaticStateMap> {
|
|
45
49
|
searchActions: TSearchAction[];
|
|
46
50
|
controllers: TControllers;
|
|
47
51
|
}
|
|
48
|
-
export
|
|
52
|
+
export interface SolutionTypeAvailability {
|
|
53
|
+
[SolutionType.search]?: boolean;
|
|
54
|
+
[SolutionType.listing]?: boolean;
|
|
55
|
+
[SolutionType.standalone]?: boolean;
|
|
56
|
+
[SolutionType.recommendation]?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export type ControllerDefinition<TController extends Controller> = SolutionTypeAvailability & (ControllerDefinitionWithoutProps<TController> | ControllerDefinitionWithProps<TController, unknown>);
|
|
49
59
|
export interface ControllerDefinitionsMap<TController extends Controller> {
|
|
50
60
|
[customName: string]: ControllerDefinition<TController>;
|
|
51
61
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare enum Kind {
|
|
2
|
+
Cart = "CART",
|
|
3
|
+
Context = "CONTEXT",
|
|
4
|
+
ParameterManager = "PARAMETER_MANAGER",
|
|
5
|
+
Recommendations = "RECOMMENDATIONS"
|
|
6
|
+
}
|
|
7
|
+
export declare function createControllerWithKind<TController, TKind extends Kind>(controller: TController, kind: TKind): TController & {
|
|
8
|
+
_kind: TKind;
|
|
9
|
+
};
|
|
@@ -5,8 +5,6 @@ export interface StateWithHistory<State> {
|
|
|
5
5
|
present?: State;
|
|
6
6
|
future: State[];
|
|
7
7
|
}
|
|
8
|
-
declare const undo: <State>(state: StateWithHistory<State>) => StateWithHistory<State>;
|
|
9
|
-
declare const redo: <State>(state: StateWithHistory<State>) => StateWithHistory<State>;
|
|
10
8
|
export declare const undoable: <State>(options: {
|
|
11
9
|
reducer: Reducer<State>;
|
|
12
10
|
actionTypes: {
|
|
@@ -15,4 +13,3 @@ export declare const undoable: <State>(options: {
|
|
|
15
13
|
snapshot: string;
|
|
16
14
|
};
|
|
17
15
|
}) => (state: StateWithHistory<State> | undefined, action: AnyAction) => StateWithHistory<State>;
|
|
18
|
-
export {};
|
package/force-app/main/default/staticresources/coveoheadless/definitions/commerce.index.d.ts
CHANGED
|
@@ -102,7 +102,7 @@ export type { InstantProducts, InstantProductsState, InstantProductsOptions, Ins
|
|
|
102
102
|
export { buildStandaloneSearchBox } from './controllers/commerce/standalone-search-box/headless-standalone-search-box.js';
|
|
103
103
|
export type { StandaloneSearchBox, StandaloneSearchBoxState, } from './controllers/commerce/standalone-search-box/headless-standalone-search-box.js';
|
|
104
104
|
export type { StandaloneSearchBoxProps, StandaloneSearchBoxOptions, } from './controllers/standalone-search-box/headless-standalone-search-box.ts';
|
|
105
|
-
export type { UrlManagerProps, UrlManagerInitialState, UrlManagerState, UrlManager, } from './controllers/commerce/core/url-manager/headless-core-url-manager.js';
|
|
105
|
+
export type { BaseUrlManagerProps, UrlManagerProps, UrlManagerInitialState, UrlManagerState, UrlManager, } from './controllers/commerce/core/url-manager/headless-core-url-manager.js';
|
|
106
106
|
export type { Template } from './features/templates/templates-manager.ts';
|
|
107
107
|
export type { ProductTemplate, ProductTemplateCondition, ProductTemplatesManager, } from './features/commerce/product-templates/product-templates-manager.js';
|
|
108
108
|
export { buildProductTemplatesManager } from './features/commerce/product-templates/product-templates-manager.js';
|
|
@@ -3,6 +3,7 @@ import { BreadcrumbManager, BreadcrumbManagerState } from './headless-core-bread
|
|
|
3
3
|
export type { BreadcrumbManager, BreadcrumbManagerState };
|
|
4
4
|
/**
|
|
5
5
|
* Defines a `BreadcrumbManager` controller instance.
|
|
6
|
+
* @group Definers
|
|
6
7
|
*
|
|
7
8
|
* @returns The `BreadcrumbManager` controller definition.
|
|
8
9
|
*
|
|
@@ -17,6 +17,9 @@ export type { FacetType };
|
|
|
17
17
|
export type MappedFacetState = {
|
|
18
18
|
[T in FacetType]: T extends 'numericalRange' ? NumericFacetState : T extends 'regular' ? RegularFacetState : T extends 'dateRange' ? DateFacetState : T extends 'hierarchical' ? CategoryFacetState : T extends 'location' ? LocationFacetState : never;
|
|
19
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* @group Definers
|
|
22
|
+
*/
|
|
20
23
|
export declare function defineFacetGenerator<TOptions extends ControllerDefinitionOption | undefined>(options?: TOptions): SubControllerDefinitionWithoutProps<FacetGenerator, TOptions>;
|
|
21
24
|
/**
|
|
22
25
|
* The `FacetGenerator` headless sub-controller creates commerce facet sub-controllers from the Commerce API search or
|
|
@@ -10,6 +10,13 @@ export interface ParameterManagerProps<T extends Parameters> {
|
|
|
10
10
|
* The initial state that should be applied to the `ParameterManager` sub-controller.
|
|
11
11
|
*/
|
|
12
12
|
initialState?: ParameterManagerInitialState<T>;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the controller's state should exclude the default parameters returned by the Commerce API, and only include
|
|
15
|
+
* the parameters that were set explicitly set through dispatched actions.
|
|
16
|
+
*
|
|
17
|
+
* Defaults to `false`.
|
|
18
|
+
*/
|
|
19
|
+
excludeDefaultParameters?: boolean;
|
|
13
20
|
}
|
|
14
21
|
export interface CoreParameterManagerProps<T extends Parameters> extends ParameterManagerProps<T> {
|
|
15
22
|
/**
|
|
@@ -28,12 +35,6 @@ export interface CoreParameterManagerProps<T extends Parameters> extends Paramet
|
|
|
28
35
|
* The action to dispatch to fetch more results.
|
|
29
36
|
*/
|
|
30
37
|
fetchProductsActionCreator: FetchProductsActionCreator;
|
|
31
|
-
/**
|
|
32
|
-
* Enriches the parameters with the active parameters.
|
|
33
|
-
* @param state
|
|
34
|
-
* @param activeParams
|
|
35
|
-
*/
|
|
36
|
-
enrichParameters(state: CommerceEngine[typeof stateKey], activeParams: T): Required<T>;
|
|
37
38
|
}
|
|
38
39
|
export interface ParameterManagerInitialState<T> {
|
|
39
40
|
/**
|
|
@@ -12,7 +12,9 @@ export type { ParameterManager, ParameterManagerProps, ParameterManagerState, Pa
|
|
|
12
12
|
*
|
|
13
13
|
* @internal
|
|
14
14
|
*/
|
|
15
|
-
export declare function defineParameterManager<TOptions extends ControllerDefinitionOption | undefined>(options?: TOptions): SubControllerDefinitionWithProps<ParameterManager<
|
|
15
|
+
export declare function defineParameterManager<TOptions extends ControllerDefinitionOption | undefined>(options?: TOptions): SubControllerDefinitionWithProps<ParameterManager<MappedParameterTypes<TOptions>>, TOptions, SSRParameterManagerProps<MappedParameterTypes<TOptions>>>;
|
|
16
|
+
export interface SSRParameterManagerProps<T extends Parameters> extends Omit<ParameterManagerProps<T>, 'excludeDefaultParameters'> {
|
|
17
|
+
}
|
|
16
18
|
type MappedParameterTypes<TOptions extends ControllerDefinitionOption | undefined> = TOptions extends {
|
|
17
19
|
listing: true;
|
|
18
20
|
search: true;
|
|
@@ -68,7 +68,7 @@ export interface SearchAndListingSubControllers<P extends Parameters, S extends
|
|
|
68
68
|
* @param props - Properties for the `ParameterManager` sub-controller.
|
|
69
69
|
* @returns A `ParameterManager` sub-controller.
|
|
70
70
|
*/
|
|
71
|
-
parameterManager(props
|
|
71
|
+
parameterManager(props?: ParameterManagerProps<P>): ParameterManager<P>;
|
|
72
72
|
}
|
|
73
73
|
export interface SearchSubControllers extends SearchAndListingSubControllers<CommerceSearchParameters, SearchSummaryState> {
|
|
74
74
|
/**
|
|
@@ -98,7 +98,6 @@ export interface SearchAndListingSubControllerProps<P extends Parameters, S exte
|
|
|
98
98
|
parametersDefinition: SchemaDefinition<Required<P>>;
|
|
99
99
|
activeParametersSelector: (state: CommerceEngine[typeof stateKey]) => P;
|
|
100
100
|
restoreActionCreator: (parameters: P) => UnknownAction;
|
|
101
|
-
enrichParameters: (state: CommerceEngine[typeof stateKey], activeParams: P) => Required<P>;
|
|
102
101
|
facetSearchType: FacetSearchType;
|
|
103
102
|
}
|
|
104
103
|
/**
|
|
@@ -3,4 +3,5 @@ import type { Summary } from '../../core/summary/headless-core-summary.js';
|
|
|
3
3
|
import type { ProductListingSummaryState } from '../../product-listing/summary/headless-product-listing-summary.js';
|
|
4
4
|
import { SearchSummaryState } from '../../search/summary/headless-search-summary.js';
|
|
5
5
|
export type { ProductListingSummaryState, Summary };
|
|
6
|
-
export declare function defineQuerySummary<TOptions extends ControllerDefinitionOption | undefined>(options?: TOptions): SubControllerDefinitionWithoutProps<Summary<ProductListingSummaryState & SearchSummaryState>,
|
|
6
|
+
export declare function defineQuerySummary<TOptions extends ControllerDefinitionOption | undefined>(options?: TOptions): SubControllerDefinitionWithoutProps<Summary<ProductListingSummaryState & SearchSummaryState>, // TODO: fix conditional typing to return the appropriate type based on current solution type
|
|
7
|
+
TOptions>;
|
|
@@ -2,9 +2,18 @@ import { CommerceEngine } from '../../../../app/commerce-engine/commerce-engine.
|
|
|
2
2
|
import { stateKey } from '../../../../app/state-key.js';
|
|
3
3
|
import { Parameters } from '../../../../features/commerce/parameters/parameters-actions.js';
|
|
4
4
|
import { Serializer } from '../../../../features/commerce/parameters/parameters-serializer.js';
|
|
5
|
-
import { UrlManager, UrlManagerInitialState, type UrlManagerProps, UrlManagerState } from '../../../url-manager/headless-url-manager.js';
|
|
5
|
+
import { UrlManager, UrlManagerInitialState, type UrlManagerProps as BaseUrlManagerProps, UrlManagerState } from '../../../url-manager/headless-url-manager.js';
|
|
6
6
|
import { ParameterManager, ParameterManagerProps } from '../parameter-manager/headless-core-parameter-manager.js';
|
|
7
|
-
export type {
|
|
7
|
+
export type { UrlManager, UrlManagerInitialState, UrlManagerState, BaseUrlManagerProps, };
|
|
8
|
+
export interface UrlManagerProps extends BaseUrlManagerProps {
|
|
9
|
+
/**
|
|
10
|
+
* Whether the controller's state should exclude the default parameters returned by the Commerce API, and only include
|
|
11
|
+
* the parameters that were set explicitly set through dispatched actions.
|
|
12
|
+
*
|
|
13
|
+
* Defaults to `false`.
|
|
14
|
+
*/
|
|
15
|
+
excludeDefaultParameters?: boolean;
|
|
16
|
+
}
|
|
8
17
|
interface CoreUrlManagerProps<T extends Parameters> extends UrlManagerProps {
|
|
9
18
|
requestIdSelector: (state: CommerceEngine[typeof stateKey]) => string;
|
|
10
19
|
parameterManagerBuilder: (engine: CommerceEngine, props: ParameterManagerProps<T>) => ParameterManager<T>;
|
|
@@ -2,7 +2,7 @@ import { ControllerDefinitionOption, SubControllerDefinitionWithoutProps } from
|
|
|
2
2
|
import { ProductListing } from '../product-listing/headless-product-listing.js';
|
|
3
3
|
import { Search } from '../search/headless-search.js';
|
|
4
4
|
export type { ProductListingState as ProductListState } from '../product-listing/headless-product-listing.js';
|
|
5
|
-
export type ProductList = Pick<ProductListing | Search, 'state' | 'subscribe' | 'interactiveProduct'>;
|
|
5
|
+
export type ProductList = Pick<ProductListing | Search, 'state' | 'subscribe' | 'interactiveProduct' | 'promoteChildToParent'>;
|
|
6
6
|
/**
|
|
7
7
|
* Defines a `ProductList` controller instance.
|
|
8
8
|
* @group Definers
|
|
@@ -13,6 +13,7 @@ export interface ProductViewDefinition extends NonRecommendationControllerDefini
|
|
|
13
13
|
* @returns The `ProductView` controller definition.
|
|
14
14
|
*
|
|
15
15
|
* @internal
|
|
16
|
+
* @group Definers
|
|
16
17
|
*/
|
|
17
18
|
export declare function defineProductView(): ProductViewDefinition;
|
|
18
19
|
export interface ProductView extends BaseProductView, Controller {
|
|
@@ -29,4 +29,4 @@ export interface CaseContextState extends CoreContextState {
|
|
|
29
29
|
caseNumber: string;
|
|
30
30
|
}
|
|
31
31
|
export type CaseContextControllerState = CaseContext['state'];
|
|
32
|
-
export declare const createCaseContext: (engine: CoreEngine
|
|
32
|
+
export declare const createCaseContext: (engine: CoreEngine, props: ContextProps) => CaseContext, mixinCaseContext: <InputContext extends CoreContext>(engine: CoreEngine, props: ContextProps, context: InputContext) => InputContext & CaseContext;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const addPageViewEntryInActionsHistory: import("@reduxjs/toolkit").AsyncThunk<void, string, {
|
|
2
2
|
state?: unknown;
|
|
3
|
-
dispatch?: import("redux-thunk").ThunkDispatch<unknown, unknown, import("redux").UnknownAction
|
|
3
|
+
dispatch?: import("redux-thunk").ThunkDispatch<unknown, unknown, import("redux").UnknownAction>;
|
|
4
4
|
extra?: unknown;
|
|
5
5
|
rejectValue?: unknown;
|
|
6
6
|
serializedErrorType?: unknown;
|
|
@@ -66,15 +66,15 @@ type InternalLegacyStateNeeded = StateNeededBySearchAnalyticsProvider | StateNee
|
|
|
66
66
|
type LogFunction<Client, StateNeeded> = (client: Client, state: StateNeeded) => Promise<void | SearchEventResponse> | void | null;
|
|
67
67
|
export declare const makeAnalyticsAction: {
|
|
68
68
|
<LegacyStateNeeded extends StateNeededBySearchAnalyticsProvider = StateNeededBySearchAnalyticsProvider, ComputedLegacyAnalyticsOptions extends LegacyAnalyticsOptions<LegacyStateNeeded, CoveoSearchPageClient, SearchPageClientProvider> = LegacyAnalyticsOptions<LegacyStateNeeded, CoveoSearchPageClient, SearchPageClientProvider>>(prefix: string, __legacy__getBuilder: (client: CoveoSearchPageClient, state: StateNeededBySearchAnalyticsProvider) => Promise<EventBuilder | null> | null, __legacy__provider?: ComputedLegacyAnalyticsOptions["__legacy__provider"] | undefined): PreparableAnalyticsAction<LegacyStateNeeded>;
|
|
69
|
-
<
|
|
69
|
+
<LegacyStateNeeded extends StateNeededBySearchAnalyticsProvider = StateNeededBySearchAnalyticsProvider, StateNeeded extends StateNeededBySearchAnalyticsProvider = StateNeededBySearchAnalyticsProvider, PayloadType = {}>({ prefix, __legacy__getBuilder, __legacy__provider, analyticsPayloadBuilder, analyticsType, }: AnalyticsActionOptions<LegacyStateNeeded, StateNeeded, (client: CoveoSearchPageClient, state: StateNeededBySearchAnalyticsProvider) => Promise<EventBuilder | null> | null, SearchPageClientProvider, CoveoSearchPageClient, PayloadType>): PreparableAnalyticsAction<StateNeeded>;
|
|
70
70
|
};
|
|
71
71
|
export declare const makeCaseAssistAnalyticsAction: {
|
|
72
72
|
<LegacyStateNeeded extends StateNeededByCaseAssistAnalytics = StateNeededByCaseAssistAnalytics, ComputedLegacyAnalyticsOptions extends LegacyAnalyticsOptions<LegacyStateNeeded, CaseAssistClient, CaseAssistAnalyticsProvider> = LegacyAnalyticsOptions<LegacyStateNeeded, CaseAssistClient, CaseAssistAnalyticsProvider>>(prefix: string, __legacy__getBuilder: LogFunction<CaseAssistClient, StateNeededByCaseAssistAnalytics>, __legacy__provider?: ComputedLegacyAnalyticsOptions["__legacy__provider"] | undefined): PreparableAnalyticsAction<LegacyStateNeeded>;
|
|
73
|
-
<
|
|
73
|
+
<LegacyStateNeeded extends StateNeededByCaseAssistAnalytics = StateNeededByCaseAssistAnalytics, StateNeeded extends StateNeededByCaseAssistAnalytics = StateNeededByCaseAssistAnalytics, PayloadType = {}>({ prefix, __legacy__getBuilder, __legacy__provider, analyticsPayloadBuilder, analyticsType, }: AnalyticsActionOptions<LegacyStateNeeded, StateNeeded, LogFunction<CaseAssistClient, StateNeededByCaseAssistAnalytics>, CaseAssistAnalyticsProvider, CaseAssistClient, PayloadType>): PreparableAnalyticsAction<StateNeeded>;
|
|
74
74
|
};
|
|
75
75
|
export declare const makeInsightAnalyticsActionFactory: (actionCause: string) => {
|
|
76
76
|
<LegacyStateNeeded extends StateNeededByInsightAnalyticsProvider = StateNeededByInsightAnalyticsProvider, ComputedLegacyAnalyticsOptions extends LegacyAnalyticsOptions<LegacyStateNeeded, CoveoInsightClient, InsightAnalyticsProvider> = LegacyAnalyticsOptions<LegacyStateNeeded, CoveoInsightClient, InsightAnalyticsProvider>>(prefix: string, __legacy__getBuilder: LogFunction<CoveoInsightClient, StateNeededByInsightAnalyticsProvider>, __legacy__provider?: ComputedLegacyAnalyticsOptions["__legacy__provider"] | undefined): PreparableAnalyticsAction<LegacyStateNeeded>;
|
|
77
|
-
<
|
|
77
|
+
<LegacyStateNeeded extends StateNeededByInsightAnalyticsProvider = StateNeededByInsightAnalyticsProvider, StateNeeded extends StateNeededByInsightAnalyticsProvider = StateNeededByInsightAnalyticsProvider, PayloadType = {}>({ prefix, __legacy__getBuilder, __legacy__provider, analyticsPayloadBuilder, analyticsType, }: AnalyticsActionOptions<LegacyStateNeeded, StateNeeded, LogFunction<CoveoInsightClient, StateNeededByInsightAnalyticsProvider>, InsightAnalyticsProvider, CoveoInsightClient, PayloadType>): PreparableAnalyticsAction<StateNeeded>;
|
|
78
78
|
};
|
|
79
79
|
export declare const makeNoopAnalyticsAction: () => PreparableAnalyticsAction<StateNeededBySearchAnalyticsProvider>;
|
|
80
80
|
export declare const noopSearchAnalyticsAction: () => LegacySearchAction;
|
|
@@ -3,29 +3,45 @@ import { NumericRangeRequest } from '../../facets/range-facets/numeric-facet-set
|
|
|
3
3
|
import { SortCriterion } from '../sort/sort.js';
|
|
4
4
|
export interface Parameters {
|
|
5
5
|
/**
|
|
6
|
-
* A record of the facets, where the key is the facet id, and value is an array containing the selected values.
|
|
6
|
+
* A record of the facets, where the key is the facet id, and the value is an array containing the selected values.
|
|
7
7
|
*/
|
|
8
8
|
f?: Record<string, string[]>;
|
|
9
9
|
/**
|
|
10
|
-
* A record of the
|
|
10
|
+
* A record of the facets, where the key is the facet id, and the value is an array containing the excluded values.
|
|
11
|
+
*/
|
|
12
|
+
fExcluded?: Record<string, string[]>;
|
|
13
|
+
/**
|
|
14
|
+
* A record of the location facets, where the key is the facet id, and the value is an array containing the selected values.
|
|
11
15
|
*/
|
|
12
16
|
lf?: Record<string, string[]>;
|
|
13
17
|
/**
|
|
14
|
-
* A record of the category facets, where the key is the facet id, and value is an array containing the parts of the selected path.
|
|
18
|
+
* A record of the category facets, where the key is the facet id, and the value is an array containing the parts of the selected path.
|
|
15
19
|
*/
|
|
16
20
|
cf?: Record<string, string[]>;
|
|
17
21
|
/**
|
|
18
|
-
* A record of the date facets, where the key is the facet id, and value is an array containing the date ranges
|
|
22
|
+
* A record of the date facets, where the key is the facet id, and the value is an array containing the selected date ranges.
|
|
19
23
|
*/
|
|
20
24
|
df?: Record<string, DateRangeRequest[]>;
|
|
21
25
|
/**
|
|
22
|
-
* A record of the
|
|
26
|
+
* A record of the date facets, where the key is the facet id, and the value is an array containing the excluded date ranges.
|
|
27
|
+
*/
|
|
28
|
+
dfExcluded?: Record<string, DateRangeRequest[]>;
|
|
29
|
+
/**
|
|
30
|
+
* A record of the numeric facets, where the key is the facet id, and the value is an array containing the selected numeric ranges.
|
|
23
31
|
*/
|
|
24
32
|
nf?: Record<string, NumericRangeRequest[]>;
|
|
25
33
|
/**
|
|
26
|
-
* A record of
|
|
34
|
+
* A record of the numeric facets, where the key is the facet id, and the value is an array containing the excluded numeric ranges.
|
|
35
|
+
*/
|
|
36
|
+
nfExcluded?: Record<string, NumericRangeRequest[]>;
|
|
37
|
+
/**
|
|
38
|
+
* A record of manual numeric facets, where the key is the facet id, and the the value is an array containing the selected manual numeric ranges.
|
|
27
39
|
*/
|
|
28
40
|
mnf?: Record<string, NumericRangeRequest[]>;
|
|
41
|
+
/**
|
|
42
|
+
* A record of manual numeric facets, where the key is the facet id, and the value is an array containing the excluded manual numeric ranges.
|
|
43
|
+
*/
|
|
44
|
+
mnfExcluded?: Record<string, NumericRangeRequest[]>;
|
|
29
45
|
/**
|
|
30
46
|
* The sort expression to order returned results by.
|
|
31
47
|
*/
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { NumberValue, RecordValue } from '@coveo/bueno';
|
|
2
2
|
export declare const parametersDefinition: {
|
|
3
3
|
f: RecordValue;
|
|
4
|
+
fExcluded: RecordValue;
|
|
4
5
|
lf: RecordValue;
|
|
5
6
|
cf: RecordValue;
|
|
6
7
|
nf: RecordValue;
|
|
8
|
+
nfExcluded: RecordValue;
|
|
7
9
|
mnf: RecordValue;
|
|
10
|
+
mnfExcluded: RecordValue;
|
|
8
11
|
df: RecordValue;
|
|
12
|
+
dfExcluded: RecordValue;
|
|
9
13
|
sortCriteria: RecordValue;
|
|
10
14
|
page: NumberValue;
|
|
11
15
|
perPage: NumberValue;
|
|
@@ -3,14 +3,3 @@ import { stateKey } from '../../../app/state-key.js';
|
|
|
3
3
|
import { Parameters as ManagedParameters } from './parameters-actions.js';
|
|
4
4
|
export declare function initialParametersSelector(state: CommerceEngine[typeof stateKey]): Required<ManagedParameters>;
|
|
5
5
|
export declare function activeParametersSelector(state: CommerceEngine[typeof stateKey]): ManagedParameters;
|
|
6
|
-
export declare function enrichedParametersSelector(state: CommerceEngine[typeof stateKey], activeParams: ManagedParameters): {
|
|
7
|
-
f: Record<string, string[]>;
|
|
8
|
-
lf: Record<string, string[]>;
|
|
9
|
-
cf: Record<string, string[]>;
|
|
10
|
-
df: Record<string, import("../../../ssr.index.js").DateRangeRequest[]>;
|
|
11
|
-
nf: Record<string, import("../../../ssr.index.js").NumericRangeRequest[]>;
|
|
12
|
-
mnf: Record<string, import("../../../ssr.index.js").NumericRangeRequest[]>;
|
|
13
|
-
sortCriteria: import("../sort/sort.js").SortCriterion;
|
|
14
|
-
page: number;
|
|
15
|
-
perPage: number;
|
|
16
|
-
};
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { SearchParameterKey } from '../../search-parameters/search-parameter-serializer.js';
|
|
2
|
+
import { ProductListingParameters } from '../product-listing-parameters/product-listing-parameters-actions.js';
|
|
2
3
|
import { CommerceSearchParameters } from '../search-parameters/search-parameters-actions.js';
|
|
4
|
+
import { SortCriterion } from '../sort/sort.js';
|
|
3
5
|
import { Parameters } from './parameters-actions.js';
|
|
6
|
+
export declare const commerceFacetsRegex: RegExp;
|
|
4
7
|
export interface Serializer<T extends Parameters> {
|
|
5
8
|
serialize: (parameters: T) => string;
|
|
6
9
|
deserialize: (fragment: string) => T;
|
|
7
10
|
}
|
|
8
11
|
export declare const searchSerializer: Serializer<CommerceSearchParameters>;
|
|
9
|
-
export declare const productListingSerializer: Serializer<
|
|
10
|
-
type
|
|
12
|
+
export declare const productListingSerializer: Serializer<ProductListingParameters>;
|
|
13
|
+
export type ParametersKey = keyof CommerceSearchParameters;
|
|
14
|
+
export type FacetParameters = keyof Pick<Parameters, 'f' | 'fExcluded' | 'lf' | 'cf' | 'nf' | 'nfExcluded' | 'df' | 'dfExcluded' | 'mnf' | 'mnfExcluded'>;
|
|
11
15
|
type FacetKey = keyof typeof supportedFacetParameters;
|
|
12
16
|
declare const supportedFacetParameters: Record<FacetParameters, boolean>;
|
|
17
|
+
export declare function buildCriterionExpression(criterion: SortCriterion | undefined): string;
|
|
13
18
|
export declare function isValidBasicKey(key: string): key is Exclude<SearchParameterKey, FacetKey>;
|
|
14
19
|
export declare function keyHasObjectValue(key: string): key is FacetKey;
|
|
20
|
+
export declare function deserializeSortCriteria(value: string): SortCriterion | undefined;
|
|
15
21
|
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { DateRangeRequest, NumericRangeRequest } from '../../../controllers/commerce/core/facets/headless-core-commerce-facet.js';
|
|
2
|
+
import { FacetValueSearchParam, SearchParamValue as CommerceSearchParamValue } from '../../search-parameters/search-parameter-utils.js';
|
|
3
|
+
import { CommerceSearchParameters } from '../search-parameters/search-parameters-actions.js';
|
|
4
|
+
import { SortCriterion } from '../sort/sort.js';
|
|
5
|
+
import { FacetParameters } from './parameters-serializer.js';
|
|
6
|
+
type CommerceSearchParametersKey = keyof CommerceSearchParameters;
|
|
7
|
+
type CommerceSearchParamPair<T> = [CommerceSearchParametersKey, T];
|
|
8
|
+
type RangeFacetValueSearchParam = Record<string, DateRangeRequest[] | NumericRangeRequest[]>;
|
|
9
|
+
export declare function buildParameterSerializer(): {
|
|
10
|
+
deserialize: typeof deserialize;
|
|
11
|
+
serialize: typeof serialize;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Converts URLSearchParams or a record of commerce search parameters into a {@link CommerceSearchParameters} object.
|
|
15
|
+
*
|
|
16
|
+
* @param urlCommerceSearchParams - The URLSearchParams or record of commerce search parameters.
|
|
17
|
+
* @returns The converted CommerceSearchParameters object.
|
|
18
|
+
*/
|
|
19
|
+
declare function deserialize(urlCommerceSearchParams: URLSearchParams | Record<string, CommerceSearchParamValue>): CommerceSearchParameters;
|
|
20
|
+
/**
|
|
21
|
+
* Serializes the commerce search parameters to the provided URL.
|
|
22
|
+
*
|
|
23
|
+
* @param commerceSearchParameters - The commerce search parameters to be serialized.
|
|
24
|
+
* @param initialUrl - The initial URL to which the commerce search parameters will be added.
|
|
25
|
+
* @returns The serialized URL.
|
|
26
|
+
*/
|
|
27
|
+
declare function serialize(commerceSearchParameters: CommerceSearchParameters, initialUrl: URL): string;
|
|
28
|
+
export declare function isValidKey(key: string): key is CommerceSearchParametersKey;
|
|
29
|
+
export declare function isValidBasicKey(key: string): key is Exclude<CommerceSearchParametersKey, keyof FacetParameters>;
|
|
30
|
+
/**
|
|
31
|
+
* Extends the search parameters with the given key-value pair. If the key-value pair is not valid or if the value is undefined, the search parameters are not modified.
|
|
32
|
+
* @param commerceSearchParams - The search parameters object to extend.
|
|
33
|
+
* @param key - The key of the search parameter.
|
|
34
|
+
* @param value - The value of the search parameter.
|
|
35
|
+
*/
|
|
36
|
+
export declare function extendSearchParams(commerceSearchParams: Record<string, unknown>, key: string, value: CommerceSearchParamValue): void;
|
|
37
|
+
export declare function cast<K extends CommerceSearchParametersKey>(pair: [K, string], decode?: boolean): [K, unknown];
|
|
38
|
+
export declare function isValidSearchParam(key: string): boolean;
|
|
39
|
+
export declare function isSortPair(pair: [CommerceSearchParametersKey, unknown]): pair is CommerceSearchParamPair<SortCriterion>;
|
|
40
|
+
export declare function isFacetPair(pair: [CommerceSearchParametersKey, unknown]): pair is CommerceSearchParamPair<FacetValueSearchParam>;
|
|
41
|
+
export declare function isRangeFacetPair(pair: [CommerceSearchParametersKey, unknown]): pair is CommerceSearchParamPair<RangeFacetValueSearchParam>;
|
|
42
|
+
export declare function isRangeFacetObject(obj: unknown): obj is Record<string, (DateRangeRequest | NumericRangeRequest)[]>;
|
|
43
|
+
export declare function addFacetValuesToSearchParams(facetId: string, paramKey: CommerceSearchParametersKey): (searchParams: Record<string, unknown>, valueArray: unknown[]) => void;
|
|
44
|
+
export {};
|
|
@@ -38,6 +38,7 @@ export declare const fetchMoreRecommendations: import("@reduxjs/toolkit").AsyncT
|
|
|
38
38
|
}>;
|
|
39
39
|
export interface SlotIdPayload {
|
|
40
40
|
slotId: string;
|
|
41
|
+
productId?: string;
|
|
41
42
|
}
|
|
42
43
|
export type RegisterRecommendationsSlotPayload = SlotIdPayload;
|
|
43
44
|
export declare const registerRecommendationsSlot: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: SlotIdPayload], SlotIdPayload, "commerce/recommendations/registerSlot", never, never>;
|
|
@@ -241,18 +241,6 @@ export declare const queryExecutedSelector: ((state: CommerceSearchSection) => s
|
|
|
241
241
|
};
|
|
242
242
|
export declare const queryExecutedFromResponseSelector: (state: CommerceQuerySection, response: SearchCommerceSuccessResponse) => string;
|
|
243
243
|
export declare const activeParametersSelector: (state: CommerceEngine[typeof stateKey]) => CommerceSearchParameters;
|
|
244
|
-
export declare function enrichedParametersSelector(state: CommerceEngine[typeof stateKey], activeParams: CommerceSearchParameters): {
|
|
245
|
-
f: Record<string, string[]>;
|
|
246
|
-
lf: Record<string, string[]>;
|
|
247
|
-
cf: Record<string, string[]>;
|
|
248
|
-
df: Record<string, import("../../../ssr.index.js").DateRangeRequest[]>;
|
|
249
|
-
nf: Record<string, import("../../../ssr.index.js").NumericRangeRequest[]>;
|
|
250
|
-
mnf: Record<string, import("../../../ssr.index.js").NumericRangeRequest[]>;
|
|
251
|
-
sortCriteria: import("../sort/sort.js").SortCriterion;
|
|
252
|
-
page: number;
|
|
253
|
-
perPage: number;
|
|
254
|
-
q: string;
|
|
255
|
-
};
|
|
256
244
|
export declare function enrichedSummarySelector(state: CommerceEngineState): {
|
|
257
245
|
query: string;
|
|
258
246
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SearchSection } from '../../state/state-sections.js';
|
|
2
2
|
export declare function rankingInformationSelector(state: SearchSection): {
|
|
3
|
-
result: import("../../
|
|
3
|
+
result: import("../../ssr.index.js").Result;
|
|
4
4
|
ranking: {
|
|
5
5
|
documentWeights: import("./ranking-info-parser.js").DocumentWeights | null;
|
|
6
6
|
termsWeight: import("./ranking-info-parser.js").TermWeightReport | null;
|