@adobe/spacecat-shared-data-access 2.8.0 → 2.8.2

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-data-access-v2.8.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.8.1...@adobe/spacecat-shared-data-access-v2.8.2) (2025-02-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * validate IMS Org ID ([#618](https://github.com/adobe/spacecat-shared/issues/618)) ([aa79853](https://github.com/adobe/spacecat-shared/commit/aa79853bddea717281f38984ec0cc88c10d12128))
7
+
8
+ # [@adobe/spacecat-shared-data-access-v2.8.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.8.0...@adobe/spacecat-shared-data-access-v2.8.1) (2025-02-20)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * log fields affected by validation error ([#614](https://github.com/adobe/spacecat-shared/issues/614)) ([e7b91bd](https://github.com/adobe/spacecat-shared/commit/e7b91bdc1d3f2a28b5755ccdbacfdb651411611e))
14
+
1
15
  # [@adobe/spacecat-shared-data-access-v2.8.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.7.1...@adobe/spacecat-shared-data-access-v2.8.0) (2025-02-19)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-data-access",
3
- "version": "2.8.0",
3
+ "version": "2.8.2",
4
4
  "description": "Shared modules of the Spacecat Services - Data Access",
5
5
  "type": "module",
6
6
  "engines": {
@@ -72,6 +72,9 @@ class BaseCollection {
72
72
  #logAndThrowError(message, cause) {
73
73
  const error = new DataAccessError(message, this, cause);
74
74
  this.log.error(`Base Collection Error [${this.entityName}]`, error);
75
+ if (isNonEmptyArray(error.cause?.fields)) {
76
+ this.log.error(`Validation errors: ${JSON.stringify(error.cause.fields)}`);
77
+ }
75
78
  throw error;
76
79
  }
77
80
 
@@ -20,8 +20,9 @@ import BaseModel from '../base/base.model.js';
20
20
  * @extends BaseModel
21
21
  */
22
22
  class Organization extends BaseModel {
23
- // add your custom methods or overrides here
23
+ static IMS_ORG_ID_REGEX = /[a-z0-9]{24}@AdobeOrg/i;
24
24
 
25
+ // add your custom methods or overrides here
25
26
  }
26
27
 
27
28
  export default Organization;
@@ -41,7 +41,7 @@ const schema = new SchemaBuilder(Organization, OrganizationCollection)
41
41
  })
42
42
  .addAttribute('imsOrgId', {
43
43
  type: 'string',
44
- default: 'default',
44
+ validate: (value) => !value || Organization.IMS_ORG_ID_REGEX.test(value),
45
45
  })
46
46
  .addAttribute('fulfillableItems', {
47
47
  type: 'any',