@adobe/spacecat-shared-utils 1.72.0 → 1.72.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [@adobe/spacecat-shared-utils-v1.72.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.72.0...@adobe/spacecat-shared-utils-v1.72.1) (2025-11-13)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **spacecat-shared-data-access/src/models/site/config.js:** add suppo… ([#1118](https://github.com/adobe/spacecat-shared/issues/1118)) ([7123b3c](https://github.com/adobe/spacecat-shared/commit/7123b3c30abb80ba3f2de040417ea3d86660bcc5))
7
+
1
8
  # [@adobe/spacecat-shared-utils-v1.72.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.71.0...@adobe/spacecat-shared-utils-v1.72.0) (2025-11-11)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-utils",
3
- "version": "1.72.0",
3
+ "version": "1.72.1",
4
4
  "description": "Shared modules of the Spacecat Services - utils",
5
5
  "type": "module",
6
6
  "exports": {
package/src/schemas.js CHANGED
@@ -89,6 +89,7 @@ export const llmoConfig = z.object({
89
89
  entities: z.record(z.uuid(), entity),
90
90
  categories: z.record(z.uuid(), category),
91
91
  topics: z.record(z.uuid(), topic),
92
+ aiTopics: z.record(z.uuid(), topic).optional(),
92
93
  brands: z.object({
93
94
  aliases: z.array(
94
95
  z.object({
@@ -148,6 +149,21 @@ export const llmoConfig = z.object({
148
149
  });
149
150
 
150
151
  // Validate topic prompts regions against their category
152
+ validateTopicPromptRegions(categories, ctx, topics, 'topics');
153
+
154
+ // Validate aiTopics prompts regions against their category
155
+ if (value.aiTopics) {
156
+ validateTopicPromptRegions(categories, ctx, value.aiTopics, 'aiTopics');
157
+ }
158
+ });
159
+
160
+ /**
161
+ * @param {LLMOConfig['categories']} categories
162
+ * @param {z.RefinementCtx} ctx
163
+ * @param {Record<string, z.infer<typeof topic>>} topics
164
+ * @param {string} topicsKey - The key name in the path (e.g., 'topics' or 'aiTopics')
165
+ */
166
+ function validateTopicPromptRegions(categories, ctx, topics, topicsKey) {
151
167
  Object.entries(topics).forEach(([topicId, topicEntity]) => {
152
168
  if (topicEntity.prompts && topicEntity.category) {
153
169
  // If category is a UUID, validate against the referenced category entity
@@ -158,14 +174,14 @@ export const llmoConfig = z.object({
158
174
  ctx,
159
175
  topicEntity.category,
160
176
  promptItem.regions,
161
- ['topics', topicId, 'prompts', promptIndex, 'regions'],
162
- 'topic prompt',
177
+ [topicsKey, topicId, 'prompts', promptIndex, 'regions'],
178
+ `${topicsKey} prompt`,
163
179
  );
164
180
  });
165
181
  }
166
182
  }
167
183
  });
168
- });
184
+ }
169
185
 
170
186
  /**
171
187
  * @param {LLMOConfig['categories']} categories