@adobe/spacecat-shared-data-access 1.61.10 → 1.61.12
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-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
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* calling all wrong args ([#520](https://github.com/adobe/spacecat-shared/issues/520)) ([b727e50](https://github.com/adobe/spacecat-shared/commit/b727e50e8375c8b6a33bac101d0a2ecaf8fc8b7e))
|
|
7
|
+
|
|
8
|
+
# [@adobe/spacecat-shared-data-access-v1.61.11](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.61.10...@adobe/spacecat-shared-data-access-v1.61.11) (2024-12-31)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* org config access ([#518](https://github.com/adobe/spacecat-shared/issues/518)) ([8ef162d](https://github.com/adobe/spacecat-shared/commit/8ef162d85a2086d9029010b4e93b20404d39c38c))
|
|
14
|
+
|
|
1
15
|
# [@adobe/spacecat-shared-data-access-v1.61.10](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.61.9...@adobe/spacecat-shared-data-access-v1.61.10) (2024-12-31)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
import { isNonEmptyObject } from '@adobe/spacecat-shared-utils';
|
|
16
16
|
|
|
17
|
-
import { DEFAULT_CONFIG, validateConfiguration } from '../../../models/site/config.js';
|
|
17
|
+
import { Config, DEFAULT_CONFIG, validateConfiguration } from '../../../models/site/config.js';
|
|
18
18
|
import SchemaBuilder from '../base/schema.builder.js';
|
|
19
19
|
import Organization from './organization.model.js';
|
|
20
20
|
import OrganizationCollection from './organization.collection.js';
|
|
@@ -33,6 +33,7 @@ const schema = new SchemaBuilder(Organization, OrganizationCollection)
|
|
|
33
33
|
required: true,
|
|
34
34
|
default: DEFAULT_CONFIG,
|
|
35
35
|
validate: (value) => isNonEmptyObject(validateConfiguration(value)),
|
|
36
|
+
get: (value) => Config(value),
|
|
36
37
|
})
|
|
37
38
|
.addAttribute('name', {
|
|
38
39
|
type: 'string',
|
|
@@ -26,7 +26,7 @@ import Site from './site.model.js';
|
|
|
26
26
|
*/
|
|
27
27
|
class SiteCollection extends BaseCollection {
|
|
28
28
|
async allSitesToAudit() {
|
|
29
|
-
return (await this.all({ attributes: ['siteId'] })).map((site) => site.getId());
|
|
29
|
+
return (await this.all({}, { attributes: ['siteId'] })).map((site) => site.getId());
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
async allWithLatestAudit(auditType, order = 'asc', deliveryType = null) {
|
|
@@ -43,7 +43,7 @@ class SiteCollection extends BaseCollection {
|
|
|
43
43
|
|
|
44
44
|
const [sites, latestAudits] = await Promise.all([
|
|
45
45
|
sitesQuery,
|
|
46
|
-
latestAuditCollection.all(
|
|
46
|
+
latestAuditCollection.all({ auditType }, { order }),
|
|
47
47
|
]);
|
|
48
48
|
|
|
49
49
|
const sitesMap = new Map(sites.map((site) => [site.getId(), site]));
|