gscdump 0.6.3 → 0.7.2
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/dist/contracts.d.mts +9 -110
- package/dist/query/index.d.mts +8 -0
- package/dist/query/plan.d.mts +11 -3
- package/package.json +19 -10
package/dist/contracts.d.mts
CHANGED
|
@@ -1,69 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
readonly DESKTOP: "DESKTOP";
|
|
10
|
-
readonly TABLET: "TABLET";
|
|
11
|
-
};
|
|
12
|
-
type Device = typeof Devices[keyof typeof Devices];
|
|
13
|
-
declare const SearchTypes: {
|
|
14
|
-
readonly WEB: "web";
|
|
15
|
-
readonly IMAGE: "image";
|
|
16
|
-
readonly VIDEO: "video";
|
|
17
|
-
readonly NEWS: "news";
|
|
18
|
-
readonly DISCOVER: "discover";
|
|
19
|
-
readonly GOOGLE_NEWS: "googleNews";
|
|
20
|
-
};
|
|
21
|
-
type SearchType = typeof SearchTypes[keyof typeof SearchTypes];
|
|
22
|
-
declare const Countries: { [K in (typeof _default)[number]["alpha-3"]]: Lowercase<K> };
|
|
23
|
-
type Country = typeof Countries[keyof typeof Countries];
|
|
24
|
-
interface DimensionValueMap {
|
|
25
|
-
query: string;
|
|
26
|
-
queryCanonical: string;
|
|
27
|
-
page: string;
|
|
28
|
-
country: Country;
|
|
29
|
-
device: Device;
|
|
30
|
-
searchAppearance: string;
|
|
31
|
-
date: string;
|
|
32
|
-
}
|
|
33
|
-
type Dimension = keyof DimensionValueMap;
|
|
34
|
-
interface QueryParamValueMap {
|
|
35
|
-
searchType: SearchType;
|
|
36
|
-
}
|
|
37
|
-
type QueryParamName = keyof QueryParamValueMap;
|
|
38
|
-
type FilterOperator = 'equals' | 'notEquals' | 'contains' | 'notContains' | 'includingRegex' | 'excludingRegex';
|
|
39
|
-
type DateOperator = 'gte' | 'gt' | 'lte' | 'lt' | 'between';
|
|
40
|
-
type MetricOperator = 'metricGte' | 'metricGt' | 'metricLte' | 'metricLt' | 'metricBetween';
|
|
41
|
-
type SpecialOperator = 'topLevel';
|
|
42
|
-
interface InternalFilter {
|
|
43
|
-
dimension: Dimension | QueryParamName | Metric;
|
|
44
|
-
operator: FilterOperator | DateOperator | MetricOperator | SpecialOperator;
|
|
45
|
-
expression: string;
|
|
46
|
-
expression2?: string;
|
|
47
|
-
}
|
|
48
|
-
interface Filter<C = object> {
|
|
49
|
-
readonly __filterBrand: 'gscdump.Filter';
|
|
50
|
-
readonly _constraints: C;
|
|
51
|
-
readonly _filters: InternalFilter[];
|
|
52
|
-
readonly _nestedGroups?: Filter<any>[];
|
|
53
|
-
readonly _groupType?: 'and' | 'or';
|
|
54
|
-
}
|
|
55
|
-
type Metric = 'clicks' | 'impressions' | 'ctr' | 'position';
|
|
56
|
-
interface BuilderState {
|
|
57
|
-
dimensions: Dimension[];
|
|
58
|
-
metrics?: Metric[];
|
|
59
|
-
filter?: Filter<any>;
|
|
60
|
-
orderBy?: {
|
|
61
|
-
column: Metric | 'date';
|
|
62
|
-
dir: 'asc' | 'desc';
|
|
63
|
-
};
|
|
64
|
-
rowLimit?: number;
|
|
65
|
-
startRow?: number;
|
|
66
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Canonical cross-package contracts. Type-only — zero runtime cost.
|
|
3
|
+
*
|
|
4
|
+
* Imported by @gscdump/engine, @gscdump/analysis, @gscdump/cli, @gscdump/mcp,
|
|
5
|
+
* @gscdump/cloud as the single source of truth for cross-cutting types so
|
|
6
|
+
* schema identifiers, tenant shape, and analyzer IO can't drift across
|
|
7
|
+
* packages.
|
|
8
|
+
*/
|
|
67
9
|
/** Logical table / dataset identifier. Canonical across query builder + storage engine. */
|
|
68
10
|
type TableName = 'pages' | 'keywords' | 'countries' | 'devices' | 'page_keywords' | 'search_appearance';
|
|
69
11
|
/** Untyped row shape crossing storage/query boundaries. */
|
|
@@ -90,47 +32,4 @@ interface TenantCtx {
|
|
|
90
32
|
userId: string;
|
|
91
33
|
siteId?: string;
|
|
92
34
|
}
|
|
93
|
-
|
|
94
|
-
interface AnalysisParams {
|
|
95
|
-
type: AnalysisTool;
|
|
96
|
-
startDate?: string;
|
|
97
|
-
endDate?: string;
|
|
98
|
-
prevStartDate?: string;
|
|
99
|
-
prevEndDate?: string;
|
|
100
|
-
brandTerms?: string[];
|
|
101
|
-
limit?: number;
|
|
102
|
-
offset?: number;
|
|
103
|
-
/** Sort column. Each analyzer enforces its own whitelist. */
|
|
104
|
-
sortBy?: string;
|
|
105
|
-
/** Sort direction. Default per-analyzer. */
|
|
106
|
-
sortDir?: 'asc' | 'desc';
|
|
107
|
-
minPosition?: number;
|
|
108
|
-
maxPosition?: number;
|
|
109
|
-
minImpressions?: number;
|
|
110
|
-
maxCtr?: number;
|
|
111
|
-
minPages?: number;
|
|
112
|
-
maxPositionSpread?: number;
|
|
113
|
-
minClusterSize?: number;
|
|
114
|
-
clusterBy?: 'prefix' | 'intent' | 'both';
|
|
115
|
-
dimension?: 'pages' | 'keywords';
|
|
116
|
-
topN?: number;
|
|
117
|
-
metric?: 'clicks' | 'impressions';
|
|
118
|
-
changeThreshold?: number;
|
|
119
|
-
minPreviousClicks?: number;
|
|
120
|
-
threshold?: number;
|
|
121
|
-
weeks?: number;
|
|
122
|
-
minWeeksWithData?: number;
|
|
123
|
-
/** content-velocity lookback window in days (max 365, default 90). */
|
|
124
|
-
days?: number;
|
|
125
|
-
/** data-query / data-detail primary BuilderState. */
|
|
126
|
-
q?: BuilderState;
|
|
127
|
-
/** data-query / data-detail optional comparison-period BuilderState. */
|
|
128
|
-
qc?: BuilderState;
|
|
129
|
-
/** data-query comparison filter applied to joined current/previous rows. */
|
|
130
|
-
comparisonFilter?: 'new' | 'lost' | 'improving' | 'declining';
|
|
131
|
-
}
|
|
132
|
-
interface AnalysisResult {
|
|
133
|
-
results: Record<string, unknown>[];
|
|
134
|
-
meta: Record<string, unknown>;
|
|
135
|
-
}
|
|
136
|
-
export { AnalysisParams, AnalysisResult, AnalysisTool, ColumnDef, ColumnType, Row, type TableName, TableSchema, TenantCtx };
|
|
35
|
+
export { ColumnDef, ColumnType, Row, TableName, TableSchema, TenantCtx };
|
package/dist/query/index.d.mts
CHANGED
|
@@ -152,6 +152,14 @@ declare function lt<D extends Dimension>(column: Column<D>, value: DimensionValu
|
|
|
152
152
|
declare function between<M extends Metric>(column: MetricColumn<M>, start: number, end: number): Filter<object>;
|
|
153
153
|
declare function between<D extends Dimension>(column: Column<D>, start: DimensionValueMap[D], end: DimensionValueMap[D]): Filter<object>;
|
|
154
154
|
declare function topLevel(column: Column<'page'>): Filter<object>;
|
|
155
|
+
/**
|
|
156
|
+
* Canonical cross-package contracts. Type-only — zero runtime cost.
|
|
157
|
+
*
|
|
158
|
+
* Imported by @gscdump/engine, @gscdump/analysis, @gscdump/cli, @gscdump/mcp,
|
|
159
|
+
* @gscdump/cloud as the single source of truth for cross-cutting types so
|
|
160
|
+
* schema identifiers, tenant shape, and analyzer IO can't drift across
|
|
161
|
+
* packages.
|
|
162
|
+
*/
|
|
155
163
|
/** Logical table / dataset identifier. Canonical across query builder + storage engine. */
|
|
156
164
|
type TableName = 'pages' | 'keywords' | 'countries' | 'devices' | 'page_keywords' | 'search_appearance';
|
|
157
165
|
type LogicalDataset = TableName;
|
package/dist/query/plan.d.mts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical cross-package contracts. Type-only — zero runtime cost.
|
|
3
|
+
*
|
|
4
|
+
* Imported by @gscdump/engine, @gscdump/analysis, @gscdump/cli, @gscdump/mcp,
|
|
5
|
+
* @gscdump/cloud as the single source of truth for cross-cutting types so
|
|
6
|
+
* schema identifiers, tenant shape, and analyzer IO can't drift across
|
|
7
|
+
* packages.
|
|
8
|
+
*/
|
|
9
|
+
/** Logical table / dataset identifier. Canonical across query builder + storage engine. */
|
|
10
|
+
type TableName = 'pages' | 'keywords' | 'countries' | 'devices' | 'page_keywords' | 'search_appearance';
|
|
1
11
|
declare const _default: {
|
|
2
12
|
name: string;
|
|
3
13
|
'alpha-2': string;
|
|
@@ -64,8 +74,6 @@ interface BuilderState {
|
|
|
64
74
|
rowLimit?: number;
|
|
65
75
|
startRow?: number;
|
|
66
76
|
}
|
|
67
|
-
/** Logical table / dataset identifier. Canonical across query builder + storage engine. */
|
|
68
|
-
type TableName = 'pages' | 'keywords' | 'countries' | 'devices' | 'page_keywords' | 'search_appearance';
|
|
69
77
|
type LogicalDataset = TableName;
|
|
70
78
|
type ComparisonFilter = 'new' | 'lost' | 'improving' | 'declining';
|
|
71
79
|
interface PlannerCapabilities {
|
|
@@ -127,4 +135,4 @@ declare class UnsupportedLogicalCapabilityError extends Error {
|
|
|
127
135
|
}
|
|
128
136
|
declare function buildLogicalPlan(state: BuilderState, capabilities?: PlannerCapabilities): LogicalQueryPlan;
|
|
129
137
|
declare function buildLogicalComparisonPlan(current: BuilderState, previous: BuilderState, capabilities?: PlannerCapabilities, comparisonFilter?: ComparisonFilter): LogicalComparisonPlan;
|
|
130
|
-
export {
|
|
138
|
+
export { ComparisonFilter, LogicalComparisonPlan, LogicalDataset, LogicalDimensionFilter, LogicalFilterGroup, LogicalFilterLeaf, LogicalFilterNode, LogicalMetricFilter, LogicalQueryPlan, PlannerCapabilities, type TableName, UnsupportedLogicalCapabilityError, buildLogicalComparisonPlan, buildLogicalPlan };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gscdump",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.7.2",
|
|
5
5
|
"description": "Google Search Console API wrapper with typed query builder, streaming pagination, and SEO analysis functions",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -34,39 +34,48 @@
|
|
|
34
34
|
"exports": {
|
|
35
35
|
".": {
|
|
36
36
|
"types": "./dist/index.d.mts",
|
|
37
|
-
"import": "./dist/index.mjs"
|
|
37
|
+
"import": "./dist/index.mjs",
|
|
38
|
+
"default": "./dist/index.mjs"
|
|
38
39
|
},
|
|
39
40
|
"./query": {
|
|
40
41
|
"types": "./dist/query/index.d.mts",
|
|
41
|
-
"import": "./dist/query/index.mjs"
|
|
42
|
+
"import": "./dist/query/index.mjs",
|
|
43
|
+
"default": "./dist/query/index.mjs"
|
|
42
44
|
},
|
|
43
45
|
"./query/plan": {
|
|
44
46
|
"types": "./dist/query/plan.d.mts",
|
|
45
|
-
"import": "./dist/query/plan.mjs"
|
|
47
|
+
"import": "./dist/query/plan.mjs",
|
|
48
|
+
"default": "./dist/query/plan.mjs"
|
|
46
49
|
},
|
|
47
50
|
"./contracts": {
|
|
48
51
|
"types": "./dist/contracts.d.mts",
|
|
49
|
-
"import": "./dist/contracts.mjs"
|
|
52
|
+
"import": "./dist/contracts.mjs",
|
|
53
|
+
"default": "./dist/contracts.mjs"
|
|
50
54
|
},
|
|
51
55
|
"./driver": {
|
|
52
56
|
"types": "./dist/driver.d.mts",
|
|
53
|
-
"import": "./dist/driver.mjs"
|
|
57
|
+
"import": "./dist/driver.mjs",
|
|
58
|
+
"default": "./dist/driver.mjs"
|
|
54
59
|
},
|
|
55
60
|
"./tenant": {
|
|
56
61
|
"types": "./dist/tenant.d.mts",
|
|
57
|
-
"import": "./dist/tenant.mjs"
|
|
62
|
+
"import": "./dist/tenant.mjs",
|
|
63
|
+
"default": "./dist/tenant.mjs"
|
|
58
64
|
},
|
|
59
65
|
"./normalize": {
|
|
60
66
|
"types": "./dist/normalize.d.mts",
|
|
61
|
-
"import": "./dist/normalize.mjs"
|
|
67
|
+
"import": "./dist/normalize.mjs",
|
|
68
|
+
"default": "./dist/normalize.mjs"
|
|
62
69
|
},
|
|
63
70
|
"./url": {
|
|
64
71
|
"types": "./dist/url.d.mts",
|
|
65
|
-
"import": "./dist/url.mjs"
|
|
72
|
+
"import": "./dist/url.mjs",
|
|
73
|
+
"default": "./dist/url.mjs"
|
|
66
74
|
},
|
|
67
75
|
"./sitemap": {
|
|
68
76
|
"types": "./dist/sitemap.d.mts",
|
|
69
|
-
"import": "./dist/sitemap.mjs"
|
|
77
|
+
"import": "./dist/sitemap.mjs",
|
|
78
|
+
"default": "./dist/sitemap.mjs"
|
|
70
79
|
}
|
|
71
80
|
},
|
|
72
81
|
"main": "./dist/index.mjs",
|