@coveo/thermidor-schema 1.0.0-beta.39 → 1.0.0-beta.40

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.
@@ -17,6 +17,8 @@ export const BreadboxFacetTypeSchema = z.enum([
17
17
  'numericalRange',
18
18
  'regular',
19
19
  ]);
20
+ // What replaced the shopper's query: an automatic query correction, or a query trigger.
21
+ export const QueryCorrectionCauseSchema = z.enum(['correction', 'trigger']);
20
22
  export const ProductSchema = z.strictObject({
21
23
  additionalFields: z.record(z.string(), z.unknown()),
22
24
  get badgePlacements() {
@@ -325,9 +327,6 @@ export const BreadboxFacetValueSchema = z.strictObject({
325
327
  });
326
328
  export const InitializePayloadSchema = z.strictObject({});
327
329
  export const SessionShellStateSchema = z.strictObject({});
328
- export const OverrideCorrectionPayloadSchema = z.strictObject({
329
- originalQuery: z.string().min(1),
330
- });
331
330
  export const NumericRangeRestoreSchema = z.strictObject({
332
331
  end: z.number(),
333
332
  endInclusive: z.boolean().optional(),
@@ -339,12 +338,13 @@ export const SubmitQueryPayloadSchema = z.strictObject({
339
338
  export const CommerceSearchStateSchema = z.strictObject({});
340
339
  export const LayoutStackActionsSchema = z.strictObject({});
341
340
  export const LayoutStackStateSchema = z.strictObject({});
342
- export const QuerySummaryActionsSchema = z.strictObject({});
343
- export const QuerySummaryStateSchema = z.strictObject({
344
- firstIndex: z.number().int().min(0),
345
- lastIndex: z.number().int().min(0),
346
- query: z.string(),
347
- totalEntries: z.number().int().min(0),
341
+ export const QuerySummaryActionsSchema = z.strictObject({
342
+ overrideCorrection: ActionSchema,
343
+ });
344
+ export const QueryCorrectionSchema = z.strictObject({
345
+ canOverride: z.boolean(),
346
+ cause: z.enum(['correction', 'trigger']),
347
+ originalQuery: z.string().min(1),
348
348
  });
349
349
  export const SetPageSizePayloadSchema = z.strictObject({
350
350
  pageSize: z.number().int().min(1),
@@ -538,9 +538,6 @@ export const BreadboxFacetSchema = z.discriminatedUnion('type', [
538
538
  export const InitializeSchema = z.strictObject({
539
539
  payload: InitializePayloadSchema,
540
540
  });
541
- export const OverrideCorrectionSchema = z.strictObject({
542
- payload: OverrideCorrectionPayloadSchema,
543
- });
544
541
  export const FacetRestoreSchema = z.strictObject({
545
542
  facetId: z.string().min(1),
546
543
  numericRanges: z.array(NumericRangeRestoreSchema).optional(),
@@ -556,11 +553,12 @@ export const LayoutStackSchema = z.looseObject({
556
553
  id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
557
554
  state: LayoutStackStateSchema.optional(),
558
555
  });
559
- export const QuerySummarySchema = z.looseObject({
560
- actions: QuerySummaryActionsSchema.optional(),
561
- component: z.literal('QuerySummary'),
562
- id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
563
- state: QuerySummaryStateSchema.optional(),
556
+ export const QuerySummaryStateSchema = z.strictObject({
557
+ correction: QueryCorrectionSchema.optional(),
558
+ firstIndex: z.number().int().min(0),
559
+ lastIndex: z.number().int().min(0),
560
+ query: z.string(),
561
+ totalEntries: z.number().int().min(0),
564
562
  });
565
563
  export const SetPageSizeSchema = z.strictObject({
566
564
  payload: SetPageSizePayloadSchema,
@@ -675,6 +673,12 @@ export const RestoreStatePayloadSchema = z.strictObject({
675
673
  query: z.string(),
676
674
  sortCriteria: z.string().optional(),
677
675
  });
676
+ export const QuerySummarySchema = z.looseObject({
677
+ actions: QuerySummaryActionsSchema.optional(),
678
+ component: z.literal('QuerySummary'),
679
+ id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
680
+ state: QuerySummaryStateSchema.optional(),
681
+ });
678
682
  export const PageSizeActionsSchema = z.strictObject({
679
683
  setPageSize: SetPageSizeSchema,
680
684
  });
@@ -776,7 +780,6 @@ export const CartSchema = z.looseObject({
776
780
  state: CartStateSchema.optional(),
777
781
  });
778
782
  export const CommerceSearchActionsSchema = z.strictObject({
779
- overrideCorrection: OverrideCorrectionSchema,
780
783
  restoreState: RestoreStateSchema,
781
784
  submitQuery: SubmitQuerySchema,
782
785
  });
@@ -1010,6 +1013,9 @@ export const QuerySummaryPropsSchema = z.object({
1010
1013
  firstIndex: DynamicNumberSchema,
1011
1014
  lastIndex: DynamicNumberSchema,
1012
1015
  totalEntries: DynamicNumberSchema,
1016
+ correction: z
1017
+ .union([QuerySummaryStateSchema.shape['correction'], DataBindingSchema, FunctionCallSchema])
1018
+ .optional(),
1013
1019
  });
1014
1020
  export const RegularFacetPropsSchema = z.object({
1015
1021
  field: DynamicStringSchema,
@@ -1111,12 +1117,6 @@ export const CommerceSearchActionSchema = z.union([
1111
1117
  }),
1112
1118
  }),
1113
1119
  }),
1114
- z.object({
1115
- event: z.object({
1116
- name: z.literal('overrideCorrection'),
1117
- context: z.strictObject({ originalQuery: z.string() }),
1118
- }),
1119
- }),
1120
1120
  ]);
1121
1121
  export const ComparisonTableActionSchema = z.never();
1122
1122
  export const DateFacetActionSchema = z.union([
@@ -1236,7 +1236,9 @@ export const QuerySuggestionsActionSchema = z.union([
1236
1236
  }),
1237
1237
  }),
1238
1238
  ]);
1239
- export const QuerySummaryActionSchema = z.never();
1239
+ export const QuerySummaryActionSchema = z.union([
1240
+ z.object({ event: z.object({ name: z.literal('overrideCorrection'), context: z.unknown() }) }),
1241
+ ]);
1240
1242
  export const RegularFacetActionSchema = z.union([
1241
1243
  z.object({
1242
1244
  event: z.object({
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export declare const THERMIDOR_CATALOG_ID = "https://schema.thermidor.coveo.com/a2-ui/catalog.json";
2
- export { ActionItemSchema, FollowupActionItemSchema, SearchActionItemSchema, SearchOptionActionItemSchema, CartSchema, CartActionsSchema, CartStateSchema, UpdateCartSchema, UpdateCartPayloadSchema, CartUpdateOperationSchema, PurchaseSchema, PurchasePayloadSchema, PurchaseProductSchema, TransactionSchema, QuerySuggestionsSchema, QuerySuggestionsActionsSchema, QuerySuggestionsStateSchema, QueryCompletionSchema, FetchSuggestionsSchema, FetchSuggestionsPayloadSchema, InstantProductsSchema, InstantProductsActionsSchema, InstantProductsStateSchema, FetchInstantProductsSchema, FetchInstantProductsPayloadSchema, RestoreStateSchema, RestoreStatePayloadSchema, FacetRestoreSchema, NumericRangeRestoreSchema, OverrideCorrectionSchema, OverrideCorrectionPayloadSchema, ShowMoreSchema, ShowMorePayloadSchema, SelectProductsSchema, SelectProductsPayloadSchema, ProductClickSchema, ProductClickPayloadSchema, BundleDisplaySchema, BundleDisplayStateSchema, BundleSlotSchema, BundleTierSchema, CategoryFacetSchema, CategoryFacetActionsSchema, CategoryFacetValueSchema, CategoryFacetSearchSchema, CategoryFacetSearchPayloadSchema, CategoryFacetSearchStateSchema, CategoryFacetSelectPathPayloadSchema, CategoryFacetStateSchema, CategoryFacetValuesSchema, CommerceSearchSchema, CommerceSearchActionsSchema, CommerceSearchStateSchema, SubmitQuerySchema, SubmitQueryPayloadSchema, ComparisonAttributeSchema, ComparisonProductSchema, ComparisonTableSchema, ComparisonTableStateSchema, ComponentContractsSchema, DateFacetSchema, DateFacetActionsSchema, DateFacetApplyCustomRangePayloadSchema, DateFacetCustomRangeSchema, DateFacetStateSchema, DateFacetToggleSelectPayloadSchema, DateFacetToggleSingleSelectPayloadSchema, DateFacetValueSchema, FacetManagerSchema, FacetManagerActionsSchema, FacetManagerStateSchema, BreadboxSchema, BreadboxActionsSchema, BreadboxStateSchema, BreadboxFacetSchema, BreadboxRegularFacetSchema, BreadboxRegularFacetValueSchema, BreadboxNumericalRangeFacetSchema, BreadboxNumericalRangeFacetValueSchema, BreadboxDateRangeFacetSchema, BreadboxDateRangeFacetValueSchema, BreadboxHierarchicalFacetSchema, BreadboxDeselectPayloadSchema, BreadboxDeselectRegularValueSchema, BreadboxDeselectNumericalRangeSchema, BreadboxDeselectDateRangeSchema, BreadboxDeselectHierarchicalPathSchema, FacetValueStateSchema, LayoutStackSchema, LayoutStackStateSchema, SearchBoxSchema, SearchBoxStateSchema, SessionShellSchema, SessionShellActionsSchema, SessionShellStateSchema, InitializeSchema, InitializePayloadSchema, NextActionsBarSchema, NextActionsStateSchema, NumericFacetSchema, NumericFacetActionsSchema, NumericFacetCustomRangeSchema, NumericFacetDomainSchema, NumericFacetApplyCustomRangePayloadSchema, NumericFacetStateSchema, NumericFacetToggleSelectPayloadSchema, NumericFacetToggleSingleSelectPayloadSchema, NumericFacetValueSchema, PageSizeSchema, PageSizeActionsSchema, PageSizeStateSchema, PaginationSchema, PaginationActionsSchema, PaginationStateSchema, ProductCarouselSchema, ProductCarouselStateSchema, ProductListSchema, ProductListActionsSchema, ProductListStateSchema, ProductResearchCardSchema, ProductResearchCardActionsSchema, ProductResearchCardStateSchema, ProductResearchRelatedDocumentSchema, ProductSummarySchema, ProductSummaryActionsSchema, ProductSummaryStateSchema, QuerySummarySchema, QuerySummaryStateSchema, BadgeSchema, BadgePlacementSchema, ProductSchema, RegularFacetSchema, RegularFacetActionsSchema, RegularFacetSearchSchema, RegularFacetSearchPayloadSchema, RegularFacetSearchResultSchema, RegularFacetSearchStateSchema, RegularFacetStateSchema, RegularFacetToggleSelectPayloadSchema, RegularFacetToggleSingleSelectPayloadSchema, RegularFacetValueSchema, SelectActionPayloadSchema, SelectSearchOptionPayloadSchema, SelectPagePayloadSchema, SelectSortPayloadSchema, SetPageSizePayloadSchema, SortSchema, SortActionsSchema, SortCriterionSchema, SortStateSchema, BundleDisplayPropsSchema, CartPropsSchema, CategoryFacetPropsSchema, CommerceSearchPropsSchema, ComparisonTablePropsSchema, DateFacetPropsSchema, FacetManagerPropsSchema, BreadboxPropsSchema, InstantProductsPropsSchema, LayoutStackPropsSchema, SearchBoxPropsSchema, SessionShellPropsSchema, NextActionsBarPropsSchema, NumericFacetPropsSchema, PageSizePropsSchema, PaginationPropsSchema, ProductCarouselPropsSchema, ProductListPropsSchema, ProductResearchCardPropsSchema, ProductSummaryPropsSchema, QuerySuggestionsPropsSchema, QuerySummaryPropsSchema, RegularFacetPropsSchema, SortPropsSchema, DataBindingSchema, FunctionCallSchema, DynamicNumberSchema, DynamicStringSchema, DynamicBooleanSchema, DynamicStringListSchema, DynamicValueSchema, DynamicActionSchema, BundleDisplayActionSchema, CategoryFacetActionSchema, CommerceSearchActionSchema, ComparisonTableActionSchema, DateFacetActionSchema, FacetManagerActionSchema, BreadboxActionSchema, InstantProductsActionSchema, LayoutStackActionSchema, SearchBoxActionSchema, SessionShellActionSchema, NextActionsBarActionSchema, NumericFacetActionSchema, PageSizeActionSchema, PaginationActionSchema, ProductCarouselActionSchema, ProductListActionSchema, ProductResearchCardActionSchema, ProductSummaryActionSchema, QuerySummaryActionSchema, RegularFacetActionSchema, SortActionSchema, } from './generated/schemas.js';
3
- export type { ActionItem, FollowupActionItem, SearchActionItem, SearchOptionActionItem, Cart, CartActions, CartState, UpdateCart, UpdateCartPayload, CartUpdateOperation, Purchase, PurchasePayload, PurchaseProduct, Transaction, QuerySuggestions, QuerySuggestionsActions, QuerySuggestionsState, QueryCompletion, FetchSuggestions, FetchSuggestionsPayload, InstantProducts, InstantProductsActions, InstantProductsState, FetchInstantProducts, FetchInstantProductsPayload, RestoreState, RestoreStatePayload, FacetRestore, NumericRangeRestore, OverrideCorrection, OverrideCorrectionPayload, ShowMore, ShowMorePayload, SelectProducts, SelectProductsPayload, ProductClick, ProductClickPayload, BundleDisplay, BundleDisplayState, BundleSlot, BundleTier, CategoryFacet, CategoryFacetActions, CategoryFacetValue, CategoryFacetSearch, CategoryFacetSearchPayload, CategoryFacetSearchState, CategoryFacetSelectPathPayload, CategoryFacetState, CategoryFacetValues, CommerceSearch, CommerceSearchActions, CommerceSearchState, SubmitQuery, SubmitQueryPayload, ComparisonAttribute, ComparisonProduct, ComparisonTable, ComparisonTableState, ComponentContracts, DateFacet, DateFacetActions, DateFacetApplyCustomRangePayload, DateFacetCustomRange, DateFacetState, DateFacetToggleSelectPayload, DateFacetToggleSingleSelectPayload, DateFacetValue, FacetManager, FacetManagerActions, FacetManagerState, Breadbox, BreadboxActions, BreadboxState, BreadboxFacet, BreadboxRegularFacet, BreadboxRegularFacetValue, BreadboxNumericalRangeFacet, BreadboxNumericalRangeFacetValue, BreadboxDateRangeFacet, BreadboxDateRangeFacetValue, BreadboxHierarchicalFacet, BreadboxDeselectPayload, BreadboxDeselectRegularValue, BreadboxDeselectNumericalRange, BreadboxDeselectDateRange, BreadboxDeselectHierarchicalPath, FacetValueState, LayoutStack, LayoutStackState, SearchBox, SearchBoxState, SessionShell, SessionShellActions, SessionShellState, Initialize, InitializePayload, NextActionsBar, NextActionsState, NumericFacet, NumericFacetActions, NumericFacetCustomRange, NumericFacetDomain, NumericFacetApplyCustomRangePayload, NumericFacetState, NumericFacetToggleSelectPayload, NumericFacetToggleSingleSelectPayload, NumericFacetValue, PageSize, PageSizeActions, PageSizeState, Pagination, PaginationActions, PaginationState, Badge, BadgePlacement, Product, ProductCarousel, ProductCarouselState, ProductList, ProductListActions, ProductListState, ProductResearchCard, ProductResearchCardActions, ProductResearchCardState, ProductResearchRelatedDocument, ProductSummary, ProductSummaryActions, ProductSummaryState, QuerySummary, QuerySummaryState, RegularFacet, RegularFacetActions, RegularFacetSearch, RegularFacetSearchPayload, RegularFacetSearchResult, RegularFacetSearchState, RegularFacetState, RegularFacetToggleSelectPayload, RegularFacetToggleSingleSelectPayload, RegularFacetValue, SelectActionPayload, SelectSearchOptionPayload, SelectPagePayload, SelectSortPayload, SetPageSizePayload, Sort, SortActions, SortCriterion, SortState, DataBinding, FunctionCall, DynamicNumber, DynamicString, DynamicBoolean, DynamicStringList, DynamicValue, DynamicAction, BundleDisplayAction, CategoryFacetAction, CommerceSearchAction, ComparisonTableAction, DateFacetAction, FacetManagerAction, BreadboxAction, InstantProductsAction, LayoutStackAction, SearchBoxAction, SessionShellAction, NextActionsBarAction, NumericFacetAction, PageSizeAction, PaginationAction, ProductCarouselAction, ProductListAction, ProductResearchCardAction, ProductSummaryAction, QuerySummaryAction, RegularFacetAction, SortAction, BundleDisplayProps, CartProps, CategoryFacetProps, CommerceSearchProps, ComparisonTableProps, DateFacetProps, FacetManagerProps, BreadboxProps, InstantProductsProps, LayoutStackProps, SearchBoxProps, SessionShellProps, NextActionsBarProps, NumericFacetProps, PageSizeProps, PaginationProps, ProductCarouselProps, ProductListProps, ProductResearchCardProps, ProductSummaryProps, QuerySuggestionsProps, QuerySummaryProps, RegularFacetProps, SortProps, } from './generated/schemas.js';
2
+ export { ActionItemSchema, FollowupActionItemSchema, SearchActionItemSchema, SearchOptionActionItemSchema, CartSchema, CartActionsSchema, CartStateSchema, UpdateCartSchema, UpdateCartPayloadSchema, CartUpdateOperationSchema, PurchaseSchema, PurchasePayloadSchema, PurchaseProductSchema, TransactionSchema, QuerySuggestionsSchema, QuerySuggestionsActionsSchema, QuerySuggestionsStateSchema, QueryCompletionSchema, FetchSuggestionsSchema, FetchSuggestionsPayloadSchema, InstantProductsSchema, InstantProductsActionsSchema, InstantProductsStateSchema, FetchInstantProductsSchema, FetchInstantProductsPayloadSchema, RestoreStateSchema, RestoreStatePayloadSchema, FacetRestoreSchema, NumericRangeRestoreSchema, ShowMoreSchema, ShowMorePayloadSchema, SelectProductsSchema, SelectProductsPayloadSchema, ProductClickSchema, ProductClickPayloadSchema, BundleDisplaySchema, BundleDisplayStateSchema, BundleSlotSchema, BundleTierSchema, CategoryFacetSchema, CategoryFacetActionsSchema, CategoryFacetValueSchema, CategoryFacetSearchSchema, CategoryFacetSearchPayloadSchema, CategoryFacetSearchStateSchema, CategoryFacetSelectPathPayloadSchema, CategoryFacetStateSchema, CategoryFacetValuesSchema, CommerceSearchSchema, CommerceSearchActionsSchema, CommerceSearchStateSchema, SubmitQuerySchema, SubmitQueryPayloadSchema, ComparisonAttributeSchema, ComparisonProductSchema, ComparisonTableSchema, ComparisonTableStateSchema, ComponentContractsSchema, DateFacetSchema, DateFacetActionsSchema, DateFacetApplyCustomRangePayloadSchema, DateFacetCustomRangeSchema, DateFacetStateSchema, DateFacetToggleSelectPayloadSchema, DateFacetToggleSingleSelectPayloadSchema, DateFacetValueSchema, FacetManagerSchema, FacetManagerActionsSchema, FacetManagerStateSchema, BreadboxSchema, BreadboxActionsSchema, BreadboxStateSchema, BreadboxFacetSchema, BreadboxRegularFacetSchema, BreadboxRegularFacetValueSchema, BreadboxNumericalRangeFacetSchema, BreadboxNumericalRangeFacetValueSchema, BreadboxDateRangeFacetSchema, BreadboxDateRangeFacetValueSchema, BreadboxHierarchicalFacetSchema, BreadboxDeselectPayloadSchema, BreadboxDeselectRegularValueSchema, BreadboxDeselectNumericalRangeSchema, BreadboxDeselectDateRangeSchema, BreadboxDeselectHierarchicalPathSchema, FacetValueStateSchema, LayoutStackSchema, LayoutStackStateSchema, SearchBoxSchema, SearchBoxStateSchema, SessionShellSchema, SessionShellActionsSchema, SessionShellStateSchema, InitializeSchema, InitializePayloadSchema, NextActionsBarSchema, NextActionsStateSchema, NumericFacetSchema, NumericFacetActionsSchema, NumericFacetCustomRangeSchema, NumericFacetDomainSchema, NumericFacetApplyCustomRangePayloadSchema, NumericFacetStateSchema, NumericFacetToggleSelectPayloadSchema, NumericFacetToggleSingleSelectPayloadSchema, NumericFacetValueSchema, PageSizeSchema, PageSizeActionsSchema, PageSizeStateSchema, PaginationSchema, PaginationActionsSchema, PaginationStateSchema, ProductCarouselSchema, ProductCarouselStateSchema, ProductListSchema, ProductListActionsSchema, ProductListStateSchema, ProductResearchCardSchema, ProductResearchCardActionsSchema, ProductResearchCardStateSchema, ProductResearchRelatedDocumentSchema, ProductSummarySchema, ProductSummaryActionsSchema, ProductSummaryStateSchema, QuerySummarySchema, QuerySummaryActionsSchema, QuerySummaryStateSchema, QueryCorrectionSchema, QueryCorrectionCauseSchema, BadgeSchema, BadgePlacementSchema, ProductSchema, RegularFacetSchema, RegularFacetActionsSchema, RegularFacetSearchSchema, RegularFacetSearchPayloadSchema, RegularFacetSearchResultSchema, RegularFacetSearchStateSchema, RegularFacetStateSchema, RegularFacetToggleSelectPayloadSchema, RegularFacetToggleSingleSelectPayloadSchema, RegularFacetValueSchema, SelectActionPayloadSchema, SelectSearchOptionPayloadSchema, SelectPagePayloadSchema, SelectSortPayloadSchema, SetPageSizePayloadSchema, SortSchema, SortActionsSchema, SortCriterionSchema, SortStateSchema, BundleDisplayPropsSchema, CartPropsSchema, CategoryFacetPropsSchema, CommerceSearchPropsSchema, ComparisonTablePropsSchema, DateFacetPropsSchema, FacetManagerPropsSchema, BreadboxPropsSchema, InstantProductsPropsSchema, LayoutStackPropsSchema, SearchBoxPropsSchema, SessionShellPropsSchema, NextActionsBarPropsSchema, NumericFacetPropsSchema, PageSizePropsSchema, PaginationPropsSchema, ProductCarouselPropsSchema, ProductListPropsSchema, ProductResearchCardPropsSchema, ProductSummaryPropsSchema, QuerySuggestionsPropsSchema, QuerySummaryPropsSchema, RegularFacetPropsSchema, SortPropsSchema, DataBindingSchema, FunctionCallSchema, DynamicNumberSchema, DynamicStringSchema, DynamicBooleanSchema, DynamicStringListSchema, DynamicValueSchema, DynamicActionSchema, BundleDisplayActionSchema, CategoryFacetActionSchema, CommerceSearchActionSchema, ComparisonTableActionSchema, DateFacetActionSchema, FacetManagerActionSchema, BreadboxActionSchema, InstantProductsActionSchema, LayoutStackActionSchema, SearchBoxActionSchema, SessionShellActionSchema, NextActionsBarActionSchema, NumericFacetActionSchema, PageSizeActionSchema, PaginationActionSchema, ProductCarouselActionSchema, ProductListActionSchema, ProductResearchCardActionSchema, ProductSummaryActionSchema, QuerySummaryActionSchema, RegularFacetActionSchema, SortActionSchema, } from './generated/schemas.js';
3
+ export type { ActionItem, FollowupActionItem, SearchActionItem, SearchOptionActionItem, Cart, CartActions, CartState, UpdateCart, UpdateCartPayload, CartUpdateOperation, Purchase, PurchasePayload, PurchaseProduct, Transaction, QuerySuggestions, QuerySuggestionsActions, QuerySuggestionsState, QueryCompletion, FetchSuggestions, FetchSuggestionsPayload, InstantProducts, InstantProductsActions, InstantProductsState, FetchInstantProducts, FetchInstantProductsPayload, RestoreState, RestoreStatePayload, FacetRestore, NumericRangeRestore, ShowMore, ShowMorePayload, SelectProducts, SelectProductsPayload, ProductClick, ProductClickPayload, BundleDisplay, BundleDisplayState, BundleSlot, BundleTier, CategoryFacet, CategoryFacetActions, CategoryFacetValue, CategoryFacetSearch, CategoryFacetSearchPayload, CategoryFacetSearchState, CategoryFacetSelectPathPayload, CategoryFacetState, CategoryFacetValues, CommerceSearch, CommerceSearchActions, CommerceSearchState, SubmitQuery, SubmitQueryPayload, ComparisonAttribute, ComparisonProduct, ComparisonTable, ComparisonTableState, ComponentContracts, DateFacet, DateFacetActions, DateFacetApplyCustomRangePayload, DateFacetCustomRange, DateFacetState, DateFacetToggleSelectPayload, DateFacetToggleSingleSelectPayload, DateFacetValue, FacetManager, FacetManagerActions, FacetManagerState, Breadbox, BreadboxActions, BreadboxState, BreadboxFacet, BreadboxRegularFacet, BreadboxRegularFacetValue, BreadboxNumericalRangeFacet, BreadboxNumericalRangeFacetValue, BreadboxDateRangeFacet, BreadboxDateRangeFacetValue, BreadboxHierarchicalFacet, BreadboxDeselectPayload, BreadboxDeselectRegularValue, BreadboxDeselectNumericalRange, BreadboxDeselectDateRange, BreadboxDeselectHierarchicalPath, FacetValueState, LayoutStack, LayoutStackState, SearchBox, SearchBoxState, SessionShell, SessionShellActions, SessionShellState, Initialize, InitializePayload, NextActionsBar, NextActionsState, NumericFacet, NumericFacetActions, NumericFacetCustomRange, NumericFacetDomain, NumericFacetApplyCustomRangePayload, NumericFacetState, NumericFacetToggleSelectPayload, NumericFacetToggleSingleSelectPayload, NumericFacetValue, PageSize, PageSizeActions, PageSizeState, Pagination, PaginationActions, PaginationState, Badge, BadgePlacement, Product, ProductCarousel, ProductCarouselState, ProductList, ProductListActions, ProductListState, ProductResearchCard, ProductResearchCardActions, ProductResearchCardState, ProductResearchRelatedDocument, ProductSummary, ProductSummaryActions, ProductSummaryState, QuerySummary, QuerySummaryActions, QuerySummaryState, QueryCorrection, QueryCorrectionCause, RegularFacet, RegularFacetActions, RegularFacetSearch, RegularFacetSearchPayload, RegularFacetSearchResult, RegularFacetSearchState, RegularFacetState, RegularFacetToggleSelectPayload, RegularFacetToggleSingleSelectPayload, RegularFacetValue, SelectActionPayload, SelectSearchOptionPayload, SelectPagePayload, SelectSortPayload, SetPageSizePayload, Sort, SortActions, SortCriterion, SortState, DataBinding, FunctionCall, DynamicNumber, DynamicString, DynamicBoolean, DynamicStringList, DynamicValue, DynamicAction, BundleDisplayAction, CategoryFacetAction, CommerceSearchAction, ComparisonTableAction, DateFacetAction, FacetManagerAction, BreadboxAction, InstantProductsAction, LayoutStackAction, SearchBoxAction, SessionShellAction, NextActionsBarAction, NumericFacetAction, PageSizeAction, PaginationAction, ProductCarouselAction, ProductListAction, ProductResearchCardAction, ProductSummaryAction, QuerySummaryAction, RegularFacetAction, SortAction, BundleDisplayProps, CartProps, CategoryFacetProps, CommerceSearchProps, ComparisonTableProps, DateFacetProps, FacetManagerProps, BreadboxProps, InstantProductsProps, LayoutStackProps, SearchBoxProps, SessionShellProps, NextActionsBarProps, NumericFacetProps, PageSizeProps, PaginationProps, ProductCarouselProps, ProductListProps, ProductResearchCardProps, ProductSummaryProps, QuerySuggestionsProps, QuerySummaryProps, RegularFacetProps, SortProps, } from './generated/schemas.js';
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export const THERMIDOR_CATALOG_ID = 'https://schema.thermidor.coveo.com/a2-ui/catalog.json';
2
- export { ActionItemSchema, FollowupActionItemSchema, SearchActionItemSchema, SearchOptionActionItemSchema, CartSchema, CartActionsSchema, CartStateSchema, UpdateCartSchema, UpdateCartPayloadSchema, CartUpdateOperationSchema, PurchaseSchema, PurchasePayloadSchema, PurchaseProductSchema, TransactionSchema, QuerySuggestionsSchema, QuerySuggestionsActionsSchema, QuerySuggestionsStateSchema, QueryCompletionSchema, FetchSuggestionsSchema, FetchSuggestionsPayloadSchema, InstantProductsSchema, InstantProductsActionsSchema, InstantProductsStateSchema, FetchInstantProductsSchema, FetchInstantProductsPayloadSchema, RestoreStateSchema, RestoreStatePayloadSchema, FacetRestoreSchema, NumericRangeRestoreSchema, OverrideCorrectionSchema, OverrideCorrectionPayloadSchema, ShowMoreSchema, ShowMorePayloadSchema, SelectProductsSchema, SelectProductsPayloadSchema, ProductClickSchema, ProductClickPayloadSchema, BundleDisplaySchema, BundleDisplayStateSchema, BundleSlotSchema, BundleTierSchema, CategoryFacetSchema, CategoryFacetActionsSchema, CategoryFacetValueSchema, CategoryFacetSearchSchema, CategoryFacetSearchPayloadSchema, CategoryFacetSearchStateSchema, CategoryFacetSelectPathPayloadSchema, CategoryFacetStateSchema, CategoryFacetValuesSchema, CommerceSearchSchema, CommerceSearchActionsSchema, CommerceSearchStateSchema, SubmitQuerySchema, SubmitQueryPayloadSchema, ComparisonAttributeSchema, ComparisonProductSchema, ComparisonTableSchema, ComparisonTableStateSchema, ComponentContractsSchema, DateFacetSchema, DateFacetActionsSchema, DateFacetApplyCustomRangePayloadSchema, DateFacetCustomRangeSchema, DateFacetStateSchema, DateFacetToggleSelectPayloadSchema, DateFacetToggleSingleSelectPayloadSchema, DateFacetValueSchema, FacetManagerSchema, FacetManagerActionsSchema, FacetManagerStateSchema, BreadboxSchema, BreadboxActionsSchema, BreadboxStateSchema, BreadboxFacetSchema, BreadboxRegularFacetSchema, BreadboxRegularFacetValueSchema, BreadboxNumericalRangeFacetSchema, BreadboxNumericalRangeFacetValueSchema, BreadboxDateRangeFacetSchema, BreadboxDateRangeFacetValueSchema, BreadboxHierarchicalFacetSchema, BreadboxDeselectPayloadSchema, BreadboxDeselectRegularValueSchema, BreadboxDeselectNumericalRangeSchema, BreadboxDeselectDateRangeSchema, BreadboxDeselectHierarchicalPathSchema, FacetValueStateSchema, LayoutStackSchema, LayoutStackStateSchema, SearchBoxSchema, SearchBoxStateSchema, SessionShellSchema, SessionShellActionsSchema, SessionShellStateSchema, InitializeSchema, InitializePayloadSchema, NextActionsBarSchema, NextActionsStateSchema, NumericFacetSchema, NumericFacetActionsSchema, NumericFacetCustomRangeSchema, NumericFacetDomainSchema, NumericFacetApplyCustomRangePayloadSchema, NumericFacetStateSchema, NumericFacetToggleSelectPayloadSchema, NumericFacetToggleSingleSelectPayloadSchema, NumericFacetValueSchema, PageSizeSchema, PageSizeActionsSchema, PageSizeStateSchema, PaginationSchema, PaginationActionsSchema, PaginationStateSchema, ProductCarouselSchema, ProductCarouselStateSchema, ProductListSchema, ProductListActionsSchema, ProductListStateSchema, ProductResearchCardSchema, ProductResearchCardActionsSchema, ProductResearchCardStateSchema, ProductResearchRelatedDocumentSchema, ProductSummarySchema, ProductSummaryActionsSchema, ProductSummaryStateSchema, QuerySummarySchema, QuerySummaryStateSchema, BadgeSchema, BadgePlacementSchema, ProductSchema, RegularFacetSchema, RegularFacetActionsSchema, RegularFacetSearchSchema, RegularFacetSearchPayloadSchema, RegularFacetSearchResultSchema, RegularFacetSearchStateSchema, RegularFacetStateSchema, RegularFacetToggleSelectPayloadSchema, RegularFacetToggleSingleSelectPayloadSchema, RegularFacetValueSchema, SelectActionPayloadSchema, SelectSearchOptionPayloadSchema, SelectPagePayloadSchema, SelectSortPayloadSchema, SetPageSizePayloadSchema, SortSchema, SortActionsSchema, SortCriterionSchema, SortStateSchema, BundleDisplayPropsSchema, CartPropsSchema, CategoryFacetPropsSchema, CommerceSearchPropsSchema, ComparisonTablePropsSchema, DateFacetPropsSchema, FacetManagerPropsSchema, BreadboxPropsSchema, InstantProductsPropsSchema, LayoutStackPropsSchema, SearchBoxPropsSchema, SessionShellPropsSchema, NextActionsBarPropsSchema, NumericFacetPropsSchema, PageSizePropsSchema, PaginationPropsSchema, ProductCarouselPropsSchema, ProductListPropsSchema, ProductResearchCardPropsSchema, ProductSummaryPropsSchema, QuerySuggestionsPropsSchema, QuerySummaryPropsSchema, RegularFacetPropsSchema, SortPropsSchema, DataBindingSchema, FunctionCallSchema, DynamicNumberSchema, DynamicStringSchema, DynamicBooleanSchema, DynamicStringListSchema, DynamicValueSchema, DynamicActionSchema, BundleDisplayActionSchema, CategoryFacetActionSchema, CommerceSearchActionSchema, ComparisonTableActionSchema, DateFacetActionSchema, FacetManagerActionSchema, BreadboxActionSchema, InstantProductsActionSchema, LayoutStackActionSchema, SearchBoxActionSchema, SessionShellActionSchema, NextActionsBarActionSchema, NumericFacetActionSchema, PageSizeActionSchema, PaginationActionSchema, ProductCarouselActionSchema, ProductListActionSchema, ProductResearchCardActionSchema, ProductSummaryActionSchema, QuerySummaryActionSchema, RegularFacetActionSchema, SortActionSchema, } from './generated/schemas.js';
2
+ export { ActionItemSchema, FollowupActionItemSchema, SearchActionItemSchema, SearchOptionActionItemSchema, CartSchema, CartActionsSchema, CartStateSchema, UpdateCartSchema, UpdateCartPayloadSchema, CartUpdateOperationSchema, PurchaseSchema, PurchasePayloadSchema, PurchaseProductSchema, TransactionSchema, QuerySuggestionsSchema, QuerySuggestionsActionsSchema, QuerySuggestionsStateSchema, QueryCompletionSchema, FetchSuggestionsSchema, FetchSuggestionsPayloadSchema, InstantProductsSchema, InstantProductsActionsSchema, InstantProductsStateSchema, FetchInstantProductsSchema, FetchInstantProductsPayloadSchema, RestoreStateSchema, RestoreStatePayloadSchema, FacetRestoreSchema, NumericRangeRestoreSchema, ShowMoreSchema, ShowMorePayloadSchema, SelectProductsSchema, SelectProductsPayloadSchema, ProductClickSchema, ProductClickPayloadSchema, BundleDisplaySchema, BundleDisplayStateSchema, BundleSlotSchema, BundleTierSchema, CategoryFacetSchema, CategoryFacetActionsSchema, CategoryFacetValueSchema, CategoryFacetSearchSchema, CategoryFacetSearchPayloadSchema, CategoryFacetSearchStateSchema, CategoryFacetSelectPathPayloadSchema, CategoryFacetStateSchema, CategoryFacetValuesSchema, CommerceSearchSchema, CommerceSearchActionsSchema, CommerceSearchStateSchema, SubmitQuerySchema, SubmitQueryPayloadSchema, ComparisonAttributeSchema, ComparisonProductSchema, ComparisonTableSchema, ComparisonTableStateSchema, ComponentContractsSchema, DateFacetSchema, DateFacetActionsSchema, DateFacetApplyCustomRangePayloadSchema, DateFacetCustomRangeSchema, DateFacetStateSchema, DateFacetToggleSelectPayloadSchema, DateFacetToggleSingleSelectPayloadSchema, DateFacetValueSchema, FacetManagerSchema, FacetManagerActionsSchema, FacetManagerStateSchema, BreadboxSchema, BreadboxActionsSchema, BreadboxStateSchema, BreadboxFacetSchema, BreadboxRegularFacetSchema, BreadboxRegularFacetValueSchema, BreadboxNumericalRangeFacetSchema, BreadboxNumericalRangeFacetValueSchema, BreadboxDateRangeFacetSchema, BreadboxDateRangeFacetValueSchema, BreadboxHierarchicalFacetSchema, BreadboxDeselectPayloadSchema, BreadboxDeselectRegularValueSchema, BreadboxDeselectNumericalRangeSchema, BreadboxDeselectDateRangeSchema, BreadboxDeselectHierarchicalPathSchema, FacetValueStateSchema, LayoutStackSchema, LayoutStackStateSchema, SearchBoxSchema, SearchBoxStateSchema, SessionShellSchema, SessionShellActionsSchema, SessionShellStateSchema, InitializeSchema, InitializePayloadSchema, NextActionsBarSchema, NextActionsStateSchema, NumericFacetSchema, NumericFacetActionsSchema, NumericFacetCustomRangeSchema, NumericFacetDomainSchema, NumericFacetApplyCustomRangePayloadSchema, NumericFacetStateSchema, NumericFacetToggleSelectPayloadSchema, NumericFacetToggleSingleSelectPayloadSchema, NumericFacetValueSchema, PageSizeSchema, PageSizeActionsSchema, PageSizeStateSchema, PaginationSchema, PaginationActionsSchema, PaginationStateSchema, ProductCarouselSchema, ProductCarouselStateSchema, ProductListSchema, ProductListActionsSchema, ProductListStateSchema, ProductResearchCardSchema, ProductResearchCardActionsSchema, ProductResearchCardStateSchema, ProductResearchRelatedDocumentSchema, ProductSummarySchema, ProductSummaryActionsSchema, ProductSummaryStateSchema, QuerySummarySchema, QuerySummaryActionsSchema, QuerySummaryStateSchema, QueryCorrectionSchema, QueryCorrectionCauseSchema, BadgeSchema, BadgePlacementSchema, ProductSchema, RegularFacetSchema, RegularFacetActionsSchema, RegularFacetSearchSchema, RegularFacetSearchPayloadSchema, RegularFacetSearchResultSchema, RegularFacetSearchStateSchema, RegularFacetStateSchema, RegularFacetToggleSelectPayloadSchema, RegularFacetToggleSingleSelectPayloadSchema, RegularFacetValueSchema, SelectActionPayloadSchema, SelectSearchOptionPayloadSchema, SelectPagePayloadSchema, SelectSortPayloadSchema, SetPageSizePayloadSchema, SortSchema, SortActionsSchema, SortCriterionSchema, SortStateSchema, BundleDisplayPropsSchema, CartPropsSchema, CategoryFacetPropsSchema, CommerceSearchPropsSchema, ComparisonTablePropsSchema, DateFacetPropsSchema, FacetManagerPropsSchema, BreadboxPropsSchema, InstantProductsPropsSchema, LayoutStackPropsSchema, SearchBoxPropsSchema, SessionShellPropsSchema, NextActionsBarPropsSchema, NumericFacetPropsSchema, PageSizePropsSchema, PaginationPropsSchema, ProductCarouselPropsSchema, ProductListPropsSchema, ProductResearchCardPropsSchema, ProductSummaryPropsSchema, QuerySuggestionsPropsSchema, QuerySummaryPropsSchema, RegularFacetPropsSchema, SortPropsSchema, DataBindingSchema, FunctionCallSchema, DynamicNumberSchema, DynamicStringSchema, DynamicBooleanSchema, DynamicStringListSchema, DynamicValueSchema, DynamicActionSchema, BundleDisplayActionSchema, CategoryFacetActionSchema, CommerceSearchActionSchema, ComparisonTableActionSchema, DateFacetActionSchema, FacetManagerActionSchema, BreadboxActionSchema, InstantProductsActionSchema, LayoutStackActionSchema, SearchBoxActionSchema, SessionShellActionSchema, NextActionsBarActionSchema, NumericFacetActionSchema, PageSizeActionSchema, PaginationActionSchema, ProductCarouselActionSchema, ProductListActionSchema, ProductResearchCardActionSchema, ProductSummaryActionSchema, QuerySummaryActionSchema, RegularFacetActionSchema, SortActionSchema, } from './generated/schemas.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coveo/thermidor-schema",
3
- "version": "1.0.0-beta.39",
3
+ "version": "1.0.0-beta.40",
4
4
  "description": "Zod and TypeScript projections of the Thermidor JSON Schema contract.",
5
5
  "homepage": "https://github.com/coveo-platform/thermidor-schema#readme",
6
6
  "bugs": {
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://schema.thermidor.coveo.com/components/commerce-search.schema.json",
4
4
  "title": "CommerceSearch",
5
- "description": "Surface-root component for a commerce search surface. Its component discriminant carries the surface intent; it owns the surface's top-level components via named child slots and dispatches search lifecycle actions (submitQuery, restoreState, overrideCorrection).",
5
+ "description": "Surface-root component for a commerce search surface. Its component discriminant carries the surface intent; it owns the surface's top-level components via named child slots and dispatches search lifecycle actions (submitQuery, restoreState).",
6
6
  "allOf": [
7
7
  {
8
8
  "$ref": "https://schema.thermidor.coveo.com/base/component.schema.json"
@@ -30,16 +30,13 @@
30
30
  },
31
31
  "actions": {
32
32
  "type": "object",
33
- "required": ["submitQuery", "restoreState", "overrideCorrection"],
33
+ "required": ["submitQuery", "restoreState"],
34
34
  "properties": {
35
35
  "submitQuery": {
36
36
  "$ref": "#/$defs/SubmitQueryAction"
37
37
  },
38
38
  "restoreState": {
39
39
  "$ref": "#/$defs/RestoreStateAction"
40
- },
41
- "overrideCorrection": {
42
- "$ref": "#/$defs/OverrideCorrectionAction"
43
40
  }
44
41
  },
45
42
  "additionalProperties": false
@@ -119,28 +116,6 @@
119
116
  }
120
117
  }
121
118
  },
122
- "OverrideCorrectionAction": {
123
- "title": "overrideCorrection",
124
- "description": "Re-runs a search with the shopper's original query instead of an automatic correction.",
125
- "allOf": [
126
- {
127
- "$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
128
- }
129
- ],
130
- "properties": {
131
- "payload": {
132
- "type": "object",
133
- "required": ["originalQuery"],
134
- "properties": {
135
- "originalQuery": {
136
- "type": "string",
137
- "minLength": 1
138
- }
139
- },
140
- "additionalProperties": false
141
- }
142
- }
143
- },
144
119
  "FacetRestore": {
145
120
  "title": "FacetRestore",
146
121
  "type": "object",
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://schema.thermidor.coveo.com/components/query-summary.schema.json",
4
4
  "title": "QuerySummary",
5
- "description": "Summarizes the current result window for a search surface (e.g. 'Products 1-12 of 43 for Water Sports'). Read-only from the frontend.",
5
+ "description": "Summarizes the current result window for a search surface (e.g. 'Products 1-12 of 43 for Water Sports'), says when the backend replaced the shopper's query, and dispatches the action that searches the shopper's query instead when the backend allows it.",
6
6
  "$comment": "Carries its own backend-computed aggregate instead of reading sibling state (search box, pagination, product-list), so it has no cross-component coupling.",
7
7
  "allOf": [
8
8
  {
@@ -33,12 +33,21 @@
33
33
  "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
34
34
  "description": "The total number of results, bound to /state/<id>/totalEntries."
35
35
  },
36
+ "correction": {
37
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
38
+ "description": "The replacement of the shopper's query, bound to /state/<id>/correction."
39
+ },
36
40
  "state": {
37
41
  "$ref": "#/$defs/QuerySummaryState"
38
42
  },
39
43
  "actions": {
40
44
  "type": "object",
41
- "properties": {},
45
+ "required": ["overrideCorrection"],
46
+ "properties": {
47
+ "overrideCorrection": {
48
+ "$ref": "#/$defs/OverrideCorrectionAction"
49
+ }
50
+ },
42
51
  "additionalProperties": false
43
52
  }
44
53
  },
@@ -52,7 +61,7 @@
52
61
  "properties": {
53
62
  "query": {
54
63
  "type": "string",
55
- "description": "The current query string. May be empty when the surface has no active query."
64
+ "description": "The query whose results are shown. May be empty when the surface has no active query."
56
65
  },
57
66
  "firstIndex": {
58
67
  "type": "integer",
@@ -68,9 +77,45 @@
68
77
  "type": "integer",
69
78
  "minimum": 0,
70
79
  "description": "The total number of results across all pages."
80
+ },
81
+ "correction": {
82
+ "$ref": "#/$defs/QueryCorrection"
83
+ }
84
+ },
85
+ "additionalProperties": false
86
+ },
87
+ "QueryCorrection": {
88
+ "title": "QueryCorrection",
89
+ "description": "Says that the backend searched another query than the shopper's. Absent when the shopper's query was searched as typed.",
90
+ "type": "object",
91
+ "required": ["originalQuery", "cause", "canOverride"],
92
+ "properties": {
93
+ "originalQuery": {
94
+ "type": "string",
95
+ "minLength": 1,
96
+ "description": "The query the shopper submitted."
97
+ },
98
+ "cause": {
99
+ "title": "QueryCorrectionCause",
100
+ "type": "string",
101
+ "enum": ["correction", "trigger"],
102
+ "description": "What replaced the shopper's query: an automatic query correction, or a query trigger."
103
+ },
104
+ "canOverride": {
105
+ "type": "boolean",
106
+ "description": "Whether overrideCorrection can search the original query instead. False when searching it would replace it again, as for an automatic correction the search service applies on every search."
71
107
  }
72
108
  },
73
109
  "additionalProperties": false
110
+ },
111
+ "OverrideCorrectionAction": {
112
+ "title": "overrideCorrection",
113
+ "description": "Searches the shopper's original query instead of the query that replaced it, for this search only: a later query can be replaced again. The backend reads the original query from its state and applies the action only when the correction's canOverride is true.",
114
+ "allOf": [
115
+ {
116
+ "$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
117
+ }
118
+ ]
74
119
  }
75
120
  }
76
121
  }