@nuxtseo/protocol 0.2.1 → 0.4.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 +8 -104
- package/dist/v1/account.js +4 -2
- package/dist/v1/actions.d.ts +706 -0
- package/dist/v1/actions.js +20 -0
- package/dist/v1/audit.d.ts +412 -10
- package/dist/v1/audit.js +24 -1
- package/dist/v1/backlinks.d.ts +448 -4
- package/dist/v1/backlinks.js +53 -1
- package/dist/v1/core.d.ts +50 -1
- package/dist/v1/core.js +39 -2
- package/dist/v1/gsc.d.ts +424 -12
- package/dist/v1/gsc.js +36 -5
- package/dist/v1/index.d.ts +0 -3
- package/dist/v1/index.js +0 -3
- package/dist/v1/pages.d.ts +72 -2
- package/dist/v1/pages.js +17 -1
- package/dist/v1/performance.d.ts +22 -16
- package/dist/v1/performance.js +54 -29
- package/dist/v1/research.d.ts +170 -2
- package/dist/v1/research.js +43 -0
- package/dist/v1/sitemaps.d.ts +6 -6
- package/dist/v1/sitemaps.js +2 -1
- package/dist/v1/sites.d.ts +298 -0
- package/dist/v1/sites.js +21 -2
- package/dist/v1/timeline.d.ts +4 -4
- package/dist/v1/timeline.js +4 -0
- package/generated/openapi.v1.json +1 -1
- package/package.json +3 -8
- package/dist/v1/content.d.ts +0 -2745
- package/dist/v1/content.js +0 -326
package/dist/v1/gsc.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { canonicalDifferenceKindSchema, gscdumpAnalysisPresetSchema, gscdumpIndexingTransitionFieldSchema, gscdumpTotalsSchema, indexingIssueSchema, } from '@gscdump/contracts';
|
|
2
2
|
import { z as schema } from 'zod';
|
|
3
|
-
import { defineOperation, defineRegistry, defineResponseObject, defineSuccessEnvelope, publicV1ErrorEnvelope, publicV1StandardRatePolicy, } from './core.js';
|
|
3
|
+
import { defineOperation, defineRegistry, defineResponseObject, defineSuccessEnvelope, publicV1ErrorEnvelope, publicV1PageSchema, publicV1StandardRatePolicy, } from './core.js';
|
|
4
4
|
export const searchConsoleSiteParamsSchema = schema.strictObject({
|
|
5
5
|
siteId: schema.string().min(1),
|
|
6
6
|
});
|
|
@@ -76,7 +76,16 @@ export const searchAnalyticsQuerySchema = schema.strictObject({
|
|
|
76
76
|
});
|
|
77
77
|
const totalsSchema = defineResponseObject(gscdumpTotalsSchema.shape, gscdumpTotalsSchema.shape);
|
|
78
78
|
const representedTotalsSchema = defineResponseObject({ clicks: schema.number(), impressions: schema.number() }, { clicks: schema.number(), impressions: schema.number() });
|
|
79
|
-
const
|
|
79
|
+
const pageRowShape = {
|
|
80
|
+
/**
|
|
81
|
+
* The canonical page URL: origin plus path, with the host twin, the scheme,
|
|
82
|
+
* the query string and the fragment folded away.
|
|
83
|
+
*
|
|
84
|
+
* Search Console reports one row per exact page string, so `https://x/a`,
|
|
85
|
+
* `https://www.x/a` and `https://x/a?utm=1` arrive as three rows that all
|
|
86
|
+
* canonicalise to one `url`. `url` therefore repeats across rows. Group by
|
|
87
|
+
* `gscPage` to reproduce `total`.
|
|
88
|
+
*/
|
|
80
89
|
url: schema.string().min(1),
|
|
81
90
|
clicks: schema.number(),
|
|
82
91
|
impressions: schema.number(),
|
|
@@ -84,9 +93,21 @@ const pageRowSchema = defineResponseObject({
|
|
|
84
93
|
pos: schema.number(),
|
|
85
94
|
keyword: schema.string().nullable(),
|
|
86
95
|
prevClicks: schema.number().optional(),
|
|
96
|
+
prevImpressions: schema.number().optional(),
|
|
87
97
|
prevPos: schema.number().optional(),
|
|
88
98
|
change: schema.number().nullable(),
|
|
89
|
-
}
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* The exact page string Search Console reported, before canonicalisation.
|
|
102
|
+
* This is the dimension `total` counts, so it is unique within `rows`.
|
|
103
|
+
*
|
|
104
|
+
* A producer must send it. A client treats it as optional, because a client
|
|
105
|
+
* newer than the deployed server reads answers that predate the field.
|
|
106
|
+
* `.nullable()` alone still demands the key, which fails every response the
|
|
107
|
+
* deployed server sends today.
|
|
108
|
+
*/
|
|
109
|
+
const gscPageField = schema.string().nullable();
|
|
110
|
+
const pageRowSchema = defineResponseObject({ ...pageRowShape, gscPage: gscPageField }, { ...pageRowShape, gscPage: gscPageField.optional() });
|
|
90
111
|
const keywordRowSchema = defineResponseObject({
|
|
91
112
|
keyword: schema.string().min(1),
|
|
92
113
|
clicks: schema.number(),
|
|
@@ -95,6 +116,7 @@ const keywordRowSchema = defineResponseObject({
|
|
|
95
116
|
pos: schema.number(),
|
|
96
117
|
topPage: schema.string().nullable(),
|
|
97
118
|
prevClicks: schema.number().optional(),
|
|
119
|
+
prevImpressions: schema.number().optional(),
|
|
98
120
|
prevPos: schema.number().optional(),
|
|
99
121
|
change: schema.number().nullable(),
|
|
100
122
|
});
|
|
@@ -126,6 +148,11 @@ function breakdownSchema(view, row) {
|
|
|
126
148
|
representedTotals: representedTotalsSchema.producer,
|
|
127
149
|
representedTotalsScope: schema.string().min(1),
|
|
128
150
|
rows: schema.array(row.producer),
|
|
151
|
+
/**
|
|
152
|
+
* The converged list envelope. `page.total` repeats the flat `total`,
|
|
153
|
+
* which counts the whole upstream population rather than this page.
|
|
154
|
+
*/
|
|
155
|
+
page: publicV1PageSchema.producer,
|
|
129
156
|
}, {
|
|
130
157
|
site: schema.string().min(1),
|
|
131
158
|
view: schema.literal(view),
|
|
@@ -136,6 +163,7 @@ function breakdownSchema(view, row) {
|
|
|
136
163
|
representedTotals: representedTotalsSchema.client,
|
|
137
164
|
representedTotalsScope: schema.string().min(1),
|
|
138
165
|
rows: schema.array(row.client),
|
|
166
|
+
page: publicV1PageSchema.client.optional(),
|
|
139
167
|
});
|
|
140
168
|
}
|
|
141
169
|
const pagesDataSchema = breakdownSchema('pages', pageRowSchema);
|
|
@@ -221,9 +249,12 @@ const analysisRowSchema = defineResponseObject({
|
|
|
221
249
|
clicks: schema.number(),
|
|
222
250
|
impressions: schema.number(),
|
|
223
251
|
ctr: schema.number(),
|
|
224
|
-
|
|
252
|
+
// Null when the keyword has no row in the current window (a `decay` keyword
|
|
253
|
+
// that vanished). Zero would read as a ranking position.
|
|
254
|
+
pos: schema.number().nullable(),
|
|
225
255
|
page: schema.string().optional(),
|
|
226
256
|
prevClicks: schema.number().optional(),
|
|
257
|
+
prevImpressions: schema.number().optional(),
|
|
227
258
|
prevPos: schema.number().optional(),
|
|
228
259
|
potentialClicks: schema.number().optional(),
|
|
229
260
|
opportunityScore: schema.number().optional(),
|
|
@@ -510,7 +541,7 @@ export const searchAnalyticsQueryOperation = defineOperation({
|
|
|
510
541
|
tags: ['Sites', 'Search'],
|
|
511
542
|
examples: [{
|
|
512
543
|
request: { params: { siteId: 'site_01JXYZ' }, query: { view: 'keywords' } },
|
|
513
|
-
response: { status: 200, body: { data: { site: 'https://example.com', view: 'keywords', period: '28d', total: 1, totals: { clicks: 12, impressions: 100, ctr: 0.12, position: 4 }, totalsScope: 'full upstream query population', representedTotals: { clicks: 12, impressions: 100 }, representedTotalsScope: 'returned rows', rows: [{ keyword: 'nuxt seo', clicks: 12, impressions: 100, ctr: 0.12, pos: 4, topPage: 'https://example.com/docs', change: 2 }] }, meta: { requestId: 'req_01JXYZ', version: '1.0' } } },
|
|
544
|
+
response: { status: 200, body: { data: { site: 'https://example.com', view: 'keywords', period: '28d', total: 1, totals: { clicks: 12, impressions: 100, ctr: 0.12, position: 4 }, totalsScope: 'full upstream query population', representedTotals: { clicks: 12, impressions: 100 }, representedTotalsScope: 'returned rows', rows: [{ keyword: 'nuxt seo', clicks: 12, impressions: 100, ctr: 0.12, pos: 4, topPage: 'https://example.com/docs', change: 2 }], page: { total: 1, limit: 25, offset: 0, hasMore: false } }, meta: { requestId: 'req_01JXYZ', version: '1.0' } } },
|
|
514
545
|
}],
|
|
515
546
|
},
|
|
516
547
|
});
|
package/dist/v1/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { actionsV1Registry } from './actions.js';
|
|
|
4
4
|
import { analyticsV1Registry } from './analytics.js';
|
|
5
5
|
import { auditV1Registry } from './audit.js';
|
|
6
6
|
import { backlinksV1Registry, mentionsV1Registry } from './backlinks.js';
|
|
7
|
-
import { contentV1Registry } from './content.js';
|
|
8
7
|
import { publicV1ErrorEnvelope } from './core.js';
|
|
9
8
|
import { searchV1Registry } from './gsc.js';
|
|
10
9
|
import { pagesV1Registry } from './pages.js';
|
|
@@ -18,7 +17,6 @@ export * from './actions.js';
|
|
|
18
17
|
export * from './analytics.js';
|
|
19
18
|
export * from './audit.js';
|
|
20
19
|
export * from './backlinks.js';
|
|
21
|
-
export * from './content.js';
|
|
22
20
|
export * from './core.js';
|
|
23
21
|
export * from './documents.js';
|
|
24
22
|
export * from './gsc.js';
|
|
@@ -36,7 +34,6 @@ export interface PublicV1Protocol extends Omit<PublicV1ProtocolLike, 'registries
|
|
|
36
34
|
readonly audit: typeof auditV1Registry;
|
|
37
35
|
readonly backlinks: typeof backlinksV1Registry;
|
|
38
36
|
readonly mentions: typeof mentionsV1Registry;
|
|
39
|
-
readonly content: typeof contentV1Registry;
|
|
40
37
|
readonly page: typeof pagesV1Registry;
|
|
41
38
|
readonly performance: typeof performanceV1Registry;
|
|
42
39
|
readonly research: typeof researchV1Registry;
|
package/dist/v1/index.js
CHANGED
|
@@ -3,7 +3,6 @@ import { actionsV1Registry } from './actions.js';
|
|
|
3
3
|
import { analyticsV1Registry } from './analytics.js';
|
|
4
4
|
import { auditV1Registry } from './audit.js';
|
|
5
5
|
import { backlinksV1Registry, mentionsV1Registry } from './backlinks.js';
|
|
6
|
-
import { contentV1Registry } from './content.js';
|
|
7
6
|
import { defineProtocol, PUBLIC_V1_VERSION, publicV1ErrorEnvelope } from './core.js';
|
|
8
7
|
import { searchV1Registry } from './gsc.js';
|
|
9
8
|
import { pagesV1Registry } from './pages.js';
|
|
@@ -17,7 +16,6 @@ export * from './actions.js';
|
|
|
17
16
|
export * from './analytics.js';
|
|
18
17
|
export * from './audit.js';
|
|
19
18
|
export * from './backlinks.js';
|
|
20
|
-
export * from './content.js';
|
|
21
19
|
export * from './core.js';
|
|
22
20
|
export * from './documents.js';
|
|
23
21
|
export * from './gsc.js';
|
|
@@ -37,7 +35,6 @@ export function createPublicV1Protocol() {
|
|
|
37
35
|
audit: auditV1Registry,
|
|
38
36
|
backlinks: backlinksV1Registry,
|
|
39
37
|
mentions: mentionsV1Registry,
|
|
40
|
-
content: contentV1Registry,
|
|
41
38
|
page: pagesV1Registry,
|
|
42
39
|
performance: performanceV1Registry,
|
|
43
40
|
research: researchV1Registry,
|
package/dist/v1/pages.d.ts
CHANGED
|
@@ -61,6 +61,11 @@ export declare const pageObservationSchema: import("./core.js").CompatibleRespon
|
|
|
61
61
|
unmonitored: "unmonitored";
|
|
62
62
|
}>>;
|
|
63
63
|
}, z.core.$strip>>;
|
|
64
|
+
/**
|
|
65
|
+
* The latest Lighthouse Scan for one page. The four category scores run from 0
|
|
66
|
+
* to 100. `lcp` and `tbt` are milliseconds. `cls` is the unitless Cumulative
|
|
67
|
+
* Layout Shift value at the Lighthouse scale, so `0.1` is the "good" threshold.
|
|
68
|
+
*/
|
|
64
69
|
export declare const pageLighthouseSchema: import("./core.js").CompatibleResponseSchema<z.ZodObject<{
|
|
65
70
|
readonly scanId: z.ZodString;
|
|
66
71
|
readonly strategy: z.ZodEnum<{
|
|
@@ -142,6 +147,12 @@ export declare const pageInspectDataSchema: import("./core.js").CompatibleRespon
|
|
|
142
147
|
unmonitored: "unmonitored";
|
|
143
148
|
}>>;
|
|
144
149
|
}, z.core.$strip>>;
|
|
150
|
+
page: z.ZodObject<{
|
|
151
|
+
readonly total: z.ZodNumber;
|
|
152
|
+
readonly limit: z.ZodNumber;
|
|
153
|
+
readonly offset: z.ZodNumber;
|
|
154
|
+
readonly hasMore: z.ZodBoolean;
|
|
155
|
+
}, z.core.$strip>;
|
|
145
156
|
total: z.ZodNumber;
|
|
146
157
|
coverage: z.ZodEnum<{
|
|
147
158
|
"issues-open": "issues-open";
|
|
@@ -208,6 +219,12 @@ export declare const pageInspectDataSchema: import("./core.js").CompatibleRespon
|
|
|
208
219
|
unmonitored: "unmonitored";
|
|
209
220
|
}>>;
|
|
210
221
|
}, z.core.$strip>>;
|
|
222
|
+
page: z.ZodOptional<z.ZodObject<{
|
|
223
|
+
readonly total: z.ZodNumber;
|
|
224
|
+
readonly limit: z.ZodNumber;
|
|
225
|
+
readonly offset: z.ZodNumber;
|
|
226
|
+
readonly hasMore: z.ZodBoolean;
|
|
227
|
+
}, z.core.$strip>>;
|
|
211
228
|
total: z.ZodNumber;
|
|
212
229
|
coverage: z.ZodEnum<{
|
|
213
230
|
"issues-open": "issues-open";
|
|
@@ -276,6 +293,12 @@ export declare const pageInspectResponseSchema: import("./core.js").CompatibleRe
|
|
|
276
293
|
unmonitored: "unmonitored";
|
|
277
294
|
}>>;
|
|
278
295
|
}, z.core.$strip>>;
|
|
296
|
+
page: z.ZodObject<{
|
|
297
|
+
readonly total: z.ZodNumber;
|
|
298
|
+
readonly limit: z.ZodNumber;
|
|
299
|
+
readonly offset: z.ZodNumber;
|
|
300
|
+
readonly hasMore: z.ZodBoolean;
|
|
301
|
+
}, z.core.$strip>;
|
|
279
302
|
total: z.ZodNumber;
|
|
280
303
|
coverage: z.ZodEnum<{
|
|
281
304
|
"issues-open": "issues-open";
|
|
@@ -348,6 +371,12 @@ export declare const pageInspectResponseSchema: import("./core.js").CompatibleRe
|
|
|
348
371
|
unmonitored: "unmonitored";
|
|
349
372
|
}>>;
|
|
350
373
|
}, z.core.$strip>>;
|
|
374
|
+
page: z.ZodOptional<z.ZodObject<{
|
|
375
|
+
readonly total: z.ZodNumber;
|
|
376
|
+
readonly limit: z.ZodNumber;
|
|
377
|
+
readonly offset: z.ZodNumber;
|
|
378
|
+
readonly hasMore: z.ZodBoolean;
|
|
379
|
+
}, z.core.$strip>>;
|
|
351
380
|
total: z.ZodNumber;
|
|
352
381
|
coverage: z.ZodEnum<{
|
|
353
382
|
"issues-open": "issues-open";
|
|
@@ -480,6 +509,11 @@ export declare const pageScanResponseSchema: import("./core.js").CompatibleRespo
|
|
|
480
509
|
}, z.core.$strip>>;
|
|
481
510
|
export type PageInspectQuery = z.output<typeof pageInspectQuerySchema>;
|
|
482
511
|
export type PageInspect = z.output<typeof pageInspectDataSchema.producer>;
|
|
512
|
+
/**
|
|
513
|
+
* What a consumer receives. Additive fields are optional here, so a client
|
|
514
|
+
* newer than the deployed server still parses its answers.
|
|
515
|
+
*/
|
|
516
|
+
export type PageInspectData = z.output<typeof pageInspectDataSchema.client>;
|
|
483
517
|
export type PageScanBody = z.output<typeof pageScanBodySchema>;
|
|
484
518
|
export type PageScan = z.output<typeof pageScanDataSchema.producer>;
|
|
485
519
|
export declare const pageInspectOperation: {
|
|
@@ -548,6 +582,12 @@ export declare const pageInspectOperation: {
|
|
|
548
582
|
unmonitored: "unmonitored";
|
|
549
583
|
}>>;
|
|
550
584
|
}, z.core.$strip>>;
|
|
585
|
+
page: z.ZodObject<{
|
|
586
|
+
readonly total: z.ZodNumber;
|
|
587
|
+
readonly limit: z.ZodNumber;
|
|
588
|
+
readonly offset: z.ZodNumber;
|
|
589
|
+
readonly hasMore: z.ZodBoolean;
|
|
590
|
+
}, z.core.$strip>;
|
|
551
591
|
total: z.ZodNumber;
|
|
552
592
|
coverage: z.ZodEnum<{
|
|
553
593
|
"issues-open": "issues-open";
|
|
@@ -620,6 +660,12 @@ export declare const pageInspectOperation: {
|
|
|
620
660
|
unmonitored: "unmonitored";
|
|
621
661
|
}>>;
|
|
622
662
|
}, z.core.$strip>>;
|
|
663
|
+
page: z.ZodOptional<z.ZodObject<{
|
|
664
|
+
readonly total: z.ZodNumber;
|
|
665
|
+
readonly limit: z.ZodNumber;
|
|
666
|
+
readonly offset: z.ZodNumber;
|
|
667
|
+
readonly hasMore: z.ZodBoolean;
|
|
668
|
+
}, z.core.$strip>>;
|
|
623
669
|
total: z.ZodNumber;
|
|
624
670
|
coverage: z.ZodEnum<{
|
|
625
671
|
"issues-open": "issues-open";
|
|
@@ -664,7 +710,7 @@ export declare const pageInspectOperation: {
|
|
|
664
710
|
}, z.core.$loose>;
|
|
665
711
|
}, z.core.$strip>>;
|
|
666
712
|
};
|
|
667
|
-
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "rate_limited", "contract_violation", "internal_error"];
|
|
713
|
+
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "conflict", "rate_limited", "contract_violation", "internal_error"];
|
|
668
714
|
readonly errorResponse: import("./core.js").CompatibleResponseSchema<z.ZodObject<{
|
|
669
715
|
readonly error: z.ZodObject<{
|
|
670
716
|
code: z.ZodEnum<{
|
|
@@ -760,6 +806,12 @@ export declare const pageInspectOperation: {
|
|
|
760
806
|
};
|
|
761
807
|
readonly observations: {
|
|
762
808
|
readonly rows: readonly [];
|
|
809
|
+
readonly page: {
|
|
810
|
+
readonly total: 0;
|
|
811
|
+
readonly limit: 100;
|
|
812
|
+
readonly offset: 0;
|
|
813
|
+
readonly hasMore: false;
|
|
814
|
+
};
|
|
763
815
|
readonly total: 0;
|
|
764
816
|
readonly coverage: 'never-scanned';
|
|
765
817
|
readonly pagination: {
|
|
@@ -1804,6 +1856,12 @@ export declare const pagesV1Registry: import("./core.js").PublicV1Registry<{
|
|
|
1804
1856
|
unmonitored: "unmonitored";
|
|
1805
1857
|
}>>;
|
|
1806
1858
|
}, z.core.$strip>>;
|
|
1859
|
+
page: z.ZodObject<{
|
|
1860
|
+
readonly total: z.ZodNumber;
|
|
1861
|
+
readonly limit: z.ZodNumber;
|
|
1862
|
+
readonly offset: z.ZodNumber;
|
|
1863
|
+
readonly hasMore: z.ZodBoolean;
|
|
1864
|
+
}, z.core.$strip>;
|
|
1807
1865
|
total: z.ZodNumber;
|
|
1808
1866
|
coverage: z.ZodEnum<{
|
|
1809
1867
|
"issues-open": "issues-open";
|
|
@@ -1876,6 +1934,12 @@ export declare const pagesV1Registry: import("./core.js").PublicV1Registry<{
|
|
|
1876
1934
|
unmonitored: "unmonitored";
|
|
1877
1935
|
}>>;
|
|
1878
1936
|
}, z.core.$strip>>;
|
|
1937
|
+
page: z.ZodOptional<z.ZodObject<{
|
|
1938
|
+
readonly total: z.ZodNumber;
|
|
1939
|
+
readonly limit: z.ZodNumber;
|
|
1940
|
+
readonly offset: z.ZodNumber;
|
|
1941
|
+
readonly hasMore: z.ZodBoolean;
|
|
1942
|
+
}, z.core.$strip>>;
|
|
1879
1943
|
total: z.ZodNumber;
|
|
1880
1944
|
coverage: z.ZodEnum<{
|
|
1881
1945
|
"issues-open": "issues-open";
|
|
@@ -1920,7 +1984,7 @@ export declare const pagesV1Registry: import("./core.js").PublicV1Registry<{
|
|
|
1920
1984
|
}, z.core.$loose>;
|
|
1921
1985
|
}, z.core.$strip>>;
|
|
1922
1986
|
};
|
|
1923
|
-
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "rate_limited", "contract_violation", "internal_error"];
|
|
1987
|
+
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "conflict", "rate_limited", "contract_violation", "internal_error"];
|
|
1924
1988
|
readonly errorResponse: import("./core.js").CompatibleResponseSchema<z.ZodObject<{
|
|
1925
1989
|
readonly error: z.ZodObject<{
|
|
1926
1990
|
code: z.ZodEnum<{
|
|
@@ -2016,6 +2080,12 @@ export declare const pagesV1Registry: import("./core.js").PublicV1Registry<{
|
|
|
2016
2080
|
};
|
|
2017
2081
|
readonly observations: {
|
|
2018
2082
|
readonly rows: readonly [];
|
|
2083
|
+
readonly page: {
|
|
2084
|
+
readonly total: 0;
|
|
2085
|
+
readonly limit: 100;
|
|
2086
|
+
readonly offset: 0;
|
|
2087
|
+
readonly hasMore: false;
|
|
2088
|
+
};
|
|
2019
2089
|
readonly total: 0;
|
|
2020
2090
|
readonly coverage: 'never-scanned';
|
|
2021
2091
|
readonly pagination: {
|
package/dist/v1/pages.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z as schema } from 'zod';
|
|
2
|
-
import { defineOperation, defineRegistry, defineResponseObject, defineSuccessEnvelope, publicV1BooleanFlag, publicV1ErrorEnvelope, publicV1StandardRatePolicy, } from './core.js';
|
|
2
|
+
import { defineOperation, defineRegistry, defineResponseObject, defineSuccessEnvelope, publicV1BooleanFlag, publicV1ErrorEnvelope, publicV1PageSchema, publicV1StandardRatePolicy, } from './core.js';
|
|
3
3
|
export const pageSiteParamsSchema = schema.strictObject({
|
|
4
4
|
siteId: schema.string().min(1),
|
|
5
5
|
});
|
|
@@ -37,6 +37,11 @@ export const pageObservationSchema = defineResponseObject({
|
|
|
37
37
|
resolvedAt: schema.string().datetime().nullable(),
|
|
38
38
|
resolution: schema.enum(['fixed', 'removed', 'excluded', 'unmonitored', 'expired']).nullable(),
|
|
39
39
|
});
|
|
40
|
+
/**
|
|
41
|
+
* The latest Lighthouse Scan for one page. The four category scores run from 0
|
|
42
|
+
* to 100. `lcp` and `tbt` are milliseconds. `cls` is the unitless Cumulative
|
|
43
|
+
* Layout Shift value at the Lighthouse scale, so `0.1` is the "good" threshold.
|
|
44
|
+
*/
|
|
40
45
|
export const pageLighthouseSchema = defineResponseObject({
|
|
41
46
|
scanId: schema.string().min(1),
|
|
42
47
|
strategy: schema.enum(['mobile', 'desktop']),
|
|
@@ -86,8 +91,16 @@ export const pageInspectDataSchema = defineResponseObject({
|
|
|
86
91
|
}),
|
|
87
92
|
observations: schema.strictObject({
|
|
88
93
|
rows: schema.array(pageObservationSchema.producer),
|
|
94
|
+
/**
|
|
95
|
+
* The converged list envelope. `data.page` already names the inspected
|
|
96
|
+
* Page here, so the list envelope sits beside its own `rows`.
|
|
97
|
+
*/
|
|
98
|
+
page: publicV1PageSchema.producer,
|
|
89
99
|
total: schema.number().int().nonnegative(),
|
|
90
100
|
coverage: pageObservationCoverageSchema,
|
|
101
|
+
/**
|
|
102
|
+
* Deprecated alias of `page`. Kept for one minor version, then removed.
|
|
103
|
+
*/
|
|
91
104
|
pagination: schema.strictObject({
|
|
92
105
|
limit: schema.number().int().positive(),
|
|
93
106
|
offset: schema.number().int().nonnegative(),
|
|
@@ -107,6 +120,7 @@ export const pageInspectDataSchema = defineResponseObject({
|
|
|
107
120
|
}),
|
|
108
121
|
observations: schema.looseObject({
|
|
109
122
|
rows: schema.array(pageObservationSchema.client),
|
|
123
|
+
page: publicV1PageSchema.client.optional(),
|
|
110
124
|
total: schema.number().int().nonnegative(),
|
|
111
125
|
coverage: pageObservationCoverageSchema,
|
|
112
126
|
pagination: schema.looseObject({
|
|
@@ -168,6 +182,7 @@ export const pageInspectOperation = defineOperation({
|
|
|
168
182
|
'auth_expired',
|
|
169
183
|
'forbidden',
|
|
170
184
|
'not_found',
|
|
185
|
+
'conflict',
|
|
171
186
|
'rate_limited',
|
|
172
187
|
'contract_violation',
|
|
173
188
|
'internal_error',
|
|
@@ -200,6 +215,7 @@ export const pageInspectOperation = defineOperation({
|
|
|
200
215
|
page: { url: 'https://example.com/guide', path: '/guide' },
|
|
201
216
|
observations: {
|
|
202
217
|
rows: [],
|
|
218
|
+
page: { total: 0, limit: 100, offset: 0, hasMore: false },
|
|
203
219
|
total: 0,
|
|
204
220
|
coverage: 'never-scanned',
|
|
205
221
|
pagination: { limit: 100, offset: 0, hasMore: false },
|
package/dist/v1/performance.d.ts
CHANGED
|
@@ -35,6 +35,12 @@ export declare const performanceVitalSummarySchema: import("./core.js").Compatib
|
|
|
35
35
|
poor: z.ZodNumber;
|
|
36
36
|
}, z.core.$loose>;
|
|
37
37
|
}, z.core.$strip>>;
|
|
38
|
+
/**
|
|
39
|
+
* Medians across the Site's latest Scans. Units follow the field: `perf`,
|
|
40
|
+
* `a11y`, `bestPractices` and `seo` are scores from 0 to 100, `lcp` and `tbt`
|
|
41
|
+
* are milliseconds, and `cls` is the unitless Cumulative Layout Shift value.
|
|
42
|
+
* `statusCounts` counts Scans in the good, needs-improvement and poor bands.
|
|
43
|
+
*/
|
|
38
44
|
export declare const sitePerformanceHealthSchema: import("./core.js").CompatibleResponseSchema<z.ZodObject<{
|
|
39
45
|
readonly perf: z.ZodObject<{
|
|
40
46
|
readonly median: z.ZodNullable<z.ZodNumber>;
|
|
@@ -841,7 +847,7 @@ export declare const sitePerformanceOverviewOperation: {
|
|
|
841
847
|
}, z.core.$loose>;
|
|
842
848
|
}, z.core.$strip>>;
|
|
843
849
|
};
|
|
844
|
-
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "rate_limited", "contract_violation", "internal_error"];
|
|
850
|
+
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "conflict", "rate_limited", "contract_violation", "internal_error"];
|
|
845
851
|
readonly errorResponse: import("./core.js").CompatibleResponseSchema<z.ZodObject<{
|
|
846
852
|
readonly error: z.ZodObject<{
|
|
847
853
|
code: z.ZodEnum<{
|
|
@@ -962,8 +968,8 @@ export declare const sitePerformanceOverviewOperation: {
|
|
|
962
968
|
};
|
|
963
969
|
};
|
|
964
970
|
readonly cls: {
|
|
965
|
-
readonly median:
|
|
966
|
-
readonly worst:
|
|
971
|
+
readonly median: 0.08;
|
|
972
|
+
readonly worst: 0.26;
|
|
967
973
|
readonly statusCounts: {
|
|
968
974
|
readonly good: 4;
|
|
969
975
|
readonly ni: 0;
|
|
@@ -1490,7 +1496,7 @@ export declare const fieldVitalsOperation: {
|
|
|
1490
1496
|
}, z.core.$loose>;
|
|
1491
1497
|
}, z.core.$strip>>;
|
|
1492
1498
|
};
|
|
1493
|
-
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "rate_limited", "contract_violation", "internal_error"];
|
|
1499
|
+
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "conflict", "rate_limited", "contract_violation", "internal_error"];
|
|
1494
1500
|
readonly errorResponse: import("./core.js").CompatibleResponseSchema<z.ZodObject<{
|
|
1495
1501
|
readonly error: z.ZodObject<{
|
|
1496
1502
|
code: z.ZodEnum<{
|
|
@@ -1877,7 +1883,7 @@ export declare const fieldVitalFindingsOperation: {
|
|
|
1877
1883
|
}, z.core.$loose>;
|
|
1878
1884
|
}, z.core.$strip>>;
|
|
1879
1885
|
};
|
|
1880
|
-
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "rate_limited", "contract_violation", "internal_error"];
|
|
1886
|
+
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "conflict", "rate_limited", "contract_violation", "internal_error"];
|
|
1881
1887
|
readonly errorResponse: import("./core.js").CompatibleResponseSchema<z.ZodObject<{
|
|
1882
1888
|
readonly error: z.ZodObject<{
|
|
1883
1889
|
code: z.ZodEnum<{
|
|
@@ -2215,7 +2221,7 @@ export declare const performanceScansOperation: {
|
|
|
2215
2221
|
}, z.core.$loose>;
|
|
2216
2222
|
}, z.core.$strip>>;
|
|
2217
2223
|
};
|
|
2218
|
-
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "rate_limited", "contract_violation", "internal_error"];
|
|
2224
|
+
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "conflict", "rate_limited", "contract_violation", "internal_error"];
|
|
2219
2225
|
readonly errorResponse: import("./core.js").CompatibleResponseSchema<z.ZodObject<{
|
|
2220
2226
|
readonly error: z.ZodObject<{
|
|
2221
2227
|
code: z.ZodEnum<{
|
|
@@ -2454,7 +2460,7 @@ export declare const monitoredPagesOperation: {
|
|
|
2454
2460
|
}, z.core.$loose>;
|
|
2455
2461
|
}, z.core.$strip>>;
|
|
2456
2462
|
};
|
|
2457
|
-
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "rate_limited", "contract_violation", "internal_error"];
|
|
2463
|
+
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "conflict", "rate_limited", "contract_violation", "internal_error"];
|
|
2458
2464
|
readonly errorResponse: import("./core.js").CompatibleResponseSchema<z.ZodObject<{
|
|
2459
2465
|
readonly error: z.ZodObject<{
|
|
2460
2466
|
code: z.ZodEnum<{
|
|
@@ -3246,7 +3252,7 @@ export declare const performanceScanDetailOperation: {
|
|
|
3246
3252
|
}, z.core.$loose>;
|
|
3247
3253
|
}, z.core.$strip>>;
|
|
3248
3254
|
};
|
|
3249
|
-
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "rate_limited", "contract_violation", "internal_error"];
|
|
3255
|
+
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "conflict", "rate_limited", "contract_violation", "internal_error"];
|
|
3250
3256
|
readonly errorResponse: import("./core.js").CompatibleResponseSchema<z.ZodObject<{
|
|
3251
3257
|
readonly error: z.ZodObject<{
|
|
3252
3258
|
code: z.ZodEnum<{
|
|
@@ -3618,7 +3624,7 @@ export declare const performanceV1Registry: import("./core.js").PublicV1Registry
|
|
|
3618
3624
|
}, z.core.$loose>;
|
|
3619
3625
|
}, z.core.$strip>>;
|
|
3620
3626
|
};
|
|
3621
|
-
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "rate_limited", "contract_violation", "internal_error"];
|
|
3627
|
+
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "conflict", "rate_limited", "contract_violation", "internal_error"];
|
|
3622
3628
|
readonly errorResponse: import("./core.js").CompatibleResponseSchema<z.ZodObject<{
|
|
3623
3629
|
readonly error: z.ZodObject<{
|
|
3624
3630
|
code: z.ZodEnum<{
|
|
@@ -3739,8 +3745,8 @@ export declare const performanceV1Registry: import("./core.js").PublicV1Registry
|
|
|
3739
3745
|
};
|
|
3740
3746
|
};
|
|
3741
3747
|
readonly cls: {
|
|
3742
|
-
readonly median:
|
|
3743
|
-
readonly worst:
|
|
3748
|
+
readonly median: 0.08;
|
|
3749
|
+
readonly worst: 0.26;
|
|
3744
3750
|
readonly statusCounts: {
|
|
3745
3751
|
readonly good: 4;
|
|
3746
3752
|
readonly ni: 0;
|
|
@@ -3947,7 +3953,7 @@ export declare const performanceV1Registry: import("./core.js").PublicV1Registry
|
|
|
3947
3953
|
}, z.core.$loose>;
|
|
3948
3954
|
}, z.core.$strip>>;
|
|
3949
3955
|
};
|
|
3950
|
-
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "rate_limited", "contract_violation", "internal_error"];
|
|
3956
|
+
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "conflict", "rate_limited", "contract_violation", "internal_error"];
|
|
3951
3957
|
readonly errorResponse: import("./core.js").CompatibleResponseSchema<z.ZodObject<{
|
|
3952
3958
|
readonly error: z.ZodObject<{
|
|
3953
3959
|
code: z.ZodEnum<{
|
|
@@ -4175,7 +4181,7 @@ export declare const performanceV1Registry: import("./core.js").PublicV1Registry
|
|
|
4175
4181
|
}, z.core.$loose>;
|
|
4176
4182
|
}, z.core.$strip>>;
|
|
4177
4183
|
};
|
|
4178
|
-
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "rate_limited", "contract_violation", "internal_error"];
|
|
4184
|
+
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "conflict", "rate_limited", "contract_violation", "internal_error"];
|
|
4179
4185
|
readonly errorResponse: import("./core.js").CompatibleResponseSchema<z.ZodObject<{
|
|
4180
4186
|
readonly error: z.ZodObject<{
|
|
4181
4187
|
code: z.ZodEnum<{
|
|
@@ -4372,7 +4378,7 @@ export declare const performanceV1Registry: import("./core.js").PublicV1Registry
|
|
|
4372
4378
|
}, z.core.$loose>;
|
|
4373
4379
|
}, z.core.$strip>>;
|
|
4374
4380
|
};
|
|
4375
|
-
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "rate_limited", "contract_violation", "internal_error"];
|
|
4381
|
+
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "conflict", "rate_limited", "contract_violation", "internal_error"];
|
|
4376
4382
|
readonly errorResponse: import("./core.js").CompatibleResponseSchema<z.ZodObject<{
|
|
4377
4383
|
readonly error: z.ZodObject<{
|
|
4378
4384
|
code: z.ZodEnum<{
|
|
@@ -4547,7 +4553,7 @@ export declare const performanceV1Registry: import("./core.js").PublicV1Registry
|
|
|
4547
4553
|
}, z.core.$loose>;
|
|
4548
4554
|
}, z.core.$strip>>;
|
|
4549
4555
|
};
|
|
4550
|
-
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "rate_limited", "contract_violation", "internal_error"];
|
|
4556
|
+
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "conflict", "rate_limited", "contract_violation", "internal_error"];
|
|
4551
4557
|
readonly errorResponse: import("./core.js").CompatibleResponseSchema<z.ZodObject<{
|
|
4552
4558
|
readonly error: z.ZodObject<{
|
|
4553
4559
|
code: z.ZodEnum<{
|
|
@@ -4870,7 +4876,7 @@ export declare const performanceV1Registry: import("./core.js").PublicV1Registry
|
|
|
4870
4876
|
}, z.core.$loose>;
|
|
4871
4877
|
}, z.core.$strip>>;
|
|
4872
4878
|
};
|
|
4873
|
-
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "rate_limited", "contract_violation", "internal_error"];
|
|
4879
|
+
readonly errors: readonly ["invalid_request", "unauthorized", "auth_expired", "forbidden", "not_found", "conflict", "rate_limited", "contract_violation", "internal_error"];
|
|
4874
4880
|
readonly errorResponse: import("./core.js").CompatibleResponseSchema<z.ZodObject<{
|
|
4875
4881
|
readonly error: z.ZodObject<{
|
|
4876
4882
|
code: z.ZodEnum<{
|