@nuxtseo/protocol 0.1.4 → 0.2.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/dist/v1/account.d.ts +708 -0
- package/dist/v1/account.js +120 -1
- package/dist/v1/actions.d.ts +348 -0
- package/dist/v1/actions.js +76 -0
- package/dist/v1/audit.d.ts +32 -0
- package/dist/v1/audit.js +8 -0
- package/dist/v1/backlinks.d.ts +2838 -199
- package/dist/v1/backlinks.js +417 -8
- package/dist/v1/core.d.ts +18 -1
- package/dist/v1/core.js +28 -0
- package/dist/v1/gsc.d.ts +2793 -1421
- package/dist/v1/gsc.js +233 -14
- package/dist/v1/pages.d.ts +1085 -0
- package/dist/v1/pages.js +241 -2
- package/dist/v1/performance.d.ts +3868 -245
- package/dist/v1/performance.js +643 -1
- package/dist/v1/research.d.ts +1803 -489
- package/dist/v1/research.js +173 -0
- package/dist/v1/sites.d.ts +1025 -0
- package/dist/v1/sites.js +230 -0
- package/dist/v1/timeline.d.ts +1540 -70
- package/dist/v1/timeline.js +244 -0
- package/generated/openapi.v1.json +1 -1
- package/package.json +4 -4
package/dist/v1/research.js
CHANGED
|
@@ -491,6 +491,177 @@ export const rankingsResearchOperation = defineOperation({
|
|
|
491
491
|
}],
|
|
492
492
|
},
|
|
493
493
|
});
|
|
494
|
+
// ---------------------------------------------------------------------------
|
|
495
|
+
// Domain lookups — the `domain_info` MCP tool. These read arbitrary third-party
|
|
496
|
+
// domains, so they carry the same Growth entitlement and DataForSEO meter as
|
|
497
|
+
// the other live research operations, and the Site in the path is the billing
|
|
498
|
+
// and authorization anchor rather than the subject.
|
|
499
|
+
// ---------------------------------------------------------------------------
|
|
500
|
+
/**
|
|
501
|
+
* One domain, never a list packed into one value. A comma is not legal in a
|
|
502
|
+
* hostname, so `?domains=a.com,b.com` can only be a caller who guessed the
|
|
503
|
+
* wrong list syntax. Accepting it verbatim handed `cleanDomain` a string it
|
|
504
|
+
* takes without complaint, and the caller got `results: []` and no error.
|
|
505
|
+
* Repeating the parameter is the only list form, and this rejects the other
|
|
506
|
+
* one loudly — the same way `metrics` on `page.vitals.findings` already does,
|
|
507
|
+
* because its members are an enum.
|
|
508
|
+
*/
|
|
509
|
+
const domainNameSchema = schema.string().trim().min(1).max(253).refine(value => !value.includes(','), { message: 'one domain per value; repeat the parameter for more than one' });
|
|
510
|
+
export const domainTrafficQuerySchema = schema.strictObject({
|
|
511
|
+
domain: domainNameSchema,
|
|
512
|
+
});
|
|
513
|
+
export const domainAvailabilityQuerySchema = schema.strictObject({
|
|
514
|
+
domains: schema.union([
|
|
515
|
+
schema.array(domainNameSchema).min(1).max(10),
|
|
516
|
+
domainNameSchema.transform(one => [one]),
|
|
517
|
+
]),
|
|
518
|
+
});
|
|
519
|
+
export const domainTrafficPageSchema = defineResponseObject({
|
|
520
|
+
path: schema.string(),
|
|
521
|
+
traffic: schema.number(),
|
|
522
|
+
keywords: schema.number(),
|
|
523
|
+
}, {
|
|
524
|
+
path: schema.string(),
|
|
525
|
+
traffic: schema.number(),
|
|
526
|
+
keywords: schema.number(),
|
|
527
|
+
});
|
|
528
|
+
export const domainTrafficDataSchema = defineResponseObject({
|
|
529
|
+
domain: schema.string(),
|
|
530
|
+
monthlyTraffic: schema.number(),
|
|
531
|
+
trend: schema.enum(['growing', 'stable', 'declining']),
|
|
532
|
+
changePercent: schema.number(),
|
|
533
|
+
trafficValue: schema.number().nullable(),
|
|
534
|
+
keywordFootprint: schema.number().nullable(),
|
|
535
|
+
topPages: schema.array(domainTrafficPageSchema.producer),
|
|
536
|
+
topCountries: schema.array(schema.strictObject({
|
|
537
|
+
country: schema.string(),
|
|
538
|
+
percent: schema.number(),
|
|
539
|
+
})),
|
|
540
|
+
message: schema.string().nullable(),
|
|
541
|
+
evidence: keywordResearchEvidenceProducerSchema,
|
|
542
|
+
}, {
|
|
543
|
+
domain: schema.string(),
|
|
544
|
+
monthlyTraffic: schema.number(),
|
|
545
|
+
trend: schema.enum(['growing', 'stable', 'declining']),
|
|
546
|
+
changePercent: schema.number(),
|
|
547
|
+
trafficValue: schema.number().nullable(),
|
|
548
|
+
keywordFootprint: schema.number().nullable(),
|
|
549
|
+
topPages: schema.array(domainTrafficPageSchema.client),
|
|
550
|
+
topCountries: schema.array(schema.looseObject({
|
|
551
|
+
country: schema.string(),
|
|
552
|
+
percent: schema.number(),
|
|
553
|
+
})),
|
|
554
|
+
message: schema.string().nullable(),
|
|
555
|
+
evidence: keywordResearchEvidenceClientSchema,
|
|
556
|
+
});
|
|
557
|
+
export const domainTrafficResponseSchema = defineSuccessEnvelope(domainTrafficDataSchema);
|
|
558
|
+
export const domainTrafficOperation = defineOperation({
|
|
559
|
+
id: 'research.domain.traffic',
|
|
560
|
+
method: 'GET',
|
|
561
|
+
path: '/api/v1/sites/{siteId}/research/domain-traffic',
|
|
562
|
+
visibility: 'public',
|
|
563
|
+
semantics: liveResearchSemantics,
|
|
564
|
+
auth: liveResearchAuth,
|
|
565
|
+
request: { params: researchSiteParamsSchema, query: domainTrafficQuerySchema, headers: null, body: null },
|
|
566
|
+
responses: { 200: domainTrafficResponseSchema },
|
|
567
|
+
errors: liveResearchErrors,
|
|
568
|
+
errorResponse: publicV1ErrorEnvelope,
|
|
569
|
+
resources: { reads: [{ type: 'site.research', idFrom: 'params.siteId' }], changes: [] },
|
|
570
|
+
policy: liveResearchPolicy,
|
|
571
|
+
lifecycle: { introduced: '1.2.0' },
|
|
572
|
+
docs: {
|
|
573
|
+
summary: 'Estimate domain traffic',
|
|
574
|
+
description: 'Returns an estimate of one domain organic search traffic, its trend, its top pages and countries. The domain does not have to be one of your Sites, so this reads a competitor as readily as your own. Cached reads consume no units.',
|
|
575
|
+
tags: ['Research'],
|
|
576
|
+
examples: [{
|
|
577
|
+
request: { params: { siteId: 'site_01JXYZ' }, query: { domain: 'nuxtseo.com' } },
|
|
578
|
+
response: {
|
|
579
|
+
status: 200,
|
|
580
|
+
body: {
|
|
581
|
+
data: {
|
|
582
|
+
domain: 'nuxtseo.com',
|
|
583
|
+
monthlyTraffic: 48200,
|
|
584
|
+
trend: 'growing',
|
|
585
|
+
changePercent: 12.4,
|
|
586
|
+
trafficValue: 31200,
|
|
587
|
+
keywordFootprint: 62,
|
|
588
|
+
topPages: [{ path: '/docs/sitemap', traffic: 4100, keywords: 220 }],
|
|
589
|
+
topCountries: [{ country: 'US', percent: 41.2 }],
|
|
590
|
+
message: null,
|
|
591
|
+
evidence: { _tag: 'live', provider: 'dataforseo', spend: { key: 'dataforseo', units: 1 } },
|
|
592
|
+
},
|
|
593
|
+
meta: { requestId: 'req_01JXYZ', version: '1.0' },
|
|
594
|
+
},
|
|
595
|
+
},
|
|
596
|
+
}],
|
|
597
|
+
},
|
|
598
|
+
});
|
|
599
|
+
export const domainStatusSchema = defineResponseObject({
|
|
600
|
+
domain: schema.string(),
|
|
601
|
+
available: schema.boolean(),
|
|
602
|
+
registrar: schema.string().nullable(),
|
|
603
|
+
expiration: schema.string().nullable(),
|
|
604
|
+
created: schema.string().nullable(),
|
|
605
|
+
note: schema.string().nullable(),
|
|
606
|
+
}, {
|
|
607
|
+
domain: schema.string(),
|
|
608
|
+
available: schema.boolean(),
|
|
609
|
+
registrar: schema.string().nullable(),
|
|
610
|
+
expiration: schema.string().nullable(),
|
|
611
|
+
created: schema.string().nullable(),
|
|
612
|
+
note: schema.string().nullable(),
|
|
613
|
+
});
|
|
614
|
+
export const domainAvailabilityDataSchema = defineResponseObject({
|
|
615
|
+
results: schema.array(domainStatusSchema.producer),
|
|
616
|
+
message: schema.string().nullable(),
|
|
617
|
+
evidence: keywordResearchEvidenceProducerSchema,
|
|
618
|
+
}, {
|
|
619
|
+
results: schema.array(domainStatusSchema.client),
|
|
620
|
+
message: schema.string().nullable(),
|
|
621
|
+
evidence: keywordResearchEvidenceClientSchema,
|
|
622
|
+
});
|
|
623
|
+
export const domainAvailabilityResponseSchema = defineSuccessEnvelope(domainAvailabilityDataSchema);
|
|
624
|
+
export const domainAvailabilityOperation = defineOperation({
|
|
625
|
+
id: 'research.domain.availability',
|
|
626
|
+
method: 'GET',
|
|
627
|
+
path: '/api/v1/sites/{siteId}/research/domain-availability',
|
|
628
|
+
visibility: 'public',
|
|
629
|
+
semantics: liveResearchSemantics,
|
|
630
|
+
auth: liveResearchAuth,
|
|
631
|
+
request: { params: researchSiteParamsSchema, query: domainAvailabilityQuerySchema, headers: null, body: null },
|
|
632
|
+
responses: { 200: domainAvailabilityResponseSchema },
|
|
633
|
+
errors: liveResearchErrors,
|
|
634
|
+
errorResponse: publicV1ErrorEnvelope,
|
|
635
|
+
resources: { reads: [{ type: 'site.research', idFrom: 'params.siteId' }], changes: [] },
|
|
636
|
+
policy: liveResearchPolicy,
|
|
637
|
+
lifecycle: { introduced: '1.2.0' },
|
|
638
|
+
docs: {
|
|
639
|
+
summary: 'Check domain availability',
|
|
640
|
+
description: 'Returns the registration status of up to ten domains, with the registrar and expiry when the domain is taken. Repeat the domains parameter for each domain. Cached reads consume no units.',
|
|
641
|
+
tags: ['Research'],
|
|
642
|
+
examples: [{
|
|
643
|
+
request: { params: { siteId: 'site_01JXYZ' }, query: { domains: ['example.com', 'example.dev'] } },
|
|
644
|
+
response: {
|
|
645
|
+
status: 200,
|
|
646
|
+
body: {
|
|
647
|
+
data: {
|
|
648
|
+
results: [{
|
|
649
|
+
domain: 'example.com',
|
|
650
|
+
available: false,
|
|
651
|
+
registrar: 'Example Registrar',
|
|
652
|
+
expiration: '2027-04-01',
|
|
653
|
+
created: '1995-08-14',
|
|
654
|
+
note: null,
|
|
655
|
+
}],
|
|
656
|
+
message: null,
|
|
657
|
+
evidence: { _tag: 'live', provider: 'dataforseo', spend: { key: 'dataforseo', units: 1 } },
|
|
658
|
+
},
|
|
659
|
+
meta: { requestId: 'req_01JXYZ', version: '1.0' },
|
|
660
|
+
},
|
|
661
|
+
},
|
|
662
|
+
}],
|
|
663
|
+
},
|
|
664
|
+
});
|
|
494
665
|
export const researchV1Registry = defineRegistry({
|
|
495
666
|
feature: 'research',
|
|
496
667
|
operations: {
|
|
@@ -498,5 +669,7 @@ export const researchV1Registry = defineRegistry({
|
|
|
498
669
|
keywords: keywordResearchOperation,
|
|
499
670
|
serp: serpResearchOperation,
|
|
500
671
|
rankings: rankingsResearchOperation,
|
|
672
|
+
domainTraffic: domainTrafficOperation,
|
|
673
|
+
domainAvailability: domainAvailabilityOperation,
|
|
501
674
|
},
|
|
502
675
|
});
|