@adobe/spacecat-shared-utils 1.63.0 → 1.65.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,17 @@
1
+ # [@adobe/spacecat-shared-utils-v1.65.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.64.0...@adobe/spacecat-shared-utils-v1.65.0) (2025-10-24)
2
+
3
+
4
+ ### Features
5
+
6
+ * update schemas to make category and region optional for brand aliases ([#1044](https://github.com/adobe/spacecat-shared/issues/1044)) ([d024402](https://github.com/adobe/spacecat-shared/commit/d02440269d557adfb810312badfbfc8ff74cddf3))
7
+
8
+ # [@adobe/spacecat-shared-utils-v1.64.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.63.0...@adobe/spacecat-shared-utils-v1.64.0) (2025-10-24)
9
+
10
+
11
+ ### Features
12
+
13
+ * change tests so I can release to prod yay ([#1043](https://github.com/adobe/spacecat-shared/issues/1043)) ([c478e22](https://github.com/adobe/spacecat-shared/commit/c478e220321ea24a20882a2521cb48c3ad4ffae3))
14
+
1
15
  # [@adobe/spacecat-shared-utils-v1.63.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.62.0...@adobe/spacecat-shared-utils-v1.63.0) (2025-10-23)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-utils",
3
- "version": "1.63.0",
3
+ "version": "1.65.0",
4
4
  "description": "Shared modules of the Spacecat Services - utils",
5
5
  "type": "module",
6
6
  "exports": {
@@ -91,7 +91,7 @@ const CDN_TRANSFORMATIONS = {
91
91
  'EdgeTimeToFirstByteMs',
92
92
  ],
93
93
  'Log format': 'JSON',
94
- 'Ownership token': payload.ownershipToken || 'The token will be available after the log forwarding configuration has been deployed in Cloudflare. Please refresh this page once you have completed this step.',
94
+ 'Ownership token': payload.ownershipToken || 'token-available-after-deployment',
95
95
  HelpUrl: 'https://developers.cloudflare.com/logs/logpush/logpush-job/enable-destinations/aws-s3/',
96
96
  }),
97
97
  'byocdn-cloudfront': (payload) => ({
package/src/schemas.js CHANGED
@@ -76,8 +76,8 @@ export const llmoConfig = z.object({
76
76
  aliases: z.array(
77
77
  z.object({
78
78
  aliases: z.array(nonEmptyString),
79
- category: z.uuid(),
80
- region: z.union([region, z.array(region)]),
79
+ category: z.uuid().optional(),
80
+ region: z.union([region, z.array(region)]).optional(),
81
81
  }),
82
82
  ),
83
83
  }),
@@ -106,8 +106,23 @@ export const llmoConfig = z.object({
106
106
  } = value;
107
107
 
108
108
  brands.aliases.forEach((alias, index) => {
109
- ensureCategoryExists(categories, ctx, alias.category, ['brands', 'aliases', index, 'category']);
110
- ensureRegionCompatibility(categories, ctx, alias.category, alias.region, ['brands', 'aliases', index, 'region'], 'brand alias');
109
+ // Ensure category and region are both provided or both omitted
110
+ if (alias.category && !alias.region) {
111
+ ctx.addIssue({
112
+ code: 'custom',
113
+ path: ['brands', 'aliases', index, 'region'],
114
+ message: 'region is required when category is provided',
115
+ });
116
+ } else if (!alias.category && alias.region) {
117
+ ctx.addIssue({
118
+ code: 'custom',
119
+ path: ['brands', 'aliases', index, 'category'],
120
+ message: 'category is required when region is provided',
121
+ });
122
+ } else if (alias.category && alias.region) {
123
+ ensureCategoryExists(categories, ctx, alias.category, ['brands', 'aliases', index, 'category']);
124
+ ensureRegionCompatibility(categories, ctx, alias.category, alias.region, ['brands', 'aliases', index, 'region'], 'brand alias');
125
+ }
111
126
  });
112
127
 
113
128
  competitors.competitors.forEach((competitor, index) => {