@adobe/spacecat-shared-data-access 1.6.2 → 1.6.4
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 +4 -4
- package/src/index.d.ts +1 -0
- package/src/service/sites/accessPatterns.js +9 -1
- package/src/service/sites/index.js +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-data-access-v1.6.4](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.6.3...@adobe/spacecat-shared-data-access-v1.6.4) (2024-01-13)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update external fixes ([#81](https://github.com/adobe/spacecat-shared/issues/81)) ([67cf21c](https://github.com/adobe/spacecat-shared/commit/67cf21c548d036de45221e118ff3bc0e7b26a692))
|
|
7
|
+
|
|
8
|
+
# [@adobe/spacecat-shared-data-access-v1.6.3](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.6.2...@adobe/spacecat-shared-data-access-v1.6.3) (2024-01-12)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* get latest audits with delivery type ([#80](https://github.com/adobe/spacecat-shared/issues/80)) ([d823773](https://github.com/adobe/spacecat-shared/commit/d823773d738ebddf2790356750827ae74e66b052))
|
|
14
|
+
|
|
1
15
|
# [@adobe/spacecat-shared-data-access-v1.6.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.6.1...@adobe/spacecat-shared-data-access-v1.6.2) (2024-01-12)
|
|
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.6.
|
|
3
|
+
"version": "1.6.4",
|
|
4
4
|
"description": "Shared modules of the Spacecat Services - Data Access",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@adobe/spacecat-shared-dynamo": "1.2.5",
|
|
33
33
|
"@adobe/spacecat-shared-utils": "1.2.0",
|
|
34
|
-
"@aws-sdk/client-dynamodb": "3.
|
|
35
|
-
"@aws-sdk/lib-dynamodb": "3.
|
|
34
|
+
"@aws-sdk/client-dynamodb": "3.490.0",
|
|
35
|
+
"@aws-sdk/lib-dynamodb": "3.490.0",
|
|
36
36
|
"uuid": "9.0.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"chai": "4.
|
|
39
|
+
"chai": "4.4.1",
|
|
40
40
|
"chai-as-promised": "7.1.1",
|
|
41
41
|
"dynamo-db-local": "6.1.0",
|
|
42
42
|
"sinon": "17.0.1"
|
package/src/index.d.ts
CHANGED
|
@@ -50,6 +50,10 @@ export const getSites = async (dynamoClient, config) => {
|
|
|
50
50
|
* specified delivery type.
|
|
51
51
|
*/
|
|
52
52
|
export const getSitesByDeliveryType = async (dynamoClient, config, deliveryType) => {
|
|
53
|
+
if (deliveryType === 'all') {
|
|
54
|
+
return getSites(dynamoClient, config);
|
|
55
|
+
}
|
|
56
|
+
|
|
53
57
|
const dynamoItems = await dynamoClient.query({
|
|
54
58
|
TableName: config.tableNameSites,
|
|
55
59
|
IndexName: config.indexNameAllSitesByDeliveryType,
|
|
@@ -87,6 +91,9 @@ export const getSitesToAudit = async (dynamoClient, config) => {
|
|
|
87
91
|
* @param {Logger} log - The logger.
|
|
88
92
|
* @param {string} auditType - The type of audits to retrieve for the sites.
|
|
89
93
|
* @param {boolean} [sortAuditsAscending=true] - Determines if the audits should be sorted in
|
|
94
|
+
* ascending order.
|
|
95
|
+
* @param {string} [deliveryType=DEFAULT_DELIVERY_TYPE] - The delivery type of the sites
|
|
96
|
+
* to retrieve.
|
|
90
97
|
* @return {Promise<Readonly<Site>[]>} A promise that resolves to an array of sites with their
|
|
91
98
|
* latest audit.
|
|
92
99
|
*/
|
|
@@ -96,9 +103,10 @@ export const getSitesWithLatestAudit = async (
|
|
|
96
103
|
log,
|
|
97
104
|
auditType,
|
|
98
105
|
sortAuditsAscending = true,
|
|
106
|
+
deliveryType = 'all',
|
|
99
107
|
) => {
|
|
100
108
|
const [sites, latestAudits] = await Promise.all([
|
|
101
|
-
|
|
109
|
+
getSitesByDeliveryType(dynamoClient, config, deliveryType),
|
|
102
110
|
getLatestAudits(dynamoClient, config, log, auditType, sortAuditsAscending),
|
|
103
111
|
]);
|
|
104
112
|
|
|
@@ -37,12 +37,17 @@ export const siteFunctions = (dynamoClient, config, log) => ({
|
|
|
37
37
|
dynamoClient,
|
|
38
38
|
config,
|
|
39
39
|
),
|
|
40
|
-
getSitesWithLatestAudit: (
|
|
40
|
+
getSitesWithLatestAudit: (
|
|
41
|
+
auditType,
|
|
42
|
+
sortAuditsAscending,
|
|
43
|
+
deliveryType,
|
|
44
|
+
) => getSitesWithLatestAudit(
|
|
41
45
|
dynamoClient,
|
|
42
46
|
config,
|
|
43
47
|
log,
|
|
44
48
|
auditType,
|
|
45
49
|
sortAuditsAscending,
|
|
50
|
+
deliveryType,
|
|
46
51
|
),
|
|
47
52
|
getSiteByBaseURL: (baseUrl) => getSiteByBaseURL(
|
|
48
53
|
dynamoClient,
|