@nuxtseo/protocol 0.3.0 → 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 +0 -8
- package/dist/v1/actions.d.ts +72 -0
- package/dist/v1/actions.js +14 -0
- package/dist/v1/audit.d.ts +10 -10
- package/dist/v1/audit.js +1 -0
- package/dist/v1/backlinks.d.ts +4 -4
- package/dist/v1/backlinks.js +2 -0
- package/dist/v1/core.d.ts +2 -2
- package/dist/v1/core.js +1 -3
- package/dist/v1/index.d.ts +0 -3
- package/dist/v1/index.js +0 -3
- package/dist/v1/pages.d.ts +2 -2
- package/dist/v1/pages.js +1 -0
- package/dist/v1/performance.d.ts +12 -12
- package/dist/v1/performance.js +6 -0
- package/dist/v1/research.d.ts +2 -2
- package/dist/v1/research.js +1 -0
- package/dist/v1/sitemaps.d.ts +6 -6
- package/dist/v1/sitemaps.js +2 -1
- 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 -2929
- package/dist/v1/content.js +0 -341
package/dist/v1/content.js
DELETED
|
@@ -1,341 +0,0 @@
|
|
|
1
|
-
import { z as schema } from 'zod';
|
|
2
|
-
import { defineOperation, defineRegistry, defineResponseObject, defineSuccessEnvelope, publicV1ErrorEnvelope, publicV1StandardRatePolicy, } from './core.js';
|
|
3
|
-
export const contentBriefStatusSchema = schema.enum([
|
|
4
|
-
'queued',
|
|
5
|
-
'researching',
|
|
6
|
-
'ready',
|
|
7
|
-
'written',
|
|
8
|
-
'published',
|
|
9
|
-
'stale',
|
|
10
|
-
'failed',
|
|
11
|
-
'archived',
|
|
12
|
-
]);
|
|
13
|
-
export const contentBriefSiteParamsSchema = schema.strictObject({
|
|
14
|
-
siteId: schema.string().min(1),
|
|
15
|
-
});
|
|
16
|
-
export const contentBriefParamsSchema = schema.strictObject({
|
|
17
|
-
siteId: schema.string().min(1),
|
|
18
|
-
briefId: schema.string().min(1),
|
|
19
|
-
});
|
|
20
|
-
export const contentBriefListQuerySchema = schema.strictObject({
|
|
21
|
-
status: contentBriefStatusSchema.optional(),
|
|
22
|
-
limit: schema.coerce.number().int().min(1).max(100).default(25),
|
|
23
|
-
offset: schema.coerce.number().int().nonnegative().default(0),
|
|
24
|
-
});
|
|
25
|
-
export const contentBriefCreateBodySchema = schema.strictObject({
|
|
26
|
-
keyword: schema.string().min(1).max(200).transform(keyword => keyword.trim()),
|
|
27
|
-
targetPage: schema.url().optional(),
|
|
28
|
-
currentRank: schema.number().optional(),
|
|
29
|
-
currentImpressions: schema.number().int().optional(),
|
|
30
|
-
currentClicks: schema.number().int().optional(),
|
|
31
|
-
});
|
|
32
|
-
const contentBriefSerpResultShape = {
|
|
33
|
-
position: schema.number(),
|
|
34
|
-
url: schema.url(),
|
|
35
|
-
title: schema.string(),
|
|
36
|
-
domain: schema.string(),
|
|
37
|
-
snippet: schema.string().optional(),
|
|
38
|
-
wordCount: schema.number().int().nonnegative().optional(),
|
|
39
|
-
};
|
|
40
|
-
export const contentBriefSerpResultSchema = defineResponseObject(contentBriefSerpResultShape);
|
|
41
|
-
const contentBriefPaaItemShape = {
|
|
42
|
-
question: schema.string(),
|
|
43
|
-
answer: schema.string().optional(),
|
|
44
|
-
};
|
|
45
|
-
export const contentBriefPaaItemSchema = defineResponseObject(contentBriefPaaItemShape);
|
|
46
|
-
const contentBriefSerpSnapshotShape = {
|
|
47
|
-
fetchedAt: schema.iso.datetime(),
|
|
48
|
-
topResults: schema.array(contentBriefSerpResultSchema.producer),
|
|
49
|
-
paa: schema.array(contentBriefPaaItemSchema.producer).optional(),
|
|
50
|
-
aiOverviewPresent: schema.boolean().optional(),
|
|
51
|
-
serpFeatures: schema.array(schema.string()).optional(),
|
|
52
|
-
medianWordCount: schema.number().int().nonnegative().optional(),
|
|
53
|
-
};
|
|
54
|
-
export const contentBriefSerpSnapshotSchema = defineResponseObject(contentBriefSerpSnapshotShape, {
|
|
55
|
-
...contentBriefSerpSnapshotShape,
|
|
56
|
-
topResults: schema.array(contentBriefSerpResultSchema.client),
|
|
57
|
-
paa: schema.array(contentBriefPaaItemSchema.client).optional(),
|
|
58
|
-
});
|
|
59
|
-
const contentBriefOutlineItemShape = {
|
|
60
|
-
level: schema.enum(['h1', 'h2', 'h3']),
|
|
61
|
-
heading: schema.string(),
|
|
62
|
-
tag: schema.enum(['intent-match', 'your-strength', 'gap', 'from-paa', 'from-aio']).optional(),
|
|
63
|
-
annotation: schema.string().optional(),
|
|
64
|
-
wordCountTarget: schema.number().int().nonnegative().optional(),
|
|
65
|
-
sourceResultUrls: schema.array(schema.url()).optional(),
|
|
66
|
-
existingCoverageExcerpt: schema.string().optional(),
|
|
67
|
-
existingCoverageUrl: schema.url().optional(),
|
|
68
|
-
};
|
|
69
|
-
export const contentBriefOutlineItemSchema = defineResponseObject(contentBriefOutlineItemShape);
|
|
70
|
-
const contentBriefInternalLinkShape = {
|
|
71
|
-
url: schema.url(),
|
|
72
|
-
impressions: schema.number().int().optional(),
|
|
73
|
-
position: schema.number().optional(),
|
|
74
|
-
reasoning: schema.string(),
|
|
75
|
-
anchorSuggestion: schema.string().optional(),
|
|
76
|
-
excerpt: schema.string().optional(),
|
|
77
|
-
};
|
|
78
|
-
export const contentBriefInternalLinkSchema = defineResponseObject(contentBriefInternalLinkShape);
|
|
79
|
-
const contentBriefPayloadProducerShape = {
|
|
80
|
-
targetPage: schema.url().optional(),
|
|
81
|
-
currentRank: schema.number().optional(),
|
|
82
|
-
currentImpressions: schema.number().int().optional(),
|
|
83
|
-
currentClicks: schema.number().int().optional(),
|
|
84
|
-
serp: contentBriefSerpSnapshotSchema.producer.optional(),
|
|
85
|
-
outline: schema.array(contentBriefOutlineItemSchema.producer).optional(),
|
|
86
|
-
internalLinks: schema.array(contentBriefInternalLinkSchema.producer).optional(),
|
|
87
|
-
summary: schema.string().optional(),
|
|
88
|
-
notes: schema.array(schema.string()).optional(),
|
|
89
|
-
};
|
|
90
|
-
export const contentBriefPayloadSchema = defineResponseObject(contentBriefPayloadProducerShape, {
|
|
91
|
-
...contentBriefPayloadProducerShape,
|
|
92
|
-
serp: contentBriefSerpSnapshotSchema.client.optional(),
|
|
93
|
-
outline: schema.array(contentBriefOutlineItemSchema.client).optional(),
|
|
94
|
-
internalLinks: schema.array(contentBriefInternalLinkSchema.client).optional(),
|
|
95
|
-
});
|
|
96
|
-
const contentBriefSummaryProducerShape = {
|
|
97
|
-
id: schema.string().min(1),
|
|
98
|
-
siteId: schema.string().min(1),
|
|
99
|
-
keyword: schema.string().min(1),
|
|
100
|
-
status: contentBriefStatusSchema,
|
|
101
|
-
error: schema.string().nullable(),
|
|
102
|
-
generatedAt: schema.iso.datetime().nullable(),
|
|
103
|
-
markedPublishedAt: schema.iso.datetime().nullable(),
|
|
104
|
-
updatedAt: schema.iso.datetime().nullable(),
|
|
105
|
-
};
|
|
106
|
-
export const contentBriefSummarySchema = defineResponseObject(contentBriefSummaryProducerShape);
|
|
107
|
-
export const contentBriefResourceSchema = defineResponseObject({
|
|
108
|
-
...contentBriefSummaryProducerShape,
|
|
109
|
-
payload: contentBriefPayloadSchema.producer.nullable(),
|
|
110
|
-
createdAt: schema.iso.datetime().nullable(),
|
|
111
|
-
markedWrittenAt: schema.iso.datetime().nullable(),
|
|
112
|
-
}, {
|
|
113
|
-
...contentBriefSummaryProducerShape,
|
|
114
|
-
payload: contentBriefPayloadSchema.client.nullable(),
|
|
115
|
-
createdAt: schema.iso.datetime().nullable(),
|
|
116
|
-
markedWrittenAt: schema.iso.datetime().nullable(),
|
|
117
|
-
});
|
|
118
|
-
const contentBriefPageShape = {
|
|
119
|
-
total: schema.number().int().nonnegative(),
|
|
120
|
-
limit: schema.number().int().positive(),
|
|
121
|
-
offset: schema.number().int().nonnegative(),
|
|
122
|
-
hasMore: schema.boolean(),
|
|
123
|
-
};
|
|
124
|
-
const contentBriefPageSchema = defineResponseObject(contentBriefPageShape);
|
|
125
|
-
export const contentBriefListDataSchema = defineResponseObject({
|
|
126
|
-
/**
|
|
127
|
-
* Deprecated alias of `rows`. Kept for one minor version, then removed.
|
|
128
|
-
*/
|
|
129
|
-
briefs: schema.array(contentBriefSummarySchema.producer),
|
|
130
|
-
rows: schema.array(contentBriefSummarySchema.producer),
|
|
131
|
-
page: contentBriefPageSchema.producer,
|
|
132
|
-
}, {
|
|
133
|
-
briefs: schema.array(contentBriefSummarySchema.client),
|
|
134
|
-
rows: schema.array(contentBriefSummarySchema.client).optional(),
|
|
135
|
-
page: contentBriefPageSchema.client,
|
|
136
|
-
});
|
|
137
|
-
export const contentBriefCreateDataSchema = defineResponseObject({
|
|
138
|
-
brief: contentBriefResourceSchema.producer,
|
|
139
|
-
created: schema.boolean(),
|
|
140
|
-
}, {
|
|
141
|
-
brief: contentBriefResourceSchema.client,
|
|
142
|
-
created: schema.boolean(),
|
|
143
|
-
});
|
|
144
|
-
export const contentBriefListResponseSchema = defineSuccessEnvelope(contentBriefListDataSchema);
|
|
145
|
-
export const contentBriefShowResponseSchema = defineSuccessEnvelope(contentBriefResourceSchema);
|
|
146
|
-
export const contentBriefCreateResponseSchema = defineSuccessEnvelope(contentBriefCreateDataSchema);
|
|
147
|
-
const readErrors = [
|
|
148
|
-
'invalid_request',
|
|
149
|
-
'unauthorized',
|
|
150
|
-
'auth_expired',
|
|
151
|
-
'forbidden',
|
|
152
|
-
'not_found',
|
|
153
|
-
'rate_limited',
|
|
154
|
-
'contract_violation',
|
|
155
|
-
'internal_error',
|
|
156
|
-
];
|
|
157
|
-
export const contentBriefListOperation = defineOperation({
|
|
158
|
-
id: 'content.briefs.list',
|
|
159
|
-
method: 'GET',
|
|
160
|
-
path: '/api/v1/sites/{siteId}/content/briefs',
|
|
161
|
-
visibility: 'public',
|
|
162
|
-
semantics: {
|
|
163
|
-
kind: 'query',
|
|
164
|
-
sideEffects: 'none',
|
|
165
|
-
retry: 'idempotent',
|
|
166
|
-
readConsistency: 'primary',
|
|
167
|
-
},
|
|
168
|
-
auth: {
|
|
169
|
-
credentials: ['session', 'api_token'],
|
|
170
|
-
scopes: ['content:read'],
|
|
171
|
-
minimumRole: 'viewer',
|
|
172
|
-
ownership: 'site',
|
|
173
|
-
},
|
|
174
|
-
request: {
|
|
175
|
-
params: contentBriefSiteParamsSchema,
|
|
176
|
-
query: contentBriefListQuerySchema,
|
|
177
|
-
headers: null,
|
|
178
|
-
body: null,
|
|
179
|
-
},
|
|
180
|
-
responses: { 200: contentBriefListResponseSchema },
|
|
181
|
-
errors: readErrors,
|
|
182
|
-
errorResponse: publicV1ErrorEnvelope,
|
|
183
|
-
resources: { reads: [{ type: 'site.content', idFrom: 'params.siteId' }], changes: [] },
|
|
184
|
-
policy: { rate: publicV1StandardRatePolicy, idempotency: { _tag: 'none' }, entitlement: null, meter: null },
|
|
185
|
-
lifecycle: { introduced: '1.0.0' },
|
|
186
|
-
docs: {
|
|
187
|
-
summary: 'List Content Briefs',
|
|
188
|
-
description: 'Lists one page of Content Brief summaries owned by a NuxtSEO Site.',
|
|
189
|
-
tags: ['Content'],
|
|
190
|
-
examples: [{
|
|
191
|
-
request: { params: { siteId: 'site_01JXYZ' }, query: { limit: 25, offset: 0 } },
|
|
192
|
-
response: {
|
|
193
|
-
status: 200,
|
|
194
|
-
body: {
|
|
195
|
-
data: {
|
|
196
|
-
briefs: [{
|
|
197
|
-
id: 'brief_01JXYZ',
|
|
198
|
-
siteId: 'site_01JXYZ',
|
|
199
|
-
keyword: 'nuxt seo',
|
|
200
|
-
status: 'ready',
|
|
201
|
-
error: null,
|
|
202
|
-
generatedAt: '2026-08-10T00:00:00.000Z',
|
|
203
|
-
markedPublishedAt: null,
|
|
204
|
-
updatedAt: '2026-08-10T00:00:00.000Z',
|
|
205
|
-
}],
|
|
206
|
-
rows: [{
|
|
207
|
-
id: 'brief_01JXYZ',
|
|
208
|
-
siteId: 'site_01JXYZ',
|
|
209
|
-
keyword: 'nuxt seo',
|
|
210
|
-
status: 'ready',
|
|
211
|
-
error: null,
|
|
212
|
-
generatedAt: '2026-08-10T00:00:00.000Z',
|
|
213
|
-
markedPublishedAt: null,
|
|
214
|
-
updatedAt: '2026-08-10T00:00:00.000Z',
|
|
215
|
-
}],
|
|
216
|
-
page: { total: 1, limit: 25, offset: 0, hasMore: false },
|
|
217
|
-
},
|
|
218
|
-
meta: { requestId: 'req_01JXYZ', version: '1.0' },
|
|
219
|
-
},
|
|
220
|
-
},
|
|
221
|
-
}],
|
|
222
|
-
},
|
|
223
|
-
});
|
|
224
|
-
const exampleBrief = {
|
|
225
|
-
id: 'brief_01JXYZ',
|
|
226
|
-
siteId: 'site_01JXYZ',
|
|
227
|
-
keyword: 'nuxt seo',
|
|
228
|
-
status: 'ready',
|
|
229
|
-
error: null,
|
|
230
|
-
generatedAt: '2026-08-10T00:00:00.000Z',
|
|
231
|
-
markedPublishedAt: null,
|
|
232
|
-
updatedAt: '2026-08-10T00:00:00.000Z',
|
|
233
|
-
createdAt: '2026-08-10T00:00:00.000Z',
|
|
234
|
-
markedWrittenAt: null,
|
|
235
|
-
payload: {
|
|
236
|
-
targetPage: 'https://example.com/guide',
|
|
237
|
-
outline: [{ level: 'h1', heading: 'Nuxt SEO' }],
|
|
238
|
-
internalLinks: [],
|
|
239
|
-
},
|
|
240
|
-
};
|
|
241
|
-
export const contentBriefShowOperation = defineOperation({
|
|
242
|
-
id: 'content.briefs.show',
|
|
243
|
-
method: 'GET',
|
|
244
|
-
path: '/api/v1/sites/{siteId}/content/briefs/{briefId}',
|
|
245
|
-
visibility: 'public',
|
|
246
|
-
semantics: {
|
|
247
|
-
kind: 'query',
|
|
248
|
-
sideEffects: 'none',
|
|
249
|
-
retry: 'idempotent',
|
|
250
|
-
readConsistency: 'primary',
|
|
251
|
-
},
|
|
252
|
-
auth: {
|
|
253
|
-
credentials: ['session', 'api_token'],
|
|
254
|
-
scopes: ['content:read'],
|
|
255
|
-
minimumRole: 'viewer',
|
|
256
|
-
ownership: 'site',
|
|
257
|
-
},
|
|
258
|
-
request: { params: contentBriefParamsSchema, query: null, headers: null, body: null },
|
|
259
|
-
responses: { 200: contentBriefShowResponseSchema },
|
|
260
|
-
errors: readErrors,
|
|
261
|
-
errorResponse: publicV1ErrorEnvelope,
|
|
262
|
-
resources: { reads: [{ type: 'site.content', idFrom: 'params.siteId' }], changes: [] },
|
|
263
|
-
policy: { rate: publicV1StandardRatePolicy, idempotency: { _tag: 'none' }, entitlement: null, meter: null },
|
|
264
|
-
lifecycle: { introduced: '1.0.0' },
|
|
265
|
-
docs: {
|
|
266
|
-
summary: 'Show a Content Brief',
|
|
267
|
-
description: 'Returns one Content Brief with its grounded SERP, outline, and internal-link evidence.',
|
|
268
|
-
tags: ['Content'],
|
|
269
|
-
examples: [{
|
|
270
|
-
request: { params: { siteId: 'site_01JXYZ', briefId: 'brief_01JXYZ' } },
|
|
271
|
-
response: {
|
|
272
|
-
status: 200,
|
|
273
|
-
body: { data: exampleBrief, meta: { requestId: 'req_01JXYZ', version: '1.0' } },
|
|
274
|
-
},
|
|
275
|
-
}],
|
|
276
|
-
},
|
|
277
|
-
});
|
|
278
|
-
export const contentBriefCreateOperation = defineOperation({
|
|
279
|
-
id: 'content.briefs.create',
|
|
280
|
-
method: 'POST',
|
|
281
|
-
path: '/api/v1/sites/{siteId}/content/briefs',
|
|
282
|
-
visibility: 'public',
|
|
283
|
-
semantics: {
|
|
284
|
-
kind: 'mutation',
|
|
285
|
-
sideEffects: 'state',
|
|
286
|
-
retry: 'never',
|
|
287
|
-
readConsistency: null,
|
|
288
|
-
},
|
|
289
|
-
auth: {
|
|
290
|
-
credentials: ['session', 'api_token'],
|
|
291
|
-
scopes: ['content:write'],
|
|
292
|
-
minimumRole: 'member',
|
|
293
|
-
ownership: 'site',
|
|
294
|
-
},
|
|
295
|
-
request: {
|
|
296
|
-
params: contentBriefSiteParamsSchema,
|
|
297
|
-
query: null,
|
|
298
|
-
headers: null,
|
|
299
|
-
body: contentBriefCreateBodySchema,
|
|
300
|
-
},
|
|
301
|
-
responses: { 200: contentBriefCreateResponseSchema },
|
|
302
|
-
errors: [
|
|
303
|
-
...readErrors,
|
|
304
|
-
'entitlement_required',
|
|
305
|
-
'conflict',
|
|
306
|
-
'quota_exhausted',
|
|
307
|
-
],
|
|
308
|
-
errorResponse: publicV1ErrorEnvelope,
|
|
309
|
-
resources: {
|
|
310
|
-
reads: [{ type: 'site.content', idFrom: 'params.siteId' }],
|
|
311
|
-
changes: [{ type: 'site.content', idFrom: 'params.siteId' }],
|
|
312
|
-
},
|
|
313
|
-
policy: { rate: publicV1StandardRatePolicy, idempotency: { _tag: 'none' }, entitlement: 'pro', meter: null },
|
|
314
|
-
lifecycle: { introduced: '1.0.0' },
|
|
315
|
-
docs: {
|
|
316
|
-
summary: 'Create a Content Brief',
|
|
317
|
-
description: 'Creates or returns the existing Site-owned Content Brief for a canonical target keyword.',
|
|
318
|
-
tags: ['Content'],
|
|
319
|
-
examples: [{
|
|
320
|
-
request: {
|
|
321
|
-
params: { siteId: 'site_01JXYZ' },
|
|
322
|
-
body: { keyword: 'nuxt seo', targetPage: 'https://example.com/guide' },
|
|
323
|
-
},
|
|
324
|
-
response: {
|
|
325
|
-
status: 200,
|
|
326
|
-
body: {
|
|
327
|
-
data: { brief: exampleBrief, created: true },
|
|
328
|
-
meta: { requestId: 'req_01JXYZ', version: '1.0' },
|
|
329
|
-
},
|
|
330
|
-
},
|
|
331
|
-
}],
|
|
332
|
-
},
|
|
333
|
-
});
|
|
334
|
-
export const contentV1Registry = defineRegistry({
|
|
335
|
-
feature: 'content',
|
|
336
|
-
operations: {
|
|
337
|
-
listBriefs: contentBriefListOperation,
|
|
338
|
-
showBrief: contentBriefShowOperation,
|
|
339
|
-
createBrief: contentBriefCreateOperation,
|
|
340
|
-
},
|
|
341
|
-
});
|