@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.
Files changed (44) hide show
  1. package/dist/analytics-codecs/analytics-row.d.ts +265 -0
  2. package/dist/analytics-codecs/analytics-row.js +175 -0
  3. package/dist/analytics-codecs/analytics-web-vitals.d.ts +57 -0
  4. package/dist/analytics-codecs/analytics-web-vitals.js +76 -0
  5. package/dist/analytics-codecs/capabilities.d.ts +35 -0
  6. package/dist/analytics-codecs/capabilities.js +76 -0
  7. package/dist/analytics-codecs/index.d.ts +3 -0
  8. package/dist/analytics-codecs/index.js +3 -0
  9. package/dist/cli-pairing.d.ts +67 -0
  10. package/dist/cli-pairing.js +52 -0
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.js +1 -0
  13. package/dist/v1/account.d.ts +715 -0
  14. package/dist/v1/account.js +123 -0
  15. package/dist/v1/actions.d.ts +2591 -0
  16. package/dist/v1/actions.js +460 -0
  17. package/dist/v1/analytics.d.ts +6145 -0
  18. package/dist/v1/analytics.js +296 -0
  19. package/dist/v1/audit.d.ts +4053 -0
  20. package/dist/v1/audit.js +609 -0
  21. package/dist/v1/backlinks.d.ts +1002 -0
  22. package/dist/v1/backlinks.js +239 -0
  23. package/dist/v1/content.d.ts +2745 -0
  24. package/dist/v1/content.js +326 -0
  25. package/dist/v1/core.d.ts +301 -0
  26. package/dist/v1/core.js +333 -0
  27. package/dist/v1/documents.d.ts +4 -0
  28. package/dist/v1/documents.js +216 -0
  29. package/dist/v1/gsc.d.ts +5172 -0
  30. package/dist/v1/gsc.js +583 -0
  31. package/dist/v1/index.d.ts +49 -0
  32. package/dist/v1/index.js +52 -0
  33. package/dist/v1/pages.d.ts +1404 -0
  34. package/dist/v1/pages.js +287 -0
  35. package/dist/v1/performance.d.ts +1379 -0
  36. package/dist/v1/performance.js +198 -0
  37. package/dist/v1/research.d.ts +1173 -0
  38. package/dist/v1/research.js +174 -0
  39. package/dist/v1/sitemaps.d.ts +1506 -0
  40. package/dist/v1/sitemaps.js +199 -0
  41. package/dist/v1/sites.d.ts +591 -0
  42. package/dist/v1/sites.js +101 -0
  43. package/generated/openapi.v1.json +1 -0
  44. package/package.json +131 -0
@@ -0,0 +1,239 @@
1
+ import { z as schema } from 'zod';
2
+ import { defineOperation, defineRegistry, defineResponseObject, defineSuccessEnvelope, publicV1ErrorEnvelope, publicV1StandardRatePolicy, } from './core.js';
3
+ export const backlinksSiteParamsSchema = schema.strictObject({
4
+ siteId: schema.string().min(1),
5
+ });
6
+ export const backlinksPageQuerySchema = schema.strictObject({
7
+ limit: schema.coerce.number().int().min(1).max(200).default(100),
8
+ offset: schema.coerce.number().int().min(0).default(0),
9
+ });
10
+ /**
11
+ * One inbound link whose destination is broken. `destinationStatus` is the
12
+ * status the destination answered with when the provider last checked, so a
13
+ * consumer can separate a 404 from a 5xx without refetching.
14
+ */
15
+ export const recoverableBacklinkSchema = defineResponseObject({
16
+ id: schema.string().min(1),
17
+ destinationUrl: schema.string().min(1),
18
+ referringUrl: schema.string().min(1),
19
+ referringDomain: schema.string().min(1),
20
+ anchor: schema.string().nullable(),
21
+ destinationStatus: schema.number().int().nullable(),
22
+ domainRank: schema.number().int().nullable(),
23
+ pageRank: schema.number().int().nullable(),
24
+ dofollow: schema.boolean().nullable(),
25
+ firstSeenAt: schema.string().datetime().nullable(),
26
+ lastSeenAt: schema.string().datetime().nullable(),
27
+ }, {
28
+ id: schema.string().min(1),
29
+ destinationUrl: schema.string().min(1),
30
+ referringUrl: schema.string().min(1),
31
+ referringDomain: schema.string().min(1),
32
+ anchor: schema.string().nullable(),
33
+ destinationStatus: schema.number().int().nullable(),
34
+ domainRank: schema.number().int().nullable(),
35
+ pageRank: schema.number().int().nullable(),
36
+ dofollow: schema.boolean().nullable(),
37
+ firstSeenAt: schema.string().datetime().nullable(),
38
+ lastSeenAt: schema.string().datetime().nullable(),
39
+ });
40
+ export const recoverableBacklinksDataSchema = defineResponseObject({
41
+ items: schema.array(recoverableBacklinkSchema.producer),
42
+ total: schema.number().int().nonnegative(),
43
+ limit: schema.number().int().positive(),
44
+ offset: schema.number().int().nonnegative(),
45
+ }, {
46
+ items: schema.array(recoverableBacklinkSchema.client),
47
+ total: schema.number().int().nonnegative(),
48
+ limit: schema.number().int().positive(),
49
+ offset: schema.number().int().nonnegative(),
50
+ });
51
+ export const recoverableBacklinksResponseSchema = defineSuccessEnvelope(recoverableBacklinksDataSchema);
52
+ export const recoverableBacklinksOperation = defineOperation({
53
+ id: 'backlinks.recoverable',
54
+ method: 'GET',
55
+ path: '/api/v1/sites/{siteId}/backlinks/recoverable',
56
+ visibility: 'public',
57
+ semantics: { kind: 'query', sideEffects: 'none', retry: 'idempotent', readConsistency: 'primary' },
58
+ auth: {
59
+ credentials: ['session', 'api_token'],
60
+ scopes: ['research:read'],
61
+ minimumRole: 'viewer',
62
+ ownership: 'site',
63
+ },
64
+ request: { params: backlinksSiteParamsSchema, query: backlinksPageQuerySchema, headers: null, body: null },
65
+ responses: { 200: recoverableBacklinksResponseSchema },
66
+ errors: [
67
+ 'invalid_request',
68
+ 'unauthorized',
69
+ 'auth_expired',
70
+ 'forbidden',
71
+ 'not_found',
72
+ 'rate_limited',
73
+ 'contract_violation',
74
+ 'internal_error',
75
+ ],
76
+ errorResponse: publicV1ErrorEnvelope,
77
+ resources: {
78
+ reads: [{ type: 'site.research', idFrom: 'params.siteId' }],
79
+ changes: [],
80
+ },
81
+ policy: {
82
+ rate: publicV1StandardRatePolicy,
83
+ idempotency: { _tag: 'none' },
84
+ entitlement: null,
85
+ meter: null,
86
+ },
87
+ lifecycle: { introduced: '1.1.0' },
88
+ docs: {
89
+ summary: 'List recoverable Backlinks',
90
+ description: 'Returns retained inbound links whose destination is broken, ranked by referring domain authority. Each item carries the referring URL and the destination URL, so a redirect can be written without a crawl. It never starts provider work and does not consume metered units.',
91
+ tags: ['Research'],
92
+ examples: [{
93
+ request: { params: { siteId: 'site_01JXYZ' }, query: { limit: 100, offset: 0 } },
94
+ response: {
95
+ status: 200,
96
+ body: {
97
+ data: {
98
+ items: [{
99
+ id: 'bl_01JXYZ',
100
+ destinationUrl: 'https://example.com/docs/utils',
101
+ referringUrl: 'https://news.example/posts/seo',
102
+ referringDomain: 'news.example',
103
+ anchor: 'Read the full documentation',
104
+ destinationStatus: 404,
105
+ domainRank: 529,
106
+ pageRank: 55,
107
+ dofollow: true,
108
+ firstSeenAt: '2026-02-09T20:43:50.000Z',
109
+ lastSeenAt: '2026-07-17T04:40:07.000Z',
110
+ }],
111
+ total: 1,
112
+ limit: 100,
113
+ offset: 0,
114
+ },
115
+ meta: { requestId: 'req_01JXYZ', version: '1.0' },
116
+ },
117
+ },
118
+ }],
119
+ },
120
+ });
121
+ export const backlinksV1Registry = defineRegistry({
122
+ feature: 'backlinks',
123
+ operations: {
124
+ recoverable: recoverableBacklinksOperation,
125
+ },
126
+ });
127
+ export const mentionsQuerySchema = schema.strictObject({
128
+ limit: schema.coerce.number().int().min(1).max(200).default(100),
129
+ includeFiltered: schema.enum(['0', '1']).default('0'),
130
+ });
131
+ export const mentionSchema = defineResponseObject({
132
+ id: schema.string().min(1),
133
+ source: schema.string().min(1),
134
+ url: schema.string().min(1),
135
+ domain: schema.string().min(1),
136
+ title: schema.string().nullable(),
137
+ snippet: schema.string().nullable(),
138
+ author: schema.string().nullable(),
139
+ authorHandle: schema.string().nullable(),
140
+ engagement: schema.number().int().nullable(),
141
+ sentiment: schema.string().nullable(),
142
+ domainRank: schema.number().int().nullable(),
143
+ publishedAt: schema.string().datetime().nullable(),
144
+ }, {
145
+ id: schema.string().min(1),
146
+ source: schema.string().min(1),
147
+ url: schema.string().min(1),
148
+ domain: schema.string().min(1),
149
+ title: schema.string().nullable(),
150
+ snippet: schema.string().nullable(),
151
+ author: schema.string().nullable(),
152
+ authorHandle: schema.string().nullable(),
153
+ engagement: schema.number().int().nullable(),
154
+ sentiment: schema.string().nullable(),
155
+ domainRank: schema.number().int().nullable(),
156
+ publishedAt: schema.string().datetime().nullable(),
157
+ });
158
+ export const mentionsDataSchema = defineResponseObject({
159
+ items: schema.array(mentionSchema.producer),
160
+ limit: schema.number().int().positive(),
161
+ }, {
162
+ items: schema.array(mentionSchema.client),
163
+ limit: schema.number().int().positive(),
164
+ });
165
+ export const mentionsResponseSchema = defineSuccessEnvelope(mentionsDataSchema);
166
+ export const mentionsListOperation = defineOperation({
167
+ id: 'mentions.list',
168
+ method: 'GET',
169
+ path: '/api/v1/sites/{siteId}/mentions',
170
+ visibility: 'public',
171
+ semantics: { kind: 'query', sideEffects: 'none', retry: 'idempotent', readConsistency: 'primary' },
172
+ auth: {
173
+ credentials: ['session', 'api_token'],
174
+ scopes: ['research:read'],
175
+ minimumRole: 'viewer',
176
+ ownership: 'site',
177
+ },
178
+ request: { params: backlinksSiteParamsSchema, query: mentionsQuerySchema, headers: null, body: null },
179
+ responses: { 200: mentionsResponseSchema },
180
+ errors: [
181
+ 'invalid_request',
182
+ 'unauthorized',
183
+ 'auth_expired',
184
+ 'forbidden',
185
+ 'not_found',
186
+ 'rate_limited',
187
+ 'contract_violation',
188
+ 'internal_error',
189
+ ],
190
+ errorResponse: publicV1ErrorEnvelope,
191
+ resources: {
192
+ reads: [{ type: 'site.research', idFrom: 'params.siteId' }],
193
+ changes: [],
194
+ },
195
+ policy: {
196
+ rate: publicV1StandardRatePolicy,
197
+ idempotency: { _tag: 'none' },
198
+ entitlement: null,
199
+ meter: null,
200
+ },
201
+ lifecycle: { introduced: '1.1.0' },
202
+ docs: {
203
+ summary: 'List Mentions',
204
+ description: 'Returns retained pages and posts that name the Site without linking to it, newest first. Dismissed and lost Mentions are excluded. Pass includeFiltered=1 to keep the ones AI triage marked a false positive. It never starts provider work and does not consume metered units.',
205
+ tags: ['Research'],
206
+ examples: [{
207
+ request: { params: { siteId: 'site_01JXYZ' }, query: { limit: 100, includeFiltered: '0' } },
208
+ response: {
209
+ status: 200,
210
+ body: {
211
+ data: {
212
+ items: [{
213
+ id: 'mn_01JXYZ',
214
+ source: 'hackernews',
215
+ url: 'https://news.ycombinator.com/item?id=1',
216
+ domain: 'news.ycombinator.com',
217
+ title: 'Show HN: a sitemap module',
218
+ snippet: 'We moved to example.com last week',
219
+ author: 'Ada Lovelace',
220
+ authorHandle: 'ada',
221
+ engagement: 142,
222
+ sentiment: 'positive',
223
+ domainRank: 812,
224
+ publishedAt: '2026-08-01T09:12:00.000Z',
225
+ }],
226
+ limit: 100,
227
+ },
228
+ meta: { requestId: 'req_01JXYZ', version: '1.0' },
229
+ },
230
+ },
231
+ }],
232
+ },
233
+ });
234
+ export const mentionsV1Registry = defineRegistry({
235
+ feature: 'mentions',
236
+ operations: {
237
+ list: mentionsListOperation,
238
+ },
239
+ });