@ainyc/canonry 4.78.0 → 4.81.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/assets/agent-workspace/skills/canonry/references/canonry-cli.md +38 -12
- package/assets/assets/{BacklinksPage-CwXveumn.js → BacklinksPage-DHShKKpo.js} +1 -1
- package/assets/assets/{ChartPrimitives-DntKGI5J.js → ChartPrimitives-udHScxjY.js} +1 -1
- package/assets/assets/ProjectPage-BsS1anh7.js +6 -0
- package/assets/assets/{RunRow-DMtYXaxG.js → RunRow-CXyPHMVQ.js} +1 -1
- package/assets/assets/{RunsPage-Cz-YlucO.js → RunsPage-BpQ_NpFt.js} +1 -1
- package/assets/assets/{SettingsPage-BCuG3C-0.js → SettingsPage-1ep4ch7n.js} +1 -1
- package/assets/assets/{TrafficPage-DV8X47wa.js → TrafficPage-C3Hx-sE7.js} +1 -1
- package/assets/assets/TrafficSourceDetailPage-B26n2R6G.js +1 -0
- package/assets/assets/{arrow-left-CUmHyNnF.js → arrow-left-Dc_IPJxw.js} +1 -1
- package/assets/assets/{extract-error-message-DFjy9_zi.js → extract-error-message-B3PoKkHW.js} +1 -1
- package/assets/assets/{index-D9smxU6R.js → index-DhdFTQkU.js} +86 -86
- package/assets/assets/{trash-2-B_UtEEm8.js → trash-2-BQ69cGl0.js} +1 -1
- package/assets/index.html +1 -1
- package/dist/{chunk-XI6YSTGE.js → chunk-6XOZSS3Y.js} +258 -8
- package/dist/{chunk-KPN22EWK.js → chunk-GMT3YPLT.js} +214 -4
- package/dist/{chunk-3WXARKUE.js → chunk-UAQ42NVJ.js} +1346 -357
- package/dist/{chunk-QKTIP6GC.js → chunk-VX5C7DK7.js} +902 -313
- package/dist/cli.js +468 -152
- package/dist/index.d.ts +17 -0
- package/dist/index.js +4 -4
- package/dist/{intelligence-service-CDVUUG7O.js → intelligence-service-CAAQAKPN.js} +2 -2
- package/dist/mcp.js +9 -3
- package/package.json +9 -8
- package/assets/assets/ProjectPage-CVudiU8X.js +0 -6
- package/assets/assets/TrafficSourceDetailPage-BmYhK9jm.js +0 -1
package/dist/cli.js
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
setTelemetrySource,
|
|
28
28
|
showFirstRunNotice,
|
|
29
29
|
trackEvent
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-VX5C7DK7.js";
|
|
31
31
|
import {
|
|
32
32
|
CliError,
|
|
33
33
|
EXIT_SYSTEM_ERROR,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
saveConfig,
|
|
45
45
|
saveConfigPatch,
|
|
46
46
|
usageError
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-6XOZSS3Y.js";
|
|
48
48
|
import {
|
|
49
49
|
apiKeys,
|
|
50
50
|
createClient,
|
|
@@ -52,27 +52,30 @@ import {
|
|
|
52
52
|
projects,
|
|
53
53
|
queries,
|
|
54
54
|
renderReportHtml
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-UAQ42NVJ.js";
|
|
56
56
|
import {
|
|
57
|
+
BacklinkSources,
|
|
57
58
|
CcReleaseSyncStatuses,
|
|
58
59
|
CheckScopes,
|
|
59
60
|
CheckStatuses,
|
|
60
61
|
CitationStates,
|
|
61
62
|
RunStatuses,
|
|
62
63
|
TrafficEventKinds,
|
|
64
|
+
backlinkSourceSchema,
|
|
63
65
|
discoveryBucketSchema,
|
|
64
66
|
discoveryCompetitorTypeSchema,
|
|
65
67
|
effectiveDomains,
|
|
66
68
|
factorStatusFromScore,
|
|
67
69
|
formatGbpMetricLabel,
|
|
68
70
|
formatIsoDate,
|
|
71
|
+
formatMicros,
|
|
69
72
|
formatRunErrorOneLine,
|
|
70
73
|
normalizeProjectAliases,
|
|
71
74
|
notificationEventSchema,
|
|
72
75
|
providerQuotaPolicySchema,
|
|
73
76
|
resolveProviderInput,
|
|
74
77
|
winnabilityClassSchema
|
|
75
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-GMT3YPLT.js";
|
|
76
79
|
|
|
77
80
|
// src/cli.ts
|
|
78
81
|
import { pathToFileURL } from "url";
|
|
@@ -440,6 +443,17 @@ function emitJsonl(records) {
|
|
|
440
443
|
}
|
|
441
444
|
|
|
442
445
|
// src/commands/backlinks.ts
|
|
446
|
+
function parseSourceFlag(value) {
|
|
447
|
+
if (value === void 0) return void 0;
|
|
448
|
+
const parsed = backlinkSourceSchema.safeParse(value);
|
|
449
|
+
if (!parsed.success) {
|
|
450
|
+
throw new CliError({
|
|
451
|
+
code: "VALIDATION_ERROR",
|
|
452
|
+
message: `Invalid --source "${value}". Expected one of: ${Object.values(BacklinkSources).join(", ")}.`
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
return parsed.data;
|
|
456
|
+
}
|
|
443
457
|
function getClient() {
|
|
444
458
|
return createApiClient();
|
|
445
459
|
}
|
|
@@ -471,8 +485,10 @@ function formatSync(sync) {
|
|
|
471
485
|
function formatSummaryAndDomains(project, response) {
|
|
472
486
|
const lines = [];
|
|
473
487
|
lines.push(`Project: ${project}`);
|
|
488
|
+
lines.push(`Source: ${response.source}`);
|
|
474
489
|
if (!response.summary) {
|
|
475
|
-
|
|
490
|
+
const hint = response.source === BacklinkSources["bing-webmaster"] ? "No Bing inbound links yet \u2014 run `canonry backlinks bing-sync <project>` (Bing must be connected)." : "No ready release \u2014 run `canonry backlinks sync --release <id>` first.";
|
|
491
|
+
lines.push(hint);
|
|
476
492
|
return lines.join("\n");
|
|
477
493
|
}
|
|
478
494
|
const s = response.summary;
|
|
@@ -618,7 +634,8 @@ async function backlinksList(opts) {
|
|
|
618
634
|
const response = await client.backlinksDomains(opts.project, {
|
|
619
635
|
limit: opts.limit ?? 50,
|
|
620
636
|
release: opts.release,
|
|
621
|
-
excludeCrawlers: opts.excludeCrawlers
|
|
637
|
+
excludeCrawlers: opts.excludeCrawlers,
|
|
638
|
+
source: opts.source
|
|
622
639
|
});
|
|
623
640
|
if (opts.format === "json") {
|
|
624
641
|
printJson(response);
|
|
@@ -631,6 +648,45 @@ async function backlinksList(opts) {
|
|
|
631
648
|
}
|
|
632
649
|
console.log(formatSummaryAndDomains(opts.project, response));
|
|
633
650
|
}
|
|
651
|
+
function formatSourceAvailability(res) {
|
|
652
|
+
const lines = [];
|
|
653
|
+
lines.push(`Project: ${res.projectId} Target: ${res.targetDomain}`);
|
|
654
|
+
lines.push("");
|
|
655
|
+
lines.push("Source Connected Data Linking domains Latest window");
|
|
656
|
+
for (const s of res.sources) {
|
|
657
|
+
lines.push(
|
|
658
|
+
`${s.source.padEnd(15)} ${(s.connected ? "yes" : "no").padEnd(10)} ${(s.hasData ? "yes" : "no").padEnd(6)} ${String(s.totalLinkingDomains).padStart(15)} ${s.latestRelease ?? "\u2014"}`
|
|
659
|
+
);
|
|
660
|
+
}
|
|
661
|
+
if (!res.anyConnected) {
|
|
662
|
+
lines.push("");
|
|
663
|
+
lines.push("No backlink source is set up. Enable Common Crawl (`canonry project \u2026 autoExtractBacklinks`");
|
|
664
|
+
lines.push("+ `canonry backlinks sync`) or connect Bing (`canonry bing connect <project> --api-key <key>`).");
|
|
665
|
+
}
|
|
666
|
+
return lines.join("\n");
|
|
667
|
+
}
|
|
668
|
+
async function backlinksSources(opts) {
|
|
669
|
+
const res = await getClient().backlinksSources(opts.project, { excludeCrawlers: opts.excludeCrawlers });
|
|
670
|
+
if (opts.format === "json") {
|
|
671
|
+
printJson(res);
|
|
672
|
+
return;
|
|
673
|
+
} else if (opts.format === "jsonl") {
|
|
674
|
+
emitJsonl(res.sources.map((s) => ({ project: opts.project, targetDomain: res.targetDomain, ...s })));
|
|
675
|
+
return;
|
|
676
|
+
}
|
|
677
|
+
console.log(formatSourceAvailability(res));
|
|
678
|
+
}
|
|
679
|
+
async function backlinksBingSync(opts) {
|
|
680
|
+
const client = getClient();
|
|
681
|
+
const run = await client.backlinksBingSync(opts.project);
|
|
682
|
+
const final = opts.wait ? await pollRun(run.id, opts.format) : run;
|
|
683
|
+
if (isMachineFormat(opts.format)) {
|
|
684
|
+
printJson(final);
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
if (opts.wait) process.stderr.write("\n");
|
|
688
|
+
console.log(`Bing sync run ${final.id} (${final.status})${final.error ? " \u2014 " + formatRunErrorOneLine(final.error) : ""}`);
|
|
689
|
+
}
|
|
634
690
|
async function backlinksReleases(opts = {}) {
|
|
635
691
|
const rows = await getClient().backlinksCachedReleases();
|
|
636
692
|
if (opts.format === "json") {
|
|
@@ -708,17 +764,18 @@ var BACKLINKS_CLI_COMMANDS = [
|
|
|
708
764
|
},
|
|
709
765
|
{
|
|
710
766
|
path: ["backlinks", "list"],
|
|
711
|
-
usage: "canonry backlinks list <project> [--limit <n>] [--release <id>] [--exclude-crawlers] [--format json]",
|
|
767
|
+
usage: "canonry backlinks list <project> [--source commoncrawl|bing-webmaster] [--limit <n>] [--release <id>] [--exclude-crawlers] [--format json|jsonl]",
|
|
712
768
|
options: {
|
|
713
769
|
limit: stringOption(),
|
|
714
770
|
release: stringOption(),
|
|
771
|
+
source: stringOption(),
|
|
715
772
|
"exclude-crawlers": { type: "boolean" }
|
|
716
773
|
},
|
|
717
774
|
run: async (input) => {
|
|
718
775
|
const project = requireProject(
|
|
719
776
|
input,
|
|
720
777
|
"backlinks list",
|
|
721
|
-
"canonry backlinks list <project> [--limit <n>] [--release <id>] [--exclude-crawlers]"
|
|
778
|
+
"canonry backlinks list <project> [--source commoncrawl|bing-webmaster] [--limit <n>] [--release <id>] [--exclude-crawlers]"
|
|
722
779
|
);
|
|
723
780
|
const limit = parseIntegerOption(input, "limit", {
|
|
724
781
|
message: "--limit must be an integer",
|
|
@@ -729,11 +786,50 @@ var BACKLINKS_CLI_COMMANDS = [
|
|
|
729
786
|
project,
|
|
730
787
|
limit,
|
|
731
788
|
release: getString(input.values, "release"),
|
|
789
|
+
source: parseSourceFlag(getString(input.values, "source")),
|
|
732
790
|
excludeCrawlers: getBoolean(input.values, "exclude-crawlers"),
|
|
733
791
|
format: input.format
|
|
734
792
|
});
|
|
735
793
|
}
|
|
736
794
|
},
|
|
795
|
+
{
|
|
796
|
+
path: ["backlinks", "sources"],
|
|
797
|
+
usage: "canonry backlinks sources <project> [--exclude-crawlers] [--format json|jsonl]",
|
|
798
|
+
options: {
|
|
799
|
+
"exclude-crawlers": { type: "boolean" }
|
|
800
|
+
},
|
|
801
|
+
run: async (input) => {
|
|
802
|
+
const project = requireProject(
|
|
803
|
+
input,
|
|
804
|
+
"backlinks sources",
|
|
805
|
+
"canonry backlinks sources <project>"
|
|
806
|
+
);
|
|
807
|
+
await backlinksSources({
|
|
808
|
+
project,
|
|
809
|
+
excludeCrawlers: getBoolean(input.values, "exclude-crawlers"),
|
|
810
|
+
format: input.format
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
path: ["backlinks", "bing-sync"],
|
|
816
|
+
usage: "canonry backlinks bing-sync <project> [--wait] [--format json]",
|
|
817
|
+
options: {
|
|
818
|
+
wait: { type: "boolean" }
|
|
819
|
+
},
|
|
820
|
+
run: async (input) => {
|
|
821
|
+
const project = requireProject(
|
|
822
|
+
input,
|
|
823
|
+
"backlinks bing-sync",
|
|
824
|
+
"canonry backlinks bing-sync <project> [--wait]"
|
|
825
|
+
);
|
|
826
|
+
await backlinksBingSync({
|
|
827
|
+
project,
|
|
828
|
+
wait: getBoolean(input.values, "wait"),
|
|
829
|
+
format: input.format
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
},
|
|
737
833
|
{
|
|
738
834
|
path: ["backlinks", "releases"],
|
|
739
835
|
usage: "canonry backlinks releases [--format json]",
|
|
@@ -2230,10 +2326,229 @@ var DOCTOR_CLI_COMMANDS = [
|
|
|
2230
2326
|
}
|
|
2231
2327
|
];
|
|
2232
2328
|
|
|
2233
|
-
// src/commands/
|
|
2329
|
+
// src/commands/ads.ts
|
|
2234
2330
|
function getClient5() {
|
|
2235
2331
|
return createApiClient();
|
|
2236
2332
|
}
|
|
2333
|
+
function describeConnection(status) {
|
|
2334
|
+
const lines = [];
|
|
2335
|
+
lines.push(`Connected: ${status.connected ? "yes" : "no"}`);
|
|
2336
|
+
if (status.connected) {
|
|
2337
|
+
if (status.displayName) lines.push(`Account: ${status.displayName} (${status.adAccountId ?? "unknown id"})`);
|
|
2338
|
+
if (status.currencyCode) lines.push(`Currency: ${status.currencyCode}`);
|
|
2339
|
+
if (status.timezone) lines.push(`Timezone: ${status.timezone}`);
|
|
2340
|
+
if (status.status) lines.push(`Status: ${status.status}`);
|
|
2341
|
+
lines.push(`Last synced: ${status.lastSyncedAt ?? "never"}`);
|
|
2342
|
+
}
|
|
2343
|
+
return lines;
|
|
2344
|
+
}
|
|
2345
|
+
async function adsConnect(project, opts) {
|
|
2346
|
+
if (!opts.apiKey) {
|
|
2347
|
+
throw new CliError({
|
|
2348
|
+
code: "ADS_API_KEY_REQUIRED",
|
|
2349
|
+
message: "API key is required (pass --api-key)",
|
|
2350
|
+
displayMessage: "Error: --api-key is required (mint an SDK key in OpenAI Ads Manager)",
|
|
2351
|
+
details: { project }
|
|
2352
|
+
});
|
|
2353
|
+
}
|
|
2354
|
+
const client = getClient5();
|
|
2355
|
+
const result = await client.adsConnect(project, { apiKey: opts.apiKey });
|
|
2356
|
+
if (isMachineFormat(opts.format)) {
|
|
2357
|
+
console.log(JSON.stringify(result, null, 2));
|
|
2358
|
+
return;
|
|
2359
|
+
}
|
|
2360
|
+
console.log(`Connected OpenAI ad account for ${project}.`);
|
|
2361
|
+
for (const line of describeConnection(result)) console.log(line);
|
|
2362
|
+
console.log("Schedule daily syncs with: canonry schedule set " + project + " --kind ads-sync --preset daily");
|
|
2363
|
+
}
|
|
2364
|
+
async function adsDisconnect(project, opts) {
|
|
2365
|
+
const client = getClient5();
|
|
2366
|
+
const result = await client.adsDisconnect(project);
|
|
2367
|
+
if (isMachineFormat(opts?.format)) {
|
|
2368
|
+
console.log(JSON.stringify(result, null, 2));
|
|
2369
|
+
return;
|
|
2370
|
+
}
|
|
2371
|
+
console.log(result.disconnected ? `Disconnected the ads connection for ${project}.` : "No ads connection to remove.");
|
|
2372
|
+
}
|
|
2373
|
+
async function adsStatus(project, opts) {
|
|
2374
|
+
const client = getClient5();
|
|
2375
|
+
const result = await client.getAdsStatus(project);
|
|
2376
|
+
if (isMachineFormat(opts?.format)) {
|
|
2377
|
+
console.log(JSON.stringify(result, null, 2));
|
|
2378
|
+
return;
|
|
2379
|
+
}
|
|
2380
|
+
for (const line of describeConnection(result)) console.log(line);
|
|
2381
|
+
if (!result.connected) {
|
|
2382
|
+
console.log("Connect with: canonry ads connect " + project + " --api-key <sdk-key>");
|
|
2383
|
+
}
|
|
2384
|
+
}
|
|
2385
|
+
async function adsSync(project, opts) {
|
|
2386
|
+
const client = getClient5();
|
|
2387
|
+
const result = await client.triggerAdsSync(project);
|
|
2388
|
+
if (isMachineFormat(opts?.format)) {
|
|
2389
|
+
console.log(JSON.stringify(result, null, 2));
|
|
2390
|
+
return;
|
|
2391
|
+
}
|
|
2392
|
+
console.log(`Ads sync queued (run ${result.runId}). Check progress with: canonry runs get ${result.runId}`);
|
|
2393
|
+
}
|
|
2394
|
+
async function adsCampaigns(project, opts) {
|
|
2395
|
+
const client = getClient5();
|
|
2396
|
+
const result = await client.getAdsCampaigns(project);
|
|
2397
|
+
if (opts?.format === "jsonl") {
|
|
2398
|
+
emitJsonl(result.campaigns.map((campaign) => ({ project, ...campaign })));
|
|
2399
|
+
return;
|
|
2400
|
+
}
|
|
2401
|
+
if (isMachineFormat(opts?.format)) {
|
|
2402
|
+
console.log(JSON.stringify(result, null, 2));
|
|
2403
|
+
return;
|
|
2404
|
+
}
|
|
2405
|
+
if (result.campaigns.length === 0) {
|
|
2406
|
+
console.log('No campaign snapshots. Run "canonry ads sync ' + project + '" first.');
|
|
2407
|
+
return;
|
|
2408
|
+
}
|
|
2409
|
+
for (const campaign of result.campaigns) {
|
|
2410
|
+
const budget = campaign.dailySpendLimitMicros != null ? `${formatMicros(campaign.dailySpendLimitMicros)}/day` : "no daily limit";
|
|
2411
|
+
console.log(`${campaign.name} [${campaign.status}] \u2014 ${campaign.adGroups.length} ad groups, ${budget}`);
|
|
2412
|
+
for (const group of campaign.adGroups) {
|
|
2413
|
+
const bid = group.maxBidMicros != null ? `max bid ${formatMicros(group.maxBidMicros)}` : "auto bid";
|
|
2414
|
+
console.log(` - ${group.name} [${group.status}] \u2014 ${group.ads.length} ads, ${bid}`);
|
|
2415
|
+
const hintLines = group.contextHints.flatMap((hint) => hint.split("\n")).filter(Boolean);
|
|
2416
|
+
for (const hint of hintLines.slice(0, 3)) console.log(` ${hint}`);
|
|
2417
|
+
if (hintLines.length > 3) console.log(` \u2026 and ${hintLines.length - 3} more hint lines`);
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
async function adsInsights(project, opts) {
|
|
2422
|
+
const client = getClient5();
|
|
2423
|
+
const result = await client.getAdsInsights(project, {
|
|
2424
|
+
level: opts?.level,
|
|
2425
|
+
entityId: opts?.entity,
|
|
2426
|
+
from: opts?.from,
|
|
2427
|
+
to: opts?.to
|
|
2428
|
+
});
|
|
2429
|
+
if (opts?.format === "jsonl") {
|
|
2430
|
+
emitJsonl(result.rows.map((row) => ({ project, ...row })));
|
|
2431
|
+
return;
|
|
2432
|
+
}
|
|
2433
|
+
if (isMachineFormat(opts?.format)) {
|
|
2434
|
+
console.log(JSON.stringify(result, null, 2));
|
|
2435
|
+
return;
|
|
2436
|
+
}
|
|
2437
|
+
if (result.rows.length === 0) {
|
|
2438
|
+
console.log('No paid-performance rollups in range. Run "canonry ads sync ' + project + '" first.');
|
|
2439
|
+
return;
|
|
2440
|
+
}
|
|
2441
|
+
const currency = result.currencyCode ?? "USD";
|
|
2442
|
+
console.log("DATE LEVEL ENTITY IMPR CLICKS SPEND CPC");
|
|
2443
|
+
for (const row of result.rows) {
|
|
2444
|
+
const cpc = row.cpcMicros != null ? formatMicros(row.cpcMicros, currency) : "\u2014";
|
|
2445
|
+
console.log(
|
|
2446
|
+
`${row.date} ${row.level.padEnd(9)} ${row.entityId.padEnd(36).slice(0, 36)} ${String(row.impressions).padStart(6)} ${String(row.clicks).padStart(6)} ${formatMicros(row.spendMicros, currency).padStart(9)} ${cpc}`
|
|
2447
|
+
);
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
async function adsSummary(project, opts) {
|
|
2451
|
+
const client = getClient5();
|
|
2452
|
+
const result = await client.getAdsSummary(project);
|
|
2453
|
+
if (isMachineFormat(opts?.format)) {
|
|
2454
|
+
console.log(JSON.stringify(result, null, 2));
|
|
2455
|
+
return;
|
|
2456
|
+
}
|
|
2457
|
+
if (!result.connected) {
|
|
2458
|
+
console.log("Not connected. Connect with: canonry ads connect " + project + " --api-key <sdk-key>");
|
|
2459
|
+
return;
|
|
2460
|
+
}
|
|
2461
|
+
console.log(`Account: ${result.displayName ?? "unknown"} (${result.currencyCode ?? "?"})`);
|
|
2462
|
+
console.log(`Structure: ${result.campaignCount} campaigns / ${result.adGroupCount} ad groups / ${result.adCount} ads`);
|
|
2463
|
+
console.log(`Window: ${result.window.from ?? "\u2014"} \u2192 ${result.window.to ?? "\u2014"}`);
|
|
2464
|
+
console.log(`Impressions: ${result.totals.impressions}`);
|
|
2465
|
+
console.log(`Clicks: ${result.totals.clicks}${result.totals.ctr != null ? ` (CTR ${(result.totals.ctr * 100).toFixed(2)}%)` : ""}`);
|
|
2466
|
+
console.log(`Spend: ${formatMicros(result.totals.spendMicros, result.currencyCode ?? "USD")}${result.totals.cpcMicros != null ? ` (CPC ${formatMicros(result.totals.cpcMicros, result.currencyCode ?? "USD")})` : ""}`);
|
|
2467
|
+
console.log(`Last synced: ${result.lastSyncedAt ?? "never"}`);
|
|
2468
|
+
}
|
|
2469
|
+
|
|
2470
|
+
// src/cli-commands/ads.ts
|
|
2471
|
+
var ADS_CLI_COMMANDS = [
|
|
2472
|
+
{
|
|
2473
|
+
path: ["ads", "connect"],
|
|
2474
|
+
usage: "canonry ads connect <project> --api-key <sdk-key> [--format json]",
|
|
2475
|
+
options: {
|
|
2476
|
+
"api-key": stringOption()
|
|
2477
|
+
},
|
|
2478
|
+
run: async (input) => {
|
|
2479
|
+
const project = requireProject(input, "ads.connect", "canonry ads connect <project> --api-key <sdk-key> [--format json]");
|
|
2480
|
+
await adsConnect(project, {
|
|
2481
|
+
apiKey: getString(input.values, "api-key"),
|
|
2482
|
+
format: input.format
|
|
2483
|
+
});
|
|
2484
|
+
}
|
|
2485
|
+
},
|
|
2486
|
+
{
|
|
2487
|
+
path: ["ads", "disconnect"],
|
|
2488
|
+
usage: "canonry ads disconnect <project> [--format json]",
|
|
2489
|
+
run: async (input) => {
|
|
2490
|
+
const project = requireProject(input, "ads.disconnect", "canonry ads disconnect <project> [--format json]");
|
|
2491
|
+
await adsDisconnect(project, { format: input.format });
|
|
2492
|
+
}
|
|
2493
|
+
},
|
|
2494
|
+
{
|
|
2495
|
+
path: ["ads", "status"],
|
|
2496
|
+
usage: "canonry ads status <project> [--format json]",
|
|
2497
|
+
run: async (input) => {
|
|
2498
|
+
const project = requireProject(input, "ads.status", "canonry ads status <project> [--format json]");
|
|
2499
|
+
await adsStatus(project, { format: input.format });
|
|
2500
|
+
}
|
|
2501
|
+
},
|
|
2502
|
+
{
|
|
2503
|
+
path: ["ads", "sync"],
|
|
2504
|
+
usage: "canonry ads sync <project> [--format json]",
|
|
2505
|
+
run: async (input) => {
|
|
2506
|
+
const project = requireProject(input, "ads.sync", "canonry ads sync <project> [--format json]");
|
|
2507
|
+
await adsSync(project, { format: input.format });
|
|
2508
|
+
}
|
|
2509
|
+
},
|
|
2510
|
+
{
|
|
2511
|
+
path: ["ads", "campaigns"],
|
|
2512
|
+
usage: "canonry ads campaigns <project> [--format json|jsonl]",
|
|
2513
|
+
run: async (input) => {
|
|
2514
|
+
const project = requireProject(input, "ads.campaigns", "canonry ads campaigns <project> [--format json|jsonl]");
|
|
2515
|
+
await adsCampaigns(project, { format: input.format });
|
|
2516
|
+
}
|
|
2517
|
+
},
|
|
2518
|
+
{
|
|
2519
|
+
path: ["ads", "insights"],
|
|
2520
|
+
usage: "canonry ads insights <project> [--level campaign|ad_group] [--entity <id>] [--from YYYY-MM-DD] [--to YYYY-MM-DD] [--format json|jsonl]",
|
|
2521
|
+
options: {
|
|
2522
|
+
level: stringOption(),
|
|
2523
|
+
entity: stringOption(),
|
|
2524
|
+
from: stringOption(),
|
|
2525
|
+
to: stringOption()
|
|
2526
|
+
},
|
|
2527
|
+
run: async (input) => {
|
|
2528
|
+
const project = requireProject(input, "ads.insights", "canonry ads insights <project> [--level <level>] [--entity <id>] [--from <date>] [--to <date>] [--format json|jsonl]");
|
|
2529
|
+
await adsInsights(project, {
|
|
2530
|
+
level: getString(input.values, "level"),
|
|
2531
|
+
entity: getString(input.values, "entity"),
|
|
2532
|
+
from: getString(input.values, "from"),
|
|
2533
|
+
to: getString(input.values, "to"),
|
|
2534
|
+
format: input.format
|
|
2535
|
+
});
|
|
2536
|
+
}
|
|
2537
|
+
},
|
|
2538
|
+
{
|
|
2539
|
+
path: ["ads", "summary"],
|
|
2540
|
+
usage: "canonry ads summary <project> [--format json]",
|
|
2541
|
+
run: async (input) => {
|
|
2542
|
+
const project = requireProject(input, "ads.summary", "canonry ads summary <project> [--format json]");
|
|
2543
|
+
await adsSummary(project, { format: input.format });
|
|
2544
|
+
}
|
|
2545
|
+
}
|
|
2546
|
+
];
|
|
2547
|
+
|
|
2548
|
+
// src/commands/ga.ts
|
|
2549
|
+
function getClient6() {
|
|
2550
|
+
return createApiClient();
|
|
2551
|
+
}
|
|
2237
2552
|
async function gaConnect(project, opts) {
|
|
2238
2553
|
if (!opts.propertyId) {
|
|
2239
2554
|
throw new CliError({
|
|
@@ -2264,7 +2579,7 @@ async function gaConnect(project, opts) {
|
|
|
2264
2579
|
} else if (opts.keyJson) {
|
|
2265
2580
|
body.keyJson = opts.keyJson;
|
|
2266
2581
|
}
|
|
2267
|
-
const client =
|
|
2582
|
+
const client = getClient6();
|
|
2268
2583
|
const result = await client.gaConnect(project, body);
|
|
2269
2584
|
if (isMachineFormat(opts.format)) {
|
|
2270
2585
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -2279,7 +2594,7 @@ async function gaConnect(project, opts) {
|
|
|
2279
2594
|
}
|
|
2280
2595
|
}
|
|
2281
2596
|
async function gaDisconnect(project, format) {
|
|
2282
|
-
const client =
|
|
2597
|
+
const client = getClient6();
|
|
2283
2598
|
await client.gaDisconnect(project);
|
|
2284
2599
|
if (isMachineFormat(format)) {
|
|
2285
2600
|
console.log(JSON.stringify({ project, disconnected: true }, null, 2));
|
|
@@ -2288,7 +2603,7 @@ async function gaDisconnect(project, format) {
|
|
|
2288
2603
|
console.log(`GA4 disconnected from project "${project}".`);
|
|
2289
2604
|
}
|
|
2290
2605
|
async function gaStatus(project, format) {
|
|
2291
|
-
const client =
|
|
2606
|
+
const client = getClient6();
|
|
2292
2607
|
const result = await client.gaStatus(project);
|
|
2293
2608
|
if (isMachineFormat(format)) {
|
|
2294
2609
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -2314,7 +2629,7 @@ async function gaStatus(project, format) {
|
|
|
2314
2629
|
console.log(` Connected: ${result.createdAt ?? "unknown"}`);
|
|
2315
2630
|
}
|
|
2316
2631
|
async function gaSync(project, opts) {
|
|
2317
|
-
const client =
|
|
2632
|
+
const client = getClient6();
|
|
2318
2633
|
const body = {};
|
|
2319
2634
|
if (opts?.days) body.days = opts.days;
|
|
2320
2635
|
if (opts?.only) body.only = opts.only;
|
|
@@ -2334,7 +2649,7 @@ async function gaSync(project, opts) {
|
|
|
2334
2649
|
console.log(` Synced at: ${result.syncedAt}`);
|
|
2335
2650
|
}
|
|
2336
2651
|
async function gaTraffic(project, opts) {
|
|
2337
|
-
const client =
|
|
2652
|
+
const client = getClient6();
|
|
2338
2653
|
const params = {};
|
|
2339
2654
|
if (opts?.limit) params.limit = String(opts.limit);
|
|
2340
2655
|
if (opts?.window) params.window = opts.window;
|
|
@@ -2424,7 +2739,7 @@ async function gaTraffic(project, opts) {
|
|
|
2424
2739
|
}
|
|
2425
2740
|
}
|
|
2426
2741
|
async function gaAiReferralHistory(project, opts) {
|
|
2427
|
-
const client =
|
|
2742
|
+
const client = getClient6();
|
|
2428
2743
|
const result = await client.gaAiReferralHistory(project, opts?.window ? { window: opts.window } : void 0);
|
|
2429
2744
|
if (opts?.format === "json") {
|
|
2430
2745
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -2452,7 +2767,7 @@ async function gaAiReferralHistory(project, opts) {
|
|
|
2452
2767
|
}
|
|
2453
2768
|
}
|
|
2454
2769
|
async function gaSocialReferralHistory(project, opts) {
|
|
2455
|
-
const client =
|
|
2770
|
+
const client = getClient6();
|
|
2456
2771
|
const result = await client.gaSocialReferralHistory(project, opts?.window ? { window: opts.window } : void 0);
|
|
2457
2772
|
if (opts?.format === "json") {
|
|
2458
2773
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -2480,7 +2795,7 @@ async function gaSocialReferralHistory(project, opts) {
|
|
|
2480
2795
|
}
|
|
2481
2796
|
}
|
|
2482
2797
|
async function gaSessionHistory(project, opts) {
|
|
2483
|
-
const client =
|
|
2798
|
+
const client = getClient6();
|
|
2484
2799
|
const result = await client.gaSessionHistory(project, opts?.window ? { window: opts.window } : void 0);
|
|
2485
2800
|
if (opts?.format === "json") {
|
|
2486
2801
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -2505,7 +2820,7 @@ async function gaSessionHistory(project, opts) {
|
|
|
2505
2820
|
}
|
|
2506
2821
|
}
|
|
2507
2822
|
async function gaCoverage(project, format) {
|
|
2508
|
-
const client =
|
|
2823
|
+
const client = getClient6();
|
|
2509
2824
|
const result = await client.gaCoverage(project);
|
|
2510
2825
|
if (format === "json") {
|
|
2511
2826
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -2531,7 +2846,7 @@ async function gaCoverage(project, format) {
|
|
|
2531
2846
|
}
|
|
2532
2847
|
}
|
|
2533
2848
|
async function gaSocialReferralSummary(project, opts) {
|
|
2534
|
-
const client =
|
|
2849
|
+
const client = getClient6();
|
|
2535
2850
|
const traffic = await client.gaTraffic(project);
|
|
2536
2851
|
if (opts?.trend) {
|
|
2537
2852
|
const trend = await client.gaSocialReferralTrend(project);
|
|
@@ -2592,7 +2907,7 @@ async function gaSocialReferralSummary(project, opts) {
|
|
|
2592
2907
|
}
|
|
2593
2908
|
}
|
|
2594
2909
|
async function gaAttribution(project, opts) {
|
|
2595
|
-
const client =
|
|
2910
|
+
const client = getClient6();
|
|
2596
2911
|
const traffic = await client.gaTraffic(project);
|
|
2597
2912
|
const fmtTrend = (pct3) => pct3 === null ? "n/a" : `${pct3 >= 0 ? "+" : ""}${pct3}%`;
|
|
2598
2913
|
if (opts?.trend) {
|
|
@@ -2919,7 +3234,7 @@ var GA_CLI_COMMANDS = [
|
|
|
2919
3234
|
];
|
|
2920
3235
|
|
|
2921
3236
|
// src/commands/gbp.ts
|
|
2922
|
-
function
|
|
3237
|
+
function getClient7() {
|
|
2923
3238
|
return createApiClient();
|
|
2924
3239
|
}
|
|
2925
3240
|
function formatLocationsTable(response) {
|
|
@@ -2937,7 +3252,7 @@ function formatLocationsTable(response) {
|
|
|
2937
3252
|
return lines.join("\n");
|
|
2938
3253
|
}
|
|
2939
3254
|
async function gbpConnect(project, opts) {
|
|
2940
|
-
const client =
|
|
3255
|
+
const client = getClient7();
|
|
2941
3256
|
const { authUrl, redirectUri } = await client.googleConnect(project, {
|
|
2942
3257
|
type: "gbp",
|
|
2943
3258
|
publicUrl: opts.publicUrl
|
|
@@ -2956,7 +3271,7 @@ async function gbpConnect(project, opts) {
|
|
|
2956
3271
|
console.log("After authorizing, run `canonry gbp locations discover <project>` to fetch your locations.");
|
|
2957
3272
|
}
|
|
2958
3273
|
async function gbpDisconnect(project, opts) {
|
|
2959
|
-
const client =
|
|
3274
|
+
const client = getClient7();
|
|
2960
3275
|
await client.disconnectGbp(project);
|
|
2961
3276
|
if (isMachineFormat(opts.format)) {
|
|
2962
3277
|
console.log(JSON.stringify({ project, disconnected: true }, null, 2));
|
|
@@ -2965,7 +3280,7 @@ async function gbpDisconnect(project, opts) {
|
|
|
2965
3280
|
console.log(`Disconnected GBP from project "${project}" and removed all discovered locations.`);
|
|
2966
3281
|
}
|
|
2967
3282
|
async function gbpLocationsList(project, opts) {
|
|
2968
|
-
const client =
|
|
3283
|
+
const client = getClient7();
|
|
2969
3284
|
const response = await client.listGbpLocations(
|
|
2970
3285
|
project,
|
|
2971
3286
|
opts.selectedOnly ? { selected: true } : void 0
|
|
@@ -2977,7 +3292,7 @@ async function gbpLocationsList(project, opts) {
|
|
|
2977
3292
|
console.log(formatLocationsTable(response));
|
|
2978
3293
|
}
|
|
2979
3294
|
async function gbpAccounts(project, opts) {
|
|
2980
|
-
const client =
|
|
3295
|
+
const client = getClient7();
|
|
2981
3296
|
const response = await client.listGbpAccounts(project);
|
|
2982
3297
|
if (isMachineFormat(opts.format)) {
|
|
2983
3298
|
console.log(JSON.stringify(response, null, 2));
|
|
@@ -3002,7 +3317,7 @@ function formatAccountsTable(response) {
|
|
|
3002
3317
|
return lines.join("\n");
|
|
3003
3318
|
}
|
|
3004
3319
|
async function gbpLocationsDiscover(project, opts) {
|
|
3005
|
-
const client =
|
|
3320
|
+
const client = getClient7();
|
|
3006
3321
|
const hasBody = opts.selectAllNew !== void 0 || opts.account !== void 0 || opts.switchAccount;
|
|
3007
3322
|
const body = hasBody ? {
|
|
3008
3323
|
...opts.selectAllNew === void 0 ? {} : { selectAllNew: opts.selectAllNew },
|
|
@@ -3019,7 +3334,7 @@ Discovered ${response.totalDiscovered} location(s); ${response.totalSelected} se
|
|
|
3019
3334
|
console.log(formatLocationsTable(response));
|
|
3020
3335
|
}
|
|
3021
3336
|
async function gbpLocationSelect(project, opts) {
|
|
3022
|
-
const client =
|
|
3337
|
+
const client = getClient7();
|
|
3023
3338
|
const updated = await client.setGbpLocationSelection(project, opts.location, true);
|
|
3024
3339
|
if (isMachineFormat(opts.format)) {
|
|
3025
3340
|
console.log(JSON.stringify(updated, null, 2));
|
|
@@ -3028,7 +3343,7 @@ async function gbpLocationSelect(project, opts) {
|
|
|
3028
3343
|
console.log(`Selected ${opts.location} ("${updated.displayName}") for sync.`);
|
|
3029
3344
|
}
|
|
3030
3345
|
async function gbpLocationDeselect(project, opts) {
|
|
3031
|
-
const client =
|
|
3346
|
+
const client = getClient7();
|
|
3032
3347
|
const updated = await client.setGbpLocationSelection(project, opts.location, false);
|
|
3033
3348
|
if (isMachineFormat(opts.format)) {
|
|
3034
3349
|
console.log(JSON.stringify(updated, null, 2));
|
|
@@ -3037,7 +3352,7 @@ async function gbpLocationDeselect(project, opts) {
|
|
|
3037
3352
|
console.log(`Deselected ${opts.location} ("${updated.displayName}"). Future syncs will skip this location.`);
|
|
3038
3353
|
}
|
|
3039
3354
|
async function gbpSync(project, opts) {
|
|
3040
|
-
const client =
|
|
3355
|
+
const client = getClient7();
|
|
3041
3356
|
const { runId, status } = await client.triggerGbpSync(project, {
|
|
3042
3357
|
locationNames: opts.location ? [opts.location] : void 0,
|
|
3043
3358
|
daysOfMetrics: opts.days,
|
|
@@ -3073,7 +3388,7 @@ async function gbpSync(project, opts) {
|
|
|
3073
3388
|
console.log(`GBP sync ${final} (run ${runId}).`);
|
|
3074
3389
|
}
|
|
3075
3390
|
async function gbpMetrics(project, opts) {
|
|
3076
|
-
const client =
|
|
3391
|
+
const client = getClient7();
|
|
3077
3392
|
const response = await client.listGbpMetrics(project, { locationName: opts.location, metric: opts.metric });
|
|
3078
3393
|
if (isMachineFormat(opts.format)) {
|
|
3079
3394
|
console.log(JSON.stringify(response, null, 2));
|
|
@@ -3091,7 +3406,7 @@ async function gbpMetrics(project, opts) {
|
|
|
3091
3406
|
}
|
|
3092
3407
|
}
|
|
3093
3408
|
async function gbpKeywords(project, opts) {
|
|
3094
|
-
const client =
|
|
3409
|
+
const client = getClient7();
|
|
3095
3410
|
const response = await client.listGbpKeywords(project, { locationName: opts.location });
|
|
3096
3411
|
if (isMachineFormat(opts.format)) {
|
|
3097
3412
|
console.log(JSON.stringify(response, null, 2));
|
|
@@ -3108,7 +3423,7 @@ async function gbpKeywords(project, opts) {
|
|
|
3108
3423
|
}
|
|
3109
3424
|
}
|
|
3110
3425
|
async function gbpPlaceActions(project, opts) {
|
|
3111
|
-
const client =
|
|
3426
|
+
const client = getClient7();
|
|
3112
3427
|
const response = await client.listGbpPlaceActions(project, { locationName: opts.location });
|
|
3113
3428
|
if (isMachineFormat(opts.format)) {
|
|
3114
3429
|
console.log(JSON.stringify(response, null, 2));
|
|
@@ -3125,7 +3440,7 @@ async function gbpPlaceActions(project, opts) {
|
|
|
3125
3440
|
}
|
|
3126
3441
|
}
|
|
3127
3442
|
async function gbpLodging(project, opts) {
|
|
3128
|
-
const client =
|
|
3443
|
+
const client = getClient7();
|
|
3129
3444
|
const response = await client.listGbpLodging(project, { locationName: opts.location });
|
|
3130
3445
|
if (isMachineFormat(opts.format)) {
|
|
3131
3446
|
console.log(JSON.stringify(response, null, 2));
|
|
@@ -3142,7 +3457,7 @@ async function gbpLodging(project, opts) {
|
|
|
3142
3457
|
}
|
|
3143
3458
|
}
|
|
3144
3459
|
async function gbpPlaces(project, opts) {
|
|
3145
|
-
const client =
|
|
3460
|
+
const client = getClient7();
|
|
3146
3461
|
const response = await client.listGbpPlaces(project, { locationName: opts.location });
|
|
3147
3462
|
if (isMachineFormat(opts.format)) {
|
|
3148
3463
|
console.log(JSON.stringify(response, null, 2));
|
|
@@ -3163,7 +3478,7 @@ function fmtDelta(pct3) {
|
|
|
3163
3478
|
return `${pct3 >= 0 ? "+" : ""}${pct3}%`;
|
|
3164
3479
|
}
|
|
3165
3480
|
async function gbpSummary(project, opts) {
|
|
3166
|
-
const client =
|
|
3481
|
+
const client = getClient7();
|
|
3167
3482
|
const s = await client.getGbpSummary(project, { locationName: opts.location });
|
|
3168
3483
|
if (isMachineFormat(opts.format)) {
|
|
3169
3484
|
console.log(JSON.stringify(s, null, 2));
|
|
@@ -3481,7 +3796,7 @@ var GET_CLI_COMMANDS = [
|
|
|
3481
3796
|
];
|
|
3482
3797
|
|
|
3483
3798
|
// src/commands/traffic.ts
|
|
3484
|
-
function
|
|
3799
|
+
function getClient8() {
|
|
3485
3800
|
return createApiClient();
|
|
3486
3801
|
}
|
|
3487
3802
|
function configString(value, fallback = "(unset)") {
|
|
@@ -3535,7 +3850,7 @@ async function trafficConnectWordpress(project, opts) {
|
|
|
3535
3850
|
details: { project }
|
|
3536
3851
|
});
|
|
3537
3852
|
}
|
|
3538
|
-
const client =
|
|
3853
|
+
const client = getClient8();
|
|
3539
3854
|
const result = await client.trafficConnectWordpress(project, {
|
|
3540
3855
|
baseUrl: opts.url,
|
|
3541
3856
|
username: opts.username,
|
|
@@ -3586,7 +3901,7 @@ async function trafficConnectCloudRun(project, opts) {
|
|
|
3586
3901
|
details: { project, keyFile: opts.serviceAccountKey }
|
|
3587
3902
|
});
|
|
3588
3903
|
}
|
|
3589
|
-
const client =
|
|
3904
|
+
const client = getClient8();
|
|
3590
3905
|
const result = await client.trafficConnectCloudRun(project, {
|
|
3591
3906
|
gcpProjectId: opts.gcpProject,
|
|
3592
3907
|
serviceName: opts.service,
|
|
@@ -3664,7 +3979,7 @@ async function trafficConnectVercel(project, opts) {
|
|
|
3664
3979
|
details: { project, environment: opts.environment }
|
|
3665
3980
|
});
|
|
3666
3981
|
}
|
|
3667
|
-
const client =
|
|
3982
|
+
const client = getClient8();
|
|
3668
3983
|
const result = await client.trafficConnectVercel(project, {
|
|
3669
3984
|
projectId: opts.projectId,
|
|
3670
3985
|
teamId: opts.teamId,
|
|
@@ -3695,7 +4010,7 @@ async function trafficBackfill(project, opts) {
|
|
|
3695
4010
|
details: { project }
|
|
3696
4011
|
});
|
|
3697
4012
|
}
|
|
3698
|
-
const client =
|
|
4013
|
+
const client = getClient8();
|
|
3699
4014
|
const submitted = await client.trafficBackfill(project, opts.source, {
|
|
3700
4015
|
days: opts.days
|
|
3701
4016
|
});
|
|
@@ -3764,7 +4079,7 @@ async function trafficSync(project, opts) {
|
|
|
3764
4079
|
details: { project }
|
|
3765
4080
|
});
|
|
3766
4081
|
}
|
|
3767
|
-
const client =
|
|
4082
|
+
const client = getClient8();
|
|
3768
4083
|
const result = await client.trafficSync(project, opts.source, {
|
|
3769
4084
|
sinceMinutes: opts.sinceMinutes
|
|
3770
4085
|
});
|
|
@@ -3802,7 +4117,7 @@ async function trafficReset(project, opts) {
|
|
|
3802
4117
|
details: { project, source: opts.source }
|
|
3803
4118
|
});
|
|
3804
4119
|
}
|
|
3805
|
-
const client =
|
|
4120
|
+
const client = getClient8();
|
|
3806
4121
|
const updated = await client.trafficReset(project, opts.source);
|
|
3807
4122
|
if (isMachineFormat(opts.format)) {
|
|
3808
4123
|
console.log(JSON.stringify(updated, null, 2));
|
|
@@ -4224,11 +4539,11 @@ var TRAFFIC_CLI_COMMANDS = [
|
|
|
4224
4539
|
];
|
|
4225
4540
|
|
|
4226
4541
|
// src/commands/competitor.ts
|
|
4227
|
-
function
|
|
4542
|
+
function getClient9() {
|
|
4228
4543
|
return createApiClient();
|
|
4229
4544
|
}
|
|
4230
4545
|
async function addCompetitors(project, domains, format) {
|
|
4231
|
-
const client =
|
|
4546
|
+
const client = getClient9();
|
|
4232
4547
|
const existing = await client.listCompetitors(project);
|
|
4233
4548
|
const existingDomains = existing.map((c) => c.domain);
|
|
4234
4549
|
const existingSet = new Set(existingDomains);
|
|
@@ -4252,7 +4567,7 @@ async function addCompetitors(project, domains, format) {
|
|
|
4252
4567
|
}
|
|
4253
4568
|
}
|
|
4254
4569
|
async function removeCompetitors(project, domains, format) {
|
|
4255
|
-
const client =
|
|
4570
|
+
const client = getClient9();
|
|
4256
4571
|
const existing = await client.listCompetitors(project);
|
|
4257
4572
|
const existingDomains = existing.map((c) => c.domain);
|
|
4258
4573
|
const requested = new Set(uniqueStrings(domains));
|
|
@@ -4281,7 +4596,7 @@ function uniqueStrings(values) {
|
|
|
4281
4596
|
return result;
|
|
4282
4597
|
}
|
|
4283
4598
|
async function listCompetitors(project, format) {
|
|
4284
|
-
const client =
|
|
4599
|
+
const client = getClient9();
|
|
4285
4600
|
const comps = await client.listCompetitors(project);
|
|
4286
4601
|
if (format === "json") {
|
|
4287
4602
|
console.log(JSON.stringify(comps, null, 2));
|
|
@@ -4380,7 +4695,7 @@ var COMPETITOR_CLI_COMMANDS = [
|
|
|
4380
4695
|
|
|
4381
4696
|
// src/commands/google.ts
|
|
4382
4697
|
var INDEXING_API_SCOPE_NOTICE = "Note: Google's Indexing API officially supports only pages with JobPosting or BroadcastEvent (livestream VideoObject) structured data. For other URL types, submissions are accepted (HTTP 200) but not guaranteed to be prioritized for crawling. For general pages, submit a sitemap and use URL Inspection to monitor status.";
|
|
4383
|
-
function
|
|
4698
|
+
function getClient10() {
|
|
4384
4699
|
return createApiClient();
|
|
4385
4700
|
}
|
|
4386
4701
|
async function waitForRunStatus2(client, runId, config) {
|
|
@@ -4420,7 +4735,7 @@ async function waitForRunStatus2(client, runId, config) {
|
|
|
4420
4735
|
});
|
|
4421
4736
|
}
|
|
4422
4737
|
async function googleConnect(project, opts) {
|
|
4423
|
-
const client =
|
|
4738
|
+
const client = getClient10();
|
|
4424
4739
|
const { authUrl, redirectUri } = await client.googleConnect(project, {
|
|
4425
4740
|
type: opts.type,
|
|
4426
4741
|
publicUrl: opts.publicUrl
|
|
@@ -4454,7 +4769,7 @@ Open this URL in your browser to authorize Google ${opts.type.toUpperCase()} acc
|
|
|
4454
4769
|
}
|
|
4455
4770
|
}
|
|
4456
4771
|
async function googleDisconnect(project, opts) {
|
|
4457
|
-
const client =
|
|
4772
|
+
const client = getClient10();
|
|
4458
4773
|
await client.googleDisconnect(project, opts.type);
|
|
4459
4774
|
if (isMachineFormat(opts.format)) {
|
|
4460
4775
|
console.log(JSON.stringify({ project, type: opts.type, disconnected: true }, null, 2));
|
|
@@ -4463,7 +4778,7 @@ async function googleDisconnect(project, opts) {
|
|
|
4463
4778
|
console.log(`Disconnected Google ${opts.type.toUpperCase()} from project "${project}".`);
|
|
4464
4779
|
}
|
|
4465
4780
|
async function googleStatus(project, format) {
|
|
4466
|
-
const client =
|
|
4781
|
+
const client = getClient10();
|
|
4467
4782
|
const connections = await client.googleConnections(project);
|
|
4468
4783
|
if (format === "json") {
|
|
4469
4784
|
console.log(JSON.stringify({ connections }, null, 2));
|
|
@@ -4490,7 +4805,7 @@ async function googleStatus(project, format) {
|
|
|
4490
4805
|
}
|
|
4491
4806
|
}
|
|
4492
4807
|
async function googleProperties(project, format) {
|
|
4493
|
-
const client =
|
|
4808
|
+
const client = getClient10();
|
|
4494
4809
|
const { sites } = await client.googleProperties(project);
|
|
4495
4810
|
if (format === "json") {
|
|
4496
4811
|
console.log(JSON.stringify({ sites }, null, 2));
|
|
@@ -4514,7 +4829,7 @@ async function googleProperties(project, format) {
|
|
|
4514
4829
|
Use "canonry google set-property <project> <siteUrl>" to select a property.`);
|
|
4515
4830
|
}
|
|
4516
4831
|
async function googleSetProperty(project, propertyUrl, format) {
|
|
4517
|
-
const client =
|
|
4832
|
+
const client = getClient10();
|
|
4518
4833
|
await client.googleSetProperty(project, "gsc", propertyUrl);
|
|
4519
4834
|
if (isMachineFormat(format)) {
|
|
4520
4835
|
console.log(JSON.stringify({ project, type: "gsc", propertyUrl }, null, 2));
|
|
@@ -4523,7 +4838,7 @@ async function googleSetProperty(project, propertyUrl, format) {
|
|
|
4523
4838
|
console.log(`GSC property set to "${propertyUrl}" for project "${project}".`);
|
|
4524
4839
|
}
|
|
4525
4840
|
async function googleSync(project, opts) {
|
|
4526
|
-
const client =
|
|
4841
|
+
const client = getClient10();
|
|
4527
4842
|
const run = await client.gscSync(project, { days: opts.days, full: opts.full });
|
|
4528
4843
|
if (!opts.wait && isMachineFormat(opts.format)) {
|
|
4529
4844
|
console.log(JSON.stringify(run, null, 2));
|
|
@@ -4553,7 +4868,7 @@ async function googleSync(project, opts) {
|
|
|
4553
4868
|
}
|
|
4554
4869
|
}
|
|
4555
4870
|
async function googlePerformanceDaily(project, opts) {
|
|
4556
|
-
const client =
|
|
4871
|
+
const client = getClient10();
|
|
4557
4872
|
const params = {};
|
|
4558
4873
|
if (opts.window) params.window = opts.window;
|
|
4559
4874
|
if (opts.startDate) params.startDate = opts.startDate;
|
|
@@ -4586,7 +4901,7 @@ async function googlePerformanceDaily(project, opts) {
|
|
|
4586
4901
|
}
|
|
4587
4902
|
}
|
|
4588
4903
|
async function googlePerformance(project, opts) {
|
|
4589
|
-
const client =
|
|
4904
|
+
const client = getClient10();
|
|
4590
4905
|
const params = {};
|
|
4591
4906
|
if (opts.days) {
|
|
4592
4907
|
const end = /* @__PURE__ */ new Date();
|
|
@@ -4625,7 +4940,7 @@ async function googlePerformance(project, opts) {
|
|
|
4625
4940
|
}
|
|
4626
4941
|
}
|
|
4627
4942
|
async function googleInspect(project, url, format) {
|
|
4628
|
-
const client =
|
|
4943
|
+
const client = getClient10();
|
|
4629
4944
|
const result = await client.gscInspect(project, url);
|
|
4630
4945
|
if (isMachineFormat(format)) {
|
|
4631
4946
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -4645,7 +4960,7 @@ URL Inspection: ${result.url}
|
|
|
4645
4960
|
console.log(` Inspected At: ${result.inspectedAt}`);
|
|
4646
4961
|
}
|
|
4647
4962
|
async function googleInspections(project, opts) {
|
|
4648
|
-
const client =
|
|
4963
|
+
const client = getClient10();
|
|
4649
4964
|
const params = {};
|
|
4650
4965
|
if (opts.url) params.url = opts.url;
|
|
4651
4966
|
const rows = await client.gscInspections(project, Object.keys(params).length > 0 ? params : void 0);
|
|
@@ -4673,7 +4988,7 @@ async function googleInspections(project, opts) {
|
|
|
4673
4988
|
}
|
|
4674
4989
|
}
|
|
4675
4990
|
async function googleCoverage(project, format) {
|
|
4676
|
-
const client =
|
|
4991
|
+
const client = getClient10();
|
|
4677
4992
|
const result = await client.gscCoverage(project);
|
|
4678
4993
|
if (isMachineFormat(format)) {
|
|
4679
4994
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -4719,7 +5034,7 @@ Index Coverage for "${project}"
|
|
|
4719
5034
|
}
|
|
4720
5035
|
}
|
|
4721
5036
|
async function googleSetSitemap(project, sitemapUrl, format) {
|
|
4722
|
-
const client =
|
|
5037
|
+
const client = getClient10();
|
|
4723
5038
|
await client.googleSetSitemap(project, "gsc", sitemapUrl);
|
|
4724
5039
|
if (isMachineFormat(format)) {
|
|
4725
5040
|
console.log(JSON.stringify({ project, type: "gsc", sitemapUrl }, null, 2));
|
|
@@ -4728,7 +5043,7 @@ async function googleSetSitemap(project, sitemapUrl, format) {
|
|
|
4728
5043
|
console.log(`GSC sitemap URL set to "${sitemapUrl}" for project "${project}".`);
|
|
4729
5044
|
}
|
|
4730
5045
|
async function googleListSitemaps(project, opts) {
|
|
4731
|
-
const client =
|
|
5046
|
+
const client = getClient10();
|
|
4732
5047
|
const result = await client.gscSitemaps(project);
|
|
4733
5048
|
if (opts.format === "json") {
|
|
4734
5049
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -4753,7 +5068,7 @@ Sitemaps for project "${project}":
|
|
|
4753
5068
|
}
|
|
4754
5069
|
}
|
|
4755
5070
|
async function googleInspectSitemap(project, opts) {
|
|
4756
|
-
const client =
|
|
5071
|
+
const client = getClient10();
|
|
4757
5072
|
const run = await client.gscInspectSitemap(project, {
|
|
4758
5073
|
sitemapUrl: opts.sitemapUrl
|
|
4759
5074
|
});
|
|
@@ -4789,7 +5104,7 @@ async function googleInspectSitemap(project, opts) {
|
|
|
4789
5104
|
}
|
|
4790
5105
|
}
|
|
4791
5106
|
async function googleCoverageHistory(project, opts) {
|
|
4792
|
-
const client =
|
|
5107
|
+
const client = getClient10();
|
|
4793
5108
|
const rows = await client.gscCoverageHistory(project, { limit: opts.limit });
|
|
4794
5109
|
if (opts.format === "json") {
|
|
4795
5110
|
console.log(JSON.stringify(rows, null, 2));
|
|
@@ -4814,7 +5129,7 @@ GSC Coverage History for "${project}" (${rows.length} snapshots):
|
|
|
4814
5129
|
}
|
|
4815
5130
|
}
|
|
4816
5131
|
async function googleDiscoverSitemaps(project, opts) {
|
|
4817
|
-
const client =
|
|
5132
|
+
const client = getClient10();
|
|
4818
5133
|
const result = await client.gscDiscoverSitemaps(project);
|
|
4819
5134
|
if (!opts.wait && isMachineFormat(opts.format)) {
|
|
4820
5135
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -4866,7 +5181,7 @@ Primary sitemap: ${result.primarySitemapUrl}`);
|
|
|
4866
5181
|
}
|
|
4867
5182
|
}
|
|
4868
5183
|
async function googleRequestIndexing(project, opts) {
|
|
4869
|
-
const client =
|
|
5184
|
+
const client = getClient10();
|
|
4870
5185
|
const body = { urls: [] };
|
|
4871
5186
|
if (opts.allUnindexed) {
|
|
4872
5187
|
body.allUnindexed = true;
|
|
@@ -4961,7 +5276,7 @@ async function googleRequestIndexing(project, opts) {
|
|
|
4961
5276
|
}
|
|
4962
5277
|
}
|
|
4963
5278
|
async function googleRefresh(project, format) {
|
|
4964
|
-
const client =
|
|
5279
|
+
const client = getClient10();
|
|
4965
5280
|
const run = await client.gscSync(project, {});
|
|
4966
5281
|
if (!isMachineFormat(format)) {
|
|
4967
5282
|
process.stderr.write("Refreshing GSC coverage data");
|
|
@@ -4984,7 +5299,7 @@ async function googleRefresh(project, format) {
|
|
|
4984
5299
|
await googleCoverage(project, format);
|
|
4985
5300
|
}
|
|
4986
5301
|
async function googleDeindexed(project, format) {
|
|
4987
|
-
const client =
|
|
5302
|
+
const client = getClient10();
|
|
4988
5303
|
const rows = await client.gscDeindexed(project);
|
|
4989
5304
|
if (format === "json") {
|
|
4990
5305
|
console.log(JSON.stringify(rows, null, 2));
|
|
@@ -5293,14 +5608,14 @@ var GOOGLE_CLI_COMMANDS = [
|
|
|
5293
5608
|
];
|
|
5294
5609
|
|
|
5295
5610
|
// src/commands/keys.ts
|
|
5296
|
-
function
|
|
5611
|
+
function getClient11() {
|
|
5297
5612
|
return createApiClient();
|
|
5298
5613
|
}
|
|
5299
5614
|
function keyStatus(key) {
|
|
5300
5615
|
return key.revokedAt ? "revoked" : "active";
|
|
5301
5616
|
}
|
|
5302
5617
|
async function listApiKeys(format) {
|
|
5303
|
-
const client =
|
|
5618
|
+
const client = getClient11();
|
|
5304
5619
|
const { keys } = await client.listApiKeys();
|
|
5305
5620
|
if (format === "json") {
|
|
5306
5621
|
console.log(JSON.stringify({ keys }, null, 2));
|
|
@@ -5325,7 +5640,7 @@ async function listApiKeys(format) {
|
|
|
5325
5640
|
}
|
|
5326
5641
|
}
|
|
5327
5642
|
async function createApiKey(opts) {
|
|
5328
|
-
const client =
|
|
5643
|
+
const client = getClient11();
|
|
5329
5644
|
const body = { name: opts.name };
|
|
5330
5645
|
if (opts.scopes && opts.scopes.length > 0) body.scopes = opts.scopes;
|
|
5331
5646
|
const created = await client.createApiKey(body);
|
|
@@ -5341,7 +5656,7 @@ async function createApiKey(opts) {
|
|
|
5341
5656
|
console.log("\nSave this now \u2014 it will not be shown again.");
|
|
5342
5657
|
}
|
|
5343
5658
|
async function revokeApiKey(id, format) {
|
|
5344
|
-
const client =
|
|
5659
|
+
const client = getClient11();
|
|
5345
5660
|
const key = await client.revokeApiKey(id);
|
|
5346
5661
|
if (isMachineFormat(format)) {
|
|
5347
5662
|
console.log(JSON.stringify(key, null, 2));
|
|
@@ -5408,11 +5723,11 @@ var KEYS_CLI_COMMANDS = [
|
|
|
5408
5723
|
|
|
5409
5724
|
// src/commands/keyword.ts
|
|
5410
5725
|
import fs2 from "fs";
|
|
5411
|
-
function
|
|
5726
|
+
function getClient12() {
|
|
5412
5727
|
return createApiClient();
|
|
5413
5728
|
}
|
|
5414
5729
|
async function addKeywords(project, keywords, format) {
|
|
5415
|
-
const client =
|
|
5730
|
+
const client = getClient12();
|
|
5416
5731
|
await client.appendKeywords(project, keywords);
|
|
5417
5732
|
if (isMachineFormat(format)) {
|
|
5418
5733
|
console.log(JSON.stringify({
|
|
@@ -5425,7 +5740,7 @@ async function addKeywords(project, keywords, format) {
|
|
|
5425
5740
|
console.log(`Added ${keywords.length} key phrase(s) to "${project}".`);
|
|
5426
5741
|
}
|
|
5427
5742
|
async function replaceKeywords(project, keywords, format) {
|
|
5428
|
-
const client =
|
|
5743
|
+
const client = getClient12();
|
|
5429
5744
|
await client.putKeywords(project, keywords);
|
|
5430
5745
|
if (isMachineFormat(format)) {
|
|
5431
5746
|
console.log(JSON.stringify({
|
|
@@ -5438,7 +5753,7 @@ async function replaceKeywords(project, keywords, format) {
|
|
|
5438
5753
|
console.log(`Set ${keywords.length} key phrase(s) for "${project}".`);
|
|
5439
5754
|
}
|
|
5440
5755
|
async function removeKeywords(project, keywords, format) {
|
|
5441
|
-
const client =
|
|
5756
|
+
const client = getClient12();
|
|
5442
5757
|
const existing = await client.listKeywords(project);
|
|
5443
5758
|
const existingSet = new Set(existing.map((k) => k.keyword));
|
|
5444
5759
|
const removedKeywords = keywords.filter((k) => existingSet.has(k));
|
|
@@ -5455,7 +5770,7 @@ async function removeKeywords(project, keywords, format) {
|
|
|
5455
5770
|
console.log(`Removed ${removedKeywords.length} key phrase(s) from "${project}".`);
|
|
5456
5771
|
}
|
|
5457
5772
|
async function listKeywords(project, format) {
|
|
5458
|
-
const client =
|
|
5773
|
+
const client = getClient12();
|
|
5459
5774
|
const kws = await client.listKeywords(project);
|
|
5460
5775
|
if (format === "json") {
|
|
5461
5776
|
console.log(JSON.stringify(kws, null, 2));
|
|
@@ -5501,7 +5816,7 @@ async function importKeywords(project, filePath, format) {
|
|
|
5501
5816
|
console.log("No key phrases found in file.");
|
|
5502
5817
|
return;
|
|
5503
5818
|
}
|
|
5504
|
-
const client =
|
|
5819
|
+
const client = getClient12();
|
|
5505
5820
|
await client.appendKeywords(project, keywords);
|
|
5506
5821
|
if (isMachineFormat(format)) {
|
|
5507
5822
|
console.log(JSON.stringify({
|
|
@@ -5515,7 +5830,7 @@ async function importKeywords(project, filePath, format) {
|
|
|
5515
5830
|
console.log(`Imported ${keywords.length} key phrase(s) to "${project}".`);
|
|
5516
5831
|
}
|
|
5517
5832
|
async function generateKeywords(project, provider, opts) {
|
|
5518
|
-
const client =
|
|
5833
|
+
const client = getClient12();
|
|
5519
5834
|
const result = await client.generateKeywords(project, provider, opts.count);
|
|
5520
5835
|
const saved = Boolean(opts.save && result.keywords.length > 0);
|
|
5521
5836
|
if (!isMachineFormat(opts.format)) {
|
|
@@ -5688,11 +6003,11 @@ var KEYWORD_CLI_COMMANDS = [
|
|
|
5688
6003
|
|
|
5689
6004
|
// src/commands/query.ts
|
|
5690
6005
|
import fs3 from "fs";
|
|
5691
|
-
function
|
|
6006
|
+
function getClient13() {
|
|
5692
6007
|
return createApiClient();
|
|
5693
6008
|
}
|
|
5694
6009
|
async function addQueries(project, queries2, format) {
|
|
5695
|
-
const client =
|
|
6010
|
+
const client = getClient13();
|
|
5696
6011
|
await client.appendQueries(project, queries2);
|
|
5697
6012
|
if (isMachineFormat(format)) {
|
|
5698
6013
|
console.log(JSON.stringify({
|
|
@@ -5705,7 +6020,7 @@ async function addQueries(project, queries2, format) {
|
|
|
5705
6020
|
console.log(`Added ${queries2.length} ${queries2.length === 1 ? "query" : "queries"} to "${project}".`);
|
|
5706
6021
|
}
|
|
5707
6022
|
async function replaceQueries(project, queries2, opts) {
|
|
5708
|
-
const client =
|
|
6023
|
+
const client = getClient13();
|
|
5709
6024
|
const isJson = isMachineFormat(opts?.format);
|
|
5710
6025
|
if (opts?.dryRun) {
|
|
5711
6026
|
const preview = await client.previewReplaceQueries(project, queries2);
|
|
@@ -5741,7 +6056,7 @@ async function replaceQueries(project, queries2, opts) {
|
|
|
5741
6056
|
console.log(`Set ${queries2.length} ${queries2.length === 1 ? "query" : "queries"} for "${project}".`);
|
|
5742
6057
|
}
|
|
5743
6058
|
async function removeQueries(project, queries2, format) {
|
|
5744
|
-
const client =
|
|
6059
|
+
const client = getClient13();
|
|
5745
6060
|
const existing = await client.listQueries(project);
|
|
5746
6061
|
const existingSet = new Set(existing.map((q) => q.query));
|
|
5747
6062
|
const removedQueries = queries2.filter((q) => existingSet.has(q));
|
|
@@ -5758,7 +6073,7 @@ async function removeQueries(project, queries2, format) {
|
|
|
5758
6073
|
console.log(`Removed ${removedQueries.length} ${removedQueries.length === 1 ? "query" : "queries"} from "${project}".`);
|
|
5759
6074
|
}
|
|
5760
6075
|
async function listQueries(project, format) {
|
|
5761
|
-
const client =
|
|
6076
|
+
const client = getClient13();
|
|
5762
6077
|
const qs = await client.listQueries(project);
|
|
5763
6078
|
if (format === "json") {
|
|
5764
6079
|
console.log(JSON.stringify(qs, null, 2));
|
|
@@ -5804,7 +6119,7 @@ async function importQueries(project, filePath, format) {
|
|
|
5804
6119
|
console.log("No queries found in file.");
|
|
5805
6120
|
return;
|
|
5806
6121
|
}
|
|
5807
|
-
const client =
|
|
6122
|
+
const client = getClient13();
|
|
5808
6123
|
await client.appendQueries(project, queries2);
|
|
5809
6124
|
if (isMachineFormat(format)) {
|
|
5810
6125
|
console.log(JSON.stringify({
|
|
@@ -5818,7 +6133,7 @@ async function importQueries(project, filePath, format) {
|
|
|
5818
6133
|
console.log(`Imported ${queries2.length} ${queries2.length === 1 ? "query" : "queries"} to "${project}".`);
|
|
5819
6134
|
}
|
|
5820
6135
|
async function generateQueries(project, provider, opts) {
|
|
5821
|
-
const client =
|
|
6136
|
+
const client = getClient13();
|
|
5822
6137
|
const result = await client.generateQueries(project, provider, opts.count);
|
|
5823
6138
|
const saved = Boolean(opts.save && result.queries.length > 0);
|
|
5824
6139
|
if (!isMachineFormat(opts.format)) {
|
|
@@ -6313,11 +6628,11 @@ var MCP_CLI_COMMANDS = [
|
|
|
6313
6628
|
];
|
|
6314
6629
|
|
|
6315
6630
|
// src/commands/notify.ts
|
|
6316
|
-
function
|
|
6631
|
+
function getClient14() {
|
|
6317
6632
|
return createApiClient();
|
|
6318
6633
|
}
|
|
6319
6634
|
async function addNotification(project, opts) {
|
|
6320
|
-
const client =
|
|
6635
|
+
const client = getClient14();
|
|
6321
6636
|
const result = await client.createNotification(project, {
|
|
6322
6637
|
channel: "webhook",
|
|
6323
6638
|
url: opts.webhook,
|
|
@@ -6331,7 +6646,7 @@ async function addNotification(project, opts) {
|
|
|
6331
6646
|
printNotification(result);
|
|
6332
6647
|
}
|
|
6333
6648
|
async function listNotifications(project, format) {
|
|
6334
|
-
const client =
|
|
6649
|
+
const client = getClient14();
|
|
6335
6650
|
const results = await client.listNotifications(project);
|
|
6336
6651
|
if (format === "json") {
|
|
6337
6652
|
console.log(JSON.stringify(results, null, 2));
|
|
@@ -6352,7 +6667,7 @@ async function listNotifications(project, format) {
|
|
|
6352
6667
|
}
|
|
6353
6668
|
}
|
|
6354
6669
|
async function removeNotification(project, id, format) {
|
|
6355
|
-
const client =
|
|
6670
|
+
const client = getClient14();
|
|
6356
6671
|
await client.deleteNotification(project, id);
|
|
6357
6672
|
if (isMachineFormat(format)) {
|
|
6358
6673
|
console.log(JSON.stringify({ project, id, removed: true }, null, 2));
|
|
@@ -6361,7 +6676,7 @@ async function removeNotification(project, id, format) {
|
|
|
6361
6676
|
console.log(`Notification ${id} removed from "${project}"`);
|
|
6362
6677
|
}
|
|
6363
6678
|
async function testNotification(project, id, format) {
|
|
6364
|
-
const client =
|
|
6679
|
+
const client = getClient14();
|
|
6365
6680
|
const result = await client.testNotification(project, id);
|
|
6366
6681
|
if (isMachineFormat(format)) {
|
|
6367
6682
|
console.log(JSON.stringify({ project, id, ...result }, null, 2));
|
|
@@ -6556,11 +6871,11 @@ async function applyConfigs(filePaths, format) {
|
|
|
6556
6871
|
}
|
|
6557
6872
|
|
|
6558
6873
|
// src/commands/analytics.ts
|
|
6559
|
-
function
|
|
6874
|
+
function getClient15() {
|
|
6560
6875
|
return createApiClient();
|
|
6561
6876
|
}
|
|
6562
6877
|
async function showAnalytics(project, options) {
|
|
6563
|
-
const client =
|
|
6878
|
+
const client = getClient15();
|
|
6564
6879
|
const features = options.feature ? [options.feature] : ["metrics", "gaps", "sources"];
|
|
6565
6880
|
const results = {};
|
|
6566
6881
|
for (const feature of features) {
|
|
@@ -6678,7 +6993,7 @@ Source Origin Breakdown`);
|
|
|
6678
6993
|
}
|
|
6679
6994
|
|
|
6680
6995
|
// src/commands/sources.ts
|
|
6681
|
-
function
|
|
6996
|
+
function getClient16() {
|
|
6682
6997
|
return createApiClient();
|
|
6683
6998
|
}
|
|
6684
6999
|
var pct = (n) => `${(n * 100).toFixed(1)}%`;
|
|
@@ -6689,7 +7004,7 @@ async function showSources(project, options) {
|
|
|
6689
7004
|
details: { command: "sources", option: "limit", value: options.limit }
|
|
6690
7005
|
});
|
|
6691
7006
|
}
|
|
6692
|
-
const client =
|
|
7007
|
+
const client = getClient16();
|
|
6693
7008
|
const data = await client.getAnalyticsSources(project, { window: options.window, limit: options.limit });
|
|
6694
7009
|
if (options.format === "jsonl") {
|
|
6695
7010
|
emitJsonl(data.ranked.entries.map((e) => ({ project, ...e })));
|
|
@@ -6740,11 +7055,11 @@ function printRankedEntries(list, indent = "") {
|
|
|
6740
7055
|
}
|
|
6741
7056
|
|
|
6742
7057
|
// src/commands/evidence.ts
|
|
6743
|
-
function
|
|
7058
|
+
function getClient17() {
|
|
6744
7059
|
return createApiClient();
|
|
6745
7060
|
}
|
|
6746
7061
|
async function showEvidence(project, format) {
|
|
6747
|
-
const client =
|
|
7062
|
+
const client = getClient17();
|
|
6748
7063
|
const timeline = await client.getTimeline(project);
|
|
6749
7064
|
if (format === "json") {
|
|
6750
7065
|
const enriched = timeline.map((entry) => ({
|
|
@@ -6811,11 +7126,11 @@ async function loadLatestRunForExport(client, project) {
|
|
|
6811
7126
|
}
|
|
6812
7127
|
|
|
6813
7128
|
// src/commands/history.ts
|
|
6814
|
-
function
|
|
7129
|
+
function getClient18() {
|
|
6815
7130
|
return createApiClient();
|
|
6816
7131
|
}
|
|
6817
7132
|
async function showHistory(project, format) {
|
|
6818
|
-
const client =
|
|
7133
|
+
const client = getClient18();
|
|
6819
7134
|
try {
|
|
6820
7135
|
const entries = await client.getHistory(project);
|
|
6821
7136
|
if (format === "json") {
|
|
@@ -6854,11 +7169,11 @@ async function showHistory(project, format) {
|
|
|
6854
7169
|
}
|
|
6855
7170
|
|
|
6856
7171
|
// src/commands/status.ts
|
|
6857
|
-
function
|
|
7172
|
+
function getClient19() {
|
|
6858
7173
|
return createApiClient();
|
|
6859
7174
|
}
|
|
6860
7175
|
async function showStatus(project, format) {
|
|
6861
|
-
const client =
|
|
7176
|
+
const client = getClient19();
|
|
6862
7177
|
const projectData = await client.getProject(project);
|
|
6863
7178
|
const latest = await getLatestRunSummary(client, project);
|
|
6864
7179
|
if (isMachineFormat(format)) {
|
|
@@ -7014,11 +7329,11 @@ var OPERATOR_CLI_COMMANDS = [
|
|
|
7014
7329
|
];
|
|
7015
7330
|
|
|
7016
7331
|
// src/commands/project.ts
|
|
7017
|
-
function
|
|
7332
|
+
function getClient20() {
|
|
7018
7333
|
return createApiClient();
|
|
7019
7334
|
}
|
|
7020
7335
|
async function createProject(name, opts) {
|
|
7021
|
-
const client =
|
|
7336
|
+
const client = getClient20();
|
|
7022
7337
|
const result = await client.putProject(name, {
|
|
7023
7338
|
displayName: opts.displayName,
|
|
7024
7339
|
canonicalDomain: opts.domain,
|
|
@@ -7034,7 +7349,7 @@ async function createProject(name, opts) {
|
|
|
7034
7349
|
console.log(`Project created: ${result.name} (${result.id})`);
|
|
7035
7350
|
}
|
|
7036
7351
|
async function listProjects(format) {
|
|
7037
|
-
const client =
|
|
7352
|
+
const client = getClient20();
|
|
7038
7353
|
const projects2 = await client.listProjects();
|
|
7039
7354
|
if (format === "json") {
|
|
7040
7355
|
console.log(JSON.stringify(projects2, null, 2));
|
|
@@ -7066,7 +7381,7 @@ async function listProjects(format) {
|
|
|
7066
7381
|
}
|
|
7067
7382
|
}
|
|
7068
7383
|
async function showProject(name, format) {
|
|
7069
|
-
const client =
|
|
7384
|
+
const client = getClient20();
|
|
7070
7385
|
const project = await client.getProject(name);
|
|
7071
7386
|
if (isMachineFormat(format)) {
|
|
7072
7387
|
console.log(JSON.stringify(project, null, 2));
|
|
@@ -7095,7 +7410,7 @@ async function showProject(name, format) {
|
|
|
7095
7410
|
if (project.updatedAt) console.log(` Updated: ${project.updatedAt}`);
|
|
7096
7411
|
}
|
|
7097
7412
|
async function updateProjectSettings(name, opts) {
|
|
7098
|
-
const client =
|
|
7413
|
+
const client = getClient20();
|
|
7099
7414
|
const project = await client.getProject(name);
|
|
7100
7415
|
let ownedDomains = opts.ownedDomains ?? project.ownedDomains ?? [];
|
|
7101
7416
|
if (opts.addOwnedDomain) {
|
|
@@ -7132,7 +7447,7 @@ async function updateProjectSettings(name, opts) {
|
|
|
7132
7447
|
console.log(`Project updated: ${result.name}`);
|
|
7133
7448
|
}
|
|
7134
7449
|
async function deleteProject(name, opts) {
|
|
7135
|
-
const client =
|
|
7450
|
+
const client = getClient20();
|
|
7136
7451
|
const isJson = isMachineFormat(opts?.format);
|
|
7137
7452
|
if (opts?.dryRun) {
|
|
7138
7453
|
const preview = await client.previewProjectDelete(name);
|
|
@@ -7162,7 +7477,7 @@ async function deleteProject(name, opts) {
|
|
|
7162
7477
|
console.log(`Project deleted: ${name}`);
|
|
7163
7478
|
}
|
|
7164
7479
|
async function addLocation(project, opts) {
|
|
7165
|
-
const client =
|
|
7480
|
+
const client = getClient20();
|
|
7166
7481
|
const location = await client.addLocation(project, {
|
|
7167
7482
|
label: opts.label,
|
|
7168
7483
|
city: opts.city,
|
|
@@ -7177,7 +7492,7 @@ async function addLocation(project, opts) {
|
|
|
7177
7492
|
console.log(`Location added: ${opts.label} (${opts.city}, ${opts.region}, ${opts.country})`);
|
|
7178
7493
|
}
|
|
7179
7494
|
async function listLocations(project, format) {
|
|
7180
|
-
const client =
|
|
7495
|
+
const client = getClient20();
|
|
7181
7496
|
const result = await client.listLocations(project);
|
|
7182
7497
|
if (format === "json") {
|
|
7183
7498
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -7211,7 +7526,7 @@ async function listLocations(project, format) {
|
|
|
7211
7526
|
}
|
|
7212
7527
|
}
|
|
7213
7528
|
async function removeLocation(project, label, format) {
|
|
7214
|
-
const client =
|
|
7529
|
+
const client = getClient20();
|
|
7215
7530
|
await client.removeLocation(project, label);
|
|
7216
7531
|
if (isMachineFormat(format)) {
|
|
7217
7532
|
console.log(JSON.stringify({ project, label, removed: true }, null, 2));
|
|
@@ -7220,7 +7535,7 @@ async function removeLocation(project, label, format) {
|
|
|
7220
7535
|
console.log(`Location removed: ${label}`);
|
|
7221
7536
|
}
|
|
7222
7537
|
async function setDefaultLocation(project, label, format) {
|
|
7223
|
-
const client =
|
|
7538
|
+
const client = getClient20();
|
|
7224
7539
|
const result = await client.setDefaultLocation(project, label);
|
|
7225
7540
|
if (isMachineFormat(format)) {
|
|
7226
7541
|
console.log(JSON.stringify({ project, ...result }, null, 2));
|
|
@@ -7461,12 +7776,12 @@ var REPORT_CLI_COMMANDS = [
|
|
|
7461
7776
|
];
|
|
7462
7777
|
|
|
7463
7778
|
// src/commands/run.ts
|
|
7464
|
-
function
|
|
7779
|
+
function getClient21() {
|
|
7465
7780
|
return createApiClient();
|
|
7466
7781
|
}
|
|
7467
7782
|
var TERMINAL_STATUSES = /* @__PURE__ */ new Set(["completed", "partial", "failed", "cancelled"]);
|
|
7468
7783
|
async function triggerRun(project, opts) {
|
|
7469
|
-
const client =
|
|
7784
|
+
const client = getClient21();
|
|
7470
7785
|
const body = {};
|
|
7471
7786
|
if (opts?.provider) {
|
|
7472
7787
|
const providerInputs = opts.provider.split(",").map((s) => s.trim()).filter(Boolean);
|
|
@@ -7568,7 +7883,7 @@ async function triggerRun(project, opts) {
|
|
|
7568
7883
|
}
|
|
7569
7884
|
}
|
|
7570
7885
|
async function triggerRunAll(opts) {
|
|
7571
|
-
const client =
|
|
7886
|
+
const client = getClient21();
|
|
7572
7887
|
const projects2 = await client.listProjects();
|
|
7573
7888
|
if (projects2.length === 0) {
|
|
7574
7889
|
if (isMachineFormat(opts?.format)) {
|
|
@@ -7651,7 +7966,7 @@ async function triggerRunAll(opts) {
|
|
|
7651
7966
|
}
|
|
7652
7967
|
}
|
|
7653
7968
|
async function cancelRun(project, runId, format) {
|
|
7654
|
-
const client =
|
|
7969
|
+
const client = getClient21();
|
|
7655
7970
|
let targetId = runId;
|
|
7656
7971
|
if (!targetId) {
|
|
7657
7972
|
const runs = await client.listRuns(project);
|
|
@@ -7683,7 +7998,7 @@ To cancel by ID : canonry run cancel ${project} <run-id>`,
|
|
|
7683
7998
|
console.log(`Run ${result.id} cancelled.`);
|
|
7684
7999
|
}
|
|
7685
8000
|
async function showRun(id, format) {
|
|
7686
|
-
const client =
|
|
8001
|
+
const client = getClient21();
|
|
7687
8002
|
const run = await client.getRun(id);
|
|
7688
8003
|
if (isMachineFormat(format)) {
|
|
7689
8004
|
console.log(JSON.stringify(run, null, 2));
|
|
@@ -7692,7 +8007,7 @@ async function showRun(id, format) {
|
|
|
7692
8007
|
printRunDetail(run);
|
|
7693
8008
|
}
|
|
7694
8009
|
async function listRuns(project, opts) {
|
|
7695
|
-
const client =
|
|
8010
|
+
const client = getClient21();
|
|
7696
8011
|
const runs = await client.listRuns(project, opts?.limit, opts?.kind);
|
|
7697
8012
|
if (opts?.format === "json") {
|
|
7698
8013
|
console.log(JSON.stringify(runs, null, 2));
|
|
@@ -7867,11 +8182,11 @@ var RUN_CLI_COMMANDS = [
|
|
|
7867
8182
|
];
|
|
7868
8183
|
|
|
7869
8184
|
// src/commands/schedule.ts
|
|
7870
|
-
function
|
|
8185
|
+
function getClient22() {
|
|
7871
8186
|
return createApiClient();
|
|
7872
8187
|
}
|
|
7873
8188
|
async function setSchedule(project, opts) {
|
|
7874
|
-
const client =
|
|
8189
|
+
const client = getClient22();
|
|
7875
8190
|
const body = {};
|
|
7876
8191
|
if (opts.kind) body.kind = opts.kind;
|
|
7877
8192
|
if (opts.sourceId) body.sourceId = opts.sourceId;
|
|
@@ -7888,7 +8203,7 @@ async function setSchedule(project, opts) {
|
|
|
7888
8203
|
printSchedule(result);
|
|
7889
8204
|
}
|
|
7890
8205
|
async function showSchedule(project, format, kind) {
|
|
7891
|
-
const client =
|
|
8206
|
+
const client = getClient22();
|
|
7892
8207
|
const result = await client.getSchedule(project, kind);
|
|
7893
8208
|
if (isMachineFormat(format)) {
|
|
7894
8209
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -7897,7 +8212,7 @@ async function showSchedule(project, format, kind) {
|
|
|
7897
8212
|
printSchedule(result);
|
|
7898
8213
|
}
|
|
7899
8214
|
async function enableSchedule(project, format, kind) {
|
|
7900
|
-
const client =
|
|
8215
|
+
const client = getClient22();
|
|
7901
8216
|
const current = await client.getSchedule(project, kind);
|
|
7902
8217
|
const body = { kind: current.kind, timezone: current.timezone, enabled: true };
|
|
7903
8218
|
if (current.preset) body.preset = current.preset;
|
|
@@ -7912,7 +8227,7 @@ async function enableSchedule(project, format, kind) {
|
|
|
7912
8227
|
console.log(`Schedule enabled for "${project}" (kind: ${result.kind})`);
|
|
7913
8228
|
}
|
|
7914
8229
|
async function disableSchedule(project, format, kind) {
|
|
7915
|
-
const client =
|
|
8230
|
+
const client = getClient22();
|
|
7916
8231
|
const current = await client.getSchedule(project, kind);
|
|
7917
8232
|
const body = { kind: current.kind, timezone: current.timezone, enabled: false };
|
|
7918
8233
|
if (current.preset) body.preset = current.preset;
|
|
@@ -7927,7 +8242,7 @@ async function disableSchedule(project, format, kind) {
|
|
|
7927
8242
|
console.log(`Schedule disabled for "${project}" (kind: ${result.kind})`);
|
|
7928
8243
|
}
|
|
7929
8244
|
async function removeSchedule(project, format, kind) {
|
|
7930
|
-
const client =
|
|
8245
|
+
const client = getClient22();
|
|
7931
8246
|
await client.deleteSchedule(project, kind);
|
|
7932
8247
|
const resolvedKind = kind ?? "answer-visibility";
|
|
7933
8248
|
if (isMachineFormat(format)) {
|
|
@@ -8045,11 +8360,11 @@ var SCHEDULE_CLI_COMMANDS = [
|
|
|
8045
8360
|
];
|
|
8046
8361
|
|
|
8047
8362
|
// src/commands/settings.ts
|
|
8048
|
-
function
|
|
8363
|
+
function getClient23() {
|
|
8049
8364
|
return createApiClient();
|
|
8050
8365
|
}
|
|
8051
8366
|
async function setProvider(name, opts) {
|
|
8052
|
-
const client =
|
|
8367
|
+
const client = getClient23();
|
|
8053
8368
|
const { format, ...payload } = opts;
|
|
8054
8369
|
const result = await client.updateProvider(name, payload);
|
|
8055
8370
|
if (isMachineFormat(format)) {
|
|
@@ -8065,7 +8380,7 @@ async function setProvider(name, opts) {
|
|
|
8065
8380
|
}
|
|
8066
8381
|
}
|
|
8067
8382
|
async function showSettings(format) {
|
|
8068
|
-
const client =
|
|
8383
|
+
const client = getClient23();
|
|
8069
8384
|
const config = loadConfig();
|
|
8070
8385
|
const settings = await client.getSettings();
|
|
8071
8386
|
if (isMachineFormat(format)) {
|
|
@@ -8615,7 +8930,7 @@ function wrapText(font, text, size, maxWidth) {
|
|
|
8615
8930
|
}
|
|
8616
8931
|
|
|
8617
8932
|
// src/commands/snapshot.ts
|
|
8618
|
-
function
|
|
8933
|
+
function getClient24() {
|
|
8619
8934
|
return createApiClient();
|
|
8620
8935
|
}
|
|
8621
8936
|
function slugify(value) {
|
|
@@ -8626,7 +8941,7 @@ function autoOutputPath(companyName, ext) {
|
|
|
8626
8941
|
return `${slugify(companyName)}-snapshot-${date}.${ext}`;
|
|
8627
8942
|
}
|
|
8628
8943
|
async function createSnapshotReport(companyName, opts) {
|
|
8629
|
-
const client =
|
|
8944
|
+
const client = getClient24();
|
|
8630
8945
|
const report = await client.createSnapshot({
|
|
8631
8946
|
companyName,
|
|
8632
8947
|
domain: opts.domain,
|
|
@@ -10710,11 +11025,11 @@ var SYSTEM_CLI_COMMANDS = [
|
|
|
10710
11025
|
];
|
|
10711
11026
|
|
|
10712
11027
|
// src/commands/technical-aeo.ts
|
|
10713
|
-
function
|
|
11028
|
+
function getClient25() {
|
|
10714
11029
|
return createApiClient();
|
|
10715
11030
|
}
|
|
10716
11031
|
async function technicalAeoScore(project, opts) {
|
|
10717
|
-
const client =
|
|
11032
|
+
const client = getClient25();
|
|
10718
11033
|
const score = await client.getTechnicalAeoScore(project);
|
|
10719
11034
|
if (isMachineFormat(opts.format)) {
|
|
10720
11035
|
console.log(JSON.stringify(score, null, 2));
|
|
@@ -10750,7 +11065,7 @@ async function technicalAeoScore(project, opts) {
|
|
|
10750
11065
|
console.log(lines.join("\n"));
|
|
10751
11066
|
}
|
|
10752
11067
|
async function technicalAeoPages(project, opts) {
|
|
10753
|
-
const client =
|
|
11068
|
+
const client = getClient25();
|
|
10754
11069
|
const status = opts.status === "success" || opts.status === "error" ? opts.status : void 0;
|
|
10755
11070
|
const res = await client.getTechnicalAeoPages(project, { status, sort: opts.sort, limit: opts.limit });
|
|
10756
11071
|
if (opts.format === "jsonl") {
|
|
@@ -10776,7 +11091,7 @@ async function technicalAeoPages(project, opts) {
|
|
|
10776
11091
|
console.log(lines.join("\n"));
|
|
10777
11092
|
}
|
|
10778
11093
|
async function technicalAeoTrend(project, opts) {
|
|
10779
|
-
const client =
|
|
11094
|
+
const client = getClient25();
|
|
10780
11095
|
const res = await client.getTechnicalAeoTrend(project, { limit: opts.limit });
|
|
10781
11096
|
if (opts.format === "jsonl") {
|
|
10782
11097
|
emitJsonl(res.points.map((p) => ({ project, ...p })));
|
|
@@ -10798,7 +11113,7 @@ async function technicalAeoTrend(project, opts) {
|
|
|
10798
11113
|
console.log(lines.join("\n"));
|
|
10799
11114
|
}
|
|
10800
11115
|
async function technicalAeoRun(project, opts) {
|
|
10801
|
-
const client =
|
|
11116
|
+
const client = getClient25();
|
|
10802
11117
|
const { runId, status } = await client.triggerSiteAudit(project, {
|
|
10803
11118
|
sitemapUrl: opts.sitemapUrl,
|
|
10804
11119
|
limit: opts.limit
|
|
@@ -10917,7 +11232,7 @@ var TECHNICAL_AEO_CLI_COMMANDS = [
|
|
|
10917
11232
|
import fs11 from "fs";
|
|
10918
11233
|
|
|
10919
11234
|
// src/commands/wordpress.ts
|
|
10920
|
-
function
|
|
11235
|
+
function getClient26() {
|
|
10921
11236
|
return createApiClient();
|
|
10922
11237
|
}
|
|
10923
11238
|
async function loadYamlModule() {
|
|
@@ -11067,7 +11382,7 @@ async function wordpressConnect(project, opts) {
|
|
|
11067
11382
|
details: { project }
|
|
11068
11383
|
});
|
|
11069
11384
|
}
|
|
11070
|
-
const client =
|
|
11385
|
+
const client = getClient26();
|
|
11071
11386
|
const result = await client.wordpressConnect(project, {
|
|
11072
11387
|
url: opts.url,
|
|
11073
11388
|
stagingUrl: opts.stagingUrl,
|
|
@@ -11084,7 +11399,7 @@ async function wordpressConnect(project, opts) {
|
|
|
11084
11399
|
printWordpressStatus(project, result);
|
|
11085
11400
|
}
|
|
11086
11401
|
async function wordpressDisconnect(project, format) {
|
|
11087
|
-
const client =
|
|
11402
|
+
const client = getClient26();
|
|
11088
11403
|
await client.wordpressDisconnect(project);
|
|
11089
11404
|
if (isMachineFormat(format)) {
|
|
11090
11405
|
printJson2({ project, disconnected: true });
|
|
@@ -11093,7 +11408,7 @@ async function wordpressDisconnect(project, format) {
|
|
|
11093
11408
|
console.log(`WordPress disconnected from project "${project}".`);
|
|
11094
11409
|
}
|
|
11095
11410
|
async function wordpressStatus(project, format) {
|
|
11096
|
-
const client =
|
|
11411
|
+
const client = getClient26();
|
|
11097
11412
|
const result = await client.wordpressStatus(project);
|
|
11098
11413
|
if (isMachineFormat(format)) {
|
|
11099
11414
|
printJson2(result);
|
|
@@ -11102,7 +11417,7 @@ async function wordpressStatus(project, format) {
|
|
|
11102
11417
|
printWordpressStatus(project, result);
|
|
11103
11418
|
}
|
|
11104
11419
|
async function wordpressPages(project, opts) {
|
|
11105
|
-
const client =
|
|
11420
|
+
const client = getClient26();
|
|
11106
11421
|
const result = await client.wordpressPages(project, opts.env);
|
|
11107
11422
|
if (isMachineFormat(opts.format)) {
|
|
11108
11423
|
printJson2(result);
|
|
@@ -11111,7 +11426,7 @@ async function wordpressPages(project, opts) {
|
|
|
11111
11426
|
printPages(project, result.env, result.pages);
|
|
11112
11427
|
}
|
|
11113
11428
|
async function wordpressPage(project, slug, opts) {
|
|
11114
|
-
const client =
|
|
11429
|
+
const client = getClient26();
|
|
11115
11430
|
const result = await client.wordpressPage(project, slug, opts.env);
|
|
11116
11431
|
if (isMachineFormat(opts.format)) {
|
|
11117
11432
|
printJson2(result);
|
|
@@ -11120,7 +11435,7 @@ async function wordpressPage(project, slug, opts) {
|
|
|
11120
11435
|
printPageDetail(result);
|
|
11121
11436
|
}
|
|
11122
11437
|
async function wordpressCreatePage(project, body) {
|
|
11123
|
-
const client =
|
|
11438
|
+
const client = getClient26();
|
|
11124
11439
|
const result = await client.wordpressCreatePage(project, body);
|
|
11125
11440
|
if (isMachineFormat(body.format)) {
|
|
11126
11441
|
printJson2(result);
|
|
@@ -11131,7 +11446,7 @@ async function wordpressCreatePage(project, body) {
|
|
|
11131
11446
|
printPageDetail(result);
|
|
11132
11447
|
}
|
|
11133
11448
|
async function wordpressUpdatePage(project, body) {
|
|
11134
|
-
const client =
|
|
11449
|
+
const client = getClient26();
|
|
11135
11450
|
const result = await client.wordpressUpdatePage(project, body);
|
|
11136
11451
|
if (isMachineFormat(body.format)) {
|
|
11137
11452
|
printJson2(result);
|
|
@@ -11142,7 +11457,7 @@ async function wordpressUpdatePage(project, body) {
|
|
|
11142
11457
|
printPageDetail(result);
|
|
11143
11458
|
}
|
|
11144
11459
|
async function wordpressSetMeta(project, body) {
|
|
11145
|
-
const client =
|
|
11460
|
+
const client = getClient26();
|
|
11146
11461
|
const result = await client.wordpressSetMeta(project, body);
|
|
11147
11462
|
if (isMachineFormat(body.format)) {
|
|
11148
11463
|
printJson2(result);
|
|
@@ -11192,7 +11507,7 @@ async function wordpressBulkSetMeta(project, opts) {
|
|
|
11192
11507
|
details: { path: filePath }
|
|
11193
11508
|
});
|
|
11194
11509
|
}
|
|
11195
|
-
const client =
|
|
11510
|
+
const client = getClient26();
|
|
11196
11511
|
const result = await client.wordpressBulkSetMeta(project, { entries, env: opts.env });
|
|
11197
11512
|
if (isMachineFormat(opts.format)) {
|
|
11198
11513
|
printJson2(result);
|
|
@@ -11235,7 +11550,7 @@ async function wordpressBulkSetMeta(project, opts) {
|
|
|
11235
11550
|
Total: ${applied.length} applied, ${skipped.length} skipped, ${manual.length} manual`);
|
|
11236
11551
|
}
|
|
11237
11552
|
async function wordpressSchema(project, slug, opts) {
|
|
11238
|
-
const client =
|
|
11553
|
+
const client = getClient26();
|
|
11239
11554
|
const result = await client.wordpressSchema(project, slug, opts.env);
|
|
11240
11555
|
if (isMachineFormat(opts.format)) {
|
|
11241
11556
|
printJson2(result);
|
|
@@ -11246,7 +11561,7 @@ async function wordpressSchema(project, slug, opts) {
|
|
|
11246
11561
|
printSchemaBlocks(result.blocks);
|
|
11247
11562
|
}
|
|
11248
11563
|
async function wordpressSetSchema(project, body) {
|
|
11249
|
-
const client =
|
|
11564
|
+
const client = getClient26();
|
|
11250
11565
|
const result = await client.wordpressSetSchema(project, body);
|
|
11251
11566
|
if (isMachineFormat(body.format)) {
|
|
11252
11567
|
printJson2(result);
|
|
@@ -11294,7 +11609,7 @@ async function wordpressSchemaDeploy(project, opts) {
|
|
|
11294
11609
|
details: { path: filePath }
|
|
11295
11610
|
});
|
|
11296
11611
|
}
|
|
11297
|
-
const client =
|
|
11612
|
+
const client = getClient26();
|
|
11298
11613
|
const result = await client.wordpressSchemaDeploy(project, { profile: parsed, env: opts.env });
|
|
11299
11614
|
if (isMachineFormat(opts.format)) {
|
|
11300
11615
|
printJson2(result);
|
|
@@ -11333,7 +11648,7 @@ async function wordpressSchemaDeploy(project, opts) {
|
|
|
11333
11648
|
Total: ${deployed} deployed, ${stripped} stripped, ${skipped} skipped, ${failed} failed`);
|
|
11334
11649
|
}
|
|
11335
11650
|
async function wordpressSchemaStatus(project, opts) {
|
|
11336
|
-
const client =
|
|
11651
|
+
const client = getClient26();
|
|
11337
11652
|
const result = await client.wordpressSchemaStatus(project, opts.env);
|
|
11338
11653
|
if (isMachineFormat(opts.format)) {
|
|
11339
11654
|
printJson2(result);
|
|
@@ -11392,7 +11707,7 @@ async function wordpressOnboard(project, opts) {
|
|
|
11392
11707
|
});
|
|
11393
11708
|
}
|
|
11394
11709
|
}
|
|
11395
|
-
const client =
|
|
11710
|
+
const client = getClient26();
|
|
11396
11711
|
const result = await client.wordpressOnboard(project, {
|
|
11397
11712
|
url: opts.url,
|
|
11398
11713
|
username: opts.user,
|
|
@@ -11417,7 +11732,7 @@ async function wordpressOnboard(project, opts) {
|
|
|
11417
11732
|
}
|
|
11418
11733
|
}
|
|
11419
11734
|
async function wordpressLlmsTxt(project, opts) {
|
|
11420
|
-
const client =
|
|
11735
|
+
const client = getClient26();
|
|
11421
11736
|
const result = await client.wordpressLlmsTxt(project, opts.env);
|
|
11422
11737
|
if (isMachineFormat(opts.format)) {
|
|
11423
11738
|
printJson2(result);
|
|
@@ -11428,7 +11743,7 @@ async function wordpressLlmsTxt(project, opts) {
|
|
|
11428
11743
|
console.log(result.content ?? "(not found)");
|
|
11429
11744
|
}
|
|
11430
11745
|
async function wordpressSetLlmsTxt(project, body) {
|
|
11431
|
-
const client =
|
|
11746
|
+
const client = getClient26();
|
|
11432
11747
|
const result = await client.wordpressSetLlmsTxt(project, body);
|
|
11433
11748
|
if (isMachineFormat(body.format)) {
|
|
11434
11749
|
printJson2(result);
|
|
@@ -11437,7 +11752,7 @@ async function wordpressSetLlmsTxt(project, body) {
|
|
|
11437
11752
|
printManualAssist(`llms.txt update for "${project}"`, result);
|
|
11438
11753
|
}
|
|
11439
11754
|
async function wordpressAudit(project, opts) {
|
|
11440
|
-
const client =
|
|
11755
|
+
const client = getClient26();
|
|
11441
11756
|
const result = await client.wordpressAudit(project, opts.env);
|
|
11442
11757
|
if (isMachineFormat(opts.format)) {
|
|
11443
11758
|
printJson2(result);
|
|
@@ -11451,7 +11766,7 @@ async function wordpressAudit(project, opts) {
|
|
|
11451
11766
|
printAuditIssues(result.issues);
|
|
11452
11767
|
}
|
|
11453
11768
|
async function wordpressDiff(project, slug, format) {
|
|
11454
|
-
const client =
|
|
11769
|
+
const client = getClient26();
|
|
11455
11770
|
const result = await client.wordpressDiff(project, slug);
|
|
11456
11771
|
if (isMachineFormat(format)) {
|
|
11457
11772
|
printJson2(result);
|
|
@@ -11460,7 +11775,7 @@ async function wordpressDiff(project, slug, format) {
|
|
|
11460
11775
|
printDiff(result);
|
|
11461
11776
|
}
|
|
11462
11777
|
async function wordpressStagingStatus(project, format) {
|
|
11463
|
-
const client =
|
|
11778
|
+
const client = getClient26();
|
|
11464
11779
|
const result = await client.wordpressStagingStatus(project);
|
|
11465
11780
|
if (isMachineFormat(format)) {
|
|
11466
11781
|
printJson2(result);
|
|
@@ -11474,7 +11789,7 @@ async function wordpressStagingStatus(project, format) {
|
|
|
11474
11789
|
console.log(` Admin URL: ${result.adminUrl}`);
|
|
11475
11790
|
}
|
|
11476
11791
|
async function wordpressStagingPush(project, format) {
|
|
11477
|
-
const client =
|
|
11792
|
+
const client = getClient26();
|
|
11478
11793
|
const result = await client.wordpressStagingPush(project);
|
|
11479
11794
|
if (isMachineFormat(format)) {
|
|
11480
11795
|
printJson2(result);
|
|
@@ -12492,6 +12807,7 @@ var REGISTERED_CLI_COMMANDS = [
|
|
|
12492
12807
|
...BING_CLI_COMMANDS,
|
|
12493
12808
|
...WORDPRESS_CLI_COMMANDS,
|
|
12494
12809
|
...CDP_CLI_COMMANDS,
|
|
12810
|
+
...ADS_CLI_COMMANDS,
|
|
12495
12811
|
...GA_CLI_COMMANDS,
|
|
12496
12812
|
...GBP_CLI_COMMANDS,
|
|
12497
12813
|
...TRAFFIC_CLI_COMMANDS,
|