@coveo/thermidor-schema 1.0.0-beta.2 → 1.0.0-beta.20
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 +2553 -373
- package/dist/generated/schemas.js +712 -166
- package/dist/generated/zod3/index.d.ts +3 -0
- package/dist/generated/zod3/index.js +5 -0
- package/dist/generated/zod3/schemas.d.ts +23928 -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-compat.d.ts +79 -0
- package/dist/zod3-compat.js +82 -0
- package/package.json +26 -20
- package/schema/base/catalog.schema.json +5 -4
- package/schema/base/component.schema.json +22 -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 -26
- 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 +21 -18
- package/schema/components/numeric-facet.schema.json +43 -28
- 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 -51
- package/schema/components/sort.schema.json +18 -18
- package/schema/definitions/action-item.schema.json +5 -0
- package/schema/definitions/bundle-tier.schema.json +9 -4
- package/schema/definitions/child-list.schema.json +31 -0
- package/schema/definitions/comparison-attribute.schema.json +2 -2
- package/schema/definitions/comparison-product.schema.json +2 -4
- package/schema/definitions/component-id.schema.json +9 -0
- package/schema/definitions/data-binding.schema.json +16 -0
- package/schema/definitions/product.schema.json +3 -6
- package/schema/components/search-box.schema.json +0 -74
- package/schema/definitions/cart-item.schema.json +0 -29
|
@@ -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 (
|
|
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
|
|
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
|
|
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"
|
|
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
|
+
}
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
},
|
|
42
42
|
"ec_images": {
|
|
43
43
|
"type": "array",
|
|
44
|
-
"items": {"type": "string"
|
|
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"
|
|
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
|
-
"
|
|
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",
|
|
@@ -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
|
-
}
|