@nuxtseo/cli 0.1.4 → 0.2.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/README.md +113 -31
- package/dist/api.js +7 -1
- package/dist/cli.js +62 -11
- package/dist/command-contract.js +10 -0
- package/dist/commands.d.ts +19 -0
- package/dist/commands.js +1215 -89
- package/dist/failures.d.ts +2 -1
- package/dist/failures.js +21 -1
- package/dist/parse.d.ts +9 -0
- package/dist/parse.js +21 -0
- package/dist/render.d.ts +43 -9
- package/dist/render.js +636 -5
- package/dist/skill.d.ts +22 -0
- package/dist/skill.js +56 -0
- package/package.json +9 -8
- package/skills/nuxtseo-cli/SKILL.md +236 -107
- package/skills/nuxtseo-cli/references/commands.md +162 -0
- package/skills/nuxtseo-cli/references/indexing.md +60 -0
- package/skills/nuxtseo-cli/references/protocol.md +15 -4
package/dist/failures.d.ts
CHANGED
|
@@ -8,10 +8,11 @@ export declare const EXIT_CODE: {
|
|
|
8
8
|
readonly retryable: 6;
|
|
9
9
|
readonly infrastructure: 7;
|
|
10
10
|
readonly notFound: 8;
|
|
11
|
+
readonly pagingCapReached: 9;
|
|
11
12
|
readonly interrupted: 130;
|
|
12
13
|
};
|
|
13
14
|
export type ExitCode = typeof EXIT_CODE[keyof typeof EXIT_CODE];
|
|
14
|
-
export type LocalFailureCode = 'authentication_required' | 'authorization_required' | 'confirmation_required' | 'conflict' | 'contract_violation' | 'infrastructure_failure' | 'interrupted' | 'invalid_cli_input' | 'not_found' | 'request_timeout' | 'retryable_failure' | 'site_ambiguous' | 'site_empty' | 'site_not_accessible' | 'state_error' | 'token_input_required' | 'transport_failure' | 'unexpected';
|
|
15
|
+
export type LocalFailureCode = 'authentication_required' | 'authorization_required' | 'confirmation_required' | 'conflict' | 'contract_violation' | 'infrastructure_failure' | 'interrupted' | 'invalid_cli_input' | 'not_found' | 'paging_cap_reached' | 'request_timeout' | 'retryable_failure' | 'site_ambiguous' | 'site_empty' | 'site_not_accessible' | 'state_error' | 'token_input_required' | 'transport_failure' | 'unexpected';
|
|
15
16
|
export type CliFailureCode = LocalFailureCode | Extract<SdkFailure, {
|
|
16
17
|
_tag: 'ApiFailure';
|
|
17
18
|
}>['code'];
|
package/dist/failures.js
CHANGED
|
@@ -15,6 +15,7 @@ export const EXIT_CODE = {
|
|
|
15
15
|
retryable: 6,
|
|
16
16
|
infrastructure: 7,
|
|
17
17
|
notFound: 8,
|
|
18
|
+
pagingCapReached: 9,
|
|
18
19
|
interrupted: 130,
|
|
19
20
|
};
|
|
20
21
|
export function ok(value) {
|
|
@@ -34,6 +35,8 @@ function defaultFailureCode(exitCode) {
|
|
|
34
35
|
return 'retryable_failure';
|
|
35
36
|
case EXIT_CODE.notFound:
|
|
36
37
|
return 'not_found';
|
|
38
|
+
case EXIT_CODE.pagingCapReached:
|
|
39
|
+
return 'paging_cap_reached';
|
|
37
40
|
case EXIT_CODE.interrupted:
|
|
38
41
|
return 'interrupted';
|
|
39
42
|
default:
|
|
@@ -83,10 +86,27 @@ function metadataLines(error) {
|
|
|
83
86
|
details ? `Details: ${details}` : undefined,
|
|
84
87
|
].filter((line) => line !== undefined);
|
|
85
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* One client-side validation issue as a person can read it.
|
|
91
|
+
*
|
|
92
|
+
* These arrive as zod issue objects, so `String(issue)` printed
|
|
93
|
+
* `[object Object]` and the caller was told which operation and which location
|
|
94
|
+
* failed and nothing whatsoever about what was wrong with it.
|
|
95
|
+
*/
|
|
96
|
+
function requestIssueLine(issue) {
|
|
97
|
+
if (typeof issue === 'string')
|
|
98
|
+
return issue;
|
|
99
|
+
if (!issue || typeof issue !== 'object')
|
|
100
|
+
return String(issue);
|
|
101
|
+
const { path, message } = issue;
|
|
102
|
+
const field = Array.isArray(path) && path.length > 0 ? path.map(String).join('.') : null;
|
|
103
|
+
const text = typeof message === 'string' && message ? message : JSON.stringify(issue);
|
|
104
|
+
return field ? `${field}: ${text}` : text;
|
|
105
|
+
}
|
|
86
106
|
export function fromSdkFailure(error) {
|
|
87
107
|
switch (error._tag) {
|
|
88
108
|
case 'RequestFailure':
|
|
89
|
-
return fail(EXIT_CODE.invalidInput, `${error.operationId}: invalid ${error.location}. ${error.issues.map(
|
|
109
|
+
return fail(EXIT_CODE.invalidInput, `${error.operationId}: invalid ${error.location}. ${error.issues.map(requestIssueLine).join('; ')}`);
|
|
90
110
|
case 'ApiFailure':
|
|
91
111
|
return {
|
|
92
112
|
_tag: 'Err',
|
package/dist/parse.d.ts
CHANGED
|
@@ -15,12 +15,21 @@ export declare const DEFAULT_TIMEOUT_MS = 30000;
|
|
|
15
15
|
export declare function extractGlobalOptions(rawArgs: readonly string[]): CliResult<ParsedGlobalOptions>;
|
|
16
16
|
export declare function parseHttpUrl(input: string, label: string): CliResult<string>;
|
|
17
17
|
export declare function parseAbsolutePageUrl(input: string): CliResult<string>;
|
|
18
|
+
/**
|
|
19
|
+
* Search Console reads accept a site-relative path as well as an absolute URL.
|
|
20
|
+
* A leading `/` is passed through; anything else must be a full page URL.
|
|
21
|
+
*/
|
|
22
|
+
export declare function parsePageUrlOrPath(input: string): CliResult<string>;
|
|
18
23
|
export declare function parseInteger(input: string | undefined, options: {
|
|
19
24
|
name: string;
|
|
20
25
|
minimum: number;
|
|
21
26
|
maximum?: number;
|
|
22
27
|
defaultValue: number;
|
|
23
28
|
}): CliResult<number>;
|
|
29
|
+
/**
|
|
30
|
+
* A ratio between 0 and 1, for example a click-through rate ceiling.
|
|
31
|
+
*/
|
|
32
|
+
export declare function parseRatio(input: string, name: string): CliResult<number>;
|
|
24
33
|
export declare function parseChoice<const TChoice extends string>(input: string | undefined, options: {
|
|
25
34
|
name: string;
|
|
26
35
|
choices: readonly TChoice[];
|
package/dist/parse.js
CHANGED
|
@@ -112,6 +112,16 @@ export function parseAbsolutePageUrl(input) {
|
|
|
112
112
|
url.hash = '';
|
|
113
113
|
return ok(url.href);
|
|
114
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Search Console reads accept a site-relative path as well as an absolute URL.
|
|
117
|
+
* A leading `/` is passed through; anything else must be a full page URL.
|
|
118
|
+
*/
|
|
119
|
+
export function parsePageUrlOrPath(input) {
|
|
120
|
+
const trimmed = input.trim();
|
|
121
|
+
if (trimmed.startsWith('/'))
|
|
122
|
+
return ok(trimmed);
|
|
123
|
+
return parseAbsolutePageUrl(trimmed);
|
|
124
|
+
}
|
|
115
125
|
export function parseInteger(input, options) {
|
|
116
126
|
if (input === undefined)
|
|
117
127
|
return ok(options.defaultValue);
|
|
@@ -124,6 +134,17 @@ export function parseInteger(input, options) {
|
|
|
124
134
|
}
|
|
125
135
|
return ok(parsed);
|
|
126
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* A ratio between 0 and 1, for example a click-through rate ceiling.
|
|
139
|
+
*/
|
|
140
|
+
export function parseRatio(input, name) {
|
|
141
|
+
if (!/^\d+(?:\.\d+)?$/.test(input))
|
|
142
|
+
return fail(EXIT_CODE.invalidInput, `${name} must be a number.`);
|
|
143
|
+
const parsed = Number(input);
|
|
144
|
+
if (!Number.isFinite(parsed) || parsed < 0 || parsed > 1)
|
|
145
|
+
return fail(EXIT_CODE.invalidInput, `${name} must be between 0 and 1.`);
|
|
146
|
+
return ok(parsed);
|
|
147
|
+
}
|
|
127
148
|
export function parseChoice(input, options) {
|
|
128
149
|
if (input === undefined && options.defaultValue !== undefined)
|
|
129
150
|
return ok(options.defaultValue);
|
package/dist/render.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import type { AccountUsageResponse, SitesListResponse } from '@nuxtseo/protocol/v1';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
1
|
+
import type { AccountUsageResponse, SitesListResponse, SiteStatus } from '@nuxtseo/protocol/v1';
|
|
2
|
+
import type { AccountTokenData } from '@nuxtseo/protocol/v1/account';
|
|
3
|
+
import type { ActionDismiss, ActionList, ActionResolve, ActionShow } from '@nuxtseo/protocol/v1/actions';
|
|
4
|
+
import type { AnalyticsQueryData, AnalyticsView } from '@nuxtseo/protocol/v1/analytics';
|
|
5
|
+
import type { AuditChanges, AuditContentDecay, AuditDuplicateClusters, AuditLinkOpportunities, AuditLinkStructure } from '@nuxtseo/protocol/v1/audit';
|
|
6
|
+
import type { BacklinkAnchors, BacklinksHistory, BacklinksSummary, Mentions, RecoverableBacklinks, ReferringDomains } from '@nuxtseo/protocol/v1/backlinks';
|
|
5
7
|
import type { ContentBrief, ContentBriefCreateData, ContentBriefListData } from '@nuxtseo/protocol/v1/content';
|
|
6
|
-
import type { IndexingDiagnosticsData, SearchAnalyticsData, SearchStatusData } from '@nuxtseo/protocol/v1/gsc';
|
|
7
|
-
import type { PageInspect, PageScan } from '@nuxtseo/protocol/v1/pages';
|
|
8
|
-
import type { SitePerformanceOverview } from '@nuxtseo/protocol/v1/performance';
|
|
9
|
-
import type { KeywordResearchData, RankingsResearchData, SerpResearchData, StoredResearchOverview } from '@nuxtseo/protocol/v1/research';
|
|
10
|
-
import type {
|
|
8
|
+
import type { IndexCohorts, IndexingDiagnosticsData, IndexingHistoryData, SearchAnalyticsData, SearchStatusData, UrlInspectionData } from '@nuxtseo/protocol/v1/gsc';
|
|
9
|
+
import type { PageInspect, PageIssues, PageScan } from '@nuxtseo/protocol/v1/pages';
|
|
10
|
+
import type { FieldVitalFindings, FieldVitals, MonitoredPages, PerformanceScanDetail, PerformanceScans, SitePerformanceOverview } from '@nuxtseo/protocol/v1/performance';
|
|
11
|
+
import type { DomainAvailability, DomainTraffic, KeywordResearchData, RankingsResearchData, SerpResearchData, StoredResearchOverview } from '@nuxtseo/protocol/v1/research';
|
|
12
|
+
import type { SiteSitemapActionResponse, SiteSitemapsResponse, SiteSitemapUrlsResponse } from '@nuxtseo/protocol/v1/sitemaps';
|
|
13
|
+
import type { Annotation, AnnotationDeleted, Annotations, TimelineEntries } from '@nuxtseo/protocol/v1/timeline';
|
|
11
14
|
export declare function renderSites(response: SitesListResponse, selectedSiteId?: string): string;
|
|
12
15
|
export declare function renderUsage(response: AccountUsageResponse): string;
|
|
13
16
|
export declare function renderActions(data: ActionList): string;
|
|
@@ -18,6 +21,19 @@ export declare function renderPageScan(data: PageScan): string;
|
|
|
18
21
|
export declare function renderPerformance(data: SitePerformanceOverview): string;
|
|
19
22
|
export declare function renderSearchStatus(data: SearchStatusData): string;
|
|
20
23
|
export declare function renderSearchAnalytics(data: SearchAnalyticsData): string;
|
|
24
|
+
export declare function renderIndexingHistory(data: IndexingHistoryData): string;
|
|
25
|
+
export declare function renderUrlInspection(data: UrlInspectionData): string;
|
|
26
|
+
export declare function renderAuditChanges(data: AuditChanges): string;
|
|
27
|
+
export declare function renderLinkStructure(data: AuditLinkStructure): string;
|
|
28
|
+
export declare function renderSitemaps(data: SiteSitemapsResponse['data']): string;
|
|
29
|
+
export declare function renderSitemapUrls(data: SiteSitemapUrlsResponse['data']): string;
|
|
30
|
+
export declare function renderSitemapAction(data: SiteSitemapActionResponse['data']): string;
|
|
31
|
+
/**
|
|
32
|
+
* Web Analytics rows differ per view and share no discriminant field, so the
|
|
33
|
+
* requested view selects the projection instead of the payload.
|
|
34
|
+
*/
|
|
35
|
+
export declare function renderAnalytics(view: AnalyticsView, data: AnalyticsQueryData): string;
|
|
36
|
+
export declare function renderAccountToken(data: AccountTokenData): string;
|
|
21
37
|
export declare function renderIndexingDiagnostics(data: IndexingDiagnosticsData): string;
|
|
22
38
|
export declare function renderResearchOverview(data: StoredResearchOverview): string;
|
|
23
39
|
export declare function renderKeywordResearch(data: KeywordResearchData): string;
|
|
@@ -32,3 +48,21 @@ export declare function renderLinkOpportunities(data: AuditLinkOpportunities): s
|
|
|
32
48
|
export declare function renderTimeline(data: TimelineEntries): string;
|
|
33
49
|
export declare function renderRecoverableBacklinks(data: RecoverableBacklinks): string;
|
|
34
50
|
export declare function renderMentions(data: Mentions): string;
|
|
51
|
+
export declare function renderFieldVitals(data: FieldVitals): string;
|
|
52
|
+
export declare function renderFieldVitalFindings(data: FieldVitalFindings): string;
|
|
53
|
+
export declare function renderBacklinksSummary(data: BacklinksSummary): string;
|
|
54
|
+
export declare function renderReferringDomains(data: ReferringDomains): string;
|
|
55
|
+
export declare function renderBacklinkAnchors(data: BacklinkAnchors): string;
|
|
56
|
+
export declare function renderBacklinksHistory(data: BacklinksHistory): string;
|
|
57
|
+
export declare function renderSiteStatus(data: SiteStatus): string;
|
|
58
|
+
export declare function renderActionDismissal(data: ActionDismiss): string;
|
|
59
|
+
export declare function renderPageIssues(data: PageIssues): string;
|
|
60
|
+
export declare function renderScans(data: PerformanceScans): string;
|
|
61
|
+
export declare function renderMonitoredPages(data: MonitoredPages): string;
|
|
62
|
+
export declare function renderScanDetail(data: PerformanceScanDetail): string;
|
|
63
|
+
export declare function renderAnnotations(data: Annotations): string;
|
|
64
|
+
export declare function renderAnnotation(data: Annotation): string;
|
|
65
|
+
export declare function renderAnnotationDeleted(data: AnnotationDeleted): string;
|
|
66
|
+
export declare function renderIndexCohorts(data: IndexCohorts): string;
|
|
67
|
+
export declare function renderDomainTraffic(data: DomainTraffic): string;
|
|
68
|
+
export declare function renderDomainAvailability(data: DomainAvailability): string;
|