@gscdump/contracts 5.8.1 → 5.9.1

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.
@@ -13,6 +13,7 @@ import { GSCDUMP_V1_ANALYTICS_DIMENSIONS, createGscdumpV1BrowserSchemas } from "
13
13
  import { googleSubmissionReceiptV1Schemas, googleSubmitV1Schema, indexingApiGrantUpdateV1Schema, indexingApiGrantV1Schemas, siteIndexingApiGrantV1Schemas } from "./google-indexing.mjs";
14
14
  import { indexNowConfigureV1Schema, indexNowConnectionV1Schemas, indexNowSubmissionReceiptV1Schemas, indexNowSubmitV1Schema } from "./indexnow.mjs";
15
15
  import { gscdumpV1OperationRoute, gscdumpV1Surface } from "./route-catalog.mjs";
16
+ import { sitemapEvidenceV1Schemas, sitemapInspectQueryV1Schema } from "./sitemap-evidence.mjs";
16
17
  import { sitemapSubmissionV1Schemas, sitemapSubmitResultV1Schemas } from "./sitemap-submission.mjs";
17
18
  import { z } from "zod";
18
19
  function errorEnvelopeSchemas(codes, publicRequestId) {
@@ -294,6 +295,7 @@ function createGscdumpV1Protocol() {
294
295
  const bingLinkResponse = defineSuccessResponse(bingLinkResultV1Schemas, partnerResponseMeta);
295
296
  const bingAuthorizationResponse = defineSuccessResponse(bingAuthorizationV1Schemas, partnerResponseMeta);
296
297
  const bingSitemapSubmitResponse = defineSuccessResponse(bingSitemapSubmitResultV1Schemas, partnerResponseMeta);
298
+ const sitemapEvidenceResponse = defineSuccessResponse(sitemapEvidenceV1Schemas, partnerResponseMeta);
297
299
  const sitemapSubmissionResponse = defineSuccessResponse(sitemapSubmissionV1Schemas, partnerResponseMeta);
298
300
  const sitemapSubmitResponse = defineSuccessResponse(sitemapSubmitResultV1Schemas, partnerResponseMeta);
299
301
  const indexingTransition = defineResponseObject({
@@ -2973,6 +2975,84 @@ function createGscdumpV1Protocol() {
2973
2975
  }
2974
2976
  }
2975
2977
  }),
2978
+ inspectSiteSitemap: defineHttpOperation({
2979
+ ...gscdumpV1OperationRoute("partner.sites.sitemaps.inspect"),
2980
+ visibility: "public",
2981
+ semantics: {
2982
+ kind: "query",
2983
+ sideEffects: "none",
2984
+ idempotent: true,
2985
+ retry: "idempotent",
2986
+ readConsistency: "primary"
2987
+ },
2988
+ auth: {
2989
+ credentials: ["user_key", "partner_key"],
2990
+ scopes: ["sitemaps:read"],
2991
+ ownership: [{
2992
+ credential: "user_key",
2993
+ rule: "authorized_site"
2994
+ }, {
2995
+ credential: "partner_key",
2996
+ rule: "authorized_site"
2997
+ }]
2998
+ },
2999
+ request: {
3000
+ params: z.strictObject({ siteId: realtimeSchemas.publicSiteId }),
3001
+ query: sitemapInspectQueryV1Schema,
3002
+ headers: requestHeaders,
3003
+ body: null
3004
+ },
3005
+ responses: { 200: sitemapEvidenceResponse },
3006
+ errors: partnerSiteErrors,
3007
+ errorResponse: errorEnvelopeSchemas(partnerSiteErrors, realtimeSchemas.publicRequestId),
3008
+ resources: {
3009
+ reads: [{
3010
+ type: "site.sitemaps",
3011
+ idFrom: "params.siteId"
3012
+ }],
3013
+ changes: []
3014
+ },
3015
+ lifecycle: { introduced: "5.9.0" },
3016
+ docs: {
3017
+ summary: "Inspect a Sitemap",
3018
+ description: "Reads provider evidence for one exact Sitemap URL. Google uses a live read. Bing uses its dated stored read. Missing means the provider did not list that exact Sitemap at Capture time. Unavailable never means missing. This operation submits nothing.",
3019
+ tags: ["Sitemaps"],
3020
+ examples: {
3021
+ request: {
3022
+ params: { siteId: "s_01" },
3023
+ query: {
3024
+ searchEngine: "google",
3025
+ url: "https://example.com/sitemap-old.xml"
3026
+ }
3027
+ },
3028
+ response: {
3029
+ data: {
3030
+ searchEngine: "google",
3031
+ sitemapUrl: "https://example.com/sitemap-old.xml",
3032
+ capture: {
3033
+ _tag: "captured",
3034
+ source: "live",
3035
+ capturedAt: "2026-10-08T02:00:00.000Z"
3036
+ },
3037
+ state: {
3038
+ _tag: "listed",
3039
+ lastSubmitted: null,
3040
+ lastDownloaded: null,
3041
+ isPending: true,
3042
+ errors: 0,
3043
+ warnings: 0,
3044
+ urlCount: null
3045
+ }
3046
+ },
3047
+ meta: {
3048
+ requestId: "req_01",
3049
+ surface: "partner",
3050
+ version: "1.0"
3051
+ }
3052
+ }
3053
+ }
3054
+ }
3055
+ }),
2976
3056
  getSiteSitemapSubmission: defineHttpOperation({
2977
3057
  ...gscdumpV1OperationRoute("partner.sites.sitemaps.submission.get"),
2978
3058
  visibility: "public",
@@ -6747,6 +6827,7 @@ function createGscdumpV1Protocol() {
6747
6827
  bingLinkResponse,
6748
6828
  bingAuthorizationResponse,
6749
6829
  bingSitemapSubmitResponse,
6830
+ sitemapEvidenceResponse,
6750
6831
  sitemapSubmissionResponse,
6751
6832
  sitemapSubmitResponse,
6752
6833
  lifecycleResponse,
@@ -211,6 +211,11 @@ export declare const GSCDUMP_V1_ROUTE_CATALOG: {
211
211
  readonly method: "GET";
212
212
  readonly template: "/sites/{siteId}/sitemaps/changes";
213
213
  };
214
+ readonly 'partner.sites.sitemaps.inspect': {
215
+ readonly surface: "partner";
216
+ readonly method: "GET";
217
+ readonly template: "/sites/{siteId}/sitemaps/inspect";
218
+ };
214
219
  readonly 'partner.sites.sitemaps.submission.get': {
215
220
  readonly surface: "partner";
216
221
  readonly method: "GET";
@@ -198,6 +198,11 @@ const GSCDUMP_V1_ROUTE_CATALOG = {
198
198
  method: "GET",
199
199
  template: "/sites/{siteId}/sitemaps/changes"
200
200
  },
201
+ "partner.sites.sitemaps.inspect": {
202
+ surface: "partner",
203
+ method: "GET",
204
+ template: "/sites/{siteId}/sitemaps/inspect"
205
+ },
201
206
  "partner.sites.sitemaps.submission.get": {
202
207
  surface: "partner",
203
208
  method: "GET",
@@ -0,0 +1,145 @@
1
+ import { z } from "zod";
2
+ export declare const sitemapInspectQueryV1Schema: z.ZodObject<{
3
+ searchEngine: z.ZodEnum<{
4
+ google: "google";
5
+ bing: "bing";
6
+ }>;
7
+ url: z.ZodURL;
8
+ }, z.core.$strict>;
9
+ /** Exact provider listing evidence. Missing requires a successful dated read. */
10
+ export declare const sitemapEvidenceV1Schemas: {
11
+ producer: z.ZodUnion<readonly [z.ZodObject<{
12
+ readonly searchEngine: z.ZodLiteral<"google">;
13
+ readonly sitemapUrl: z.ZodURL;
14
+ readonly capture: z.ZodObject<{
15
+ readonly _tag: z.ZodLiteral<"captured">;
16
+ readonly source: z.ZodEnum<{
17
+ live: "live";
18
+ stored: "stored";
19
+ }>;
20
+ readonly capturedAt: z.ZodISODateTime;
21
+ }, z.core.$strip>;
22
+ readonly state: z.ZodDiscriminatedUnion<[z.ZodObject<{
23
+ readonly _tag: z.ZodLiteral<"listed">;
24
+ readonly lastSubmitted: z.ZodNullable<z.ZodISODateTime>;
25
+ readonly lastDownloaded: z.ZodNullable<z.ZodISODateTime>;
26
+ readonly isPending: z.ZodBoolean;
27
+ readonly errors: z.ZodNumber;
28
+ readonly warnings: z.ZodNumber;
29
+ readonly urlCount: z.ZodNullable<z.ZodNumber>;
30
+ }, z.core.$strip>, z.ZodObject<{
31
+ readonly _tag: z.ZodLiteral<"missing">;
32
+ }, z.core.$strip>], "_tag">;
33
+ }, z.core.$strip>, z.ZodObject<{
34
+ readonly searchEngine: z.ZodLiteral<"bing">;
35
+ readonly sitemapUrl: z.ZodURL;
36
+ readonly capture: z.ZodObject<{
37
+ readonly _tag: z.ZodLiteral<"captured">;
38
+ readonly source: z.ZodEnum<{
39
+ live: "live";
40
+ stored: "stored";
41
+ }>;
42
+ readonly capturedAt: z.ZodISODateTime;
43
+ }, z.core.$strip>;
44
+ readonly state: z.ZodDiscriminatedUnion<[z.ZodObject<{
45
+ readonly _tag: z.ZodLiteral<"listed">;
46
+ readonly status: z.ZodString;
47
+ readonly submittedAt: z.ZodNullable<z.ZodISODateTime>;
48
+ readonly lastCrawledAt: z.ZodNullable<z.ZodISODateTime>;
49
+ readonly urlCount: z.ZodNullable<z.ZodNumber>;
50
+ }, z.core.$strip>, z.ZodObject<{
51
+ readonly _tag: z.ZodLiteral<"missing">;
52
+ }, z.core.$strip>], "_tag">;
53
+ }, z.core.$strip>, z.ZodObject<{
54
+ readonly searchEngine: z.ZodEnum<{
55
+ google: "google";
56
+ bing: "bing";
57
+ }>;
58
+ readonly sitemapUrl: z.ZodURL;
59
+ readonly capture: z.ZodObject<{
60
+ readonly _tag: z.ZodLiteral<"unavailable">;
61
+ }, z.core.$strip>;
62
+ readonly state: z.ZodObject<{
63
+ readonly _tag: z.ZodLiteral<"unavailable">;
64
+ readonly reason: z.ZodEnum<{
65
+ "not-checked": "not-checked";
66
+ "permission-lost": "permission-lost";
67
+ "grant-missing": "grant-missing";
68
+ "provider-unavailable": "provider-unavailable";
69
+ "reauthorization-required": "reauthorization-required";
70
+ "not-enabled": "not-enabled";
71
+ "site-unverified": "site-unverified";
72
+ throttled: "throttled";
73
+ }>;
74
+ readonly retryable: z.ZodBoolean;
75
+ }, z.core.$strip>;
76
+ }, z.core.$strip>]>;
77
+ client: z.ZodUnion<readonly [z.ZodObject<{
78
+ readonly searchEngine: z.ZodLiteral<"google">;
79
+ readonly sitemapUrl: z.ZodURL;
80
+ readonly capture: z.ZodObject<{
81
+ readonly _tag: z.ZodLiteral<"captured">;
82
+ readonly source: z.ZodEnum<{
83
+ live: "live";
84
+ stored: "stored";
85
+ }>;
86
+ readonly capturedAt: z.ZodISODateTime;
87
+ }, z.core.$strip>;
88
+ readonly state: z.ZodDiscriminatedUnion<[z.ZodObject<{
89
+ readonly _tag: z.ZodLiteral<"listed">;
90
+ readonly lastSubmitted: z.ZodNullable<z.ZodISODateTime>;
91
+ readonly lastDownloaded: z.ZodNullable<z.ZodISODateTime>;
92
+ readonly isPending: z.ZodBoolean;
93
+ readonly errors: z.ZodNumber;
94
+ readonly warnings: z.ZodNumber;
95
+ readonly urlCount: z.ZodNullable<z.ZodNumber>;
96
+ }, z.core.$strip>, z.ZodObject<{
97
+ readonly _tag: z.ZodLiteral<"missing">;
98
+ }, z.core.$strip>], "_tag">;
99
+ }, z.core.$strip>, z.ZodObject<{
100
+ readonly searchEngine: z.ZodLiteral<"bing">;
101
+ readonly sitemapUrl: z.ZodURL;
102
+ readonly capture: z.ZodObject<{
103
+ readonly _tag: z.ZodLiteral<"captured">;
104
+ readonly source: z.ZodEnum<{
105
+ live: "live";
106
+ stored: "stored";
107
+ }>;
108
+ readonly capturedAt: z.ZodISODateTime;
109
+ }, z.core.$strip>;
110
+ readonly state: z.ZodDiscriminatedUnion<[z.ZodObject<{
111
+ readonly _tag: z.ZodLiteral<"listed">;
112
+ readonly status: z.ZodString;
113
+ readonly submittedAt: z.ZodNullable<z.ZodISODateTime>;
114
+ readonly lastCrawledAt: z.ZodNullable<z.ZodISODateTime>;
115
+ readonly urlCount: z.ZodNullable<z.ZodNumber>;
116
+ }, z.core.$strip>, z.ZodObject<{
117
+ readonly _tag: z.ZodLiteral<"missing">;
118
+ }, z.core.$strip>], "_tag">;
119
+ }, z.core.$strip>, z.ZodObject<{
120
+ readonly searchEngine: z.ZodEnum<{
121
+ google: "google";
122
+ bing: "bing";
123
+ }>;
124
+ readonly sitemapUrl: z.ZodURL;
125
+ readonly capture: z.ZodObject<{
126
+ readonly _tag: z.ZodLiteral<"unavailable">;
127
+ }, z.core.$strip>;
128
+ readonly state: z.ZodObject<{
129
+ readonly _tag: z.ZodLiteral<"unavailable">;
130
+ readonly reason: z.ZodEnum<{
131
+ "not-checked": "not-checked";
132
+ "permission-lost": "permission-lost";
133
+ "grant-missing": "grant-missing";
134
+ "provider-unavailable": "provider-unavailable";
135
+ "reauthorization-required": "reauthorization-required";
136
+ "not-enabled": "not-enabled";
137
+ "site-unverified": "site-unverified";
138
+ throttled: "throttled";
139
+ }>;
140
+ readonly retryable: z.ZodBoolean;
141
+ }, z.core.$strip>;
142
+ }, z.core.$strip>]>;
143
+ };
144
+ export type SitemapInspectQueryV1 = z.infer<typeof sitemapInspectQueryV1Schema>;
145
+ export type SitemapEvidenceV1 = z.infer<typeof sitemapEvidenceV1Schemas.producer>;
@@ -0,0 +1,93 @@
1
+ import { defineResponseObject } from "./http-core.mjs";
2
+ import { z } from "zod";
3
+ const sitemapUrl = z.url({ protocol: /^https?$/ }).max(2048).refine((value) => {
4
+ const url = new URL(value);
5
+ return !url.username && !url.password && !url.hash;
6
+ }, "Use a Sitemap URL without credentials or a fragment.");
7
+ const sitemapInspectQueryV1Schema = z.strictObject({
8
+ searchEngine: z.enum(["google", "bing"]),
9
+ url: sitemapUrl
10
+ });
11
+ const captured = defineResponseObject({
12
+ _tag: z.literal("captured"),
13
+ source: z.enum(["live", "stored"]),
14
+ capturedAt: z.iso.datetime()
15
+ });
16
+ const unavailableCapture = defineResponseObject({ _tag: z.literal("unavailable") });
17
+ const missing = defineResponseObject({ _tag: z.literal("missing") });
18
+ const unavailable = defineResponseObject({
19
+ _tag: z.literal("unavailable"),
20
+ reason: z.enum([
21
+ "grant-missing",
22
+ "reauthorization-required",
23
+ "permission-lost",
24
+ "site-unverified",
25
+ "not-enabled",
26
+ "not-checked",
27
+ "throttled",
28
+ "provider-unavailable"
29
+ ]),
30
+ retryable: z.boolean()
31
+ });
32
+ const googleListed = defineResponseObject({
33
+ _tag: z.literal("listed"),
34
+ lastSubmitted: z.iso.datetime({ offset: true }).nullable(),
35
+ lastDownloaded: z.iso.datetime({ offset: true }).nullable(),
36
+ isPending: z.boolean(),
37
+ errors: z.number().int().nonnegative(),
38
+ warnings: z.number().int().nonnegative(),
39
+ urlCount: z.number().int().nonnegative().nullable()
40
+ });
41
+ const bingListed = defineResponseObject({
42
+ _tag: z.literal("listed"),
43
+ status: z.string(),
44
+ submittedAt: z.iso.datetime({ offset: true }).nullable(),
45
+ lastCrawledAt: z.iso.datetime({ offset: true }).nullable(),
46
+ urlCount: z.number().int().nonnegative().nullable()
47
+ });
48
+ const google = defineResponseObject({
49
+ searchEngine: z.literal("google"),
50
+ sitemapUrl,
51
+ capture: captured.producer,
52
+ state: z.discriminatedUnion("_tag", [googleListed.producer, missing.producer])
53
+ }, {
54
+ searchEngine: z.literal("google"),
55
+ sitemapUrl,
56
+ capture: captured.client,
57
+ state: z.discriminatedUnion("_tag", [googleListed.client, missing.client])
58
+ });
59
+ const bing = defineResponseObject({
60
+ searchEngine: z.literal("bing"),
61
+ sitemapUrl,
62
+ capture: captured.producer,
63
+ state: z.discriminatedUnion("_tag", [bingListed.producer, missing.producer])
64
+ }, {
65
+ searchEngine: z.literal("bing"),
66
+ sitemapUrl,
67
+ capture: captured.client,
68
+ state: z.discriminatedUnion("_tag", [bingListed.client, missing.client])
69
+ });
70
+ const failed = defineResponseObject({
71
+ searchEngine: z.enum(["google", "bing"]),
72
+ sitemapUrl,
73
+ capture: unavailableCapture.producer,
74
+ state: unavailable.producer
75
+ }, {
76
+ searchEngine: z.enum(["google", "bing"]),
77
+ sitemapUrl,
78
+ capture: unavailableCapture.client,
79
+ state: unavailable.client
80
+ });
81
+ const sitemapEvidenceV1Schemas = {
82
+ producer: z.union([
83
+ google.producer,
84
+ bing.producer,
85
+ failed.producer
86
+ ]),
87
+ client: z.union([
88
+ google.client,
89
+ bing.client,
90
+ failed.client
91
+ ])
92
+ };
93
+ export { sitemapEvidenceV1Schemas, sitemapInspectQueryV1Schema };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gscdump/contracts",
3
3
  "type": "module",
4
- "version": "5.8.1",
4
+ "version": "5.9.1",
5
5
  "description": "Shared gscdump.com API, webhook, realtime, and lifecycle contracts.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",