@gscdump/cli 0.18.5 → 0.19.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/README.md +1 -1
- package/dist/index.mjs +17 -3
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -200,7 +200,7 @@ gscdump auth login --no-browser
|
|
|
200
200
|
- [`gscdump`](../gscdump) — Core library: GSC API client + query builder + analytics pipeline.
|
|
201
201
|
- [`@gscdump/engine`](../engine) — Storage engine the CLI syncs into.
|
|
202
202
|
- [`@gscdump/analysis`](../analysis) — SEO analyzers (row-based + DuckDB-native).
|
|
203
|
-
- [`@gscdump/nuxt
|
|
203
|
+
- [`@gscdump/nuxt`](../nuxt) — Nuxt layer for embedding analytics dashboards.
|
|
204
204
|
|
|
205
205
|
## License
|
|
206
206
|
|
package/dist/index.mjs
CHANGED
|
@@ -122,7 +122,7 @@ function loadEnvFromCwd() {
|
|
|
122
122
|
}
|
|
123
123
|
return applied;
|
|
124
124
|
}
|
|
125
|
-
var version = "0.
|
|
125
|
+
var version = "0.19.1";
|
|
126
126
|
const ALL_SEARCH_TYPES$1 = Object.values(SearchTypes);
|
|
127
127
|
const VERSION = version;
|
|
128
128
|
function noSubcommandSelected(parent, subNames) {
|
|
@@ -2721,6 +2721,20 @@ async function compactClosedMonths(store, siteUrl, quiet) {
|
|
|
2721
2721
|
}
|
|
2722
2722
|
const INSPECTION_QPD_PER_PROPERTY = 2e3;
|
|
2723
2723
|
const INDEXING_NOT_FOUND_RE = /\b404\b|NOT_FOUND/i;
|
|
2724
|
+
const INSPECTION_HISTORY_LOOKBACK_MONTHS = 24;
|
|
2725
|
+
async function findLatestInspection(inspector, ctx, url) {
|
|
2726
|
+
const now = /* @__PURE__ */ new Date();
|
|
2727
|
+
const buckets = [];
|
|
2728
|
+
for (let i = 0; i < INSPECTION_HISTORY_LOOKBACK_MONTHS; i++) {
|
|
2729
|
+
const d = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth() - i, 1));
|
|
2730
|
+
buckets.push(`${d.getUTCFullYear()}-${String(d.getUTCMonth() + 1).padStart(2, "0")}`);
|
|
2731
|
+
}
|
|
2732
|
+
buckets.push("unknown");
|
|
2733
|
+
for (const yearMonth of buckets) {
|
|
2734
|
+
const matches = (await inspector.loadHistory(ctx, yearMonth))?.records.filter((r) => r.url === url) ?? [];
|
|
2735
|
+
if (matches.length > 0) return matches.reduce((a, b) => a.inspectedAt >= b.inspectedAt ? a : b);
|
|
2736
|
+
}
|
|
2737
|
+
}
|
|
2724
2738
|
async function readUrlList(opts) {
|
|
2725
2739
|
if (opts.file) return (await readFile(opts.file, "utf8")).split("\n").map((l) => l.trim()).filter(Boolean);
|
|
2726
2740
|
const chunks = [];
|
|
@@ -2809,7 +2823,7 @@ const inspectSubCommand = defineCommand({
|
|
|
2809
2823
|
if (!quiet) process.stdout.write(`\r${progressBar(completed, urls.length, `${url.slice(0, 60)}`)}`);
|
|
2810
2824
|
});
|
|
2811
2825
|
if (!quiet) process.stdout.write("\n");
|
|
2812
|
-
await inspector.
|
|
2826
|
+
await inspector.appendHistory({
|
|
2813
2827
|
userId: store.userId,
|
|
2814
2828
|
siteId: store.siteIdFor(siteUrl)
|
|
2815
2829
|
}, records);
|
|
@@ -2857,7 +2871,7 @@ const showSubCommand = defineCommand({
|
|
|
2857
2871
|
});
|
|
2858
2872
|
const store = ctx.store;
|
|
2859
2873
|
const siteUrl = await ctx.resolveSite(args.site ? String(args.site) : void 0);
|
|
2860
|
-
const record = await createInspectionStore({ dataSource: store.dataSource })
|
|
2874
|
+
const record = await findLatestInspection(createInspectionStore({ dataSource: store.dataSource }), {
|
|
2861
2875
|
userId: store.userId,
|
|
2862
2876
|
siteId: store.siteIdFor(siteUrl)
|
|
2863
2877
|
}, String(args.url));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gscdump/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.19.1",
|
|
5
5
|
"description": "CLI for Google Search Console - dump, query, and run MCP server",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"google-auth-library": "^10.6.2",
|
|
43
43
|
"ofetch": "^1.5.1",
|
|
44
44
|
"open": "^11.0.0",
|
|
45
|
-
"@gscdump/
|
|
46
|
-
"@gscdump/
|
|
47
|
-
"@gscdump/
|
|
48
|
-
"gscdump": "0.
|
|
49
|
-
"
|
|
45
|
+
"@gscdump/analysis": "0.19.1",
|
|
46
|
+
"@gscdump/engine": "0.19.1",
|
|
47
|
+
"@gscdump/engine-gsc-api": "0.19.1",
|
|
48
|
+
"@gscdump/mcp": "0.19.1",
|
|
49
|
+
"gscdump": "0.19.1"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@duckdb/node-api": "1.5.1-r.2",
|