@coveo/thermidor-schema 0.0.0 → 1.0.0-beta.1

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 (33) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +34 -0
  3. package/dist/generated/schemas.d.ts +1823 -0
  4. package/dist/generated/schemas.js +539 -0
  5. package/dist/index.d.ts +3 -0
  6. package/dist/index.js +2 -0
  7. package/package.json +46 -8
  8. package/schema/base/action.schema.json +12 -0
  9. package/schema/base/catalog.schema.json +37 -0
  10. package/schema/base/component.schema.json +41 -0
  11. package/schema/components/bundle-display.schema.json +47 -0
  12. package/schema/components/cart.schema.json +108 -0
  13. package/schema/components/category-facet.schema.json +292 -0
  14. package/schema/components/comparison-table.schema.json +54 -0
  15. package/schema/components/component-contracts.schema.json +55 -0
  16. package/schema/components/date-facet.schema.json +281 -0
  17. package/schema/components/facet-manager.schema.json +47 -0
  18. package/schema/components/next-actions-bar.schema.json +87 -0
  19. package/schema/components/numeric-facet.schema.json +303 -0
  20. package/schema/components/pagination.schema.json +123 -0
  21. package/schema/components/product-carousel.schema.json +52 -0
  22. package/schema/components/product-list.schema.json +46 -0
  23. package/schema/components/regular-facet.schema.json +385 -0
  24. package/schema/components/search-box.schema.json +74 -0
  25. package/schema/components/sort.schema.json +107 -0
  26. package/schema/definitions/action-item.schema.json +20 -0
  27. package/schema/definitions/bundle-tier.schema.json +44 -0
  28. package/schema/definitions/cart-item.schema.json +29 -0
  29. package/schema/definitions/comparison-attribute.schema.json +19 -0
  30. package/schema/definitions/comparison-product.schema.json +39 -0
  31. package/schema/definitions/facet-value-state.schema.json +8 -0
  32. package/schema/definitions/product.schema.json +92 -0
  33. package/schema/definitions/selectable-facet-value-state.schema.json +8 -0
@@ -0,0 +1,303 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.thermidor.coveo.com/components/numeric-facet.schema.json",
4
+ "title": "NumericFacet",
5
+ "description": "A numeric range facet for a commerce search surface. Renders numeric range values and dispatches toggleSelect, clearAllActiveValues, applyCustomRange, showMoreValues, and showLessValues to refine results.",
6
+ "allOf": [
7
+ {
8
+ "$ref": "https://schema.thermidor.coveo.com/base/component.schema.json"
9
+ }
10
+ ],
11
+ "properties": {
12
+ "componentType": {
13
+ "type": "string",
14
+ "const": "numeric-facet"
15
+ },
16
+ "state": {
17
+ "$ref": "#/$defs/NumericFacetState"
18
+ },
19
+ "actions": {
20
+ "type": "object",
21
+ "required": [
22
+ "toggleSelect",
23
+ "toggleSingleSelect",
24
+ "clearAllActiveValues",
25
+ "applyCustomRange",
26
+ "showMoreValues",
27
+ "showLessValues"
28
+ ],
29
+ "properties": {
30
+ "toggleSelect": {
31
+ "$ref": "#/$defs/NumericFacetToggleSelectAction"
32
+ },
33
+ "toggleSingleSelect": {
34
+ "$ref": "#/$defs/NumericFacetToggleSingleSelectAction"
35
+ },
36
+ "clearAllActiveValues": {
37
+ "$ref": "#/$defs/NumericFacetClearAllActiveValuesAction"
38
+ },
39
+ "applyCustomRange": {
40
+ "$ref": "#/$defs/NumericFacetApplyCustomRangeAction"
41
+ },
42
+ "showMoreValues": {
43
+ "$ref": "#/$defs/NumericFacetShowMoreValuesAction"
44
+ },
45
+ "showLessValues": {
46
+ "$ref": "#/$defs/NumericFacetShowLessValuesAction"
47
+ }
48
+ },
49
+ "additionalProperties": false
50
+ }
51
+ },
52
+ "additionalProperties": false,
53
+ "$defs": {
54
+ "NumericFacetState": {
55
+ "title": "NumericFacetState",
56
+ "description": "The current numeric facet state. Owned exclusively by the backend.",
57
+ "type": "object",
58
+ "required": [
59
+ "field",
60
+ "displayName",
61
+ "values",
62
+ "customRange",
63
+ "hasActiveValues",
64
+ "canShowMoreValues",
65
+ "canShowLessValues"
66
+ ],
67
+ "properties": {
68
+ "field": {
69
+ "type": "string",
70
+ "description": "The index field this facet queries."
71
+ },
72
+ "displayName": {
73
+ "type": "string",
74
+ "description": "Human-readable name for this facet."
75
+ },
76
+ "values": {
77
+ "type": "array",
78
+ "description": "The numeric range values available for this facet.",
79
+ "minItems": 0,
80
+ "maxItems": 500,
81
+ "items": {
82
+ "$ref": "#/$defs/NumericFacetValue"
83
+ }
84
+ },
85
+ "customRange": {
86
+ "description": "The currently applied custom range, or null when none is active. Mutually exclusive with selected values.",
87
+ "oneOf": [
88
+ {
89
+ "$ref": "#/$defs/NumericFacetCustomRange"
90
+ },
91
+ {
92
+ "type": "null"
93
+ }
94
+ ]
95
+ },
96
+ "hasActiveValues": {
97
+ "type": "boolean",
98
+ "description": "Whether at least one range value is not in the idle state."
99
+ },
100
+ "canShowMoreValues": {
101
+ "type": "boolean",
102
+ "description": "Whether more values can be shown."
103
+ },
104
+ "canShowLessValues": {
105
+ "type": "boolean",
106
+ "description": "Whether fewer values can be shown."
107
+ },
108
+ "domain": {
109
+ "$ref": "#/$defs/NumericFacetDomain",
110
+ "description": "The optional numeric domain (min/max) of the facet."
111
+ }
112
+ },
113
+ "additionalProperties": false
114
+ },
115
+ "NumericFacetValue": {
116
+ "title": "NumericFacetValue",
117
+ "description": "A single numeric range value within a numeric facet.",
118
+ "type": "object",
119
+ "required": [
120
+ "start",
121
+ "end",
122
+ "numberOfResults",
123
+ "state"
124
+ ],
125
+ "properties": {
126
+ "start": {
127
+ "type": "number",
128
+ "description": "The inclusive lower bound of the range."
129
+ },
130
+ "end": {
131
+ "type": "number",
132
+ "description": "The upper bound of the range."
133
+ },
134
+ "numberOfResults": {
135
+ "type": "integer",
136
+ "minimum": 0,
137
+ "description": "The number of results matching this range."
138
+ },
139
+ "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)."
142
+ }
143
+ },
144
+ "additionalProperties": false
145
+ },
146
+ "NumericFacetCustomRange": {
147
+ "title": "NumericFacetCustomRange",
148
+ "description": "A custom numeric range applied by the user, with its result count.",
149
+ "type": "object",
150
+ "required": [
151
+ "start",
152
+ "end",
153
+ "numberOfResults"
154
+ ],
155
+ "properties": {
156
+ "start": {
157
+ "type": "number",
158
+ "description": "The inclusive lower bound of the custom range."
159
+ },
160
+ "end": {
161
+ "type": "number",
162
+ "description": "The upper bound of the custom range."
163
+ },
164
+ "numberOfResults": {
165
+ "type": "integer",
166
+ "minimum": 0,
167
+ "description": "The number of results matching this custom range."
168
+ }
169
+ },
170
+ "additionalProperties": false
171
+ },
172
+ "NumericFacetDomain": {
173
+ "title": "NumericFacetDomain",
174
+ "description": "The numeric domain bounds of a numeric facet.",
175
+ "type": "object",
176
+ "properties": {
177
+ "min": {
178
+ "type": "number",
179
+ "description": "The minimum value of the domain."
180
+ },
181
+ "max": {
182
+ "type": "number",
183
+ "description": "The maximum value of the domain."
184
+ }
185
+ },
186
+ "additionalProperties": false
187
+ },
188
+ "NumericFacetToggleSelectAction": {
189
+ "title": "numericFacetToggleSelect",
190
+ "description": "Toggles the selection of a numeric range value.",
191
+ "allOf": [
192
+ {
193
+ "$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
194
+ }
195
+ ],
196
+ "properties": {
197
+ "payload": {
198
+ "type": "object",
199
+ "required": [
200
+ "start",
201
+ "end"
202
+ ],
203
+ "properties": {
204
+ "start": {
205
+ "type": "number",
206
+ "description": "The inclusive lower bound of the range to toggle."
207
+ },
208
+ "end": {
209
+ "type": "number",
210
+ "description": "The upper bound of the range to toggle."
211
+ }
212
+ },
213
+ "additionalProperties": false
214
+ }
215
+ }
216
+ },
217
+ "NumericFacetToggleSingleSelectAction": {
218
+ "title": "numericFacetToggleSingleSelect",
219
+ "description": "Toggles the selection of a range value, deselecting all other values (single-select behavior).",
220
+ "allOf": [
221
+ {
222
+ "$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
223
+ }
224
+ ],
225
+ "properties": {
226
+ "payload": {
227
+ "type": "object",
228
+ "required": [
229
+ "start",
230
+ "end"
231
+ ],
232
+ "properties": {
233
+ "start": {
234
+ "type": "number",
235
+ "description": "The inclusive lower bound of the range to single-select."
236
+ },
237
+ "end": {
238
+ "type": "number",
239
+ "description": "The upper bound of the range to single-select."
240
+ }
241
+ },
242
+ "additionalProperties": false
243
+ }
244
+ }
245
+ },
246
+ "NumericFacetClearAllActiveValuesAction": {
247
+ "title": "numericFacetClearAllActiveValues",
248
+ "description": "Resets all numeric range values to the idle state, clearing every selection.",
249
+ "allOf": [
250
+ {
251
+ "$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
252
+ }
253
+ ]
254
+ },
255
+ "NumericFacetApplyCustomRangeAction": {
256
+ "title": "numericFacetApplyCustomRange",
257
+ "description": "Applies a single custom numeric range, clearing any selected displayed ranges.",
258
+ "allOf": [
259
+ {
260
+ "$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
261
+ }
262
+ ],
263
+ "properties": {
264
+ "payload": {
265
+ "type": "object",
266
+ "required": [
267
+ "start",
268
+ "end"
269
+ ],
270
+ "properties": {
271
+ "start": {
272
+ "type": "number",
273
+ "description": "The inclusive lower bound of the custom range."
274
+ },
275
+ "end": {
276
+ "type": "number",
277
+ "description": "The upper bound of the custom range."
278
+ }
279
+ },
280
+ "additionalProperties": false
281
+ }
282
+ }
283
+ },
284
+ "NumericFacetShowMoreValuesAction": {
285
+ "title": "numericFacetShowMoreValues",
286
+ "description": "Increases the number of numeric range values shown.",
287
+ "allOf": [
288
+ {
289
+ "$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
290
+ }
291
+ ]
292
+ },
293
+ "NumericFacetShowLessValuesAction": {
294
+ "title": "numericFacetShowLessValues",
295
+ "description": "Decreases the number of numeric range values shown.",
296
+ "allOf": [
297
+ {
298
+ "$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
299
+ }
300
+ ]
301
+ }
302
+ }
303
+ }
@@ -0,0 +1,123 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.thermidor.coveo.com/components/pagination.schema.json",
4
+ "title": "Pagination",
5
+ "description": "Controls page navigation for a commerce search surface. Manages current page, page size, and total counts; dispatches selectPage to navigate.",
6
+ "allOf": [
7
+ {
8
+ "$ref": "https://schema.thermidor.coveo.com/base/component.schema.json"
9
+ }
10
+ ],
11
+ "properties": {
12
+ "componentType": {
13
+ "type": "string",
14
+ "const": "pagination"
15
+ },
16
+ "state": {
17
+ "$ref": "#/$defs/PaginationState"
18
+ },
19
+ "actions": {
20
+ "type": "object",
21
+ "required": [
22
+ "selectPage",
23
+ "setPageSize"
24
+ ],
25
+ "properties": {
26
+ "selectPage": {
27
+ "$ref": "#/$defs/SelectPageAction"
28
+ },
29
+ "setPageSize": {
30
+ "$ref": "#/$defs/SetPageSizeAction"
31
+ }
32
+ },
33
+ "additionalProperties": false
34
+ }
35
+ },
36
+ "additionalProperties": false,
37
+ "$defs": {
38
+ "PaginationState": {
39
+ "title": "PaginationState",
40
+ "description": "The current pagination state. Owned exclusively by the backend.",
41
+ "type": "object",
42
+ "required": [
43
+ "page",
44
+ "pageSize",
45
+ "totalEntries",
46
+ "totalPages"
47
+ ],
48
+ "properties": {
49
+ "page": {
50
+ "type": "integer",
51
+ "minimum": 0,
52
+ "description": "The current zero-indexed page number."
53
+ },
54
+ "pageSize": {
55
+ "type": "integer",
56
+ "minimum": 1,
57
+ "description": "The number of items per page."
58
+ },
59
+ "totalEntries": {
60
+ "type": "integer",
61
+ "minimum": 0,
62
+ "description": "The total number of items across all pages."
63
+ },
64
+ "totalPages": {
65
+ "type": "integer",
66
+ "minimum": 0,
67
+ "description": "The total number of pages."
68
+ }
69
+ },
70
+ "additionalProperties": false
71
+ },
72
+ "SelectPageAction": {
73
+ "title": "selectPage",
74
+ "description": "Navigates to a specific page.",
75
+ "allOf": [
76
+ {
77
+ "$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
78
+ }
79
+ ],
80
+ "properties": {
81
+ "payload": {
82
+ "type": "object",
83
+ "required": [
84
+ "page"
85
+ ],
86
+ "properties": {
87
+ "page": {
88
+ "type": "integer",
89
+ "minimum": 0,
90
+ "description": "The zero-indexed page number to navigate to."
91
+ }
92
+ },
93
+ "additionalProperties": false
94
+ }
95
+ }
96
+ },
97
+ "SetPageSizeAction": {
98
+ "title": "setPageSize",
99
+ "description": "Changes the number of items displayed per page.",
100
+ "allOf": [
101
+ {
102
+ "$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
103
+ }
104
+ ],
105
+ "properties": {
106
+ "payload": {
107
+ "type": "object",
108
+ "required": [
109
+ "pageSize"
110
+ ],
111
+ "properties": {
112
+ "pageSize": {
113
+ "type": "integer",
114
+ "minimum": 1,
115
+ "description": "The number of items to display per page."
116
+ }
117
+ },
118
+ "additionalProperties": false
119
+ }
120
+ }
121
+ }
122
+ }
123
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.thermidor.coveo.com/components/product-carousel.schema.json",
4
+ "title": "ProductCarousel",
5
+ "description": "Renders an ordered list of commerce products for a single category or intent bucket. Read-only from the frontend: the backend is the sole source of truth for which products are displayed and in what order.",
6
+ "allOf": [
7
+ {
8
+ "$ref": "https://schema.thermidor.coveo.com/base/component.schema.json"
9
+ }
10
+ ],
11
+ "properties": {
12
+ "componentType": {
13
+ "type": "string",
14
+ "const": "product-carousel"
15
+ },
16
+ "state": {
17
+ "$ref": "#/$defs/ProductCarouselState"
18
+ },
19
+ "actions": {
20
+ "type": "object",
21
+ "properties": {},
22
+ "additionalProperties": false
23
+ }
24
+ },
25
+ "additionalProperties": false,
26
+ "$defs": {
27
+ "ProductCarouselState": {
28
+ "title": "ProductCarouselState",
29
+ "description": "The ordered list of products to render. Owned exclusively by the backend; the frontend must not mutate this directly.",
30
+ "$comment": "This schema validates the runtime state value the backend pushes to the frontend.",
31
+ "type": "object",
32
+ "required": [
33
+ "heading",
34
+ "products"
35
+ ],
36
+ "properties": {
37
+ "heading": {
38
+ "type": "string",
39
+ "description": "Display heading for this product list (e.g. 'Life Jackets'). An empty string is a valid transient value while the list is still loading."
40
+ },
41
+ "products": {
42
+ "type": "array",
43
+ "description": "Ordered list of products to render.",
44
+ "items": {
45
+ "$ref": "https://schema.thermidor.coveo.com/definitions/product.schema.json"
46
+ }
47
+ }
48
+ },
49
+ "additionalProperties": false
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.thermidor.coveo.com/components/product-list.schema.json",
4
+ "title": "ProductList",
5
+ "description": "Renders an ordered list of commerce products from a decomposed commerce search surface. Read-only from the frontend: the backend is the sole source of truth for which products are displayed and in what order.",
6
+ "allOf": [
7
+ {
8
+ "$ref": "https://schema.thermidor.coveo.com/base/component.schema.json"
9
+ }
10
+ ],
11
+ "properties": {
12
+ "componentType": {
13
+ "type": "string",
14
+ "const": "product-list"
15
+ },
16
+ "state": {
17
+ "$ref": "#/$defs/ProductListState"
18
+ },
19
+ "actions": {
20
+ "type": "object",
21
+ "properties": {},
22
+ "additionalProperties": false
23
+ }
24
+ },
25
+ "additionalProperties": false,
26
+ "$defs": {
27
+ "ProductListState": {
28
+ "title": "ProductListState",
29
+ "description": "The ordered list of products to render. Owned exclusively by the backend; the frontend must not mutate this directly.",
30
+ "type": "object",
31
+ "required": [
32
+ "products"
33
+ ],
34
+ "properties": {
35
+ "products": {
36
+ "type": "array",
37
+ "description": "Ordered list of products to render.",
38
+ "items": {
39
+ "$ref": "https://schema.thermidor.coveo.com/definitions/product.schema.json"
40
+ }
41
+ }
42
+ },
43
+ "additionalProperties": false
44
+ }
45
+ }
46
+ }