@adobe/spacecat-shared-data-access 1.61.12 → 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 +14 -0
- package/package.json +2 -2
- package/src/v2/models/audit/audit.model.js +2 -2
- package/src/v2/models/audit/audit.schema.js +2 -2
- package/src/v2/models/audit/index.d.ts +1 -1
- package/src/v2/models/latest-audit/index.d.ts +1 -1
- package/src/v2/models/latest-audit/latest-audit.schema.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
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
|
+
|
|
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)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* audit result to validate array ([#522](https://github.com/adobe/spacecat-shared/issues/522)) ([a6978d5](https://github.com/adobe/spacecat-shared/commit/a6978d54c52e668ea2336e68c9dcb000ba1a45a3))
|
|
14
|
+
|
|
1
15
|
# [@adobe/spacecat-shared-data-access-v1.61.12](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.61.11...@adobe/spacecat-shared-data-access-v1.61.12) (2024-12-31)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/spacecat-shared-data-access",
|
|
3
|
-
"version": "1.61.
|
|
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.
|
|
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",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { isObject } from '@adobe/spacecat-shared-utils';
|
|
13
|
+
import { isArray, isObject } from '@adobe/spacecat-shared-utils';
|
|
14
14
|
|
|
15
15
|
import { ValidationError } from '../../errors/index.js';
|
|
16
16
|
import BaseModel from '../base/base.model.js';
|
|
@@ -53,7 +53,7 @@ class Audit extends BaseModel {
|
|
|
53
53
|
* @returns {boolean} - True if valid, false otherwise.
|
|
54
54
|
*/
|
|
55
55
|
static validateAuditResult = (auditResult, auditType) => {
|
|
56
|
-
if (!isObject(auditResult) && !
|
|
56
|
+
if (!isObject(auditResult) && !isArray(auditResult)) {
|
|
57
57
|
throw new ValidationError('Audit result must be an object or array');
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -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 SchemaBuilder from '../base/schema.builder.js';
|
|
18
18
|
import Audit from './audit.model.js';
|
|
@@ -33,7 +33,7 @@ const schema = new SchemaBuilder(Audit, AuditCollection)
|
|
|
33
33
|
.addAttribute('auditResult', {
|
|
34
34
|
type: 'any',
|
|
35
35
|
required: true,
|
|
36
|
-
validate: (value) => isNonEmptyObject(value),
|
|
36
|
+
validate: (value) => isNonEmptyObject(value) || isArray(value),
|
|
37
37
|
set: (value, attributes) => {
|
|
38
38
|
// as the electroDb validate function does not provide access to the model instance
|
|
39
39
|
// we need to call the validate function from the model on setting the value
|
|
@@ -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
|