@ainyc/canonry 4.11.1 → 4.13.1
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/assets/index-BofSsfDl.js +302 -0
- package/assets/assets/index-D0EPNRDs.css +1 -0
- package/assets/index.html +2 -2
- package/dist/{chunk-3SFDZPKU.js → chunk-DCE3B6KD.js} +177 -2
- package/dist/{chunk-5J5BVJF7.js → chunk-LNRDWAG3.js} +16 -1
- package/dist/{chunk-PBQ4Z4P4.js → chunk-RIGQFQJJ.js} +1705 -292
- package/dist/{chunk-565T7PMC.js → chunk-YDGT5CAY.js} +54 -2
- package/dist/cli.js +269 -103
- package/dist/index.d.ts +19 -0
- package/dist/index.js +4 -4
- package/dist/{intelligence-service-XWOFLEHJ.js → intelligence-service-NT24OLLA.js} +2 -2
- package/dist/mcp.js +2 -2
- package/package.json +11 -9
- package/assets/assets/index-CGXCbiM_.css +0 -1
- package/assets/assets/index-DOcemxPD.js +0 -302
package/dist/cli.js
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
setGoogleAuthConfig,
|
|
19
19
|
showFirstRunNotice,
|
|
20
20
|
trackEvent
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-RIGQFQJJ.js";
|
|
22
22
|
import {
|
|
23
23
|
CliError,
|
|
24
24
|
EXIT_SYSTEM_ERROR,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
saveConfig,
|
|
34
34
|
saveConfigPatch,
|
|
35
35
|
usageError
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-LNRDWAG3.js";
|
|
37
37
|
import {
|
|
38
38
|
apiKeys,
|
|
39
39
|
competitors,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
projects,
|
|
46
46
|
querySnapshots,
|
|
47
47
|
runs
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-DCE3B6KD.js";
|
|
49
49
|
import {
|
|
50
50
|
CcReleaseSyncStatuses,
|
|
51
51
|
CheckScopes,
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
providerQuotaPolicySchema,
|
|
65
65
|
resolveProviderInput,
|
|
66
66
|
skillsClientSchema
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-YDGT5CAY.js";
|
|
68
68
|
|
|
69
69
|
// src/cli.ts
|
|
70
70
|
import { pathToFileURL } from "url";
|
|
@@ -580,7 +580,7 @@ function readStoredGroundingSources(rawResponse) {
|
|
|
580
580
|
return result;
|
|
581
581
|
}
|
|
582
582
|
async function backfillInsightsCommand(project, opts) {
|
|
583
|
-
const { IntelligenceService } = await import("./intelligence-service-
|
|
583
|
+
const { IntelligenceService } = await import("./intelligence-service-NT24OLLA.js");
|
|
584
584
|
const config = loadConfig();
|
|
585
585
|
const db = createClient(config.database);
|
|
586
586
|
migrate(db);
|
|
@@ -2677,12 +2677,177 @@ var GA_CLI_COMMANDS = [
|
|
|
2677
2677
|
}
|
|
2678
2678
|
];
|
|
2679
2679
|
|
|
2680
|
-
// src/commands/
|
|
2680
|
+
// src/commands/traffic.ts
|
|
2681
2681
|
function getClient5() {
|
|
2682
2682
|
return createApiClient();
|
|
2683
2683
|
}
|
|
2684
|
-
async function
|
|
2684
|
+
async function trafficConnectCloudRun(project, opts) {
|
|
2685
|
+
if (!opts.gcpProject) {
|
|
2686
|
+
throw new CliError({
|
|
2687
|
+
code: "TRAFFIC_GCP_PROJECT_REQUIRED",
|
|
2688
|
+
message: "--gcp-project is required",
|
|
2689
|
+
displayMessage: "Error: --gcp-project is required",
|
|
2690
|
+
details: { project }
|
|
2691
|
+
});
|
|
2692
|
+
}
|
|
2693
|
+
if (!opts.serviceAccountKey) {
|
|
2694
|
+
throw new CliError({
|
|
2695
|
+
code: "TRAFFIC_KEY_FILE_REQUIRED",
|
|
2696
|
+
message: "--service-account-key is required for v1 (OAuth-mode Cloud Run is not yet supported).",
|
|
2697
|
+
displayMessage: "Error: --service-account-key <path-to-json> is required",
|
|
2698
|
+
details: { project }
|
|
2699
|
+
});
|
|
2700
|
+
}
|
|
2701
|
+
const fs12 = await import("fs");
|
|
2702
|
+
let keyJson;
|
|
2703
|
+
try {
|
|
2704
|
+
keyJson = fs12.readFileSync(opts.serviceAccountKey, "utf-8");
|
|
2705
|
+
JSON.parse(keyJson);
|
|
2706
|
+
} catch (e) {
|
|
2707
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
2708
|
+
throw new CliError({
|
|
2709
|
+
code: "TRAFFIC_KEY_FILE_READ_ERROR",
|
|
2710
|
+
message: `Failed to read service-account key: ${msg}`,
|
|
2711
|
+
displayMessage: `Error: failed to read --service-account-key "${opts.serviceAccountKey}": ${msg}`,
|
|
2712
|
+
details: { project, keyFile: opts.serviceAccountKey }
|
|
2713
|
+
});
|
|
2714
|
+
}
|
|
2715
|
+
const client = getClient5();
|
|
2716
|
+
const result = await client.trafficConnectCloudRun(project, {
|
|
2717
|
+
gcpProjectId: opts.gcpProject,
|
|
2718
|
+
serviceName: opts.service,
|
|
2719
|
+
location: opts.location,
|
|
2720
|
+
displayName: opts.displayName,
|
|
2721
|
+
keyJson
|
|
2722
|
+
});
|
|
2723
|
+
if (opts.format === "json") {
|
|
2724
|
+
console.log(JSON.stringify(result, null, 2));
|
|
2725
|
+
return;
|
|
2726
|
+
}
|
|
2727
|
+
console.log(`Cloud Run traffic source connected for project "${project}".`);
|
|
2728
|
+
console.log(` Source ID: ${result.id}`);
|
|
2729
|
+
console.log(` Display name: ${result.displayName}`);
|
|
2730
|
+
console.log(` Status: ${result.status}`);
|
|
2731
|
+
console.log(` GCP project: ${result.config.gcpProjectId ?? "(unset)"}`);
|
|
2732
|
+
if (result.config.serviceName) console.log(` Service: ${result.config.serviceName}`);
|
|
2733
|
+
if (result.config.location) console.log(` Location: ${result.config.location}`);
|
|
2734
|
+
console.log("");
|
|
2735
|
+
console.log(`Next: canonry traffic sync ${project} --source ${result.id}`);
|
|
2736
|
+
}
|
|
2737
|
+
async function trafficSync(project, opts) {
|
|
2738
|
+
if (!opts.source) {
|
|
2739
|
+
throw new CliError({
|
|
2740
|
+
code: "TRAFFIC_SOURCE_REQUIRED",
|
|
2741
|
+
message: "--source <id> is required",
|
|
2742
|
+
displayMessage: "Error: --source <id> is required (run `canonry traffic connect cloud-run` first if you have not connected a source)",
|
|
2743
|
+
details: { project }
|
|
2744
|
+
});
|
|
2745
|
+
}
|
|
2685
2746
|
const client = getClient5();
|
|
2747
|
+
const result = await client.trafficSync(project, opts.source, {
|
|
2748
|
+
sinceMinutes: opts.sinceMinutes
|
|
2749
|
+
});
|
|
2750
|
+
if (opts.format === "json") {
|
|
2751
|
+
console.log(JSON.stringify(result, null, 2));
|
|
2752
|
+
return;
|
|
2753
|
+
}
|
|
2754
|
+
console.log(`Traffic sync complete for "${project}" (source ${opts.source}).`);
|
|
2755
|
+
console.log(` Run ID: ${result.runId}`);
|
|
2756
|
+
console.log(` Window: ${result.windowStart} \u2192 ${result.windowEnd}`);
|
|
2757
|
+
console.log(` Pulled events: ${result.pulledEvents}`);
|
|
2758
|
+
console.log(` Crawler hits: ${result.crawlerHits} (${result.crawlerBucketRows} hourly bucket${result.crawlerBucketRows === 1 ? "" : "s"})`);
|
|
2759
|
+
console.log(` AI referral hits: ${result.aiReferralHits} (${result.aiReferralBucketRows} hourly bucket${result.aiReferralBucketRows === 1 ? "" : "s"})`);
|
|
2760
|
+
console.log(` Unknown hits: ${result.unknownHits}`);
|
|
2761
|
+
console.log(` Sample rows: ${result.sampleRows}`);
|
|
2762
|
+
console.log(` Synced at: ${result.syncedAt}`);
|
|
2763
|
+
}
|
|
2764
|
+
|
|
2765
|
+
// src/cli-commands/traffic.ts
|
|
2766
|
+
var TRAFFIC_CLI_COMMANDS = [
|
|
2767
|
+
{
|
|
2768
|
+
path: ["traffic", "connect", "cloud-run"],
|
|
2769
|
+
usage: "canonry traffic connect cloud-run <project> --gcp-project <id> --service-account-key <path> [--service <name>] [--location <region>] [--display-name <name>] [--format json]",
|
|
2770
|
+
options: {
|
|
2771
|
+
"gcp-project": stringOption(),
|
|
2772
|
+
service: stringOption(),
|
|
2773
|
+
location: stringOption(),
|
|
2774
|
+
"service-account-key": stringOption(),
|
|
2775
|
+
"display-name": stringOption()
|
|
2776
|
+
},
|
|
2777
|
+
run: async (input) => {
|
|
2778
|
+
const project = requireProject(
|
|
2779
|
+
input,
|
|
2780
|
+
"traffic.connect.cloud-run",
|
|
2781
|
+
"canonry traffic connect cloud-run <project> --gcp-project <id> --service-account-key <path>"
|
|
2782
|
+
);
|
|
2783
|
+
const gcpProject = getString(input.values, "gcp-project");
|
|
2784
|
+
if (!gcpProject) throw new Error("--gcp-project is required");
|
|
2785
|
+
const serviceAccountKey = getString(input.values, "service-account-key");
|
|
2786
|
+
if (!serviceAccountKey) throw new Error("--service-account-key is required");
|
|
2787
|
+
await trafficConnectCloudRun(project, {
|
|
2788
|
+
gcpProject,
|
|
2789
|
+
service: getString(input.values, "service"),
|
|
2790
|
+
location: getString(input.values, "location"),
|
|
2791
|
+
serviceAccountKey,
|
|
2792
|
+
displayName: getString(input.values, "display-name"),
|
|
2793
|
+
format: input.format
|
|
2794
|
+
});
|
|
2795
|
+
}
|
|
2796
|
+
},
|
|
2797
|
+
{
|
|
2798
|
+
path: ["traffic", "connect"],
|
|
2799
|
+
usage: "canonry traffic connect <provider> <project> [args]",
|
|
2800
|
+
run: async (input) => {
|
|
2801
|
+
unknownSubcommand(input.positionals[0], {
|
|
2802
|
+
command: "traffic connect",
|
|
2803
|
+
usage: "canonry traffic connect <provider> <project> [args]",
|
|
2804
|
+
available: ["cloud-run"]
|
|
2805
|
+
});
|
|
2806
|
+
}
|
|
2807
|
+
},
|
|
2808
|
+
{
|
|
2809
|
+
path: ["traffic", "sync"],
|
|
2810
|
+
usage: "canonry traffic sync <project> --source <id> [--since-minutes 60] [--format json]",
|
|
2811
|
+
options: {
|
|
2812
|
+
source: stringOption(),
|
|
2813
|
+
"since-minutes": stringOption()
|
|
2814
|
+
},
|
|
2815
|
+
run: async (input) => {
|
|
2816
|
+
const project = requireProject(
|
|
2817
|
+
input,
|
|
2818
|
+
"traffic.sync",
|
|
2819
|
+
"canonry traffic sync <project> --source <id> [--since-minutes 60]"
|
|
2820
|
+
);
|
|
2821
|
+
const source = getString(input.values, "source");
|
|
2822
|
+
if (!source) throw new Error("--source <id> is required");
|
|
2823
|
+
const sinceStr = getString(input.values, "since-minutes");
|
|
2824
|
+
const sinceMinutes = sinceStr ? parseInt(sinceStr, 10) : void 0;
|
|
2825
|
+
await trafficSync(project, {
|
|
2826
|
+
source,
|
|
2827
|
+
sinceMinutes,
|
|
2828
|
+
format: input.format
|
|
2829
|
+
});
|
|
2830
|
+
}
|
|
2831
|
+
},
|
|
2832
|
+
{
|
|
2833
|
+
path: ["traffic"],
|
|
2834
|
+
usage: "canonry traffic <subcommand> <project> [args]",
|
|
2835
|
+
run: async (input) => {
|
|
2836
|
+
unknownSubcommand(input.positionals[0], {
|
|
2837
|
+
command: "traffic",
|
|
2838
|
+
usage: "canonry traffic <subcommand> <project> [args]",
|
|
2839
|
+
available: ["connect", "sync"]
|
|
2840
|
+
});
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2843
|
+
];
|
|
2844
|
+
|
|
2845
|
+
// src/commands/competitor.ts
|
|
2846
|
+
function getClient6() {
|
|
2847
|
+
return createApiClient();
|
|
2848
|
+
}
|
|
2849
|
+
async function addCompetitors(project, domains, format) {
|
|
2850
|
+
const client = getClient6();
|
|
2686
2851
|
const existing = await client.listCompetitors(project);
|
|
2687
2852
|
const existingDomains = existing.map((c) => c.domain);
|
|
2688
2853
|
const existingSet = new Set(existingDomains);
|
|
@@ -2706,7 +2871,7 @@ async function addCompetitors(project, domains, format) {
|
|
|
2706
2871
|
}
|
|
2707
2872
|
}
|
|
2708
2873
|
async function removeCompetitors(project, domains, format) {
|
|
2709
|
-
const client =
|
|
2874
|
+
const client = getClient6();
|
|
2710
2875
|
const existing = await client.listCompetitors(project);
|
|
2711
2876
|
const existingDomains = existing.map((c) => c.domain);
|
|
2712
2877
|
const requested = new Set(uniqueStrings(domains));
|
|
@@ -2735,7 +2900,7 @@ function uniqueStrings(values) {
|
|
|
2735
2900
|
return result;
|
|
2736
2901
|
}
|
|
2737
2902
|
async function listCompetitors(project, format) {
|
|
2738
|
-
const client =
|
|
2903
|
+
const client = getClient6();
|
|
2739
2904
|
const comps = await client.listCompetitors(project);
|
|
2740
2905
|
if (format === "json") {
|
|
2741
2906
|
console.log(JSON.stringify(comps, null, 2));
|
|
@@ -2831,7 +2996,7 @@ var COMPETITOR_CLI_COMMANDS = [
|
|
|
2831
2996
|
|
|
2832
2997
|
// src/commands/google.ts
|
|
2833
2998
|
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.";
|
|
2834
|
-
function
|
|
2999
|
+
function getClient7() {
|
|
2835
3000
|
return createApiClient();
|
|
2836
3001
|
}
|
|
2837
3002
|
async function waitForRunStatus2(client, runId, config) {
|
|
@@ -2871,7 +3036,7 @@ async function waitForRunStatus2(client, runId, config) {
|
|
|
2871
3036
|
});
|
|
2872
3037
|
}
|
|
2873
3038
|
async function googleConnect(project, opts) {
|
|
2874
|
-
const client =
|
|
3039
|
+
const client = getClient7();
|
|
2875
3040
|
const { authUrl, redirectUri } = await client.googleConnect(project, {
|
|
2876
3041
|
type: opts.type,
|
|
2877
3042
|
publicUrl: opts.publicUrl
|
|
@@ -2905,7 +3070,7 @@ Open this URL in your browser to authorize Google ${opts.type.toUpperCase()} acc
|
|
|
2905
3070
|
}
|
|
2906
3071
|
}
|
|
2907
3072
|
async function googleDisconnect(project, opts) {
|
|
2908
|
-
const client =
|
|
3073
|
+
const client = getClient7();
|
|
2909
3074
|
await client.googleDisconnect(project, opts.type);
|
|
2910
3075
|
if (opts.format === "json") {
|
|
2911
3076
|
console.log(JSON.stringify({ project, type: opts.type, disconnected: true }, null, 2));
|
|
@@ -2914,7 +3079,7 @@ async function googleDisconnect(project, opts) {
|
|
|
2914
3079
|
console.log(`Disconnected Google ${opts.type.toUpperCase()} from project "${project}".`);
|
|
2915
3080
|
}
|
|
2916
3081
|
async function googleStatus(project, format) {
|
|
2917
|
-
const client =
|
|
3082
|
+
const client = getClient7();
|
|
2918
3083
|
const connections = await client.googleConnections(project);
|
|
2919
3084
|
if (format === "json") {
|
|
2920
3085
|
console.log(JSON.stringify({ connections }, null, 2));
|
|
@@ -2938,7 +3103,7 @@ async function googleStatus(project, format) {
|
|
|
2938
3103
|
}
|
|
2939
3104
|
}
|
|
2940
3105
|
async function googleProperties(project, format) {
|
|
2941
|
-
const client =
|
|
3106
|
+
const client = getClient7();
|
|
2942
3107
|
const { sites } = await client.googleProperties(project);
|
|
2943
3108
|
if (format === "json") {
|
|
2944
3109
|
console.log(JSON.stringify({ sites }, null, 2));
|
|
@@ -2959,7 +3124,7 @@ async function googleProperties(project, format) {
|
|
|
2959
3124
|
Use "canonry google set-property <project> <siteUrl>" to select a property.`);
|
|
2960
3125
|
}
|
|
2961
3126
|
async function googleSetProperty(project, propertyUrl, format) {
|
|
2962
|
-
const client =
|
|
3127
|
+
const client = getClient7();
|
|
2963
3128
|
await client.googleSetProperty(project, "gsc", propertyUrl);
|
|
2964
3129
|
if (format === "json") {
|
|
2965
3130
|
console.log(JSON.stringify({ project, type: "gsc", propertyUrl }, null, 2));
|
|
@@ -2968,7 +3133,7 @@ async function googleSetProperty(project, propertyUrl, format) {
|
|
|
2968
3133
|
console.log(`GSC property set to "${propertyUrl}" for project "${project}".`);
|
|
2969
3134
|
}
|
|
2970
3135
|
async function googleSync(project, opts) {
|
|
2971
|
-
const client =
|
|
3136
|
+
const client = getClient7();
|
|
2972
3137
|
const run = await client.gscSync(project, { days: opts.days, full: opts.full });
|
|
2973
3138
|
if (!opts.wait && opts.format === "json") {
|
|
2974
3139
|
console.log(JSON.stringify(run, null, 2));
|
|
@@ -2998,7 +3163,7 @@ async function googleSync(project, opts) {
|
|
|
2998
3163
|
}
|
|
2999
3164
|
}
|
|
3000
3165
|
async function googlePerformance(project, opts) {
|
|
3001
|
-
const client =
|
|
3166
|
+
const client = getClient7();
|
|
3002
3167
|
const params = {};
|
|
3003
3168
|
if (opts.days) {
|
|
3004
3169
|
const end = /* @__PURE__ */ new Date();
|
|
@@ -3034,7 +3199,7 @@ async function googlePerformance(project, opts) {
|
|
|
3034
3199
|
}
|
|
3035
3200
|
}
|
|
3036
3201
|
async function googleInspect(project, url, format) {
|
|
3037
|
-
const client =
|
|
3202
|
+
const client = getClient7();
|
|
3038
3203
|
const result = await client.gscInspect(project, url);
|
|
3039
3204
|
if (format === "json") {
|
|
3040
3205
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -3054,7 +3219,7 @@ URL Inspection: ${result.url}
|
|
|
3054
3219
|
console.log(` Inspected At: ${result.inspectedAt}`);
|
|
3055
3220
|
}
|
|
3056
3221
|
async function googleInspections(project, opts) {
|
|
3057
|
-
const client =
|
|
3222
|
+
const client = getClient7();
|
|
3058
3223
|
const params = {};
|
|
3059
3224
|
if (opts.url) params.url = opts.url;
|
|
3060
3225
|
const rows = await client.gscInspections(project, Object.keys(params).length > 0 ? params : void 0);
|
|
@@ -3079,7 +3244,7 @@ async function googleInspections(project, opts) {
|
|
|
3079
3244
|
}
|
|
3080
3245
|
}
|
|
3081
3246
|
async function googleCoverage(project, format) {
|
|
3082
|
-
const client =
|
|
3247
|
+
const client = getClient7();
|
|
3083
3248
|
const result = await client.gscCoverage(project);
|
|
3084
3249
|
if (format === "json") {
|
|
3085
3250
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -3125,7 +3290,7 @@ Index Coverage for "${project}"
|
|
|
3125
3290
|
}
|
|
3126
3291
|
}
|
|
3127
3292
|
async function googleSetSitemap(project, sitemapUrl, format) {
|
|
3128
|
-
const client =
|
|
3293
|
+
const client = getClient7();
|
|
3129
3294
|
await client.googleSetSitemap(project, "gsc", sitemapUrl);
|
|
3130
3295
|
if (format === "json") {
|
|
3131
3296
|
console.log(JSON.stringify({ project, type: "gsc", sitemapUrl }, null, 2));
|
|
@@ -3134,7 +3299,7 @@ async function googleSetSitemap(project, sitemapUrl, format) {
|
|
|
3134
3299
|
console.log(`GSC sitemap URL set to "${sitemapUrl}" for project "${project}".`);
|
|
3135
3300
|
}
|
|
3136
3301
|
async function googleListSitemaps(project, opts) {
|
|
3137
|
-
const client =
|
|
3302
|
+
const client = getClient7();
|
|
3138
3303
|
const result = await client.gscSitemaps(project);
|
|
3139
3304
|
if (opts.format === "json") {
|
|
3140
3305
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -3156,7 +3321,7 @@ Sitemaps for project "${project}":
|
|
|
3156
3321
|
}
|
|
3157
3322
|
}
|
|
3158
3323
|
async function googleInspectSitemap(project, opts) {
|
|
3159
|
-
const client =
|
|
3324
|
+
const client = getClient7();
|
|
3160
3325
|
const run = await client.gscInspectSitemap(project, {
|
|
3161
3326
|
sitemapUrl: opts.sitemapUrl
|
|
3162
3327
|
});
|
|
@@ -3192,7 +3357,7 @@ async function googleInspectSitemap(project, opts) {
|
|
|
3192
3357
|
}
|
|
3193
3358
|
}
|
|
3194
3359
|
async function googleCoverageHistory(project, opts) {
|
|
3195
|
-
const client =
|
|
3360
|
+
const client = getClient7();
|
|
3196
3361
|
const rows = await client.gscCoverageHistory(project, { limit: opts.limit });
|
|
3197
3362
|
if (opts.format === "json") {
|
|
3198
3363
|
console.log(JSON.stringify(rows, null, 2));
|
|
@@ -3214,7 +3379,7 @@ GSC Coverage History for "${project}" (${rows.length} snapshots):
|
|
|
3214
3379
|
}
|
|
3215
3380
|
}
|
|
3216
3381
|
async function googleDiscoverSitemaps(project, opts) {
|
|
3217
|
-
const client =
|
|
3382
|
+
const client = getClient7();
|
|
3218
3383
|
const result = await client.gscDiscoverSitemaps(project);
|
|
3219
3384
|
if (!opts.wait && opts.format === "json") {
|
|
3220
3385
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -3266,7 +3431,7 @@ Primary sitemap: ${result.primarySitemapUrl}`);
|
|
|
3266
3431
|
}
|
|
3267
3432
|
}
|
|
3268
3433
|
async function googleRequestIndexing(project, opts) {
|
|
3269
|
-
const client =
|
|
3434
|
+
const client = getClient7();
|
|
3270
3435
|
const body = { urls: [] };
|
|
3271
3436
|
if (opts.allUnindexed) {
|
|
3272
3437
|
body.allUnindexed = true;
|
|
@@ -3361,7 +3526,7 @@ async function googleRequestIndexing(project, opts) {
|
|
|
3361
3526
|
}
|
|
3362
3527
|
}
|
|
3363
3528
|
async function googleRefresh(project, format) {
|
|
3364
|
-
const client =
|
|
3529
|
+
const client = getClient7();
|
|
3365
3530
|
const run = await client.gscSync(project, {});
|
|
3366
3531
|
if (format !== "json") {
|
|
3367
3532
|
process.stderr.write("Refreshing GSC coverage data");
|
|
@@ -3384,7 +3549,7 @@ async function googleRefresh(project, format) {
|
|
|
3384
3549
|
await googleCoverage(project, format);
|
|
3385
3550
|
}
|
|
3386
3551
|
async function googleDeindexed(project, format) {
|
|
3387
|
-
const client =
|
|
3552
|
+
const client = getClient7();
|
|
3388
3553
|
const rows = await client.gscDeindexed(project);
|
|
3389
3554
|
if (format === "json") {
|
|
3390
3555
|
console.log(JSON.stringify(rows, null, 2));
|
|
@@ -3673,11 +3838,11 @@ var GOOGLE_CLI_COMMANDS = [
|
|
|
3673
3838
|
|
|
3674
3839
|
// src/commands/keyword.ts
|
|
3675
3840
|
import fs from "fs";
|
|
3676
|
-
function
|
|
3841
|
+
function getClient8() {
|
|
3677
3842
|
return createApiClient();
|
|
3678
3843
|
}
|
|
3679
3844
|
async function addKeywords(project, keywords, format) {
|
|
3680
|
-
const client =
|
|
3845
|
+
const client = getClient8();
|
|
3681
3846
|
await client.appendKeywords(project, keywords);
|
|
3682
3847
|
if (format === "json") {
|
|
3683
3848
|
console.log(JSON.stringify({
|
|
@@ -3690,7 +3855,7 @@ async function addKeywords(project, keywords, format) {
|
|
|
3690
3855
|
console.log(`Added ${keywords.length} key phrase(s) to "${project}".`);
|
|
3691
3856
|
}
|
|
3692
3857
|
async function replaceKeywords(project, keywords, format) {
|
|
3693
|
-
const client =
|
|
3858
|
+
const client = getClient8();
|
|
3694
3859
|
await client.putKeywords(project, keywords);
|
|
3695
3860
|
if (format === "json") {
|
|
3696
3861
|
console.log(JSON.stringify({
|
|
@@ -3703,7 +3868,7 @@ async function replaceKeywords(project, keywords, format) {
|
|
|
3703
3868
|
console.log(`Set ${keywords.length} key phrase(s) for "${project}".`);
|
|
3704
3869
|
}
|
|
3705
3870
|
async function removeKeywords(project, keywords, format) {
|
|
3706
|
-
const client =
|
|
3871
|
+
const client = getClient8();
|
|
3707
3872
|
const existing = await client.listKeywords(project);
|
|
3708
3873
|
const existingSet = new Set(existing.map((k) => k.keyword));
|
|
3709
3874
|
const removedKeywords = keywords.filter((k) => existingSet.has(k));
|
|
@@ -3720,7 +3885,7 @@ async function removeKeywords(project, keywords, format) {
|
|
|
3720
3885
|
console.log(`Removed ${removedKeywords.length} key phrase(s) from "${project}".`);
|
|
3721
3886
|
}
|
|
3722
3887
|
async function listKeywords(project, format) {
|
|
3723
|
-
const client =
|
|
3888
|
+
const client = getClient8();
|
|
3724
3889
|
const kws = await client.listKeywords(project);
|
|
3725
3890
|
if (format === "json") {
|
|
3726
3891
|
console.log(JSON.stringify(kws, null, 2));
|
|
@@ -3763,7 +3928,7 @@ async function importKeywords(project, filePath, format) {
|
|
|
3763
3928
|
console.log("No key phrases found in file.");
|
|
3764
3929
|
return;
|
|
3765
3930
|
}
|
|
3766
|
-
const client =
|
|
3931
|
+
const client = getClient8();
|
|
3767
3932
|
await client.appendKeywords(project, keywords);
|
|
3768
3933
|
if (format === "json") {
|
|
3769
3934
|
console.log(JSON.stringify({
|
|
@@ -3777,7 +3942,7 @@ async function importKeywords(project, filePath, format) {
|
|
|
3777
3942
|
console.log(`Imported ${keywords.length} key phrase(s) to "${project}".`);
|
|
3778
3943
|
}
|
|
3779
3944
|
async function generateKeywords(project, provider, opts) {
|
|
3780
|
-
const client =
|
|
3945
|
+
const client = getClient8();
|
|
3781
3946
|
const result = await client.generateKeywords(project, provider, opts.count);
|
|
3782
3947
|
const saved = Boolean(opts.save && result.keywords.length > 0);
|
|
3783
3948
|
if (opts.format !== "json") {
|
|
@@ -3950,11 +4115,11 @@ var KEYWORD_CLI_COMMANDS = [
|
|
|
3950
4115
|
|
|
3951
4116
|
// src/commands/query.ts
|
|
3952
4117
|
import fs2 from "fs";
|
|
3953
|
-
function
|
|
4118
|
+
function getClient9() {
|
|
3954
4119
|
return createApiClient();
|
|
3955
4120
|
}
|
|
3956
4121
|
async function addQueries(project, queries, format) {
|
|
3957
|
-
const client =
|
|
4122
|
+
const client = getClient9();
|
|
3958
4123
|
await client.appendQueries(project, queries);
|
|
3959
4124
|
if (format === "json") {
|
|
3960
4125
|
console.log(JSON.stringify({
|
|
@@ -3967,7 +4132,7 @@ async function addQueries(project, queries, format) {
|
|
|
3967
4132
|
console.log(`Added ${queries.length} ${queries.length === 1 ? "query" : "queries"} to "${project}".`);
|
|
3968
4133
|
}
|
|
3969
4134
|
async function replaceQueries(project, queries, format) {
|
|
3970
|
-
const client =
|
|
4135
|
+
const client = getClient9();
|
|
3971
4136
|
await client.putQueries(project, queries);
|
|
3972
4137
|
if (format === "json") {
|
|
3973
4138
|
console.log(JSON.stringify({
|
|
@@ -3980,7 +4145,7 @@ async function replaceQueries(project, queries, format) {
|
|
|
3980
4145
|
console.log(`Set ${queries.length} ${queries.length === 1 ? "query" : "queries"} for "${project}".`);
|
|
3981
4146
|
}
|
|
3982
4147
|
async function removeQueries(project, queries, format) {
|
|
3983
|
-
const client =
|
|
4148
|
+
const client = getClient9();
|
|
3984
4149
|
const existing = await client.listQueries(project);
|
|
3985
4150
|
const existingSet = new Set(existing.map((q) => q.query));
|
|
3986
4151
|
const removedQueries = queries.filter((q) => existingSet.has(q));
|
|
@@ -3997,7 +4162,7 @@ async function removeQueries(project, queries, format) {
|
|
|
3997
4162
|
console.log(`Removed ${removedQueries.length} ${removedQueries.length === 1 ? "query" : "queries"} from "${project}".`);
|
|
3998
4163
|
}
|
|
3999
4164
|
async function listQueries(project, format) {
|
|
4000
|
-
const client =
|
|
4165
|
+
const client = getClient9();
|
|
4001
4166
|
const qs = await client.listQueries(project);
|
|
4002
4167
|
if (format === "json") {
|
|
4003
4168
|
console.log(JSON.stringify(qs, null, 2));
|
|
@@ -4040,7 +4205,7 @@ async function importQueries(project, filePath, format) {
|
|
|
4040
4205
|
console.log("No queries found in file.");
|
|
4041
4206
|
return;
|
|
4042
4207
|
}
|
|
4043
|
-
const client =
|
|
4208
|
+
const client = getClient9();
|
|
4044
4209
|
await client.appendQueries(project, queries);
|
|
4045
4210
|
if (format === "json") {
|
|
4046
4211
|
console.log(JSON.stringify({
|
|
@@ -4054,7 +4219,7 @@ async function importQueries(project, filePath, format) {
|
|
|
4054
4219
|
console.log(`Imported ${queries.length} ${queries.length === 1 ? "query" : "queries"} to "${project}".`);
|
|
4055
4220
|
}
|
|
4056
4221
|
async function generateQueries(project, provider, opts) {
|
|
4057
|
-
const client =
|
|
4222
|
+
const client = getClient9();
|
|
4058
4223
|
const result = await client.generateQueries(project, provider, opts.count);
|
|
4059
4224
|
const saved = Boolean(opts.save && result.queries.length > 0);
|
|
4060
4225
|
if (opts.format !== "json") {
|
|
@@ -4538,11 +4703,11 @@ var MCP_CLI_COMMANDS = [
|
|
|
4538
4703
|
];
|
|
4539
4704
|
|
|
4540
4705
|
// src/commands/notify.ts
|
|
4541
|
-
function
|
|
4706
|
+
function getClient10() {
|
|
4542
4707
|
return createApiClient();
|
|
4543
4708
|
}
|
|
4544
4709
|
async function addNotification(project, opts) {
|
|
4545
|
-
const client =
|
|
4710
|
+
const client = getClient10();
|
|
4546
4711
|
const result = await client.createNotification(project, {
|
|
4547
4712
|
channel: "webhook",
|
|
4548
4713
|
url: opts.webhook,
|
|
@@ -4556,7 +4721,7 @@ async function addNotification(project, opts) {
|
|
|
4556
4721
|
printNotification(result);
|
|
4557
4722
|
}
|
|
4558
4723
|
async function listNotifications(project, format) {
|
|
4559
|
-
const client =
|
|
4724
|
+
const client = getClient10();
|
|
4560
4725
|
const results = await client.listNotifications(project);
|
|
4561
4726
|
if (format === "json") {
|
|
4562
4727
|
console.log(JSON.stringify(results, null, 2));
|
|
@@ -4574,7 +4739,7 @@ async function listNotifications(project, format) {
|
|
|
4574
4739
|
}
|
|
4575
4740
|
}
|
|
4576
4741
|
async function removeNotification(project, id, format) {
|
|
4577
|
-
const client =
|
|
4742
|
+
const client = getClient10();
|
|
4578
4743
|
await client.deleteNotification(project, id);
|
|
4579
4744
|
if (format === "json") {
|
|
4580
4745
|
console.log(JSON.stringify({ project, id, removed: true }, null, 2));
|
|
@@ -4583,7 +4748,7 @@ async function removeNotification(project, id, format) {
|
|
|
4583
4748
|
console.log(`Notification ${id} removed from "${project}"`);
|
|
4584
4749
|
}
|
|
4585
4750
|
async function testNotification(project, id, format) {
|
|
4586
|
-
const client =
|
|
4751
|
+
const client = getClient10();
|
|
4587
4752
|
const result = await client.testNotification(project, id);
|
|
4588
4753
|
if (format === "json") {
|
|
4589
4754
|
console.log(JSON.stringify({ project, id, ...result }, null, 2));
|
|
@@ -4774,11 +4939,11 @@ async function applyConfigs(filePaths, format) {
|
|
|
4774
4939
|
}
|
|
4775
4940
|
|
|
4776
4941
|
// src/commands/analytics.ts
|
|
4777
|
-
function
|
|
4942
|
+
function getClient11() {
|
|
4778
4943
|
return createApiClient();
|
|
4779
4944
|
}
|
|
4780
4945
|
async function showAnalytics(project, options) {
|
|
4781
|
-
const client =
|
|
4946
|
+
const client = getClient11();
|
|
4782
4947
|
const features = options.feature ? [options.feature] : ["metrics", "gaps", "sources"];
|
|
4783
4948
|
const results = {};
|
|
4784
4949
|
for (const feature of features) {
|
|
@@ -4881,11 +5046,11 @@ Source Origin Breakdown`);
|
|
|
4881
5046
|
}
|
|
4882
5047
|
|
|
4883
5048
|
// src/commands/evidence.ts
|
|
4884
|
-
function
|
|
5049
|
+
function getClient12() {
|
|
4885
5050
|
return createApiClient();
|
|
4886
5051
|
}
|
|
4887
5052
|
async function showEvidence(project, format) {
|
|
4888
|
-
const client =
|
|
5053
|
+
const client = getClient12();
|
|
4889
5054
|
const timeline = await client.getTimeline(project);
|
|
4890
5055
|
if (format === "json") {
|
|
4891
5056
|
const enriched = timeline.map((entry) => ({
|
|
@@ -4945,11 +5110,11 @@ async function loadLatestRunForExport(client, project) {
|
|
|
4945
5110
|
}
|
|
4946
5111
|
|
|
4947
5112
|
// src/commands/history.ts
|
|
4948
|
-
function
|
|
5113
|
+
function getClient13() {
|
|
4949
5114
|
return createApiClient();
|
|
4950
5115
|
}
|
|
4951
5116
|
async function showHistory(project, format) {
|
|
4952
|
-
const client =
|
|
5117
|
+
const client = getClient13();
|
|
4953
5118
|
try {
|
|
4954
5119
|
const entries = await client.getHistory(project);
|
|
4955
5120
|
if (format === "json") {
|
|
@@ -4984,11 +5149,11 @@ async function showHistory(project, format) {
|
|
|
4984
5149
|
}
|
|
4985
5150
|
|
|
4986
5151
|
// src/commands/status.ts
|
|
4987
|
-
function
|
|
5152
|
+
function getClient14() {
|
|
4988
5153
|
return createApiClient();
|
|
4989
5154
|
}
|
|
4990
5155
|
async function showStatus(project, format) {
|
|
4991
|
-
const client =
|
|
5156
|
+
const client = getClient14();
|
|
4992
5157
|
const projectData = await client.getProject(project);
|
|
4993
5158
|
const latest = await getLatestRunSummary(client, project);
|
|
4994
5159
|
if (format === "json") {
|
|
@@ -5119,11 +5284,11 @@ var OPERATOR_CLI_COMMANDS = [
|
|
|
5119
5284
|
];
|
|
5120
5285
|
|
|
5121
5286
|
// src/commands/project.ts
|
|
5122
|
-
function
|
|
5287
|
+
function getClient15() {
|
|
5123
5288
|
return createApiClient();
|
|
5124
5289
|
}
|
|
5125
5290
|
async function createProject(name, opts) {
|
|
5126
|
-
const client =
|
|
5291
|
+
const client = getClient15();
|
|
5127
5292
|
const result = await client.putProject(name, {
|
|
5128
5293
|
displayName: opts.displayName,
|
|
5129
5294
|
canonicalDomain: opts.domain,
|
|
@@ -5138,7 +5303,7 @@ async function createProject(name, opts) {
|
|
|
5138
5303
|
console.log(`Project created: ${result.name} (${result.id})`);
|
|
5139
5304
|
}
|
|
5140
5305
|
async function listProjects(format) {
|
|
5141
|
-
const client =
|
|
5306
|
+
const client = getClient15();
|
|
5142
5307
|
const projects2 = await client.listProjects();
|
|
5143
5308
|
if (format === "json") {
|
|
5144
5309
|
console.log(JSON.stringify(projects2, null, 2));
|
|
@@ -5166,7 +5331,7 @@ async function listProjects(format) {
|
|
|
5166
5331
|
}
|
|
5167
5332
|
}
|
|
5168
5333
|
async function showProject(name, format) {
|
|
5169
|
-
const client =
|
|
5334
|
+
const client = getClient15();
|
|
5170
5335
|
const project = await client.getProject(name);
|
|
5171
5336
|
if (format === "json") {
|
|
5172
5337
|
console.log(JSON.stringify(project, null, 2));
|
|
@@ -5192,7 +5357,7 @@ async function showProject(name, format) {
|
|
|
5192
5357
|
if (project.updatedAt) console.log(` Updated: ${project.updatedAt}`);
|
|
5193
5358
|
}
|
|
5194
5359
|
async function updateProjectSettings(name, opts) {
|
|
5195
|
-
const client =
|
|
5360
|
+
const client = getClient15();
|
|
5196
5361
|
const project = await client.getProject(name);
|
|
5197
5362
|
let ownedDomains = opts.ownedDomains ?? project.ownedDomains ?? [];
|
|
5198
5363
|
if (opts.addOwnedDomain) {
|
|
@@ -5217,7 +5382,7 @@ async function updateProjectSettings(name, opts) {
|
|
|
5217
5382
|
console.log(`Project updated: ${result.name}`);
|
|
5218
5383
|
}
|
|
5219
5384
|
async function deleteProject(name, format) {
|
|
5220
|
-
const client =
|
|
5385
|
+
const client = getClient15();
|
|
5221
5386
|
await client.deleteProject(name);
|
|
5222
5387
|
if (format === "json") {
|
|
5223
5388
|
console.log(JSON.stringify({ name, deleted: true }, null, 2));
|
|
@@ -5226,7 +5391,7 @@ async function deleteProject(name, format) {
|
|
|
5226
5391
|
console.log(`Project deleted: ${name}`);
|
|
5227
5392
|
}
|
|
5228
5393
|
async function addLocation(project, opts) {
|
|
5229
|
-
const client =
|
|
5394
|
+
const client = getClient15();
|
|
5230
5395
|
const location = await client.addLocation(project, {
|
|
5231
5396
|
label: opts.label,
|
|
5232
5397
|
city: opts.city,
|
|
@@ -5241,7 +5406,7 @@ async function addLocation(project, opts) {
|
|
|
5241
5406
|
console.log(`Location added: ${opts.label} (${opts.city}, ${opts.region}, ${opts.country})`);
|
|
5242
5407
|
}
|
|
5243
5408
|
async function listLocations(project, format) {
|
|
5244
|
-
const client =
|
|
5409
|
+
const client = getClient15();
|
|
5245
5410
|
const result = await client.listLocations(project);
|
|
5246
5411
|
if (format === "json") {
|
|
5247
5412
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -5267,7 +5432,7 @@ async function listLocations(project, format) {
|
|
|
5267
5432
|
}
|
|
5268
5433
|
}
|
|
5269
5434
|
async function removeLocation(project, label, format) {
|
|
5270
|
-
const client =
|
|
5435
|
+
const client = getClient15();
|
|
5271
5436
|
await client.removeLocation(project, label);
|
|
5272
5437
|
if (format === "json") {
|
|
5273
5438
|
console.log(JSON.stringify({ project, label, removed: true }, null, 2));
|
|
@@ -5276,7 +5441,7 @@ async function removeLocation(project, label, format) {
|
|
|
5276
5441
|
console.log(`Location removed: ${label}`);
|
|
5277
5442
|
}
|
|
5278
5443
|
async function setDefaultLocation(project, label, format) {
|
|
5279
|
-
const client =
|
|
5444
|
+
const client = getClient15();
|
|
5280
5445
|
const result = await client.setDefaultLocation(project, label);
|
|
5281
5446
|
if (format === "json") {
|
|
5282
5447
|
console.log(JSON.stringify({ project, ...result }, null, 2));
|
|
@@ -5508,12 +5673,12 @@ var REPORT_CLI_COMMANDS = [
|
|
|
5508
5673
|
];
|
|
5509
5674
|
|
|
5510
5675
|
// src/commands/run.ts
|
|
5511
|
-
function
|
|
5676
|
+
function getClient16() {
|
|
5512
5677
|
return createApiClient();
|
|
5513
5678
|
}
|
|
5514
5679
|
var TERMINAL_STATUSES = /* @__PURE__ */ new Set(["completed", "partial", "failed", "cancelled"]);
|
|
5515
5680
|
async function triggerRun(project, opts) {
|
|
5516
|
-
const client =
|
|
5681
|
+
const client = getClient16();
|
|
5517
5682
|
const body = {};
|
|
5518
5683
|
if (opts?.provider) {
|
|
5519
5684
|
const providerInputs = opts.provider.split(",").map((s) => s.trim()).filter(Boolean);
|
|
@@ -5609,7 +5774,7 @@ async function triggerRun(project, opts) {
|
|
|
5609
5774
|
}
|
|
5610
5775
|
}
|
|
5611
5776
|
async function triggerRunAll(opts) {
|
|
5612
|
-
const client =
|
|
5777
|
+
const client = getClient16();
|
|
5613
5778
|
const projects2 = await client.listProjects();
|
|
5614
5779
|
if (projects2.length === 0) {
|
|
5615
5780
|
if (opts?.format === "json") {
|
|
@@ -5667,7 +5832,7 @@ async function triggerRunAll(opts) {
|
|
|
5667
5832
|
}
|
|
5668
5833
|
}
|
|
5669
5834
|
async function cancelRun(project, runId, format) {
|
|
5670
|
-
const client =
|
|
5835
|
+
const client = getClient16();
|
|
5671
5836
|
let targetId = runId;
|
|
5672
5837
|
if (!targetId) {
|
|
5673
5838
|
const runs2 = await client.listRuns(project);
|
|
@@ -5699,7 +5864,7 @@ To cancel by ID : canonry run cancel ${project} <run-id>`,
|
|
|
5699
5864
|
console.log(`Run ${result.id} cancelled.`);
|
|
5700
5865
|
}
|
|
5701
5866
|
async function showRun(id, format) {
|
|
5702
|
-
const client =
|
|
5867
|
+
const client = getClient16();
|
|
5703
5868
|
const run = await client.getRun(id);
|
|
5704
5869
|
if (format === "json") {
|
|
5705
5870
|
console.log(JSON.stringify(run, null, 2));
|
|
@@ -5708,7 +5873,7 @@ async function showRun(id, format) {
|
|
|
5708
5873
|
printRunDetail(run);
|
|
5709
5874
|
}
|
|
5710
5875
|
async function listRuns(project, opts) {
|
|
5711
|
-
const client =
|
|
5876
|
+
const client = getClient16();
|
|
5712
5877
|
const runs2 = await client.listRuns(project, opts?.limit);
|
|
5713
5878
|
if (opts?.format === "json") {
|
|
5714
5879
|
console.log(JSON.stringify(runs2, null, 2));
|
|
@@ -5861,11 +6026,11 @@ var RUN_CLI_COMMANDS = [
|
|
|
5861
6026
|
];
|
|
5862
6027
|
|
|
5863
6028
|
// src/commands/schedule.ts
|
|
5864
|
-
function
|
|
6029
|
+
function getClient17() {
|
|
5865
6030
|
return createApiClient();
|
|
5866
6031
|
}
|
|
5867
6032
|
async function setSchedule(project, opts) {
|
|
5868
|
-
const client =
|
|
6033
|
+
const client = getClient17();
|
|
5869
6034
|
const body = {};
|
|
5870
6035
|
if (opts.preset) body.preset = opts.preset;
|
|
5871
6036
|
if (opts.cron) body.cron = opts.cron;
|
|
@@ -5880,7 +6045,7 @@ async function setSchedule(project, opts) {
|
|
|
5880
6045
|
printSchedule(result);
|
|
5881
6046
|
}
|
|
5882
6047
|
async function showSchedule(project, format) {
|
|
5883
|
-
const client =
|
|
6048
|
+
const client = getClient17();
|
|
5884
6049
|
const result = await client.getSchedule(project);
|
|
5885
6050
|
if (format === "json") {
|
|
5886
6051
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -5889,7 +6054,7 @@ async function showSchedule(project, format) {
|
|
|
5889
6054
|
printSchedule(result);
|
|
5890
6055
|
}
|
|
5891
6056
|
async function enableSchedule(project, format) {
|
|
5892
|
-
const client =
|
|
6057
|
+
const client = getClient17();
|
|
5893
6058
|
const current = await client.getSchedule(project);
|
|
5894
6059
|
const body = { timezone: current.timezone, enabled: true };
|
|
5895
6060
|
if (current.preset) body.preset = current.preset;
|
|
@@ -5903,7 +6068,7 @@ async function enableSchedule(project, format) {
|
|
|
5903
6068
|
console.log(`Schedule enabled for "${project}"`);
|
|
5904
6069
|
}
|
|
5905
6070
|
async function disableSchedule(project, format) {
|
|
5906
|
-
const client =
|
|
6071
|
+
const client = getClient17();
|
|
5907
6072
|
const current = await client.getSchedule(project);
|
|
5908
6073
|
const body = { timezone: current.timezone, enabled: false };
|
|
5909
6074
|
if (current.preset) body.preset = current.preset;
|
|
@@ -5917,7 +6082,7 @@ async function disableSchedule(project, format) {
|
|
|
5917
6082
|
console.log(`Schedule disabled for "${project}"`);
|
|
5918
6083
|
}
|
|
5919
6084
|
async function removeSchedule(project, format) {
|
|
5920
|
-
const client =
|
|
6085
|
+
const client = getClient17();
|
|
5921
6086
|
await client.deleteSchedule(project);
|
|
5922
6087
|
if (format === "json") {
|
|
5923
6088
|
console.log(JSON.stringify({ project, removed: true }, null, 2));
|
|
@@ -6024,11 +6189,11 @@ var SCHEDULE_CLI_COMMANDS = [
|
|
|
6024
6189
|
];
|
|
6025
6190
|
|
|
6026
6191
|
// src/commands/settings.ts
|
|
6027
|
-
function
|
|
6192
|
+
function getClient18() {
|
|
6028
6193
|
return createApiClient();
|
|
6029
6194
|
}
|
|
6030
6195
|
async function setProvider(name, opts) {
|
|
6031
|
-
const client =
|
|
6196
|
+
const client = getClient18();
|
|
6032
6197
|
const { format, ...payload } = opts;
|
|
6033
6198
|
const result = await client.updateProvider(name, payload);
|
|
6034
6199
|
if (format === "json") {
|
|
@@ -6044,7 +6209,7 @@ async function setProvider(name, opts) {
|
|
|
6044
6209
|
}
|
|
6045
6210
|
}
|
|
6046
6211
|
async function showSettings(format) {
|
|
6047
|
-
const client =
|
|
6212
|
+
const client = getClient18();
|
|
6048
6213
|
const config = loadConfig();
|
|
6049
6214
|
const settings = await client.getSettings();
|
|
6050
6215
|
if (format === "json") {
|
|
@@ -6841,7 +7006,7 @@ function wrapText(font, text, size, maxWidth) {
|
|
|
6841
7006
|
}
|
|
6842
7007
|
|
|
6843
7008
|
// src/commands/snapshot.ts
|
|
6844
|
-
function
|
|
7009
|
+
function getClient19() {
|
|
6845
7010
|
return createApiClient();
|
|
6846
7011
|
}
|
|
6847
7012
|
function slugify(value) {
|
|
@@ -6852,7 +7017,7 @@ function autoOutputPath(companyName, ext) {
|
|
|
6852
7017
|
return `${slugify(companyName)}-snapshot-${date}.${ext}`;
|
|
6853
7018
|
}
|
|
6854
7019
|
async function createSnapshotReport(companyName, opts) {
|
|
6855
|
-
const client =
|
|
7020
|
+
const client = getClient19();
|
|
6856
7021
|
const report = await client.createSnapshot({
|
|
6857
7022
|
companyName,
|
|
6858
7023
|
domain: opts.domain,
|
|
@@ -8621,7 +8786,7 @@ var SYSTEM_CLI_COMMANDS = [
|
|
|
8621
8786
|
import fs11 from "fs";
|
|
8622
8787
|
|
|
8623
8788
|
// src/commands/wordpress.ts
|
|
8624
|
-
function
|
|
8789
|
+
function getClient20() {
|
|
8625
8790
|
return createApiClient();
|
|
8626
8791
|
}
|
|
8627
8792
|
function printJson2(value) {
|
|
@@ -8768,7 +8933,7 @@ async function wordpressConnect(project, opts) {
|
|
|
8768
8933
|
details: { project }
|
|
8769
8934
|
});
|
|
8770
8935
|
}
|
|
8771
|
-
const client =
|
|
8936
|
+
const client = getClient20();
|
|
8772
8937
|
const result = await client.wordpressConnect(project, {
|
|
8773
8938
|
url: opts.url,
|
|
8774
8939
|
stagingUrl: opts.stagingUrl,
|
|
@@ -8785,7 +8950,7 @@ async function wordpressConnect(project, opts) {
|
|
|
8785
8950
|
printWordpressStatus(project, result);
|
|
8786
8951
|
}
|
|
8787
8952
|
async function wordpressDisconnect(project, format) {
|
|
8788
|
-
const client =
|
|
8953
|
+
const client = getClient20();
|
|
8789
8954
|
await client.wordpressDisconnect(project);
|
|
8790
8955
|
if (format === "json") {
|
|
8791
8956
|
printJson2({ project, disconnected: true });
|
|
@@ -8794,7 +8959,7 @@ async function wordpressDisconnect(project, format) {
|
|
|
8794
8959
|
console.log(`WordPress disconnected from project "${project}".`);
|
|
8795
8960
|
}
|
|
8796
8961
|
async function wordpressStatus(project, format) {
|
|
8797
|
-
const client =
|
|
8962
|
+
const client = getClient20();
|
|
8798
8963
|
const result = await client.wordpressStatus(project);
|
|
8799
8964
|
if (format === "json") {
|
|
8800
8965
|
printJson2(result);
|
|
@@ -8803,7 +8968,7 @@ async function wordpressStatus(project, format) {
|
|
|
8803
8968
|
printWordpressStatus(project, result);
|
|
8804
8969
|
}
|
|
8805
8970
|
async function wordpressPages(project, opts) {
|
|
8806
|
-
const client =
|
|
8971
|
+
const client = getClient20();
|
|
8807
8972
|
const result = await client.wordpressPages(project, opts.env);
|
|
8808
8973
|
if (opts.format === "json") {
|
|
8809
8974
|
printJson2(result);
|
|
@@ -8812,7 +8977,7 @@ async function wordpressPages(project, opts) {
|
|
|
8812
8977
|
printPages(project, result.env, result.pages);
|
|
8813
8978
|
}
|
|
8814
8979
|
async function wordpressPage(project, slug, opts) {
|
|
8815
|
-
const client =
|
|
8980
|
+
const client = getClient20();
|
|
8816
8981
|
const result = await client.wordpressPage(project, slug, opts.env);
|
|
8817
8982
|
if (opts.format === "json") {
|
|
8818
8983
|
printJson2(result);
|
|
@@ -8821,7 +8986,7 @@ async function wordpressPage(project, slug, opts) {
|
|
|
8821
8986
|
printPageDetail(result);
|
|
8822
8987
|
}
|
|
8823
8988
|
async function wordpressCreatePage(project, body) {
|
|
8824
|
-
const client =
|
|
8989
|
+
const client = getClient20();
|
|
8825
8990
|
const result = await client.wordpressCreatePage(project, body);
|
|
8826
8991
|
if (body.format === "json") {
|
|
8827
8992
|
printJson2(result);
|
|
@@ -8832,7 +8997,7 @@ async function wordpressCreatePage(project, body) {
|
|
|
8832
8997
|
printPageDetail(result);
|
|
8833
8998
|
}
|
|
8834
8999
|
async function wordpressUpdatePage(project, body) {
|
|
8835
|
-
const client =
|
|
9000
|
+
const client = getClient20();
|
|
8836
9001
|
const result = await client.wordpressUpdatePage(project, body);
|
|
8837
9002
|
if (body.format === "json") {
|
|
8838
9003
|
printJson2(result);
|
|
@@ -8843,7 +9008,7 @@ async function wordpressUpdatePage(project, body) {
|
|
|
8843
9008
|
printPageDetail(result);
|
|
8844
9009
|
}
|
|
8845
9010
|
async function wordpressSetMeta(project, body) {
|
|
8846
|
-
const client =
|
|
9011
|
+
const client = getClient20();
|
|
8847
9012
|
const result = await client.wordpressSetMeta(project, body);
|
|
8848
9013
|
if (body.format === "json") {
|
|
8849
9014
|
printJson2(result);
|
|
@@ -8893,7 +9058,7 @@ async function wordpressBulkSetMeta(project, opts) {
|
|
|
8893
9058
|
details: { path: filePath }
|
|
8894
9059
|
});
|
|
8895
9060
|
}
|
|
8896
|
-
const client =
|
|
9061
|
+
const client = getClient20();
|
|
8897
9062
|
const result = await client.wordpressBulkSetMeta(project, { entries, env: opts.env });
|
|
8898
9063
|
if (opts.format === "json") {
|
|
8899
9064
|
printJson2(result);
|
|
@@ -8936,7 +9101,7 @@ async function wordpressBulkSetMeta(project, opts) {
|
|
|
8936
9101
|
Total: ${applied.length} applied, ${skipped.length} skipped, ${manual.length} manual`);
|
|
8937
9102
|
}
|
|
8938
9103
|
async function wordpressSchema(project, slug, opts) {
|
|
8939
|
-
const client =
|
|
9104
|
+
const client = getClient20();
|
|
8940
9105
|
const result = await client.wordpressSchema(project, slug, opts.env);
|
|
8941
9106
|
if (opts.format === "json") {
|
|
8942
9107
|
printJson2(result);
|
|
@@ -8947,7 +9112,7 @@ async function wordpressSchema(project, slug, opts) {
|
|
|
8947
9112
|
printSchemaBlocks(result.blocks);
|
|
8948
9113
|
}
|
|
8949
9114
|
async function wordpressSetSchema(project, body) {
|
|
8950
|
-
const client =
|
|
9115
|
+
const client = getClient20();
|
|
8951
9116
|
const result = await client.wordpressSetSchema(project, body);
|
|
8952
9117
|
if (body.format === "json") {
|
|
8953
9118
|
printJson2(result);
|
|
@@ -8995,7 +9160,7 @@ async function wordpressSchemaDeploy(project, opts) {
|
|
|
8995
9160
|
details: { path: filePath }
|
|
8996
9161
|
});
|
|
8997
9162
|
}
|
|
8998
|
-
const client =
|
|
9163
|
+
const client = getClient20();
|
|
8999
9164
|
const result = await client.wordpressSchemaDeploy(project, { profile: parsed, env: opts.env });
|
|
9000
9165
|
if (opts.format === "json") {
|
|
9001
9166
|
printJson2(result);
|
|
@@ -9034,7 +9199,7 @@ async function wordpressSchemaDeploy(project, opts) {
|
|
|
9034
9199
|
Total: ${deployed} deployed, ${stripped} stripped, ${skipped} skipped, ${failed} failed`);
|
|
9035
9200
|
}
|
|
9036
9201
|
async function wordpressSchemaStatus(project, opts) {
|
|
9037
|
-
const client =
|
|
9202
|
+
const client = getClient20();
|
|
9038
9203
|
const result = await client.wordpressSchemaStatus(project, opts.env);
|
|
9039
9204
|
if (opts.format === "json") {
|
|
9040
9205
|
printJson2(result);
|
|
@@ -9093,7 +9258,7 @@ async function wordpressOnboard(project, opts) {
|
|
|
9093
9258
|
});
|
|
9094
9259
|
}
|
|
9095
9260
|
}
|
|
9096
|
-
const client =
|
|
9261
|
+
const client = getClient20();
|
|
9097
9262
|
const result = await client.wordpressOnboard(project, {
|
|
9098
9263
|
url: opts.url,
|
|
9099
9264
|
username: opts.user,
|
|
@@ -9118,7 +9283,7 @@ async function wordpressOnboard(project, opts) {
|
|
|
9118
9283
|
}
|
|
9119
9284
|
}
|
|
9120
9285
|
async function wordpressLlmsTxt(project, opts) {
|
|
9121
|
-
const client =
|
|
9286
|
+
const client = getClient20();
|
|
9122
9287
|
const result = await client.wordpressLlmsTxt(project, opts.env);
|
|
9123
9288
|
if (opts.format === "json") {
|
|
9124
9289
|
printJson2(result);
|
|
@@ -9129,7 +9294,7 @@ async function wordpressLlmsTxt(project, opts) {
|
|
|
9129
9294
|
console.log(result.content ?? "(not found)");
|
|
9130
9295
|
}
|
|
9131
9296
|
async function wordpressSetLlmsTxt(project, body) {
|
|
9132
|
-
const client =
|
|
9297
|
+
const client = getClient20();
|
|
9133
9298
|
const result = await client.wordpressSetLlmsTxt(project, body);
|
|
9134
9299
|
if (body.format === "json") {
|
|
9135
9300
|
printJson2(result);
|
|
@@ -9138,7 +9303,7 @@ async function wordpressSetLlmsTxt(project, body) {
|
|
|
9138
9303
|
printManualAssist(`llms.txt update for "${project}"`, result);
|
|
9139
9304
|
}
|
|
9140
9305
|
async function wordpressAudit(project, opts) {
|
|
9141
|
-
const client =
|
|
9306
|
+
const client = getClient20();
|
|
9142
9307
|
const result = await client.wordpressAudit(project, opts.env);
|
|
9143
9308
|
if (opts.format === "json") {
|
|
9144
9309
|
printJson2(result);
|
|
@@ -9152,7 +9317,7 @@ async function wordpressAudit(project, opts) {
|
|
|
9152
9317
|
printAuditIssues(result.issues);
|
|
9153
9318
|
}
|
|
9154
9319
|
async function wordpressDiff(project, slug, format) {
|
|
9155
|
-
const client =
|
|
9320
|
+
const client = getClient20();
|
|
9156
9321
|
const result = await client.wordpressDiff(project, slug);
|
|
9157
9322
|
if (format === "json") {
|
|
9158
9323
|
printJson2(result);
|
|
@@ -9161,7 +9326,7 @@ async function wordpressDiff(project, slug, format) {
|
|
|
9161
9326
|
printDiff(result);
|
|
9162
9327
|
}
|
|
9163
9328
|
async function wordpressStagingStatus(project, format) {
|
|
9164
|
-
const client =
|
|
9329
|
+
const client = getClient20();
|
|
9165
9330
|
const result = await client.wordpressStagingStatus(project);
|
|
9166
9331
|
if (format === "json") {
|
|
9167
9332
|
printJson2(result);
|
|
@@ -9175,7 +9340,7 @@ async function wordpressStagingStatus(project, format) {
|
|
|
9175
9340
|
console.log(` Admin URL: ${result.adminUrl}`);
|
|
9176
9341
|
}
|
|
9177
9342
|
async function wordpressStagingPush(project, format) {
|
|
9178
|
-
const client =
|
|
9343
|
+
const client = getClient20();
|
|
9179
9344
|
const result = await client.wordpressStagingPush(project);
|
|
9180
9345
|
if (format === "json") {
|
|
9181
9346
|
printJson2(result);
|
|
@@ -10169,6 +10334,7 @@ var REGISTERED_CLI_COMMANDS = [
|
|
|
10169
10334
|
...WORDPRESS_CLI_COMMANDS,
|
|
10170
10335
|
...CDP_CLI_COMMANDS,
|
|
10171
10336
|
...GA_CLI_COMMANDS,
|
|
10337
|
+
...TRAFFIC_CLI_COMMANDS,
|
|
10172
10338
|
...INTELLIGENCE_CLI_COMMANDS,
|
|
10173
10339
|
...CONTENT_CLI_COMMANDS,
|
|
10174
10340
|
...AGENT_CLI_COMMANDS,
|