@coveo/quantic 3.29.7 → 3.29.8-pre.dd08ef9ef0

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.
Files changed (30) hide show
  1. package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +4 -2
  2. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/types/controller-definitions.d.ts +3 -0
  3. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-commerce-next.index.d.ts +8 -8
  4. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controller-utils.d.ts +1 -2
  5. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/breadcrumb-manager/headless-core-breadcrumb-manager.ssr.d.ts +3 -2
  6. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/cart/headless-cart.ssr.d.ts +1 -2
  7. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/context/headless-context.ssr.d.ts +2 -3
  8. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/did-you-mean/headless-did-you-mean.ssr.d.ts +2 -1
  9. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/filter-suggestions/headless-filter-suggestions-generator.ssr.d.ts +1 -2
  10. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/generator/headless-commerce-facet-generator.ssr.d.ts +3 -2
  11. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/instant-products/headless-instant-products.ssr.d.ts +1 -2
  12. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/pagination/headless-core-commerce-pagination.ssr.d.ts +3 -2
  13. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/parameter-manager/headless-core-parameter-manager.ssr.d.ts +3 -13
  14. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/product-list/headless-product-list.ssr.d.ts +3 -2
  15. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/product-view/headless-product-view.ssr.d.ts +1 -3
  16. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/recent-queries-list/headless-recent-queries-list.ssr.d.ts +1 -2
  17. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/search-box/headless-search-box.ssr.d.ts +1 -2
  18. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/sort/headless-core-commerce-sort.ssr.d.ts +3 -2
  19. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/standalone-search-box/headless-standalone-search-box.ssr.d.ts +1 -2
  20. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/summary/headless-core-summary.ssr.d.ts +3 -2
  21. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/triggers/headless-notify-trigger.ssr.d.ts +1 -2
  22. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/triggers/headless-query-trigger.ssr.d.ts +1 -2
  23. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/triggers/headless-redirection-trigger.ssr.d.ts +1 -2
  24. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/controller-definitions.d.ts +3 -48
  25. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/controller-scopes.d.ts +0 -6
  26. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/common/errors.d.ts +0 -3
  27. package/force-app/main/default/staticresources/coveoheadless/headless.js +4 -2
  28. package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +4 -2
  29. package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +4 -2
  30. package/package.json +2 -2
@@ -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 { ControllerDefinitionOption, SubControllerDefinitionWithProps } from '../../types/controller-definitions.js';
5
+ import type { SearchAndListingControllerDefinitionWithProps } from '../../types/controller-definitions.js';
6
6
  export type { ParameterManager, ParameterManagerProps, ParameterManagerState, Parameters, ProductListingParameters, CommerceSearchParameters, };
7
- export type ParameterManagerDefinition<TOptions extends ControllerDefinitionOption | undefined> = SubControllerDefinitionWithProps<ParameterManager<MappedParameterTypes<TOptions>>, TOptions, SSRParameterManagerProps<MappedParameterTypes<TOptions>>>;
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<TOptions extends ControllerDefinitionOption | undefined>(options?: TOptions): ParameterManagerDefinition<TOptions>;
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 { ControllerDefinitionOption, SubControllerDefinitionWithoutProps } from '../../types/controller-definitions.js';
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<TOptions extends ControllerDefinitionOption | undefined>(options?: TOptions): SubControllerDefinitionWithoutProps<ProductList, TOptions>;
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
- interface ProductViewDefinition extends NonRecommendationControllerDefinitionWithoutProps<ProductView> {
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 interface RecentQueriesListDefinition extends NonRecommendationControllerDefinitionWithoutProps<RecentQueriesList> {
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
@@ -1,8 +1,7 @@
1
1
  import { type CoreSearchBox, type SearchBox, type SearchBoxOptions, type SearchBoxProps, type SearchBoxState, type Suggestion } from '../../../../controllers/commerce/search-box/headless-search-box.js';
2
2
  import type { SearchOnlyControllerDefinitionWithoutProps } from '../../types/controller-definitions.js';
3
3
  export type { CoreSearchBox, SearchBox, SearchBoxProps, SearchBoxState, SearchBoxOptions, Suggestion, };
4
- export interface SearchBoxDefinition extends SearchOnlyControllerDefinitionWithoutProps<SearchBox> {
5
- }
4
+ export type SearchBoxDefinition = SearchOnlyControllerDefinitionWithoutProps<SearchBox>;
6
5
  /**
7
6
  * Defines a `SearchBox` controller instance.
8
7
  * @group Definers
@@ -1,6 +1,7 @@
1
1
  import type { Sort, SortProps, SortState } from '../../../../controllers/commerce/core/sort/headless-core-commerce-sort.js';
2
- import type { ControllerDefinitionOption, SubControllerDefinitionWithoutProps } from '../../types/controller-definitions.js';
2
+ import type { SearchAndListingControllerDefinitionWithoutProps } from '../../types/controller-definitions.js';
3
3
  export type { Sort, SortProps, SortState };
4
+ export type SortDefinition = SearchAndListingControllerDefinitionWithoutProps<Sort>;
4
5
  /**
5
6
  * Defines a `Sort` controller instance.
6
7
  * @group Definers
@@ -8,4 +9,4 @@ export type { Sort, SortProps, SortState };
8
9
  * @param props - The configurable `Sort` properties.
9
10
  * @returns The `Sort` controller definition.
10
11
  */
11
- export declare function defineSort<TOptions extends ControllerDefinitionOption | undefined>(props?: SortProps & TOptions): SubControllerDefinitionWithoutProps<Sort, TOptions>;
12
+ export declare function defineSort(props?: SortProps): SortDefinition;
@@ -2,8 +2,7 @@ import { type StandaloneSearchBox, type StandaloneSearchBoxState } from '../../.
2
2
  import type { StandaloneSearchBoxProps } from '../../../../controllers/standalone-search-box/headless-standalone-search-box.js';
3
3
  import type { ListingAndStandaloneControllerWithoutProps } from '../../types/controller-definitions.js';
4
4
  export type { StandaloneSearchBoxState, StandaloneSearchBox, StandaloneSearchBoxProps, };
5
- export interface StandaloneSearchBoxDefinition extends ListingAndStandaloneControllerWithoutProps<StandaloneSearchBox> {
6
- }
5
+ export type StandaloneSearchBoxDefinition = ListingAndStandaloneControllerWithoutProps<StandaloneSearchBox>;
7
6
  /**
8
7
  * Defines the `StandaloneSearchBox` controller for the purpose of server-side rendering.
9
8
  * @group Definers
@@ -2,12 +2,13 @@ import type { Summary, SummaryState } from '../../../../controllers/commerce/cor
2
2
  import type { ProductListingSummaryState } from '../../../../controllers/commerce/product-listing/summary/headless-product-listing-summary.js';
3
3
  import type { RecommendationsSummaryState } from '../../../../controllers/commerce/recommendations/summary/headless-recommendations-summary.js';
4
4
  import type { SearchSummaryState } from '../../../../controllers/commerce/search/summary/headless-search-summary.js';
5
- import type { ControllerDefinitionOption, SubControllerDefinitionWithoutProps } from '../../types/controller-definitions.js';
5
+ import type { SearchAndListingControllerDefinitionWithoutProps } from '../../types/controller-definitions.js';
6
6
  export type { Summary, ProductListingSummaryState, RecommendationsSummaryState, SearchSummaryState, SummaryState, };
7
+ export type SummaryDefinition = SearchAndListingControllerDefinitionWithoutProps<Summary<ProductListingSummaryState | SearchSummaryState | RecommendationsSummaryState>>;
7
8
  /**
8
9
  * Defines a `Summary` controller instance.
9
10
  * @group Definers
10
11
  *
11
12
  * @returns The `Summary` controller definition.
12
13
  */
13
- export declare function defineSummary<TOptions extends ControllerDefinitionOption | undefined>(options?: TOptions): SubControllerDefinitionWithoutProps<Summary<ProductListingSummaryState | SearchSummaryState | RecommendationsSummaryState>, TOptions>;
14
+ export declare function defineSummary(): SummaryDefinition;
@@ -1,8 +1,7 @@
1
1
  import type { NotifyTrigger, NotifyTriggerState } from '../../../../controllers/core/triggers/headless-core-notify-trigger.js';
2
2
  import type { SearchAndListingControllerDefinitionWithoutProps } from '../../types/controller-definitions.js';
3
3
  export type { NotifyTrigger, NotifyTriggerState };
4
- export interface NotifyTriggerDefinition extends SearchAndListingControllerDefinitionWithoutProps<NotifyTrigger> {
5
- }
4
+ export type NotifyTriggerDefinition = SearchAndListingControllerDefinitionWithoutProps<NotifyTrigger>;
6
5
  /**
7
6
  * Defines the `NotifyTrigger` controller for the purpose of server-side rendering.
8
7
  * @group Definers
@@ -2,8 +2,7 @@ import type { QueryTrigger } from '../../../../controllers/core/triggers/headles
2
2
  import type { SearchOnlyControllerDefinitionWithoutProps } from '../../types/controller-definitions.js';
3
3
  export type { QueryTriggerState } from '../../../../controllers/core/triggers/headless-core-query-trigger.js';
4
4
  export type { QueryTrigger };
5
- export interface QueryTriggerDefinition extends SearchOnlyControllerDefinitionWithoutProps<QueryTrigger> {
6
- }
5
+ export type QueryTriggerDefinition = SearchOnlyControllerDefinitionWithoutProps<QueryTrigger>;
7
6
  /**
8
7
  * Defines the `QueryTrigger` controller for the purpose of server-side rendering.
9
8
  * @group Definers
@@ -1,8 +1,7 @@
1
1
  import type { RedirectionTrigger, RedirectionTriggerState } from '../../../../controllers/core/triggers/headless-core-redirection-trigger.js';
2
2
  import type { SearchOnlyControllerDefinitionWithoutProps } from '../../types/controller-definitions.js';
3
3
  export type { RedirectionTrigger, RedirectionTriggerState };
4
- export interface RedirectionTriggerDefinition extends SearchOnlyControllerDefinitionWithoutProps<RedirectionTrigger> {
5
- }
4
+ export type RedirectionTriggerDefinition = SearchOnlyControllerDefinitionWithoutProps<RedirectionTrigger>;
6
5
  /**
7
6
  * Defines the `RedirectionTrigger` controller for the purpose of server-side rendering.
8
7
  * @group Definers
@@ -1,5 +1,4 @@
1
1
  import type { Controller } from '../../../controllers/controller/headless-controller.js';
2
- import type { InvalidControllerDefinition } from '../../common/errors.js';
3
2
  import type { InferControllerStaticStateFromController, InferControllerStaticStateMapFromControllers } from '../../common/types/controller-inference.js';
4
3
  import type { ControllersPropsMap } from '../../common/types/controllers.js';
5
4
  import type { HasKey, HasRequiredKeys, OptionsTuple } from '../../common/types/utilities.js';
@@ -8,7 +7,7 @@ import type { ContextDefinition } from '../controllers/context/headless-context.
8
7
  import type { ParameterManagerDefinition } from '../controllers/parameter-manager/headless-core-parameter-manager.ssr.js';
9
8
  import type { SSRCommerceEngine } from '../factories/build-factory.js';
10
9
  import { type recommendationInternalOptionKey, SolutionType } from './controller-constants.js';
11
- import type { ListingAndStandaloneController, ListingOnlyController, NonRecommendationController, RecommendationOnlyController, SearchAndListingController, SearchOnlyController, UniversalController } from './controller-scopes.js';
10
+ import type { ListingAndStandaloneController, NonRecommendationController, RecommendationOnlyController, SearchAndListingController, SearchOnlyController, UniversalController } from './controller-scopes.js';
12
11
  import type { HydratedState } from './hydrate-static-state.js';
13
12
  import type { HasSolutionType } from './utilities.js';
14
13
  export type { HydratedState, OptionsTuple, InferControllerStaticStateFromController, InferControllerStaticStateMapFromControllers, };
@@ -44,10 +43,7 @@ export interface ControllerDefinitionsMap<TController extends Controller> {
44
43
  [customName: string]: ControllerDefinition<TController>;
45
44
  }
46
45
  type BakedInControllerDefinitions = {
47
- parameterManager: ParameterManagerDefinition<{
48
- listing: true;
49
- search: true;
50
- }>;
46
+ parameterManager: ParameterManagerDefinition;
51
47
  context: ContextDefinition;
52
48
  cart: CartDefinition;
53
49
  };
@@ -89,51 +85,10 @@ export type IsRecommendationController<TController extends ControllerDefinition<
89
85
  type DefaultControllerProps<TControllers extends ControllerDefinitionsMap<Controller>, TControllersPropsMap extends ControllersPropsMap, K extends keyof TControllers> = {
90
86
  [I in keyof TControllersPropsMap as I extends K ? I : never]: TControllersPropsMap[I];
91
87
  };
92
- export interface ControllerDefinitionOption {
93
- /**
94
- * Whether the controller will be used in a product listing context.
95
- * @defaultValue true
96
- */
97
- listing?: boolean;
98
- /**
99
- * Whether the controller will be used in a search page context.
100
- * @defaultValue true
101
- */
102
- search?: boolean;
103
- }
104
88
  export type SearchOnlyControllerDefinitionWithoutProps<TController extends Controller> = ControllerDefinitionWithoutProps<TController> & SearchOnlyController;
105
- type SearchOnlyControllerDefinitionWithProps<TController extends Controller, TProps> = ControllerDefinitionWithProps<TController, TProps> & SearchOnlyController;
106
89
  export type ListingAndStandaloneControllerWithoutProps<TController extends Controller> = ControllerDefinitionWithoutProps<TController> & ListingAndStandaloneController;
107
- type ListingOnlyControllerDefinitionWithoutProps<TController extends Controller> = ControllerDefinitionWithoutProps<TController> & ListingOnlyController;
108
- type ListingOnlyControllerDefinitionWithProps<TController extends Controller, TProps> = ControllerDefinitionWithProps<TController, TProps> & ListingOnlyController;
109
90
  export type RecommendationOnlyControllerDefinitionWithProps<TController extends Controller, TProps> = ControllerDefinitionWithProps<TController, TProps> & RecommendationOnlyController;
110
91
  export type NonRecommendationControllerDefinitionWithoutProps<TController extends Controller> = ControllerDefinitionWithoutProps<TController> & NonRecommendationController;
111
92
  export type UniversalControllerDefinitionWithProps<TController extends Controller, TProps> = ControllerDefinitionWithProps<TController, TProps> & UniversalController;
112
93
  export type SearchAndListingControllerDefinitionWithoutProps<TController extends Controller> = ControllerDefinitionWithoutProps<TController> & SearchAndListingController;
113
- type SearchAndListingControllerDefinitionWithProps<TController extends Controller, TProps> = ControllerDefinitionWithProps<TController, TProps> & SearchAndListingController;
114
- export type SubControllerDefinitionWithoutProps<TController extends Controller, TDefinition extends ControllerDefinitionOption | undefined> = TDefinition extends {
115
- listing?: true;
116
- search?: true;
117
- } | undefined ? SearchAndListingControllerDefinitionWithoutProps<TController> : TDefinition extends {
118
- listing?: true;
119
- search?: false;
120
- } ? ListingOnlyControllerDefinitionWithoutProps<TController> : TDefinition extends {
121
- listing?: false;
122
- search?: true;
123
- } ? SearchOnlyControllerDefinitionWithoutProps<TController> : TDefinition extends {
124
- listing: false;
125
- search: false;
126
- } ? InvalidControllerDefinition : never;
127
- export type SubControllerDefinitionWithProps<TController extends Controller, TDefinition extends ControllerDefinitionOption | undefined, TProps> = TDefinition extends {
128
- listing?: true;
129
- search?: true;
130
- } | undefined ? SearchAndListingControllerDefinitionWithProps<TController, TProps> : TDefinition extends {
131
- listing?: true;
132
- search?: false;
133
- } ? ListingOnlyControllerDefinitionWithProps<TController, TProps> : TDefinition extends {
134
- listing?: false;
135
- search?: true;
136
- } ? SearchOnlyControllerDefinitionWithProps<TController, TProps> : TDefinition extends {
137
- listing: false;
138
- search: false;
139
- } ? InvalidControllerDefinition : never;
94
+ export type SearchAndListingControllerDefinitionWithProps<TController extends Controller, TProps> = ControllerDefinitionWithProps<TController, TProps> & SearchAndListingController;
@@ -37,12 +37,6 @@ export interface SearchOnlyController {
37
37
  */
38
38
  [SolutionType.search]: true;
39
39
  }
40
- export interface ListingOnlyController {
41
- /**
42
- * @internal
43
- */
44
- [SolutionType.listing]: true;
45
- }
46
40
  export interface RecommendationOnlyController {
47
41
  /**
48
42
  * @internal
@@ -1,6 +1,3 @@
1
- export declare class InvalidControllerDefinition extends Error {
2
- constructor();
3
- }
4
1
  export declare class MissingControllerProps extends Error {
5
2
  constructor(controller: string);
6
3
  }