@coveo/thermidor-schema 0.0.0 → 1.0.0-beta.10
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/LICENSE +201 -0
- package/README.md +61 -0
- package/dist/generated/schemas.d.ts +3992 -0
- package/dist/generated/schemas.js +1085 -0
- package/dist/generated/zod3/schemas.d.ts +23821 -0
- package/dist/generated/zod3/schemas.js +1087 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/dist/zod3/index.d.ts +3 -0
- package/dist/zod3/index.js +5 -0
- package/dist/zod3-compat.d.ts +79 -0
- package/dist/zod3-compat.js +82 -0
- package/package.json +52 -8
- package/schema/base/action.schema.json +12 -0
- package/schema/base/catalog.schema.json +38 -0
- package/schema/base/component.schema.json +45 -0
- package/schema/component-contracts.schema.json +73 -0
- package/schema/components/bundle-display.schema.json +52 -0
- package/schema/components/cart.schema.json +147 -0
- package/schema/components/category-facet.schema.json +303 -0
- package/schema/components/commerce-search.schema.json +186 -0
- package/schema/components/comparison-table.schema.json +78 -0
- package/schema/components/date-facet.schema.json +294 -0
- package/schema/components/facet-manager.schema.json +45 -0
- package/schema/components/layout-stack.schema.json +50 -0
- package/schema/components/next-actions-bar.schema.json +85 -0
- package/schema/components/numeric-facet.schema.json +320 -0
- package/schema/components/page-size.schema.json +79 -0
- package/schema/components/pagination.schema.json +149 -0
- package/schema/components/product-carousel.schema.json +60 -0
- package/schema/components/product-list.schema.json +116 -0
- package/schema/components/product-research-card.schema.json +70 -0
- package/schema/components/product-summary.schema.json +64 -0
- package/schema/components/query-suggestions.schema.json +113 -0
- package/schema/components/query-summary.schema.json +76 -0
- package/schema/components/regular-facet.schema.json +395 -0
- package/schema/components/sort.schema.json +107 -0
- package/schema/definitions/action-item.schema.json +20 -0
- package/schema/definitions/bundle-tier.schema.json +49 -0
- package/schema/definitions/child-list.schema.json +32 -0
- package/schema/definitions/comparison-attribute.schema.json +19 -0
- package/schema/definitions/comparison-product.schema.json +39 -0
- package/schema/definitions/component-id.schema.json +9 -0
- package/schema/definitions/data-binding.schema.json +16 -0
- package/schema/definitions/facet-value-state.schema.json +8 -0
- package/schema/definitions/product.schema.json +92 -0
- package/schema/definitions/selectable-facet-value-state.schema.json +8 -0
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schema.thermidor.coveo.com/components/category-facet.schema.json",
|
|
4
|
+
"title": "CategoryFacet",
|
|
5
|
+
"description": "A hierarchical category facet for a commerce surface. Renders a flat representation of the category tree (ancestry, selected value, and available children) with facet search. Dispatches selectPath, clearSelectedPath, search, and show-more/less actions.",
|
|
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": "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."
|
|
42
|
+
},
|
|
43
|
+
"state": {
|
|
44
|
+
"$ref": "#/$defs/CategoryFacetState"
|
|
45
|
+
},
|
|
46
|
+
"actions": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"required": [
|
|
49
|
+
"selectPath",
|
|
50
|
+
"clearSelectedPath",
|
|
51
|
+
"search",
|
|
52
|
+
"showMoreSearchResults",
|
|
53
|
+
"clearSearch",
|
|
54
|
+
"showMoreValues",
|
|
55
|
+
"showLessValues"
|
|
56
|
+
],
|
|
57
|
+
"properties": {
|
|
58
|
+
"selectPath": {
|
|
59
|
+
"$ref": "#/$defs/CategoryFacetSelectPathAction"
|
|
60
|
+
},
|
|
61
|
+
"clearSelectedPath": {
|
|
62
|
+
"$ref": "#/$defs/CategoryFacetClearSelectedPathAction"
|
|
63
|
+
},
|
|
64
|
+
"search": {
|
|
65
|
+
"$ref": "#/$defs/CategoryFacetSearchAction"
|
|
66
|
+
},
|
|
67
|
+
"showMoreSearchResults": {
|
|
68
|
+
"$ref": "#/$defs/CategoryFacetShowMoreSearchResultsAction"
|
|
69
|
+
},
|
|
70
|
+
"clearSearch": {
|
|
71
|
+
"$ref": "#/$defs/CategoryFacetClearSearchAction"
|
|
72
|
+
},
|
|
73
|
+
"showMoreValues": {
|
|
74
|
+
"$ref": "#/$defs/CategoryFacetShowMoreValuesAction"
|
|
75
|
+
},
|
|
76
|
+
"showLessValues": {
|
|
77
|
+
"$ref": "#/$defs/CategoryFacetShowLessValuesAction"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"additionalProperties": false
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"additionalProperties": false,
|
|
84
|
+
"$defs": {
|
|
85
|
+
"CategoryFacetState": {
|
|
86
|
+
"title": "CategoryFacetState",
|
|
87
|
+
"description": "The current category facet state. Owned exclusively by the backend. Presents a flat view of the category hierarchy: the ancestry path, the currently selected value, and the children available for further navigation.",
|
|
88
|
+
"type": "object",
|
|
89
|
+
"required": [
|
|
90
|
+
"field",
|
|
91
|
+
"displayName",
|
|
92
|
+
"values",
|
|
93
|
+
"canShowMoreValues",
|
|
94
|
+
"canShowLessValues",
|
|
95
|
+
"facetSearch"
|
|
96
|
+
],
|
|
97
|
+
"properties": {
|
|
98
|
+
"field": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"description": "The index field this facet operates on."
|
|
101
|
+
},
|
|
102
|
+
"displayName": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"description": "The human-readable label for this facet."
|
|
105
|
+
},
|
|
106
|
+
"values": {
|
|
107
|
+
"$ref": "#/$defs/CategoryFacetValues",
|
|
108
|
+
"description": "The flat representation of the category hierarchy."
|
|
109
|
+
},
|
|
110
|
+
"canShowMoreValues": {
|
|
111
|
+
"type": "boolean",
|
|
112
|
+
"description": "Whether more child values can be shown at the current level."
|
|
113
|
+
},
|
|
114
|
+
"canShowLessValues": {
|
|
115
|
+
"type": "boolean",
|
|
116
|
+
"description": "Whether the number of shown child values can be reduced."
|
|
117
|
+
},
|
|
118
|
+
"facetSearch": {
|
|
119
|
+
"$ref": "#/$defs/CategoryFacetSearch",
|
|
120
|
+
"description": "The current category facet search state."
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"additionalProperties": false
|
|
124
|
+
},
|
|
125
|
+
"CategoryFacetValues": {
|
|
126
|
+
"title": "CategoryFacetValues",
|
|
127
|
+
"description": "Flat representation of the category hierarchy. When no category is selected, ancestry and selected are null and children contains the top-level categories.",
|
|
128
|
+
"type": "object",
|
|
129
|
+
"required": ["ancestry", "selected", "children"],
|
|
130
|
+
"properties": {
|
|
131
|
+
"ancestry": {
|
|
132
|
+
"type": "array",
|
|
133
|
+
"description": "The ordered list of ancestor categories leading to the selected value, from the root down. Empty when no category is selected.",
|
|
134
|
+
"items": {
|
|
135
|
+
"$ref": "#/$defs/CategoryFacetValue"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"selected": {
|
|
139
|
+
"description": "The currently selected category value. Null when no category is selected.",
|
|
140
|
+
"oneOf": [
|
|
141
|
+
{
|
|
142
|
+
"$ref": "#/$defs/CategoryFacetValue"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"type": "null"
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
"children": {
|
|
150
|
+
"type": "array",
|
|
151
|
+
"description": "The child categories available for navigation. When no category is selected, these are the top-level categories. When a category is selected, these are its direct children.",
|
|
152
|
+
"items": {
|
|
153
|
+
"$ref": "#/$defs/CategoryFacetValue"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"additionalProperties": false
|
|
158
|
+
},
|
|
159
|
+
"CategoryFacetSearch": {
|
|
160
|
+
"title": "CategoryFacetSearch",
|
|
161
|
+
"description": "The current category facet search state.",
|
|
162
|
+
"type": "object",
|
|
163
|
+
"required": ["query", "canShowMoreResults", "results"],
|
|
164
|
+
"properties": {
|
|
165
|
+
"query": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"maxLength": 256,
|
|
168
|
+
"description": "The current facet search query."
|
|
169
|
+
},
|
|
170
|
+
"canShowMoreResults": {
|
|
171
|
+
"type": "boolean",
|
|
172
|
+
"description": "Whether more facet search results can be shown for the current query."
|
|
173
|
+
},
|
|
174
|
+
"results": {
|
|
175
|
+
"type": "array",
|
|
176
|
+
"description": "The current facet search results.",
|
|
177
|
+
"items": {
|
|
178
|
+
"$ref": "#/$defs/CategoryFacetValue"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"additionalProperties": false
|
|
183
|
+
},
|
|
184
|
+
"CategoryFacetSelectPathAction": {
|
|
185
|
+
"title": "categoryFacetSelectPath",
|
|
186
|
+
"description": "Navigates to a category by selecting its path.",
|
|
187
|
+
"allOf": [
|
|
188
|
+
{
|
|
189
|
+
"$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
"properties": {
|
|
193
|
+
"payload": {
|
|
194
|
+
"type": "object",
|
|
195
|
+
"required": ["path"],
|
|
196
|
+
"properties": {
|
|
197
|
+
"path": {
|
|
198
|
+
"type": "array",
|
|
199
|
+
"description": "The path of the category to select.",
|
|
200
|
+
"items": {
|
|
201
|
+
"type": "string"
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"additionalProperties": false
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"CategoryFacetClearSelectedPathAction": {
|
|
210
|
+
"title": "categoryFacetClearSelectedPath",
|
|
211
|
+
"description": "Clears the current category selection, navigating back to the root.",
|
|
212
|
+
"allOf": [
|
|
213
|
+
{
|
|
214
|
+
"$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
|
|
215
|
+
}
|
|
216
|
+
]
|
|
217
|
+
},
|
|
218
|
+
"CategoryFacetSearchAction": {
|
|
219
|
+
"title": "categoryFacetSearch",
|
|
220
|
+
"description": "Runs a category facet search for the given query.",
|
|
221
|
+
"allOf": [
|
|
222
|
+
{
|
|
223
|
+
"$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
|
|
224
|
+
}
|
|
225
|
+
],
|
|
226
|
+
"properties": {
|
|
227
|
+
"payload": {
|
|
228
|
+
"type": "object",
|
|
229
|
+
"required": ["query"],
|
|
230
|
+
"properties": {
|
|
231
|
+
"query": {
|
|
232
|
+
"type": "string",
|
|
233
|
+
"maxLength": 256,
|
|
234
|
+
"description": "The facet search query string."
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
"additionalProperties": false
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
"CategoryFacetShowMoreSearchResultsAction": {
|
|
242
|
+
"title": "categoryFacetShowMoreSearchResults",
|
|
243
|
+
"description": "Requests the next page of category facet search results.",
|
|
244
|
+
"allOf": [
|
|
245
|
+
{
|
|
246
|
+
"$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
|
|
247
|
+
}
|
|
248
|
+
]
|
|
249
|
+
},
|
|
250
|
+
"CategoryFacetClearSearchAction": {
|
|
251
|
+
"title": "categoryFacetClearSearch",
|
|
252
|
+
"description": "Clears the category facet search query and results.",
|
|
253
|
+
"allOf": [
|
|
254
|
+
{
|
|
255
|
+
"$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
|
|
256
|
+
}
|
|
257
|
+
]
|
|
258
|
+
},
|
|
259
|
+
"CategoryFacetShowMoreValuesAction": {
|
|
260
|
+
"title": "categoryFacetShowMoreValues",
|
|
261
|
+
"description": "Increases the number of child category values shown.",
|
|
262
|
+
"allOf": [
|
|
263
|
+
{
|
|
264
|
+
"$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
|
|
265
|
+
}
|
|
266
|
+
]
|
|
267
|
+
},
|
|
268
|
+
"CategoryFacetShowLessValuesAction": {
|
|
269
|
+
"title": "categoryFacetShowLessValues",
|
|
270
|
+
"description": "Decreases the number of child category values shown.",
|
|
271
|
+
"allOf": [
|
|
272
|
+
{
|
|
273
|
+
"$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
|
|
274
|
+
}
|
|
275
|
+
]
|
|
276
|
+
},
|
|
277
|
+
"CategoryFacetValue": {
|
|
278
|
+
"title": "CategoryFacetValue",
|
|
279
|
+
"description": "A single category value. Used throughout the category facet state (ancestry, selected value, children) and as facet search results.",
|
|
280
|
+
"type": "object",
|
|
281
|
+
"required": ["path", "value", "numberOfResults"],
|
|
282
|
+
"properties": {
|
|
283
|
+
"path": {
|
|
284
|
+
"type": "array",
|
|
285
|
+
"description": "The ordered path of category segments from the root to this value.",
|
|
286
|
+
"items": {
|
|
287
|
+
"type": "string"
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
"value": {
|
|
291
|
+
"type": "string",
|
|
292
|
+
"description": "The display label of this category."
|
|
293
|
+
},
|
|
294
|
+
"numberOfResults": {
|
|
295
|
+
"type": "integer",
|
|
296
|
+
"minimum": 0,
|
|
297
|
+
"description": "The number of results matching this category."
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
"additionalProperties": false
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schema.thermidor.coveo.com/components/commerce-search.schema.json",
|
|
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).",
|
|
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": "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)."
|
|
27
|
+
},
|
|
28
|
+
"state": {
|
|
29
|
+
"$ref": "#/$defs/CommerceSearchState"
|
|
30
|
+
},
|
|
31
|
+
"actions": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"required": ["submitQuery", "restoreState", "overrideCorrection"],
|
|
34
|
+
"properties": {
|
|
35
|
+
"submitQuery": {
|
|
36
|
+
"$ref": "#/$defs/SubmitQueryAction"
|
|
37
|
+
},
|
|
38
|
+
"restoreState": {
|
|
39
|
+
"$ref": "#/$defs/RestoreStateAction"
|
|
40
|
+
},
|
|
41
|
+
"overrideCorrection": {
|
|
42
|
+
"$ref": "#/$defs/OverrideCorrectionAction"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"additionalProperties": false
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"additionalProperties": false,
|
|
49
|
+
"$defs": {
|
|
50
|
+
"CommerceSearchState": {
|
|
51
|
+
"title": "CommerceSearchState",
|
|
52
|
+
"description": "The commerce search surface state. Owned exclusively by the backend.",
|
|
53
|
+
"type": "object",
|
|
54
|
+
"additionalProperties": false
|
|
55
|
+
},
|
|
56
|
+
"SubmitQueryAction": {
|
|
57
|
+
"title": "submitQuery",
|
|
58
|
+
"description": "Submits a new search query.",
|
|
59
|
+
"allOf": [
|
|
60
|
+
{
|
|
61
|
+
"$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"properties": {
|
|
65
|
+
"payload": {
|
|
66
|
+
"type": "object",
|
|
67
|
+
"required": ["query"],
|
|
68
|
+
"properties": {
|
|
69
|
+
"query": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"description": "The query string to submit."
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"additionalProperties": false
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"RestoreStateAction": {
|
|
79
|
+
"title": "restoreState",
|
|
80
|
+
"description": "Restores a commerce-search surface from externally persisted search state.",
|
|
81
|
+
"allOf": [
|
|
82
|
+
{
|
|
83
|
+
"$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"properties": {
|
|
87
|
+
"payload": {
|
|
88
|
+
"type": "object",
|
|
89
|
+
"required": ["query", "page", "pageSize"],
|
|
90
|
+
"properties": {
|
|
91
|
+
"query": {
|
|
92
|
+
"type": "string"
|
|
93
|
+
},
|
|
94
|
+
"page": {
|
|
95
|
+
"type": "integer",
|
|
96
|
+
"minimum": 0
|
|
97
|
+
},
|
|
98
|
+
"pageSize": {
|
|
99
|
+
"type": "integer",
|
|
100
|
+
"minimum": 1
|
|
101
|
+
},
|
|
102
|
+
"sortCriteria": {
|
|
103
|
+
"type": "string"
|
|
104
|
+
},
|
|
105
|
+
"facets": {
|
|
106
|
+
"type": "array",
|
|
107
|
+
"items": {
|
|
108
|
+
"$ref": "#/$defs/FacetRestore"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"pinnedProducts": {
|
|
112
|
+
"type": "array",
|
|
113
|
+
"items": {
|
|
114
|
+
"type": "string"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"additionalProperties": false
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
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
|
+
"FacetRestore": {
|
|
145
|
+
"title": "FacetRestore",
|
|
146
|
+
"type": "object",
|
|
147
|
+
"required": ["facetId"],
|
|
148
|
+
"properties": {
|
|
149
|
+
"facetId": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"minLength": 1
|
|
152
|
+
},
|
|
153
|
+
"values": {
|
|
154
|
+
"type": "array",
|
|
155
|
+
"items": {
|
|
156
|
+
"type": "string"
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"numericRanges": {
|
|
160
|
+
"type": "array",
|
|
161
|
+
"items": {
|
|
162
|
+
"$ref": "#/$defs/NumericRangeRestore"
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"additionalProperties": false
|
|
167
|
+
},
|
|
168
|
+
"NumericRangeRestore": {
|
|
169
|
+
"title": "NumericRangeRestore",
|
|
170
|
+
"type": "object",
|
|
171
|
+
"required": ["start", "end"],
|
|
172
|
+
"properties": {
|
|
173
|
+
"start": {
|
|
174
|
+
"type": "number"
|
|
175
|
+
},
|
|
176
|
+
"end": {
|
|
177
|
+
"type": "number"
|
|
178
|
+
},
|
|
179
|
+
"endInclusive": {
|
|
180
|
+
"type": "boolean"
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"additionalProperties": false
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|