@adobe/mysticat-shared-seo-client 1.2.1 → 1.2.3
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 +12 -0
- package/package.json +1 -1
- package/src/client.js +38 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [@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
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **seo-client:** omit display_date to avoid 5x historical pricing ([#1537](https://github.com/adobe/spacecat-shared/issues/1537)) ([4ffc683](https://github.com/adobe/spacecat-shared/commit/4ffc683db492d10414c2bc5c23804ec42d88b2c5))
|
|
6
|
+
|
|
7
|
+
## [@adobe/mysticat-shared-seo-client-v1.2.2](https://github.com/adobe/spacecat-shared/compare/@adobe/mysticat-shared-seo-client-v1.2.1...@adobe/mysticat-shared-seo-client-v1.2.2) (2026-04-14)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Fix request params for the original results in SEO client ([#1535](https://github.com/adobe/spacecat-shared/issues/1535)) ([b8687cf](https://github.com/adobe/spacecat-shared/commit/b8687cf8d42098ee746df79f1268d729e73f6587))
|
|
12
|
+
|
|
1
13
|
## [@adobe/mysticat-shared-seo-client-v1.2.1](https://github.com/adobe/spacecat-shared/compare/@adobe/mysticat-shared-seo-client-v1.2.0...@adobe/mysticat-shared-seo-client-v1.2.1) (2026-04-10)
|
|
2
14
|
|
|
3
15
|
### Bug Fixes
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -15,7 +15,7 @@ import { context as h2, h1 } from '@adobe/fetch';
|
|
|
15
15
|
|
|
16
16
|
import { ENDPOINTS } from './endpoints.js';
|
|
17
17
|
import {
|
|
18
|
-
parseCsvResponse, coerceValue, getLimit, toApiDate, fromApiDate,
|
|
18
|
+
parseCsvResponse, coerceValue, getLimit, toApiDate, fromApiDate, buildFilter,
|
|
19
19
|
extractBrand, INTENT_CODES,
|
|
20
20
|
} from './utils.js';
|
|
21
21
|
|
|
@@ -344,7 +344,7 @@ export default class SeoClient {
|
|
|
344
344
|
if (typeof opts !== 'object' || opts === null) {
|
|
345
345
|
throw new Error('Second argument must be an options object, not a positional value');
|
|
346
346
|
}
|
|
347
|
-
const { date
|
|
347
|
+
const { date, limit = 200, region } = opts;
|
|
348
348
|
if (!hasText(url)) {
|
|
349
349
|
throw new Error(`Invalid URL: ${url}`);
|
|
350
350
|
}
|
|
@@ -358,15 +358,23 @@ export default class SeoClient {
|
|
|
358
358
|
// Capped at MAX_PAID_KEYWORDS_FETCH to bound cost.
|
|
359
359
|
const fetchLimit = Math.min(effectiveLimit * 10, MAX_PAID_KEYWORDS_FETCH);
|
|
360
360
|
|
|
361
|
-
const dbResults = await this.fanOut(databases, (db) =>
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
361
|
+
const dbResults = await this.fanOut(databases, (db) => {
|
|
362
|
+
const params = {
|
|
363
|
+
type: ep.type,
|
|
364
|
+
domain: url,
|
|
365
|
+
database: db,
|
|
366
|
+
display_limit: fetchLimit,
|
|
367
|
+
export_columns: ep.columns,
|
|
368
|
+
...ep.defaultParams,
|
|
369
|
+
};
|
|
370
|
+
// Omitting display_date returns the provider's latest snapshot at live pricing
|
|
371
|
+
// (5x cheaper). The returned data may differ slightly from a pinned monthly
|
|
372
|
+
// snapshot, which is acceptable for our use case.
|
|
373
|
+
if (date) {
|
|
374
|
+
params.display_date = toApiDate(date);
|
|
375
|
+
}
|
|
376
|
+
return this.sendRawRequest(params, ep.path);
|
|
377
|
+
}, 'getPaidPages');
|
|
370
378
|
|
|
371
379
|
// Group keywords by URL across all databases
|
|
372
380
|
const pageMap = new Map();
|
|
@@ -425,7 +433,7 @@ export default class SeoClient {
|
|
|
425
433
|
if (typeof opts !== 'object' || opts === null) {
|
|
426
434
|
throw new Error('Second argument must be an options object, not a positional value');
|
|
427
435
|
}
|
|
428
|
-
const { date
|
|
436
|
+
const { date, region } = opts;
|
|
429
437
|
if (!hasText(url)) {
|
|
430
438
|
throw new Error(`Invalid URL: ${url}`);
|
|
431
439
|
}
|
|
@@ -433,14 +441,22 @@ export default class SeoClient {
|
|
|
433
441
|
const ep = ENDPOINTS.metrics;
|
|
434
442
|
const databases = getDatabases(region);
|
|
435
443
|
|
|
436
|
-
const dbResults = await this.fanOut(databases, (db) =>
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
+
const dbResults = await this.fanOut(databases, (db) => {
|
|
445
|
+
const params = {
|
|
446
|
+
type: ep.type,
|
|
447
|
+
domain: url,
|
|
448
|
+
database: db,
|
|
449
|
+
export_columns: ep.columns,
|
|
450
|
+
...ep.defaultParams,
|
|
451
|
+
};
|
|
452
|
+
// Omitting display_date returns the provider's latest snapshot at live pricing
|
|
453
|
+
// (5x cheaper). The returned data may differ slightly from a pinned monthly
|
|
454
|
+
// snapshot, which is acceptable for our use case.
|
|
455
|
+
if (date) {
|
|
456
|
+
params.display_date = toApiDate(date);
|
|
457
|
+
}
|
|
458
|
+
return this.sendRawRequest(params, ep.path);
|
|
459
|
+
}, 'getMetrics');
|
|
444
460
|
|
|
445
461
|
const metrics = {
|
|
446
462
|
org_keywords: 0,
|
|
@@ -704,7 +720,7 @@ export default class SeoClient {
|
|
|
704
720
|
const { body: pagesBody, fullAuditRef } = await this.sendRawRequest({
|
|
705
721
|
type: epPages.type,
|
|
706
722
|
target: url,
|
|
707
|
-
target_type: '
|
|
723
|
+
target_type: 'domain',
|
|
708
724
|
export_columns: epPages.columns,
|
|
709
725
|
display_limit: effectiveLimit,
|
|
710
726
|
display_filter: buildFilter([{
|
|
@@ -758,7 +774,7 @@ export default class SeoClient {
|
|
|
758
774
|
}
|
|
759
775
|
|
|
760
776
|
// eslint-disable-next-line no-unused-vars, class-methods-use-this
|
|
761
|
-
async getMetricsByCountry(url, date
|
|
777
|
+
async getMetricsByCountry(url, date) {
|
|
762
778
|
return STUB_RESPONSE;
|
|
763
779
|
}
|
|
764
780
|
}
|