@adobe/spacecat-shared-ahrefs-client 1.7.0 → 1.8.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 CHANGED
@@ -1,3 +1,17 @@
1
+ # [@adobe/spacecat-shared-ahrefs-client-v1.8.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-ahrefs-client-v1.7.1...@adobe/spacecat-shared-ahrefs-client-v1.8.0) (2025-06-02)
2
+
3
+
4
+ ### Features
5
+
6
+ * more fields from ahref for organic keywords ([#780](https://github.com/adobe/spacecat-shared/issues/780)) ([fd1bc34](https://github.com/adobe/spacecat-shared/commit/fd1bc3424def73bb944928d445bdf7f9df1fe933))
7
+
8
+ # [@adobe/spacecat-shared-ahrefs-client-v1.7.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-ahrefs-client-v1.7.0...@adobe/spacecat-shared-ahrefs-client-v1.7.1) (2025-05-31)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update external fixes ([#779](https://github.com/adobe/spacecat-shared/issues/779)) ([07f8cce](https://github.com/adobe/spacecat-shared/commit/07f8cce73e33bfb9c61fe14f2ef28012b872437d))
14
+
1
15
  # [@adobe/spacecat-shared-ahrefs-client-v1.7.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-ahrefs-client-v1.6.21...@adobe/spacecat-shared-ahrefs-client-v1.7.0) (2025-05-26)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-ahrefs-client",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "Shared modules of the Spacecat Services - Ahrefs Client",
5
5
  "type": "module",
6
6
  "engines": {
@@ -41,7 +41,7 @@
41
41
  "devDependencies": {
42
42
  "chai": "5.2.0",
43
43
  "chai-as-promised": "8.0.1",
44
- "nock": "14.0.4",
44
+ "nock": "14.0.5",
45
45
  "sinon": "20.0.0",
46
46
  "sinon-chai": "4.0.0",
47
47
  "typescript": "5.8.3"
package/src/index.js CHANGED
@@ -20,6 +20,21 @@ export const { fetch } = process.env.HELIX_FETCH_FORCE_HTTP1
20
20
 
21
21
  const getLimit = (limit, upperLimit) => Math.min(limit, upperLimit);
22
22
 
23
+ export const ORGANIC_KEYWORDS_FIELDS = /** @type {const} */ ([
24
+ 'keyword',
25
+ 'sum_traffic',
26
+ 'volume',
27
+ 'best_position',
28
+ 'cpc',
29
+ 'last_update',
30
+ 'is_branded',
31
+ 'is_navigational',
32
+ 'is_informational',
33
+ 'is_commercial',
34
+ 'is_transactional',
35
+ 'serp_features_merged',
36
+ ]);
37
+
23
38
  export default class AhrefsAPIClient {
24
39
  static createFrom(context) {
25
40
  const { AHREFS_API_BASE_URL: apiBaseUrl, AHREFS_API_KEY: apiKey } = context.env;
@@ -207,14 +222,7 @@ export default class AhrefsAPIClient {
207
222
  const queryParams = {
208
223
  country,
209
224
  date: new Date().toISOString().split('T')[0],
210
- select: [
211
- 'keyword',
212
- 'sum_traffic',
213
- 'volume',
214
- 'best_position',
215
- 'cpc',
216
- 'is_branded',
217
- ].join(','),
225
+ select: ORGANIC_KEYWORDS_FIELDS.join(','),
218
226
  order_by: 'sum_traffic:desc',
219
227
  target: url,
220
228
  limit: getLimit(limit, 100),