@adobe/spacecat-shared-utils 1.53.0 → 1.54.0

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.54.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.53.0...@adobe/spacecat-shared-utils-v1.54.0) (2025-10-02)
2
+
3
+
4
+ ### Features
5
+
6
+ * remove topic from brand alias and make regions mandatory in categories + make regions mandatory for categories ([#997](https://github.com/adobe/spacecat-shared/issues/997)) ([78e609a](https://github.com/adobe/spacecat-shared/commit/78e609a336cb2a2645199d94d4464c4843bd8c4a))
7
+
1
8
  # [@adobe/spacecat-shared-utils-v1.53.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.52.0...@adobe/spacecat-shared-utils-v1.53.0) (2025-10-02)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-utils",
3
- "version": "1.53.0",
3
+ "version": "1.54.0",
4
4
  "description": "Shared modules of the Spacecat Services - utils",
5
5
  "type": "module",
6
6
  "engines": {
package/src/schemas.js CHANGED
@@ -39,7 +39,7 @@ const nonEmptyString = z.string().min(1);
39
39
  const region = z.string().length(2).regex(/^[a-z][a-z]$/i);
40
40
 
41
41
  const entity = z.union([
42
- z.object({ type: z.literal('category'), name: nonEmptyString, region: z.union([region, z.array(region)]).optional() }),
42
+ z.object({ type: z.literal('category'), name: nonEmptyString, region: z.union([region, z.array(region)]) }),
43
43
  z.object({ type: z.literal('topic'), name: nonEmptyString }),
44
44
  z.object({ type: nonEmptyString }),
45
45
  ]);
@@ -52,7 +52,6 @@ export const llmoConfig = z.object({
52
52
  aliases: z.array(nonEmptyString),
53
53
  category: z.uuid(),
54
54
  region: z.union([region, z.array(region)]),
55
- topic: z.uuid(),
56
55
  }),
57
56
  ),
58
57
  }),
@@ -72,7 +71,6 @@ export const llmoConfig = z.object({
72
71
 
73
72
  brands.aliases.forEach((alias, index) => {
74
73
  ensureEntityType(entities, ctx, alias.category, 'category', ['brands', 'aliases', index, 'category'], 'category');
75
- ensureEntityType(entities, ctx, alias.topic, 'topic', ['brands', 'aliases', index, 'topic'], 'topic');
76
74
  ensureRegionCompatibility(entities, ctx, alias.category, alias.region, ['brands', 'aliases', index, 'region'], 'brand alias');
77
75
  });
78
76
 
@@ -127,16 +125,6 @@ function ensureRegionCompatibility(entities, ctx, categoryId, itemRegion, path,
127
125
 
128
126
  const categoryRegions = categoryEntity.region;
129
127
 
130
- // If category has no regions defined, item should not have regions
131
- if (!categoryRegions) {
132
- ctx.addIssue({
133
- code: 'custom',
134
- path,
135
- message: `${itemLabel} cannot have regions when the referenced category has no regions defined`,
136
- });
137
- return;
138
- }
139
-
140
128
  // Normalize regions to arrays for comparison
141
129
  const categoryRegionArray = Array.isArray(categoryRegions) ? categoryRegions : [categoryRegions];
142
130
  const itemRegionArray = Array.isArray(itemRegion) ? itemRegion : [itemRegion];