@coveo/thermidor-schema 1.0.0-beta.4 → 1.0.0-beta.41

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 (65) hide show
  1. package/README.md +32 -5
  2. package/dist/generated/schemas.d.ts +3668 -560
  3. package/dist/generated/schemas.js +912 -285
  4. package/dist/generated/zod3/index.d.ts +3 -0
  5. package/dist/generated/zod3/index.js +5 -0
  6. package/dist/generated/zod3/schemas.d.ts +32331 -0
  7. package/dist/generated/zod3/schemas.js +1282 -0
  8. package/dist/index.d.ts +2 -2
  9. package/dist/index.js +1 -1
  10. package/dist/zod3-compat.d.ts +79 -0
  11. package/dist/zod3-compat.js +82 -0
  12. package/package.json +28 -22
  13. package/schema/base/catalog.schema.json +5 -4
  14. package/schema/base/component.schema.json +22 -33
  15. package/schema/{components/component-contracts.schema.json → component-contracts.schema.json} +23 -2
  16. package/schema/components/breadbox.schema.json +82 -0
  17. package/schema/components/bundle-display.schema.json +17 -13
  18. package/schema/components/cart.schema.json +147 -0
  19. package/schema/components/category-facet.schema.json +30 -16
  20. package/schema/components/commerce-search.schema.json +111 -15
  21. package/schema/components/comparison-table.schema.json +21 -13
  22. package/schema/components/date-facet.schema.json +35 -15
  23. package/schema/components/facet-manager.schema.json +12 -14
  24. package/schema/components/instant-products.schema.json +85 -0
  25. package/schema/components/layout-stack.schema.json +19 -15
  26. package/schema/components/next-actions-bar.schema.json +44 -17
  27. package/schema/components/numeric-facet.schema.json +39 -17
  28. package/schema/components/page-size.schema.json +13 -15
  29. package/schema/components/pagination.schema.json +28 -27
  30. package/schema/components/product-carousel.schema.json +13 -13
  31. package/schema/components/product-list.schema.json +75 -14
  32. package/schema/components/product-research-card.schema.json +107 -0
  33. package/schema/components/product-summary.schema.json +15 -14
  34. package/schema/components/query-suggestions.schema.json +102 -0
  35. package/schema/components/query-summary.schema.json +70 -16
  36. package/schema/components/regular-facet.schema.json +40 -93
  37. package/schema/components/search-box.schema.json +47 -0
  38. package/schema/components/session-shell.schema.json +65 -0
  39. package/schema/components/sort.schema.json +22 -16
  40. package/schema/definitions/action-item.schema.json +10 -13
  41. package/schema/definitions/badge-placement.schema.json +22 -0
  42. package/schema/definitions/badge.schema.json +27 -0
  43. package/schema/definitions/breadbox-date-range-facet.schema.json +56 -0
  44. package/schema/definitions/breadbox-deselect-date-range.schema.json +28 -0
  45. package/schema/definitions/breadbox-deselect-hierarchical-path.schema.json +28 -0
  46. package/schema/definitions/breadbox-deselect-numerical-range.schema.json +28 -0
  47. package/schema/definitions/breadbox-deselect-payload.schema.json +20 -0
  48. package/schema/definitions/breadbox-deselect-regular-value.schema.json +25 -0
  49. package/schema/definitions/breadbox-facet.schema.json +20 -0
  50. package/schema/definitions/breadbox-hierarchical-facet.schema.json +37 -0
  51. package/schema/definitions/breadbox-numerical-range-facet.schema.json +56 -0
  52. package/schema/definitions/breadbox-regular-facet.schema.json +59 -0
  53. package/schema/definitions/bundle-tier.schema.json +6 -1
  54. package/schema/definitions/child-list.schema.json +32 -0
  55. package/schema/definitions/comparison-product.schema.json +7 -2
  56. package/schema/definitions/component-id.schema.json +9 -0
  57. package/schema/definitions/data-binding.schema.json +16 -0
  58. package/schema/definitions/facet-value-state.schema.json +1 -1
  59. package/schema/definitions/followup-action-item.schema.json +20 -0
  60. package/schema/definitions/product.schema.json +10 -6
  61. package/schema/definitions/search-action-item.schema.json +20 -0
  62. package/schema/definitions/search-option-action-item.schema.json +25 -0
  63. package/schema/definitions/sort-field.schema.json +26 -0
  64. package/schema/definitions/child-ref.schema.json +0 -8
  65. package/schema/definitions/selectable-facet-value-state.schema.json +0 -8
@@ -0,0 +1,147 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.thermidor.coveo.com/components/cart.schema.json",
4
+ "title": "Cart",
5
+ "description": "Represents a commerce cart or checkout surface. The backend owns cart state; semantic cart mutations and purchase completion are dispatched through this component.",
6
+ "allOf": [
7
+ {
8
+ "$ref": "https://schema.thermidor.coveo.com/base/component.schema.json"
9
+ }
10
+ ],
11
+ "properties": {
12
+ "component": {
13
+ "type": "string",
14
+ "const": "Cart"
15
+ },
16
+ "id": {
17
+ "type": "string"
18
+ },
19
+ "state": {
20
+ "$ref": "#/$defs/CartState"
21
+ },
22
+ "actions": {
23
+ "type": "object",
24
+ "required": ["updateCart", "purchase"],
25
+ "properties": {
26
+ "updateCart": {
27
+ "$ref": "#/$defs/UpdateCartAction"
28
+ },
29
+ "purchase": {
30
+ "$ref": "#/$defs/PurchaseAction"
31
+ }
32
+ },
33
+ "additionalProperties": false
34
+ }
35
+ },
36
+ "additionalProperties": false,
37
+ "$defs": {
38
+ "CartState": {
39
+ "title": "CartState",
40
+ "description": "Cart state is backend-owned. This initial contract intentionally carries no presentation fields; it provides the canonical action anchor for cart mutations and checkout completion.",
41
+ "type": "object",
42
+ "properties": {},
43
+ "additionalProperties": false
44
+ },
45
+ "UpdateCartAction": {
46
+ "title": "updateCart",
47
+ "description": "Applies a semantic item update to the cart and records the corresponding commerce cart event.",
48
+ "allOf": [
49
+ {
50
+ "$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
51
+ }
52
+ ],
53
+ "properties": {
54
+ "payload": {
55
+ "type": "object",
56
+ "required": ["productId", "quantity", "operation"],
57
+ "properties": {
58
+ "productId": {
59
+ "type": "string",
60
+ "minLength": 1
61
+ },
62
+ "name": {
63
+ "type": "string"
64
+ },
65
+ "price": {
66
+ "type": ["number", "null"]
67
+ },
68
+ "quantity": {
69
+ "type": "integer",
70
+ "minimum": 1
71
+ },
72
+ "operation": {
73
+ "title": "CartUpdateOperation",
74
+ "type": "string",
75
+ "enum": ["add", "remove", "setQuantity"]
76
+ }
77
+ },
78
+ "additionalProperties": false
79
+ }
80
+ }
81
+ },
82
+ "PurchaseAction": {
83
+ "title": "purchase",
84
+ "description": "Records a completed commerce transaction.",
85
+ "allOf": [
86
+ {
87
+ "$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
88
+ }
89
+ ],
90
+ "properties": {
91
+ "payload": {
92
+ "type": "object",
93
+ "required": ["products", "transaction"],
94
+ "properties": {
95
+ "products": {
96
+ "type": "array",
97
+ "items": {
98
+ "$ref": "#/$defs/PurchaseProduct"
99
+ }
100
+ },
101
+ "transaction": {
102
+ "$ref": "#/$defs/Transaction"
103
+ }
104
+ },
105
+ "additionalProperties": false
106
+ }
107
+ }
108
+ },
109
+ "PurchaseProduct": {
110
+ "title": "PurchaseProduct",
111
+ "type": "object",
112
+ "required": ["productId", "quantity"],
113
+ "properties": {
114
+ "productId": {
115
+ "type": "string",
116
+ "minLength": 1
117
+ },
118
+ "name": {
119
+ "type": "string"
120
+ },
121
+ "price": {
122
+ "type": ["number", "null"]
123
+ },
124
+ "quantity": {
125
+ "type": "integer",
126
+ "minimum": 1
127
+ }
128
+ },
129
+ "additionalProperties": false
130
+ },
131
+ "Transaction": {
132
+ "title": "Transaction",
133
+ "type": "object",
134
+ "required": ["id", "revenue"],
135
+ "properties": {
136
+ "id": {
137
+ "type": "string",
138
+ "minLength": 1
139
+ },
140
+ "revenue": {
141
+ "type": "number"
142
+ }
143
+ },
144
+ "additionalProperties": false
145
+ }
146
+ }
147
+ }
@@ -9,9 +9,36 @@
9
9
  }
10
10
  ],
11
11
  "properties": {
12
- "componentType": {
12
+ "component": {
13
13
  "type": "string",
14
- "const": "category-facet"
14
+ "const": "CategoryFacet"
15
+ },
16
+ "id": {
17
+ "type": "string"
18
+ },
19
+ "field": {
20
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
21
+ "description": "The index field the facet operates on, bound to /state/<id>/field."
22
+ },
23
+ "displayName": {
24
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
25
+ "description": "The facet's human-readable label, bound to /state/<id>/displayName."
26
+ },
27
+ "values": {
28
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
29
+ "description": "The category facet values, bound to /state/<id>/values."
30
+ },
31
+ "canShowMoreValues": {
32
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
33
+ "description": "Whether more facet values can be shown, bound to /state/<id>/canShowMoreValues."
34
+ },
35
+ "canShowLessValues": {
36
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
37
+ "description": "Whether fewer facet values can be shown, bound to /state/<id>/canShowLessValues."
38
+ },
39
+ "facetSearch": {
40
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
41
+ "description": "The facet search state, bound to /state/<id>/facetSearch."
15
42
  },
16
43
  "state": {
17
44
  "$ref": "#/$defs/CategoryFacetState"
@@ -51,17 +78,6 @@
51
78
  }
52
79
  },
53
80
  "additionalProperties": false
54
- },
55
- "children": {
56
- "type": "array",
57
- "items": {
58
- "$ref": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json"
59
- },
60
- "maxItems": 1000,
61
- "default": []
62
- },
63
- "child": {
64
- "$ref": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json"
65
81
  }
66
82
  },
67
83
  "additionalProperties": false,
@@ -141,14 +157,13 @@
141
157
  "additionalProperties": false
142
158
  },
143
159
  "CategoryFacetSearch": {
144
- "title": "CategoryFacetSearch",
160
+ "title": "CategoryFacetSearchState",
145
161
  "description": "The current category facet search state.",
146
162
  "type": "object",
147
163
  "required": ["query", "canShowMoreResults", "results"],
148
164
  "properties": {
149
165
  "query": {
150
166
  "type": "string",
151
- "maxLength": 256,
152
167
  "description": "The current facet search query."
153
168
  },
154
169
  "canShowMoreResults": {
@@ -214,7 +229,6 @@
214
229
  "properties": {
215
230
  "query": {
216
231
  "type": "string",
217
- "maxLength": 256,
218
232
  "description": "The facet search query string."
219
233
  }
220
234
  },
@@ -2,40 +2,44 @@
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 componentType carries the surface intent; it owns the surface's top-level components via children and dispatches submitQuery when the user submits a new query.",
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"
9
9
  }
10
10
  ],
11
11
  "properties": {
12
- "componentType": {
12
+ "id": {
13
+ "type": "string"
14
+ },
15
+ "component": {
13
16
  "type": "string",
14
- "const": "commerce-search"
17
+ "const": "CommerceSearch"
18
+ },
19
+ "sidebarChild": {
20
+ "$ref": "https://schema.thermidor.coveo.com/definitions/component-id.schema.json",
21
+ "description": "The sidebar named slot: a static ComponentId the renderer mounts by name via children(sidebarChild).",
22
+ "$comment": "Heterogeneous named-slot composition: CommerceSearch uses named ComponentId slots (sidebar, main) rather than a positional children[] array."
23
+ },
24
+ "mainChild": {
25
+ "$ref": "https://schema.thermidor.coveo.com/definitions/component-id.schema.json",
26
+ "description": "The main-area named slot: a static ComponentId the renderer mounts by name via children(mainChild)."
15
27
  },
16
28
  "state": {
17
29
  "$ref": "#/$defs/CommerceSearchState"
18
30
  },
19
31
  "actions": {
20
32
  "type": "object",
21
- "required": ["submitQuery"],
33
+ "required": ["submitQuery", "restoreState"],
22
34
  "properties": {
23
35
  "submitQuery": {
24
36
  "$ref": "#/$defs/SubmitQueryAction"
37
+ },
38
+ "restoreState": {
39
+ "$ref": "#/$defs/RestoreStateAction"
25
40
  }
26
41
  },
27
42
  "additionalProperties": false
28
- },
29
- "children": {
30
- "type": "array",
31
- "items": {
32
- "$ref": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json"
33
- },
34
- "maxItems": 1000,
35
- "default": []
36
- },
37
- "child": {
38
- "$ref": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json"
39
43
  }
40
44
  },
41
45
  "additionalProperties": false,
@@ -67,6 +71,98 @@
67
71
  "additionalProperties": false
68
72
  }
69
73
  }
74
+ },
75
+ "RestoreStateAction": {
76
+ "title": "restoreState",
77
+ "description": "Restores a commerce-search surface from externally persisted search state.",
78
+ "allOf": [
79
+ {
80
+ "$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
81
+ }
82
+ ],
83
+ "properties": {
84
+ "payload": {
85
+ "type": "object",
86
+ "required": ["query", "page", "pageSize"],
87
+ "properties": {
88
+ "query": {
89
+ "type": "string"
90
+ },
91
+ "page": {
92
+ "type": "integer",
93
+ "minimum": 0
94
+ },
95
+ "pageSize": {
96
+ "type": "integer",
97
+ "minimum": 1
98
+ },
99
+ "sortCriteria": {
100
+ "type": "string"
101
+ },
102
+ "facets": {
103
+ "type": "array",
104
+ "items": {
105
+ "$ref": "#/$defs/FacetRestore"
106
+ }
107
+ },
108
+ "pinnedProducts": {
109
+ "type": "array",
110
+ "items": {
111
+ "type": "string"
112
+ }
113
+ }
114
+ },
115
+ "additionalProperties": false
116
+ }
117
+ }
118
+ },
119
+ "FacetRestore": {
120
+ "title": "FacetRestore",
121
+ "type": "object",
122
+ "required": ["facetId"],
123
+ "properties": {
124
+ "facetId": {
125
+ "type": "string",
126
+ "minLength": 1
127
+ },
128
+ "values": {
129
+ "type": "array",
130
+ "items": {
131
+ "type": "string"
132
+ }
133
+ },
134
+ "numericRanges": {
135
+ "type": "array",
136
+ "items": {
137
+ "$ref": "#/$defs/NumericRangeRestore"
138
+ }
139
+ },
140
+ "path": {
141
+ "type": "array",
142
+ "description": "The selected path of a category facet, ordered from the root to the selected value.",
143
+ "items": {
144
+ "type": "string"
145
+ }
146
+ }
147
+ },
148
+ "additionalProperties": false
149
+ },
150
+ "NumericRangeRestore": {
151
+ "title": "NumericRangeRestore",
152
+ "type": "object",
153
+ "required": ["start", "end"],
154
+ "properties": {
155
+ "start": {
156
+ "type": "number"
157
+ },
158
+ "end": {
159
+ "type": "number"
160
+ },
161
+ "endInclusive": {
162
+ "type": "boolean"
163
+ }
164
+ },
165
+ "additionalProperties": false
70
166
  }
71
167
  }
72
168
  }
@@ -9,9 +9,28 @@
9
9
  }
10
10
  ],
11
11
  "properties": {
12
- "componentType": {
12
+ "id": {
13
+ "type": "string"
14
+ },
15
+ "component": {
13
16
  "type": "string",
14
- "const": "comparison-table"
17
+ "const": "ComparisonTable"
18
+ },
19
+ "heading": {
20
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
21
+ "description": "The table heading, bound to /state/<id>/heading."
22
+ },
23
+ "summary": {
24
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
25
+ "description": "The AI summary text, bound to /state/<id>/summary."
26
+ },
27
+ "products": {
28
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
29
+ "description": "The compared products, bound to /state/<id>/products."
30
+ },
31
+ "attributes": {
32
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
33
+ "description": "The ordered attribute descriptors, bound to /state/<id>/attributes."
15
34
  },
16
35
  "state": {
17
36
  "$ref": "#/$defs/ComparisonTableState"
@@ -20,17 +39,6 @@
20
39
  "type": "object",
21
40
  "properties": {},
22
41
  "additionalProperties": false
23
- },
24
- "children": {
25
- "type": "array",
26
- "items": {
27
- "$ref": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json"
28
- },
29
- "maxItems": 1000,
30
- "default": []
31
- },
32
- "child": {
33
- "$ref": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json"
34
42
  }
35
43
  },
36
44
  "additionalProperties": false,
@@ -9,9 +9,40 @@
9
9
  }
10
10
  ],
11
11
  "properties": {
12
- "componentType": {
12
+ "component": {
13
13
  "type": "string",
14
- "const": "date-facet"
14
+ "const": "DateFacet"
15
+ },
16
+ "id": {
17
+ "type": "string"
18
+ },
19
+ "field": {
20
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
21
+ "description": "The commerce index field the facet operates on, bound to /state/<id>/field."
22
+ },
23
+ "displayName": {
24
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
25
+ "description": "The facet's human-readable label, bound to /state/<id>/displayName."
26
+ },
27
+ "values": {
28
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
29
+ "description": "The date-range facet values, bound to /state/<id>/values."
30
+ },
31
+ "customRange": {
32
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
33
+ "description": "The custom range, bound to /state/<id>/customRange."
34
+ },
35
+ "hasActiveValues": {
36
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
37
+ "description": "Whether at least one facet value is active, bound to /state/<id>/hasActiveValues."
38
+ },
39
+ "canShowMoreValues": {
40
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
41
+ "description": "Whether more facet values can be shown, bound to /state/<id>/canShowMoreValues."
42
+ },
43
+ "canShowLessValues": {
44
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
45
+ "description": "Whether fewer facet values can be shown, bound to /state/<id>/canShowLessValues."
15
46
  },
16
47
  "state": {
17
48
  "$ref": "#/$defs/DateFacetState"
@@ -47,17 +78,6 @@
47
78
  }
48
79
  },
49
80
  "additionalProperties": false
50
- },
51
- "children": {
52
- "type": "array",
53
- "items": {
54
- "$ref": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json"
55
- },
56
- "maxItems": 1000,
57
- "default": []
58
- },
59
- "child": {
60
- "$ref": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json"
61
81
  }
62
82
  },
63
83
  "additionalProperties": false,
@@ -137,8 +157,8 @@
137
157
  "description": "The number of results matching this range."
138
158
  },
139
159
  "state": {
140
- "$ref": "https://schema.thermidor.coveo.com/definitions/selectable-facet-value-state.schema.json",
141
- "description": "The selection state of this facet value (idle or selected; exclusion is not supported)."
160
+ "$ref": "https://schema.thermidor.coveo.com/definitions/facet-value-state.schema.json",
161
+ "description": "The selection state of this facet value."
142
162
  }
143
163
  },
144
164
  "additionalProperties": false
@@ -2,16 +2,25 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://schema.thermidor.coveo.com/components/facet-manager.schema.json",
4
4
  "title": "FacetManager",
5
- "description": "Manages facet ordering and cross-facet concerns. Holds the backend-determined order of facet components as state. The position of each identifier (indexed from 0) determines the facet's rendering rank. Ready to gain cross-facet actions (e.g., clear all facets, reorder) as needs arise.",
5
+ "description": "Manages facet ordering and cross-facet concerns. Holds the backend-determined order of facet components as state; each identifier's position (from 0) is its rendering rank.",
6
+ "$comment": "Ready to gain cross-facet actions (e.g. clear all facets, reorder) as needs arise.",
6
7
  "allOf": [
7
8
  {
8
9
  "$ref": "https://schema.thermidor.coveo.com/base/component.schema.json"
9
10
  }
10
11
  ],
11
12
  "properties": {
12
- "componentType": {
13
+ "id": {
14
+ "type": "string"
15
+ },
16
+ "component": {
13
17
  "type": "string",
14
- "const": "facet-manager"
18
+ "const": "FacetManager"
19
+ },
20
+ "children": {
21
+ "$ref": "https://schema.thermidor.coveo.com/definitions/child-list.schema.json",
22
+ "description": "The backend-determined facet order: a ChildList of ComponentId references whose position (from 0) is each facet's rendering rank.",
23
+ "$comment": "Homogeneous ordered-list composition: child ids are static (binder passes through unresolved), mounted in order via children(id)."
15
24
  },
16
25
  "state": {
17
26
  "$ref": "#/$defs/FacetManagerState"
@@ -20,17 +29,6 @@
20
29
  "type": "object",
21
30
  "properties": {},
22
31
  "additionalProperties": false
23
- },
24
- "children": {
25
- "type": "array",
26
- "items": {
27
- "$ref": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json"
28
- },
29
- "maxItems": 1000,
30
- "default": []
31
- },
32
- "child": {
33
- "$ref": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json"
34
32
  }
35
33
  },
36
34
  "additionalProperties": false,
@@ -0,0 +1,85 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.thermidor.coveo.com/components/instant-products.schema.json",
4
+ "title": "InstantProducts",
5
+ "description": "Requests and renders the products for the query highlighted in the search box. The renderer owns the highlight, and shows the products only while their query equals the highlighted query.",
6
+ "allOf": [
7
+ {
8
+ "$ref": "https://schema.thermidor.coveo.com/base/component.schema.json"
9
+ }
10
+ ],
11
+ "properties": {
12
+ "id": {
13
+ "type": "string"
14
+ },
15
+ "component": {
16
+ "type": "string",
17
+ "const": "InstantProducts"
18
+ },
19
+ "query": {
20
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
21
+ "description": "The highlighted query these products were requested for, bound to /state/<id>/query."
22
+ },
23
+ "products": {
24
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
25
+ "description": "The products for the query, bound to /state/<id>/products."
26
+ },
27
+ "state": {
28
+ "$ref": "#/$defs/InstantProductsState"
29
+ },
30
+ "actions": {
31
+ "type": "object",
32
+ "required": ["fetchInstantProducts"],
33
+ "properties": {
34
+ "fetchInstantProducts": {
35
+ "$ref": "#/$defs/FetchInstantProductsAction"
36
+ }
37
+ },
38
+ "additionalProperties": false
39
+ }
40
+ },
41
+ "additionalProperties": false,
42
+ "$defs": {
43
+ "InstantProductsState": {
44
+ "title": "InstantProductsState",
45
+ "description": "The products for one query. Owned exclusively by the backend, which writes the whole state on every answer.",
46
+ "type": "object",
47
+ "required": ["query", "products"],
48
+ "properties": {
49
+ "query": {
50
+ "type": "string",
51
+ "description": "The highlighted query for which these products were requested."
52
+ },
53
+ "products": {
54
+ "type": "array",
55
+ "description": "Products returned by the commerce service for the query.",
56
+ "items": {
57
+ "$ref": "https://schema.thermidor.coveo.com/definitions/product.schema.json"
58
+ }
59
+ }
60
+ },
61
+ "additionalProperties": false
62
+ },
63
+ "FetchInstantProductsAction": {
64
+ "title": "fetchInstantProducts",
65
+ "description": "Fetches the products for the highlighted query.",
66
+ "allOf": [
67
+ {
68
+ "$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
69
+ }
70
+ ],
71
+ "properties": {
72
+ "payload": {
73
+ "type": "object",
74
+ "required": ["query"],
75
+ "properties": {
76
+ "query": {
77
+ "type": "string"
78
+ }
79
+ },
80
+ "additionalProperties": false
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }