seo 0.17.8 → 0.17.9
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/PRIVACY.md +12 -3
- package/README.md +2 -2
- package/TERMS.md +1 -1
- package/dist/cli.js +93 -92
- package/dist/cli.js.map +1 -1
- package/dist/{dist-B4R6hoQ0.js → dist-DiyyBCYL.js} +66 -66
- package/dist/{dist-B4R6hoQ0.js.map → dist-DiyyBCYL.js.map} +1 -1
- package/dist/{dist-2VY_4sc-.js → dist-DzcRsuc4.js} +1 -1
- package/dist/{esm-R3uezpJ-.js → esm-BByR3SEY.js} +2 -2
- package/dist/{esm-R3uezpJ-.js.map → esm-BByR3SEY.js.map} +1 -1
- package/dist/index.d.ts +69 -42
- package/dist/index.js +586 -30
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +581 -31
- package/dist/mcp.js.map +1 -1
- package/package.json +3 -3
- package/skills/seo/SKILL.md +5 -5
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __seoCreateRequire } from 'node:module'; const require = __seoCreateRequire(import.meta.url);
|
|
2
|
-
import { n as version, t as load } from "./esm-
|
|
2
|
+
import { n as version, t as load } from "./esm-BByR3SEY.js";
|
|
3
3
|
import { SEO_PROVIDER_API_VERSION } from "./provider-sdk.js";
|
|
4
4
|
import crypto$1, { createHash, randomUUID, sign } from "node:crypto";
|
|
5
5
|
import { z } from "zod";
|
|
@@ -1727,7 +1727,7 @@ function bearerFetch(token) {
|
|
|
1727
1727
|
}
|
|
1728
1728
|
});
|
|
1729
1729
|
}
|
|
1730
|
-
async function failure(response, label, subject, options) {
|
|
1730
|
+
async function failure$1(response, label, subject, options) {
|
|
1731
1731
|
const detail = (await response.text().catch(() => "")).slice(0, 300);
|
|
1732
1732
|
const status = response.status;
|
|
1733
1733
|
const what = subject ? `${label} for ${subject}` : label;
|
|
@@ -1751,7 +1751,7 @@ async function googleJson(gfetch, url, input) {
|
|
|
1751
1751
|
body: input.body === void 0 ? void 0 : JSON.stringify(input.body),
|
|
1752
1752
|
signal
|
|
1753
1753
|
});
|
|
1754
|
-
if (!response.ok) throw await failure(response, input.label, input.subject, input);
|
|
1754
|
+
if (!response.ok) throw await failure$1(response, input.label, input.subject, input);
|
|
1755
1755
|
return readJson(response, input.label, { maxBytes: input.maxBytes });
|
|
1756
1756
|
});
|
|
1757
1757
|
}
|
|
@@ -1844,7 +1844,7 @@ async function runAnalyticsReport(gfetch, propertyId, body, options) {
|
|
|
1844
1844
|
}
|
|
1845
1845
|
// packages/core/src/bing/api.ts
|
|
1846
1846
|
const BASE = "https://ssl.bing.com/webmaster/api.svc/json";
|
|
1847
|
-
const MAX_BYTES$
|
|
1847
|
+
const MAX_BYTES$6 = 8e6;
|
|
1848
1848
|
function bingCall(auth, options) {
|
|
1849
1849
|
return async (method, params = {}) => {
|
|
1850
1850
|
const url = new URL(`${BASE}/${method}`);
|
|
@@ -1869,7 +1869,7 @@ function bingCall(auth, options) {
|
|
|
1869
1869
|
if (response.status === 429 || /throttle/i.test(detail)) throw new SeoError("RATE_LIMITED", "Bing Webmaster is limiting requests. Try again in a few minutes.");
|
|
1870
1870
|
throw new SeoError("OPTIONAL_PROVIDER_UNAVAILABLE", `Bing Webmaster answered ${response.status}. ${detail}`.trim());
|
|
1871
1871
|
}
|
|
1872
|
-
return (await readJson(response, "Bing Webmaster", { maxBytes: MAX_BYTES$
|
|
1872
|
+
return (await readJson(response, "Bing Webmaster", { maxBytes: MAX_BYTES$6 })).d;
|
|
1873
1873
|
};
|
|
1874
1874
|
}
|
|
1875
1875
|
function day$3(value) {
|
|
@@ -2865,6 +2865,7 @@ async function runSites(input) {
|
|
|
2865
2865
|
input.bing === void 0 ? null : bing === null ? "Bing Webmaster: not connected." : bing instanceof Error ? `Bing Webmaster: could not list sites. ${bing.message}` : bingOnly.length ? `Bing Webmaster sites with no Search Console property here (${bingOnly.length}): ${bingOnly.map((site) => site.url).join(", ")}.` : `Bing Webmaster: ${bingSites.length} verified sites; the bing column shows each one.`,
|
|
2866
2866
|
`Research keys: ${research.length ? research.join(", ") : "none"}.`,
|
|
2867
2867
|
input.clicky?.length ? `Clicky sites (seo_data with source "clicky"): ${input.clicky.join(", ")}.` : null,
|
|
2868
|
+
input.simpleAnalytics ? "Simple Analytics: API key saved; seo_data with source \"simple_analytics\" and the site's domain." : null,
|
|
2868
2869
|
`Add a Google account${input.bing === void 0 ? "" : ", Bing"} or a key: ${input.connect}`,
|
|
2869
2870
|
"Next: seo_report with a site."
|
|
2870
2871
|
].filter(Boolean).join("\n\n"),
|
|
@@ -2873,7 +2874,8 @@ async function runSites(input) {
|
|
|
2873
2874
|
googleAnalytics: analytics,
|
|
2874
2875
|
bing: Array.isArray(bing) ? bingSites : null,
|
|
2875
2876
|
research,
|
|
2876
|
-
clicky: input.clicky ?? []
|
|
2877
|
+
clicky: input.clicky ?? [],
|
|
2878
|
+
simpleAnalytics: Boolean(input.simpleAnalytics)
|
|
2877
2879
|
}
|
|
2878
2880
|
};
|
|
2879
2881
|
}
|
|
@@ -17202,7 +17204,8 @@ const PROVIDER_SECRET_NAMES = {
|
|
|
17202
17204
|
bingApiKey: "bing-api-key",
|
|
17203
17205
|
clickySiteKeys: "clicky-sitekeys",
|
|
17204
17206
|
dataForSeoCredentials: "dataforseo-credentials",
|
|
17205
|
-
providerExtensionCredentials: "provider-extension-credentials"
|
|
17207
|
+
providerExtensionCredentials: "provider-extension-credentials",
|
|
17208
|
+
simpleAnalyticsKey: "simple-analytics-key"
|
|
17206
17209
|
};
|
|
17207
17210
|
const REMOVED_PROVIDER_SECRET_NAMES = [
|
|
17208
17211
|
"indexnow-keys",
|
|
@@ -17890,7 +17893,7 @@ async function loadInstalledProviderExtensions(options = {}) {
|
|
|
17890
17893
|
const DEFAULT_MAX_REQUESTS = 8;
|
|
17891
17894
|
const MAX_RESPONSE_BYTES$1 = 10485760;
|
|
17892
17895
|
const MAX_REQUEST_BODY_BYTES = 65536;
|
|
17893
|
-
const TIMEOUT_MS$
|
|
17896
|
+
const TIMEOUT_MS$4 = 15e3;
|
|
17894
17897
|
function normalizeProviderExtensionAccount(provider, account) {
|
|
17895
17898
|
const fields = provider.connection.fields.filter((field) => field.kind === "account");
|
|
17896
17899
|
const allowed = new Set(fields.map((field) => field.id));
|
|
@@ -17937,7 +17940,7 @@ function runtimeForProvider(provider, options = {}) {
|
|
|
17937
17940
|
},
|
|
17938
17941
|
fetch: providerFetch,
|
|
17939
17942
|
maxResponseBytes: MAX_RESPONSE_BYTES$1,
|
|
17940
|
-
timeoutMs: TIMEOUT_MS$
|
|
17943
|
+
timeoutMs: TIMEOUT_MS$4,
|
|
17941
17944
|
retry: (input.method ?? "GET") === "GET" ? "safe" : "never",
|
|
17942
17945
|
schema: z.unknown()
|
|
17943
17946
|
});
|
|
@@ -25667,7 +25670,7 @@ function placementPage(input) {
|
|
|
25667
25670
|
};
|
|
25668
25671
|
}
|
|
25669
25672
|
// packages/core/src/analyze/internal-links-report.ts
|
|
25670
|
-
const DAY$
|
|
25673
|
+
const DAY$2 = 864e5;
|
|
25671
25674
|
const ISO_DAY = /^\d{4}-\d{2}-\d{2}$/;
|
|
25672
25675
|
function internalLinksReportRange(input, fallbackDays, now) {
|
|
25673
25676
|
if (!input.startDate && !input.endDate) return {
|
|
@@ -25679,7 +25682,7 @@ function internalLinksReportRange(input, fallbackDays, now) {
|
|
|
25679
25682
|
return {
|
|
25680
25683
|
startDate,
|
|
25681
25684
|
endDate,
|
|
25682
|
-
days: Math.round((Date.parse(`${endDate}T00:00:00Z`) - Date.parse(`${startDate}T00:00:00Z`)) / DAY$
|
|
25685
|
+
days: Math.round((Date.parse(`${endDate}T00:00:00Z`) - Date.parse(`${startDate}T00:00:00Z`)) / DAY$2) + 1
|
|
25683
25686
|
};
|
|
25684
25687
|
}
|
|
25685
25688
|
const plural$6 = (count, word) => `${count} ${word}${count === 1 ? "" : "s"}`;
|
|
@@ -30396,7 +30399,7 @@ async function detectBrandTerms(input) {
|
|
|
30396
30399
|
}
|
|
30397
30400
|
// packages/core/src/clicky/api.ts
|
|
30398
30401
|
const ENDPOINT$1 = "https://api.clicky.com/api/stats/4";
|
|
30399
|
-
const MAX_BYTES$
|
|
30402
|
+
const MAX_BYTES$5 = 5e6;
|
|
30400
30403
|
var ClickyError = class extends Error {
|
|
30401
30404
|
code;
|
|
30402
30405
|
constructor(code, message) {
|
|
@@ -30423,7 +30426,7 @@ async function clickyStats(site, types, options = {}) {
|
|
|
30423
30426
|
throw new ClickyError("remote", "Could not reach Clicky. Try again.");
|
|
30424
30427
|
});
|
|
30425
30428
|
if (!response.ok) throw new ClickyError("remote", `Clicky returned ${response.status}.`);
|
|
30426
|
-
const groups = await readJson(response, "Clicky", { maxBytes: MAX_BYTES$
|
|
30429
|
+
const groups = await readJson(response, "Clicky", { maxBytes: MAX_BYTES$5 });
|
|
30427
30430
|
if (!Array.isArray(groups)) throw new ClickyError("remote", "Clicky returned invalid data.");
|
|
30428
30431
|
const failed = groups.find((group) => typeof group?.error === "string");
|
|
30429
30432
|
if (failed?.error) throw /sitekey|site id|authenticat|permission/iu.test(failed.error) ? new ClickyError("auth", `Clicky rejected site ID ${site.siteId} or its sitekey.`) : new ClickyError("remote", `Clicky: ${failed.error.slice(0, 200)}`);
|
|
@@ -33515,6 +33518,66 @@ function lintReportText(files) {
|
|
|
33515
33518
|
if (reviews) lines.push("Errors and warnings each come with a fix. Review items are judgement calls: change a line only when it fails the question.");
|
|
33516
33519
|
return lines.join("\n").trimEnd();
|
|
33517
33520
|
}
|
|
33521
|
+
// packages/core/src/simple-analytics/api.ts
|
|
33522
|
+
const ORIGIN = "https://simpleanalytics.com";
|
|
33523
|
+
const MAX_BYTES$4 = 5e6;
|
|
33524
|
+
const TIMEOUT_MS$3 = 2e4;
|
|
33525
|
+
const SIMPLE_ANALYTICS_LIMIT = 1e3;
|
|
33526
|
+
var SimpleAnalyticsError = class extends Error {
|
|
33527
|
+
code;
|
|
33528
|
+
constructor(code, message) {
|
|
33529
|
+
super(message);
|
|
33530
|
+
this.code = code;
|
|
33531
|
+
}
|
|
33532
|
+
};
|
|
33533
|
+
function isSimpleAnalyticsKey(value) {
|
|
33534
|
+
return /^sa_api_key_[A-Za-z0-9_-]{8,120}$/u.test(value.trim());
|
|
33535
|
+
}
|
|
33536
|
+
const number = (value) => typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : null;
|
|
33537
|
+
const rows = (value) => Array.isArray(value) ? value.flatMap((row) => row && typeof row.value === "string" ? [{
|
|
33538
|
+
value: row.value,
|
|
33539
|
+
pageviews: number(row.pageviews) ?? 0,
|
|
33540
|
+
visitors: number(row.visitors) ?? 0
|
|
33541
|
+
}] : []) : [];
|
|
33542
|
+
async function simpleAnalyticsStats(key, hostname, range, fields, filters = {}) {
|
|
33543
|
+
const url = new URL(`${ORIGIN}/${encodeURIComponent(hostname)}.json`);
|
|
33544
|
+
url.searchParams.set("version", "6");
|
|
33545
|
+
url.searchParams.set("info", "false");
|
|
33546
|
+
url.searchParams.set("start", range.startDate);
|
|
33547
|
+
url.searchParams.set("end", range.endDate);
|
|
33548
|
+
url.searchParams.set("fields", fields.join(","));
|
|
33549
|
+
url.searchParams.set("limit", String(SIMPLE_ANALYTICS_LIMIT));
|
|
33550
|
+
for (const [name, value] of Object.entries(filters)) url.searchParams.set(name, value);
|
|
33551
|
+
const response = await fetch(url, {
|
|
33552
|
+
headers: {
|
|
33553
|
+
"Api-Key": key,
|
|
33554
|
+
accept: "application/json"
|
|
33555
|
+
},
|
|
33556
|
+
signal: AbortSignal.timeout(TIMEOUT_MS$3)
|
|
33557
|
+
}).catch(() => {
|
|
33558
|
+
throw new SimpleAnalyticsError("remote", "Could not reach Simple Analytics. Try again.");
|
|
33559
|
+
});
|
|
33560
|
+
if (response.status === 404) throw new SimpleAnalyticsError("not_found", `Simple Analytics has no website ${hostname} for this key.`);
|
|
33561
|
+
if (response.status === 401 || response.status === 403) throw new SimpleAnalyticsError("auth", `Simple Analytics rejected the API key for ${hostname}.`);
|
|
33562
|
+
if (response.status === 423) throw new SimpleAnalyticsError("auth", `Simple Analytics has no API access for ${hostname} on its plan.`);
|
|
33563
|
+
if (response.status === 400) {
|
|
33564
|
+
const reason = await readJson(response, "Simple Analytics", { maxBytes: 1e4 }).catch(() => null);
|
|
33565
|
+
const error = String(reason?.error ?? "");
|
|
33566
|
+
throw /api-key|authori[sz]/iu.test(error) ? new SimpleAnalyticsError("auth", `Simple Analytics rejected the API key for ${hostname}.`) : new SimpleAnalyticsError("remote", `Simple Analytics: ${error.slice(0, 200) || "returned 400"}.`);
|
|
33567
|
+
}
|
|
33568
|
+
if (!response.ok) throw new SimpleAnalyticsError("remote", `Simple Analytics returned ${response.status}.`);
|
|
33569
|
+
const body = await readJson(response, "Simple Analytics", { maxBytes: MAX_BYTES$4 });
|
|
33570
|
+
if (body?.ok !== true) throw new SimpleAnalyticsError("remote", `Simple Analytics: ${String(body?.error ?? "invalid data").slice(0, 200)}`);
|
|
33571
|
+
return {
|
|
33572
|
+
hostname: typeof body.hostname === "string" ? body.hostname : hostname,
|
|
33573
|
+
timezone: typeof body.timezone === "string" ? body.timezone : null,
|
|
33574
|
+
pageviews: number(body.pageviews),
|
|
33575
|
+
visitors: number(body.visitors),
|
|
33576
|
+
pages: rows(body.pages),
|
|
33577
|
+
referrers: rows(body.referrers),
|
|
33578
|
+
utm_sources: rows(body.utm_sources)
|
|
33579
|
+
};
|
|
33580
|
+
}
|
|
33518
33581
|
// packages/core/src/commands/research-ahrefs.ts
|
|
33519
33582
|
async function ahrefs(key, input, missed, totals) {
|
|
33520
33583
|
const where = targetParts(input).ahrefs;
|
|
@@ -36029,20 +36092,20 @@ async function pickClickySite(saved, target, connect, refresh) {
|
|
|
36029
36092
|
}
|
|
36030
36093
|
throw new CommandError("NO_ACCESS", `No saved Clicky site matches ${target}. Saved Clicky sites: ${sites.map(clickyLabel).join(", ")}. Pass one of these site IDs, or add the site: ${connect}`);
|
|
36031
36094
|
}
|
|
36032
|
-
const DAY = 864e5;
|
|
36033
|
-
const isoDay = (time) => new Date(time).toISOString().slice(0, 10);
|
|
36095
|
+
const DAY$1 = 864e5;
|
|
36096
|
+
const isoDay$1 = (time) => new Date(time).toISOString().slice(0, 10);
|
|
36034
36097
|
function clickyRange(input) {
|
|
36035
36098
|
if (!input.startDate && !input.endDate) {
|
|
36036
|
-
const end = Date.now() - DAY;
|
|
36099
|
+
const end = Date.now() - DAY$1;
|
|
36037
36100
|
return {
|
|
36038
|
-
startDate: isoDay(end - 27 * DAY),
|
|
36039
|
-
endDate: isoDay(end)
|
|
36101
|
+
startDate: isoDay$1(end - 27 * DAY$1),
|
|
36102
|
+
endDate: isoDay$1(end)
|
|
36040
36103
|
};
|
|
36041
36104
|
}
|
|
36042
36105
|
const start = Date.parse(`${input.startDate}T00:00:00Z`);
|
|
36043
36106
|
const end = Date.parse(`${input.endDate}T00:00:00Z`);
|
|
36044
36107
|
if (!input.startDate || !input.endDate || !(start <= end)) throw new CommandError("INVALID_INPUT", "Send a start date and an end date together, in order.");
|
|
36045
|
-
if ((end - start) / DAY + 1 > 31) throw new CommandError("INVALID_INPUT", "Clicky reads at most 31 days at a time. Send a shorter range.");
|
|
36108
|
+
if ((end - start) / DAY$1 + 1 > 31) throw new CommandError("INVALID_INPUT", "Clicky reads at most 31 days at a time. Send a shorter range.");
|
|
36046
36109
|
return {
|
|
36047
36110
|
startDate: input.startDate,
|
|
36048
36111
|
endDate: input.endDate
|
|
@@ -36131,6 +36194,143 @@ async function runClickyRows(input, keys, options) {
|
|
|
36131
36194
|
}
|
|
36132
36195
|
};
|
|
36133
36196
|
}
|
|
36197
|
+
const FREE_LIMIT = 100;
|
|
36198
|
+
const FREE_HISTORY_DAYS = 30;
|
|
36199
|
+
function compared(now, before) {
|
|
36200
|
+
const rows = /* @__PURE__ */ new Map();
|
|
36201
|
+
const add = (name, visits, key) => {
|
|
36202
|
+
const row = rows.get(name) ?? {
|
|
36203
|
+
visits: 0,
|
|
36204
|
+
previousVisits: 0
|
|
36205
|
+
};
|
|
36206
|
+
row[key] += visits;
|
|
36207
|
+
rows.set(name, row);
|
|
36208
|
+
};
|
|
36209
|
+
for (const item of now) add(item.name, item.visits, "visits");
|
|
36210
|
+
for (const item of before) add(item.name, item.visits, "previousVisits");
|
|
36211
|
+
return [...rows].map(([name, row]) => ({
|
|
36212
|
+
name,
|
|
36213
|
+
...row
|
|
36214
|
+
})).sort((left, right) => right.visits - left.visits || right.previousVisits - left.previousVisits || (left.name < right.name ? -1 : left.name > right.name ? 1 : 0));
|
|
36215
|
+
}
|
|
36216
|
+
const sum$1 = (rows) => ({
|
|
36217
|
+
visits: rows.reduce((total, row) => total + row.visits, 0),
|
|
36218
|
+
previousVisits: rows.reduce((total, row) => total + row.previousVisits, 0)
|
|
36219
|
+
});
|
|
36220
|
+
const was = (rows) => rows.slice(0, 10).map((row) => `${row.name} ${row.visits} (was ${row.previousVisits})`).join(", ");
|
|
36221
|
+
async function clickyBeside(keys, site, range, before, pages) {
|
|
36222
|
+
const saved = keys ? clickySites(keys) : [];
|
|
36223
|
+
if (!saved.length) return null;
|
|
36224
|
+
let found;
|
|
36225
|
+
try {
|
|
36226
|
+
found = await pickClickySite(saved, site, "");
|
|
36227
|
+
} catch {
|
|
36228
|
+
return null;
|
|
36229
|
+
}
|
|
36230
|
+
const types = [
|
|
36231
|
+
"visitors",
|
|
36232
|
+
"traffic-sources",
|
|
36233
|
+
"links-domains",
|
|
36234
|
+
...pages ? ["pages-entrance"] : []
|
|
36235
|
+
];
|
|
36236
|
+
try {
|
|
36237
|
+
const read = (dates) => clickyStats(found, types, {
|
|
36238
|
+
date: `${dates.startDate},${dates.endDate}`,
|
|
36239
|
+
limit: LIMIT
|
|
36240
|
+
});
|
|
36241
|
+
const now = await read(range);
|
|
36242
|
+
const then = await read(before);
|
|
36243
|
+
const tally = (items) => items.reduce((total, item) => total + (count$2(item) ?? 0), 0);
|
|
36244
|
+
const visits = {
|
|
36245
|
+
visits: tally(now.visitors ?? []),
|
|
36246
|
+
previousVisits: tally(then.visitors ?? [])
|
|
36247
|
+
};
|
|
36248
|
+
const sources = compared(totals(now["traffic-sources"] ?? []), totals(then["traffic-sources"] ?? []));
|
|
36249
|
+
const fromAi = (items) => totals(items).flatMap((item) => {
|
|
36250
|
+
const source = aiReferralSourceForValue(item.name);
|
|
36251
|
+
return source ? [{
|
|
36252
|
+
name: source.label,
|
|
36253
|
+
visits: item.visits
|
|
36254
|
+
}] : [];
|
|
36255
|
+
});
|
|
36256
|
+
const ai = compared(fromAi(now["links-domains"] ?? []), fromAi(then["links-domains"] ?? []));
|
|
36257
|
+
const aiTotal = sum$1(ai);
|
|
36258
|
+
const landed = (items) => {
|
|
36259
|
+
let total = 0;
|
|
36260
|
+
for (const item of items) {
|
|
36261
|
+
const value = count$2(item);
|
|
36262
|
+
if (value === null || !item.url) continue;
|
|
36263
|
+
try {
|
|
36264
|
+
if (new URL(item.url).pathname.includes(pages ?? "")) total += value;
|
|
36265
|
+
} catch {}
|
|
36266
|
+
}
|
|
36267
|
+
return total;
|
|
36268
|
+
};
|
|
36269
|
+
const onPages = pages ? {
|
|
36270
|
+
contains: pages,
|
|
36271
|
+
visits: landed(now["pages-entrance"] ?? []),
|
|
36272
|
+
previousVisits: landed(then["pages-entrance"] ?? [])
|
|
36273
|
+
} : null;
|
|
36274
|
+
const cut = (type) => [now, then].some((stats) => {
|
|
36275
|
+
const length = stats[type]?.length ?? 0;
|
|
36276
|
+
return length >= LIMIT || length === FREE_LIMIT;
|
|
36277
|
+
});
|
|
36278
|
+
const linksCut = cut("links-domains");
|
|
36279
|
+
const pagesCut = Boolean(pages) && cut("pages-entrance");
|
|
36280
|
+
const daysBack = Math.round((Date.now() - Date.parse(`${before.startDate}T00:00:00Z`)) / DAY$1);
|
|
36281
|
+
const notes = [
|
|
36282
|
+
"Visits are Clicky’s own count, in the Clicky site’s time zone; they are not Google Analytics sessions or Search Console clicks.",
|
|
36283
|
+
pagesCut ? "Clicky’s list of landing pages reached its row limit (100 on a free account, 1,000 otherwise), so the landing-page total can be higher than shown." : "",
|
|
36284
|
+
daysBack > FREE_HISTORY_DAYS ? `The earlier period starts ${daysBack} days ago; a free Clicky account keeps 30 days, so on one it can read as zero.` : ""
|
|
36285
|
+
].filter(Boolean);
|
|
36286
|
+
const total = `${visits.visits} (was ${visits.previousVisits}, ${change$2(pct(visits.visits, visits.previousVisits))})`;
|
|
36287
|
+
const text = [
|
|
36288
|
+
`Clicky site ${clickyLabel(found)}: visits ${total}${pages ? " on the whole site" : ""}.`,
|
|
36289
|
+
sources.length ? `Traffic sources (visits): ${was(sources)}.` : "",
|
|
36290
|
+
onPages ? `Visits that landed on pages whose path contains "${pages}", from every source: ${onPages.visits} (was ${onPages.previousVisits}, ${change$2(pct(onPages.visits, onPages.previousVisits))}). Clicky does not split landing pages by source.` : "",
|
|
36291
|
+
...notes
|
|
36292
|
+
].filter(Boolean).join(" ");
|
|
36293
|
+
const limit = "Clicky’s list of incoming link domains reached its row limit (100 on a free account, 1,000 otherwise)";
|
|
36294
|
+
return {
|
|
36295
|
+
text: `${text}\n\n${[
|
|
36296
|
+
aiTotal.visits || aiTotal.previousVisits ? `Visits from AI assistants in Clicky’s incoming links (whole site): ${aiTotal.visits} (was ${aiTotal.previousVisits}, ${change$2(pct(aiTotal.visits, aiTotal.previousVisits))}). By source: ${was(ai)}.` : linksCut ? `Visits from AI assistants in Clicky’s incoming links (whole site): none among the domains Clicky listed. ${limit}, so this is unknown, not zero.` : "Visits from AI assistants in Clicky’s incoming links (whole site): none in either period.",
|
|
36297
|
+
linksCut && (aiTotal.visits || aiTotal.previousVisits) ? `${limit}, so these can be higher.` : "",
|
|
36298
|
+
"Only visits that pass a referrer count; AI apps that send none show as direct."
|
|
36299
|
+
].filter(Boolean).join(" ")}`,
|
|
36300
|
+
data: {
|
|
36301
|
+
siteId: found.siteId,
|
|
36302
|
+
domain: found.domain,
|
|
36303
|
+
metric: "visits",
|
|
36304
|
+
...visits,
|
|
36305
|
+
visitsChangePct: pct(visits.visits, visits.previousVisits),
|
|
36306
|
+
trafficSources: sources.map(({ name, ...row }) => ({
|
|
36307
|
+
source: name,
|
|
36308
|
+
...row
|
|
36309
|
+
})),
|
|
36310
|
+
...onPages ? { landingPages: {
|
|
36311
|
+
...onPages,
|
|
36312
|
+
capped: pagesCut
|
|
36313
|
+
} } : {},
|
|
36314
|
+
aiAssistants: {
|
|
36315
|
+
...aiTotal,
|
|
36316
|
+
visitsChangePct: pct(aiTotal.visits, aiTotal.previousVisits),
|
|
36317
|
+
bySource: ai.map(({ name, ...row }) => ({
|
|
36318
|
+
source: name,
|
|
36319
|
+
...row
|
|
36320
|
+
})),
|
|
36321
|
+
capped: linksCut
|
|
36322
|
+
},
|
|
36323
|
+
notes
|
|
36324
|
+
}
|
|
36325
|
+
};
|
|
36326
|
+
} catch (error) {
|
|
36327
|
+
const message = error instanceof ClickyError ? error.message : error instanceof Error ? error.message : String(error);
|
|
36328
|
+
return {
|
|
36329
|
+
text: `Clicky: could not be read. ${message}`,
|
|
36330
|
+
data: { error: message }
|
|
36331
|
+
};
|
|
36332
|
+
}
|
|
36333
|
+
}
|
|
36134
36334
|
// packages/core/src/commands/domain-rating.ts
|
|
36135
36335
|
const DR_ATTRIBUTION = "domain_rating: Domain Rating by Ahrefs (https://ahrefs.com/).";
|
|
36136
36336
|
const ENDPOINT = "https://api.ahrefs.com/v3/public/domain-rating-free";
|
|
@@ -38753,6 +38953,288 @@ async function sortedByDomainRating(rows, key) {
|
|
|
38753
38953
|
added: true
|
|
38754
38954
|
};
|
|
38755
38955
|
}
|
|
38956
|
+
// packages/core/src/commands/simple-analytics.ts
|
|
38957
|
+
const SIMPLE_ANALYTICS_KEY = "x-simpleanalytics-key";
|
|
38958
|
+
const simpleAnalyticsKey = (keys) => keys.get("x-simpleanalytics-key")?.trim() || null;
|
|
38959
|
+
const MAX_AI_TOOLS = 5;
|
|
38960
|
+
const MAX_AI_PAIRS = 4;
|
|
38961
|
+
const TOP = 10;
|
|
38962
|
+
const DAY = 864e5;
|
|
38963
|
+
const isoDay = (time) => new Date(time).toISOString().slice(0, 10);
|
|
38964
|
+
const BARE_AI = {
|
|
38965
|
+
chatgpt: "chatgpt",
|
|
38966
|
+
openai: "chatgpt",
|
|
38967
|
+
perplexity: "perplexity",
|
|
38968
|
+
claude: "claude",
|
|
38969
|
+
gemini: "gemini",
|
|
38970
|
+
copilot: "copilot",
|
|
38971
|
+
grok: "grok",
|
|
38972
|
+
deepseek: "deepseek"
|
|
38973
|
+
};
|
|
38974
|
+
const aiTool = (value) => aiReferralSourceForValue(value) ?? AI_REFERRAL_SOURCES.find((source) => source.id === BARE_AI[value.trim().toLowerCase()]);
|
|
38975
|
+
function hostsOf(site) {
|
|
38976
|
+
const text = site.trim().toLowerCase().replace(/^sc-domain:/u, "");
|
|
38977
|
+
let host;
|
|
38978
|
+
try {
|
|
38979
|
+
host = new URL(text.includes("://") ? text : `https://${text}`).hostname;
|
|
38980
|
+
} catch {
|
|
38981
|
+
host = text;
|
|
38982
|
+
}
|
|
38983
|
+
const bare = host.replace(/^www\./u, "");
|
|
38984
|
+
return [bare, `www.${bare}`];
|
|
38985
|
+
}
|
|
38986
|
+
const byVisitors = (a, b) => b.visitors - a.visitors || b.pageviews - a.pageviews || (a.value < b.value ? -1 : a.value > b.value ? 1 : 0);
|
|
38987
|
+
async function readPeriod(key, hostname, range, filters, withPages) {
|
|
38988
|
+
const stats = await simpleAnalyticsStats(key, hostname, range, [
|
|
38989
|
+
"pageviews",
|
|
38990
|
+
"visitors",
|
|
38991
|
+
...withPages ? ["pages"] : [],
|
|
38992
|
+
"referrers",
|
|
38993
|
+
"utm_sources"
|
|
38994
|
+
], filters);
|
|
38995
|
+
const referrers = [...stats.referrers].sort(byVisitors);
|
|
38996
|
+
const utmSources = [...stats.utm_sources].sort(byVisitors);
|
|
38997
|
+
const tools = /* @__PURE__ */ new Map();
|
|
38998
|
+
const add = (rows, side) => {
|
|
38999
|
+
for (const row of rows) {
|
|
39000
|
+
const tool = aiTool(row.value);
|
|
39001
|
+
if (!tool || !row.visitors) continue;
|
|
39002
|
+
const entry = tools.get(tool.id) ?? {
|
|
39003
|
+
label: tool.label,
|
|
39004
|
+
refs: [],
|
|
39005
|
+
utms: []
|
|
39006
|
+
};
|
|
39007
|
+
entry[side].push(row);
|
|
39008
|
+
tools.set(tool.id, entry);
|
|
39009
|
+
}
|
|
39010
|
+
};
|
|
39011
|
+
add(referrers, "refs");
|
|
39012
|
+
add(utmSources, "utms");
|
|
39013
|
+
const sum = (rows) => rows.reduce((total, row) => total + row.visitors, 0);
|
|
39014
|
+
const ranked = [...tools.values()].map((tool) => ({
|
|
39015
|
+
...tool,
|
|
39016
|
+
total: sum(tool.refs) + sum(tool.utms)
|
|
39017
|
+
})).sort((a, b) => b.total - a.total || (a.label < b.label ? -1 : a.label > b.label ? 1 : 0));
|
|
39018
|
+
const counted = await Promise.all(ranked.slice(0, MAX_AI_TOOLS).map(async (tool) => {
|
|
39019
|
+
const pairs = tool.refs.flatMap((ref) => tool.utms.map((utm) => ({
|
|
39020
|
+
ref,
|
|
39021
|
+
utm
|
|
39022
|
+
}))).sort((a, b) => Math.min(b.ref.visitors, b.utm.visitors) - Math.min(a.ref.visitors, a.utm.visitors) || (a.ref.value + a.utm.value < b.ref.value + b.utm.value ? -1 : 1));
|
|
39023
|
+
const checked = pairs.slice(0, MAX_AI_PAIRS);
|
|
39024
|
+
const overlaps = await Promise.all(checked.map(async ({ ref, utm }) => (await simpleAnalyticsStats(key, hostname, range, ["visitors"], {
|
|
39025
|
+
...filters,
|
|
39026
|
+
referrer: ref.value,
|
|
39027
|
+
utm_source: utm.value
|
|
39028
|
+
})).visitors ?? 0));
|
|
39029
|
+
return {
|
|
39030
|
+
tool: tool.label,
|
|
39031
|
+
visitors: tool.total - overlaps.reduce((sum, n) => sum + n, 0),
|
|
39032
|
+
referrers: tool.refs.map((row) => row.value),
|
|
39033
|
+
utmSources: tool.utms.map((row) => row.value),
|
|
39034
|
+
exact: pairs.length <= MAX_AI_PAIRS
|
|
39035
|
+
};
|
|
39036
|
+
}));
|
|
39037
|
+
const full = (rows) => rows.length >= SIMPLE_ANALYTICS_LIMIT;
|
|
39038
|
+
return {
|
|
39039
|
+
hostname: stats.hostname,
|
|
39040
|
+
timezone: stats.timezone,
|
|
39041
|
+
range,
|
|
39042
|
+
visitors: stats.visitors ?? 0,
|
|
39043
|
+
pageviews: stats.pageviews ?? 0,
|
|
39044
|
+
pages: [...stats.pages].sort(byVisitors),
|
|
39045
|
+
referrers,
|
|
39046
|
+
utmSources,
|
|
39047
|
+
ai: {
|
|
39048
|
+
visitors: counted.reduce((total, tool) => total + tool.visitors, 0),
|
|
39049
|
+
tools: counted,
|
|
39050
|
+
notCounted: Math.max(0, ranked.length - MAX_AI_TOOLS)
|
|
39051
|
+
},
|
|
39052
|
+
capped: {
|
|
39053
|
+
pages: full(stats.pages),
|
|
39054
|
+
referrers: full(stats.referrers),
|
|
39055
|
+
utmSources: full(stats.utm_sources)
|
|
39056
|
+
}
|
|
39057
|
+
};
|
|
39058
|
+
}
|
|
39059
|
+
async function firstPeriod(site, read) {
|
|
39060
|
+
for (const hostname of hostsOf(site)) try {
|
|
39061
|
+
return await read(hostname);
|
|
39062
|
+
} catch (error) {
|
|
39063
|
+
if (error instanceof SimpleAnalyticsError && error.code === "not_found") continue;
|
|
39064
|
+
throw error;
|
|
39065
|
+
}
|
|
39066
|
+
return null;
|
|
39067
|
+
}
|
|
39068
|
+
function pageFilter(pages) {
|
|
39069
|
+
return pages?.startsWith("/") ? { pages: `${pages.replace(/\*+$/u, "")}*` } : {};
|
|
39070
|
+
}
|
|
39071
|
+
const top = (rows) => rows.slice(0, TOP).map((row) => `${row.value} ${row.visitors}`).join("; ");
|
|
39072
|
+
const aiNotes = (period) => [
|
|
39073
|
+
period.ai.tools.some((tool) => !tool.exact) ? `${period.ai.tools.filter((tool) => !tool.exact).map((tool) => tool.tool).join(", ")} came in more referrer and utm_source pairs than were checked, so a visitor with both can count twice there.` : "",
|
|
39074
|
+
period.ai.notCounted ? `${period.ai.notCounted} more AI ${period.ai.notCounted === 1 ? "tool is" : "tools are"} left out of this count.` : "",
|
|
39075
|
+
period.capped.referrers || period.capped.utmSources ? `A referrer or utm_source list reached Simple Analytics' ${SIMPLE_ANALYTICS_LIMIT}-row limit, so AI tools past it are missing, not zero.` : ""
|
|
39076
|
+
].filter(Boolean);
|
|
39077
|
+
const VISITORS_NOTE = "Visitors are Simple Analytics’ own count: a pageview with no referrer or one from another site, which it also counts as a visit. They are not Google Analytics sessions or users, or Search Console clicks.";
|
|
39078
|
+
const zoneNote = (period) => period.timezone ? `Days are in the website’s time zone, ${period.timezone}.` : "";
|
|
39079
|
+
const failure = (error) => error instanceof Error ? error.message : String(error);
|
|
39080
|
+
async function simpleAnalyticsBeside(keys, site, range, before, pages) {
|
|
39081
|
+
const key = keys ? simpleAnalyticsKey(keys) : null;
|
|
39082
|
+
if (!key) return null;
|
|
39083
|
+
const filters = pageFilter(pages);
|
|
39084
|
+
try {
|
|
39085
|
+
const now = await firstPeriod(site, (hostname) => readPeriod(key, hostname, range, filters, false));
|
|
39086
|
+
if (!now) return null;
|
|
39087
|
+
const then = await readPeriod(key, now.hostname, before, filters, false);
|
|
39088
|
+
const merged = (a, b, name) => {
|
|
39089
|
+
const rows = /* @__PURE__ */ new Map();
|
|
39090
|
+
for (const row of a) {
|
|
39091
|
+
const entry = rows.get(name(row)) ?? {
|
|
39092
|
+
visitors: 0,
|
|
39093
|
+
previousVisitors: 0
|
|
39094
|
+
};
|
|
39095
|
+
entry.visitors += row.visitors;
|
|
39096
|
+
rows.set(name(row), entry);
|
|
39097
|
+
}
|
|
39098
|
+
for (const row of b) {
|
|
39099
|
+
const entry = rows.get(name(row)) ?? {
|
|
39100
|
+
visitors: 0,
|
|
39101
|
+
previousVisitors: 0
|
|
39102
|
+
};
|
|
39103
|
+
entry.previousVisitors += row.visitors;
|
|
39104
|
+
rows.set(name(row), entry);
|
|
39105
|
+
}
|
|
39106
|
+
return [...rows].map(([key, entry]) => ({
|
|
39107
|
+
name: key,
|
|
39108
|
+
...entry
|
|
39109
|
+
})).sort((x, y) => y.visitors - x.visitors || y.previousVisitors - x.previousVisitors || (x.name < y.name ? -1 : x.name > y.name ? 1 : 0));
|
|
39110
|
+
};
|
|
39111
|
+
const was = (rows) => rows.slice(0, TOP).map((row) => `${row.name} ${row.visitors} (was ${row.previousVisitors})`).join(", ");
|
|
39112
|
+
const referrers = merged(now.referrers, then.referrers, (row) => row.value);
|
|
39113
|
+
const tools = merged(now.ai.tools, then.ai.tools, (row) => row.tool);
|
|
39114
|
+
const scope = filters.pages ? `, pages whose path starts with "${pages}"` : "";
|
|
39115
|
+
const notes = [
|
|
39116
|
+
VISITORS_NOTE,
|
|
39117
|
+
zoneNote(now),
|
|
39118
|
+
pages && !filters.pages ? `Simple Analytics narrows only to paths that start with some text, so these numbers cover the whole site, not pages containing "${pages}".` : "",
|
|
39119
|
+
now.capped.referrers || then.capped.referrers ? `The referrer list reached Simple Analytics' ${SIMPLE_ANALYTICS_LIMIT}-row limit, so referrers past it are missing, not zero.` : ""
|
|
39120
|
+
].filter(Boolean);
|
|
39121
|
+
return {
|
|
39122
|
+
text: `${[
|
|
39123
|
+
`Simple Analytics, website ${now.hostname}${scope}: visitors ${now.visitors} (was ${then.visitors}, ${change$2(pct(now.visitors, then.visitors))}), pageviews ${now.pageviews} (was ${then.pageviews}, ${change$2(pct(now.pageviews, then.pageviews))}).`,
|
|
39124
|
+
referrers.length ? `Top referrers (visitors): ${was(referrers)}.` : "",
|
|
39125
|
+
...notes
|
|
39126
|
+
].filter(Boolean).join(" ")}\n\n${[
|
|
39127
|
+
now.ai.visitors || then.ai.visitors ? `Visitors from AI assistants in Simple Analytics (referrers and utm_source tags, a visitor with both counted once): ${now.ai.visitors} (was ${then.ai.visitors}, ${change$2(pct(now.ai.visitors, then.ai.visitors))}). By tool: ${was(tools)}.` : now.capped.referrers || now.capped.utmSources ? "Visitors from AI assistants in Simple Analytics: none among the referrers and utm_source tags it listed, but a list reached its row limit, so this is unknown, not zero." : "Visitors from AI assistants in Simple Analytics: none in either period.",
|
|
39128
|
+
.../* @__PURE__ */ new Set([...aiNotes(now), ...aiNotes(then)]),
|
|
39129
|
+
"Only visits that pass a referrer or utm_source count; AI apps that send neither show as direct."
|
|
39130
|
+
].join(" ")}`,
|
|
39131
|
+
data: {
|
|
39132
|
+
hostname: now.hostname,
|
|
39133
|
+
timezone: now.timezone,
|
|
39134
|
+
...filters.pages ? { pathStartsWith: pages } : {},
|
|
39135
|
+
metric: "visitors",
|
|
39136
|
+
visitors: now.visitors,
|
|
39137
|
+
previousVisitors: then.visitors,
|
|
39138
|
+
visitorsChangePct: pct(now.visitors, then.visitors),
|
|
39139
|
+
pageviews: now.pageviews,
|
|
39140
|
+
previousPageviews: then.pageviews,
|
|
39141
|
+
referrers: referrers.map(({ name, ...row }) => ({
|
|
39142
|
+
referrer: name,
|
|
39143
|
+
...row
|
|
39144
|
+
})),
|
|
39145
|
+
aiAssistants: {
|
|
39146
|
+
visitors: now.ai.visitors,
|
|
39147
|
+
previousVisitors: then.ai.visitors,
|
|
39148
|
+
visitorsChangePct: pct(now.ai.visitors, then.ai.visitors),
|
|
39149
|
+
byTool: tools.map(({ name, ...row }) => ({
|
|
39150
|
+
tool: name,
|
|
39151
|
+
...row
|
|
39152
|
+
})),
|
|
39153
|
+
tools: now.ai.tools,
|
|
39154
|
+
previousTools: then.ai.tools
|
|
39155
|
+
},
|
|
39156
|
+
capped: {
|
|
39157
|
+
now: now.capped,
|
|
39158
|
+
before: then.capped
|
|
39159
|
+
},
|
|
39160
|
+
notes
|
|
39161
|
+
}
|
|
39162
|
+
};
|
|
39163
|
+
} catch (error) {
|
|
39164
|
+
return {
|
|
39165
|
+
text: `Simple Analytics: could not be read. ${failure(error)}`,
|
|
39166
|
+
data: { error: failure(error) }
|
|
39167
|
+
};
|
|
39168
|
+
}
|
|
39169
|
+
}
|
|
39170
|
+
async function runSimpleAnalyticsRows(input, keys, options) {
|
|
39171
|
+
const key = simpleAnalyticsKey(keys);
|
|
39172
|
+
if (!key) throw new CommandError("NO_KEY", `No Simple Analytics API key is saved. Add one: ${options.connect}`);
|
|
39173
|
+
let range;
|
|
39174
|
+
if (!input.startDate && !input.endDate) {
|
|
39175
|
+
const end = Date.now() - DAY;
|
|
39176
|
+
range = {
|
|
39177
|
+
startDate: isoDay(end - 27 * DAY),
|
|
39178
|
+
endDate: isoDay(end)
|
|
39179
|
+
};
|
|
39180
|
+
} else if (!input.startDate || !input.endDate || !(Date.parse(input.startDate) <= Date.parse(input.endDate))) throw new CommandError("INVALID_INPUT", "Send a start date and an end date together, in order.");
|
|
39181
|
+
else range = {
|
|
39182
|
+
startDate: input.startDate,
|
|
39183
|
+
endDate: input.endDate
|
|
39184
|
+
};
|
|
39185
|
+
let period;
|
|
39186
|
+
try {
|
|
39187
|
+
period = await firstPeriod(input.site, (hostname) => readPeriod(key, hostname, range, {}, true));
|
|
39188
|
+
} catch (error) {
|
|
39189
|
+
throw new CommandError(error instanceof SimpleAnalyticsError && error.code === "auth" ? "NO_ACCESS" : "PROVIDER_ERROR", error instanceof SimpleAnalyticsError && error.code === "auth" ? `${error.message} Save it again: ${options.connect}` : failure(error));
|
|
39190
|
+
}
|
|
39191
|
+
if (!period) throw new CommandError("NO_ACCESS", `Simple Analytics has no website ${hostsOf(input.site).join(" or ")} for this API key.`);
|
|
39192
|
+
const offset = input.offset ?? 0;
|
|
39193
|
+
const rows = period.pages.filter((row) => row.visitors > 0).map((row) => ({
|
|
39194
|
+
page: row.value,
|
|
39195
|
+
visitors: row.visitors,
|
|
39196
|
+
pageviews: row.pageviews
|
|
39197
|
+
}));
|
|
39198
|
+
const notes = [
|
|
39199
|
+
`Visitors ${period.visitors}, pageviews ${period.pageviews} in all. A page’s visitors are the visits that started on it; pages with pageviews but no visitors are left out.`,
|
|
39200
|
+
VISITORS_NOTE,
|
|
39201
|
+
zoneNote(period),
|
|
39202
|
+
period.referrers.length ? `Referrers (visitors): ${top(period.referrers)}.` : "Referrers: none in this range.",
|
|
39203
|
+
period.utmSources.length ? `utm_source tags (visitors): ${top(period.utmSources)}.` : "",
|
|
39204
|
+
period.ai.visitors ? `Visitors from AI assistants (referrers and utm_source tags, a visitor with both counted once): ${period.ai.visitors}. By tool: ${period.ai.tools.map((tool) => `${tool.tool} ${tool.visitors}`).join(", ")}.` : "Visitors from AI assistants: none among the referrers and utm_source tags listed.",
|
|
39205
|
+
...aiNotes(period),
|
|
39206
|
+
period.capped.pages ? `Simple Analytics returned its ${SIMPLE_ANALYTICS_LIMIT}-row limit of pages; pages past it are missing, not zero.` : ""
|
|
39207
|
+
].filter(Boolean);
|
|
39208
|
+
return {
|
|
39209
|
+
text: rowsText({
|
|
39210
|
+
title: `Simple Analytics website ${period.hostname}: landing pages, ${range.startDate} to ${range.endDate}.`,
|
|
39211
|
+
rows,
|
|
39212
|
+
offset,
|
|
39213
|
+
limit: 50,
|
|
39214
|
+
detail: input.detail ?? "summary",
|
|
39215
|
+
notes,
|
|
39216
|
+
more: options.call
|
|
39217
|
+
}),
|
|
39218
|
+
data: {
|
|
39219
|
+
hostname: period.hostname,
|
|
39220
|
+
timezone: period.timezone,
|
|
39221
|
+
range,
|
|
39222
|
+
metric: "visitors",
|
|
39223
|
+
visitors: period.visitors,
|
|
39224
|
+
pageviews: period.pageviews,
|
|
39225
|
+
referrers: period.referrers.slice(0, 50),
|
|
39226
|
+
utmSources: period.utmSources.slice(0, 50),
|
|
39227
|
+
aiAssistants: {
|
|
39228
|
+
visitors: period.ai.visitors,
|
|
39229
|
+
tools: period.ai.tools
|
|
39230
|
+
},
|
|
39231
|
+
capped: period.capped.pages,
|
|
39232
|
+
total: rows.length,
|
|
39233
|
+
offset,
|
|
39234
|
+
rows: rows.slice(offset, offset + 50)
|
|
39235
|
+
}
|
|
39236
|
+
};
|
|
39237
|
+
}
|
|
38756
39238
|
// packages/core/src/commands/sitemap-urls.ts
|
|
38757
39239
|
const MAX_FILES = 20;
|
|
38758
39240
|
const MAX_URLS = 5e4;
|
|
@@ -39094,7 +39576,7 @@ function markdownText(markdown, url) {
|
|
|
39094
39576
|
if (!markdown.markdown) return "Main content as Markdown: the page has no main content to read.";
|
|
39095
39577
|
return `Main content as Markdown (live page${markdown.truncated ? `, cut to ${markdown.markdown.length.toLocaleString("en-US")} of ${markdown.characters.toLocaleString("en-US")} characters` : ""}):\n\n${markdown.markdown}`;
|
|
39096
39578
|
}
|
|
39097
|
-
async function runCompare(input, deps) {
|
|
39579
|
+
async function runCompare(input, deps, keys) {
|
|
39098
39580
|
if (!realIsoDate(input.date)) throw new CommandError("INVALID_INPUT", "The date must be a real day as YYYY-MM-DD.");
|
|
39099
39581
|
const last = latestFinalGscDate(deps.now?.() ?? /* @__PURE__ */ new Date());
|
|
39100
39582
|
const daysAfter = Math.round((Date.parse(last) - Date.parse(input.date)) / 864e5) + 1;
|
|
@@ -39108,18 +39590,22 @@ async function runCompare(input, deps) {
|
|
|
39108
39590
|
startDate: shiftIsoDate(input.date, -days),
|
|
39109
39591
|
endDate: shiftIsoDate(input.date, -1)
|
|
39110
39592
|
};
|
|
39111
|
-
const [report, updates, analytics] = await Promise.all([
|
|
39593
|
+
const [report, updates, analytics, clicky, simpleAnalytics] = await Promise.all([
|
|
39112
39594
|
siteOverview(sharedReader(deps.searchAnalytics), input.site, after, before, input.pages),
|
|
39113
39595
|
googleUpdates({
|
|
39114
39596
|
start: before.startDate,
|
|
39115
39597
|
end: after.endDate
|
|
39116
39598
|
}),
|
|
39117
|
-
analyticsBeside(deps.analytics, input.site, after, before, input.pages)
|
|
39599
|
+
analyticsBeside(deps.analytics, input.site, after, before, input.pages),
|
|
39600
|
+
clickyBeside(keys, input.site, after, before, input.pages),
|
|
39601
|
+
simpleAnalyticsBeside(keys, input.site, after, before, input.pages)
|
|
39118
39602
|
]);
|
|
39119
39603
|
return {
|
|
39120
39604
|
text: [
|
|
39121
39605
|
overviewText(report, `Compare on ${input.site}: ${days} days after ${input.date}`, originOf(input.site), 10),
|
|
39122
39606
|
analytics?.text,
|
|
39607
|
+
clicky?.text,
|
|
39608
|
+
simpleAnalytics?.text,
|
|
39123
39609
|
listOfUpdates(updates),
|
|
39124
39610
|
`Next: ${deps.call("page")} for a page that moved.`,
|
|
39125
39611
|
FACTS_ONLY
|
|
@@ -39127,6 +39613,8 @@ async function runCompare(input, deps) {
|
|
|
39127
39613
|
data: {
|
|
39128
39614
|
...report,
|
|
39129
39615
|
...analytics ? { analytics: analytics.data } : {},
|
|
39616
|
+
...clicky ? { clicky: clicky.data } : {},
|
|
39617
|
+
...simpleAnalytics ? { simpleAnalytics: simpleAnalytics.data } : {},
|
|
39130
39618
|
googleUpdates: updates
|
|
39131
39619
|
}
|
|
39132
39620
|
};
|
|
@@ -39433,6 +39921,31 @@ function opportunityLines(site) {
|
|
|
39433
39921
|
" - Searches, CPC and intent are DataForSEO estimates, Domain Rating is by Ahrefs, fit with the site is a model classification and \"free tool\" is a guess from the words."
|
|
39434
39922
|
];
|
|
39435
39923
|
}
|
|
39924
|
+
const ENGINE_NAMES = {
|
|
39925
|
+
chatgpt: "ChatGPT search",
|
|
39926
|
+
google_ai_mode: "Google AI Mode",
|
|
39927
|
+
google_ai_overview: "AI Overviews"
|
|
39928
|
+
};
|
|
39929
|
+
function aiAnswerLines(site) {
|
|
39930
|
+
const found = site.ai_answers;
|
|
39931
|
+
if (!found) return [];
|
|
39932
|
+
if (found.blocked) return [`- AI answers: ${sentence(found.blocked)}`];
|
|
39933
|
+
if (!found.checked_at) return [];
|
|
39934
|
+
const day = (ms) => dayLabel(new Date(ms).toISOString().slice(0, 10));
|
|
39935
|
+
const { counts } = found;
|
|
39936
|
+
const answers = Object.values(counts).reduce((sum, n) => sum + n, 0);
|
|
39937
|
+
const unknown = [counts.unavailable ? `${count(counts.unavailable)} unavailable` : "", counts.pending ? `${count(counts.pending)} not ready yet` : ""].filter(Boolean);
|
|
39938
|
+
const engines = list(Object.values(ENGINE_NAMES));
|
|
39939
|
+
const lines = [`- AI answers, checked ${day(found.checked_at)}: ${plural$1(found.questions.length, "question")} from Search Console asked in ${engines}. Cited in ${count(counts.cited)} of ${plural$1(answers, "answer")}, mentioned by name in ${count(counts.mentioned)}, neither in ${count(counts.neither)}, no AI answer shown in ${count(counts.no_answer)}${unknown.length ? `, ${list(unknown)}` : ""}.`];
|
|
39940
|
+
if (found.previous_checked_at) {
|
|
39941
|
+
const shown = found.changes.slice(0, 10);
|
|
39942
|
+
const label = (result) => result.replace("_", " ");
|
|
39943
|
+
lines.push(shown.length ? ` - Changed since ${day(found.previous_checked_at)}:` : ` - No answer changed since ${day(found.previous_checked_at)}${counts.unavailable || counts.pending ? " among the ones known both weeks" : ""}.`, ...shown.map((change) => ` - "${change.question}" in ${ENGINE_NAMES[change.engine] ?? change.engine}: ${label(change.from)}, now ${label(change.to)}${change.cited_url ? ` (${change.cited_url})` : ""}.`), ...found.changes.length > shown.length ? [` - And ${plural$1(found.changes.length - shown.length, "more")}.`] : []);
|
|
39944
|
+
}
|
|
39945
|
+
if (found.cited_sites.length) lines.push(` - Sites cited instead: ${found.cited_sites.slice(0, 5).map((item) => `${item.host} (${item.answers})`).join(", ")}.`);
|
|
39946
|
+
lines.push(" - Each answer is one sample that can change from run to run, so one week’s change is not a trend.");
|
|
39947
|
+
return lines;
|
|
39948
|
+
}
|
|
39436
39949
|
function measuredLines(site) {
|
|
39437
39950
|
const found = site.measured;
|
|
39438
39951
|
if (!found?.total) return [];
|
|
@@ -39467,7 +39980,7 @@ function weekMarkdown(data) {
|
|
|
39467
39980
|
"",
|
|
39468
39981
|
attention.length ? total === 1 ? "Your site had changes worth a look this week." : `${attention.length} of your ${total} sites had changes worth a look this week.` : quiet.length ? total === 1 ? "Your site had a quiet week." : quiet.length === total ? `All ${total} of your sites had a quiet week.` : `${quiet.length} of your ${total} sites had a quiet week.` : "Your sites are still on their first checks."
|
|
39469
39982
|
];
|
|
39470
|
-
for (const { site, found } of rows) out.push("", `## ${siteName(site.property)}${found.length ? `: ${list(found.map((item) => item.heading))}` : ""}`, "", ...siteLines(site, startMs, endMs, data.first).map((line) => `- ${line}`), ...opportunityLines(site), ...measuredLines(site), ...updateLines(site), ...site.link ? [`- [View site](${site.link})`] : []);
|
|
39983
|
+
for (const { site, found } of rows) out.push("", `## ${siteName(site.property)}${found.length ? `: ${list(found.map((item) => item.heading))}` : ""}`, "", ...siteLines(site, startMs, endMs, data.first).map((line) => `- ${line}`), ...opportunityLines(site), ...aiAnswerLines(site), ...measuredLines(site), ...updateLines(site), ...site.link ? [`- [View site](${site.link})`] : []);
|
|
39471
39984
|
return out.join("\n");
|
|
39472
39985
|
}
|
|
39473
39986
|
async function runAllSites(deps, sites) {
|
|
@@ -39514,7 +40027,8 @@ const DATA_SOURCES = [
|
|
|
39514
40027
|
"search_console",
|
|
39515
40028
|
"google_analytics",
|
|
39516
40029
|
"bing",
|
|
39517
|
-
"clicky"
|
|
40030
|
+
"clicky",
|
|
40031
|
+
"simple_analytics"
|
|
39518
40032
|
];
|
|
39519
40033
|
function tool(spec) {
|
|
39520
40034
|
return spec;
|
|
@@ -39523,6 +40037,7 @@ const listSites$1 = async (surface) => runSites({
|
|
|
39523
40037
|
accounts: await surface.accounts(),
|
|
39524
40038
|
keys: await surface.keys(),
|
|
39525
40039
|
clicky: clickySites(await surface.keys()).map(clickyLabel),
|
|
40040
|
+
simpleAnalytics: Boolean(simpleAnalyticsKey(await surface.keys())),
|
|
39526
40041
|
signIn: surface.signIn,
|
|
39527
40042
|
bing: surface.deps.bing ? await surface.deps.bing() : void 0,
|
|
39528
40043
|
connect: surface.connect
|
|
@@ -39651,7 +40166,7 @@ const SHARED_TOOLS = [
|
|
|
39651
40166
|
name: "seo_compare",
|
|
39652
40167
|
command: "compare",
|
|
39653
40168
|
title: "Before and after a date",
|
|
39654
|
-
description: "Compares equal periods before and after a date, such as a site change or a Google update: totals, devices, and the pages and queries that moved, Google Analytics sessions from the property whose web stream matches the site, and Google updates in the window. Optional pages narrows it to URLs that contain that text, such as /blog/.",
|
|
40169
|
+
description: "Compares equal periods before and after a date, such as a site change or a Google update: totals, devices, and the pages and queries that moved, Google Analytics sessions from the property whose web stream matches the site, Clicky visits from a saved Clicky site with the same domain, Simple Analytics visitors when an API key is saved and it has the site, and Google updates in the window. Optional pages narrows it to URLs that contain that text, such as /blog/.",
|
|
39655
40170
|
input: z.object({
|
|
39656
40171
|
site,
|
|
39657
40172
|
date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).describe("YYYY-MM-DD: the first day after the change."),
|
|
@@ -39661,7 +40176,7 @@ const SHARED_TOOLS = [
|
|
|
39661
40176
|
site: await surface.resolveSite(input.site),
|
|
39662
40177
|
date: input.date,
|
|
39663
40178
|
pages: input.pages
|
|
39664
|
-
}, surface.deps)
|
|
40179
|
+
}, surface.deps, await surface.keys())
|
|
39665
40180
|
}),
|
|
39666
40181
|
tool({
|
|
39667
40182
|
name: "seo_index",
|
|
@@ -39735,10 +40250,10 @@ const SHARED_TOOLS = [
|
|
|
39735
40250
|
name: "seo_data",
|
|
39736
40251
|
command: "data",
|
|
39737
40252
|
title: "Raw rows",
|
|
39738
|
-
description: `Raw rows for questions the report does not answer. search_console (default): rows for any dimensions, each with the previous period and the change; page and query narrow to rows whose URL or query contains that text; page_regex, query_regex and exclude_query_regex take RE2 regexes for custom cuts. google_analytics: landing pages for visits from search, with Google Analytics’ own metric names. bing: Bing Webmaster query or page rows (first dimension) for the same site, by week. clicky: landing-page visits, traffic sources and search engines from a Clicky site the person saved (site is its domain or Clicky site ID; at most 31 days).`,
|
|
40253
|
+
description: `Raw rows for questions the report does not answer. search_console (default): rows for any dimensions, each with the previous period and the change; page and query narrow to rows whose URL or query contains that text; page_regex, query_regex and exclude_query_regex take RE2 regexes for custom cuts. google_analytics: landing pages for visits from search, with Google Analytics’ own metric names. bing: Bing Webmaster query or page rows (first dimension) for the same site, by week. clicky: landing-page visits, traffic sources and search engines from a Clicky site the person saved (site is its domain or Clicky site ID; at most 31 days). simple_analytics: landing-page visitors, referrers, utm_source tags and AI tools from Simple Analytics with the API key the person saved (site is its domain).`,
|
|
39739
40254
|
input: z.object({
|
|
39740
40255
|
source: z.enum(DATA_SOURCES).default("search_console"),
|
|
39741
|
-
site: z.string().min(1).describe("search_console and bing: the property or site. google_analytics: numeric property id from seo_sites. clicky: the site or its Clicky site ID."),
|
|
40256
|
+
site: z.string().min(1).describe("search_console and bing: the property or site. google_analytics: numeric property id from seo_sites. clicky: the site or its Clicky site ID. simple_analytics: the site domain."),
|
|
39742
40257
|
dimensions: z.array(z.enum(DIMENSIONS)).max(4).default(["query"]).describe("search_console; bing uses the first, query or page."),
|
|
39743
40258
|
page: z.string().min(1).optional().describe("search_console only: URL text, such as /blog/."),
|
|
39744
40259
|
query: z.string().min(1).optional().describe("search_console only: query text."),
|
|
@@ -39749,6 +40264,16 @@ const SHARED_TOOLS = [
|
|
|
39749
40264
|
...detail
|
|
39750
40265
|
}),
|
|
39751
40266
|
run: async (surface, input) => {
|
|
40267
|
+
if (input.source === "simple_analytics") return runSimpleAnalyticsRows({
|
|
40268
|
+
site: input.site,
|
|
40269
|
+
startDate: input.start_date,
|
|
40270
|
+
endDate: input.end_date,
|
|
40271
|
+
detail: input.detail,
|
|
40272
|
+
offset: input.offset
|
|
40273
|
+
}, await surface.keys(), {
|
|
40274
|
+
connect: surface.connect,
|
|
40275
|
+
call: (offset) => `seo_data with source "simple_analytics", site "${input.site}", detail "rows", offset ${offset}`
|
|
40276
|
+
});
|
|
39752
40277
|
if (input.source === "clicky") return runClickyRows({
|
|
39753
40278
|
site: input.site,
|
|
39754
40279
|
startDate: input.start_date,
|
|
@@ -40078,6 +40603,35 @@ async function deleteDataForSeoCredentials() {
|
|
|
40078
40603
|
await deleteProviderSecret(DATAFORSEO_CREDENTIAL_SECRET);
|
|
40079
40604
|
clearLegacyConfigCredentials();
|
|
40080
40605
|
}
|
|
40606
|
+
// packages/core/src/simple-analytics/credentials.ts
|
|
40607
|
+
const SIMPLE_ANALYTICS_KEY_ENV = "SEO_SIMPLE_ANALYTICS_KEY";
|
|
40608
|
+
const SECRET = PROVIDER_SECRET_NAMES.simpleAnalyticsKey;
|
|
40609
|
+
function checked(value) {
|
|
40610
|
+
const key = value.trim();
|
|
40611
|
+
if (!isSimpleAnalyticsKey(key)) throw new ProviderError({
|
|
40612
|
+
provider: "simple-analytics",
|
|
40613
|
+
operation: "credentials",
|
|
40614
|
+
code: "configuration",
|
|
40615
|
+
message: "Simple Analytics needs an API key that starts with sa_api_key_ (Account settings, API keys)."
|
|
40616
|
+
});
|
|
40617
|
+
return key;
|
|
40618
|
+
}
|
|
40619
|
+
async function readSimpleAnalyticsKey() {
|
|
40620
|
+
const saved = await readProviderSecret({
|
|
40621
|
+
name: SECRET,
|
|
40622
|
+
envVar: SIMPLE_ANALYTICS_KEY_ENV
|
|
40623
|
+
});
|
|
40624
|
+
return saved ? {
|
|
40625
|
+
key: checked(saved.value),
|
|
40626
|
+
source: saved.source
|
|
40627
|
+
} : void 0;
|
|
40628
|
+
}
|
|
40629
|
+
async function writeSimpleAnalyticsKey(value) {
|
|
40630
|
+
return writeProviderSecret(SECRET, checked(value));
|
|
40631
|
+
}
|
|
40632
|
+
async function deleteSimpleAnalyticsKey() {
|
|
40633
|
+
await deleteProviderSecret(SECRET);
|
|
40634
|
+
}
|
|
40081
40635
|
// packages/core/src/storage/issues.ts
|
|
40082
40636
|
const issuesFile = () => join(getSeoCliPaths().configDir, "issues.json");
|
|
40083
40637
|
function readFile$1() {
|
|
@@ -40176,10 +40730,11 @@ async function localAccounts() {
|
|
|
40176
40730
|
}));
|
|
40177
40731
|
}
|
|
40178
40732
|
async function localResearchKeys() {
|
|
40179
|
-
const [dataForSeo, ahrefs, clicky, saved] = await Promise.all([
|
|
40733
|
+
const [dataForSeo, ahrefs, clicky, simpleAnalytics, saved] = await Promise.all([
|
|
40180
40734
|
readDataForSeoCredentials().catch(() => void 0),
|
|
40181
40735
|
readAhrefsApiKey().catch(() => void 0),
|
|
40182
40736
|
readClickySiteKeys().catch(() => ({})),
|
|
40737
|
+
readSimpleAnalyticsKey().catch(() => void 0),
|
|
40183
40738
|
cloudLinked() ? cloudKeys().catch(() => ({})) : {}
|
|
40184
40739
|
]);
|
|
40185
40740
|
const keys = new Headers(saved);
|
|
@@ -40192,6 +40747,7 @@ async function localResearchKeys() {
|
|
|
40192
40747
|
keys.set("x-dataforseo-password", dataForSeo.password);
|
|
40193
40748
|
}
|
|
40194
40749
|
if (ahrefs?.apiKey) keys.set("x-ahrefs-key", ahrefs.apiKey);
|
|
40750
|
+
if (simpleAnalytics) keys.set(SIMPLE_ANALYTICS_KEY, simpleAnalytics.key);
|
|
40195
40751
|
return keys;
|
|
40196
40752
|
}
|
|
40197
40753
|
const TYPESAFE_API_KEY_ENV = "TYPESAFE_API_KEY";
|
|
@@ -42783,6 +43339,6 @@ function isoDate(daysAgo = 0) {
|
|
|
42783
43339
|
date.setUTCDate(date.getUTCDate() - daysAgo);
|
|
42784
43340
|
return date.toISOString().slice(0, 10);
|
|
42785
43341
|
}
|
|
42786
|
-
export { AHREFS_API_KEY_ENV, AHREFS_API_KEY_SECRET, AI_REFERRAL_SOURCES, AI_REFERRAL_SOURCES_VERSION, ANALYTICS_PROVIDER_IDS, AUDIT_PAGE_RULE_IDS, AhrefsClient, BING_API_KEY_ENV, BING_API_KEY_SECRET, BROWSER_USER_AGENT, CANNIBAL_MAXIMUM_DOMINANT_SHARE, CANNIBAL_MINIMUM_PAGE_IMPRESSIONS, CANNIBAL_MINIMUM_PAGE_SHARE, CLICKY_SITEKEY_ENV, CLICKY_SITE_KEYS_SECRET, CLOUD_SIGN_IN, CLOUD_URL, CRAWL_SKIP_REASONS, CTR_DEFAULT_LIMIT, CTR_MAX_LIMIT, CTR_MAX_MIN_IMPRESSIONS, DATAFORSEO_CREDENTIAL_SECRET, DATAFORSEO_LOGIN_ENV, DATAFORSEO_PASSWORD_ENV, DEFAULT_MAX_PAGES, DEFAULT_SEARCH_CONSOLE_EXPORT_ROW_LIMIT, DEFAULT_UNREACHED_PAGE_LIMIT, DataForSeoClient, DecisionModelError, DecisionRunner, GOOGLE_TIMEOUT_MS, GSC_FINAL_DATA_LAG_DAYS, GSC_TIME_ZONE, GoogleApiError, INCIDENTS_URL, JsonFileStorageAdapter, LINK_ROLES, LINT_MAX_FILES, LOCAL_BING_CONNECT, LOCAL_SIGN_IN, LOG_MAX_AGE_MS, LOG_MAX_FILE_BYTES, LOG_MAX_TOTAL_BYTES, LocalCredentialsProvider, MANAGED_PROVIDER_SECRET_NAMES, MAX_CRAWL_CONCURRENCY, MAX_CRAWL_DEPTH, MAX_CRAWL_PAGES, MAX_CRAWL_TIMEOUT_MS, MAX_MAX_PAGES, MAX_SEARCH_CONSOLE_EXPORT_FILES, MAX_SEARCH_CONSOLE_EXPORT_ROW_LIMIT, PAGE_TYPES, PROVIDER_ERROR_CODES, PROVIDER_SECRET_NAMES, ProviderError, ProviderExtensionRegistry, RESEARCH_IMPORT_COLUMN_KEYS, ResponseSizeLimitError, SEARCH_INTENTS, SEO_CRAWLER_IDENTITY, SEO_CRAWLER_TOKEN, SEO_CRAWLER_USER_AGENT, SEO_PROVIDER_API_VERSION, SEO_VERSION, SERP_TITLE_REFERENCE_WIDTH_PX, SERP_TITLE_WIDTH_PROFILE, SITEMAP_FILE_URL_LIMIT, SITE_CHECK_MAX_ISSUES, SITE_CHECK_MAX_PAGES, SITE_FACTS_DEFAULT_CONCURRENCY, SITE_FACTS_MAX_CONCURRENCY, SITE_FACTS_MAX_SITES, SITE_FACTS_TIMEOUT_MS, STEP_CHANGE_RULES, SeoError, ServiceAccountAccessTokenClient, SessionLedger, TELEMETRY_AGENTS, TELEMETRY_ENDPOINT, TELEMETRY_ERROR_CATEGORIES, TELEMETRY_EVENTS, TELEMETRY_FAILURE_CONTEXTS, TELEMETRY_FAILURE_REASONS, TELEMETRY_NOTICE, TELEMETRY_OPERATIONS, TELEMETRY_REPORTS, TELEMETRY_SCHEMA_VERSION, TELEMETRY_TIMEOUT_MS, TYPESAFE_API_KEY_ENV, URL_INSPECTION_TIMEOUT_MS, agentActionsView, aiReferralSourceForValue, aiReferralsReport, analyticsConnectionLabel, analyticsConnectionProviderId, analyticsConnectionSchema, analyticsProviderDetails, analyticsProviderSchema, analyzeAiReferralRows, analyzeCannibalImportRows, analyzeCannibalRows, analyzeCtrUnderperformersFromRows, analyzeDecay, analyzeIndexCoverageSignals, analyzePageOpportunitiesFromRows, analyzeQueryClustersFromRows, analyzeQuickWinsFromRows, analyzeSecondPageRows, analyzeSegmentRows, analyzeStrikingDistanceRows, analyzeTrafficAnomalyRows, assertCrawlConfigLimits, assertUrlMatchesGscProperty, auditCrawlPages, auditCrawlRequests, auditPage, authStatus, bearerFetch, boundedSitemapInventory, buildAgentFindings, buildQueryClusterReportFromRows, buildTelemetryPayload, builtPagePath, cacheDb, cannibalDataStatus, cannibalImportReport, cannibalReport, cannibalReportWith, changeWindow, checkBuiltSite, checkDatabaseReadiness, checkSites, classifyTelemetryFailure, clearCache, cloudAccountFor, cloudBing, cloudCredentials, cloudGoogleEmails, cloudGoogleToken, cloudKeys, cloudLinked, cloudLogout, cloudWeek, clusterQueryRows, combineRobotsValues, compareSegmentRows, configSchema, contentCoverageRecommendation, contentCoverageType, contentOptimizationFromPageOpportunities, contentOptimizationReport, countLabel, crawlConfigHash, crawlConfigSchema, crawlCoverageCaveat, crawlDefinitionId, crawlFixToQueueItem, crawlImplementationQueueWorkflow, crawlIssueGroupSchema, crawlIssueSchema, crawlOne, crawlPageSnapshotSchema, crawlReportSchema, crawlReportSummarySchema, crawlRequestObservationSchema, crawlRunId, crawlSite, crawlSkipImpact, crawlSkipReasonCountsFromRecord, crawlStatusOnly, crawlTopFixSchema, crawlerJsonSchemas, crawlerRuleCategorySchema, crawlerRuleIdSchema, crawlerRuleInfoSchema, crawlerRuleRecommendationSchema, crawlerRuleSeveritySchema, crawlerSchemas, createAuthorizedClient, createCrawlReport, createCtrBenchmarkContext, createGoogleAccessTokenClient, createLogger, createPageRenderer, ctrUnderperformersReport, ctrUnderperformersReportWith, decayClusterDrafts, decayComparisonRange, decayingReport, decayingReportWith, deleteAhrefsApiKey, deleteBingApiKey, deleteClickySiteKey, deleteDataForSeoCredentials, deleteManagedProviderSecrets, deleteProviderExtensionAccount, deleteProviderExtensionCredentials, deleteProviderSecret, deleteTokens, deriveBrandTerms, describeInstalledProviderExtension, detectAgentName, detectBrandTerms, detectTelemetryAgent, diagnoseCsvFiles, diagnoseProperty, diagnosePropertyWorkflow, effectiveRobotsDirectives, effectiveSnippetControl, ensurePrivateDatabaseFiles, ensureSeoCliDirs, estimateSerpTitleWidth, expectedCtrForPosition, explainRule, fetchCruxFieldData, fetchFailureKind, fetchPage, fetchPageStatus, fetchSearchStatusIncidents, fetchSitemapUrls, fileSize, finalGscDateRange, findOverlappingSearchUpdates, finishCloudLogin, formatRelativeExpiry, ga4MatchReason, ga4PropertyIdFromName, ga4ReportQualityWarnings, ga4RequestCanUseCache, ga4RowsToObjects, getAuthModeStatus, getCacheStats, getClientConfig, getDb, getPrivacySnapshot, getSeoCliPaths, getServiceAccountConfig, getServiceAccountStatus, getTelemetryStatus, getTokenStorageStatus, googleJson, groupCrawlIssues, hasMetaRobotsDirective, hasRule, hasXRobotsDirective, hashKey, indexCoverageSignals, inferTemplateMovement, initializeTelemetry, inspectProviderPackage, inspectSearchConsoleUrl, inspectUrl, installProviderPackage, installedProviderPackageSchema, installedProviderPackagesSchema, installedProviderSerp, internalLinksReport, internalLinksReportWith, interpretUpdateCorrelation, isBrandQuery, isNewerVersion, isSkippableReportError, isTelemetryCi, isTelemetryOperation, isTelemetryReport, isoDate, isoWeek, latestFinalGscDate, linkRecover, linkRecoverRecommendation, lintPaths, listAnalyticsAccounts, listAnalyticsDataStreams, listGa4AccountSummaries, listGa4DataStreams, listGoogleAccounts, listInstalledProviderExtensions, listRules, listSearchConsoleSites, listSearchUpdates, listSites, loadInstalledProviderExtensions, loadProviderExtensions, loadProviderPackage, loadSearchConsoleExport, localAccounts, localBing, localCredentialsProvider, localError, localGoogleFetch, localInternalLinksDependencies, localRefreshClicky, localResearchKeys, localResearchStore, loginWithLoopback, makeRunId, matchGa4WebStreams, measureCoverage, metaRobotsDirectives, migrateLegacyMacConfig, missingOAuthClientMessage, missingSharedClientLoginMessage, nodeCommandDeps, normalizeBrandText, normalizeClickySiteId, normalizeClickySiteKey, normalizeCrawlConfig, normalizeCrawlSkipReasonCounts, normalizeForCoverage, normalizeHttpUrl, normalizeJavaScriptRenderingMode, normalizeLoadedCrawlReport, normalizeProviderExtensionAccount, normalizedResearchColumnName, notSignedIn, noteCacheWrite, openCloudLink, pageEvidenceRecommendation, pageOpportunitiesReport, parseOlderThan, pendingCloudLogin, performanceAudit, performanceReportIsCacheable, plural, providerCapabilitySchema, providerConnectionFieldSchema, providerExactVersionSchema, providerExtensionIdSchema, providerIdSchema, providerIntegritySchema, providerKindSchema, providerPackageManifestSchema, providerPackageNameSchema, providerPreferenceSchema, providerRegistrationSchema, providerRequestJson, providerRequestText, pruneLogs, publicHttpFetch, queryClusterReport, queryClusterTokens, queryContentCoverageFromPage, queryContentFieldsFromPage, queryFieldCoverage, queryOpportunityRecommendation, queryPageMetrics, queryPageTopQuery, queryPagesMetrics, queryPagesMetricsBatch, queryPagesTopQueries, queryPagesTopQueriesBatch, querySearchAnalytics, quickWinsCsvRows, quickWinsReport, quickWinsReportWith, readAhrefsApiKey, readAllTokens, readBingApiKey, readBoundedResponseText, readClickySiteKey, readClickySiteKeys, readConfig, readDataForSeoCredentials, readInstalledProviderPackages, readJson, readJsonOrUndefined, readLintFiles, readOauthClient, readProviderExtensionAccount, readProviderExtensionCredentials, readProviderSecret, readTokens, recommendationForRule, reconcileExportPagesWithCrawl, redirectTrace, refreshAuthToken, refreshPrioritiesCsvFiles, refreshPrioritiesWorkflow, registrableDomain, removeInstalledProviderPackage, renderCrawlCsv, renderCrawlHtml, renderCrawlJunit, renderCrawlMarkdownTickets, renderCrawlPagesCsv, renderCrawlPretty, renderCsv, renderPresentationTablesMarkdown, renderWorkflowMarkdown, reportNarrative, requestHeaders, requirePageVerification, researchImportColumns, resetSeoData, resolveLocalSite, resolveSegmentRanges, resolveSeoCliPaths, reviewObservations, roundedPosition, runAnalyticsProviderLandingPages, runAnalyticsReport, runDoctor, runGa4Report, runProviderExtensionAction, runtimeForProvider, safeProviderAdapterError, saveInstalledProviderPackage, searchAnalyticsRows, searchUpdatesFromIncidents, secondPage, secondPageWith, segmentComparisonRange, segmentImpact, segmentRangeDays, seoErrorEnvelope, sessionSourceInListFilter, setActiveGoogleAccount, setTelemetryEnabled, setTokenStorageMode, shiftIsoDate, shouldExcludeBrandQuery, siteStartUrl, snapshotFetchedPage, startCloudLogin, strikingDistance, strikingDistanceWith, summarizeCrawlReport, pageTechnicalSignals as technicalPageSignals, telemetryErrorCategory, toSeoError, tokenSchema, tokenStoreSchema, topFixes, trackTelemetryCommandFailed, trackTelemetryReportComplete, trackTelemetryReportFailed, trackTelemetryReportStart, trackTelemetrySetupComplete, trafficAnomaly, trafficAnomalyWith, typesafeDecisionModel, unavailableSegmentImpactReport, unicodeTokens, uninstallProviderExtension, updateCorrelation, updateNotice, updatePostmortemCsvFiles, updatePostmortemWorkflow, urlInspectionQuota, validateResearchImportColumnSources, verifyAnalyticsProvider, verifyProviderExtension, verifyQueryContent, verifyQueryContentWith, withAgentReportContract, withRankingHistory, withinGoogleTimeout, workflowPresentation, writeAhrefsApiKey, writeBingApiKey, writeClickySiteKey, writeConfig, writeDataForSeoCredentials, writeInstalledProviderPackages, writeOauthClient, writeProviderExtensionAccount, writeProviderExtensionCredentials, writeProviderSecret, writeToCache, writeTokens, xRobotsDirectives };
|
|
43342
|
+
export { AHREFS_API_KEY_ENV, AHREFS_API_KEY_SECRET, AI_REFERRAL_SOURCES, AI_REFERRAL_SOURCES_VERSION, ANALYTICS_PROVIDER_IDS, AUDIT_PAGE_RULE_IDS, AhrefsClient, BING_API_KEY_ENV, BING_API_KEY_SECRET, BROWSER_USER_AGENT, CANNIBAL_MAXIMUM_DOMINANT_SHARE, CANNIBAL_MINIMUM_PAGE_IMPRESSIONS, CANNIBAL_MINIMUM_PAGE_SHARE, CLICKY_SITEKEY_ENV, CLICKY_SITE_KEYS_SECRET, CLOUD_SIGN_IN, CLOUD_URL, CRAWL_SKIP_REASONS, CTR_DEFAULT_LIMIT, CTR_MAX_LIMIT, CTR_MAX_MIN_IMPRESSIONS, DATAFORSEO_CREDENTIAL_SECRET, DATAFORSEO_LOGIN_ENV, DATAFORSEO_PASSWORD_ENV, DEFAULT_MAX_PAGES, DEFAULT_SEARCH_CONSOLE_EXPORT_ROW_LIMIT, DEFAULT_UNREACHED_PAGE_LIMIT, DataForSeoClient, DecisionModelError, DecisionRunner, GOOGLE_TIMEOUT_MS, GSC_FINAL_DATA_LAG_DAYS, GSC_TIME_ZONE, GoogleApiError, INCIDENTS_URL, JsonFileStorageAdapter, LINK_ROLES, LINT_MAX_FILES, LOCAL_BING_CONNECT, LOCAL_SIGN_IN, LOG_MAX_AGE_MS, LOG_MAX_FILE_BYTES, LOG_MAX_TOTAL_BYTES, LocalCredentialsProvider, MANAGED_PROVIDER_SECRET_NAMES, MAX_CRAWL_CONCURRENCY, MAX_CRAWL_DEPTH, MAX_CRAWL_PAGES, MAX_CRAWL_TIMEOUT_MS, MAX_MAX_PAGES, MAX_SEARCH_CONSOLE_EXPORT_FILES, MAX_SEARCH_CONSOLE_EXPORT_ROW_LIMIT, PAGE_TYPES, PROVIDER_ERROR_CODES, PROVIDER_SECRET_NAMES, ProviderError, ProviderExtensionRegistry, RESEARCH_IMPORT_COLUMN_KEYS, ResponseSizeLimitError, SEARCH_INTENTS, SEO_CRAWLER_IDENTITY, SEO_CRAWLER_TOKEN, SEO_CRAWLER_USER_AGENT, SEO_PROVIDER_API_VERSION, SEO_VERSION, SERP_TITLE_REFERENCE_WIDTH_PX, SERP_TITLE_WIDTH_PROFILE, SIMPLE_ANALYTICS_KEY_ENV, SITEMAP_FILE_URL_LIMIT, SITE_CHECK_MAX_ISSUES, SITE_CHECK_MAX_PAGES, SITE_FACTS_DEFAULT_CONCURRENCY, SITE_FACTS_MAX_CONCURRENCY, SITE_FACTS_MAX_SITES, SITE_FACTS_TIMEOUT_MS, STEP_CHANGE_RULES, SeoError, ServiceAccountAccessTokenClient, SessionLedger, TELEMETRY_AGENTS, TELEMETRY_ENDPOINT, TELEMETRY_ERROR_CATEGORIES, TELEMETRY_EVENTS, TELEMETRY_FAILURE_CONTEXTS, TELEMETRY_FAILURE_REASONS, TELEMETRY_NOTICE, TELEMETRY_OPERATIONS, TELEMETRY_REPORTS, TELEMETRY_SCHEMA_VERSION, TELEMETRY_TIMEOUT_MS, TYPESAFE_API_KEY_ENV, URL_INSPECTION_TIMEOUT_MS, agentActionsView, aiReferralSourceForValue, aiReferralsReport, analyticsConnectionLabel, analyticsConnectionProviderId, analyticsConnectionSchema, analyticsProviderDetails, analyticsProviderSchema, analyzeAiReferralRows, analyzeCannibalImportRows, analyzeCannibalRows, analyzeCtrUnderperformersFromRows, analyzeDecay, analyzeIndexCoverageSignals, analyzePageOpportunitiesFromRows, analyzeQueryClustersFromRows, analyzeQuickWinsFromRows, analyzeSecondPageRows, analyzeSegmentRows, analyzeStrikingDistanceRows, analyzeTrafficAnomalyRows, assertCrawlConfigLimits, assertUrlMatchesGscProperty, auditCrawlPages, auditCrawlRequests, auditPage, authStatus, bearerFetch, boundedSitemapInventory, buildAgentFindings, buildQueryClusterReportFromRows, buildTelemetryPayload, builtPagePath, cacheDb, cannibalDataStatus, cannibalImportReport, cannibalReport, cannibalReportWith, changeWindow, checkBuiltSite, checkDatabaseReadiness, checkSites, classifyTelemetryFailure, clearCache, cloudAccountFor, cloudBing, cloudCredentials, cloudGoogleEmails, cloudGoogleToken, cloudKeys, cloudLinked, cloudLogout, cloudWeek, clusterQueryRows, combineRobotsValues, compareSegmentRows, configSchema, contentCoverageRecommendation, contentCoverageType, contentOptimizationFromPageOpportunities, contentOptimizationReport, countLabel, crawlConfigHash, crawlConfigSchema, crawlCoverageCaveat, crawlDefinitionId, crawlFixToQueueItem, crawlImplementationQueueWorkflow, crawlIssueGroupSchema, crawlIssueSchema, crawlOne, crawlPageSnapshotSchema, crawlReportSchema, crawlReportSummarySchema, crawlRequestObservationSchema, crawlRunId, crawlSite, crawlSkipImpact, crawlSkipReasonCountsFromRecord, crawlStatusOnly, crawlTopFixSchema, crawlerJsonSchemas, crawlerRuleCategorySchema, crawlerRuleIdSchema, crawlerRuleInfoSchema, crawlerRuleRecommendationSchema, crawlerRuleSeveritySchema, crawlerSchemas, createAuthorizedClient, createCrawlReport, createCtrBenchmarkContext, createGoogleAccessTokenClient, createLogger, createPageRenderer, ctrUnderperformersReport, ctrUnderperformersReportWith, decayClusterDrafts, decayComparisonRange, decayingReport, decayingReportWith, deleteAhrefsApiKey, deleteBingApiKey, deleteClickySiteKey, deleteDataForSeoCredentials, deleteManagedProviderSecrets, deleteProviderExtensionAccount, deleteProviderExtensionCredentials, deleteProviderSecret, deleteSimpleAnalyticsKey, deleteTokens, deriveBrandTerms, describeInstalledProviderExtension, detectAgentName, detectBrandTerms, detectTelemetryAgent, diagnoseCsvFiles, diagnoseProperty, diagnosePropertyWorkflow, effectiveRobotsDirectives, effectiveSnippetControl, ensurePrivateDatabaseFiles, ensureSeoCliDirs, estimateSerpTitleWidth, expectedCtrForPosition, explainRule, fetchCruxFieldData, fetchFailureKind, fetchPage, fetchPageStatus, fetchSearchStatusIncidents, fetchSitemapUrls, fileSize, finalGscDateRange, findOverlappingSearchUpdates, finishCloudLogin, formatRelativeExpiry, ga4MatchReason, ga4PropertyIdFromName, ga4ReportQualityWarnings, ga4RequestCanUseCache, ga4RowsToObjects, getAuthModeStatus, getCacheStats, getClientConfig, getDb, getPrivacySnapshot, getSeoCliPaths, getServiceAccountConfig, getServiceAccountStatus, getTelemetryStatus, getTokenStorageStatus, googleJson, groupCrawlIssues, hasMetaRobotsDirective, hasRule, hasXRobotsDirective, hashKey, indexCoverageSignals, inferTemplateMovement, initializeTelemetry, inspectProviderPackage, inspectSearchConsoleUrl, inspectUrl, installProviderPackage, installedProviderPackageSchema, installedProviderPackagesSchema, installedProviderSerp, internalLinksReport, internalLinksReportWith, interpretUpdateCorrelation, isBrandQuery, isNewerVersion, isSkippableReportError, isTelemetryCi, isTelemetryOperation, isTelemetryReport, isoDate, isoWeek, latestFinalGscDate, linkRecover, linkRecoverRecommendation, lintPaths, listAnalyticsAccounts, listAnalyticsDataStreams, listGa4AccountSummaries, listGa4DataStreams, listGoogleAccounts, listInstalledProviderExtensions, listRules, listSearchConsoleSites, listSearchUpdates, listSites, loadInstalledProviderExtensions, loadProviderExtensions, loadProviderPackage, loadSearchConsoleExport, localAccounts, localBing, localCredentialsProvider, localError, localGoogleFetch, localInternalLinksDependencies, localRefreshClicky, localResearchKeys, localResearchStore, loginWithLoopback, makeRunId, matchGa4WebStreams, measureCoverage, metaRobotsDirectives, migrateLegacyMacConfig, missingOAuthClientMessage, missingSharedClientLoginMessage, nodeCommandDeps, normalizeBrandText, normalizeClickySiteId, normalizeClickySiteKey, normalizeCrawlConfig, normalizeCrawlSkipReasonCounts, normalizeForCoverage, normalizeHttpUrl, normalizeJavaScriptRenderingMode, normalizeLoadedCrawlReport, normalizeProviderExtensionAccount, normalizedResearchColumnName, notSignedIn, noteCacheWrite, openCloudLink, pageEvidenceRecommendation, pageOpportunitiesReport, parseOlderThan, pendingCloudLogin, performanceAudit, performanceReportIsCacheable, plural, providerCapabilitySchema, providerConnectionFieldSchema, providerExactVersionSchema, providerExtensionIdSchema, providerIdSchema, providerIntegritySchema, providerKindSchema, providerPackageManifestSchema, providerPackageNameSchema, providerPreferenceSchema, providerRegistrationSchema, providerRequestJson, providerRequestText, pruneLogs, publicHttpFetch, queryClusterReport, queryClusterTokens, queryContentCoverageFromPage, queryContentFieldsFromPage, queryFieldCoverage, queryOpportunityRecommendation, queryPageMetrics, queryPageTopQuery, queryPagesMetrics, queryPagesMetricsBatch, queryPagesTopQueries, queryPagesTopQueriesBatch, querySearchAnalytics, quickWinsCsvRows, quickWinsReport, quickWinsReportWith, readAhrefsApiKey, readAllTokens, readBingApiKey, readBoundedResponseText, readClickySiteKey, readClickySiteKeys, readConfig, readDataForSeoCredentials, readInstalledProviderPackages, readJson, readJsonOrUndefined, readLintFiles, readOauthClient, readProviderExtensionAccount, readProviderExtensionCredentials, readProviderSecret, readSimpleAnalyticsKey, readTokens, recommendationForRule, reconcileExportPagesWithCrawl, redirectTrace, refreshAuthToken, refreshPrioritiesCsvFiles, refreshPrioritiesWorkflow, registrableDomain, removeInstalledProviderPackage, renderCrawlCsv, renderCrawlHtml, renderCrawlJunit, renderCrawlMarkdownTickets, renderCrawlPagesCsv, renderCrawlPretty, renderCsv, renderPresentationTablesMarkdown, renderWorkflowMarkdown, reportNarrative, requestHeaders, requirePageVerification, researchImportColumns, resetSeoData, resolveLocalSite, resolveSegmentRanges, resolveSeoCliPaths, reviewObservations, roundedPosition, runAnalyticsProviderLandingPages, runAnalyticsReport, runDoctor, runGa4Report, runProviderExtensionAction, runtimeForProvider, safeProviderAdapterError, saveInstalledProviderPackage, searchAnalyticsRows, searchUpdatesFromIncidents, secondPage, secondPageWith, segmentComparisonRange, segmentImpact, segmentRangeDays, seoErrorEnvelope, sessionSourceInListFilter, setActiveGoogleAccount, setTelemetryEnabled, setTokenStorageMode, shiftIsoDate, shouldExcludeBrandQuery, siteStartUrl, snapshotFetchedPage, startCloudLogin, strikingDistance, strikingDistanceWith, summarizeCrawlReport, pageTechnicalSignals as technicalPageSignals, telemetryErrorCategory, toSeoError, tokenSchema, tokenStoreSchema, topFixes, trackTelemetryCommandFailed, trackTelemetryReportComplete, trackTelemetryReportFailed, trackTelemetryReportStart, trackTelemetrySetupComplete, trafficAnomaly, trafficAnomalyWith, typesafeDecisionModel, unavailableSegmentImpactReport, unicodeTokens, uninstallProviderExtension, updateCorrelation, updateNotice, updatePostmortemCsvFiles, updatePostmortemWorkflow, urlInspectionQuota, validateResearchImportColumnSources, verifyAnalyticsProvider, verifyProviderExtension, verifyQueryContent, verifyQueryContentWith, withAgentReportContract, withRankingHistory, withinGoogleTimeout, workflowPresentation, writeAhrefsApiKey, writeBingApiKey, writeClickySiteKey, writeConfig, writeDataForSeoCredentials, writeInstalledProviderPackages, writeOauthClient, writeProviderExtensionAccount, writeProviderExtensionCredentials, writeProviderSecret, writeSimpleAnalyticsKey, writeToCache, writeTokens, xRobotsDirectives };
|
|
42787
43343
|
|
|
42788
43344
|
//# sourceMappingURL=index.js.map
|