@nuxtseo/protocol 0.1.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/analytics-codecs/analytics-row.d.ts +265 -0
- package/dist/analytics-codecs/analytics-row.js +175 -0
- package/dist/analytics-codecs/analytics-web-vitals.d.ts +57 -0
- package/dist/analytics-codecs/analytics-web-vitals.js +76 -0
- package/dist/analytics-codecs/capabilities.d.ts +35 -0
- package/dist/analytics-codecs/capabilities.js +76 -0
- package/dist/analytics-codecs/index.d.ts +3 -0
- package/dist/analytics-codecs/index.js +3 -0
- package/dist/cli-pairing.d.ts +67 -0
- package/dist/cli-pairing.js +52 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/v1/account.d.ts +715 -0
- package/dist/v1/account.js +123 -0
- package/dist/v1/actions.d.ts +2591 -0
- package/dist/v1/actions.js +460 -0
- package/dist/v1/analytics.d.ts +6145 -0
- package/dist/v1/analytics.js +296 -0
- package/dist/v1/audit.d.ts +4053 -0
- package/dist/v1/audit.js +609 -0
- package/dist/v1/backlinks.d.ts +1002 -0
- package/dist/v1/backlinks.js +239 -0
- package/dist/v1/content.d.ts +2745 -0
- package/dist/v1/content.js +326 -0
- package/dist/v1/core.d.ts +301 -0
- package/dist/v1/core.js +333 -0
- package/dist/v1/documents.d.ts +4 -0
- package/dist/v1/documents.js +216 -0
- package/dist/v1/gsc.d.ts +5172 -0
- package/dist/v1/gsc.js +583 -0
- package/dist/v1/index.d.ts +49 -0
- package/dist/v1/index.js +52 -0
- package/dist/v1/pages.d.ts +1404 -0
- package/dist/v1/pages.js +287 -0
- package/dist/v1/performance.d.ts +1379 -0
- package/dist/v1/performance.js +198 -0
- package/dist/v1/research.d.ts +1173 -0
- package/dist/v1/research.js +174 -0
- package/dist/v1/sitemaps.d.ts +1506 -0
- package/dist/v1/sitemaps.js +199 -0
- package/dist/v1/sites.d.ts +591 -0
- package/dist/v1/sites.js +101 -0
- package/generated/openapi.v1.json +1 -0
- package/package.json +131 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { z as schema } from 'zod';
|
|
2
|
+
import { defineOperation, defineRegistry, defineResponseObject, defineSuccessEnvelope, publicV1ErrorEnvelope, publicV1StandardRatePolicy, } from './core.js';
|
|
3
|
+
export const researchSiteParamsSchema = schema.strictObject({
|
|
4
|
+
siteId: schema.string().min(1),
|
|
5
|
+
});
|
|
6
|
+
export const researchMetricsSchema = defineResponseObject({
|
|
7
|
+
organicTraffic: schema.number().nullable(),
|
|
8
|
+
totalKeywords: schema.number().nullable(),
|
|
9
|
+
keywordFootprint: schema.number().nullable(),
|
|
10
|
+
trafficValue: schema.number().nullable(),
|
|
11
|
+
}, {
|
|
12
|
+
organicTraffic: schema.number().nullable(),
|
|
13
|
+
totalKeywords: schema.number().nullable(),
|
|
14
|
+
keywordFootprint: schema.number().nullable(),
|
|
15
|
+
trafficValue: schema.number().nullable(),
|
|
16
|
+
});
|
|
17
|
+
export const researchRankingKeywordSchema = defineResponseObject({
|
|
18
|
+
keyword: schema.string().min(1),
|
|
19
|
+
position: schema.number().nullable(),
|
|
20
|
+
volume: schema.number().nullable(),
|
|
21
|
+
traffic: schema.number().nullable(),
|
|
22
|
+
url: schema.string().nullable(),
|
|
23
|
+
intent: schema.string().nullable(),
|
|
24
|
+
}, {
|
|
25
|
+
keyword: schema.string().min(1),
|
|
26
|
+
position: schema.number().nullable(),
|
|
27
|
+
volume: schema.number().nullable(),
|
|
28
|
+
traffic: schema.number().nullable(),
|
|
29
|
+
url: schema.string().nullable(),
|
|
30
|
+
intent: schema.string().nullable(),
|
|
31
|
+
});
|
|
32
|
+
export const researchSharedKeywordSchema = defineResponseObject({
|
|
33
|
+
keyword: schema.string().min(1),
|
|
34
|
+
yourPosition: schema.number(),
|
|
35
|
+
theirPosition: schema.number(),
|
|
36
|
+
volume: schema.number(),
|
|
37
|
+
}, {
|
|
38
|
+
keyword: schema.string().min(1),
|
|
39
|
+
yourPosition: schema.number(),
|
|
40
|
+
theirPosition: schema.number(),
|
|
41
|
+
volume: schema.number(),
|
|
42
|
+
});
|
|
43
|
+
export const researchHistoryPointSchema = defineResponseObject({
|
|
44
|
+
observedAt: schema.string().datetime().nullable(),
|
|
45
|
+
metrics: researchMetricsSchema.producer,
|
|
46
|
+
}, {
|
|
47
|
+
observedAt: schema.string().datetime().nullable(),
|
|
48
|
+
metrics: researchMetricsSchema.client,
|
|
49
|
+
});
|
|
50
|
+
export const researchCompetitorSchema = defineResponseObject({
|
|
51
|
+
domain: schema.string().min(1),
|
|
52
|
+
discovery: schema.enum(['manual', 'automatic', 'unknown']),
|
|
53
|
+
metrics: researchMetricsSchema.producer,
|
|
54
|
+
topKeywords: schema.array(researchRankingKeywordSchema.producer),
|
|
55
|
+
sharedKeywords: schema.array(researchSharedKeywordSchema.producer),
|
|
56
|
+
keywordGaps: schema.array(researchRankingKeywordSchema.producer),
|
|
57
|
+
quickWins: schema.array(researchSharedKeywordSchema.producer),
|
|
58
|
+
history: schema.array(researchHistoryPointSchema.producer),
|
|
59
|
+
collectedAt: schema.string().datetime().nullable(),
|
|
60
|
+
}, {
|
|
61
|
+
domain: schema.string().min(1),
|
|
62
|
+
discovery: schema.enum(['manual', 'automatic', 'unknown']),
|
|
63
|
+
metrics: researchMetricsSchema.client,
|
|
64
|
+
topKeywords: schema.array(researchRankingKeywordSchema.client),
|
|
65
|
+
sharedKeywords: schema.array(researchSharedKeywordSchema.client),
|
|
66
|
+
keywordGaps: schema.array(researchRankingKeywordSchema.client),
|
|
67
|
+
quickWins: schema.array(researchSharedKeywordSchema.client),
|
|
68
|
+
history: schema.array(researchHistoryPointSchema.client),
|
|
69
|
+
collectedAt: schema.string().datetime().nullable(),
|
|
70
|
+
});
|
|
71
|
+
export const researchSubjectSchema = defineResponseObject({
|
|
72
|
+
domain: schema.string().min(1),
|
|
73
|
+
metrics: researchMetricsSchema.producer,
|
|
74
|
+
history: schema.array(researchHistoryPointSchema.producer),
|
|
75
|
+
collectedAt: schema.string().datetime().nullable(),
|
|
76
|
+
}, {
|
|
77
|
+
domain: schema.string().min(1),
|
|
78
|
+
metrics: researchMetricsSchema.client,
|
|
79
|
+
history: schema.array(researchHistoryPointSchema.client),
|
|
80
|
+
collectedAt: schema.string().datetime().nullable(),
|
|
81
|
+
});
|
|
82
|
+
export const storedResearchOverviewDataSchema = defineResponseObject({
|
|
83
|
+
evidence: schema.strictObject({
|
|
84
|
+
_tag: schema.literal('stored'),
|
|
85
|
+
provider: schema.literal('dataforseo'),
|
|
86
|
+
collectedAt: schema.string().datetime().nullable(),
|
|
87
|
+
}),
|
|
88
|
+
summary: schema.strictObject({
|
|
89
|
+
competitorCount: schema.number().int().nonnegative(),
|
|
90
|
+
quickWins: schema.number().int().nonnegative(),
|
|
91
|
+
totalSharedKeywords: schema.number().int().nonnegative(),
|
|
92
|
+
totalTrafficValue: schema.number().nonnegative(),
|
|
93
|
+
}),
|
|
94
|
+
subject: researchSubjectSchema.producer.nullable(),
|
|
95
|
+
competitors: schema.array(researchCompetitorSchema.producer),
|
|
96
|
+
}, {
|
|
97
|
+
evidence: schema.looseObject({
|
|
98
|
+
_tag: schema.literal('stored'),
|
|
99
|
+
provider: schema.literal('dataforseo'),
|
|
100
|
+
collectedAt: schema.string().datetime().nullable(),
|
|
101
|
+
}),
|
|
102
|
+
summary: schema.looseObject({
|
|
103
|
+
competitorCount: schema.number().int().nonnegative(),
|
|
104
|
+
quickWins: schema.number().int().nonnegative(),
|
|
105
|
+
totalSharedKeywords: schema.number().int().nonnegative(),
|
|
106
|
+
totalTrafficValue: schema.number().nonnegative(),
|
|
107
|
+
}),
|
|
108
|
+
subject: researchSubjectSchema.client.nullable(),
|
|
109
|
+
competitors: schema.array(researchCompetitorSchema.client),
|
|
110
|
+
});
|
|
111
|
+
export const storedResearchOverviewResponseSchema = defineSuccessEnvelope(storedResearchOverviewDataSchema);
|
|
112
|
+
export const storedResearchOverviewOperation = defineOperation({
|
|
113
|
+
id: 'research.overview',
|
|
114
|
+
method: 'GET',
|
|
115
|
+
path: '/api/v1/sites/{siteId}/research',
|
|
116
|
+
visibility: 'public',
|
|
117
|
+
semantics: { kind: 'query', sideEffects: 'none', retry: 'idempotent', readConsistency: 'primary' },
|
|
118
|
+
auth: {
|
|
119
|
+
credentials: ['session', 'api_token'],
|
|
120
|
+
scopes: ['research:read'],
|
|
121
|
+
minimumRole: 'viewer',
|
|
122
|
+
ownership: 'site',
|
|
123
|
+
},
|
|
124
|
+
request: { params: researchSiteParamsSchema, query: null, headers: null, body: null },
|
|
125
|
+
responses: { 200: storedResearchOverviewResponseSchema },
|
|
126
|
+
errors: [
|
|
127
|
+
'invalid_request',
|
|
128
|
+
'unauthorized',
|
|
129
|
+
'auth_expired',
|
|
130
|
+
'forbidden',
|
|
131
|
+
'not_found',
|
|
132
|
+
'rate_limited',
|
|
133
|
+
'contract_violation',
|
|
134
|
+
'internal_error',
|
|
135
|
+
],
|
|
136
|
+
errorResponse: publicV1ErrorEnvelope,
|
|
137
|
+
resources: {
|
|
138
|
+
reads: [{ type: 'site.research', idFrom: 'params.siteId' }],
|
|
139
|
+
changes: [],
|
|
140
|
+
},
|
|
141
|
+
policy: {
|
|
142
|
+
rate: publicV1StandardRatePolicy,
|
|
143
|
+
idempotency: { _tag: 'none' },
|
|
144
|
+
entitlement: null,
|
|
145
|
+
meter: null,
|
|
146
|
+
},
|
|
147
|
+
lifecycle: { introduced: '1.0.0' },
|
|
148
|
+
docs: {
|
|
149
|
+
summary: 'Get stored Site Research',
|
|
150
|
+
description: 'Returns retained competitor and keyword-gap evidence already collected for the Site. It never starts provider work and does not consume metered units.',
|
|
151
|
+
tags: ['Research'],
|
|
152
|
+
examples: [{
|
|
153
|
+
request: { params: { siteId: 'site_01JXYZ' } },
|
|
154
|
+
response: {
|
|
155
|
+
status: 200,
|
|
156
|
+
body: {
|
|
157
|
+
data: {
|
|
158
|
+
evidence: { _tag: 'stored', provider: 'dataforseo', collectedAt: null },
|
|
159
|
+
summary: { competitorCount: 0, quickWins: 0, totalSharedKeywords: 0, totalTrafficValue: 0 },
|
|
160
|
+
subject: null,
|
|
161
|
+
competitors: [],
|
|
162
|
+
},
|
|
163
|
+
meta: { requestId: 'req_01JXYZ', version: '1.0' },
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
}],
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
export const researchV1Registry = defineRegistry({
|
|
170
|
+
feature: 'research',
|
|
171
|
+
operations: {
|
|
172
|
+
overview: storedResearchOverviewOperation,
|
|
173
|
+
},
|
|
174
|
+
});
|