gscdump 0.0.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/LICENSE +21 -0
- package/dist/index.d.mts +1195 -0
- package/dist/index.mjs +3823 -0
- package/package.json +62 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,1195 @@
|
|
|
1
|
+
import _dayjs, { Dayjs } from "dayjs";
|
|
2
|
+
import { $Fetch, FetchOptions } from "ofetch";
|
|
3
|
+
import { indexing_v3 } from "@googleapis/indexing/v3";
|
|
4
|
+
import { searchconsole_v1 } from "@googleapis/searchconsole/v1";
|
|
5
|
+
|
|
6
|
+
//#region src/analysis/types.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Shared types for pure analysis functions.
|
|
9
|
+
* These types describe the inputs and outputs of analysis functions
|
|
10
|
+
* that operate on data, independent of how it was fetched.
|
|
11
|
+
*/
|
|
12
|
+
type SortOrder = 'asc' | 'desc';
|
|
13
|
+
/** Base search metrics present on all data rows */
|
|
14
|
+
interface BaseMetrics {
|
|
15
|
+
clicks: number;
|
|
16
|
+
impressions: number;
|
|
17
|
+
ctr: number;
|
|
18
|
+
position: number;
|
|
19
|
+
}
|
|
20
|
+
/** Row with both query and page dimensions */
|
|
21
|
+
interface QueryPageRow extends BaseMetrics {
|
|
22
|
+
query: string;
|
|
23
|
+
page: string;
|
|
24
|
+
}
|
|
25
|
+
/** Date-keyed metrics for time series analysis */
|
|
26
|
+
interface DateMetrics extends BaseMetrics {
|
|
27
|
+
date: string;
|
|
28
|
+
}
|
|
29
|
+
/** Coerce nullable number to number, defaulting to 0 */
|
|
30
|
+
declare function num(value: number | null | undefined): number;
|
|
31
|
+
/** Create a generic sorter for any metric type */
|
|
32
|
+
declare function createSorter<T, M extends string>(getValue: (item: T, metric: M) => number, defaultMetric: M, defaultOrder?: SortOrder): (items: T[], sortBy?: M, sortOrder?: SortOrder) => T[];
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/core/types.d.ts
|
|
35
|
+
type ApiSite = searchconsole_v1.Schema$WmxSite;
|
|
36
|
+
type ApiSitemap = searchconsole_v1.Schema$WmxSitemap;
|
|
37
|
+
type ApiSitemapContent = searchconsole_v1.Schema$WmxSitemapContent;
|
|
38
|
+
type SearchAnalyticsQuery = searchconsole_v1.Schema$SearchAnalyticsQueryRequest;
|
|
39
|
+
type SearchAnalyticsResponse = searchconsole_v1.Schema$SearchAnalyticsQueryResponse;
|
|
40
|
+
type DataRow = searchconsole_v1.Schema$ApiDataRow;
|
|
41
|
+
type DimensionFilter = searchconsole_v1.Schema$ApiDimensionFilter;
|
|
42
|
+
type DimensionFilterGroup = searchconsole_v1.Schema$ApiDimensionFilterGroup;
|
|
43
|
+
type UrlInspectionResult = searchconsole_v1.Schema$UrlInspectionResult;
|
|
44
|
+
type IndexStatusResult = searchconsole_v1.Schema$IndexStatusInspectionResult;
|
|
45
|
+
type MobileUsabilityResult = searchconsole_v1.Schema$MobileUsabilityInspectionResult;
|
|
46
|
+
type RichResultsResult = searchconsole_v1.Schema$RichResultsInspectionResult;
|
|
47
|
+
type InspectUrlIndexResponse = searchconsole_v1.Schema$InspectUrlIndexResponse;
|
|
48
|
+
type UrlNotificationMetadata = indexing_v3.Schema$UrlNotificationMetadata;
|
|
49
|
+
type PublishUrlNotificationResponse = indexing_v3.Schema$PublishUrlNotificationResponse;
|
|
50
|
+
type RequiredNonNullable<T> = Required<Exclude<T, null | undefined>>;
|
|
51
|
+
interface Site extends Required<Omit<ApiSite, 'siteUrl'>> {
|
|
52
|
+
siteUrl: string;
|
|
53
|
+
}
|
|
54
|
+
interface Period {
|
|
55
|
+
start: Date | string;
|
|
56
|
+
end: Date | string;
|
|
57
|
+
}
|
|
58
|
+
interface ResolvedAnalyticsRange {
|
|
59
|
+
period: Period;
|
|
60
|
+
prevPeriod?: Period;
|
|
61
|
+
}
|
|
62
|
+
interface SiteAnalytics {
|
|
63
|
+
analytics: {
|
|
64
|
+
period: {
|
|
65
|
+
totalClicks: number;
|
|
66
|
+
totalImpressions: number;
|
|
67
|
+
};
|
|
68
|
+
prevPeriod: {
|
|
69
|
+
totalClicks: number;
|
|
70
|
+
totalImpressions: number;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
sitemaps: ApiSitemap[];
|
|
74
|
+
indexedUrls: string[];
|
|
75
|
+
period: {
|
|
76
|
+
url: string;
|
|
77
|
+
clicks: number;
|
|
78
|
+
clicksPercent: number;
|
|
79
|
+
prevClicks: number;
|
|
80
|
+
impressions: number;
|
|
81
|
+
impressionsPercent: number;
|
|
82
|
+
prevImpressions: number;
|
|
83
|
+
}[];
|
|
84
|
+
keywords: {
|
|
85
|
+
keyword: string;
|
|
86
|
+
position: number;
|
|
87
|
+
prevPosition: number;
|
|
88
|
+
positionPercent: number;
|
|
89
|
+
ctr: number;
|
|
90
|
+
ctrPercent: number;
|
|
91
|
+
prevCtr: number;
|
|
92
|
+
clicks: number;
|
|
93
|
+
}[];
|
|
94
|
+
graph: {
|
|
95
|
+
keys?: undefined;
|
|
96
|
+
time: string;
|
|
97
|
+
clicks: number;
|
|
98
|
+
impressions: number;
|
|
99
|
+
}[];
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/api/search-analytics/types.d.ts
|
|
103
|
+
type DataType = 'web' | 'image' | 'video' | 'news' | 'discover' | 'googleNews';
|
|
104
|
+
type DataState = 'final' | 'all';
|
|
105
|
+
type AggregationType = 'byPage' | 'byProperty';
|
|
106
|
+
interface QueryOptions {
|
|
107
|
+
period?: Period;
|
|
108
|
+
prevPeriod?: Period;
|
|
109
|
+
domain?: string;
|
|
110
|
+
filters?: DimensionFilter[];
|
|
111
|
+
/** Data type: web, image, video, news, discover, googleNews. Default: web */
|
|
112
|
+
type?: DataType;
|
|
113
|
+
/** Data state: final (settled data) or all (includes fresh/unfinalized). Default: all */
|
|
114
|
+
dataState?: DataState;
|
|
115
|
+
/**
|
|
116
|
+
* Aggregation type: byPage (per-URL metrics) or byProperty (domain-level rollup).
|
|
117
|
+
* Use byProperty for sc-domain: properties to get true totals.
|
|
118
|
+
* byPage can undercount when same query hits multiple pages.
|
|
119
|
+
* Default: byPage
|
|
120
|
+
*/
|
|
121
|
+
aggregationType?: AggregationType;
|
|
122
|
+
/** Maximum rows to return. Default: 25000 (GSC API limit per request) */
|
|
123
|
+
rowLimit?: number;
|
|
124
|
+
}
|
|
125
|
+
interface ComparisonResult<T> {
|
|
126
|
+
current: T[];
|
|
127
|
+
previous: T[];
|
|
128
|
+
metadata?: {
|
|
129
|
+
currentCount: number;
|
|
130
|
+
previousCount: number;
|
|
131
|
+
[key: string]: unknown;
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
interface DeviceData extends Omit<DataRow, 'keys'> {
|
|
135
|
+
dimension: 'device';
|
|
136
|
+
device: string;
|
|
137
|
+
keys: null;
|
|
138
|
+
}
|
|
139
|
+
interface CountryData extends Omit<DataRow, 'keys'> {
|
|
140
|
+
dimension: 'country';
|
|
141
|
+
countryCodeGsc: string;
|
|
142
|
+
country: string;
|
|
143
|
+
countryCode: string;
|
|
144
|
+
keywords?: number;
|
|
145
|
+
keys: null;
|
|
146
|
+
}
|
|
147
|
+
interface AnalyticsData extends Omit<DataRow, 'keys'> {
|
|
148
|
+
keywords: DataRow[];
|
|
149
|
+
}
|
|
150
|
+
interface PageData extends Omit<DataRow, 'keys'> {
|
|
151
|
+
dimension: 'page';
|
|
152
|
+
page: string;
|
|
153
|
+
keyword?: string;
|
|
154
|
+
keywordPosition?: number;
|
|
155
|
+
prevClicks?: number;
|
|
156
|
+
clicksPercent?: number;
|
|
157
|
+
prevImpressions?: number;
|
|
158
|
+
impressionsPercent?: number;
|
|
159
|
+
lost?: boolean;
|
|
160
|
+
keys: null;
|
|
161
|
+
}
|
|
162
|
+
interface KeywordData extends Omit<DataRow, 'keys'> {
|
|
163
|
+
dimension: 'query';
|
|
164
|
+
keyword: string;
|
|
165
|
+
page?: string | null;
|
|
166
|
+
positionPercent?: number;
|
|
167
|
+
prevPosition?: number;
|
|
168
|
+
ctrPercent?: number;
|
|
169
|
+
prevCtr?: number;
|
|
170
|
+
lost?: boolean;
|
|
171
|
+
prevClicks?: number;
|
|
172
|
+
prevImpressions?: number;
|
|
173
|
+
keys: null;
|
|
174
|
+
}
|
|
175
|
+
interface DateData extends Omit<DataRow, 'keys'> {
|
|
176
|
+
dimension: 'date';
|
|
177
|
+
date: string;
|
|
178
|
+
keys: null;
|
|
179
|
+
}
|
|
180
|
+
interface SearchAppearanceData extends Omit<DataRow, 'keys'> {
|
|
181
|
+
dimension: 'searchAppearance';
|
|
182
|
+
searchAppearance: string;
|
|
183
|
+
keys: null;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Discriminated union of all query result row types.
|
|
187
|
+
* Use the `dimension` field to narrow to specific types.
|
|
188
|
+
*/
|
|
189
|
+
type QueryResultRow = DateData | DeviceData | CountryData | PageData | KeywordData | SearchAppearanceData;
|
|
190
|
+
interface DateRow extends Omit<DataRow, 'keys'> {
|
|
191
|
+
date: string;
|
|
192
|
+
keys: null;
|
|
193
|
+
}
|
|
194
|
+
interface KeywordRow extends Omit<DataRow, 'keys'> {
|
|
195
|
+
keyword: string;
|
|
196
|
+
keys: null;
|
|
197
|
+
}
|
|
198
|
+
interface PageRow extends Omit<DataRow, 'keys'> {
|
|
199
|
+
page: string;
|
|
200
|
+
keys: null;
|
|
201
|
+
}
|
|
202
|
+
interface FetchPageResult {
|
|
203
|
+
dates: DateRow[];
|
|
204
|
+
keywords: KeywordRow[];
|
|
205
|
+
}
|
|
206
|
+
interface FetchKeywordResult {
|
|
207
|
+
dates: DateRow[];
|
|
208
|
+
pages: PageRow[];
|
|
209
|
+
}
|
|
210
|
+
//#endregion
|
|
211
|
+
//#region src/analysis/striking-distance.d.ts
|
|
212
|
+
type StrikingDistanceSortMetric = 'clicks' | 'impressions' | 'ctr' | 'position' | 'potentialClicks';
|
|
213
|
+
interface StrikingDistanceOptions {
|
|
214
|
+
/** Minimum position (inclusive). Default: 4 */
|
|
215
|
+
minPosition?: number;
|
|
216
|
+
/** Maximum position (inclusive). Default: 20 */
|
|
217
|
+
maxPosition?: number;
|
|
218
|
+
/** Minimum impressions. Default: 100 */
|
|
219
|
+
minImpressions?: number;
|
|
220
|
+
/** Maximum CTR (queries with low CTR have more potential). Default: 0.05 (5%) */
|
|
221
|
+
maxCtr?: number;
|
|
222
|
+
/** Sort metric. Default: potentialClicks */
|
|
223
|
+
sortBy?: StrikingDistanceSortMetric;
|
|
224
|
+
/** Sort order. Default: desc */
|
|
225
|
+
sortOrder?: SortOrder;
|
|
226
|
+
}
|
|
227
|
+
interface StrikingDistanceResult {
|
|
228
|
+
keyword: string;
|
|
229
|
+
page: string | null;
|
|
230
|
+
clicks: number;
|
|
231
|
+
impressions: number;
|
|
232
|
+
ctr: number;
|
|
233
|
+
position: number;
|
|
234
|
+
/** Estimated clicks if position improved to top 3 */
|
|
235
|
+
potentialClicks: number;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Finds striking distance keywords - high impressions, low CTR, position 4-20.
|
|
239
|
+
* These are "quick wins" that could gain significant traffic with small ranking improvements.
|
|
240
|
+
*/
|
|
241
|
+
declare function analyzeStrikingDistance(keywords: KeywordData[], options?: StrikingDistanceOptions): StrikingDistanceResult[];
|
|
242
|
+
//#endregion
|
|
243
|
+
//#region src/analysis/opportunity.d.ts
|
|
244
|
+
type OpportunitySortMetric = 'opportunityScore' | 'potentialClicks' | 'impressions' | 'position';
|
|
245
|
+
interface OpportunityWeights {
|
|
246
|
+
position?: number;
|
|
247
|
+
impressions?: number;
|
|
248
|
+
ctrGap?: number;
|
|
249
|
+
}
|
|
250
|
+
interface OpportunityOptions {
|
|
251
|
+
/** Minimum impressions to consider. Default: 100 */
|
|
252
|
+
minImpressions?: number;
|
|
253
|
+
/** Custom weights for score factors. Default: all 1 */
|
|
254
|
+
weights?: OpportunityWeights;
|
|
255
|
+
/** Sort metric. Default: opportunityScore */
|
|
256
|
+
sortBy?: OpportunitySortMetric;
|
|
257
|
+
}
|
|
258
|
+
interface OpportunityFactors {
|
|
259
|
+
positionScore: number;
|
|
260
|
+
impressionScore: number;
|
|
261
|
+
ctrGapScore: number;
|
|
262
|
+
}
|
|
263
|
+
interface OpportunityResult {
|
|
264
|
+
keyword: string;
|
|
265
|
+
page: string | null;
|
|
266
|
+
clicks: number;
|
|
267
|
+
impressions: number;
|
|
268
|
+
ctr: number;
|
|
269
|
+
position: number;
|
|
270
|
+
opportunityScore: number;
|
|
271
|
+
potentialClicks: number;
|
|
272
|
+
factors: OpportunityFactors;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Scores keywords by optimization opportunity.
|
|
276
|
+
* Composite score combining position, impressions, and CTR gap factors.
|
|
277
|
+
*/
|
|
278
|
+
declare function analyzeOpportunity(keywords: KeywordData[], options?: OpportunityOptions): OpportunityResult[];
|
|
279
|
+
//#endregion
|
|
280
|
+
//#region src/analysis/brand.d.ts
|
|
281
|
+
interface BrandSegmentationOptions {
|
|
282
|
+
/** Brand terms to match against keywords (case-insensitive) */
|
|
283
|
+
brandTerms: string[];
|
|
284
|
+
/** Minimum impressions for a keyword to be included. Default: 10 */
|
|
285
|
+
minImpressions?: number;
|
|
286
|
+
}
|
|
287
|
+
interface BrandSummary {
|
|
288
|
+
brandClicks: number;
|
|
289
|
+
nonBrandClicks: number;
|
|
290
|
+
brandShare: number;
|
|
291
|
+
brandImpressions: number;
|
|
292
|
+
nonBrandImpressions: number;
|
|
293
|
+
}
|
|
294
|
+
interface BrandSegmentationResult {
|
|
295
|
+
brand: KeywordData[];
|
|
296
|
+
nonBrand: KeywordData[];
|
|
297
|
+
summary: BrandSummary;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Segments keywords into brand and non-brand based on provided brand terms.
|
|
301
|
+
* Simple string matching - keyword contains any brand term (case-insensitive).
|
|
302
|
+
*/
|
|
303
|
+
declare function analyzeBrandSegmentation(keywords: KeywordData[], options: BrandSegmentationOptions): BrandSegmentationResult;
|
|
304
|
+
//#endregion
|
|
305
|
+
//#region src/analysis/concentration.d.ts
|
|
306
|
+
/**
|
|
307
|
+
* Traffic concentration analysis - measures distribution across pages/keywords.
|
|
308
|
+
* Pure function operating on page or keyword data.
|
|
309
|
+
*/
|
|
310
|
+
type ConcentrationRiskLevel = 'low' | 'medium' | 'high';
|
|
311
|
+
interface ConcentrationOptions {
|
|
312
|
+
/** Number of top items to report. Default: 10 */
|
|
313
|
+
topN?: number;
|
|
314
|
+
}
|
|
315
|
+
interface ConcentrationItem {
|
|
316
|
+
key: string;
|
|
317
|
+
clicks: number;
|
|
318
|
+
share: number;
|
|
319
|
+
}
|
|
320
|
+
interface ConcentrationResult {
|
|
321
|
+
/** Gini coefficient: 0 = equal distribution, 1 = fully concentrated */
|
|
322
|
+
giniCoefficient: number;
|
|
323
|
+
/** Herfindahl-Hirschman Index: 0-10000, >2500 = highly concentrated */
|
|
324
|
+
hhi: number;
|
|
325
|
+
/** Percentage of total clicks from top N items */
|
|
326
|
+
topNConcentration: number;
|
|
327
|
+
topNItems: ConcentrationItem[];
|
|
328
|
+
totalItems: number;
|
|
329
|
+
totalClicks: number;
|
|
330
|
+
/** Risk level derived from HHI: <1500 low, 1500-2500 medium, >2500 high */
|
|
331
|
+
riskLevel: ConcentrationRiskLevel;
|
|
332
|
+
}
|
|
333
|
+
/** Item with a key and clicks for concentration analysis */
|
|
334
|
+
interface ConcentrationInput {
|
|
335
|
+
key: string;
|
|
336
|
+
clicks: number;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Analyzes traffic concentration across items (pages or keywords).
|
|
340
|
+
* Returns Gini coefficient, HHI, and top-N concentration metrics.
|
|
341
|
+
*
|
|
342
|
+
* @param items Array of items with key and clicks
|
|
343
|
+
* @param options Configuration options
|
|
344
|
+
*/
|
|
345
|
+
declare function analyzeConcentration(items: ConcentrationInput[], options?: ConcentrationOptions): ConcentrationResult;
|
|
346
|
+
/** Item with page and optional/nullable clicks */
|
|
347
|
+
interface PageLike {
|
|
348
|
+
page: string;
|
|
349
|
+
clicks?: number | null;
|
|
350
|
+
}
|
|
351
|
+
/** Item with keyword and optional/nullable clicks */
|
|
352
|
+
interface KeywordLike {
|
|
353
|
+
keyword: string;
|
|
354
|
+
clicks?: number | null;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Convenience wrapper for page concentration analysis.
|
|
358
|
+
*/
|
|
359
|
+
declare function analyzePageConcentration(pages: PageLike[], options?: ConcentrationOptions): ConcentrationResult;
|
|
360
|
+
/**
|
|
361
|
+
* Convenience wrapper for keyword concentration analysis.
|
|
362
|
+
*/
|
|
363
|
+
declare function analyzeKeywordConcentration(keywords: KeywordLike[], options?: ConcentrationOptions): ConcentrationResult;
|
|
364
|
+
//#endregion
|
|
365
|
+
//#region src/analysis/decay.d.ts
|
|
366
|
+
type DecaySortMetric = 'lostClicks' | 'declinePercent' | 'currentClicks';
|
|
367
|
+
interface DecayOptions {
|
|
368
|
+
/** Minimum clicks in previous period to consider. Default: 50 */
|
|
369
|
+
minPreviousClicks?: number;
|
|
370
|
+
/** Minimum decline percentage (0-1). Default: 0.2 (20%) */
|
|
371
|
+
threshold?: number;
|
|
372
|
+
/** Metric to sort results by. Default: lostClicks */
|
|
373
|
+
sortBy?: DecaySortMetric;
|
|
374
|
+
}
|
|
375
|
+
interface DecayInput {
|
|
376
|
+
current: PageData[];
|
|
377
|
+
previous: PageData[];
|
|
378
|
+
}
|
|
379
|
+
interface DecayResult {
|
|
380
|
+
page: string;
|
|
381
|
+
currentClicks: number;
|
|
382
|
+
previousClicks: number;
|
|
383
|
+
lostClicks: number;
|
|
384
|
+
declinePercent: number;
|
|
385
|
+
currentPosition: number;
|
|
386
|
+
previousPosition: number;
|
|
387
|
+
positionDrop: number;
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Identifies "decaying" content - pages that have lost significant traffic.
|
|
391
|
+
* Useful for finding old content that needs updating.
|
|
392
|
+
*
|
|
393
|
+
* @param input Current and previous period page data
|
|
394
|
+
* @param options Filtering and sorting options
|
|
395
|
+
*/
|
|
396
|
+
declare function analyzeDecay(input: DecayInput, options?: DecayOptions): DecayResult[];
|
|
397
|
+
//#endregion
|
|
398
|
+
//#region src/analysis/movers.d.ts
|
|
399
|
+
type MoversSortMetric = 'clicks' | 'impressions' | 'clicksChange' | 'impressionsChange' | 'positionChange';
|
|
400
|
+
interface MoversOptions {
|
|
401
|
+
/** Minimum change threshold to flag. Default: 0.2 (20%) */
|
|
402
|
+
changeThreshold?: number;
|
|
403
|
+
/** Minimum impressions in recent period. Default: 50 */
|
|
404
|
+
minImpressions?: number;
|
|
405
|
+
/** Metric to sort results by. Default: clicksChange */
|
|
406
|
+
sortBy?: MoversSortMetric;
|
|
407
|
+
}
|
|
408
|
+
interface MoversInput {
|
|
409
|
+
current: KeywordData[];
|
|
410
|
+
previous: KeywordData[];
|
|
411
|
+
/** If periods have different lengths, provide normalization factor (previous/current) */
|
|
412
|
+
normalizationFactor?: number;
|
|
413
|
+
}
|
|
414
|
+
interface MoverData {
|
|
415
|
+
keyword: string;
|
|
416
|
+
page: string | null;
|
|
417
|
+
recentClicks: number;
|
|
418
|
+
recentImpressions: number;
|
|
419
|
+
recentPosition: number;
|
|
420
|
+
baselineClicks: number;
|
|
421
|
+
baselineImpressions: number;
|
|
422
|
+
baselinePosition: number;
|
|
423
|
+
clicksChange: number;
|
|
424
|
+
clicksChangePercent: number;
|
|
425
|
+
impressionsChangePercent: number;
|
|
426
|
+
positionChange: number;
|
|
427
|
+
}
|
|
428
|
+
interface MoversResult {
|
|
429
|
+
rising: MoverData[];
|
|
430
|
+
declining: MoverData[];
|
|
431
|
+
stable: MoverData[];
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Identifies movers and shakers - keywords with significant recent changes.
|
|
435
|
+
* Compares recent period against baseline period.
|
|
436
|
+
*
|
|
437
|
+
* @param input Current and previous keyword data
|
|
438
|
+
* @param options Filtering and sorting options
|
|
439
|
+
*/
|
|
440
|
+
declare function analyzeMovers(input: MoversInput, options?: MoversOptions): MoversResult;
|
|
441
|
+
//#endregion
|
|
442
|
+
//#region src/analysis/cannibalization.d.ts
|
|
443
|
+
type CannibalizationSortMetric = 'clicks' | 'impressions' | 'positionSpread' | 'pageCount';
|
|
444
|
+
interface CannibalizationOptions {
|
|
445
|
+
/** Minimum impressions for a query to be considered. Default: 10 */
|
|
446
|
+
minImpressions?: number;
|
|
447
|
+
/** Maximum position spread to flag as cannibalization. Default: 10 */
|
|
448
|
+
maxPositionSpread?: number;
|
|
449
|
+
/** Minimum number of pages ranking for same query. Default: 2 */
|
|
450
|
+
minPages?: number;
|
|
451
|
+
/** Sort metric. Default: clicks */
|
|
452
|
+
sortBy?: CannibalizationSortMetric;
|
|
453
|
+
/** Sort order. Default: desc */
|
|
454
|
+
sortOrder?: SortOrder;
|
|
455
|
+
}
|
|
456
|
+
interface CannibalizationPage {
|
|
457
|
+
page: string;
|
|
458
|
+
clicks: number;
|
|
459
|
+
impressions: number;
|
|
460
|
+
ctr: number;
|
|
461
|
+
position: number;
|
|
462
|
+
}
|
|
463
|
+
interface CannibalizationResult {
|
|
464
|
+
query: string;
|
|
465
|
+
pages: CannibalizationPage[];
|
|
466
|
+
totalClicks: number;
|
|
467
|
+
totalImpressions: number;
|
|
468
|
+
positionSpread: number;
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Detects keyword cannibalization - queries ranking for multiple pages.
|
|
472
|
+
* Returns queries where multiple pages compete for the same search term.
|
|
473
|
+
*
|
|
474
|
+
* @param rows Query+page data rows
|
|
475
|
+
* @param options Filtering and sorting options
|
|
476
|
+
*/
|
|
477
|
+
declare function analyzeCannibalization(rows: QueryPageRow[], options?: CannibalizationOptions): CannibalizationResult[];
|
|
478
|
+
//#endregion
|
|
479
|
+
//#region src/analysis/zero-click.d.ts
|
|
480
|
+
interface ZeroClickOptions {
|
|
481
|
+
/** Minimum impressions. Default: 1000 */
|
|
482
|
+
minImpressions?: number;
|
|
483
|
+
/** Maximum CTR to be considered "Zero Click". Default: 0.03 (3%) */
|
|
484
|
+
maxCtr?: number;
|
|
485
|
+
/** Only consider queries in top X positions. Default: 10 */
|
|
486
|
+
maxPosition?: number;
|
|
487
|
+
}
|
|
488
|
+
interface ZeroClickResult {
|
|
489
|
+
query: string;
|
|
490
|
+
page: string;
|
|
491
|
+
clicks: number;
|
|
492
|
+
impressions: number;
|
|
493
|
+
ctr: number;
|
|
494
|
+
position: number;
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Identifies potential "Zero-Click" queries.
|
|
498
|
+
* These are high-volume queries where you rank well but get few clicks,
|
|
499
|
+
* often due to SERP features (Answer Boxes, Knowledge Panels, AI Overviews).
|
|
500
|
+
*
|
|
501
|
+
* @param rows Query+page data rows
|
|
502
|
+
* @param options Filtering options
|
|
503
|
+
*/
|
|
504
|
+
declare function analyzeZeroClick(rows: QueryPageRow[], options?: ZeroClickOptions): ZeroClickResult[];
|
|
505
|
+
//#endregion
|
|
506
|
+
//#region src/analysis/seasonality.d.ts
|
|
507
|
+
type SeasonalityMetric = 'clicks' | 'impressions';
|
|
508
|
+
interface SeasonalityOptions {
|
|
509
|
+
/** Metric to analyze for seasonality. Default: clicks */
|
|
510
|
+
metric?: SeasonalityMetric;
|
|
511
|
+
}
|
|
512
|
+
interface MonthlyData {
|
|
513
|
+
month: string;
|
|
514
|
+
value: number;
|
|
515
|
+
vsAverage: number;
|
|
516
|
+
isPeak: boolean;
|
|
517
|
+
isTrough: boolean;
|
|
518
|
+
}
|
|
519
|
+
interface SeasonalityResult {
|
|
520
|
+
hasSeasonality: boolean;
|
|
521
|
+
/** Coefficient of variation: std dev / mean. Higher = more seasonal. */
|
|
522
|
+
strength: number;
|
|
523
|
+
peakMonths: string[];
|
|
524
|
+
troughMonths: string[];
|
|
525
|
+
monthlyBreakdown: MonthlyData[];
|
|
526
|
+
insufficientData: boolean;
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Detects seasonality patterns by analyzing monthly traffic variation.
|
|
530
|
+
* Identifies peaks (>1.5x average) and troughs (<0.5x average).
|
|
531
|
+
*
|
|
532
|
+
* @param dates Array of date metrics (each row is one day)
|
|
533
|
+
* @param options Analysis options
|
|
534
|
+
*/
|
|
535
|
+
declare function analyzeSeasonality(dates: DateMetrics[], options?: SeasonalityOptions): SeasonalityResult;
|
|
536
|
+
//#endregion
|
|
537
|
+
//#region src/analysis/clustering.d.ts
|
|
538
|
+
type ClusterType = 'prefix' | 'intent' | 'both';
|
|
539
|
+
interface ClusteringOptions {
|
|
540
|
+
/** Minimum keywords for a cluster to be reported. Default: 2 */
|
|
541
|
+
minClusterSize?: number;
|
|
542
|
+
/** Minimum impressions for a keyword to be included. Default: 10 */
|
|
543
|
+
minImpressions?: number;
|
|
544
|
+
/** Clustering method. Default: 'both' */
|
|
545
|
+
clusterBy?: ClusterType;
|
|
546
|
+
}
|
|
547
|
+
interface KeywordCluster {
|
|
548
|
+
clusterName: string;
|
|
549
|
+
clusterType: 'prefix' | 'intent';
|
|
550
|
+
keywords: KeywordData[];
|
|
551
|
+
totalClicks: number;
|
|
552
|
+
totalImpressions: number;
|
|
553
|
+
avgPosition: number;
|
|
554
|
+
keywordCount: number;
|
|
555
|
+
}
|
|
556
|
+
interface ClusteringResult {
|
|
557
|
+
clusters: KeywordCluster[];
|
|
558
|
+
unclustered: KeywordData[];
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Clusters keywords by intent prefix or common word prefix.
|
|
562
|
+
* Simple regex/prefix approach - no external NLP dependencies.
|
|
563
|
+
*
|
|
564
|
+
* @param keywords Array of keyword data
|
|
565
|
+
* @param options Clustering options
|
|
566
|
+
*/
|
|
567
|
+
declare function analyzeClustering(keywords: KeywordData[], options?: ClusteringOptions): ClusteringResult;
|
|
568
|
+
//#endregion
|
|
569
|
+
//#region src/core/client.d.ts
|
|
570
|
+
/**
|
|
571
|
+
* Compatible interface with OAuth2Client from google-auth-library
|
|
572
|
+
*/
|
|
573
|
+
interface AuthClient {
|
|
574
|
+
credentials?: {
|
|
575
|
+
access_token?: string | null;
|
|
576
|
+
refresh_token?: string | null;
|
|
577
|
+
expiry_date?: number | null;
|
|
578
|
+
};
|
|
579
|
+
getAccessToken: () => Promise<{
|
|
580
|
+
token?: string | null;
|
|
581
|
+
}>;
|
|
582
|
+
}
|
|
583
|
+
interface AuthOptions {
|
|
584
|
+
clientId: string;
|
|
585
|
+
clientSecret: string;
|
|
586
|
+
refreshToken: string;
|
|
587
|
+
}
|
|
588
|
+
declare function createAuth(options: AuthOptions): AuthClient;
|
|
589
|
+
/** Auth can be a token string, object with accessToken, or OAuth2Client-like object with credentials */
|
|
590
|
+
type Auth = string | {
|
|
591
|
+
accessToken: string;
|
|
592
|
+
} | AuthClient | AuthOptions;
|
|
593
|
+
declare function createFetch(auth: Auth, options?: FetchOptions): $Fetch;
|
|
594
|
+
interface GoogleSearchConsoleClient {
|
|
595
|
+
sites: {
|
|
596
|
+
list: () => Promise<{
|
|
597
|
+
siteEntry?: ApiSite[];
|
|
598
|
+
}>;
|
|
599
|
+
};
|
|
600
|
+
sitemaps: {
|
|
601
|
+
list: (siteUrl: string) => Promise<{
|
|
602
|
+
sitemap?: ApiSitemap[];
|
|
603
|
+
}>;
|
|
604
|
+
get: (siteUrl: string, feedpath: string) => Promise<ApiSitemap>;
|
|
605
|
+
submit: (siteUrl: string, feedpath: string) => Promise<void>;
|
|
606
|
+
delete: (siteUrl: string, feedpath: string) => Promise<void>;
|
|
607
|
+
};
|
|
608
|
+
searchAnalytics: {
|
|
609
|
+
query: (siteUrl: string, body: SearchAnalyticsQuery) => Promise<SearchAnalyticsResponse>;
|
|
610
|
+
};
|
|
611
|
+
urlInspection: {
|
|
612
|
+
inspect: (siteUrl: string, inspectionUrl: string) => Promise<InspectUrlIndexResponse>;
|
|
613
|
+
};
|
|
614
|
+
indexing: {
|
|
615
|
+
publish: (url: string, type: 'URL_UPDATED' | 'URL_DELETED') => Promise<PublishUrlNotificationResponse>;
|
|
616
|
+
getMetadata: (url: string) => Promise<UrlNotificationMetadata>;
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
interface GoogleSearchConsoleClientOptions {
|
|
620
|
+
fetchOptions?: FetchOptions;
|
|
621
|
+
fetch?: $Fetch;
|
|
622
|
+
onRateLimited?: (context: {
|
|
623
|
+
response: Response;
|
|
624
|
+
}) => void | Promise<void>;
|
|
625
|
+
}
|
|
626
|
+
declare function googleSearchConsole(auth: Auth, options?: GoogleSearchConsoleClientOptions): GoogleSearchConsoleClient;
|
|
627
|
+
//#endregion
|
|
628
|
+
//#region src/api/indexing.d.ts
|
|
629
|
+
type IndexingNotificationType = 'URL_UPDATED' | 'URL_DELETED';
|
|
630
|
+
interface IndexingResult {
|
|
631
|
+
url: string;
|
|
632
|
+
type: IndexingNotificationType;
|
|
633
|
+
notifyTime?: string;
|
|
634
|
+
}
|
|
635
|
+
interface IndexingMetadata {
|
|
636
|
+
url: string;
|
|
637
|
+
latestUpdate?: indexing_v3.Schema$UrlNotificationMetadata;
|
|
638
|
+
latestRemove?: indexing_v3.Schema$UrlNotificationMetadata;
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* Request Google to index or remove a URL via the Indexing API.
|
|
642
|
+
* Note: The Indexing API officially supports only job posting and livestream content,
|
|
643
|
+
* but can be used for any URL with varying success.
|
|
644
|
+
*/
|
|
645
|
+
declare function requestIndexing(client: GoogleSearchConsoleClient, url: string, options?: {
|
|
646
|
+
type?: IndexingNotificationType;
|
|
647
|
+
}): Promise<IndexingResult>;
|
|
648
|
+
/**
|
|
649
|
+
* Get the indexing notification metadata for a URL.
|
|
650
|
+
* Returns when Google was last notified about updates/removals.
|
|
651
|
+
*/
|
|
652
|
+
declare function getIndexingMetadata(client: GoogleSearchConsoleClient, url: string): Promise<IndexingMetadata>;
|
|
653
|
+
/**
|
|
654
|
+
* Batch request indexing for multiple URLs with rate limiting.
|
|
655
|
+
* Returns results for each URL.
|
|
656
|
+
*/
|
|
657
|
+
declare function batchRequestIndexing(client: GoogleSearchConsoleClient, urls: string[], options?: {
|
|
658
|
+
type?: IndexingNotificationType;
|
|
659
|
+
delayMs?: number;
|
|
660
|
+
onProgress?: (result: IndexingResult, index: number, total: number) => void;
|
|
661
|
+
}): Promise<IndexingResult[]>;
|
|
662
|
+
//#endregion
|
|
663
|
+
//#region src/api/inspection.d.ts
|
|
664
|
+
interface InspectUrlResult {
|
|
665
|
+
url: string;
|
|
666
|
+
inspection?: UrlInspectionResult;
|
|
667
|
+
isIndexed: boolean;
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Inspects a URL in Google Search Console to check its indexing status.
|
|
671
|
+
*/
|
|
672
|
+
declare function inspectUrl(client: GoogleSearchConsoleClient, siteUrl: string, inspectionUrl: string): Promise<{
|
|
673
|
+
inspection: UrlInspectionResult | undefined;
|
|
674
|
+
isIndexed: boolean;
|
|
675
|
+
}>;
|
|
676
|
+
/**
|
|
677
|
+
* Batch inspect multiple URLs with rate limiting.
|
|
678
|
+
* Returns inspection results for each URL.
|
|
679
|
+
*/
|
|
680
|
+
declare function batchInspectUrls(client: GoogleSearchConsoleClient, siteUrl: string, urls: string[], options?: {
|
|
681
|
+
delayMs?: number;
|
|
682
|
+
onProgress?: (result: InspectUrlResult, index: number, total: number) => void;
|
|
683
|
+
}): Promise<InspectUrlResult[]>;
|
|
684
|
+
//#endregion
|
|
685
|
+
//#region src/api/sites.d.ts
|
|
686
|
+
/**
|
|
687
|
+
* Fetches all sites the authenticated user has access to in Google Search Console.
|
|
688
|
+
*/
|
|
689
|
+
declare function fetchSites(client: GoogleSearchConsoleClient): Promise<ApiSite[]>;
|
|
690
|
+
/**
|
|
691
|
+
* Fetches sitemaps for a site.
|
|
692
|
+
*/
|
|
693
|
+
declare function fetchSitemaps(client: GoogleSearchConsoleClient, siteUrl: string): Promise<ApiSitemap[]>;
|
|
694
|
+
/**
|
|
695
|
+
* Gets details for a specific sitemap.
|
|
696
|
+
*/
|
|
697
|
+
declare function fetchSitemap(client: GoogleSearchConsoleClient, siteUrl: string, feedpath: string): Promise<ApiSitemap>;
|
|
698
|
+
/**
|
|
699
|
+
* Submits a sitemap to Google Search Console.
|
|
700
|
+
*/
|
|
701
|
+
declare function submitSitemap(client: GoogleSearchConsoleClient, siteUrl: string, feedpath: string): Promise<void>;
|
|
702
|
+
/**
|
|
703
|
+
* Deletes a sitemap from Google Search Console.
|
|
704
|
+
*/
|
|
705
|
+
declare function deleteSitemap(client: GoogleSearchConsoleClient, siteUrl: string, feedpath: string): Promise<void>;
|
|
706
|
+
/**
|
|
707
|
+
* Fetches all verified sites with their sitemaps from Google Search Console.
|
|
708
|
+
*/
|
|
709
|
+
declare function fetchSitesWithSitemaps(client: GoogleSearchConsoleClient): Promise<(Site & {
|
|
710
|
+
sitemaps: RequiredNonNullable<ApiSitemap>[];
|
|
711
|
+
})[]>;
|
|
712
|
+
//#endregion
|
|
713
|
+
//#region src/api/search-analytics/analytics.d.ts
|
|
714
|
+
/**
|
|
715
|
+
* Fetches overall site analytics summary with period comparison and keyword data.
|
|
716
|
+
*/
|
|
717
|
+
declare function fetchAnalyticsWithComparison(client: GoogleSearchConsoleClient, siteUrl: string, options?: QueryOptions): Promise<ComparisonResult<AnalyticsData>>;
|
|
718
|
+
//#endregion
|
|
719
|
+
//#region src/api/search-analytics/breakdowns.d.ts
|
|
720
|
+
/**
|
|
721
|
+
* Fetches device breakdown (desktop, mobile, tablet) with period comparison.
|
|
722
|
+
*/
|
|
723
|
+
declare function fetchDevicesWithComparison(client: GoogleSearchConsoleClient, siteUrl: string, options?: QueryOptions): Promise<ComparisonResult<DeviceData>>;
|
|
724
|
+
/**
|
|
725
|
+
* Fetches device breakdown (desktop, mobile, tablet).
|
|
726
|
+
*/
|
|
727
|
+
declare function fetchDevices(client: GoogleSearchConsoleClient, siteUrl: string, options?: QueryOptions): Promise<DeviceData[]>;
|
|
728
|
+
/**
|
|
729
|
+
* Fetches top countries by traffic with period comparison and keyword counts per country.
|
|
730
|
+
*/
|
|
731
|
+
declare function fetchCountriesWithComparison(client: GoogleSearchConsoleClient, siteUrl: string, options?: QueryOptions): Promise<ComparisonResult<CountryData>>;
|
|
732
|
+
/**
|
|
733
|
+
* Fetches top countries by traffic.
|
|
734
|
+
*/
|
|
735
|
+
declare function fetchCountries(client: GoogleSearchConsoleClient, siteUrl: string, options?: QueryOptions): Promise<CountryData[]>;
|
|
736
|
+
/**
|
|
737
|
+
* Fetches search appearance breakdown (AMP, rich results, etc.) with period comparison.
|
|
738
|
+
*/
|
|
739
|
+
declare function fetchSearchAppearanceWithComparison(client: GoogleSearchConsoleClient, siteUrl: string, options?: QueryOptions): Promise<ComparisonResult<SearchAppearanceData>>;
|
|
740
|
+
/**
|
|
741
|
+
* Fetches search appearance breakdown (AMP, rich results, etc.).
|
|
742
|
+
*/
|
|
743
|
+
declare function fetchSearchAppearance(client: GoogleSearchConsoleClient, siteUrl: string, options?: QueryOptions): Promise<SearchAppearanceData[]>;
|
|
744
|
+
//#endregion
|
|
745
|
+
//#region src/api/search-analytics/dates.d.ts
|
|
746
|
+
interface DatesComparisonResult {
|
|
747
|
+
current: DateData[];
|
|
748
|
+
previous: DateData[];
|
|
749
|
+
metadata: {
|
|
750
|
+
currentCount: number;
|
|
751
|
+
previousCount: number;
|
|
752
|
+
totals: {
|
|
753
|
+
current: {
|
|
754
|
+
clicks: number;
|
|
755
|
+
impressions: number;
|
|
756
|
+
ctr: number;
|
|
757
|
+
position: number;
|
|
758
|
+
};
|
|
759
|
+
previous: {
|
|
760
|
+
clicks: number;
|
|
761
|
+
impressions: number;
|
|
762
|
+
ctr: number;
|
|
763
|
+
position: number;
|
|
764
|
+
};
|
|
765
|
+
clicksPercent: number;
|
|
766
|
+
impressionsPercent: number;
|
|
767
|
+
ctrPercent: number;
|
|
768
|
+
positionPercent: number;
|
|
769
|
+
};
|
|
770
|
+
};
|
|
771
|
+
}
|
|
772
|
+
/**
|
|
773
|
+
* Fetches daily search analytics data with period-over-period comparison.
|
|
774
|
+
*/
|
|
775
|
+
declare function fetchDatesWithComparison(client: GoogleSearchConsoleClient, siteUrl: string, options?: QueryOptions): Promise<DatesComparisonResult>;
|
|
776
|
+
interface YoYComparisonOptions {
|
|
777
|
+
/** Current period to compare. If not provided, uses last 28 days */
|
|
778
|
+
period?: Period;
|
|
779
|
+
}
|
|
780
|
+
interface YoYMetrics {
|
|
781
|
+
clicks: number;
|
|
782
|
+
impressions: number;
|
|
783
|
+
ctr: number;
|
|
784
|
+
position: number;
|
|
785
|
+
}
|
|
786
|
+
interface YoYComparisonResult {
|
|
787
|
+
current: YoYMetrics;
|
|
788
|
+
previous: YoYMetrics;
|
|
789
|
+
change: {
|
|
790
|
+
clicks: number;
|
|
791
|
+
clicksPercent: number;
|
|
792
|
+
impressions: number;
|
|
793
|
+
impressionsPercent: number;
|
|
794
|
+
ctr: number;
|
|
795
|
+
ctrPercent: number;
|
|
796
|
+
position: number;
|
|
797
|
+
positionPercent: number;
|
|
798
|
+
};
|
|
799
|
+
periodDays: number;
|
|
800
|
+
withinLimit: boolean;
|
|
801
|
+
}
|
|
802
|
+
/**
|
|
803
|
+
* Fetches year-over-year comparison for site metrics.
|
|
804
|
+
* GSC has ~16 months history, so works for periods up to ~4 months.
|
|
805
|
+
*/
|
|
806
|
+
declare function fetchYoYComparison(client: GoogleSearchConsoleClient, siteUrl: string, options?: YoYComparisonOptions): Promise<YoYComparisonResult>;
|
|
807
|
+
/**
|
|
808
|
+
* Fetches daily search analytics data for a site.
|
|
809
|
+
*/
|
|
810
|
+
declare function fetchDates(client: GoogleSearchConsoleClient, siteUrl: string, options?: QueryOptions): Promise<DateData[]>;
|
|
811
|
+
//#endregion
|
|
812
|
+
//#region src/api/search-analytics/keywords.d.ts
|
|
813
|
+
/**
|
|
814
|
+
* Fetches keyword/query performance data with period comparison and associated pages.
|
|
815
|
+
*/
|
|
816
|
+
declare function fetchKeywordsWithComparison(client: GoogleSearchConsoleClient, siteUrl: string, options?: QueryOptions): Promise<ComparisonResult<KeywordData>>;
|
|
817
|
+
/**
|
|
818
|
+
* Fetches all keywords with their performance data using recursive pagination.
|
|
819
|
+
*/
|
|
820
|
+
declare function fetchKeywords(client: GoogleSearchConsoleClient, siteUrl: string, options?: QueryOptions): Promise<KeywordData[]>;
|
|
821
|
+
interface FetchKeywordOptions extends QueryOptions {
|
|
822
|
+
/** Maximum pages to return. Default: 5 */
|
|
823
|
+
rowLimit?: number;
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Fetches detailed data for a specific keyword including daily trends and top pages.
|
|
827
|
+
*/
|
|
828
|
+
declare function fetchKeyword(client: GoogleSearchConsoleClient, siteUrl: string, keyword: string, options?: FetchKeywordOptions): Promise<FetchKeywordResult>;
|
|
829
|
+
//#endregion
|
|
830
|
+
//#region src/api/search-analytics/pages.d.ts
|
|
831
|
+
type Page = ({
|
|
832
|
+
page: string;
|
|
833
|
+
});
|
|
834
|
+
/**
|
|
835
|
+
* Fetches all pages with their performance data using recursive pagination.
|
|
836
|
+
*/
|
|
837
|
+
declare function fetchPages(client: GoogleSearchConsoleClient, siteUrl: string, options?: QueryOptions): Promise<Page[]>;
|
|
838
|
+
/**
|
|
839
|
+
* Fetches page performance data with period comparison, including top keyword per page.
|
|
840
|
+
*/
|
|
841
|
+
declare function fetchPagesWithComparison(client: GoogleSearchConsoleClient, siteUrl: string, options?: QueryOptions): Promise<ComparisonResult<PageData>>;
|
|
842
|
+
interface FetchPageOptions extends QueryOptions {
|
|
843
|
+
/** Maximum keywords to return. Default: 5 */
|
|
844
|
+
rowLimit?: number;
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* Fetches detailed data for a specific page including daily trends and top keywords.
|
|
848
|
+
*/
|
|
849
|
+
declare function fetchPage(client: GoogleSearchConsoleClient, siteUrl: string, url: string, options?: FetchPageOptions): Promise<FetchPageResult>;
|
|
850
|
+
//#endregion
|
|
851
|
+
//#region src/api/search-analytics/query.d.ts
|
|
852
|
+
/**
|
|
853
|
+
* Recursively queries GSC search analytics, automatically handling pagination for large datasets.
|
|
854
|
+
*/
|
|
855
|
+
declare function queryRecursive(client: GoogleSearchConsoleClient, siteUrl: string, query: SearchAnalyticsQuery, options?: {
|
|
856
|
+
onProgress?: (rows: number) => void;
|
|
857
|
+
}): Promise<{
|
|
858
|
+
rows: DataRow[];
|
|
859
|
+
pages: number;
|
|
860
|
+
}>;
|
|
861
|
+
/**
|
|
862
|
+
* Creates a GSC search analytics query request body with standard defaults.
|
|
863
|
+
*/
|
|
864
|
+
declare function createQueryBody(options?: QueryOptions): SearchAnalyticsQuery;
|
|
865
|
+
/**
|
|
866
|
+
* Helper to add search appearance dimension filter.
|
|
867
|
+
* Use with spread: createQueryBody({ ...withSearchAppearance('AMP'), period })
|
|
868
|
+
*/
|
|
869
|
+
declare function withSearchAppearance(appearance: string): Pick<QueryOptions, 'filters'>;
|
|
870
|
+
/**
|
|
871
|
+
* Helper to set data type (web, image, video, news, discover, googleNews).
|
|
872
|
+
* Use with spread: createQueryBody({ ...withDataType('image'), period })
|
|
873
|
+
*/
|
|
874
|
+
declare function withDataType(type: DataType): Pick<QueryOptions, 'type'>;
|
|
875
|
+
/**
|
|
876
|
+
* Helper to include fresh/unfinalized data (last 3 days).
|
|
877
|
+
* Use with spread: createQueryBody({ ...withFreshData(), period })
|
|
878
|
+
*/
|
|
879
|
+
declare function withFreshData(): Pick<QueryOptions, 'dataState'>;
|
|
880
|
+
/**
|
|
881
|
+
* Helper to use only finalized data (excludes last 3 days).
|
|
882
|
+
* Use with spread: createQueryBody({ ...withFinalData(), period })
|
|
883
|
+
*/
|
|
884
|
+
declare function withFinalData(): Pick<QueryOptions, 'dataState'>;
|
|
885
|
+
/**
|
|
886
|
+
* Helper to use byProperty aggregation (domain-level rollup).
|
|
887
|
+
* Use for sc-domain: properties to get true totals.
|
|
888
|
+
* Use with spread: createQueryBody({ ...withPropertyAggregation(), period })
|
|
889
|
+
*/
|
|
890
|
+
declare function withPropertyAggregation(): Pick<QueryOptions, 'aggregationType'>;
|
|
891
|
+
//#endregion
|
|
892
|
+
//#region src/api/search-analytics/stream.d.ts
|
|
893
|
+
/**
|
|
894
|
+
* Supported GSC dimensions for streaming queries.
|
|
895
|
+
* Maps to GSC API dimension names.
|
|
896
|
+
*/
|
|
897
|
+
type DimensionKey = 'query' | 'page' | 'date' | 'device' | 'country';
|
|
898
|
+
/**
|
|
899
|
+
* Maps each dimension to its output field name.
|
|
900
|
+
* Note: 'query' maps to 'keyword' to match existing API conventions.
|
|
901
|
+
*/
|
|
902
|
+
type DimensionFields = {
|
|
903
|
+
query: {
|
|
904
|
+
keyword: string;
|
|
905
|
+
};
|
|
906
|
+
page: {
|
|
907
|
+
page: string;
|
|
908
|
+
};
|
|
909
|
+
date: {
|
|
910
|
+
date: string;
|
|
911
|
+
};
|
|
912
|
+
device: {
|
|
913
|
+
device: string;
|
|
914
|
+
};
|
|
915
|
+
country: {
|
|
916
|
+
country: string;
|
|
917
|
+
};
|
|
918
|
+
};
|
|
919
|
+
/**
|
|
920
|
+
* Recursively extracts and merges fields for each dimension in a tuple.
|
|
921
|
+
* Used for type inference from dimensions array.
|
|
922
|
+
*/
|
|
923
|
+
type ExtractFields<D extends readonly DimensionKey[]> = D extends readonly [infer First extends DimensionKey, ...infer Rest extends DimensionKey[]] ? DimensionFields[First] & ExtractFields<Rest> : object;
|
|
924
|
+
/**
|
|
925
|
+
* Output row type for streaming queries.
|
|
926
|
+
* Combines GSC metrics (clicks, impressions, ctr, position) with
|
|
927
|
+
* typed dimension fields based on the dimensions array.
|
|
928
|
+
*
|
|
929
|
+
* @example
|
|
930
|
+
* // For dimensions: ['query', 'page']
|
|
931
|
+
* // StreamRow = { keyword: string, page: string, clicks?: number, impressions?: number, ctr?: number, position?: number }
|
|
932
|
+
*/
|
|
933
|
+
type StreamRow<D extends readonly DimensionKey[]> = Omit<DataRow, 'keys'> & ExtractFields<D>;
|
|
934
|
+
/**
|
|
935
|
+
* Async generator for memory-efficient pagination of GSC search analytics.
|
|
936
|
+
* Yields batches of typed rows as they're fetched, avoiding accumulation in memory.
|
|
937
|
+
*
|
|
938
|
+
* **Design:** Single generic function with type inference replaces separate
|
|
939
|
+
* `fetchPagesStream`, `fetchKeywordsStream` wrappers. Output type is inferred
|
|
940
|
+
* from the dimensions tuple:
|
|
941
|
+
* - `['query']` → `{ keyword: string, clicks, impressions, ctr, position }`
|
|
942
|
+
* - `['page']` → `{ page: string, clicks, impressions, ctr, position }`
|
|
943
|
+
* - `['query', 'page']` → `{ keyword: string, page: string, ... }`
|
|
944
|
+
*
|
|
945
|
+
* Each yield contains up to 25,000 rows (one API page). Use `collectStream()`
|
|
946
|
+
* to gather all batches if full array is needed.
|
|
947
|
+
*
|
|
948
|
+
* @param client - GSC client instance
|
|
949
|
+
* @param siteUrl - Site URL (e.g., 'https://example.com/' or 'sc-domain:example.com')
|
|
950
|
+
* @param query - Query with dimensions array (requires `as const` for type inference)
|
|
951
|
+
*
|
|
952
|
+
* @example
|
|
953
|
+
* ```ts
|
|
954
|
+
* // Stream keyword+page combinations
|
|
955
|
+
* for await (const batch of queryRecursiveStream(client, url, {
|
|
956
|
+
* dimensions: ['query', 'page'] as const,
|
|
957
|
+
* startDate: '2024-01-01',
|
|
958
|
+
* endDate: '2024-01-31',
|
|
959
|
+
* })) {
|
|
960
|
+
* // batch: { keyword: string, page: string, clicks, impressions, ctr, position }[]
|
|
961
|
+
* await db.insert(batch)
|
|
962
|
+
* }
|
|
963
|
+
*
|
|
964
|
+
* // Or collect all at once
|
|
965
|
+
* const allRows = await collectStream(queryRecursiveStream(client, url, {
|
|
966
|
+
* dimensions: ['page'] as const,
|
|
967
|
+
* startDate: '2024-01-01',
|
|
968
|
+
* endDate: '2024-01-31',
|
|
969
|
+
* }))
|
|
970
|
+
* ```
|
|
971
|
+
*
|
|
972
|
+
* @remarks
|
|
973
|
+
* - Requires `as const` on dimensions array for proper type inference
|
|
974
|
+
* - Use for large datasets (>25k rows) where memory is a concern
|
|
975
|
+
* - Non-paginating queries (devices, countries) don't benefit from streaming
|
|
976
|
+
*/
|
|
977
|
+
declare function queryRecursiveStream<const D extends readonly DimensionKey[]>(client: GoogleSearchConsoleClient, siteUrl: string, query: Omit<SearchAnalyticsQuery, 'dimensions'> & {
|
|
978
|
+
dimensions: D;
|
|
979
|
+
}): AsyncGenerator<StreamRow<D>[], void, undefined>;
|
|
980
|
+
/** Collect all batches into single array (for testing / simple cases) */
|
|
981
|
+
declare function collectStream<T>(gen: AsyncGenerator<T[], void, undefined>): Promise<T[]>;
|
|
982
|
+
//#endregion
|
|
983
|
+
//#region src/core/errors.d.ts
|
|
984
|
+
/**
|
|
985
|
+
* GSC API error detection and formatting utilities.
|
|
986
|
+
* Provides helpful messages for quota exceeded and rate limit errors.
|
|
987
|
+
*/
|
|
988
|
+
interface ErrorInfo {
|
|
989
|
+
isQuotaError: boolean;
|
|
990
|
+
isRateLimitError: boolean;
|
|
991
|
+
isAuthError: boolean;
|
|
992
|
+
code?: number;
|
|
993
|
+
message: string;
|
|
994
|
+
retryAfter?: number;
|
|
995
|
+
suggestion: string;
|
|
996
|
+
}
|
|
997
|
+
/** GSC API quota limits (approximate) */
|
|
998
|
+
declare const GSC_QUOTAS: {
|
|
999
|
+
/** Search Analytics API: ~25,000 requests/day per project */
|
|
1000
|
+
readonly searchAnalytics: 25000;
|
|
1001
|
+
/** URL Inspection API: ~2,000 requests/day per property */
|
|
1002
|
+
readonly urlInspection: 2000;
|
|
1003
|
+
/** Indexing API: ~200 requests/day per property */
|
|
1004
|
+
readonly indexing: 200;
|
|
1005
|
+
};
|
|
1006
|
+
/**
|
|
1007
|
+
* Detects if an error is a quota exceeded error (403 quotaExceeded).
|
|
1008
|
+
*/
|
|
1009
|
+
declare function isQuotaError(error: unknown): boolean;
|
|
1010
|
+
/**
|
|
1011
|
+
* Detects if an error is a rate limit error (429 Too Many Requests).
|
|
1012
|
+
*/
|
|
1013
|
+
declare function isRateLimitError(error: unknown): boolean;
|
|
1014
|
+
/**
|
|
1015
|
+
* Detects if an error is an authentication error (401/403 without quota).
|
|
1016
|
+
*/
|
|
1017
|
+
declare function isAuthError(error: unknown): boolean;
|
|
1018
|
+
/**
|
|
1019
|
+
* Extracts HTTP status code from various error formats.
|
|
1020
|
+
*/
|
|
1021
|
+
declare function getErrorCode(error: unknown): number | undefined;
|
|
1022
|
+
/**
|
|
1023
|
+
* Extracts error message from various error formats.
|
|
1024
|
+
*/
|
|
1025
|
+
declare function getErrorMessage(error: unknown): string;
|
|
1026
|
+
/**
|
|
1027
|
+
* Extracts retry-after value from error headers (in seconds).
|
|
1028
|
+
*/
|
|
1029
|
+
declare function getRetryAfter(error: unknown): number | undefined;
|
|
1030
|
+
/**
|
|
1031
|
+
* Analyzes an error and returns structured information with suggestions.
|
|
1032
|
+
*/
|
|
1033
|
+
declare function analyzeError(error: unknown): ErrorInfo;
|
|
1034
|
+
/**
|
|
1035
|
+
* Formats an error for CLI display with color codes.
|
|
1036
|
+
*/
|
|
1037
|
+
declare function formatErrorForCli(error: unknown): string;
|
|
1038
|
+
//#endregion
|
|
1039
|
+
//#region src/utils/countries.d.ts
|
|
1040
|
+
declare const _default: {
|
|
1041
|
+
name: string;
|
|
1042
|
+
'alpha-2': string;
|
|
1043
|
+
'alpha-3': string;
|
|
1044
|
+
'country-code': string;
|
|
1045
|
+
}[];
|
|
1046
|
+
//#endregion
|
|
1047
|
+
//#region src/query/constants.d.ts
|
|
1048
|
+
declare const Device: {
|
|
1049
|
+
readonly MOBILE: "MOBILE";
|
|
1050
|
+
readonly DESKTOP: "DESKTOP";
|
|
1051
|
+
readonly TABLET: "TABLET";
|
|
1052
|
+
};
|
|
1053
|
+
type Device = typeof Device[keyof typeof Device];
|
|
1054
|
+
declare const Country: { [K in (typeof _default)[number]["alpha-3"]]: Lowercase<K> };
|
|
1055
|
+
type Country = typeof Country[keyof typeof Country];
|
|
1056
|
+
//#endregion
|
|
1057
|
+
//#region src/query/types.d.ts
|
|
1058
|
+
interface DimensionValueMap {
|
|
1059
|
+
query: string;
|
|
1060
|
+
page: string;
|
|
1061
|
+
country: Country;
|
|
1062
|
+
device: Device;
|
|
1063
|
+
searchAppearance: string;
|
|
1064
|
+
date: string;
|
|
1065
|
+
}
|
|
1066
|
+
type Dimension = keyof DimensionValueMap;
|
|
1067
|
+
declare const ColumnBrand: unique symbol;
|
|
1068
|
+
interface Column<D extends Dimension> {
|
|
1069
|
+
readonly [ColumnBrand]: D;
|
|
1070
|
+
readonly dimension: D;
|
|
1071
|
+
}
|
|
1072
|
+
type FilterOperator = 'equals' | 'notEquals' | 'contains' | 'notContains' | 'includingRegex' | 'excludingRegex';
|
|
1073
|
+
type DateOperator = 'gte' | 'gt' | 'lte' | 'lt' | 'between';
|
|
1074
|
+
interface InternalFilter {
|
|
1075
|
+
dimension: Dimension;
|
|
1076
|
+
operator: FilterOperator | DateOperator;
|
|
1077
|
+
expression: string;
|
|
1078
|
+
expression2?: string;
|
|
1079
|
+
}
|
|
1080
|
+
declare const FilterBrand: unique symbol;
|
|
1081
|
+
interface Filter<C = object> {
|
|
1082
|
+
readonly [FilterBrand]: true;
|
|
1083
|
+
readonly _constraints: C;
|
|
1084
|
+
readonly _filters: InternalFilter[];
|
|
1085
|
+
readonly _groupType?: 'and' | 'or';
|
|
1086
|
+
}
|
|
1087
|
+
type MergeConstraints<F extends Filter<any>[]> = UnionToIntersection<F[number]['_constraints']>;
|
|
1088
|
+
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
|
1089
|
+
interface GSCResult<D extends Dimension[], C> {
|
|
1090
|
+
rows: Array<GSCRow<D, C>>;
|
|
1091
|
+
}
|
|
1092
|
+
type GSCRow<D extends Dimension[], C> = { [K in D[number]]: K extends keyof C ? C[K] : DimensionValueMap[K] } & {
|
|
1093
|
+
clicks: number;
|
|
1094
|
+
impressions: number;
|
|
1095
|
+
ctr: number;
|
|
1096
|
+
position: number;
|
|
1097
|
+
};
|
|
1098
|
+
interface BuilderState {
|
|
1099
|
+
dimensions: Dimension[];
|
|
1100
|
+
filters: Filter<any>[];
|
|
1101
|
+
siteUrl?: string;
|
|
1102
|
+
rowLimit?: number;
|
|
1103
|
+
}
|
|
1104
|
+
//#endregion
|
|
1105
|
+
//#region src/query/builder.d.ts
|
|
1106
|
+
interface GSCQueryBuilder<D extends Dimension[] = [], C = object> {
|
|
1107
|
+
select<T extends Dimension[]>(...dims: T): GSCQueryBuilder<T, C>;
|
|
1108
|
+
where<F extends Filter<any>>(filter: F): GSCQueryBuilder<D, C & F['_constraints']>;
|
|
1109
|
+
siteUrl(url: string): GSCQueryBuilder<D, C>;
|
|
1110
|
+
limit(n: number): GSCQueryBuilder<D, C>;
|
|
1111
|
+
execute(client: GoogleSearchConsoleClient): Promise<GSCResult<D, C>>;
|
|
1112
|
+
toBody(): SearchAnalyticsQuery;
|
|
1113
|
+
/** Expose internal state for analysis functions to merge with */
|
|
1114
|
+
getState(): BuilderState;
|
|
1115
|
+
}
|
|
1116
|
+
declare const gsc: GSCQueryBuilder<[], object>;
|
|
1117
|
+
//#endregion
|
|
1118
|
+
//#region src/query/resolver.d.ts
|
|
1119
|
+
/**
|
|
1120
|
+
* Extract date range from filters. Used by analysis functions to get the period.
|
|
1121
|
+
*/
|
|
1122
|
+
declare function extractDateRange(filters: Filter<any>[]): {
|
|
1123
|
+
startDate?: string;
|
|
1124
|
+
endDate?: string;
|
|
1125
|
+
};
|
|
1126
|
+
//#endregion
|
|
1127
|
+
//#region src/query/columns.d.ts
|
|
1128
|
+
declare const page: Column<"page">;
|
|
1129
|
+
declare const query: Column<"query">;
|
|
1130
|
+
declare const device: Column<"device">;
|
|
1131
|
+
declare const country: Column<"country">;
|
|
1132
|
+
declare const searchAppearance: Column<"searchAppearance">;
|
|
1133
|
+
declare const date: Column<"date">;
|
|
1134
|
+
//#endregion
|
|
1135
|
+
//#region src/query/operators.d.ts
|
|
1136
|
+
declare function eq<D extends Dimension, V extends DimensionValueMap[D]>(column: Column<D>, value: V): Filter<Record<D, V>>;
|
|
1137
|
+
declare function ne<D extends Dimension>(column: Column<D>, value: DimensionValueMap[D]): Filter<object>;
|
|
1138
|
+
declare function inArray<D extends Dimension, V extends DimensionValueMap[D]>(column: Column<D>, values: readonly V[]): Filter<Record<D, V>>;
|
|
1139
|
+
declare function contains<D extends Dimension>(column: Column<D>, pattern: string): Filter<object>;
|
|
1140
|
+
declare function like<D extends Dimension>(column: Column<D>, pattern: string): Filter<object>;
|
|
1141
|
+
declare function regex<D extends Dimension>(column: Column<D>, pattern: RegExp | string): Filter<object>;
|
|
1142
|
+
declare function notRegex<D extends Dimension>(column: Column<D>, pattern: RegExp | string): Filter<object>;
|
|
1143
|
+
declare function and<F extends Filter<any>[]>(...filters: F): Filter<MergeConstraints<F>>;
|
|
1144
|
+
declare function or<F extends Filter<any>[]>(...filters: F): Filter<object>;
|
|
1145
|
+
declare function not<F extends Filter<any>>(filter: F): Filter<object>;
|
|
1146
|
+
declare function gte<D extends Dimension>(column: Column<D>, value: DimensionValueMap[D]): Filter<object>;
|
|
1147
|
+
declare function gt<D extends Dimension>(column: Column<D>, value: DimensionValueMap[D]): Filter<object>;
|
|
1148
|
+
declare function lte<D extends Dimension>(column: Column<D>, value: DimensionValueMap[D]): Filter<object>;
|
|
1149
|
+
declare function lt<D extends Dimension>(column: Column<D>, value: DimensionValueMap[D]): Filter<object>;
|
|
1150
|
+
declare function between<D extends Dimension>(column: Column<D>, start: DimensionValueMap[D], end: DimensionValueMap[D]): Filter<object>;
|
|
1151
|
+
//#endregion
|
|
1152
|
+
//#region src/utils/format.d.ts
|
|
1153
|
+
interface ResolvedPeriodRange {
|
|
1154
|
+
period: {
|
|
1155
|
+
startTimestamp: number;
|
|
1156
|
+
start: Date;
|
|
1157
|
+
startDateTime: string;
|
|
1158
|
+
startDate: string;
|
|
1159
|
+
end: Date;
|
|
1160
|
+
endDate: string;
|
|
1161
|
+
endTimestamp: number;
|
|
1162
|
+
endDateTime: string;
|
|
1163
|
+
};
|
|
1164
|
+
prevPeriod: {
|
|
1165
|
+
start: Date;
|
|
1166
|
+
startDate: string;
|
|
1167
|
+
end: Date;
|
|
1168
|
+
endDate: string;
|
|
1169
|
+
};
|
|
1170
|
+
}
|
|
1171
|
+
/**
|
|
1172
|
+
* Formats a date for GSC API queries (YYYY-MM-DD format).
|
|
1173
|
+
* @param d - Date object, date string, or null/undefined
|
|
1174
|
+
* @returns Formatted date string or null/undefined if input is falsy
|
|
1175
|
+
*/
|
|
1176
|
+
declare function formatDateGsc(d?: Date | string | null): string | null | undefined;
|
|
1177
|
+
/**
|
|
1178
|
+
* Calculates the percentage difference between two values.
|
|
1179
|
+
* Returns 0 if either value is null, undefined, or 0 (no meaningful comparison).
|
|
1180
|
+
* @param a - Current value
|
|
1181
|
+
* @param b - Previous/comparison value
|
|
1182
|
+
* @returns Percentage difference (positive = increase, negative = decrease), or 0 if either value is falsy
|
|
1183
|
+
*/
|
|
1184
|
+
declare function percentDifference(a?: number | null, b?: number | null): number;
|
|
1185
|
+
/**
|
|
1186
|
+
* Resolves a period string or object into start/end dates for current and previous periods.
|
|
1187
|
+
* @param periodRange - Period string (e.g., '30d', '3mo', 'all') or Period object with start/end dates
|
|
1188
|
+
* @returns Resolved period ranges with timestamps and formatted dates for both current and previous periods
|
|
1189
|
+
*/
|
|
1190
|
+
declare function userPeriodRange(periodRange?: string | Period): ResolvedPeriodRange;
|
|
1191
|
+
//#endregion
|
|
1192
|
+
//#region src/utils/dayjs.d.ts
|
|
1193
|
+
declare function dayjs(date?: _dayjs.ConfigType): Dayjs;
|
|
1194
|
+
//#endregion
|
|
1195
|
+
export { AggregationType, AnalyticsData, ApiSite, ApiSitemap, ApiSitemapContent, Auth, AuthClient, AuthOptions, BaseMetrics, BrandSegmentationOptions, BrandSegmentationResult, BrandSummary, type BuilderState, CannibalizationOptions, CannibalizationPage, CannibalizationResult, CannibalizationSortMetric, ClusterType, ClusteringOptions, ClusteringResult, type Column, ComparisonResult, ConcentrationInput, ConcentrationItem, ConcentrationOptions, ConcentrationResult, ConcentrationRiskLevel, Country, type Country as CountryType, CountryData, DataRow, DataState, DataType, DateData, DateMetrics, DateRow, DatesComparisonResult, DecayInput, DecayOptions, DecayResult, DecaySortMetric, Device, type Device as DeviceType, DeviceData, type Dimension, DimensionFilter, DimensionFilterGroup, DimensionKey, type DimensionValueMap, ErrorInfo, FetchKeywordOptions, FetchKeywordResult, FetchPageOptions, FetchPageResult, type Filter, type GSCQueryBuilder, type GSCResult, type GSCRow, GSC_QUOTAS, GoogleSearchConsoleClient, GoogleSearchConsoleClientOptions, IndexStatusResult, IndexingMetadata, IndexingNotificationType, IndexingResult, InspectUrlIndexResponse, InspectUrlResult, KeywordCluster, KeywordData, KeywordRow, MobileUsabilityResult, MonthlyData, MoverData, MoversInput, MoversOptions, MoversResult, MoversSortMetric, OpportunityFactors, OpportunityOptions, OpportunityResult, OpportunitySortMetric, OpportunityWeights, Page, PageData, PageRow, Period, PublishUrlNotificationResponse, QueryOptions, QueryPageRow, QueryResultRow, RequiredNonNullable, ResolvedAnalyticsRange, ResolvedPeriodRange, RichResultsResult, SearchAnalyticsQuery, SearchAnalyticsResponse, SearchAppearanceData, SeasonalityMetric, SeasonalityOptions, SeasonalityResult, Site, SiteAnalytics, SortOrder, StreamRow, StrikingDistanceOptions, StrikingDistanceResult, StrikingDistanceSortMetric, UrlInspectionResult, UrlNotificationMetadata, YoYComparisonOptions, YoYComparisonResult, YoYMetrics, ZeroClickOptions, ZeroClickResult, analyzeBrandSegmentation, analyzeCannibalization, analyzeClustering, analyzeConcentration, analyzeDecay, analyzeError, analyzeKeywordConcentration, analyzeMovers, analyzeOpportunity, analyzePageConcentration, analyzeSeasonality, analyzeStrikingDistance, analyzeZeroClick, and, batchInspectUrls, batchRequestIndexing, between, collectStream, contains, _default as countries, country, createAuth, createFetch, createQueryBody, createSorter, date, dayjs, deleteSitemap, device, eq, extractDateRange, fetchAnalyticsWithComparison, fetchCountries, fetchCountriesWithComparison, fetchDates, fetchDatesWithComparison, fetchDevices, fetchDevicesWithComparison, fetchKeyword, fetchKeywords, fetchKeywordsWithComparison, fetchPage, fetchPages, fetchPagesWithComparison, fetchSearchAppearance, fetchSearchAppearanceWithComparison, fetchSitemap, fetchSitemaps, fetchSites, fetchSitesWithSitemaps, fetchYoYComparison, formatDateGsc, formatErrorForCli, getErrorCode, getErrorMessage, getIndexingMetadata, getRetryAfter, googleSearchConsole, gsc, gt, gte, inArray, inspectUrl, isAuthError, isQuotaError, isRateLimitError, like, lt, lte, ne, not, notRegex, num, or, page, percentDifference, query, queryRecursive, queryRecursiveStream, regex, requestIndexing, searchAppearance, submitSitemap, userPeriodRange, withDataType, withFinalData, withFreshData, withPropertyAggregation, withSearchAppearance };
|