@gscdump/analysis 3.5.0 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { QueryPageRow, SortOrder } from "../types.mjs";
2
- type CannibalizationSortMetric = 'clicks' | 'impressions' | 'positionSpread' | 'pageCount';
3
- interface CannibalizationOptions {
2
+ export type CannibalizationSortMetric = 'clicks' | 'impressions' | 'positionSpread' | 'pageCount';
3
+ export interface CannibalizationOptions {
4
4
  /** Minimum impressions for a query to be considered. Default: 10 */
5
5
  minImpressions?: number;
6
6
  /** Maximum position spread to flag as cannibalization. Default: 10 */
@@ -12,21 +12,21 @@ interface CannibalizationOptions {
12
12
  /** Sort order. Default: desc */
13
13
  sortOrder?: SortOrder;
14
14
  }
15
- interface CannibalizationPage {
15
+ export interface CannibalizationPage {
16
16
  page: string;
17
17
  clicks: number;
18
18
  impressions: number;
19
19
  ctr: number;
20
20
  position: number;
21
21
  }
22
- interface CannibalizationResult {
22
+ export interface CannibalizationResult {
23
23
  query: string;
24
24
  pages: CannibalizationPage[];
25
25
  totalClicks: number;
26
26
  totalImpressions: number;
27
27
  positionSpread: number;
28
28
  }
29
- interface CannibalizationCompetitor {
29
+ export interface CannibalizationCompetitor {
30
30
  url: string;
31
31
  clicks: number;
32
32
  impressions: number;
@@ -35,7 +35,7 @@ interface CannibalizationCompetitor {
35
35
  share: number;
36
36
  rank: number;
37
37
  }
38
- interface CannibalizationEvent {
38
+ export interface CannibalizationEvent {
39
39
  keyword: string;
40
40
  totalImpressions: number;
41
41
  totalClicks: number;
@@ -54,5 +54,4 @@ interface CannibalizationEvent {
54
54
  * ranking for multiple pages within a small position spread. Re-exported
55
55
  * from `@gscdump/analysis` for portable callers.
56
56
  */
57
- declare function analyzeCannibalization(rows: QueryPageRow[], options?: CannibalizationOptions): CannibalizationResult[];
58
- export { CannibalizationCompetitor, CannibalizationEvent, CannibalizationOptions, CannibalizationPage, CannibalizationResult, CannibalizationSortMetric, analyzeCannibalization };
57
+ export declare function analyzeCannibalization(rows: QueryPageRow[], options?: CannibalizationOptions): CannibalizationResult[];
@@ -1,6 +1,6 @@
1
1
  import { QueriesRow } from "../types.mjs";
2
- type ClusterType = 'prefix' | 'intent' | 'both';
3
- interface ClusteringOptions {
2
+ export type ClusterType = 'prefix' | 'intent' | 'both';
3
+ export interface ClusteringOptions {
4
4
  /** Minimum keywords for a cluster to be reported. Default: 2 */
5
5
  minClusterSize?: number;
6
6
  /** Minimum impressions for a keyword to be included. Default: 10 */
@@ -8,7 +8,7 @@ interface ClusteringOptions {
8
8
  /** Clustering method. Default: 'both' */
9
9
  clusterBy?: ClusterType;
10
10
  }
11
- interface KeywordCluster {
11
+ export interface KeywordCluster {
12
12
  clusterName: string;
13
13
  clusterType: 'prefix' | 'intent';
14
14
  keywords: QueriesRow[];
@@ -17,7 +17,7 @@ interface KeywordCluster {
17
17
  avgPosition: number;
18
18
  keywordCount: number;
19
19
  }
20
- interface ClusteringResult {
20
+ export interface ClusteringResult {
21
21
  clusters: KeywordCluster[];
22
22
  unclustered: QueriesRow[];
23
23
  }
@@ -25,5 +25,4 @@ interface ClusteringResult {
25
25
  * Pure helper: clusters keywords by intent prefix or common word prefix.
26
26
  * Re-exported from `@gscdump/analysis` for portable callers.
27
27
  */
28
- declare function analyzeClustering(keywords: QueriesRow[], options?: ClusteringOptions): ClusteringResult;
29
- export { ClusterType, ClusteringOptions, ClusteringResult, KeywordCluster, analyzeClustering };
28
+ export declare function analyzeClustering(keywords: QueriesRow[], options?: ClusteringOptions): ClusteringResult;
@@ -1,19 +1,19 @@
1
1
  import { PageRow, QueriesRow } from "../types.mjs";
2
- type ConcentrationRiskLevel = 'low' | 'medium' | 'high';
3
- interface ConcentrationOptions {
2
+ export type ConcentrationRiskLevel = 'low' | 'medium' | 'high';
3
+ export interface ConcentrationOptions {
4
4
  /** Number of top items to report. Default: 10 */
5
5
  topN?: number;
6
6
  }
7
- interface ConcentrationItem {
7
+ export interface ConcentrationItem {
8
8
  key: string;
9
9
  clicks: number;
10
10
  share: number;
11
11
  }
12
- interface ConcentrationInput {
12
+ export interface ConcentrationInput {
13
13
  key: string;
14
14
  clicks: number;
15
15
  }
16
- interface ConcentrationResult {
16
+ export interface ConcentrationResult {
17
17
  /** Gini coefficient: 0 = equal distribution, 1 = fully concentrated */
18
18
  giniCoefficient: number;
19
19
  /** Herfindahl-Hirschman Index: 0-10000, >2500 = highly concentrated */
@@ -30,13 +30,12 @@ interface ConcentrationResult {
30
30
  * Pure helper: analyze traffic concentration across items (pages or keywords).
31
31
  * Re-exported from `@gscdump/analysis` for portable callers.
32
32
  */
33
- declare function analyzeConcentration(items: ConcentrationInput[], options?: ConcentrationOptions): ConcentrationResult;
33
+ export declare function analyzeConcentration(items: ConcentrationInput[], options?: ConcentrationOptions): ConcentrationResult;
34
34
  /**
35
35
  * Page concentration analysis.
36
36
  */
37
- declare function analyzePageConcentration(pages: PageRow[], options?: ConcentrationOptions): ConcentrationResult;
37
+ export declare function analyzePageConcentration(pages: PageRow[], options?: ConcentrationOptions): ConcentrationResult;
38
38
  /**
39
39
  * Keyword concentration analysis.
40
40
  */
41
- declare function analyzeKeywordConcentration(keywords: QueriesRow[], options?: ConcentrationOptions): ConcentrationResult;
42
- export { ConcentrationInput, ConcentrationItem, ConcentrationOptions, ConcentrationResult, ConcentrationRiskLevel, analyzeConcentration, analyzeKeywordConcentration, analyzePageConcentration };
41
+ export declare function analyzeKeywordConcentration(keywords: QueriesRow[], options?: ConcentrationOptions): ConcentrationResult;
@@ -1,6 +1,6 @@
1
1
  import { PageRow } from "../types.mjs";
2
- type DecaySortMetric = 'lostClicks' | 'declinePercent' | 'currentClicks';
3
- interface DecayOptions {
2
+ export type DecaySortMetric = 'lostClicks' | 'declinePercent' | 'currentClicks';
3
+ export interface DecayOptions {
4
4
  /** Minimum clicks in previous period to consider. Default: 50 */
5
5
  minPreviousClicks?: number;
6
6
  /** Minimum decline percentage (0-1). Default: 0.2 (20%) */
@@ -8,16 +8,16 @@ interface DecayOptions {
8
8
  /** Metric to sort results by. Default: lostClicks */
9
9
  sortBy?: DecaySortMetric;
10
10
  }
11
- interface DecayInput {
11
+ export interface DecayInput {
12
12
  current: PageRow[];
13
13
  previous: PageRow[];
14
14
  }
15
- interface DecaySeriesPoint {
15
+ export interface DecaySeriesPoint {
16
16
  week: string;
17
17
  clicks: number;
18
18
  impressions: number;
19
19
  }
20
- interface DecayResult {
20
+ export interface DecayResult {
21
21
  page: string;
22
22
  currentClicks: number;
23
23
  previousClicks: number;
@@ -34,5 +34,4 @@ interface DecayResult {
34
34
  * Pure helper: identify "decaying" content — pages that have lost
35
35
  * significant traffic between two periods.
36
36
  */
37
- declare function analyzeDecay(input: DecayInput, options?: DecayOptions): DecayResult[];
38
- export { DecayInput, DecayOptions, DecayResult, DecaySeriesPoint, DecaySortMetric, analyzeDecay };
37
+ export declare function analyzeDecay(input: DecayInput, options?: DecayOptions): DecayResult[];
@@ -1,6 +1,6 @@
1
1
  import { QueriesRow } from "../types.mjs";
2
- type MoversSortMetric = 'clicks' | 'impressions' | 'clicksChange' | 'impressionsChange' | 'positionChange';
3
- interface MoversOptions {
2
+ export type MoversSortMetric = 'clicks' | 'impressions' | 'clicksChange' | 'impressionsChange' | 'positionChange';
3
+ export interface MoversOptions {
4
4
  /** Minimum change threshold to flag. Default: 0.2 (20%) */
5
5
  changeThreshold?: number;
6
6
  /** Minimum impressions in recent period. Default: 50 */
@@ -8,13 +8,13 @@ interface MoversOptions {
8
8
  /** Metric to sort results by. Default: clicksChange */
9
9
  sortBy?: MoversSortMetric;
10
10
  }
11
- interface MoversInput {
11
+ export interface MoversInput {
12
12
  current: QueriesRow[];
13
13
  previous: QueriesRow[];
14
14
  /** If periods have different lengths, provide normalization factor (previous/current) */
15
15
  normalizationFactor?: number;
16
16
  }
17
- interface MoverData {
17
+ export interface MoverData {
18
18
  keyword: string;
19
19
  page: string | null;
20
20
  recentClicks: number;
@@ -30,7 +30,7 @@ interface MoverData {
30
30
  /** `null` unless both recentPosition and baselinePosition exist. */
31
31
  positionChange: number | null;
32
32
  }
33
- interface MoversResult {
33
+ export interface MoversResult {
34
34
  rising: MoverData[];
35
35
  declining: MoverData[];
36
36
  stable: MoverData[];
@@ -39,5 +39,4 @@ interface MoversResult {
39
39
  * Pure helper: identify "movers and shakers" — keywords with significant
40
40
  * recent changes between two periods.
41
41
  */
42
- declare function analyzeMovers(input: MoversInput, options?: MoversOptions): MoversResult;
43
- export { MoverData, MoversInput, MoversOptions, MoversResult, MoversSortMetric, analyzeMovers };
42
+ export declare function analyzeMovers(input: MoversInput, options?: MoversOptions): MoversResult;
@@ -1,11 +1,11 @@
1
1
  import { QueriesRow } from "../types.mjs";
2
- type OpportunitySortMetric = 'opportunityScore' | 'potentialClicks' | 'impressions' | 'position';
3
- interface OpportunityFactors {
2
+ export type OpportunitySortMetric = 'opportunityScore' | 'potentialClicks' | 'impressions' | 'position';
3
+ export interface OpportunityFactors {
4
4
  positionScore: number;
5
5
  impressionScore: number;
6
6
  ctrGapScore: number;
7
7
  }
8
- interface OpportunityResult {
8
+ export interface OpportunityResult {
9
9
  keyword: string;
10
10
  page: string | null;
11
11
  clicks: number;
@@ -16,17 +16,16 @@ interface OpportunityResult {
16
16
  potentialClicks: number;
17
17
  factors: OpportunityFactors;
18
18
  }
19
- interface OpportunityWeights {
19
+ export interface OpportunityWeights {
20
20
  position?: number;
21
21
  impressions?: number;
22
22
  ctrGap?: number;
23
23
  }
24
- interface OpportunityOptions {
24
+ export interface OpportunityOptions {
25
25
  minImpressions?: number;
26
26
  weights?: OpportunityWeights;
27
27
  sortBy?: OpportunitySortMetric;
28
28
  limit?: number;
29
29
  }
30
30
  /** Pure opportunity scorer shared by hosted and package analyzer callers. */
31
- declare function analyzeOpportunity(keywords: QueriesRow[], options?: OpportunityOptions): OpportunityResult[];
32
- export { OpportunityFactors, OpportunityOptions, OpportunityResult, OpportunitySortMetric, OpportunityWeights, analyzeOpportunity };
31
+ export declare function analyzeOpportunity(keywords: QueriesRow[], options?: OpportunityOptions): OpportunityResult[];
@@ -1,17 +1,17 @@
1
1
  import { DateRow } from "../types.mjs";
2
- type SeasonalityMetric = 'clicks' | 'impressions';
3
- interface SeasonalityOptions {
2
+ export type SeasonalityMetric = 'clicks' | 'impressions';
3
+ export interface SeasonalityOptions {
4
4
  /** Metric to analyze for seasonality. Default: clicks */
5
5
  metric?: SeasonalityMetric;
6
6
  }
7
- interface MonthlyData {
7
+ export interface MonthlyData {
8
8
  month: string;
9
9
  value: number;
10
10
  vsAverage: number;
11
11
  isPeak: boolean;
12
12
  isTrough: boolean;
13
13
  }
14
- interface SeasonalityResult {
14
+ export interface SeasonalityResult {
15
15
  hasSeasonality: boolean;
16
16
  /** Coefficient of variation: std dev / mean. Higher = more seasonal. */
17
17
  strength: number;
@@ -24,5 +24,4 @@ interface SeasonalityResult {
24
24
  * Pure helper: detects seasonality patterns by analyzing monthly traffic
25
25
  * variation. Re-exported from `@gscdump/analysis` for portable callers.
26
26
  */
27
- declare function analyzeSeasonality(dates: DateRow[], options?: SeasonalityOptions): SeasonalityResult;
28
- export { MonthlyData, SeasonalityMetric, SeasonalityOptions, SeasonalityResult, analyzeSeasonality };
27
+ export declare function analyzeSeasonality(dates: DateRow[], options?: SeasonalityOptions): SeasonalityResult;
@@ -14,7 +14,7 @@
14
14
  * Row shape both plans produce. Field names match GSC's native columns so
15
15
  * the row-source path needs no rename step; the SQL plan aliases `url → page`.
16
16
  */
17
- interface StrikingDistanceInputRow {
17
+ export interface StrikingDistanceInputRow {
18
18
  query: string;
19
19
  page: string | null;
20
20
  clicks: number;
@@ -22,7 +22,7 @@ interface StrikingDistanceInputRow {
22
22
  ctr: number;
23
23
  position: number;
24
24
  }
25
- interface StrikingDistanceResult {
25
+ export interface StrikingDistanceResult {
26
26
  keyword: string;
27
27
  page: string | null;
28
28
  clicks: number;
@@ -32,23 +32,22 @@ interface StrikingDistanceResult {
32
32
  /** Estimated clicks at ~15% CTR (the average for positions 1–3). */
33
33
  potentialClicks: number;
34
34
  }
35
- interface StrikingDistanceFilterOptions {
35
+ export interface StrikingDistanceFilterOptions {
36
36
  minPosition?: number;
37
37
  maxPosition?: number;
38
38
  minImpressions?: number;
39
39
  maxCtr?: number;
40
40
  }
41
- interface StrikingDistanceOptions extends StrikingDistanceFilterOptions {
41
+ export interface StrikingDistanceOptions extends StrikingDistanceFilterOptions {
42
42
  limit?: number;
43
43
  offset?: number;
44
44
  }
45
45
  /** Pure striking-distance analysis for consumers that already own the rows. */
46
- declare function analyzeStrikingDistance(rows: readonly {
46
+ export declare function analyzeStrikingDistance(rows: readonly {
47
47
  query: unknown;
48
48
  page?: unknown;
49
49
  clicks: unknown;
50
50
  impressions: unknown;
51
51
  ctr: unknown;
52
52
  position: unknown;
53
- }[], options?: StrikingDistanceOptions): StrikingDistanceResult[];
54
- export { StrikingDistanceFilterOptions, StrikingDistanceInputRow, StrikingDistanceOptions, StrikingDistanceResult, analyzeStrikingDistance };
53
+ }[], options?: StrikingDistanceOptions): StrikingDistanceResult[];
@@ -1,5 +1,5 @@
1
1
  import { QueryPageRow } from "../types.mjs";
2
- interface ZeroClickResult {
2
+ export interface ZeroClickResult {
3
3
  query: string;
4
4
  page: string;
5
5
  clicks: number;
@@ -7,11 +7,10 @@ interface ZeroClickResult {
7
7
  ctr: number;
8
8
  position: number;
9
9
  }
10
- interface ZeroClickOptions {
10
+ export interface ZeroClickOptions {
11
11
  minImpressions?: number;
12
12
  maxCtr?: number;
13
13
  maxPosition?: number;
14
14
  }
15
15
  /** Pure zero-click detector shared by hosted and package analyzer callers. */
16
- declare function analyzeZeroClick(rows: QueryPageRow[], options?: ZeroClickOptions): ZeroClickResult[];
17
- export { ZeroClickOptions, ZeroClickResult, analyzeZeroClick };
16
+ export declare function analyzeZeroClick(rows: QueryPageRow[], options?: ZeroClickOptions): ZeroClickResult[];
@@ -1,5 +1,5 @@
1
1
  import { AnalysisParams, AnalysisResult } from "@gscdump/engine/analysis-types";
2
2
  import { AnalyzerRegistry } from "@gscdump/engine/analyzer";
3
3
  import { AttachedTableRunner, AttachedTableRunner as AnalyzerRunner, AttachedTableSourceOptions, AttachedTableSourceOptions as BrowserAnalyzeOptions } from "@gscdump/engine/source";
4
- declare function analyzeInBrowser(runner: AttachedTableRunner, opts: AttachedTableSourceOptions, params: AnalysisParams, registry: AnalyzerRegistry): Promise<AnalysisResult>;
5
- export { type AnalyzerRunner, type BrowserAnalyzeOptions, analyzeInBrowser };
4
+ export declare function analyzeInBrowser(runner: AttachedTableRunner, opts: AttachedTableSourceOptions, params: AnalysisParams, registry: AnalyzerRegistry): Promise<AnalysisResult>;
5
+ export type { AnalyzerRunner, BrowserAnalyzeOptions };
@@ -1,4 +1,4 @@
1
1
  import { ROW_ANALYZERS } from "./analyzer/row-analyzers.mjs";
2
2
  import { SQL_ANALYZERS } from "./sql-analyzers.mjs";
3
- declare const defaultAnalyzerRegistry: import("@gscdump/engine/analyzer").AnalyzerRegistry;
4
- export { ROW_ANALYZERS, SQL_ANALYZERS, defaultAnalyzerRegistry };
3
+ export declare const defaultAnalyzerRegistry: import("@gscdump/engine/analyzer").AnalyzerRegistry;
4
+ export { ROW_ANALYZERS, SQL_ANALYZERS };
package/dist/errors.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- type AnalysisErrorKind = 'missing-report-param' | 'missing-comparison-window' | 'missing-brand-terms' | 'unknown-report' | 'unknown-analyzer' | 'required-step-failed';
2
- type AnalysisError = {
1
+ export type AnalysisErrorKind = 'missing-report-param' | 'missing-comparison-window' | 'missing-brand-terms' | 'unknown-report' | 'unknown-analyzer' | 'required-step-failed';
2
+ export type AnalysisError = {
3
3
  kind: 'missing-report-param';
4
4
  report: string;
5
5
  param: string;
@@ -28,7 +28,7 @@ type AnalysisError = {
28
28
  message: string;
29
29
  cause?: unknown;
30
30
  };
31
- declare const analysisErrors: {
31
+ export declare const analysisErrors: {
32
32
  readonly missingReportParam: (report: string, param: string, message: string) => AnalysisError;
33
33
  readonly missingComparisonWindow: (report: string, message: string) => AnalysisError;
34
34
  readonly missingBrandTerms: () => AnalysisError;
@@ -36,9 +36,9 @@ declare const analysisErrors: {
36
36
  readonly unknownAnalyzer: (analyzer: string) => AnalysisError;
37
37
  readonly requiredStepFailed: (report: string, stepKey: string, stepError: string, cause?: unknown) => AnalysisError;
38
38
  };
39
- declare function isAnalysisError(value: unknown): value is AnalysisError;
39
+ export declare function isAnalysisError(value: unknown): value is AnalysisError;
40
40
  /** The human-readable rendering of an `AnalysisError`, for logs and string sinks. */
41
- declare function formatAnalysisError(error: AnalysisError): string;
41
+ export declare function formatAnalysisError(error: AnalysisError): string;
42
42
  /**
43
43
  * Re-raises an `AnalysisError` value as a generic `Error`, stashing the union
44
44
  * under `.analysisError` for stack-walking and preserving the original `cause`
@@ -48,5 +48,4 @@ declare function formatAnalysisError(error: AnalysisError): string;
48
48
  * assertions (`/--target/`, `/comparison window/`, `/required step "k"/`)
49
49
  * continue to match.
50
50
  */
51
- declare function analysisErrorToException(error: AnalysisError): Error;
52
- export { AnalysisError, AnalysisErrorKind, analysisErrorToException, analysisErrors, formatAnalysisError, isAnalysisError };
51
+ export declare function analysisErrorToException(error: AnalysisError): Error;
@@ -1,6 +1,6 @@
1
- declare const INTENT_CLASSIFIER_VERSION = 1;
2
- type SearchIntent = 'transactional' | 'commercial' | 'informational' | 'unknown';
3
- interface IntentClassification {
1
+ export declare const INTENT_CLASSIFIER_VERSION = 1;
2
+ export type SearchIntent = 'transactional' | 'commercial' | 'informational' | 'unknown';
3
+ export interface IntentClassification {
4
4
  /** Primary intent, by priority transactional > commercial > informational. */
5
5
  intent: SearchIntent;
6
6
  /** Procedural sub-signal of informational ("how to …"). */
@@ -8,13 +8,12 @@ interface IntentClassification {
8
8
  /** Matched cue tokens/phrases, for explainability + debugging. */
9
9
  signals: readonly string[];
10
10
  }
11
- declare const SEARCH_INTENT_CODE: Record<SearchIntent, number>;
11
+ export declare const SEARCH_INTENT_CODE: Record<SearchIntent, number>;
12
12
  /** Pack a classification into one small int for cheap dimension storage. */
13
- declare function encodeIntent(c: Pick<IntentClassification, 'intent' | 'howTo'>): number;
13
+ export declare function encodeIntent(c: Pick<IntentClassification, 'intent' | 'howTo'>): number;
14
14
  /**
15
15
  * Classify the search intent of a raw query from lexical cues. Deterministic;
16
16
  * version it (`INTENT_CLASSIFIER_VERSION`) and bump on any rule change so a
17
17
  * materialized `intent` can detect staleness, like the canonical normalizer.
18
18
  */
19
- declare function classifyQueryIntent(query: string): IntentClassification;
20
- export { INTENT_CLASSIFIER_VERSION, IntentClassification, SEARCH_INTENT_CODE, SearchIntent, classifyQueryIntent, encodeIntent };
19
+ export declare function classifyQueryIntent(query: string): IntentClassification;
@@ -6,10 +6,9 @@
6
6
  * v2 adds Unicode folding, the empty-canonical guard, and `pluralize`-based
7
7
  * singularization.
8
8
  */
9
- declare const NORMALIZER_VERSION = 2;
9
+ export declare const NORMALIZER_VERSION = 2;
10
10
  /**
11
11
  * Produce a canonical form of a search query for grouping near-duplicates.
12
12
  * Idempotent: `normalizeQuery(normalizeQuery(q)) === normalizeQuery(q)`.
13
13
  */
14
- declare function normalizeQuery(query: string): string;
15
- export { NORMALIZER_VERSION, normalizeQuery };
14
+ export declare function normalizeQuery(query: string): string;
@@ -1,7 +1,6 @@
1
1
  import { ReportResult } from "@gscdump/engine/report";
2
- interface FormatReportOptions {
2
+ export interface FormatReportOptions {
3
3
  /** Cap findings rendered per section. Defaults to all (already bounded by report). */
4
4
  maxFindingsPerSection?: number;
5
5
  }
6
- declare function formatReport(report: ReportResult, opts?: FormatReportOptions): string;
7
- export { FormatReportOptions, formatReport };
6
+ export declare function formatReport(report: ReportResult, opts?: FormatReportOptions): string;
@@ -1,4 +1,3 @@
1
1
  import { DefinedReport, ReportParams } from "@gscdump/engine/report";
2
- declare const REPORTS: readonly DefinedReport<ReportParams>[];
3
- declare const defaultReportRegistry: import("@gscdump/engine/report").ReportRegistry;
4
- export { REPORTS, defaultReportRegistry };
2
+ export declare const REPORTS: readonly DefinedReport<ReportParams>[];
3
+ export declare const defaultReportRegistry: import("@gscdump/engine/report").ReportRegistry;
@@ -6,8 +6,8 @@
6
6
  * Today: case-insensitive exact match, falling back to substring (LIKE %x%)
7
7
  * over a caller-supplied candidate list.
8
8
  */
9
- type ResolveTargetKind = 'page' | 'query';
10
- interface ResolveTargetInput {
9
+ export type ResolveTargetKind = 'page' | 'query';
10
+ export interface ResolveTargetInput {
11
11
  kind: ResolveTargetKind;
12
12
  input: string;
13
13
  /**
@@ -17,7 +17,7 @@ interface ResolveTargetInput {
17
17
  */
18
18
  candidates?: readonly string[];
19
19
  }
20
- interface ResolveTargetResult {
20
+ export interface ResolveTargetResult {
21
21
  /** Best exact match from `candidates` (case-insensitive), or trusted input when no candidates were supplied. */
22
22
  exact: string | null;
23
23
  /** All candidates that include the input as a substring (case-insensitive). Includes `exact` if matched. */
@@ -25,5 +25,4 @@ interface ResolveTargetResult {
25
25
  /** True when no candidates matched at all. */
26
26
  unresolved: boolean;
27
27
  }
28
- declare function resolveTarget(opts: ResolveTargetInput): ResolveTargetResult;
29
- export { ResolveTargetInput, ResolveTargetKind, ResolveTargetResult, resolveTarget };
28
+ export declare function resolveTarget(opts: ResolveTargetInput): ResolveTargetResult;
@@ -3,7 +3,7 @@ import { AnalyzerRegistry } from "@gscdump/engine/analyzer";
3
3
  import { Result } from "gscdump/result";
4
4
  import { AnalysisQuerySource } from "@gscdump/engine/source";
5
5
  import { DefinedReport, ReportContext, ReportParams, ReportResult } from "@gscdump/engine/report";
6
- interface RunReportOptions<P extends ReportParams = ReportParams> {
6
+ export interface RunReportOptions<P extends ReportParams = ReportParams> {
7
7
  source: AnalysisQuerySource;
8
8
  analyzers: AnalyzerRegistry;
9
9
  ctx: ReportContext<P>;
@@ -26,7 +26,7 @@ interface RunReportOptions<P extends ReportParams = ReportParams> {
26
26
  * defects from this core's perspective and still propagate; those are modelled
27
27
  * at the report-definition boundary, not here.
28
28
  */
29
- declare function runReportResult<P extends ReportParams = ReportParams>(report: DefinedReport<P>, opts: RunReportOptions<P>): Promise<Result<ReportResult, AnalysisError>>;
29
+ export declare function runReportResult<P extends ReportParams = ReportParams>(report: DefinedReport<P>, opts: RunReportOptions<P>): Promise<Result<ReportResult, AnalysisError>>;
30
30
  /**
31
31
  * Throwing wrapper over {@link runReportResult}, preserving the historical
32
32
  * call-site ergonomics (a required-step failure rejects). The thrown message is
@@ -34,8 +34,8 @@ declare function runReportResult<P extends ReportParams = ReportParams>(report:
34
34
  * assertions hold; the typed `AnalysisError` is reachable via `.analysisError`
35
35
  * and the original failure via `.cause`.
36
36
  */
37
- declare function runReport<P extends ReportParams = ReportParams>(report: DefinedReport<P>, opts: RunReportOptions<P>): Promise<ReportResult>;
38
- interface DryRunReportResult {
37
+ export declare function runReport<P extends ReportParams = ReportParams>(report: DefinedReport<P>, opts: RunReportOptions<P>): Promise<ReportResult>;
38
+ export interface DryRunReportResult {
39
39
  steps: {
40
40
  key: string;
41
41
  type: string;
@@ -52,5 +52,4 @@ interface DryRunReportResult {
52
52
  * cost models don't exist yet — so `estRowsScanned` is left undefined.
53
53
  * Useful right now only as an "is this report wired up correctly?" check.
54
54
  */
55
- declare function dryRunReport<P extends ReportParams = ReportParams>(report: DefinedReport<P>, ctx: ReportContext<P>): Promise<DryRunReportResult>;
56
- export { DryRunReportResult, RunReportOptions, dryRunReport, runReport, runReportResult };
55
+ export declare function dryRunReport<P extends ReportParams = ReportParams>(report: DefinedReport<P>, ctx: ReportContext<P>): Promise<DryRunReportResult>;
@@ -1,23 +1,23 @@
1
- interface SitemapHealthRow {
1
+ export interface SitemapHealthRow {
2
2
  path: string;
3
3
  errors: number;
4
4
  warnings: number;
5
5
  }
6
- interface SitemapHealthInput extends SitemapHealthRow {
6
+ export interface SitemapHealthInput extends SitemapHealthRow {
7
7
  isPending?: boolean;
8
8
  type?: string;
9
9
  contents?: Array<{
10
10
  submitted: number | string;
11
11
  }>;
12
12
  }
13
- interface SitemapDelta {
13
+ export interface SitemapDelta {
14
14
  path: string;
15
15
  errorDelta: number;
16
16
  warningDelta: number;
17
17
  newErrors: number;
18
18
  newWarnings: number;
19
19
  }
20
- interface SitemapHealthTotals {
20
+ export interface SitemapHealthTotals {
21
21
  totalSitemaps: number;
22
22
  totalUrls: number;
23
23
  totalErrors: number;
@@ -25,33 +25,32 @@ interface SitemapHealthTotals {
25
25
  pendingCount: number;
26
26
  indexSitemaps: number;
27
27
  }
28
- interface SitemapHealthDiff {
28
+ export interface SitemapHealthDiff {
29
29
  changed: boolean;
30
30
  deltas: SitemapDelta[];
31
31
  totals: SitemapHealthTotals;
32
32
  }
33
- interface SitemapCollapsePolicy {
33
+ export interface SitemapCollapsePolicy {
34
34
  ratio: number;
35
35
  minHighWater: number;
36
36
  minDrop: number;
37
37
  baselineOffset: 1 | 2;
38
38
  }
39
- declare const SITEMAP_SYNC_COLLAPSE_POLICY: SitemapCollapsePolicy;
40
- declare const SITEMAP_TRUST_COLLAPSE_POLICY: SitemapCollapsePolicy;
41
- type SitemapCollapseState = {
39
+ export declare const SITEMAP_SYNC_COLLAPSE_POLICY: SitemapCollapsePolicy;
40
+ export declare const SITEMAP_TRUST_COLLAPSE_POLICY: SitemapCollapsePolicy;
41
+ export type SitemapCollapseState = {
42
42
  _tag: 'none';
43
43
  } | {
44
44
  _tag: 'awaiting_confirmation' | 'persisted' | 'recovered_blip';
45
45
  current: number;
46
46
  highWater: number;
47
47
  };
48
- interface CurrentSitemapScope {
48
+ export interface CurrentSitemapScope {
49
49
  current: number;
50
50
  highWater: number;
51
51
  collapsed: boolean;
52
52
  }
53
- declare function classifySitemapCollapse(newestFirstCounts: ReadonlyArray<number | null | undefined>, policy: SitemapCollapsePolicy): SitemapCollapseState;
54
- declare function compareCurrentSitemapScope(newestFirstCounts: ReadonlyArray<number | null | undefined>, policy: SitemapCollapsePolicy): CurrentSitemapScope | null;
55
- declare function sitemapHistoryHasCollapse(newestFirstCounts: ReadonlyArray<number | null | undefined>, policy: SitemapCollapsePolicy): boolean;
56
- declare function diffSitemapHealth(prev: readonly SitemapHealthRow[], curr: readonly SitemapHealthInput[]): SitemapHealthDiff;
57
- export { CurrentSitemapScope, SITEMAP_SYNC_COLLAPSE_POLICY, SITEMAP_TRUST_COLLAPSE_POLICY, SitemapCollapsePolicy, SitemapCollapseState, SitemapDelta, SitemapHealthDiff, SitemapHealthInput, SitemapHealthRow, SitemapHealthTotals, classifySitemapCollapse, compareCurrentSitemapScope, diffSitemapHealth, sitemapHistoryHasCollapse };
53
+ export declare function classifySitemapCollapse(newestFirstCounts: ReadonlyArray<number | null | undefined>, policy: SitemapCollapsePolicy): SitemapCollapseState;
54
+ export declare function compareCurrentSitemapScope(newestFirstCounts: ReadonlyArray<number | null | undefined>, policy: SitemapCollapsePolicy): CurrentSitemapScope | null;
55
+ export declare function sitemapHistoryHasCollapse(newestFirstCounts: ReadonlyArray<number | null | undefined>, policy: SitemapCollapsePolicy): boolean;
56
+ export declare function diffSitemapHealth(prev: readonly SitemapHealthRow[], curr: readonly SitemapHealthInput[]): SitemapHealthDiff;
@@ -1,6 +1,6 @@
1
1
  import { BuilderState } from "gscdump/query";
2
2
  import { AnalysisQuerySource } from "@gscdump/engine/source";
3
- interface SyncedRange {
3
+ export interface SyncedRange {
4
4
  oldestDateSynced: string | null;
5
5
  newestDateSynced: string | null;
6
6
  /**
@@ -17,10 +17,9 @@ interface SyncedRange {
17
17
  end: string;
18
18
  }>;
19
19
  }
20
- interface CompositeSourceOptions {
20
+ export interface CompositeSourceOptions {
21
21
  engine: AnalysisQuerySource;
22
22
  live: AnalysisQuerySource;
23
23
  site: SyncedRange;
24
24
  }
25
- declare function createCompositeSource(opts: CompositeSourceOptions): AnalysisQuerySource;
26
- export { CompositeSourceOptions, SyncedRange, createCompositeSource };
25
+ export declare function createCompositeSource(opts: CompositeSourceOptions): AnalysisQuerySource;
@@ -23,7 +23,7 @@ function shouldRouteToLive(state, site) {
23
23
  if (!startDate || !endDate) return false;
24
24
  if (!site.oldestDateSynced || !site.newestDateSynced) return true;
25
25
  if (startDate < site.oldestDateSynced || endDate > site.newestDateSynced) return true;
26
- if (site.coveredSpans && site.coveredSpans.length > 0) return hasGapInCoveredSpans(startDate, endDate, site.coveredSpans);
26
+ if (site.coveredSpans) return hasGapInCoveredSpans(startDate, endDate, site.coveredSpans);
27
27
  return false;
28
28
  }
29
29
  function createCompositeSource(opts) {
@@ -5,10 +5,9 @@ import { PlannerCapabilities } from "gscdump/query/plan";
5
5
  * Permissive defaults: in-memory sources are usually test doubles, so they
6
6
  * advertise every capability unless the test explicitly narrows them.
7
7
  */
8
- declare const IN_MEMORY_DEFAULT_CAPABILITIES: PlannerCapabilities;
9
- interface InMemoryQuerySourceOptions {
8
+ export declare const IN_MEMORY_DEFAULT_CAPABILITIES: PlannerCapabilities;
9
+ export interface InMemoryQuerySourceOptions {
10
10
  queryRows: (state: BuilderState) => Promise<QueryRow[]> | QueryRow[];
11
11
  capabilities?: PlannerCapabilities;
12
12
  }
13
- declare function createInMemoryQuerySource(options: InMemoryQuerySourceOptions): AnalysisQuerySource;
14
- export { IN_MEMORY_DEFAULT_CAPABILITIES, InMemoryQuerySourceOptions, createInMemoryQuerySource };
13
+ export declare function createInMemoryQuerySource(options: InMemoryQuerySourceOptions): AnalysisQuerySource;
@@ -1,3 +1,2 @@
1
1
  import { Analyzer } from "@gscdump/engine/analyzer";
2
- declare const SQL_ANALYZERS: readonly Analyzer[];
3
- export { SQL_ANALYZERS };
2
+ export declare const SQL_ANALYZERS: readonly Analyzer[];