@adobe/spacecat-shared-data-access 1.2.0 → 1.2.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 +14 -0
- package/package.json +1 -1
- package/src/models/site.js +25 -0
- package/src/service/audits/index.js +9 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-data-access-v1.2.2](https://github.com/adobe-rnd/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.2.1...@adobe/spacecat-shared-data-access-v1.2.2) (2023-12-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* allow update of github URL ([#40](https://github.com/adobe-rnd/spacecat-shared/issues/40)) ([21da989](https://github.com/adobe-rnd/spacecat-shared/commit/21da9893fcb9c971c1c6a4e1271133188351c155))
|
|
7
|
+
|
|
8
|
+
# [@adobe/spacecat-shared-data-access-v1.2.1](https://github.com/adobe-rnd/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.2.0...@adobe/spacecat-shared-data-access-v1.2.1) (2023-12-07)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* export getLatestAuditsForSite ([#39](https://github.com/adobe-rnd/spacecat-shared/issues/39)) ([e9c9130](https://github.com/adobe-rnd/spacecat-shared/commit/e9c9130b940122714be76e3df6e96e44bbde5348))
|
|
14
|
+
|
|
1
15
|
# [@adobe/spacecat-shared-data-access-v1.2.0](https://github.com/adobe-rnd/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.1.6...@adobe/spacecat-shared-data-access-v1.2.0) (2023-12-05)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
package/src/models/site.js
CHANGED
|
@@ -65,6 +65,27 @@ const Site = (data = {}) => {
|
|
|
65
65
|
return self;
|
|
66
66
|
}; */
|
|
67
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Updates the GitHub URL belonging to the site.
|
|
70
|
+
* @param {string} gitHubURL - The GitHub URL.
|
|
71
|
+
* @return {Base} The updated site.
|
|
72
|
+
*/
|
|
73
|
+
self.updateGitHubURL = (gitHubURL) => {
|
|
74
|
+
if (!isValidUrl(gitHubURL)) {
|
|
75
|
+
throw new Error('GitHub URL must be a valid URL');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
self.state.gitHubURL = gitHubURL;
|
|
79
|
+
self.touch();
|
|
80
|
+
|
|
81
|
+
return self;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Updates the IMS Org ID belonging to the site.
|
|
86
|
+
* @param {string} imsOrgId - The IMS Org ID.
|
|
87
|
+
* @return {Base} The updated site.
|
|
88
|
+
*/
|
|
68
89
|
self.updateImsOrgId = (imsOrgId) => {
|
|
69
90
|
if (!hasText(imsOrgId)) {
|
|
70
91
|
throw new Error('IMS Org ID must be provided');
|
|
@@ -81,6 +102,10 @@ const Site = (data = {}) => {
|
|
|
81
102
|
return self;
|
|
82
103
|
};
|
|
83
104
|
|
|
105
|
+
/**
|
|
106
|
+
* Sets whether the site is live.
|
|
107
|
+
* @return {Base} The updated site.
|
|
108
|
+
*/
|
|
84
109
|
self.toggleLive = () => {
|
|
85
110
|
self.state.isLive = !self.state.isLive;
|
|
86
111
|
return self;
|
|
@@ -11,10 +11,12 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import {
|
|
14
|
-
addAudit,
|
|
14
|
+
addAudit,
|
|
15
|
+
getAuditForSite,
|
|
15
16
|
getAuditsForSite,
|
|
16
17
|
getLatestAuditForSite,
|
|
17
18
|
getLatestAudits,
|
|
19
|
+
getLatestAuditsForSite,
|
|
18
20
|
removeAuditsForSite,
|
|
19
21
|
} from './accessPatterns.js';
|
|
20
22
|
|
|
@@ -48,6 +50,12 @@ export const auditFunctions = (dynamoClient, config, log) => ({
|
|
|
48
50
|
siteId,
|
|
49
51
|
auditType,
|
|
50
52
|
),
|
|
53
|
+
getLatestAuditsForSite: (siteId) => getLatestAuditsForSite(
|
|
54
|
+
dynamoClient,
|
|
55
|
+
config,
|
|
56
|
+
log,
|
|
57
|
+
siteId,
|
|
58
|
+
),
|
|
51
59
|
addAudit: (auditData) => addAudit(
|
|
52
60
|
dynamoClient,
|
|
53
61
|
config,
|