@nuxtseo/protocol 0.5.7 → 0.5.8
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/gsc.d.ts +529 -0
- package/dist/v1/gsc.js +21 -1
- package/dist/v1/sitemaps.d.ts +1756 -160
- package/dist/v1/sitemaps.js +45 -0
- package/generated/openapi.v1.json +1 -1
- package/package.json +2 -2
package/dist/v1/sitemaps.js
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
import { gscdumpSitemapsResponseSchema, gscdumpSitemapUrlsQuerySchema, gscdumpSitemapUrlsResponseSchema, partnerSitemapActionResponseSchema, partnerSitemapActionSchema, } from '@gscdump/contracts';
|
|
2
|
+
import { sitemapEvidenceV1Schemas, sitemapInspectQueryV1Schema, sitemapSubmissionStateV1Schemas } from '@gscdump/contracts/v1/http';
|
|
2
3
|
import { z as schema } from 'zod';
|
|
3
4
|
import { defineOperation, defineRegistry, defineSuccessEnvelope, publicV1ErrorEnvelope, publicV1StandardRatePolicy, } from './core.js';
|
|
4
5
|
export const siteSitemapParamsSchema = schema.strictObject({ siteId: schema.string().min(1) });
|
|
6
|
+
// Expose the grant's role without exposing the account owner's identity.
|
|
7
|
+
const publicGrantHolder = schema.strictObject({ _tag: schema.enum(['caller', 'site-owner']) });
|
|
8
|
+
const publicSubmissionStates = sitemapSubmissionStateV1Schemas.producer.options.map(state => 'grantHolder' in state.shape ? state.extend({ grantHolder: publicGrantHolder }).strict() : state.strict());
|
|
9
|
+
const publicSubmissionClientStates = sitemapSubmissionStateV1Schemas.client.options.map(state => 'grantHolder' in state.shape ? state.extend({ grantHolder: publicGrantHolder.loose() }).loose() : state.loose());
|
|
10
|
+
export const siteSitemapSubmissionDataSchema = schema.strictObject({
|
|
11
|
+
searchEngine: schema.literal('google'),
|
|
12
|
+
gscPropertyUrl: schema.string().min(1),
|
|
13
|
+
callerCanAct: schema.boolean(),
|
|
14
|
+
state: schema.union([...publicSubmissionStates, schema.strictObject({ _tag: schema.literal('unknown') })]),
|
|
15
|
+
});
|
|
16
|
+
export const siteSitemapSubmissionResponseSchema = defineSuccessEnvelope({
|
|
17
|
+
producer: siteSitemapSubmissionDataSchema,
|
|
18
|
+
client: siteSitemapSubmissionDataSchema.extend({ state: schema.union([...publicSubmissionClientStates, schema.object({ _tag: schema.literal('unknown') }).loose()]) }).loose(),
|
|
19
|
+
});
|
|
20
|
+
export const siteSitemapEvidenceResponseSchema = defineSuccessEnvelope(sitemapEvidenceV1Schemas);
|
|
5
21
|
const [submitSitemapSchema, deleteSitemapSchema] = partnerSitemapActionSchema.options;
|
|
6
22
|
export const siteSitemapActionBodySchema = schema.discriminatedUnion('action', [
|
|
7
23
|
submitSitemapSchema,
|
|
@@ -190,10 +206,39 @@ export const siteSitemapActionCreateOperation = defineOperation({
|
|
|
190
206
|
}],
|
|
191
207
|
},
|
|
192
208
|
});
|
|
209
|
+
export const siteSitemapSubmissionReadOperation = defineOperation({
|
|
210
|
+
...siteSitemapsListOperation,
|
|
211
|
+
id: 'sites.sitemaps.submission.read',
|
|
212
|
+
path: '/api/v1/sites/{siteId}/sitemaps/submission',
|
|
213
|
+
responses: { 200: siteSitemapSubmissionResponseSchema },
|
|
214
|
+
docs: {
|
|
215
|
+
summary: 'Read Site Sitemap submission',
|
|
216
|
+
description: 'Returns site-level Google Sitemap submission readiness. It does not prove submission of an arbitrary Sitemap URL.',
|
|
217
|
+
tags: ['Sites', 'Sitemaps'],
|
|
218
|
+
examples: [{ request: { params: { siteId: 'site_01JXYZ' } }, response: { status: 200, body: { data: { searchEngine: 'google', gscPropertyUrl: 'sc-domain:example.com', callerCanAct: false, state: { _tag: 'not-checked' } }, meta: { requestId: 'req_01JXYZ', version: '1.0' } } } }],
|
|
219
|
+
},
|
|
220
|
+
});
|
|
221
|
+
export const siteSitemapInspectOperation = defineOperation({
|
|
222
|
+
...siteSitemapsListOperation,
|
|
223
|
+
id: 'sites.sitemaps.inspect',
|
|
224
|
+
path: '/api/v1/sites/{siteId}/sitemaps/inspect',
|
|
225
|
+
semantics: { kind: 'query', sideEffects: 'none', retry: 'idempotent', readConsistency: 'primary' },
|
|
226
|
+
request: { params: siteSitemapParamsSchema, query: sitemapInspectQueryV1Schema, headers: null, body: null },
|
|
227
|
+
responses: { 200: siteSitemapEvidenceResponseSchema },
|
|
228
|
+
errors: [...readErrors, 'entitlement_required'],
|
|
229
|
+
docs: {
|
|
230
|
+
summary: 'Inspect one Site Sitemap',
|
|
231
|
+
description: 'Reads exact Sitemap listing evidence from Google live or Bing stored data. Every successful read carries its capture time.',
|
|
232
|
+
tags: ['Sites', 'Sitemaps'],
|
|
233
|
+
examples: [{ request: { params: { siteId: 'site_01JXYZ' }, query: { url: 'https://example.com/sitemap.xml', searchEngine: 'google' } }, response: { status: 200, body: { data: { searchEngine: 'google', sitemapUrl: 'https://example.com/sitemap.xml', capture: { _tag: 'captured', source: 'live', capturedAt: '2026-10-08T00:00:00Z' }, state: { _tag: 'missing' } }, meta: { requestId: 'req_01JXYZ', version: '1.0' } } } }],
|
|
234
|
+
},
|
|
235
|
+
});
|
|
193
236
|
export const sitemapsV1Registry = defineRegistry({
|
|
194
237
|
feature: 'sites',
|
|
195
238
|
operations: {
|
|
196
239
|
list: siteSitemapsListOperation,
|
|
240
|
+
readSubmission: siteSitemapSubmissionReadOperation,
|
|
241
|
+
inspect: siteSitemapInspectOperation,
|
|
197
242
|
listUrls: siteSitemapUrlsListOperation,
|
|
198
243
|
createAction: siteSitemapActionCreateOperation,
|
|
199
244
|
},
|