@adobe/mysticat-shared-seo-client 1.2.3 → 1.3.1

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,15 @@
1
+ ## [@adobe/mysticat-shared-seo-client-v1.3.1](https://github.com/adobe/spacecat-shared/compare/@adobe/mysticat-shared-seo-client-v1.3.0...@adobe/mysticat-shared-seo-client-v1.3.1) (2026-05-14)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **deps:** update external fixes ([#1533](https://github.com/adobe/spacecat-shared/issues/1533)) ([0a3e2ab](https://github.com/adobe/spacecat-shared/commit/0a3e2abbbc5f58b5320518f7d596d4cef6271fa0))
6
+
7
+ ## [@adobe/mysticat-shared-seo-client-v1.3.0](https://github.com/adobe/spacecat-shared/compare/@adobe/mysticat-shared-seo-client-v1.2.3...@adobe/mysticat-shared-seo-client-v1.3.0) (2026-04-28)
8
+
9
+ ### Features
10
+
11
+ * **seo-client:** return keywords[] array from getPaidPages() ([#1564](https://github.com/adobe/spacecat-shared/issues/1564)) ([71be968](https://github.com/adobe/spacecat-shared/commit/71be968ac133fc3c0d547d70e9663fcf2fe90437))
12
+
1
13
  ## [@adobe/mysticat-shared-seo-client-v1.2.3](https://github.com/adobe/spacecat-shared/compare/@adobe/mysticat-shared-seo-client-v1.2.2...@adobe/mysticat-shared-seo-client-v1.2.3) (2026-04-15)
2
14
 
3
15
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/mysticat-shared-seo-client",
3
- "version": "1.2.3",
3
+ "version": "1.3.1",
4
4
  "description": "Shared modules of the SpaceCat Services - SEO Client",
5
5
  "type": "module",
6
6
  "engines": {
@@ -42,9 +42,9 @@
42
42
  "devDependencies": {
43
43
  "chai": "6.2.2",
44
44
  "chai-as-promised": "8.0.2",
45
- "nock": "14.0.11",
46
- "sinon": "21.0.3",
45
+ "nock": "14.0.15",
46
+ "sinon": "21.1.2",
47
47
  "sinon-chai": "4.0.1",
48
- "typescript": "6.0.2"
48
+ "typescript": "6.0.3"
49
49
  }
50
50
  }
package/src/client.js CHANGED
@@ -340,6 +340,23 @@ export default class SeoClient {
340
340
  };
341
341
  }
342
342
 
343
+ /**
344
+ * Fetch paid (PPC) pages and their keyword data from Semrush.
345
+ *
346
+ * Per-keyword CPC is returned as float dollars (e.g., 3.95) with null for unknown.
347
+ * This deliberately differs from getOrganicKeywords() which returns CPC as integer
348
+ * cents (e.g., 395) with 0 for unknown. The float-dollars convention was chosen for
349
+ * the keywords[] array because downstream consumers (import-worker, Mystique) expect
350
+ * dollars and the per-keyword CPC should not go through the cents round-trip used by
351
+ * the aggregate `value` field.
352
+ *
353
+ * @param {string} url - Domain to query
354
+ * @param {Object} [opts] - Options
355
+ * @param {string} [opts.date] - Report date
356
+ * @param {number} [opts.limit=200] - Max pages to return
357
+ * @param {string} [opts.region] - Limit to specific region
358
+ * @returns {Promise<{result: {pages: Array}, fullAuditRef: string}>}
359
+ */
343
360
  async getPaidPages(url, opts = {}) {
344
361
  if (typeof opts !== 'object' || opts === null) {
345
362
  throw new Error('Second argument must be an options object, not a positional value');
@@ -420,6 +437,15 @@ export default class SeoClient {
420
437
  ),
421
438
  0,
422
439
  ),
440
+ keywords: page.keywords.map((kw) => ({
441
+ keyword: kw.Ph,
442
+ traffic: kw.kwTraffic,
443
+ cpc: coerceValue(kw.Cp, 'float') ?? null,
444
+ serp_title: kw.Tt || null,
445
+ position: coerceValue(kw.Po, 'int') ?? null,
446
+ volume: coerceValue(kw.Nq, 'int') ?? null,
447
+ country: kw.db.toUpperCase(),
448
+ })),
423
449
  };
424
450
  });
425
451