@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,123 @@
1
+ import { z as schema } from 'zod';
2
+ import { defineOperation, defineRegistry, defineResponseObject, defineSuccessEnvelope, publicV1ErrorEnvelope, publicV1MetaClientSchema, publicV1MetaProducerSchema, publicV1StandardRatePolicy, } from './core.js';
3
+ export const usageMeterGroupSchema = schema.enum(['integrations', 'compute', 'capacity']);
4
+ export const usageUpgradeTierSchema = schema.enum(['free', 'search', 'full', 'pro', 'agency', 'lifetime']);
5
+ export const usagePlanSchema = usageUpgradeTierSchema;
6
+ export const accountUsageQuerySchema = schema.strictObject({
7
+ group: usageMeterGroupSchema.optional(),
8
+ });
9
+ export const usageMeterProducerSchema = schema.strictObject({
10
+ key: schema.string().min(1),
11
+ label: schema.string().min(1),
12
+ description: schema.string().min(1),
13
+ group: usageMeterGroupSchema,
14
+ unit: schema.string().min(1),
15
+ used: schema.number().nonnegative(),
16
+ limit: schema.number().nonnegative().nullable(),
17
+ blocked: schema.boolean(),
18
+ overCap: schema.boolean(),
19
+ resetsAt: schema.iso.datetime().nullable(),
20
+ upgradeCopy: schema.array(schema.strictObject({
21
+ tier: usageUpgradeTierSchema,
22
+ gain: schema.string().min(1),
23
+ })),
24
+ });
25
+ export const usageMeterClientSchema = schema.looseObject({
26
+ key: schema.string().min(1),
27
+ label: schema.string().min(1),
28
+ description: schema.string().min(1),
29
+ group: usageMeterGroupSchema,
30
+ unit: schema.string().min(1),
31
+ used: schema.number().nonnegative(),
32
+ limit: schema.number().nonnegative().nullable(),
33
+ blocked: schema.boolean(),
34
+ overCap: schema.boolean(),
35
+ resetsAt: schema.iso.datetime().nullable(),
36
+ upgradeCopy: schema.array(schema.looseObject({
37
+ tier: usageUpgradeTierSchema,
38
+ gain: schema.string().min(1),
39
+ })),
40
+ });
41
+ export const accountUsageDataSchema = defineResponseObject({
42
+ plan: usagePlanSchema,
43
+ meters: schema.array(usageMeterProducerSchema),
44
+ }, {
45
+ plan: usagePlanSchema,
46
+ meters: schema.array(usageMeterClientSchema),
47
+ });
48
+ export const accountUsageMetaSchema = defineResponseObject({ ...publicV1MetaProducerSchema.shape, total: schema.number().int().nonnegative() }, { ...publicV1MetaClientSchema.shape, total: schema.number().int().nonnegative() });
49
+ export const accountUsageResponseSchema = defineSuccessEnvelope(accountUsageDataSchema, accountUsageMetaSchema);
50
+ export const accountUsageOperation = defineOperation({
51
+ id: 'account.usage',
52
+ method: 'GET',
53
+ path: '/api/v1/account/usage',
54
+ visibility: 'public',
55
+ semantics: {
56
+ kind: 'query',
57
+ sideEffects: 'none',
58
+ retry: 'idempotent',
59
+ readConsistency: 'primary',
60
+ },
61
+ auth: {
62
+ credentials: ['session', 'api_token'],
63
+ scopes: ['account:read'],
64
+ minimumRole: 'viewer',
65
+ ownership: 'team',
66
+ },
67
+ request: {
68
+ params: null,
69
+ query: accountUsageQuerySchema,
70
+ headers: null,
71
+ body: null,
72
+ },
73
+ responses: { 200: accountUsageResponseSchema },
74
+ errors: ['invalid_request', 'unauthorized', 'auth_expired', 'forbidden', 'rate_limited', 'contract_violation', 'internal_error'],
75
+ errorResponse: publicV1ErrorEnvelope,
76
+ resources: {
77
+ reads: [{ type: 'account.usage', idFrom: 'team.id' }],
78
+ changes: [],
79
+ },
80
+ policy: {
81
+ rate: publicV1StandardRatePolicy,
82
+ idempotency: { _tag: 'none' },
83
+ entitlement: null,
84
+ meter: null,
85
+ },
86
+ lifecycle: { introduced: '1.0.0' },
87
+ docs: {
88
+ summary: 'Read account usage',
89
+ description: 'Returns current Team-scoped public meter readings without spending quota.',
90
+ tags: ['Account'],
91
+ examples: [{
92
+ request: { query: {} },
93
+ response: {
94
+ status: 200,
95
+ body: {
96
+ data: {
97
+ plan: 'pro',
98
+ meters: [{
99
+ key: 'dataforseo',
100
+ label: 'Research lookups',
101
+ description: 'Third-party research requests used by live market analysis.',
102
+ group: 'integrations',
103
+ unit: 'requests',
104
+ used: 8,
105
+ limit: 100,
106
+ blocked: false,
107
+ overCap: false,
108
+ resetsAt: '2026-09-01T00:00:00.000Z',
109
+ upgradeCopy: [{ tier: 'agency', gain: 'Increase monthly research capacity.' }],
110
+ }],
111
+ },
112
+ meta: { requestId: 'req_01JXYZ', version: '1.0', total: 1 },
113
+ },
114
+ },
115
+ }],
116
+ },
117
+ });
118
+ export const accountV1Registry = defineRegistry({
119
+ feature: 'account',
120
+ operations: {
121
+ usage: accountUsageOperation,
122
+ },
123
+ });