@coveo/thermidor-schema 1.0.0-beta.1 → 1.0.0-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -5
- package/dist/generated/schemas.d.ts +2547 -378
- package/dist/generated/schemas.js +689 -143
- package/dist/generated/zod3/schemas.d.ts +23821 -0
- package/dist/generated/zod3/schemas.js +1087 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- 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 +26 -20
- package/schema/base/catalog.schema.json +3 -2
- package/schema/base/component.schema.json +24 -20
- package/schema/{components/component-contracts.schema.json → component-contracts.schema.json} +23 -5
- package/schema/components/bundle-display.schema.json +11 -6
- package/schema/components/cart.schema.json +85 -46
- package/schema/components/category-facet.schema.json +35 -24
- package/schema/components/commerce-search.schema.json +186 -0
- package/schema/components/comparison-table.schema.json +35 -11
- package/schema/components/date-facet.schema.json +39 -26
- package/schema/components/facet-manager.schema.json +16 -18
- package/schema/components/layout-stack.schema.json +50 -0
- package/schema/components/next-actions-bar.schema.json +16 -18
- package/schema/components/numeric-facet.schema.json +43 -26
- package/schema/components/page-size.schema.json +79 -0
- package/schema/components/pagination.schema.json +45 -19
- package/schema/components/product-carousel.schema.json +15 -7
- package/schema/components/product-list.schema.json +77 -7
- 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 +42 -32
- package/schema/components/sort.schema.json +18 -18
- package/schema/definitions/bundle-tier.schema.json +9 -4
- package/schema/definitions/child-list.schema.json +32 -0
- package/schema/definitions/comparison-attribute.schema.json +2 -2
- package/schema/definitions/comparison-product.schema.json +2 -2
- package/schema/definitions/component-id.schema.json +9 -0
- package/schema/definitions/data-binding.schema.json +16 -0
- package/schema/components/search-box.schema.json +0 -74
- package/schema/definitions/cart-item.schema.json +0 -29
|
@@ -2,32 +2,32 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://schema.thermidor.coveo.com/components/cart.schema.json",
|
|
4
4
|
"title": "Cart",
|
|
5
|
-
"description": "
|
|
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
6
|
"allOf": [
|
|
7
7
|
{
|
|
8
8
|
"$ref": "https://schema.thermidor.coveo.com/base/component.schema.json"
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"properties": {
|
|
12
|
-
"
|
|
12
|
+
"component": {
|
|
13
13
|
"type": "string",
|
|
14
|
-
"const": "
|
|
14
|
+
"const": "Cart"
|
|
15
|
+
},
|
|
16
|
+
"id": {
|
|
17
|
+
"type": "string"
|
|
15
18
|
},
|
|
16
19
|
"state": {
|
|
17
20
|
"$ref": "#/$defs/CartState"
|
|
18
21
|
},
|
|
19
22
|
"actions": {
|
|
20
23
|
"type": "object",
|
|
21
|
-
"required": [
|
|
22
|
-
"setItems",
|
|
23
|
-
"updateItemQuantity"
|
|
24
|
-
],
|
|
24
|
+
"required": ["updateCart", "purchase"],
|
|
25
25
|
"properties": {
|
|
26
|
-
"
|
|
27
|
-
"$ref": "#/$defs/
|
|
26
|
+
"updateCart": {
|
|
27
|
+
"$ref": "#/$defs/UpdateCartAction"
|
|
28
28
|
},
|
|
29
|
-
"
|
|
30
|
-
"$ref": "#/$defs/
|
|
29
|
+
"purchase": {
|
|
30
|
+
"$ref": "#/$defs/PurchaseAction"
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"additionalProperties": false
|
|
@@ -37,26 +37,14 @@
|
|
|
37
37
|
"$defs": {
|
|
38
38
|
"CartState": {
|
|
39
39
|
"title": "CartState",
|
|
40
|
-
"description": "
|
|
41
|
-
"$comment": "This schema validates the runtime state value the backend pushes to the frontend.",
|
|
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.",
|
|
42
41
|
"type": "object",
|
|
43
|
-
"
|
|
44
|
-
"items"
|
|
45
|
-
],
|
|
46
|
-
"properties": {
|
|
47
|
-
"items": {
|
|
48
|
-
"type": "array",
|
|
49
|
-
"description": "The current line items in the cart.",
|
|
50
|
-
"items": {
|
|
51
|
-
"$ref": "https://schema.thermidor.coveo.com/definitions/cart-item.schema.json"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
},
|
|
42
|
+
"properties": {},
|
|
55
43
|
"additionalProperties": false
|
|
56
44
|
},
|
|
57
|
-
"
|
|
58
|
-
"title": "
|
|
59
|
-
"description": "
|
|
45
|
+
"UpdateCartAction": {
|
|
46
|
+
"title": "updateCart",
|
|
47
|
+
"description": "Applies a semantic item update to the cart and records the corresponding commerce cart event.",
|
|
60
48
|
"allOf": [
|
|
61
49
|
{
|
|
62
50
|
"$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
|
|
@@ -65,25 +53,35 @@
|
|
|
65
53
|
"properties": {
|
|
66
54
|
"payload": {
|
|
67
55
|
"type": "object",
|
|
68
|
-
"required": [
|
|
69
|
-
"items"
|
|
70
|
-
],
|
|
56
|
+
"required": ["productId", "quantity", "operation"],
|
|
71
57
|
"properties": {
|
|
72
|
-
"
|
|
73
|
-
"type": "
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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"]
|
|
78
76
|
}
|
|
79
77
|
},
|
|
80
78
|
"additionalProperties": false
|
|
81
79
|
}
|
|
82
80
|
}
|
|
83
81
|
},
|
|
84
|
-
"
|
|
85
|
-
"title": "
|
|
86
|
-
"description": "
|
|
82
|
+
"PurchaseAction": {
|
|
83
|
+
"title": "purchase",
|
|
84
|
+
"description": "Records a completed commerce transaction.",
|
|
87
85
|
"allOf": [
|
|
88
86
|
{
|
|
89
87
|
"$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
|
|
@@ -92,17 +90,58 @@
|
|
|
92
90
|
"properties": {
|
|
93
91
|
"payload": {
|
|
94
92
|
"type": "object",
|
|
95
|
-
"required": [
|
|
96
|
-
"item"
|
|
97
|
-
],
|
|
93
|
+
"required": ["products", "transaction"],
|
|
98
94
|
"properties": {
|
|
99
|
-
"
|
|
100
|
-
"
|
|
95
|
+
"products": {
|
|
96
|
+
"type": "array",
|
|
97
|
+
"items": {
|
|
98
|
+
"$ref": "#/$defs/PurchaseProduct"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"transaction": {
|
|
102
|
+
"$ref": "#/$defs/Transaction"
|
|
101
103
|
}
|
|
102
104
|
},
|
|
103
105
|
"additionalProperties": false
|
|
104
106
|
}
|
|
105
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
|
|
106
145
|
}
|
|
107
146
|
}
|
|
108
|
-
}
|
|
147
|
+
}
|
|
@@ -9,9 +9,36 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"properties": {
|
|
12
|
-
"
|
|
12
|
+
"component": {
|
|
13
13
|
"type": "string",
|
|
14
|
-
"const": "
|
|
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"
|
|
@@ -99,11 +126,7 @@
|
|
|
99
126
|
"title": "CategoryFacetValues",
|
|
100
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.",
|
|
101
128
|
"type": "object",
|
|
102
|
-
"required": [
|
|
103
|
-
"ancestry",
|
|
104
|
-
"selected",
|
|
105
|
-
"children"
|
|
106
|
-
],
|
|
129
|
+
"required": ["ancestry", "selected", "children"],
|
|
107
130
|
"properties": {
|
|
108
131
|
"ancestry": {
|
|
109
132
|
"type": "array",
|
|
@@ -137,11 +160,7 @@
|
|
|
137
160
|
"title": "CategoryFacetSearch",
|
|
138
161
|
"description": "The current category facet search state.",
|
|
139
162
|
"type": "object",
|
|
140
|
-
"required": [
|
|
141
|
-
"query",
|
|
142
|
-
"canShowMoreResults",
|
|
143
|
-
"results"
|
|
144
|
-
],
|
|
163
|
+
"required": ["query", "canShowMoreResults", "results"],
|
|
145
164
|
"properties": {
|
|
146
165
|
"query": {
|
|
147
166
|
"type": "string",
|
|
@@ -173,9 +192,7 @@
|
|
|
173
192
|
"properties": {
|
|
174
193
|
"payload": {
|
|
175
194
|
"type": "object",
|
|
176
|
-
"required": [
|
|
177
|
-
"path"
|
|
178
|
-
],
|
|
195
|
+
"required": ["path"],
|
|
179
196
|
"properties": {
|
|
180
197
|
"path": {
|
|
181
198
|
"type": "array",
|
|
@@ -209,9 +226,7 @@
|
|
|
209
226
|
"properties": {
|
|
210
227
|
"payload": {
|
|
211
228
|
"type": "object",
|
|
212
|
-
"required": [
|
|
213
|
-
"query"
|
|
214
|
-
],
|
|
229
|
+
"required": ["query"],
|
|
215
230
|
"properties": {
|
|
216
231
|
"query": {
|
|
217
232
|
"type": "string",
|
|
@@ -263,11 +278,7 @@
|
|
|
263
278
|
"title": "CategoryFacetValue",
|
|
264
279
|
"description": "A single category value. Used throughout the category facet state (ancestry, selected value, children) and as facet search results.",
|
|
265
280
|
"type": "object",
|
|
266
|
-
"required": [
|
|
267
|
-
"path",
|
|
268
|
-
"value",
|
|
269
|
-
"numberOfResults"
|
|
270
|
-
],
|
|
281
|
+
"required": ["path", "value", "numberOfResults"],
|
|
271
282
|
"properties": {
|
|
272
283
|
"path": {
|
|
273
284
|
"type": "array",
|
|
@@ -289,4 +300,4 @@
|
|
|
289
300
|
"additionalProperties": false
|
|
290
301
|
}
|
|
291
302
|
}
|
|
292
|
-
}
|
|
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
|
+
}
|
|
@@ -2,16 +2,35 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://schema.thermidor.coveo.com/components/comparison-table.schema.json",
|
|
4
4
|
"title": "ComparisonTable",
|
|
5
|
-
"description": "Renders a tabular product comparison
|
|
5
|
+
"description": "Renders a tabular product comparison. A leaf component that owns its framing (heading and AI summary), the compared products, and the ordered attribute descriptors defining the comparison rows. Read-only: the product set, attributes, and framing are owned by the backend.",
|
|
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
|
-
"
|
|
12
|
+
"id": {
|
|
13
|
+
"type": "string"
|
|
14
|
+
},
|
|
15
|
+
"component": {
|
|
13
16
|
"type": "string",
|
|
14
|
-
"const": "
|
|
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"
|
|
@@ -26,23 +45,28 @@
|
|
|
26
45
|
"$defs": {
|
|
27
46
|
"ComparisonTableState": {
|
|
28
47
|
"title": "ComparisonTableState",
|
|
29
|
-
"description": "The comparison
|
|
48
|
+
"description": "The comparison content owned by the backend: the table heading, the AI summary text, the compared products, and the ordered attribute descriptors defining the comparison rows.",
|
|
30
49
|
"type": "object",
|
|
31
|
-
"required": [
|
|
32
|
-
"products",
|
|
33
|
-
"attributes"
|
|
34
|
-
],
|
|
50
|
+
"required": ["products", "attributes", "heading", "summary"],
|
|
35
51
|
"properties": {
|
|
52
|
+
"heading": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"description": "Title displayed above the comparison table."
|
|
55
|
+
},
|
|
56
|
+
"summary": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"description": "AI-generated summary text displayed below the comparison table."
|
|
59
|
+
},
|
|
36
60
|
"products": {
|
|
37
61
|
"type": "array",
|
|
38
|
-
"description": "
|
|
62
|
+
"description": "The compared products shown as columns of the comparison table.",
|
|
39
63
|
"items": {
|
|
40
64
|
"$ref": "https://schema.thermidor.coveo.com/definitions/comparison-product.schema.json"
|
|
41
65
|
}
|
|
42
66
|
},
|
|
43
67
|
"attributes": {
|
|
44
68
|
"type": "array",
|
|
45
|
-
"description": "Attribute descriptors defining the comparison
|
|
69
|
+
"description": "Attribute descriptors defining the comparison rows.",
|
|
46
70
|
"items": {
|
|
47
71
|
"$ref": "https://schema.thermidor.coveo.com/definitions/comparison-attribute.schema.json"
|
|
48
72
|
}
|
|
@@ -51,4 +75,4 @@
|
|
|
51
75
|
"additionalProperties": false
|
|
52
76
|
}
|
|
53
77
|
}
|
|
54
|
-
}
|
|
78
|
+
}
|
|
@@ -9,9 +9,40 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"properties": {
|
|
12
|
-
"
|
|
12
|
+
"component": {
|
|
13
13
|
"type": "string",
|
|
14
|
-
"const": "
|
|
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"
|
|
@@ -110,12 +141,7 @@
|
|
|
110
141
|
"title": "DateFacetValue",
|
|
111
142
|
"description": "A single selectable date range within a date facet.",
|
|
112
143
|
"type": "object",
|
|
113
|
-
"required": [
|
|
114
|
-
"start",
|
|
115
|
-
"end",
|
|
116
|
-
"numberOfResults",
|
|
117
|
-
"state"
|
|
118
|
-
],
|
|
144
|
+
"required": ["start", "end", "numberOfResults", "state"],
|
|
119
145
|
"properties": {
|
|
120
146
|
"start": {
|
|
121
147
|
"type": "string",
|
|
@@ -141,11 +167,7 @@
|
|
|
141
167
|
"title": "DateFacetCustomRange",
|
|
142
168
|
"description": "A custom date range applied by the user, with its result count.",
|
|
143
169
|
"type": "object",
|
|
144
|
-
"required": [
|
|
145
|
-
"start",
|
|
146
|
-
"end",
|
|
147
|
-
"numberOfResults"
|
|
148
|
-
],
|
|
170
|
+
"required": ["start", "end", "numberOfResults"],
|
|
149
171
|
"properties": {
|
|
150
172
|
"start": {
|
|
151
173
|
"type": "string",
|
|
@@ -174,10 +196,7 @@
|
|
|
174
196
|
"properties": {
|
|
175
197
|
"payload": {
|
|
176
198
|
"type": "object",
|
|
177
|
-
"required": [
|
|
178
|
-
"start",
|
|
179
|
-
"end"
|
|
180
|
-
],
|
|
199
|
+
"required": ["start", "end"],
|
|
181
200
|
"properties": {
|
|
182
201
|
"start": {
|
|
183
202
|
"type": "string",
|
|
@@ -203,10 +222,7 @@
|
|
|
203
222
|
"properties": {
|
|
204
223
|
"payload": {
|
|
205
224
|
"type": "object",
|
|
206
|
-
"required": [
|
|
207
|
-
"start",
|
|
208
|
-
"end"
|
|
209
|
-
],
|
|
225
|
+
"required": ["start", "end"],
|
|
210
226
|
"properties": {
|
|
211
227
|
"start": {
|
|
212
228
|
"type": "string",
|
|
@@ -241,10 +257,7 @@
|
|
|
241
257
|
"properties": {
|
|
242
258
|
"payload": {
|
|
243
259
|
"type": "object",
|
|
244
|
-
"required": [
|
|
245
|
-
"start",
|
|
246
|
-
"end"
|
|
247
|
-
],
|
|
260
|
+
"required": ["start", "end"],
|
|
248
261
|
"properties": {
|
|
249
262
|
"start": {
|
|
250
263
|
"type": "string",
|
|
@@ -278,4 +291,4 @@
|
|
|
278
291
|
]
|
|
279
292
|
}
|
|
280
293
|
}
|
|
281
|
-
}
|
|
294
|
+
}
|