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

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 (30) hide show
  1. package/dist/generated/schemas.d.ts +304 -201
  2. package/dist/generated/schemas.js +176 -62
  3. package/dist/index.d.ts +2 -2
  4. package/dist/index.js +1 -1
  5. package/package.json +1 -1
  6. package/schema/base/component.schema.json +14 -1
  7. package/schema/components/bundle-display.schema.json +13 -4
  8. package/schema/components/category-facet.schema.json +17 -22
  9. package/schema/components/{search-box.schema.json → commerce-search.schema.json} +22 -24
  10. package/schema/components/comparison-table.schema.json +25 -9
  11. package/schema/components/component-contracts.schema.json +15 -6
  12. package/schema/components/date-facet.schema.json +17 -24
  13. package/schema/components/facet-manager.schema.json +15 -15
  14. package/schema/components/layout-stack.schema.json +47 -0
  15. package/schema/components/next-actions-bar.schema.json +16 -15
  16. package/schema/components/numeric-facet.schema.json +17 -24
  17. package/schema/components/page-size.schema.json +81 -0
  18. package/schema/components/pagination.schema.json +16 -17
  19. package/schema/components/product-carousel.schema.json +13 -5
  20. package/schema/components/product-list.schema.json +13 -4
  21. package/schema/components/product-summary.schema.json +63 -0
  22. package/schema/components/query-summary.schema.json +67 -0
  23. package/schema/components/regular-facet.schema.json +20 -30
  24. package/schema/components/sort.schema.json +16 -16
  25. package/schema/definitions/bundle-tier.schema.json +3 -3
  26. package/schema/definitions/child-ref.schema.json +8 -0
  27. package/schema/definitions/comparison-attribute.schema.json +2 -2
  28. package/schema/definitions/comparison-product.schema.json +2 -2
  29. package/schema/components/cart.schema.json +0 -108
  30. package/schema/definitions/cart-item.schema.json +0 -29
@@ -18,10 +18,7 @@
18
18
  },
19
19
  "actions": {
20
20
  "type": "object",
21
- "required": [
22
- "selectPage",
23
- "setPageSize"
24
- ],
21
+ "required": ["selectPage", "setPageSize"],
25
22
  "properties": {
26
23
  "selectPage": {
27
24
  "$ref": "#/$defs/SelectPageAction"
@@ -31,6 +28,17 @@
31
28
  }
32
29
  },
33
30
  "additionalProperties": false
31
+ },
32
+ "children": {
33
+ "type": "array",
34
+ "items": {
35
+ "$ref": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json"
36
+ },
37
+ "maxItems": 1000,
38
+ "default": []
39
+ },
40
+ "child": {
41
+ "$ref": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json"
34
42
  }
35
43
  },
36
44
  "additionalProperties": false,
@@ -39,12 +47,7 @@
39
47
  "title": "PaginationState",
40
48
  "description": "The current pagination state. Owned exclusively by the backend.",
41
49
  "type": "object",
42
- "required": [
43
- "page",
44
- "pageSize",
45
- "totalEntries",
46
- "totalPages"
47
- ],
50
+ "required": ["page", "pageSize", "totalEntries", "totalPages"],
48
51
  "properties": {
49
52
  "page": {
50
53
  "type": "integer",
@@ -80,9 +83,7 @@
80
83
  "properties": {
81
84
  "payload": {
82
85
  "type": "object",
83
- "required": [
84
- "page"
85
- ],
86
+ "required": ["page"],
86
87
  "properties": {
87
88
  "page": {
88
89
  "type": "integer",
@@ -105,9 +106,7 @@
105
106
  "properties": {
106
107
  "payload": {
107
108
  "type": "object",
108
- "required": [
109
- "pageSize"
110
- ],
109
+ "required": ["pageSize"],
111
110
  "properties": {
112
111
  "pageSize": {
113
112
  "type": "integer",
@@ -120,4 +119,4 @@
120
119
  }
121
120
  }
122
121
  }
123
- }
122
+ }
@@ -20,6 +20,17 @@
20
20
  "type": "object",
21
21
  "properties": {},
22
22
  "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"
23
34
  }
24
35
  },
25
36
  "additionalProperties": false,
@@ -29,10 +40,7 @@
29
40
  "description": "The ordered list of products to render. Owned exclusively by the backend; the frontend must not mutate this directly.",
30
41
  "$comment": "This schema validates the runtime state value the backend pushes to the frontend.",
31
42
  "type": "object",
32
- "required": [
33
- "heading",
34
- "products"
35
- ],
43
+ "required": ["heading", "products"],
36
44
  "properties": {
37
45
  "heading": {
38
46
  "type": "string",
@@ -49,4 +57,4 @@
49
57
  "additionalProperties": false
50
58
  }
51
59
  }
52
- }
60
+ }
@@ -20,6 +20,17 @@
20
20
  "type": "object",
21
21
  "properties": {},
22
22
  "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"
23
34
  }
24
35
  },
25
36
  "additionalProperties": false,
@@ -28,9 +39,7 @@
28
39
  "title": "ProductListState",
29
40
  "description": "The ordered list of products to render. Owned exclusively by the backend; the frontend must not mutate this directly.",
30
41
  "type": "object",
31
- "required": [
32
- "products"
33
- ],
42
+ "required": ["products"],
34
43
  "properties": {
35
44
  "products": {
36
45
  "type": "array",
@@ -43,4 +52,4 @@
43
52
  "additionalProperties": false
44
53
  }
45
54
  }
46
- }
55
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.thermidor.coveo.com/components/product-summary.schema.json",
4
+ "title": "ProductSummary",
5
+ "description": "Renders a single commerce product as a compact summary row (thumbnail, name, short description, price) for a category slot. Read-only from the frontend: the backend is the sole source of truth for the summarized product. Presentation as a compact row is expressed by this component type on the A2-UI plane, never as data in AG-UI state.",
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-summary"
15
+ },
16
+ "state": {
17
+ "$ref": "#/$defs/ProductSummaryState"
18
+ },
19
+ "actions": {
20
+ "type": "object",
21
+ "properties": {},
22
+ "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
+ }
35
+ },
36
+ "additionalProperties": false,
37
+ "$defs": {
38
+ "ProductSummaryState": {
39
+ "title": "ProductSummaryState",
40
+ "description": "The single product to summarize for a category slot. Owned exclusively by the backend; the frontend must not mutate this directly.",
41
+ "type": "object",
42
+ "required": ["categoryLabel", "product"],
43
+ "properties": {
44
+ "categoryLabel": {
45
+ "type": "string",
46
+ "description": "Display label of the product category this summary represents (e.g. 'Surfboard')."
47
+ },
48
+ "product": {
49
+ "description": "The single product to summarize, or null when no product is available for this slot.",
50
+ "oneOf": [
51
+ {
52
+ "$ref": "https://schema.thermidor.coveo.com/definitions/product.schema.json"
53
+ },
54
+ {
55
+ "type": "null"
56
+ }
57
+ ]
58
+ }
59
+ },
60
+ "additionalProperties": false
61
+ }
62
+ }
63
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.thermidor.coveo.com/components/query-summary.schema.json",
4
+ "title": "QuerySummary",
5
+ "description": "Summarizes the current result window for a search surface (e.g. 'Products 1-12 of 43 for Water Sports'). Read-only from the frontend. Rather than reading three sibling components' state (search-box query, pagination page/pageSize/totalEntries, product-list count), it carries its own backend-computed aggregate so it has no cross-component coupling.",
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": "query-summary"
15
+ },
16
+ "state": {
17
+ "$ref": "#/$defs/QuerySummaryState"
18
+ },
19
+ "actions": {
20
+ "type": "object",
21
+ "properties": {},
22
+ "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
+ }
35
+ },
36
+ "additionalProperties": false,
37
+ "$defs": {
38
+ "QuerySummaryState": {
39
+ "title": "QuerySummaryState",
40
+ "description": "The backend-computed aggregate for the current result window. Owned exclusively by the backend; the frontend must not mutate this directly.",
41
+ "type": "object",
42
+ "required": ["query", "firstIndex", "lastIndex", "totalEntries"],
43
+ "properties": {
44
+ "query": {
45
+ "type": "string",
46
+ "description": "The current query string. May be empty when the surface has no active query."
47
+ },
48
+ "firstIndex": {
49
+ "type": "integer",
50
+ "minimum": 0,
51
+ "description": "The 1-based index of the first result on the current page."
52
+ },
53
+ "lastIndex": {
54
+ "type": "integer",
55
+ "minimum": 0,
56
+ "description": "The 1-based index of the last result on the current page."
57
+ },
58
+ "totalEntries": {
59
+ "type": "integer",
60
+ "minimum": 0,
61
+ "description": "The total number of results across all pages."
62
+ }
63
+ },
64
+ "additionalProperties": false
65
+ }
66
+ }
67
+ }
@@ -63,6 +63,17 @@
63
63
  }
64
64
  },
65
65
  "additionalProperties": false
66
+ },
67
+ "children": {
68
+ "type": "array",
69
+ "items": {
70
+ "$ref": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json"
71
+ },
72
+ "maxItems": 1000,
73
+ "default": []
74
+ },
75
+ "child": {
76
+ "$ref": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json"
66
77
  }
67
78
  },
68
79
  "additionalProperties": false,
@@ -125,11 +136,7 @@
125
136
  "title": "RegularFacetValue",
126
137
  "description": "A single selectable value within a regular facet.",
127
138
  "type": "object",
128
- "required": [
129
- "value",
130
- "numberOfResults",
131
- "state"
132
- ],
139
+ "required": ["value", "numberOfResults", "state"],
133
140
  "properties": {
134
141
  "value": {
135
142
  "type": "string",
@@ -154,11 +161,7 @@
154
161
  "title": "RegularFacetSearch",
155
162
  "description": "The facet search state for a regular facet.",
156
163
  "type": "object",
157
- "required": [
158
- "query",
159
- "canShowMoreResults",
160
- "results"
161
- ],
164
+ "required": ["query", "canShowMoreResults", "results"],
162
165
  "properties": {
163
166
  "query": {
164
167
  "type": "string",
@@ -186,10 +189,7 @@
186
189
  "title": "RegularFacetSearchResult",
187
190
  "description": "A single result returned by a regular facet search. Facet search only returns idle (unselected) values, so it carries no selection state.",
188
191
  "type": "object",
189
- "required": [
190
- "value",
191
- "numberOfResults"
192
- ],
192
+ "required": ["value", "numberOfResults"],
193
193
  "properties": {
194
194
  "value": {
195
195
  "type": "string",
@@ -217,9 +217,7 @@
217
217
  "properties": {
218
218
  "payload": {
219
219
  "type": "object",
220
- "required": [
221
- "value"
222
- ],
220
+ "required": ["value"],
223
221
  "properties": {
224
222
  "value": {
225
223
  "type": "string",
@@ -243,9 +241,7 @@
243
241
  "properties": {
244
242
  "payload": {
245
243
  "type": "object",
246
- "required": [
247
- "value"
248
- ],
244
+ "required": ["value"],
249
245
  "properties": {
250
246
  "value": {
251
247
  "type": "string",
@@ -269,9 +265,7 @@
269
265
  "properties": {
270
266
  "payload": {
271
267
  "type": "object",
272
- "required": [
273
- "value"
274
- ],
268
+ "required": ["value"],
275
269
  "properties": {
276
270
  "value": {
277
271
  "type": "string",
@@ -295,9 +289,7 @@
295
289
  "properties": {
296
290
  "payload": {
297
291
  "type": "object",
298
- "required": [
299
- "value"
300
- ],
292
+ "required": ["value"],
301
293
  "properties": {
302
294
  "value": {
303
295
  "type": "string",
@@ -330,9 +322,7 @@
330
322
  "properties": {
331
323
  "payload": {
332
324
  "type": "object",
333
- "required": [
334
- "query"
335
- ],
325
+ "required": ["query"],
336
326
  "properties": {
337
327
  "query": {
338
328
  "type": "string",
@@ -382,4 +372,4 @@
382
372
  ]
383
373
  }
384
374
  }
385
- }
375
+ }
@@ -18,15 +18,24 @@
18
18
  },
19
19
  "actions": {
20
20
  "type": "object",
21
- "required": [
22
- "selectSort"
23
- ],
21
+ "required": ["selectSort"],
24
22
  "properties": {
25
23
  "selectSort": {
26
24
  "$ref": "#/$defs/SelectSortAction"
27
25
  }
28
26
  },
29
27
  "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"
30
39
  }
31
40
  },
32
41
  "additionalProperties": false,
@@ -35,10 +44,7 @@
35
44
  "title": "SortState",
36
45
  "description": "The current sort state. Owned exclusively by the backend.",
37
46
  "type": "object",
38
- "required": [
39
- "appliedSort",
40
- "availableSorts"
41
- ],
47
+ "required": ["appliedSort", "availableSorts"],
42
48
  "properties": {
43
49
  "appliedSort": {
44
50
  "$ref": "#/$defs/SortCriterion",
@@ -58,10 +64,7 @@
58
64
  "title": "SortCriterion",
59
65
  "description": "A sort criterion consisting of a named criteria and field definitions.",
60
66
  "type": "object",
61
- "required": [
62
- "sortCriteria",
63
- "fields"
64
- ],
67
+ "required": ["sortCriteria", "fields"],
65
68
  "properties": {
66
69
  "sortCriteria": {
67
70
  "type": "string",
@@ -85,10 +88,7 @@
85
88
  "properties": {
86
89
  "payload": {
87
90
  "type": "object",
88
- "required": [
89
- "sortCriteria",
90
- "fields"
91
- ],
91
+ "required": ["sortCriteria", "fields"],
92
92
  "properties": {
93
93
  "sortCriteria": {
94
94
  "type": "string",
@@ -104,4 +104,4 @@
104
104
  }
105
105
  }
106
106
  }
107
- }
107
+ }
@@ -27,15 +27,15 @@
27
27
  "BundleSlot": {
28
28
  "title": "BundleSlot",
29
29
  "type": "object",
30
- "required": ["categoryLabel", "surfaceRef"],
30
+ "required": ["categoryLabel", "childId"],
31
31
  "properties": {
32
32
  "categoryLabel": {
33
33
  "type": "string",
34
34
  "description": "Display name of the product category for this slot."
35
35
  },
36
- "surfaceRef": {
36
+ "childId": {
37
37
  "type": "string",
38
- "description": "Surface ID where this slot's products are rendered via a ProductCarousel."
38
+ "description": "Id of the bundle-display child product-list node that renders this slot's products. Associates the slot with its child on the A2-UI composition plane; the renderer mounts the child via children(id)."
39
39
  }
40
40
  },
41
41
  "additionalProperties": false
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.thermidor.coveo.com/definitions/child-ref.schema.json",
4
+ "title": "ChildRef",
5
+ "type": "string",
6
+ "pattern": "^[a-z][a-z0-9-]*$",
7
+ "description": "A reference to another component in the same flat map, by componentId."
8
+ }
@@ -2,13 +2,13 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://schema.thermidor.coveo.com/definitions/comparison-attribute.schema.json",
4
4
  "title": "ComparisonAttribute",
5
- "description": "Defines an attribute (column) used in a ComparisonTable. The key is the programmatic identifier that maps to values in ComparisonProduct.values, and label is the human-readable column heading.",
5
+ "description": "Defines an attribute (row) used in a ComparisonTable. The key is the programmatic identifier that maps to values in each compared product's values record, and label is the human-readable row heading.",
6
6
  "type": "object",
7
7
  "required": ["key", "label"],
8
8
  "properties": {
9
9
  "key": {
10
10
  "type": "string",
11
- "description": "The programmatic identifier for this attribute, used as a key in ComparisonProduct.values."
11
+ "description": "The programmatic identifier for this attribute, used as a key in each compared product's values record."
12
12
  },
13
13
  "label": {
14
14
  "type": "string",
@@ -2,9 +2,9 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://schema.thermidor.coveo.com/definitions/comparison-product.schema.json",
4
4
  "title": "ComparisonProduct",
5
- "description": "A product entry in a comparison table, containing required identifiers and a values record mapping attribute keys to display strings.",
5
+ "description": "A product entry (column) in a ComparisonTable, containing required identifiers and a values record mapping attribute keys to display strings.",
6
6
  "type": "object",
7
- "required": ["productId", "name", "values"],
7
+ "required": ["productId", "name"],
8
8
  "properties": {
9
9
  "productId": {
10
10
  "type": "string",
@@ -1,108 +0,0 @@
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": "Renders the current cart contents and exposes actions for the frontend to manage line items.",
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": "cart"
15
- },
16
- "state": {
17
- "$ref": "#/$defs/CartState"
18
- },
19
- "actions": {
20
- "type": "object",
21
- "required": [
22
- "setItems",
23
- "updateItemQuantity"
24
- ],
25
- "properties": {
26
- "setItems": {
27
- "$ref": "#/$defs/SetItemsAction"
28
- },
29
- "updateItemQuantity": {
30
- "$ref": "#/$defs/UpdateItemQuantityAction"
31
- }
32
- },
33
- "additionalProperties": false
34
- }
35
- },
36
- "additionalProperties": false,
37
- "$defs": {
38
- "CartState": {
39
- "title": "CartState",
40
- "description": "The current contents of the cart. Owned exclusively by the backend; the frontend must not mutate this directly.",
41
- "$comment": "This schema validates the runtime state value the backend pushes to the frontend.",
42
- "type": "object",
43
- "required": [
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
- },
55
- "additionalProperties": false
56
- },
57
- "SetItemsAction": {
58
- "title": "setItems",
59
- "description": "Replaces the entire cart contents with the provided list of items.",
60
- "allOf": [
61
- {
62
- "$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
63
- }
64
- ],
65
- "properties": {
66
- "payload": {
67
- "type": "object",
68
- "required": [
69
- "items"
70
- ],
71
- "properties": {
72
- "items": {
73
- "type": "array",
74
- "description": "The new complete list of cart items. An empty array clears the cart.",
75
- "items": {
76
- "$ref": "https://schema.thermidor.coveo.com/definitions/cart-item.schema.json"
77
- }
78
- }
79
- },
80
- "additionalProperties": false
81
- }
82
- }
83
- },
84
- "UpdateItemQuantityAction": {
85
- "title": "updateItemQuantity",
86
- "description": "Updates the quantity of a single existing cart line item identified by productId.",
87
- "allOf": [
88
- {
89
- "$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
90
- }
91
- ],
92
- "properties": {
93
- "payload": {
94
- "type": "object",
95
- "required": [
96
- "item"
97
- ],
98
- "properties": {
99
- "item": {
100
- "$ref": "https://schema.thermidor.coveo.com/definitions/cart-item.schema.json"
101
- }
102
- },
103
- "additionalProperties": false
104
- }
105
- }
106
- }
107
- }
108
- }
@@ -1,29 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schema.thermidor.coveo.com/definitions/cart-item.schema.json",
4
- "title": "CartItem",
5
- "description": "A single line item in the cart, as exposed by the CartController state and used in cart action payloads.",
6
- "type": "object",
7
- "required": ["productId", "name", "price", "quantity"],
8
- "properties": {
9
- "productId": {
10
- "type": "string",
11
- "description": "The unique product identifier. Corresponds to the Product's permanentid field."
12
- },
13
- "name": {
14
- "type": "string",
15
- "description": "The display name of the product at the time it was added to the cart."
16
- },
17
- "price": {
18
- "type": "number",
19
- "minimum": 0,
20
- "description": "The non-negative unit price at the time the item was added, in the session currency."
21
- },
22
- "quantity": {
23
- "type": "integer",
24
- "minimum": 1,
25
- "description": "The number of units of this product in the cart."
26
- }
27
- },
28
- "additionalProperties": false
29
- }