@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,198 @@
1
+ import { z as schema } from 'zod';
2
+ import { defineOperation, defineRegistry, defineResponseObject, defineSuccessEnvelope, publicV1ErrorEnvelope, publicV1StandardRatePolicy, } from './core.js';
3
+ export const performanceSiteParamsSchema = schema.strictObject({
4
+ siteId: schema.string().min(1),
5
+ });
6
+ const nullableMetricSchema = schema.number().nullable();
7
+ export const performanceScoreSummarySchema = defineResponseObject({
8
+ median: nullableMetricSchema,
9
+ worst: nullableMetricSchema,
10
+ best: nullableMetricSchema,
11
+ }, {
12
+ median: nullableMetricSchema,
13
+ worst: nullableMetricSchema,
14
+ best: nullableMetricSchema,
15
+ });
16
+ export const performanceCategorySummarySchema = defineResponseObject({
17
+ median: nullableMetricSchema,
18
+ worst: nullableMetricSchema,
19
+ }, {
20
+ median: nullableMetricSchema,
21
+ worst: nullableMetricSchema,
22
+ });
23
+ export const performanceVitalSummarySchema = defineResponseObject({
24
+ median: nullableMetricSchema,
25
+ worst: nullableMetricSchema,
26
+ statusCounts: schema.strictObject({
27
+ good: schema.number().int().nonnegative(),
28
+ ni: schema.number().int().nonnegative(),
29
+ poor: schema.number().int().nonnegative(),
30
+ }),
31
+ }, {
32
+ median: nullableMetricSchema,
33
+ worst: nullableMetricSchema,
34
+ statusCounts: schema.looseObject({
35
+ good: schema.number().int().nonnegative(),
36
+ ni: schema.number().int().nonnegative(),
37
+ poor: schema.number().int().nonnegative(),
38
+ }),
39
+ });
40
+ export const sitePerformanceHealthSchema = defineResponseObject({
41
+ perf: performanceScoreSummarySchema.producer,
42
+ a11y: performanceCategorySummarySchema.producer,
43
+ bestPractices: performanceCategorySummarySchema.producer,
44
+ seo: performanceCategorySummarySchema.producer,
45
+ lcp: performanceVitalSummarySchema.producer,
46
+ tbt: performanceVitalSummarySchema.producer,
47
+ cls: performanceVitalSummarySchema.producer,
48
+ scannedPageCount: schema.number().int().nonnegative(),
49
+ lastScanAt: schema.string().datetime().nullable(),
50
+ }, {
51
+ perf: performanceScoreSummarySchema.client,
52
+ a11y: performanceCategorySummarySchema.client,
53
+ bestPractices: performanceCategorySummarySchema.client,
54
+ seo: performanceCategorySummarySchema.client,
55
+ lcp: performanceVitalSummarySchema.client,
56
+ tbt: performanceVitalSummarySchema.client,
57
+ cls: performanceVitalSummarySchema.client,
58
+ scannedPageCount: schema.number().int().nonnegative(),
59
+ lastScanAt: schema.string().datetime().nullable(),
60
+ });
61
+ export const sitePerformanceScanSchema = defineResponseObject({
62
+ scanId: schema.string().min(1),
63
+ url: schema.string().url(),
64
+ completedAt: schema.string().datetime().nullable(),
65
+ perf: nullableMetricSchema,
66
+ a11y: nullableMetricSchema,
67
+ bestPractices: nullableMetricSchema,
68
+ seo: nullableMetricSchema,
69
+ lcp: nullableMetricSchema,
70
+ tbt: nullableMetricSchema,
71
+ cls: nullableMetricSchema,
72
+ }, {
73
+ scanId: schema.string().min(1),
74
+ url: schema.string().url(),
75
+ completedAt: schema.string().datetime().nullable(),
76
+ perf: nullableMetricSchema,
77
+ a11y: nullableMetricSchema,
78
+ bestPractices: nullableMetricSchema,
79
+ seo: nullableMetricSchema,
80
+ lcp: nullableMetricSchema,
81
+ tbt: nullableMetricSchema,
82
+ cls: nullableMetricSchema,
83
+ });
84
+ export const sitePerformanceRouteSchema = defineResponseObject({
85
+ pageId: schema.string().min(1),
86
+ path: schema.string(),
87
+ url: schema.string().url(),
88
+ latestScanId: schema.string().min(1).nullable(),
89
+ completedAt: schema.string().datetime().nullable(),
90
+ perf: nullableMetricSchema,
91
+ a11y: nullableMetricSchema,
92
+ bestPractices: nullableMetricSchema,
93
+ seo: nullableMetricSchema,
94
+ lcp: nullableMetricSchema,
95
+ tbt: nullableMetricSchema,
96
+ cls: nullableMetricSchema,
97
+ }, {
98
+ pageId: schema.string().min(1),
99
+ path: schema.string(),
100
+ url: schema.string().url(),
101
+ latestScanId: schema.string().min(1).nullable(),
102
+ completedAt: schema.string().datetime().nullable(),
103
+ perf: nullableMetricSchema,
104
+ a11y: nullableMetricSchema,
105
+ bestPractices: nullableMetricSchema,
106
+ seo: nullableMetricSchema,
107
+ lcp: nullableMetricSchema,
108
+ tbt: nullableMetricSchema,
109
+ cls: nullableMetricSchema,
110
+ });
111
+ export const sitePerformanceOverviewDataSchema = defineResponseObject({
112
+ health: sitePerformanceHealthSchema.producer.nullable(),
113
+ homepage: sitePerformanceScanSchema.producer.nullable(),
114
+ homepageDesktop: sitePerformanceScanSchema.producer.nullable(),
115
+ routes: schema.array(sitePerformanceRouteSchema.producer),
116
+ routesDesktop: schema.array(sitePerformanceRouteSchema.producer),
117
+ }, {
118
+ health: sitePerformanceHealthSchema.client.nullable(),
119
+ homepage: sitePerformanceScanSchema.client.nullable(),
120
+ homepageDesktop: sitePerformanceScanSchema.client.nullable(),
121
+ routes: schema.array(sitePerformanceRouteSchema.client),
122
+ routesDesktop: schema.array(sitePerformanceRouteSchema.client),
123
+ });
124
+ export const sitePerformanceOverviewResponseSchema = defineSuccessEnvelope(sitePerformanceOverviewDataSchema);
125
+ export const sitePerformanceOverviewOperation = defineOperation({
126
+ id: 'page.performance',
127
+ method: 'GET',
128
+ path: '/api/v1/sites/{siteId}/performance',
129
+ visibility: 'public',
130
+ semantics: { kind: 'query', sideEffects: 'none', retry: 'idempotent', readConsistency: 'primary' },
131
+ auth: {
132
+ credentials: ['session', 'api_token'],
133
+ scopes: ['page:read'],
134
+ minimumRole: 'viewer',
135
+ ownership: 'site',
136
+ },
137
+ request: { params: performanceSiteParamsSchema, query: null, headers: null, body: null },
138
+ responses: { 200: sitePerformanceOverviewResponseSchema },
139
+ errors: [
140
+ 'invalid_request',
141
+ 'unauthorized',
142
+ 'auth_expired',
143
+ 'forbidden',
144
+ 'not_found',
145
+ 'rate_limited',
146
+ 'contract_violation',
147
+ 'internal_error',
148
+ ],
149
+ errorResponse: publicV1ErrorEnvelope,
150
+ resources: {
151
+ reads: [{ type: 'site.page', idFrom: 'params.siteId' }],
152
+ changes: [],
153
+ },
154
+ policy: {
155
+ rate: publicV1StandardRatePolicy,
156
+ idempotency: { _tag: 'none' },
157
+ entitlement: null,
158
+ meter: null,
159
+ },
160
+ lifecycle: { introduced: '1.0.0' },
161
+ docs: {
162
+ summary: 'Get Site Performance',
163
+ description: 'Returns stored fleet-level Lighthouse health and the latest mobile and desktop evidence for monitored Pages. Use Page inspection for one Page.',
164
+ tags: ['Pages'],
165
+ examples: [{
166
+ request: { params: { siteId: 'site_01JXYZ' } },
167
+ response: {
168
+ status: 200,
169
+ body: {
170
+ data: {
171
+ health: {
172
+ perf: { median: 82, worst: 68, best: 94 },
173
+ a11y: { median: 96, worst: 91 },
174
+ bestPractices: { median: 92, worst: 86 },
175
+ seo: { median: 98, worst: 94 },
176
+ lcp: { median: 2200, worst: 4100, statusCounts: { good: 3, ni: 1, poor: 1 } },
177
+ tbt: { median: 180, worst: 650, statusCounts: { good: 3, ni: 1, poor: 1 } },
178
+ cls: { median: 80, worst: 260, statusCounts: { good: 4, ni: 0, poor: 1 } },
179
+ scannedPageCount: 5,
180
+ lastScanAt: '2026-08-10T01:00:00.000Z',
181
+ },
182
+ homepage: null,
183
+ homepageDesktop: null,
184
+ routes: [],
185
+ routesDesktop: [],
186
+ },
187
+ meta: { requestId: 'req_01JXYZ', version: '1.0' },
188
+ },
189
+ },
190
+ }],
191
+ },
192
+ });
193
+ export const performanceV1Registry = defineRegistry({
194
+ feature: 'page',
195
+ operations: {
196
+ overview: sitePerformanceOverviewOperation,
197
+ },
198
+ });