@adobe/spacecat-shared-ahrefs-client 1.10.3 → 1.10.5

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.10.5](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-ahrefs-client-v1.10.4...@adobe/spacecat-shared-ahrefs-client-v1.10.5) (2026-01-29)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update dependency @adobe/helix-universal to v5.4.0 ([#1295](https://github.com/adobe/spacecat-shared/issues/1295)) ([5c1595b](https://github.com/adobe/spacecat-shared/commit/5c1595bd7cba9b7053da867b8f46e302f8683eba))
7
+
8
+ # [@adobe/spacecat-shared-ahrefs-client-v1.10.4](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-ahrefs-client-v1.10.3...@adobe/spacecat-shared-ahrefs-client-v1.10.4) (2026-01-20)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * getPaidPages was missing parameter mode ([#1271](https://github.com/adobe/spacecat-shared/issues/1271)) ([09e597f](https://github.com/adobe/spacecat-shared/commit/09e597ff7ede8f9c9752dc1b35cd81539a48019a))
14
+
1
15
  # [@adobe/spacecat-shared-ahrefs-client-v1.10.3](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-ahrefs-client-v1.10.2...@adobe/spacecat-shared-ahrefs-client-v1.10.3) (2025-11-28)
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.10.3",
3
+ "version": "1.10.5",
4
4
  "description": "Shared modules of the Spacecat Services - Ahrefs Client",
5
5
  "type": "module",
6
6
  "engines": {
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@adobe/fetch": "4.2.3",
38
- "@adobe/helix-universal": "5.3.0",
38
+ "@adobe/helix-universal": "5.4.0",
39
39
  "@adobe/spacecat-shared-utils": "1.81.1"
40
40
  },
41
41
  "devDependencies": {
package/src/index.d.ts CHANGED
@@ -90,8 +90,9 @@ export default class AhrefsAPIClient {
90
90
  * @param url - The target URL
91
91
  * @param date - Optional date in YYYY-MM-DD format, defaults to today
92
92
  * @param limit - Maximum number of results to return (max: 1000)
93
+ * @param mode - Search mode: 'exact' for exact domain match, 'prefix' for domain and all subpages (default: 'prefix')
93
94
  */
94
- getPaidPages(url: string, date?: string, limit?: number):
95
+ getPaidPages(url: string, date?: string, limit?: number, mode?: 'exact' | 'prefix' | 'domain' | 'subdomains'):
95
96
  Promise<{ result: object, fullAuditRef: string }>;
96
97
 
97
98
  /**
package/src/index.js CHANGED
@@ -277,6 +277,8 @@ export default class AhrefsAPIClient {
277
277
  * @param {string} [date] - The date for the analysis in YYYY-MM-DD format.
278
278
  * Defaults to today's date.
279
279
  * @param {number} [limit=200] - Maximum number of results to return (max: 1000)
280
+ * @param {string} [mode='prefix'] - Search mode: 'exact' for exact domain match,
281
+ * 'prefix' for domain and all subpages
280
282
  * @returns {Promise<{result: Object, fullAuditRef: string}>} Response object containing:
281
283
  * - result.pages: Array of paid page objects with properties:
282
284
  * - url: The page URL
@@ -291,10 +293,14 @@ export default class AhrefsAPIClient {
291
293
  * - value: The estimated cost of a page's monthly paid search traffic, in USD cents.
292
294
  * - fullAuditRef: Full URL of the API request for reference
293
295
  * @example
294
- * const result = await client.getPaidPages('example.com', '2025-11-10', 50);
296
+ * // Using defaults (today's date, limit 200, prefix mode)
297
+ * const result = await client.getPaidPages('example.com');
298
+ *
299
+ * // With custom parameters
300
+ * const result = await client.getPaidPages('example.com', '2025-11-10', 50, 'exact');
295
301
  * console.log(result.result.pages); // Array of paid pages
296
302
  */
297
- async getPaidPages(url, date = new Date().toISOString().split('T')[0], limit = 200) {
303
+ async getPaidPages(url, date = new Date().toISOString().split('T')[0], limit = 200, mode = 'prefix') {
298
304
  const queryParams = {
299
305
  target: url,
300
306
  date,
@@ -309,6 +315,7 @@ export default class AhrefsAPIClient {
309
315
  ].join(','),
310
316
  order_by: 'sum_traffic:desc',
311
317
  limit: getLimit(limit, 1000),
318
+ mode,
312
319
  output: 'json',
313
320
  };
314
321