@coveo/thermidor-schema 1.0.0-beta.26 → 1.0.0-beta.27

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.
@@ -194,10 +194,11 @@ export const ProductSummaryStateSchema = z.strictObject({
194
194
  product: z.union([ProductSchema, z.null()]),
195
195
  });
196
196
  export const ProductResearchCardActionsSchema = z.strictObject({});
197
- export const ProductResearchCardStateSchema = z.strictObject({
198
- bullets: z.array(z.string().min(1)).min(1),
199
- product: ProductSchema,
200
- summary: z.string().min(1),
197
+ export const ProductResearchRelatedDocumentSchema = z.strictObject({
198
+ clickUri: z.string().optional(),
199
+ filetype: z.string().optional(),
200
+ size: z.number().int().min(0).optional(),
201
+ title: z.string(),
201
202
  });
202
203
  export const SelectPagePayloadSchema = z.strictObject({
203
204
  page: z.number().int().min(0),
@@ -433,11 +434,11 @@ export const ProductSummarySchema = z.looseObject({
433
434
  id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
434
435
  state: ProductSummaryStateSchema.optional(),
435
436
  });
436
- export const ProductResearchCardSchema = z.looseObject({
437
- actions: ProductResearchCardActionsSchema.optional(),
438
- component: z.literal('ProductResearchCard'),
439
- id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
440
- state: ProductResearchCardStateSchema.optional(),
437
+ export const ProductResearchCardStateSchema = z.strictObject({
438
+ bullets: z.array(z.string().min(1)).min(1),
439
+ product: ProductSchema,
440
+ relatedDocuments: z.array(ProductResearchRelatedDocumentSchema).optional(),
441
+ summary: z.string().min(1),
441
442
  });
442
443
  export const SelectPageSchema = z.strictObject({
443
444
  payload: SelectPagePayloadSchema,
@@ -588,6 +589,12 @@ export const ProductListActionsSchema = z.strictObject({
588
589
  productClick: ProductClickSchema,
589
590
  selectProducts: SelectProductsSchema,
590
591
  });
592
+ export const ProductResearchCardSchema = z.looseObject({
593
+ actions: ProductResearchCardActionsSchema.optional(),
594
+ component: z.literal('ProductResearchCard'),
595
+ id: z.string().min(1).regex(new RegExp('^[a-z][a-z0-9-]*$')),
596
+ state: ProductResearchCardStateSchema.optional(),
597
+ });
591
598
  export const PaginationActionsSchema = z.strictObject({
592
599
  selectPage: SelectPageSchema,
593
600
  setPageSize: PurpleSetPageSizeSchema,
@@ -948,6 +955,13 @@ export const ProductResearchCardPropsSchema = z.object({
948
955
  ]),
949
956
  summary: DynamicStringSchema,
950
957
  bullets: DynamicStringListSchema,
958
+ relatedDocuments: z
959
+ .union([
960
+ ProductResearchCardStateSchema.shape['relatedDocuments'],
961
+ DataBindingSchema,
962
+ FunctionCallSchema,
963
+ ])
964
+ .optional(),
951
965
  });
952
966
  export const ProductSummaryPropsSchema = z.object({
953
967
  categoryLabel: DynamicStringSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coveo/thermidor-schema",
3
- "version": "1.0.0-beta.26",
3
+ "version": "1.0.0-beta.27",
4
4
  "description": "Zod and TypeScript projections of the Thermidor JSON Schema contract.",
5
5
  "homepage": "https://github.com/coveo-platform/thermidor-schema#readme",
6
6
  "bugs": {
@@ -28,6 +28,10 @@
28
28
  "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
29
29
  "description": "The product-education bullets, bound to /state/<id>/bullets."
30
30
  },
31
+ "relatedDocuments": {
32
+ "$ref": "https://schema.thermidor.coveo.com/definitions/data-binding.schema.json",
33
+ "description": "The related documents, bound to /state/<id>/relatedDocuments."
34
+ },
31
35
  "state": {
32
36
  "$ref": "#/$defs/ProductResearchCardState"
33
37
  },
@@ -41,7 +45,7 @@
41
45
  "$defs": {
42
46
  "ProductResearchCardState": {
43
47
  "title": "ProductResearchCardState",
44
- "description": "The researched product and its research content. Owned exclusively by the backend; the frontend must not mutate this directly.",
48
+ "description": "The researched product, its research content, and related documents. Owned exclusively by the backend; the frontend must not mutate this directly.",
45
49
  "$comment": "This schema validates the runtime state value the backend pushes to the frontend.",
46
50
  "type": "object",
47
51
  "required": ["product", "summary", "bullets"],
@@ -62,6 +66,39 @@
62
66
  "type": "string",
63
67
  "minLength": 1
64
68
  }
69
+ },
70
+ "relatedDocuments": {
71
+ "type": "array",
72
+ "description": "Documents related to the researched product, in display order.",
73
+ "items": {
74
+ "$ref": "#/$defs/ProductResearchRelatedDocument"
75
+ }
76
+ }
77
+ },
78
+ "additionalProperties": false
79
+ },
80
+ "ProductResearchRelatedDocument": {
81
+ "title": "ProductResearchRelatedDocument",
82
+ "description": "A document related to the researched product.",
83
+ "type": "object",
84
+ "required": ["title"],
85
+ "properties": {
86
+ "title": {
87
+ "type": "string",
88
+ "description": "The display title of the document."
89
+ },
90
+ "clickUri": {
91
+ "type": "string",
92
+ "description": "The URI used to open the document."
93
+ },
94
+ "size": {
95
+ "type": "integer",
96
+ "minimum": 0,
97
+ "description": "The document size in bytes."
98
+ },
99
+ "filetype": {
100
+ "type": "string",
101
+ "description": "The document file type."
65
102
  }
66
103
  },
67
104
  "additionalProperties": false