@adobe/spacecat-shared-utils 1.66.1 → 1.68.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.68.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.67.0...@adobe/spacecat-shared-utils-v1.68.0) (2025-10-29)
2
+
3
+
4
+ ### Features
5
+
6
+ * add optional urls to categories | LLMO-845 ([#1055](https://github.com/adobe/spacecat-shared/issues/1055)) ([5d4d63e](https://github.com/adobe/spacecat-shared/commit/5d4d63e95e9d688c5334a0db66af419cc1aad858))
7
+
8
+ # [@adobe/spacecat-shared-utils-v1.67.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.66.1...@adobe/spacecat-shared-utils-v1.67.0) (2025-10-29)
9
+
10
+
11
+ ### Features
12
+
13
+ * added a11y-assistive type to extractor ([#1067](https://github.com/adobe/spacecat-shared/issues/1067)) ([79d0326](https://github.com/adobe/spacecat-shared/commit/79d0326fef06341d6243f3979659ccc904f59d14))
14
+
1
15
  # [@adobe/spacecat-shared-utils-v1.66.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.66.0...@adobe/spacecat-shared-utils-v1.66.1) (2025-10-28)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-utils",
3
- "version": "1.66.1",
3
+ "version": "1.68.0",
4
4
  "description": "Shared modules of the Spacecat Services - utils",
5
5
  "type": "module",
6
6
  "exports": {
package/src/schemas.js CHANGED
@@ -50,10 +50,27 @@ const entity = z.object({
50
50
  name: nonEmptyString,
51
51
  });
52
52
 
53
+ const categoryUrl = z.object({
54
+ value: nonEmptyString,
55
+ type: z.union([z.literal('prefix'), z.literal('url')]),
56
+ }).superRefine((data, ctx) => {
57
+ // Validate URL format only for type 'url'
58
+ if (data.type === 'url') {
59
+ if (!URL.canParse(data.value)) {
60
+ ctx.addIssue({
61
+ code: 'custom',
62
+ path: ['value'],
63
+ message: 'Invalid URL format',
64
+ });
65
+ }
66
+ }
67
+ });
68
+
53
69
  const category = z.object({
54
70
  name: nonEmptyString,
55
71
  region: z.union([region, z.array(region)]),
56
72
  origin: z.union([z.literal('human'), z.literal('ai'), z.string()]).optional(),
73
+ urls: z.array(categoryUrl).optional(),
57
74
  });
58
75
 
59
76
  const topic = z.object({
@@ -41,6 +41,7 @@ function extractUrlsFromSuggestion(opts) {
41
41
  }
42
42
  }
43
43
  break;
44
+ case OPPORTUNITY_TYPES.A11Y_ASSISTIVE:
44
45
  case OPPORTUNITY_TYPES.ACCESSIBILITY:
45
46
  case OPPORTUNITY_TYPES.COLOR_CONTRAST:
46
47
  case OPPORTUNITY_TYPES.STRUCTURED_DATA: