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

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 (48) hide show
  1. package/README.md +32 -5
  2. package/dist/generated/schemas.d.ts +2651 -408
  3. package/dist/generated/schemas.js +738 -173
  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 +24410 -0
  7. package/dist/generated/zod3/schemas.js +1106 -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 +26 -20
  13. package/schema/base/catalog.schema.json +5 -4
  14. package/schema/base/component.schema.json +22 -20
  15. package/schema/{components/component-contracts.schema.json → component-contracts.schema.json} +23 -5
  16. package/schema/components/bundle-display.schema.json +11 -6
  17. package/schema/components/cart.schema.json +85 -46
  18. package/schema/components/category-facet.schema.json +35 -26
  19. package/schema/components/commerce-search.schema.json +186 -0
  20. package/schema/components/comparison-table.schema.json +35 -11
  21. package/schema/components/date-facet.schema.json +39 -26
  22. package/schema/components/facet-manager.schema.json +16 -18
  23. package/schema/components/layout-stack.schema.json +50 -0
  24. package/schema/components/next-actions-bar.schema.json +43 -19
  25. package/schema/components/numeric-facet.schema.json +43 -28
  26. package/schema/components/page-size.schema.json +79 -0
  27. package/schema/components/pagination.schema.json +45 -19
  28. package/schema/components/product-carousel.schema.json +15 -7
  29. package/schema/components/product-list.schema.json +77 -7
  30. package/schema/components/product-research-card.schema.json +70 -0
  31. package/schema/components/product-summary.schema.json +64 -0
  32. package/schema/components/query-suggestions.schema.json +113 -0
  33. package/schema/components/query-summary.schema.json +76 -0
  34. package/schema/components/regular-facet.schema.json +42 -51
  35. package/schema/components/sort.schema.json +18 -18
  36. package/schema/definitions/action-item.schema.json +10 -13
  37. package/schema/definitions/bundle-tier.schema.json +9 -4
  38. package/schema/definitions/child-list.schema.json +31 -0
  39. package/schema/definitions/comparison-attribute.schema.json +2 -2
  40. package/schema/definitions/comparison-product.schema.json +2 -4
  41. package/schema/definitions/component-id.schema.json +9 -0
  42. package/schema/definitions/data-binding.schema.json +16 -0
  43. package/schema/definitions/followup-action-item.schema.json +20 -0
  44. package/schema/definitions/product.schema.json +3 -6
  45. package/schema/definitions/search-action-item.schema.json +20 -0
  46. package/schema/definitions/search-option-action-item.schema.json +25 -0
  47. package/schema/components/search-box.schema.json +0 -74
  48. package/schema/definitions/cart-item.schema.json +0 -29
@@ -9,18 +9,27 @@
9
9
  }
10
10
  ],
11
11
  "properties": {
12
- "componentType": {
12
+ "id": {
13
+ "type": "string"
14
+ },
15
+ "component": {
13
16
  "type": "string",
14
- "const": "sort"
17
+ "const": "Sort"
18
+ },
19
+ "appliedSort": {
20
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
21
+ "description": "The currently applied sort criterion, bound to /state/<id>/appliedSort."
22
+ },
23
+ "availableSorts": {
24
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
25
+ "description": "The available sort options, bound to /state/<id>/availableSorts."
15
26
  },
16
27
  "state": {
17
28
  "$ref": "#/$defs/SortState"
18
29
  },
19
30
  "actions": {
20
31
  "type": "object",
21
- "required": [
22
- "selectSort"
23
- ],
32
+ "required": ["selectSort"],
24
33
  "properties": {
25
34
  "selectSort": {
26
35
  "$ref": "#/$defs/SelectSortAction"
@@ -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
+ }
@@ -2,19 +2,16 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://schema.thermidor.coveo.com/definitions/action-item.schema.json",
4
4
  "title": "ActionItem",
5
- "description": "A suggested action the assistant offers the user, such as a follow-up question or a search query.",
6
- "type": "object",
7
- "required": ["text", "type"],
8
- "properties": {
9
- "text": {
10
- "type": "string",
11
- "description": "The display text of the action shown to the user."
5
+ "description": "A suggested action the assistant offers the user: a follow-up question, a search query, or a search the backend saved. Discriminated by type.",
6
+ "oneOf": [
7
+ {
8
+ "$ref": "https://schema.thermidor.coveo.com/definitions/followup-action-item.schema.json"
12
9
  },
13
- "type": {
14
- "type": "string",
15
- "enum": ["followup", "search"],
16
- "description": "The kind of action: \"followup\" triggers a conversational follow-up, \"search\" triggers a standalone search."
10
+ {
11
+ "$ref": "https://schema.thermidor.coveo.com/definitions/search-action-item.schema.json"
12
+ },
13
+ {
14
+ "$ref": "https://schema.thermidor.coveo.com/definitions/search-option-action-item.schema.json"
17
15
  }
18
- },
19
- "additionalProperties": false
16
+ ]
20
17
  }
@@ -4,7 +4,7 @@
4
4
  "title": "BundleTier",
5
5
  "description": "A tier in a product bundle, grouping product slots by price/quality level.",
6
6
  "type": "object",
7
- "required": ["label", "description", "slots"],
7
+ "required": ["label", "description", "total", "slots"],
8
8
  "properties": {
9
9
  "label": {
10
10
  "type": "string",
@@ -14,6 +14,11 @@
14
14
  "type": "string",
15
15
  "description": "Brief description of what the tier includes."
16
16
  },
17
+ "total": {
18
+ "type": "number",
19
+ "minimum": 0,
20
+ "description": "Backend-computed total price for this tier's slots, in the request currency."
21
+ },
17
22
  "slots": {
18
23
  "type": "array",
19
24
  "description": "Product category slots within this tier.",
@@ -27,15 +32,15 @@
27
32
  "BundleSlot": {
28
33
  "title": "BundleSlot",
29
34
  "type": "object",
30
- "required": ["categoryLabel", "surfaceRef"],
35
+ "required": ["categoryLabel", "childId"],
31
36
  "properties": {
32
37
  "categoryLabel": {
33
38
  "type": "string",
34
39
  "description": "Display name of the product category for this slot."
35
40
  },
36
- "surfaceRef": {
41
+ "childId": {
37
42
  "type": "string",
38
- "description": "Surface ID where this slot's products are rendered via a ProductCarousel."
43
+ "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
44
  }
40
45
  },
41
46
  "additionalProperties": false
@@ -0,0 +1,31 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.thermidor.coveo.com/definitions/child-list.schema.json",
4
+ "title": "ChildList",
5
+ "description": "The A2-UI ChildList type: how a container holds its ordered children, as a static array of ComponentId references or a template binding children to a data-model list.",
6
+ "$comment": "A2-UI common_types.json#/$defs/ChildList. Any child-list property MUST use this type so validators treat it as a structural link. Thermidor emits only the static array form.",
7
+ "oneOf": [
8
+ {
9
+ "type": "array",
10
+ "description": "A static, ordered list of child component ids. Order is backend-owned and meaningful for container components (e.g. facet order); referential integrity and uniqueness are owned by the backend and not enforced at parse time.",
11
+ "items": {
12
+ "$ref": "https://schema.thermidor.coveo.com/definitions/component-id.schema.json"
13
+ }
14
+ },
15
+ {
16
+ "type": "object",
17
+ "description": "A template for generating a dynamic list of children from a data-model list. The componentId is the component used as the template; path is the JSON Pointer to the list of component property objects in the data model.",
18
+ "required": ["componentId", "path"],
19
+ "properties": {
20
+ "componentId": {
21
+ "$ref": "https://schema.thermidor.coveo.com/definitions/component-id.schema.json"
22
+ },
23
+ "path": {
24
+ "type": "string",
25
+ "description": "An RFC 6901 JSON Pointer to the list of component property objects in the A2-UI data model."
26
+ }
27
+ },
28
+ "additionalProperties": false
29
+ }
30
+ ]
31
+ }
@@ -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",
@@ -21,7 +21,6 @@
21
21
  },
22
22
  "imageUrl": {
23
23
  "type": "string",
24
- "format": "uri",
25
24
  "description": "Product image URL."
26
25
  },
27
26
  "price": {
@@ -31,7 +30,6 @@
31
30
  "rating": {
32
31
  "type": "number",
33
32
  "minimum": 0,
34
- "maximum": 5,
35
33
  "description": "Product rating on a 0-5 scale."
36
34
  }
37
35
  },
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.thermidor.coveo.com/definitions/component-id.schema.json",
4
+ "title": "ComponentId",
5
+ "type": "string",
6
+ "pattern": "^[a-z][a-z0-9-]*$",
7
+ "description": "A reference to the unique id of another component within the same surface. Thermidor node ids are kebab-case; the pattern narrows the A2-UI string type to that convention.",
8
+ "$comment": "A2-UI common_types.json#/$defs/ComponentId. Any property holding another component's id MUST use this type so validators treat it as a structural link rather than free text."
9
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
4
+ "title": "DataBinding",
5
+ "type": "object",
6
+ "required": ["path"],
7
+ "properties": {
8
+ "path": {
9
+ "type": "string",
10
+ "description": "An RFC 6901 JSON Pointer resolving a value in the A2-UI data model, at or beneath statePath(id)."
11
+ }
12
+ },
13
+ "additionalProperties": false,
14
+ "description": "A standard A2-UI Data_Binding object { \"path\": <RFC 6901 JSON Pointer> } pointing at or beneath statePath(id) = /state/<id>.",
15
+ "$comment": "A2-UI common_types.json#/$defs/DataBinding. A bindable prop references this so the Zod generator projects it as a Dynamic_Value union (literal or { path } binding)."
16
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.thermidor.coveo.com/definitions/followup-action-item.schema.json",
4
+ "title": "FollowupActionItem",
5
+ "description": "An ActionItem that triggers a conversational follow-up.",
6
+ "type": "object",
7
+ "required": ["text", "type"],
8
+ "properties": {
9
+ "text": {
10
+ "type": "string",
11
+ "description": "The display text of the action shown to the user."
12
+ },
13
+ "type": {
14
+ "type": "string",
15
+ "const": "followup",
16
+ "description": "The ActionItem discriminator."
17
+ }
18
+ },
19
+ "additionalProperties": false
20
+ }
@@ -41,12 +41,12 @@
41
41
  },
42
42
  "ec_images": {
43
43
  "type": "array",
44
- "items": {"type": "string", "format": "uri"},
44
+ "items": {"type": "string"},
45
45
  "description": "Full-resolution image URLs, in display order."
46
46
  },
47
47
  "ec_thumbnails": {
48
48
  "type": "array",
49
- "items": {"type": "string", "format": "uri"},
49
+ "items": {"type": "string"},
50
50
  "description": "Thumbnail image URLs, in display order."
51
51
  },
52
52
  "ec_in_stock": {
@@ -56,7 +56,6 @@
56
56
  "ec_rating": {
57
57
  "type": ["number", "null"],
58
58
  "minimum": 0,
59
- "maximum": 5,
60
59
  "description": "Average customer rating on a 0-5 scale. Null when no ratings exist."
61
60
  },
62
61
  "ec_color": {
@@ -73,9 +72,7 @@
73
72
  },
74
73
  "clickUri": {
75
74
  "type": "string",
76
- "format": "uri",
77
- "$comment": "TODO(quicktype): Restore format: uri-reference when quicktype-core preserves that JSON Schema format through its TypeGraph.",
78
- "description": "Absolute URL to the product detail page."
75
+ "description": "URL of the product detail page."
79
76
  },
80
77
  "additionalFields": {
81
78
  "type": "object",
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.thermidor.coveo.com/definitions/search-action-item.schema.json",
4
+ "title": "SearchActionItem",
5
+ "description": "An ActionItem that triggers a standalone search.",
6
+ "type": "object",
7
+ "required": ["text", "type"],
8
+ "properties": {
9
+ "text": {
10
+ "type": "string",
11
+ "description": "The display text of the action shown to the user."
12
+ },
13
+ "type": {
14
+ "type": "string",
15
+ "const": "search",
16
+ "description": "The ActionItem discriminator."
17
+ }
18
+ },
19
+ "additionalProperties": false
20
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.thermidor.coveo.com/definitions/search-option-action-item.schema.json",
4
+ "title": "SearchOptionActionItem",
5
+ "description": "An ActionItem that opens a search the backend saved behind it. Selecting it dispatches selectSearchOption with its optionId.",
6
+ "type": "object",
7
+ "required": ["text", "type", "optionId"],
8
+ "properties": {
9
+ "text": {
10
+ "type": "string",
11
+ "description": "The display text of the action shown to the user."
12
+ },
13
+ "type": {
14
+ "type": "string",
15
+ "const": "searchOption",
16
+ "description": "The ActionItem discriminator."
17
+ },
18
+ "optionId": {
19
+ "type": "string",
20
+ "minLength": 1,
21
+ "description": "Opaque identifier of the search the backend saved behind the action. Set only by the backend; the frontend sends it back unchanged in the selectSearchOption payload so the backend can run that search."
22
+ }
23
+ },
24
+ "additionalProperties": false
25
+ }
@@ -1,74 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schema.thermidor.coveo.com/components/search-box.schema.json",
4
- "title": "SearchBox",
5
- "description": "Provides a search input for a commerce search surface. Renders the current query and dispatches submitQuery when the user submits a new query.",
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": "search-box"
15
- },
16
- "state": {
17
- "$ref": "#/$defs/SearchBoxState"
18
- },
19
- "actions": {
20
- "type": "object",
21
- "required": [
22
- "submitQuery"
23
- ],
24
- "properties": {
25
- "submitQuery": {
26
- "$ref": "#/$defs/SubmitQueryAction"
27
- }
28
- },
29
- "additionalProperties": false
30
- }
31
- },
32
- "additionalProperties": false,
33
- "$defs": {
34
- "SearchBoxState": {
35
- "title": "SearchBoxState",
36
- "description": "The current search box state. Owned exclusively by the backend.",
37
- "type": "object",
38
- "required": [
39
- "query"
40
- ],
41
- "properties": {
42
- "query": {
43
- "type": "string",
44
- "description": "The current search query string."
45
- }
46
- },
47
- "additionalProperties": false
48
- },
49
- "SubmitQueryAction": {
50
- "title": "submitQuery",
51
- "description": "Submits a new search query.",
52
- "allOf": [
53
- {
54
- "$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
55
- }
56
- ],
57
- "properties": {
58
- "payload": {
59
- "type": "object",
60
- "required": [
61
- "query"
62
- ],
63
- "properties": {
64
- "query": {
65
- "type": "string",
66
- "description": "The query string to submit."
67
- }
68
- },
69
- "additionalProperties": false
70
- }
71
- }
72
- }
73
- }
74
- }
@@ -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
- }