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

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 (47) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +61 -0
  3. package/dist/generated/schemas.d.ts +3992 -0
  4. package/dist/generated/schemas.js +1085 -0
  5. package/dist/generated/zod3/schemas.d.ts +23821 -0
  6. package/dist/generated/zod3/schemas.js +1087 -0
  7. package/dist/index.d.ts +3 -0
  8. package/dist/index.js +2 -0
  9. package/dist/zod3/index.d.ts +3 -0
  10. package/dist/zod3/index.js +5 -0
  11. package/dist/zod3-compat.d.ts +79 -0
  12. package/dist/zod3-compat.js +82 -0
  13. package/package.json +52 -8
  14. package/schema/base/action.schema.json +12 -0
  15. package/schema/base/catalog.schema.json +38 -0
  16. package/schema/base/component.schema.json +45 -0
  17. package/schema/component-contracts.schema.json +73 -0
  18. package/schema/components/bundle-display.schema.json +52 -0
  19. package/schema/components/cart.schema.json +147 -0
  20. package/schema/components/category-facet.schema.json +303 -0
  21. package/schema/components/commerce-search.schema.json +186 -0
  22. package/schema/components/comparison-table.schema.json +78 -0
  23. package/schema/components/date-facet.schema.json +294 -0
  24. package/schema/components/facet-manager.schema.json +45 -0
  25. package/schema/components/layout-stack.schema.json +50 -0
  26. package/schema/components/next-actions-bar.schema.json +85 -0
  27. package/schema/components/numeric-facet.schema.json +320 -0
  28. package/schema/components/page-size.schema.json +79 -0
  29. package/schema/components/pagination.schema.json +149 -0
  30. package/schema/components/product-carousel.schema.json +60 -0
  31. package/schema/components/product-list.schema.json +116 -0
  32. package/schema/components/product-research-card.schema.json +70 -0
  33. package/schema/components/product-summary.schema.json +64 -0
  34. package/schema/components/query-suggestions.schema.json +113 -0
  35. package/schema/components/query-summary.schema.json +76 -0
  36. package/schema/components/regular-facet.schema.json +395 -0
  37. package/schema/components/sort.schema.json +107 -0
  38. package/schema/definitions/action-item.schema.json +20 -0
  39. package/schema/definitions/bundle-tier.schema.json +49 -0
  40. package/schema/definitions/child-list.schema.json +32 -0
  41. package/schema/definitions/comparison-attribute.schema.json +19 -0
  42. package/schema/definitions/comparison-product.schema.json +39 -0
  43. package/schema/definitions/component-id.schema.json +9 -0
  44. package/schema/definitions/data-binding.schema.json +16 -0
  45. package/schema/definitions/facet-value-state.schema.json +8 -0
  46. package/schema/definitions/product.schema.json +92 -0
  47. package/schema/definitions/selectable-facet-value-state.schema.json +8 -0
@@ -0,0 +1,116 @@
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
+ "id": {
13
+ "type": "string"
14
+ },
15
+ "component": {
16
+ "type": "string",
17
+ "const": "ProductList"
18
+ },
19
+ "products": {
20
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
21
+ "description": "The ordered list of products, bound to /state/<id>/products via a { \"path\": ... } Data_Binding."
22
+ },
23
+ "state": {
24
+ "$ref": "#/$defs/ProductListState"
25
+ },
26
+ "actions": {
27
+ "type": "object",
28
+ "required": ["selectProducts", "productClick"],
29
+ "properties": {
30
+ "selectProducts": {
31
+ "$ref": "#/$defs/SelectProductsAction"
32
+ },
33
+ "productClick": {
34
+ "$ref": "#/$defs/ProductClickAction"
35
+ }
36
+ },
37
+ "additionalProperties": false
38
+ }
39
+ },
40
+ "additionalProperties": false,
41
+ "$defs": {
42
+ "ProductListState": {
43
+ "title": "ProductListState",
44
+ "description": "The ordered list of products to render. Owned exclusively by the backend; the frontend must not mutate this directly.",
45
+ "type": "object",
46
+ "required": ["products"],
47
+ "properties": {
48
+ "products": {
49
+ "type": "array",
50
+ "description": "Ordered list of products to render.",
51
+ "items": {
52
+ "$ref": "https://schema.thermidor.coveo.com/definitions/product.schema.json"
53
+ }
54
+ }
55
+ },
56
+ "additionalProperties": false
57
+ },
58
+ "SelectProductsAction": {
59
+ "title": "selectProducts",
60
+ "description": "Persists the set of products selected by the shopper.",
61
+ "allOf": [
62
+ {
63
+ "$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
64
+ }
65
+ ],
66
+ "properties": {
67
+ "payload": {
68
+ "type": "object",
69
+ "required": ["productIds"],
70
+ "properties": {
71
+ "productIds": {
72
+ "type": "array",
73
+ "items": {
74
+ "type": "string",
75
+ "minLength": 1
76
+ }
77
+ }
78
+ },
79
+ "additionalProperties": false
80
+ }
81
+ }
82
+ },
83
+ "ProductClickAction": {
84
+ "title": "productClick",
85
+ "description": "Records a shopper clicking a product result.",
86
+ "allOf": [
87
+ {
88
+ "$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
89
+ }
90
+ ],
91
+ "properties": {
92
+ "payload": {
93
+ "type": "object",
94
+ "required": ["productId", "position"],
95
+ "properties": {
96
+ "productId": {
97
+ "type": "string",
98
+ "minLength": 1
99
+ },
100
+ "name": {
101
+ "type": "string"
102
+ },
103
+ "price": {
104
+ "type": ["number", "null"]
105
+ },
106
+ "position": {
107
+ "type": "integer",
108
+ "minimum": 0
109
+ }
110
+ },
111
+ "additionalProperties": false
112
+ }
113
+ }
114
+ }
115
+ }
116
+ }
@@ -0,0 +1,70 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.thermidor.coveo.com/components/product-research-card.schema.json",
4
+ "title": "ProductResearchCard",
5
+ "description": "Renders a research card for a single known product: the product details alongside a short research summary and a list of concise product-education bullets. Read-only from the frontend: the backend is the sole source of truth for the product and the research content.",
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": "ProductResearchCard"
18
+ },
19
+ "product": {
20
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
21
+ "description": "The researched product, bound to /state/<id>/product."
22
+ },
23
+ "summary": {
24
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
25
+ "description": "The research summary, bound to /state/<id>/summary."
26
+ },
27
+ "bullets": {
28
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
29
+ "description": "The product-education bullets, bound to /state/<id>/bullets."
30
+ },
31
+ "state": {
32
+ "$ref": "#/$defs/ProductResearchCardState"
33
+ },
34
+ "actions": {
35
+ "type": "object",
36
+ "properties": {},
37
+ "additionalProperties": false
38
+ }
39
+ },
40
+ "additionalProperties": false,
41
+ "$defs": {
42
+ "ProductResearchCardState": {
43
+ "title": "ProductResearchCardState",
44
+ "description": "The researched product and its research content. Owned exclusively by the backend; the frontend must not mutate this directly.",
45
+ "$comment": "This schema validates the runtime state value the backend pushes to the frontend.",
46
+ "type": "object",
47
+ "required": ["product", "summary", "bullets"],
48
+ "properties": {
49
+ "product": {
50
+ "$ref": "https://schema.thermidor.coveo.com/definitions/product.schema.json"
51
+ },
52
+ "summary": {
53
+ "type": "string",
54
+ "minLength": 1,
55
+ "description": "Short research paragraph about the product."
56
+ },
57
+ "bullets": {
58
+ "type": "array",
59
+ "minItems": 1,
60
+ "description": "Concise product-education bullets, in display order. Producers currently emit at most 5 bullets.",
61
+ "items": {
62
+ "type": "string",
63
+ "minLength": 1
64
+ }
65
+ }
66
+ },
67
+ "additionalProperties": false
68
+ }
69
+ }
70
+ }
@@ -0,0 +1,64 @@
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.",
6
+ "$comment": "Compact-row presentation is expressed by this component type on the A2-UI plane, never as data in AG-UI state.",
7
+ "allOf": [
8
+ {
9
+ "$ref": "https://schema.thermidor.coveo.com/base/component.schema.json"
10
+ }
11
+ ],
12
+ "properties": {
13
+ "id": {
14
+ "type": "string"
15
+ },
16
+ "component": {
17
+ "type": "string",
18
+ "const": "ProductSummary"
19
+ },
20
+ "categoryLabel": {
21
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
22
+ "description": "The product category label, bound to /state/<id>/categoryLabel."
23
+ },
24
+ "product": {
25
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
26
+ "description": "The single summarized product, bound to /state/<id>/product."
27
+ },
28
+ "state": {
29
+ "$ref": "#/$defs/ProductSummaryState"
30
+ },
31
+ "actions": {
32
+ "type": "object",
33
+ "properties": {},
34
+ "additionalProperties": false
35
+ }
36
+ },
37
+ "additionalProperties": false,
38
+ "$defs": {
39
+ "ProductSummaryState": {
40
+ "title": "ProductSummaryState",
41
+ "description": "The single product to summarize for a category slot. Owned exclusively by the backend; the frontend must not mutate this directly.",
42
+ "type": "object",
43
+ "required": ["categoryLabel", "product"],
44
+ "properties": {
45
+ "categoryLabel": {
46
+ "type": "string",
47
+ "description": "Display label of the product category this summary represents (e.g. 'Surfboard')."
48
+ },
49
+ "product": {
50
+ "description": "The single product to summarize, or null when no product is available for this slot.",
51
+ "oneOf": [
52
+ {
53
+ "$ref": "https://schema.thermidor.coveo.com/definitions/product.schema.json"
54
+ },
55
+ {
56
+ "type": "null"
57
+ }
58
+ ]
59
+ }
60
+ },
61
+ "additionalProperties": false
62
+ }
63
+ }
64
+ }
@@ -0,0 +1,113 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.thermidor.coveo.com/components/query-suggestions.schema.json",
4
+ "title": "QuerySuggestions",
5
+ "description": "Requests and renders backend-provided query completions and product suggestions for the active search input.",
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": "QuerySuggestions"
18
+ },
19
+ "query": {
20
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
21
+ "description": "The input query these suggestions were requested for, bound to /state/<id>/query."
22
+ },
23
+ "completions": {
24
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
25
+ "description": "The query completions, bound to /state/<id>/completions."
26
+ },
27
+ "products": {
28
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
29
+ "description": "The product suggestions, bound to /state/<id>/products."
30
+ },
31
+ "state": {
32
+ "$ref": "#/$defs/QuerySuggestionsState"
33
+ },
34
+ "actions": {
35
+ "type": "object",
36
+ "required": ["fetchSuggestions"],
37
+ "properties": {
38
+ "fetchSuggestions": {
39
+ "$ref": "#/$defs/FetchSuggestionsAction"
40
+ }
41
+ },
42
+ "additionalProperties": false
43
+ }
44
+ },
45
+ "additionalProperties": false,
46
+ "$defs": {
47
+ "QuerySuggestionsState": {
48
+ "title": "QuerySuggestionsState",
49
+ "description": "The suggestion result for one query. Owned exclusively by the backend.",
50
+ "type": "object",
51
+ "required": ["query", "completions", "products"],
52
+ "properties": {
53
+ "query": {
54
+ "type": "string",
55
+ "description": "The input query for which these suggestions were requested."
56
+ },
57
+ "completions": {
58
+ "type": "array",
59
+ "description": "Query completions returned by the commerce service.",
60
+ "items": {
61
+ "$ref": "#/$defs/QueryCompletion"
62
+ }
63
+ },
64
+ "products": {
65
+ "type": "array",
66
+ "description": "Product suggestions returned by the commerce service.",
67
+ "items": {
68
+ "$ref": "https://schema.thermidor.coveo.com/definitions/product.schema.json"
69
+ }
70
+ }
71
+ },
72
+ "additionalProperties": false
73
+ },
74
+ "FetchSuggestionsAction": {
75
+ "title": "fetchSuggestions",
76
+ "description": "Fetches query completions and product suggestions for the current input.",
77
+ "allOf": [
78
+ {
79
+ "$ref": "https://schema.thermidor.coveo.com/base/action.schema.json"
80
+ }
81
+ ],
82
+ "properties": {
83
+ "payload": {
84
+ "type": "object",
85
+ "required": ["query"],
86
+ "properties": {
87
+ "query": {
88
+ "type": "string"
89
+ }
90
+ },
91
+ "additionalProperties": false
92
+ }
93
+ }
94
+ },
95
+ "QueryCompletion": {
96
+ "title": "QueryCompletion",
97
+ "description": "One query completion returned by the commerce service.",
98
+ "type": "object",
99
+ "required": ["expression"],
100
+ "properties": {
101
+ "expression": {
102
+ "type": "string",
103
+ "description": "The suggested query text."
104
+ },
105
+ "score": {
106
+ "type": "number",
107
+ "description": "The relevance score returned by the commerce service, when available."
108
+ }
109
+ },
110
+ "additionalProperties": false
111
+ }
112
+ }
113
+ }
@@ -0,0 +1,76 @@
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.",
6
+ "$comment": "Carries its own backend-computed aggregate instead of reading sibling state (search box, pagination, product-list), so it has no cross-component coupling.",
7
+ "allOf": [
8
+ {
9
+ "$ref": "https://schema.thermidor.coveo.com/base/component.schema.json"
10
+ }
11
+ ],
12
+ "properties": {
13
+ "id": {
14
+ "type": "string"
15
+ },
16
+ "component": {
17
+ "type": "string",
18
+ "const": "QuerySummary"
19
+ },
20
+ "query": {
21
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
22
+ "description": "The current query string, bound to /state/<id>/query."
23
+ },
24
+ "firstIndex": {
25
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
26
+ "description": "The 1-based index of the first result on the page, bound to /state/<id>/firstIndex."
27
+ },
28
+ "lastIndex": {
29
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
30
+ "description": "The 1-based index of the last result on the page, bound to /state/<id>/lastIndex."
31
+ },
32
+ "totalEntries": {
33
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
34
+ "description": "The total number of results, bound to /state/<id>/totalEntries."
35
+ },
36
+ "state": {
37
+ "$ref": "#/$defs/QuerySummaryState"
38
+ },
39
+ "actions": {
40
+ "type": "object",
41
+ "properties": {},
42
+ "additionalProperties": false
43
+ }
44
+ },
45
+ "additionalProperties": false,
46
+ "$defs": {
47
+ "QuerySummaryState": {
48
+ "title": "QuerySummaryState",
49
+ "description": "The backend-computed aggregate for the current result window. Owned exclusively by the backend; the frontend must not mutate this directly.",
50
+ "type": "object",
51
+ "required": ["query", "firstIndex", "lastIndex", "totalEntries"],
52
+ "properties": {
53
+ "query": {
54
+ "type": "string",
55
+ "description": "The current query string. May be empty when the surface has no active query."
56
+ },
57
+ "firstIndex": {
58
+ "type": "integer",
59
+ "minimum": 0,
60
+ "description": "The 1-based index of the first result on the current page."
61
+ },
62
+ "lastIndex": {
63
+ "type": "integer",
64
+ "minimum": 0,
65
+ "description": "The 1-based index of the last result on the current page."
66
+ },
67
+ "totalEntries": {
68
+ "type": "integer",
69
+ "minimum": 0,
70
+ "description": "The total number of results across all pages."
71
+ }
72
+ },
73
+ "additionalProperties": false
74
+ }
75
+ }
76
+ }