@adobe/spacecat-shared-data-access 1.61.13 → 1.61.14

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-data-access-v1.61.14](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.61.13...@adobe/spacecat-shared-data-access-v1.61.14) (2025-01-03)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * latest audit result to validate array ([#523](https://github.com/adobe/spacecat-shared/issues/523)) ([3450c18](https://github.com/adobe/spacecat-shared/commit/3450c184b2ca2b52ebfa437e5dd23ba6d540b3b5))
7
+
1
8
  # [@adobe/spacecat-shared-data-access-v1.61.13](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.61.12...@adobe/spacecat-shared-data-access-v1.61.13) (2025-01-03)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-data-access",
3
- "version": "1.61.13",
3
+ "version": "1.61.14",
4
4
  "description": "Shared modules of the Spacecat Services - Data Access",
5
5
  "type": "module",
6
6
  "engines": {
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@adobe/spacecat-shared-dynamo": "1.5.1",
38
- "@adobe/spacecat-shared-utils": "1.25.2",
38
+ "@adobe/spacecat-shared-utils": "1.25.4",
39
39
  "@aws-sdk/client-dynamodb": "3.716.0",
40
40
  "@aws-sdk/lib-dynamodb": "3.716.0",
41
41
  "@types/joi": "17.2.3",
@@ -18,7 +18,7 @@ export interface LatestAudit extends BaseModel {
18
18
  getAudit(): Promise<Audit>
19
19
  getAuditedAt(): string;
20
20
  getAuditId(): object;
21
- getAuditResult(): object;
21
+ getAuditResult(): object | [];
22
22
  getAuditType(): string;
23
23
  getFullAuditRef(): string;
24
24
  getIsError(): boolean;
@@ -12,7 +12,7 @@
12
12
 
13
13
  /* c8 ignore start */
14
14
 
15
- import { isIsoDate, isNonEmptyObject } from '@adobe/spacecat-shared-utils';
15
+ import { isArray, isIsoDate, isNonEmptyObject } from '@adobe/spacecat-shared-utils';
16
16
 
17
17
  import Audit from '../audit/audit.model.js';
18
18
  import SchemaBuilder from '../base/schema.builder.js';
@@ -37,7 +37,7 @@ const schema = new SchemaBuilder(LatestAudit, LatestAuditCollection)
37
37
  .addAttribute('auditResult', {
38
38
  type: 'any',
39
39
  required: true,
40
- validate: (value) => isNonEmptyObject(value),
40
+ validate: (value) => isNonEmptyObject(value) || isArray(value),
41
41
  set: (value, attributes) => {
42
42
  // as the electroDb validate function does not provide access to the model instance
43
43
  // we need to call the validate function from the model on setting the value