@adobe/spacecat-shared-data-access 1.29.2 → 1.30.0
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 +7 -0
- package/package.json +1 -1
- package/src/dto/site-top-page.js +5 -1
- package/src/index.d.ts +6 -0
- package/src/models/site-top-page.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-data-access-v1.30.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.29.2...@adobe/spacecat-shared-data-access-v1.30.0) (2024-06-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* introduce organic keywords for ahrefs client and top keyword in top pages ([#257](https://github.com/adobe/spacecat-shared/issues/257)) ([371f1c4](https://github.com/adobe/spacecat-shared/commit/371f1c475870fd2aac833f925236237a8b25c026))
|
|
7
|
+
|
|
1
8
|
# [@adobe/spacecat-shared-data-access-v1.29.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.29.1...@adobe/spacecat-shared-data-access-v1.29.2) (2024-06-18)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/dto/site-top-page.js
CHANGED
|
@@ -26,6 +26,7 @@ export const SiteTopPageDto = {
|
|
|
26
26
|
siteId: siteTopPage.getSiteId(),
|
|
27
27
|
url: siteTopPage.getURL(),
|
|
28
28
|
traffic: siteTopPage.getTraffic(),
|
|
29
|
+
topKeyword: siteTopPage.getTopKeyword(),
|
|
29
30
|
source: siteTopPage.getSource(),
|
|
30
31
|
geo: siteTopPage.getGeo(),
|
|
31
32
|
importedAt: siteTopPage.getImportedAt(),
|
|
@@ -34,13 +35,16 @@ export const SiteTopPageDto = {
|
|
|
34
35
|
|
|
35
36
|
/**
|
|
36
37
|
* Converts a DynamoDB item into a SiteTopPage object.
|
|
37
|
-
* @param {
|
|
38
|
+
* @param {
|
|
39
|
+
* {siteId, url, traffic, topKeyword, source, geo, importedAt, SK: string}
|
|
40
|
+
* } item - DynamoDB item.
|
|
38
41
|
* @returns {SiteTopPage}
|
|
39
42
|
*/
|
|
40
43
|
fromDynamoItem: (item) => createSiteTopPage({
|
|
41
44
|
siteId: item.siteId,
|
|
42
45
|
url: item.url,
|
|
43
46
|
traffic: item.traffic,
|
|
47
|
+
topKeyword: item.topKeyword,
|
|
44
48
|
source: item.source,
|
|
45
49
|
geo: item.geo,
|
|
46
50
|
importedAt: item.importedAt,
|
package/src/index.d.ts
CHANGED
|
@@ -347,6 +347,12 @@ export interface SiteTopPage {
|
|
|
347
347
|
*/
|
|
348
348
|
getTraffic: () => number;
|
|
349
349
|
|
|
350
|
+
/**
|
|
351
|
+
* Retrieves the keyword that brings the most organic traffic to the page.
|
|
352
|
+
* @returns {string} The keyword.
|
|
353
|
+
*/
|
|
354
|
+
getTopKeyword: () => string;
|
|
355
|
+
|
|
350
356
|
/**
|
|
351
357
|
* Retrieves the source of the site top page.
|
|
352
358
|
* @returns {string} The source.
|
|
@@ -23,6 +23,7 @@ const SiteTopPage = (data = {}) => {
|
|
|
23
23
|
self.getSiteId = () => self.state.siteId;
|
|
24
24
|
self.getURL = () => self.state.url;
|
|
25
25
|
self.getTraffic = () => self.state.traffic;
|
|
26
|
+
self.getTopKeyword = () => self.state.topKeyword;
|
|
26
27
|
self.getSource = () => self.state.source.toLowerCase();
|
|
27
28
|
self.getGeo = () => self.state.geo;
|
|
28
29
|
self.getImportedAt = () => self.state.importedAt;
|