gscdump 3.0.0 → 3.2.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.
package/README.md CHANGED
@@ -89,6 +89,12 @@ const evidence = await client.getIndexingEvidence(
89
89
 
90
90
  if (evidence.ok)
91
91
  console.log(evidence.value)
92
+
93
+ const [pages, queries, crawl] = await Promise.all([
94
+ client.getPageStats('https://example.com/'),
95
+ client.getQueryStats('https://example.com/'),
96
+ client.getCrawlStats('https://example.com/'),
97
+ ])
92
98
  ```
93
99
 
94
100
  Sitemap XML reading and traversal lives in `sitemapd`. Product feed scoping and
@@ -1,5 +1,5 @@
1
1
  import { err, ok } from "../core/result.mjs";
2
- import { normalizeBingCrawlIssue, normalizeBingIndexingEvidence, normalizeBingPageStats, normalizeBingSite, normalizeBingUrlInfo, normalizeBingUrlTrafficInfo } from "./normalize.mjs";
2
+ import { normalizeBingCrawlIssue, normalizeBingCrawlStats, normalizeBingIndexingEvidence, normalizeBingPageStats, normalizeBingQueryStats, normalizeBingRankAndTrafficStats, normalizeBingSite, normalizeBingUrlInfo, normalizeBingUrlTrafficInfo } from "./normalize.mjs";
3
3
  const DEFAULT_BING_WEBMASTER_API_URL = "https://www.bing.com/webmaster/api.svc/json";
4
4
  const DEFAULT_BING_CHILD_PAGE_LIMIT = 100;
5
5
  const BING_MAX_CHILD_PAGE_COUNT = 65536;
@@ -206,6 +206,18 @@ function bingWebmaster(options) {
206
206
  query: { siteUrl },
207
207
  signal: callOptions?.signal
208
208
  }),
209
+ getQueryStats: (siteUrl, callOptions) => request("GetQueryStats", parseList(normalizeBingQueryStats), {
210
+ query: { siteUrl },
211
+ signal: callOptions?.signal
212
+ }),
213
+ getRankAndTrafficStats: (siteUrl, callOptions) => request("GetRankAndTrafficStats", parseList(normalizeBingRankAndTrafficStats), {
214
+ query: { siteUrl },
215
+ signal: callOptions?.signal
216
+ }),
217
+ getCrawlStats: (siteUrl, callOptions) => request("GetCrawlStats", parseList(normalizeBingCrawlStats), {
218
+ query: { siteUrl },
219
+ signal: callOptions?.signal
220
+ }),
209
221
  getCrawlIssues: (siteUrl, callOptions) => request("GetCrawlIssues", parseList(normalizeBingCrawlIssue), {
210
222
  query: { siteUrl },
211
223
  signal: callOptions?.signal
@@ -1,4 +1,4 @@
1
- import { BingCallOptions, BingChildrenFilters, BingChildrenOptions, BingCrawlDateFilter, BingCrawlEvidence, BingCrawlIssue, BingCrawlIssueWire, BingDiscoveredDateFilter, BingDocumentFilter, BingEvidenceError, BingFetch, BingHttpCodeFilter, BingIndexingEvidence, BingOperation, BingPageStats, BingProviderError, BingQueryStatsWire, BingSite, BingSiteWire, BingUnknownEvidence, BingUrlInfo, BingUrlInfoWire, BingUrlTrafficInfo, BingUrlTrafficInfoWire, BingUrlWithCrawlIssues, BingWebmasterClient, BingWebmasterOptions, BingWireResponse } from "./types.mjs";
1
+ import { BingCallOptions, BingChildrenFilters, BingChildrenOptions, BingCrawlDateFilter, BingCrawlEvidence, BingCrawlIssue, BingCrawlIssueWire, BingCrawlStats, BingCrawlStatsWire, BingDiscoveredDateFilter, BingDocumentFilter, BingEvidenceError, BingFetch, BingHttpCodeFilter, BingIndexingEvidence, BingOperation, BingPageStats, BingProviderError, BingQueryStats, BingQueryStatsWire, BingRankAndTrafficStats, BingRankAndTrafficStatsWire, BingSite, BingSiteWire, BingUnknownEvidence, BingUrlInfo, BingUrlInfoWire, BingUrlTrafficInfo, BingUrlTrafficInfoWire, BingUrlWithCrawlIssues, BingWebmasterClient, BingWebmasterOptions, BingWireResponse } from "./types.mjs";
2
2
  import { DEFAULT_BING_CHILD_PAGE_LIMIT, DEFAULT_BING_WEBMASTER_API_URL, bingWebmaster } from "./client.mjs";
3
- import { normalizeBingCrawlIssue, normalizeBingIndexingEvidence, normalizeBingPageStats, normalizeBingSite, normalizeBingUrlInfo, normalizeBingUrlTrafficInfo } from "./normalize.mjs";
4
- export { type BingCallOptions, type BingChildrenFilters, type BingChildrenOptions, type BingCrawlDateFilter, type BingCrawlEvidence, type BingCrawlIssue, type BingCrawlIssueWire, type BingDiscoveredDateFilter, type BingDocumentFilter, type BingEvidenceError, type BingFetch, type BingHttpCodeFilter, type BingIndexingEvidence, type BingOperation, type BingPageStats, type BingProviderError, type BingQueryStatsWire, type BingSite, type BingSiteWire, type BingUnknownEvidence, type BingUrlInfo, type BingUrlInfoWire, type BingUrlTrafficInfo, type BingUrlTrafficInfoWire, type BingUrlWithCrawlIssues, type BingWebmasterClient, type BingWebmasterOptions, type BingWireResponse, DEFAULT_BING_CHILD_PAGE_LIMIT, DEFAULT_BING_WEBMASTER_API_URL, bingWebmaster, normalizeBingCrawlIssue, normalizeBingIndexingEvidence, normalizeBingPageStats, normalizeBingSite, normalizeBingUrlInfo, normalizeBingUrlTrafficInfo };
3
+ import { normalizeBingCrawlIssue, normalizeBingCrawlStats, normalizeBingIndexingEvidence, normalizeBingPageStats, normalizeBingQueryStats, normalizeBingRankAndTrafficStats, normalizeBingSite, normalizeBingUrlInfo, normalizeBingUrlTrafficInfo } from "./normalize.mjs";
4
+ export { type BingCallOptions, type BingChildrenFilters, type BingChildrenOptions, type BingCrawlDateFilter, type BingCrawlEvidence, type BingCrawlIssue, type BingCrawlIssueWire, type BingCrawlStats, type BingCrawlStatsWire, type BingDiscoveredDateFilter, type BingDocumentFilter, type BingEvidenceError, type BingFetch, type BingHttpCodeFilter, type BingIndexingEvidence, type BingOperation, type BingPageStats, type BingProviderError, type BingQueryStats, type BingQueryStatsWire, type BingRankAndTrafficStats, type BingRankAndTrafficStatsWire, type BingSite, type BingSiteWire, type BingUnknownEvidence, type BingUrlInfo, type BingUrlInfoWire, type BingUrlTrafficInfo, type BingUrlTrafficInfoWire, type BingUrlWithCrawlIssues, type BingWebmasterClient, type BingWebmasterOptions, type BingWireResponse, DEFAULT_BING_CHILD_PAGE_LIMIT, DEFAULT_BING_WEBMASTER_API_URL, bingWebmaster, normalizeBingCrawlIssue, normalizeBingCrawlStats, normalizeBingIndexingEvidence, normalizeBingPageStats, normalizeBingQueryStats, normalizeBingRankAndTrafficStats, normalizeBingSite, normalizeBingUrlInfo, normalizeBingUrlTrafficInfo };
@@ -1,3 +1,3 @@
1
- import { normalizeBingCrawlIssue, normalizeBingIndexingEvidence, normalizeBingPageStats, normalizeBingSite, normalizeBingUrlInfo, normalizeBingUrlTrafficInfo } from "./normalize.mjs";
1
+ import { normalizeBingCrawlIssue, normalizeBingCrawlStats, normalizeBingIndexingEvidence, normalizeBingPageStats, normalizeBingQueryStats, normalizeBingRankAndTrafficStats, normalizeBingSite, normalizeBingUrlInfo, normalizeBingUrlTrafficInfo } from "./normalize.mjs";
2
2
  import { DEFAULT_BING_CHILD_PAGE_LIMIT, DEFAULT_BING_WEBMASTER_API_URL, bingWebmaster } from "./client.mjs";
3
- export { DEFAULT_BING_CHILD_PAGE_LIMIT, DEFAULT_BING_WEBMASTER_API_URL, bingWebmaster, normalizeBingCrawlIssue, normalizeBingIndexingEvidence, normalizeBingPageStats, normalizeBingSite, normalizeBingUrlInfo, normalizeBingUrlTrafficInfo };
3
+ export { DEFAULT_BING_CHILD_PAGE_LIMIT, DEFAULT_BING_WEBMASTER_API_URL, bingWebmaster, normalizeBingCrawlIssue, normalizeBingCrawlStats, normalizeBingIndexingEvidence, normalizeBingPageStats, normalizeBingQueryStats, normalizeBingRankAndTrafficStats, normalizeBingSite, normalizeBingUrlInfo, normalizeBingUrlTrafficInfo };
@@ -1,9 +1,12 @@
1
1
  import { Result } from "../core/result.mjs";
2
- import { BingEvidenceError, BingIndexingEvidence, BingPageStats, BingSite, BingUrlInfo, BingUrlTrafficInfo, BingUrlWithCrawlIssues } from "./types.mjs";
2
+ import { BingCrawlStats, BingEvidenceError, BingIndexingEvidence, BingPageStats, BingQueryStats, BingRankAndTrafficStats, BingSite, BingUrlInfo, BingUrlTrafficInfo, BingUrlWithCrawlIssues } from "./types.mjs";
3
3
  declare function normalizeBingSite(value: unknown): Result<BingSite, 'invalid-payload'>;
4
4
  declare function normalizeBingUrlInfo(value: unknown): Result<BingUrlInfo, 'invalid-payload'>;
5
5
  declare function normalizeBingUrlTrafficInfo(value: unknown): Result<BingUrlTrafficInfo, 'invalid-payload'>;
6
6
  declare function normalizeBingPageStats(value: unknown): Result<BingPageStats, 'invalid-payload'>;
7
+ declare function normalizeBingQueryStats(value: unknown): Result<BingQueryStats, 'invalid-payload'>;
8
+ declare function normalizeBingRankAndTrafficStats(value: unknown): Result<BingRankAndTrafficStats, 'invalid-payload'>;
9
+ declare function normalizeBingCrawlStats(value: unknown): Result<BingCrawlStats, 'invalid-payload'>;
7
10
  declare function normalizeBingCrawlIssue(value: unknown): Result<BingUrlWithCrawlIssues, 'invalid-payload'>;
8
11
  declare function normalizeBingIndexingEvidence(info: BingUrlInfo | null, url: string, observedAt: Date): Result<BingIndexingEvidence, BingEvidenceError>;
9
- export { normalizeBingCrawlIssue, normalizeBingIndexingEvidence, normalizeBingPageStats, normalizeBingSite, normalizeBingUrlInfo, normalizeBingUrlTrafficInfo };
12
+ export { normalizeBingCrawlIssue, normalizeBingCrawlStats, normalizeBingIndexingEvidence, normalizeBingPageStats, normalizeBingQueryStats, normalizeBingRankAndTrafficStats, normalizeBingSite, normalizeBingUrlInfo, normalizeBingUrlTrafficInfo };
@@ -7,6 +7,15 @@ function isRecord(value) {
7
7
  function isNonNegativeInteger(value) {
8
8
  return typeof value === "number" && Number.isInteger(value) && value >= 0;
9
9
  }
10
+ function isNonNegativeNumber(value) {
11
+ return typeof value === "number" && Number.isFinite(value) && value >= 0;
12
+ }
13
+ function isBingAveragePosition(value) {
14
+ return value === -1 || isNonNegativeNumber(value);
15
+ }
16
+ function normalizeBingAveragePosition(value) {
17
+ return value === -1 ? null : value;
18
+ }
10
19
  function parseBingDate(value) {
11
20
  if (value === void 0 || value === null) return ok(void 0);
12
21
  if (typeof value !== "string") return err("invalid-date");
@@ -51,17 +60,67 @@ function normalizeBingUrlTrafficInfo(value) {
51
60
  url: value.Url
52
61
  });
53
62
  }
63
+ function normalizeBingTrafficStats(value) {
64
+ if (!isRecord(value) || !isBingAveragePosition(value.AvgClickPosition) || !isBingAveragePosition(value.AvgImpressionPosition) || !isNonNegativeInteger(value.Clicks) || !isNonNegativeInteger(value.Impressions) || typeof value.Query !== "string") return err("invalid-payload");
65
+ const date = parseBingDate(value.Date);
66
+ if (!date.ok || !date.value) return err("invalid-payload");
67
+ return ok({
68
+ averageClickPosition: normalizeBingAveragePosition(value.AvgClickPosition),
69
+ averageImpressionPosition: normalizeBingAveragePosition(value.AvgImpressionPosition),
70
+ clicks: value.Clicks,
71
+ date: date.value,
72
+ dimension: value.Query,
73
+ impressions: value.Impressions
74
+ });
75
+ }
54
76
  function normalizeBingPageStats(value) {
55
- if (!isRecord(value) || !isNonNegativeInteger(value.AvgClickPosition) || !isNonNegativeInteger(value.AvgImpressionPosition) || !isNonNegativeInteger(value.Clicks) || !isNonNegativeInteger(value.Impressions) || typeof value.Query !== "string") return err("invalid-payload");
77
+ const parsed = normalizeBingTrafficStats(value);
78
+ if (!parsed.ok) return parsed;
79
+ const { dimension, ...stats } = parsed.value;
80
+ return ok({
81
+ ...stats,
82
+ page: dimension
83
+ });
84
+ }
85
+ function normalizeBingQueryStats(value) {
86
+ const parsed = normalizeBingTrafficStats(value);
87
+ if (!parsed.ok) return parsed;
88
+ const { dimension, ...stats } = parsed.value;
89
+ return ok({
90
+ ...stats,
91
+ query: dimension
92
+ });
93
+ }
94
+ function normalizeBingRankAndTrafficStats(value) {
95
+ if (!isRecord(value) || !isNonNegativeInteger(value.Clicks) || !isNonNegativeInteger(value.Impressions)) return err("invalid-payload");
56
96
  const date = parseBingDate(value.Date);
57
97
  if (!date.ok || !date.value) return err("invalid-payload");
58
98
  return ok({
59
- averageClickPosition: value.AvgClickPosition,
60
- averageImpressionPosition: value.AvgImpressionPosition,
61
99
  clicks: value.Clicks,
62
100
  date: date.value,
63
- impressions: value.Impressions,
64
- query: value.Query
101
+ impressions: value.Impressions
102
+ });
103
+ }
104
+ function normalizeBingCrawlStats(value) {
105
+ if (!isRecord(value) || !isNonNegativeInteger(value.AllOtherCodes) || !isNonNegativeInteger(value.BlockedByRobotsTxt) || !isNonNegativeInteger(value.Code2xx) || !isNonNegativeInteger(value.Code301) || !isNonNegativeInteger(value.Code302) || !isNonNegativeInteger(value.Code4xx) || !isNonNegativeInteger(value.Code5xx) || value.ConnectionTimeout !== void 0 && !isNonNegativeInteger(value.ConnectionTimeout) || !isNonNegativeInteger(value.ContainsMalware) || !isNonNegativeInteger(value.CrawlErrors) || !isNonNegativeInteger(value.CrawledPages) || value.DnsFailures !== void 0 && !isNonNegativeInteger(value.DnsFailures) || !isNonNegativeInteger(value.InIndex) || !isNonNegativeInteger(value.InLinks)) return err("invalid-payload");
106
+ const date = parseBingDate(value.Date);
107
+ if (!date.ok || !date.value) return err("invalid-payload");
108
+ return ok({
109
+ allOtherCodes: value.AllOtherCodes,
110
+ blockedByRobotsTxt: value.BlockedByRobotsTxt,
111
+ code2xx: value.Code2xx,
112
+ code301: value.Code301,
113
+ code302: value.Code302,
114
+ code4xx: value.Code4xx,
115
+ code5xx: value.Code5xx,
116
+ ...value.ConnectionTimeout === void 0 ? {} : { connectionTimeout: value.ConnectionTimeout },
117
+ containsMalware: value.ContainsMalware,
118
+ crawlErrors: value.CrawlErrors,
119
+ crawledPages: value.CrawledPages,
120
+ date: date.value,
121
+ ...value.DnsFailures === void 0 ? {} : { dnsFailures: value.DnsFailures },
122
+ inIndex: value.InIndex,
123
+ inLinks: value.InLinks
65
124
  });
66
125
  }
67
126
  const CRAWL_ISSUES = {
@@ -121,4 +180,4 @@ function normalizeBingIndexingEvidence(info, url, observedAt) {
121
180
  url
122
181
  });
123
182
  }
124
- export { normalizeBingCrawlIssue, normalizeBingIndexingEvidence, normalizeBingPageStats, normalizeBingSite, normalizeBingUrlInfo, normalizeBingUrlTrafficInfo };
183
+ export { normalizeBingCrawlIssue, normalizeBingCrawlStats, normalizeBingIndexingEvidence, normalizeBingPageStats, normalizeBingQueryStats, normalizeBingRankAndTrafficStats, normalizeBingSite, normalizeBingUrlInfo, normalizeBingUrlTrafficInfo };
@@ -33,6 +33,30 @@ interface BingQueryStatsWire {
33
33
  Impressions: number;
34
34
  Query: string;
35
35
  }
36
+ interface BingRankAndTrafficStatsWire {
37
+ __type?: string;
38
+ Clicks: number;
39
+ Date: string;
40
+ Impressions: number;
41
+ }
42
+ interface BingCrawlStatsWire {
43
+ __type?: string;
44
+ AllOtherCodes: number;
45
+ BlockedByRobotsTxt: number;
46
+ Code2xx: number;
47
+ Code301: number;
48
+ Code302: number;
49
+ Code4xx: number;
50
+ Code5xx: number;
51
+ ConnectionTimeout?: number;
52
+ ContainsMalware: number;
53
+ CrawlErrors: number;
54
+ CrawledPages: number;
55
+ Date: string;
56
+ DnsFailures?: number;
57
+ InIndex: number;
58
+ InLinks: number;
59
+ }
36
60
  interface BingCrawlIssueWire {
37
61
  __type?: string;
38
62
  HttpCode: number;
@@ -64,13 +88,43 @@ interface BingUrlTrafficInfo {
64
88
  url: string;
65
89
  }
66
90
  interface BingPageStats {
67
- averageClickPosition: number;
68
- averageImpressionPosition: number;
91
+ averageClickPosition: number | null;
92
+ averageImpressionPosition: number | null;
93
+ clicks: number;
94
+ date: string;
95
+ impressions: number;
96
+ page: string;
97
+ }
98
+ interface BingQueryStats {
99
+ averageClickPosition: number | null;
100
+ averageImpressionPosition: number | null;
69
101
  clicks: number;
70
102
  date: string;
71
103
  impressions: number;
72
104
  query: string;
73
105
  }
106
+ interface BingRankAndTrafficStats {
107
+ clicks: number;
108
+ date: string;
109
+ impressions: number;
110
+ }
111
+ interface BingCrawlStats {
112
+ allOtherCodes: number;
113
+ blockedByRobotsTxt: number;
114
+ code2xx: number;
115
+ code301: number;
116
+ code302: number;
117
+ code4xx: number;
118
+ code5xx: number;
119
+ connectionTimeout?: number;
120
+ containsMalware: number;
121
+ crawlErrors: number;
122
+ crawledPages: number;
123
+ date: string;
124
+ dnsFailures?: number;
125
+ inIndex: number;
126
+ inLinks: number;
127
+ }
74
128
  type BingCrawlIssue = 'none' | '301' | '302' | '4xx' | '5xx' | 'blocked-by-robots-txt' | 'contains-malware' | 'important-url-blocked-by-robots-txt' | 'dns-errors' | 'timeout-errors' | 'unknown';
75
129
  interface BingUrlWithCrawlIssues {
76
130
  httpCode: number;
@@ -143,7 +197,7 @@ interface BingEvidenceError {
143
197
  reason: 'not-a-page';
144
198
  url: string;
145
199
  }
146
- type BingOperation = 'GetUserSites' | 'GetUrlInfo' | 'GetUrlTrafficInfo' | 'GetChildrenUrlInfo' | 'GetPageStats' | 'GetCrawlIssues';
200
+ type BingOperation = 'GetUserSites' | 'GetUrlInfo' | 'GetUrlTrafficInfo' | 'GetChildrenUrlInfo' | 'GetPageStats' | 'GetQueryStats' | 'GetRankAndTrafficStats' | 'GetCrawlStats' | 'GetCrawlIssues';
147
201
  interface BingCallOptions {
148
202
  signal?: AbortSignal;
149
203
  }
@@ -169,6 +223,9 @@ interface BingWebmasterClient {
169
223
  getUrlTrafficInfo: (siteUrl: string, url: string, options?: BingCallOptions) => Promise<Result<BingUrlTrafficInfo | null, BingProviderError>>;
170
224
  getChildrenUrlInfo: (siteUrl: string, url: string, options?: BingChildrenOptions) => Promise<Result<BingUrlInfo[], BingProviderError>>;
171
225
  getPageStats: (siteUrl: string, options?: BingCallOptions) => Promise<Result<BingPageStats[], BingProviderError>>;
226
+ getQueryStats: (siteUrl: string, options?: BingCallOptions) => Promise<Result<BingQueryStats[], BingProviderError>>;
227
+ getRankAndTrafficStats: (siteUrl: string, options?: BingCallOptions) => Promise<Result<BingRankAndTrafficStats[], BingProviderError>>;
228
+ getCrawlStats: (siteUrl: string, options?: BingCallOptions) => Promise<Result<BingCrawlStats[], BingProviderError>>;
172
229
  getCrawlIssues: (siteUrl: string, options?: BingCallOptions) => Promise<Result<BingUrlWithCrawlIssues[], BingProviderError>>;
173
230
  }
174
231
  type BingFetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
@@ -178,4 +235,4 @@ interface BingWebmasterOptions {
178
235
  clock?: () => Date;
179
236
  fetch?: BingFetch;
180
237
  }
181
- export { BingCallOptions, BingChildrenFilters, BingChildrenOptions, BingCrawlDateFilter, BingCrawlEvidence, BingCrawlIssue, BingCrawlIssueWire, BingDiscoveredDateFilter, BingDocumentFilter, BingEvidenceError, BingFetch, BingHttpCodeFilter, BingIndexingEvidence, BingOperation, BingPageStats, BingProviderError, BingQueryStatsWire, BingSite, BingSiteWire, BingUnknownEvidence, BingUrlInfo, BingUrlInfoWire, BingUrlTrafficInfo, BingUrlTrafficInfoWire, BingUrlWithCrawlIssues, BingWebmasterClient, BingWebmasterOptions, BingWireResponse };
238
+ export { BingCallOptions, BingChildrenFilters, BingChildrenOptions, BingCrawlDateFilter, BingCrawlEvidence, BingCrawlIssue, BingCrawlIssueWire, BingCrawlStats, BingCrawlStatsWire, BingDiscoveredDateFilter, BingDocumentFilter, BingEvidenceError, BingFetch, BingHttpCodeFilter, BingIndexingEvidence, BingOperation, BingPageStats, BingProviderError, BingQueryStats, BingQueryStatsWire, BingRankAndTrafficStats, BingRankAndTrafficStatsWire, BingSite, BingSiteWire, BingUnknownEvidence, BingUrlInfo, BingUrlInfoWire, BingUrlTrafficInfo, BingUrlTrafficInfoWire, BingUrlWithCrawlIssues, BingWebmasterClient, BingWebmasterOptions, BingWireResponse };
@@ -0,0 +1,4 @@
1
+ import { Auth, AuthClient, AuthOptions, CallOptions, DEFAULT_GSC_REQUEST_TIMEOUT_MS, GoogleSearchConsoleClient, GoogleSearchConsoleClientOptions, QueryReturn, VerificationMethod, VerificationSite, VerificationSiteType, VerificationToken, VerificationWebResource, createAuth, createFetch, googleSearchConsole } from "./core/client.mjs";
2
+ import { GSC_INDEXING_SCOPE, GSC_READ_SCOPE, GSC_SITE_VERIFICATION_SCOPE, GSC_WRITE_SCOPE, hasGoogleScope } from "./core/scope-values.mjs";
3
+ import { hasGscReadScope, hasGscWriteScope, hasIndexingScope } from "./core/scopes.mjs";
4
+ export { type Auth, type AuthClient, type AuthOptions, type CallOptions, DEFAULT_GSC_REQUEST_TIMEOUT_MS, GSC_INDEXING_SCOPE, GSC_READ_SCOPE, GSC_SITE_VERIFICATION_SCOPE, GSC_WRITE_SCOPE, type GoogleSearchConsoleClient, type GoogleSearchConsoleClientOptions, type QueryReturn, type VerificationMethod, type VerificationSite, type VerificationSiteType, type VerificationToken, type VerificationWebResource, createAuth, createFetch, googleSearchConsole, hasGoogleScope, hasGscReadScope, hasGscWriteScope, hasIndexingScope };
@@ -0,0 +1,4 @@
1
+ import { GSC_INDEXING_SCOPE, GSC_READ_SCOPE, GSC_SITE_VERIFICATION_SCOPE, GSC_WRITE_SCOPE, hasGoogleScope } from "./core/scope-values.mjs";
2
+ import { hasGscReadScope, hasGscWriteScope, hasIndexingScope } from "./core/scopes.mjs";
3
+ import { DEFAULT_GSC_REQUEST_TIMEOUT_MS, createAuth, createFetch, googleSearchConsole } from "./core/client.mjs";
4
+ export { DEFAULT_GSC_REQUEST_TIMEOUT_MS, GSC_INDEXING_SCOPE, GSC_READ_SCOPE, GSC_SITE_VERIFICATION_SCOPE, GSC_WRITE_SCOPE, createAuth, createFetch, googleSearchConsole, hasGoogleScope, hasGscReadScope, hasGscWriteScope, hasIndexingScope };
@@ -1,3 +1,4 @@
1
+ import { GscSearchType, GscSearchType as GscSearchType$1 } from "@gscdump/contracts/search-types";
1
2
  import { ColumnDef, ColumnType, Row, TableName, TableSchema, TenantCtx } from "@gscdump/contracts";
2
3
  type GscSearchAnalyticsDimension = 'page' | 'query' | 'country' | 'device' | 'date' | 'hour' | 'searchAppearance';
3
4
  type GscDataState = 'final' | 'all' | 'hourly_all';
@@ -17,7 +18,6 @@ interface GscSearchAnalyticsFilterGroup {
17
18
  groupType?: 'and' | 'or';
18
19
  filters: GscSearchAnalyticsFilter[];
19
20
  }
20
- type GscSearchType = 'web' | 'image' | 'video' | 'news' | 'discover' | 'googleNews';
21
21
  type GscAggregationType = 'auto' | 'byPage' | 'byProperty' | 'byNewsShowcasePanel';
22
22
  type GscResponseAggregationType = 'auto' | 'byPage' | 'byProperty' | 'byNewsShowcasePanel';
23
23
  interface GscSearchAnalyticsRequest {
@@ -28,7 +28,7 @@ interface GscSearchAnalyticsRequest {
28
28
  rowLimit?: number;
29
29
  startRow?: number;
30
30
  /** GSC search corpus. Maps to wire field `type` (the API still accepts the deprecated `searchType` alias). */
31
- type?: GscSearchType;
31
+ type?: GscSearchType$1;
32
32
  dataState?: GscDataState;
33
33
  aggregationType?: GscAggregationType;
34
34
  }
@@ -44,4 +44,4 @@ interface GscSearchAnalyticsResponse {
44
44
  responseAggregationType?: GscResponseAggregationType;
45
45
  metadata?: GscSearchAnalyticsMetadata;
46
46
  }
47
- export { type ColumnDef, type ColumnType, GscAggregationType, GscDataState, GscResponseAggregationType, GscSearchAnalyticsDimension, GscSearchAnalyticsFilter, GscSearchAnalyticsFilterGroup, GscSearchAnalyticsFilterOperator, GscSearchAnalyticsMetadata, GscSearchAnalyticsRequest, GscSearchAnalyticsResponse, GscSearchAnalyticsRow, GscSearchType, type Row, type TableName, type TableSchema, type TenantCtx };
47
+ export { type ColumnDef, type ColumnType, GscAggregationType, GscDataState, GscResponseAggregationType, GscSearchAnalyticsDimension, GscSearchAnalyticsFilter, GscSearchAnalyticsFilterGroup, GscSearchAnalyticsFilterOperator, GscSearchAnalyticsMetadata, GscSearchAnalyticsRequest, GscSearchAnalyticsResponse, GscSearchAnalyticsRow, type GscSearchType, type Row, type TableName, type TableSchema, type TenantCtx };
@@ -0,0 +1,20 @@
1
+ type WindowPreset = 'last-7d' | 'last-28d' | 'last-30d' | 'last-90d' | 'last-180d' | 'last-365d' | 'mtd' | 'ytd' | 'custom';
2
+ type ComparisonMode = 'none' | 'prev-period' | 'yoy';
3
+ interface ResolveWindowOptions {
4
+ preset: WindowPreset;
5
+ comparison?: ComparisonMode;
6
+ anchor?: string;
7
+ start?: string;
8
+ end?: string;
9
+ }
10
+ interface ResolvedWindow {
11
+ start: string;
12
+ end: string;
13
+ days: number;
14
+ comparison?: {
15
+ start: string;
16
+ end: string;
17
+ };
18
+ }
19
+ declare function resolveWindow(opts: ResolveWindowOptions): ResolvedWindow;
20
+ export { ComparisonMode, ResolveWindowOptions, ResolvedWindow, WindowPreset, resolveWindow };
@@ -0,0 +1,63 @@
1
+ import { addDays, countDays, toIsoDate } from "./gsc-dates.mjs";
2
+ function resolveWindow(opts) {
3
+ const anchor = opts.anchor ? /* @__PURE__ */ new Date(`${opts.anchor}T00:00:00Z`) : /* @__PURE__ */ new Date();
4
+ const anchorIso = toIsoDate(anchor);
5
+ let start;
6
+ let end;
7
+ switch (opts.preset) {
8
+ case "last-7d":
9
+ end = anchorIso;
10
+ start = addDays(anchorIso, -6);
11
+ break;
12
+ case "last-28d":
13
+ end = anchorIso;
14
+ start = addDays(anchorIso, -27);
15
+ break;
16
+ case "last-30d":
17
+ end = anchorIso;
18
+ start = addDays(anchorIso, -29);
19
+ break;
20
+ case "last-90d":
21
+ end = anchorIso;
22
+ start = addDays(anchorIso, -89);
23
+ break;
24
+ case "last-180d":
25
+ end = anchorIso;
26
+ start = addDays(anchorIso, -179);
27
+ break;
28
+ case "last-365d":
29
+ end = anchorIso;
30
+ start = addDays(anchorIso, -364);
31
+ break;
32
+ case "mtd":
33
+ end = anchorIso;
34
+ start = toIsoDate(new Date(Date.UTC(anchor.getUTCFullYear(), anchor.getUTCMonth(), 1)));
35
+ break;
36
+ case "ytd":
37
+ end = anchorIso;
38
+ start = toIsoDate(new Date(Date.UTC(anchor.getUTCFullYear(), 0, 1)));
39
+ break;
40
+ case "custom":
41
+ if (!opts.start || !opts.end) throw new Error("resolveWindow: preset=custom requires start and end");
42
+ start = opts.start;
43
+ end = opts.end;
44
+ }
45
+ const days = countDays(start, end);
46
+ const result = {
47
+ start,
48
+ end,
49
+ days
50
+ };
51
+ if (opts.comparison === "prev-period") {
52
+ const previousEnd = addDays(start, -1);
53
+ result.comparison = {
54
+ start: addDays(previousEnd, -(days - 1)),
55
+ end: previousEnd
56
+ };
57
+ } else if (opts.comparison === "yoy") result.comparison = {
58
+ start: addDays(start, -365),
59
+ end: addDays(end, -365)
60
+ };
61
+ return result;
62
+ }
63
+ export { resolveWindow };
package/dist/dates.d.mts CHANGED
@@ -1,3 +1,5 @@
1
+ import { Period, ResolvedAnalyticsRange } from "./core/types.mjs";
1
2
  import { DAYS_PER_RANGE, GSC_FINALIZED_LAG_DAYS, GSC_FRESHEST_LAG_DAYS, GSC_RETENTION_MONTHS, MS_PER_DAY, addDays, countDays, daysAgo, generateGscDateRange, getBackfillProgress, getDateRange, getFreshestGscDate, getLatestGscDate, getNextDate, getOldestGscDate, getPendingDates, getPstDate, groupIntoRanges, toIsoDate } from "./core/gsc-dates.mjs";
3
+ import { ComparisonMode, ResolveWindowOptions, ResolvedWindow, WindowPreset, resolveWindow } from "./core/window.mjs";
2
4
  import { currentPstDate, daysAgoPst } from "./query/utils/dayjs.mjs";
3
- export { DAYS_PER_RANGE, GSC_FINALIZED_LAG_DAYS, GSC_FRESHEST_LAG_DAYS, GSC_RETENTION_MONTHS, MS_PER_DAY, addDays, countDays, currentPstDate, daysAgoPst, daysAgo as daysAgoUtc, generateGscDateRange, getBackfillProgress, getDateRange, getFreshestGscDate, getLatestGscDate, getNextDate, getOldestGscDate, getPendingDates, getPstDate, groupIntoRanges, toIsoDate };
5
+ export { type ComparisonMode, DAYS_PER_RANGE, GSC_FINALIZED_LAG_DAYS, GSC_FRESHEST_LAG_DAYS, GSC_RETENTION_MONTHS, MS_PER_DAY, type Period, type ResolveWindowOptions, type ResolvedAnalyticsRange, type ResolvedWindow, type WindowPreset, addDays, countDays, currentPstDate, daysAgoPst, daysAgo as daysAgoUtc, generateGscDateRange, getBackfillProgress, getDateRange, getFreshestGscDate, getLatestGscDate, getNextDate, getOldestGscDate, getPendingDates, getPstDate, groupIntoRanges, resolveWindow, toIsoDate };
package/dist/dates.mjs CHANGED
@@ -1,3 +1,4 @@
1
1
  import { DAYS_PER_RANGE, GSC_FINALIZED_LAG_DAYS, GSC_FRESHEST_LAG_DAYS, GSC_RETENTION_MONTHS, MS_PER_DAY, addDays, countDays, daysAgo, generateGscDateRange, getBackfillProgress, getDateRange, getFreshestGscDate, getLatestGscDate, getNextDate, getOldestGscDate, getPendingDates, getPstDate, groupIntoRanges, toIsoDate } from "./core/gsc-dates.mjs";
2
2
  import { currentPstDate, daysAgoPst } from "./query/utils/dayjs.mjs";
3
- export { DAYS_PER_RANGE, GSC_FINALIZED_LAG_DAYS, GSC_FRESHEST_LAG_DAYS, GSC_RETENTION_MONTHS, MS_PER_DAY, addDays, countDays, currentPstDate, daysAgoPst, daysAgo as daysAgoUtc, generateGscDateRange, getBackfillProgress, getDateRange, getFreshestGscDate, getLatestGscDate, getNextDate, getOldestGscDate, getPendingDates, getPstDate, groupIntoRanges, toIsoDate };
3
+ import { resolveWindow } from "./core/window.mjs";
4
+ export { DAYS_PER_RANGE, GSC_FINALIZED_LAG_DAYS, GSC_FRESHEST_LAG_DAYS, GSC_RETENTION_MONTHS, MS_PER_DAY, addDays, countDays, currentPstDate, daysAgoPst, daysAgo as daysAgoUtc, generateGscDateRange, getBackfillProgress, getDateRange, getFreshestGscDate, getLatestGscDate, getNextDate, getOldestGscDate, getPendingDates, getPstDate, groupIntoRanges, resolveWindow, toIsoDate };
@@ -0,0 +1,2 @@
1
+ import { GscApiError, GscApiErrorInfo, GscError, GscErrorKind, classifyError, gscErrorToException, isPermissionDeniedError, parseGoogleError, rethrowAsGscApiError } from "./core/errors.mjs";
2
+ export { GscApiError, type GscApiErrorInfo, type GscError, type GscErrorKind, classifyError, gscErrorToException, isPermissionDeniedError, parseGoogleError, rethrowAsGscApiError };
@@ -0,0 +1,2 @@
1
+ import { GscApiError, classifyError, gscErrorToException, isPermissionDeniedError, parseGoogleError, rethrowAsGscApiError } from "./core/errors.mjs";
2
+ export { GscApiError, classifyError, gscErrorToException, isPermissionDeniedError, parseGoogleError, rethrowAsGscApiError };
package/dist/index.d.mts CHANGED
@@ -1,11 +1,13 @@
1
1
  import { Err, Ok, Result, err, isErr, isOk, ok, unwrapResult } from "./core/result.mjs";
2
- import { BackfillProgress, DAYS_PER_RANGE, GSC_FINALIZED_LAG_DAYS, GSC_FRESHEST_LAG_DAYS, GSC_RETENTION_MONTHS, MS_PER_DAY, addDays, countDays, generateGscDateRange, getBackfillProgress, getDateRange, getFreshestGscDate, getLatestGscDate, getNextDate, getOldestGscDate, getPendingDates, getPreviousDate, getPstDate, groupIntoRanges, isValidGscDate, toIsoDate } from "./core/gsc-dates.mjs";
3
- import { runSequentialBatch } from "./api/batch.mjs";
4
2
  import { AmpInspectionResult, AmpIssue, ApiSite, ApiSitemap, ApiSitemapContent, DataRow, DimensionFilter, DimensionFilterGroup, IndexStatusResult, InspectUrlIndexResponse, MobileUsabilityIssue, MobileUsabilityResult, Period, PublishUrlNotificationResponse, RequiredNonNullable, ResolvedAnalyticsRange, RichResultsDetectedItem, RichResultsIssue, RichResultsItem, RichResultsResult, SearchAnalyticsMetadata, SearchAnalyticsQuery, SearchAnalyticsResponse, Site, SiteAnalytics, UrlInspectionResult, UrlNotification, UrlNotificationMetadata } from "./core/types.mjs";
5
3
  import { Auth, AuthClient, AuthOptions, CallOptions, DEFAULT_GSC_REQUEST_TIMEOUT_MS, GoogleSearchConsoleClient, GoogleSearchConsoleClientOptions, QueryReturn, VerificationMethod, VerificationSite, VerificationSiteType, VerificationToken, VerificationWebResource, createAuth, createFetch, googleSearchConsole } from "./core/client.mjs";
4
+ import { GSC_INDEXING_SCOPE, GSC_READ_SCOPE, GSC_SITE_VERIFICATION_SCOPE, GSC_WRITE_SCOPE, hasGoogleScope } from "./core/scope-values.mjs";
5
+ import { hasGscReadScope, hasGscWriteScope, hasIndexingScope } from "./core/scopes.mjs";
6
+ import { BackfillProgress, DAYS_PER_RANGE, GSC_FINALIZED_LAG_DAYS, GSC_FRESHEST_LAG_DAYS, GSC_RETENTION_MONTHS, MS_PER_DAY, addDays, countDays, generateGscDateRange, getBackfillProgress, getDateRange, getFreshestGscDate, getLatestGscDate, getNextDate, getOldestGscDate, getPendingDates, getPreviousDate, getPstDate, groupIntoRanges, isValidGscDate, toIsoDate } from "./core/gsc-dates.mjs";
7
+ import { GscApiError, GscApiErrorInfo, GscError, GscErrorKind, classifyError, gscErrorToException, isPermissionDeniedError, parseGoogleError, rethrowAsGscApiError } from "./core/errors.mjs";
8
+ import { runSequentialBatch } from "./api/batch.mjs";
6
9
  import { IndexingMetadata, IndexingNotificationType, IndexingResult, batchRequestIndexing, getIndexingMetadata, requestIndexing } from "./api/indexing.mjs";
7
10
  import { BatchInspectUrlsFlatSettledOptions, IndexingEligibility, IndexingIneligibleReason, InspectUrlFlatSettledResult, InspectUrlResult, InspectionPriority, LegacyInspectionPriority, MAX_FLAT_INSPECTION_BATCH_CONCURRENCY, ParsedIndexingResult, ValueWeightedInspectionPriority, batchInspectUrls, batchInspectUrlsFlatSettled, canUseUrlInspection, getIndexingEligibility, getNextCheckAfter, getNextCheckPriority, inspectUrl, inspectUrlFlat } from "./api/inspection.mjs";
8
- import { GscApiError, GscApiErrorInfo, GscError, GscErrorKind, classifyError, gscErrorToException, isPermissionDeniedError, parseGoogleError, rethrowAsGscApiError } from "./core/errors.mjs";
9
11
  import { OAuthTokenInfo, OAuthTokens, exchangeAuthCodeResult, introspectAccessToken, introspectAccessTokenResult, refreshAccessToken, revokeOAuthToken, revokeOAuthTokenResult } from "./api/oauth.mjs";
10
12
  import { FetchSitesWithSitemapsOptions, addSite, deleteSite, deleteSitemap, fetchSitemap, fetchSitemaps, fetchSites, fetchSitesWithSitemaps, submitSitemap } from "./api/sites.mjs";
11
13
  import { getVerificationToken, getVerifiedSite, listVerifiedSites, resolveVerificationTarget, siteUrlToVerificationSite, unverifySite, verificationMethodsFor, verifySite } from "./api/verification.mjs";
@@ -13,8 +15,6 @@ import { CanonicalDifferenceKind, classifyCanonicalDifference, isCanonicalMismat
13
15
  import { INDEXING_ISSUE_FILTERS, INDEXING_ISSUE_LABELS, INDEXING_ISSUE_SEVERITY, IndexingIssueType, KNOWN_COVERAGE_STATES, KNOWN_PAGE_FETCH_STATES, UnmappedInspectionReasons, isFragmentUrl, unmappedInspectionReasons } from "./core/indexing-issues.mjs";
14
16
  import { GscPropertyCandidate, findBestGscProperty, findExactGscProperty, formatGscPropertyCandidates, gscPropertyMatchesTarget, isVerifiedGscPermission, isVerifiedGscProperty, matchGscSite, pickBestGscProperty } from "./core/property.mjs";
15
17
  import { URL_INSPECTION_EFFECTIVE_LIMIT } from "./core/quota.mjs";
16
- import { GSC_INDEXING_SCOPE, GSC_READ_SCOPE, GSC_SITE_VERIFICATION_SCOPE, GSC_WRITE_SCOPE, hasGoogleScope } from "./core/scope-values.mjs";
17
- import { hasGscReadScope, hasGscWriteScope, hasIndexingScope } from "./core/scopes.mjs";
18
18
  import { ParsedGscSiteUrl, normalizeGscSiteUrl, normalizeRegistrationTarget, parseGscSiteUrl } from "./core/site-url.mjs";
19
19
  import { normalizeUrl } from "./normalize.mjs";
20
20
  import { AccountNextAction, AccountStatus, AnalyticsNextAction, AnalyticsStatus, GSCDUMP_ONBOARDING_CONTRACT_VERSION, GSCDUMP_OPTIONAL_INDEXING_SCOPE, GSCDUMP_REQUIRED_ANALYTICS_SCOPE, GSCDUMP_WRITE_ANALYTICS_SCOPE, IndexingNextAction, IndexingStatus, LifecycleError, LifecycleErrorCode, LifecycleProgress, LifecycleWebhookEnvelope, LifecycleWebhookEvent, PartnerLifecycleAccount, PartnerLifecycleResponse, PartnerLifecycleSite, PropertyNextAction, PropertyStatus, QuerySourceMode, SitemapNextAction, SitemapStatus, accountNextActions, accountStatuses, analyticsNextActions, analyticsStatuses, hasOptionalIndexingScope, hasRequiredAnalyticsScope, indexingNextActions, indexingStatuses, lifecycleErrorCodes, parseGrantedScopes, propertyNextActions, propertyStatuses, querySourceModes, sitemapNextActions, sitemapStatuses } from "./onboarding.mjs";
@@ -0,0 +1,5 @@
1
+ import { UrlInspectionResult } from "./core/types.mjs";
2
+ import { runSequentialBatch } from "./api/batch.mjs";
3
+ import { IndexingMetadata, IndexingNotificationType, IndexingResult, batchRequestIndexing, getIndexingMetadata, requestIndexing } from "./api/indexing.mjs";
4
+ import { BatchInspectUrlsFlatSettledOptions, IndexingEligibility, IndexingIneligibleReason, InspectUrlFlatSettledResult, InspectUrlResult, InspectionPriority, LegacyInspectionPriority, MAX_FLAT_INSPECTION_BATCH_CONCURRENCY, ParsedIndexingResult, ValueWeightedInspectionPriority, batchInspectUrls, batchInspectUrlsFlatSettled, canUseUrlInspection, getIndexingEligibility, getNextCheckAfter, getNextCheckPriority, inspectUrl, inspectUrlFlat } from "./api/inspection.mjs";
5
+ export { type BatchInspectUrlsFlatSettledOptions, type IndexingEligibility, type IndexingIneligibleReason, type IndexingMetadata, type IndexingNotificationType, type IndexingResult, type InspectUrlFlatSettledResult, type InspectUrlResult, type InspectionPriority, type LegacyInspectionPriority, MAX_FLAT_INSPECTION_BATCH_CONCURRENCY, type ParsedIndexingResult, type UrlInspectionResult, type ValueWeightedInspectionPriority, batchInspectUrls, batchInspectUrlsFlatSettled, batchRequestIndexing, canUseUrlInspection, getIndexingEligibility, getIndexingMetadata, getNextCheckAfter, getNextCheckPriority, inspectUrl, inspectUrlFlat, requestIndexing, runSequentialBatch };
@@ -0,0 +1,4 @@
1
+ import { runSequentialBatch } from "./api/batch.mjs";
2
+ import { batchRequestIndexing, getIndexingMetadata, requestIndexing } from "./api/indexing.mjs";
3
+ import { MAX_FLAT_INSPECTION_BATCH_CONCURRENCY, batchInspectUrls, batchInspectUrlsFlatSettled, canUseUrlInspection, getIndexingEligibility, getNextCheckAfter, getNextCheckPriority, inspectUrl, inspectUrlFlat } from "./api/inspection.mjs";
4
+ export { MAX_FLAT_INSPECTION_BATCH_CONCURRENCY, batchInspectUrls, batchInspectUrlsFlatSettled, batchRequestIndexing, canUseUrlInspection, getIndexingEligibility, getIndexingMetadata, getNextCheckAfter, getNextCheckPriority, inspectUrl, inspectUrlFlat, requestIndexing, runSequentialBatch };
@@ -1,19 +1,11 @@
1
1
  import _default from "./utils/countries.mjs";
2
+ import { GSC_SEARCH_TYPES as SearchTypes, GscSearchType as SearchType } from "@gscdump/contracts/search-types";
2
3
  declare const Devices: {
3
4
  readonly MOBILE: "MOBILE";
4
5
  readonly DESKTOP: "DESKTOP";
5
6
  readonly TABLET: "TABLET";
6
7
  };
7
8
  type Device = typeof Devices[keyof typeof Devices];
8
- declare const SearchTypes: {
9
- readonly WEB: "web";
10
- readonly IMAGE: "image";
11
- readonly VIDEO: "video";
12
- readonly NEWS: "news";
13
- readonly DISCOVER: "discover";
14
- readonly GOOGLE_NEWS: "googleNews";
15
- };
16
- type SearchType = typeof SearchTypes[keyof typeof SearchTypes];
17
9
  declare const Countries: { [K in (typeof _default)[number]["alpha-3"]]: Lowercase<K>; };
18
10
  type Country = typeof Countries[keyof typeof Countries];
19
- export { Countries, Country, Device, Devices, SearchType, SearchTypes };
11
+ export { Countries, Country, Device, Devices, type SearchType, SearchTypes };
@@ -1,16 +1,9 @@
1
1
  import countries_default from "./utils/countries.mjs";
2
+ import { GSC_SEARCH_TYPES as SearchTypes } from "@gscdump/contracts/search-types";
2
3
  const Devices = {
3
4
  MOBILE: "MOBILE",
4
5
  DESKTOP: "DESKTOP",
5
6
  TABLET: "TABLET"
6
7
  };
7
- const SearchTypes = {
8
- WEB: "web",
9
- IMAGE: "image",
10
- VIDEO: "video",
11
- NEWS: "news",
12
- DISCOVER: "discover",
13
- GOOGLE_NEWS: "googleNews"
14
- };
15
8
  const Countries = Object.fromEntries(countries_default.map((c) => [c["alpha-3"], c["alpha-3"].toLowerCase()]));
16
9
  export { Countries, Devices, SearchTypes };
@@ -1,7 +1,7 @@
1
- import { currentPstDate } from "./utils/dayjs.mjs";
2
1
  import { Countries, Country, Device, Devices, SearchType, SearchTypes } from "./constants.mjs";
3
2
  import { BuilderState, Column, Dimension, DimensionValueMap, Filter, FilterInput, GSCResult, GSCRow, InternalFilter, JsonFilter, JsonInternalFilter, Metric, MetricColumn, QueryParam, QueryParamName, QueryParamValueMap } from "./types.mjs";
4
3
  import { GSCQueryBuilder, gsc } from "./builder.mjs";
4
+ import { currentPstDate } from "./utils/dayjs.mjs";
5
5
  import { clicks, country, ctr, date, device, hour, impressions, page, position, query, queryCanonical, searchAppearance, searchType } from "./columns.mjs";
6
6
  import { QueryError, QueryErrorKind, UnresolvableDatasetError, UnsupportedLogicalCapabilityError, isQueryError, queryErrorToException, queryErrors } from "./errors.mjs";
7
7
  import { and, between, contains, eq, gt, gte, inArray, like, lt, lte, ne, not, notRegex, or, regex, topLevel } from "./operators.mjs";
@@ -0,0 +1,5 @@
1
+ import { ApiSite, ApiSitemap, Site } from "./core/types.mjs";
2
+ import { VerificationMethod, VerificationSite, VerificationToken, VerificationWebResource } from "./core/client.mjs";
3
+ import { FetchSitesWithSitemapsOptions, addSite, deleteSite, deleteSitemap, fetchSitemap, fetchSitemaps, fetchSites, fetchSitesWithSitemaps, submitSitemap } from "./api/sites.mjs";
4
+ import { getVerificationToken, getVerifiedSite, listVerifiedSites, resolveVerificationTarget, siteUrlToVerificationSite, unverifySite, verificationMethodsFor, verifySite } from "./api/verification.mjs";
5
+ export { type ApiSite, type ApiSitemap, type FetchSitesWithSitemapsOptions, type Site, type VerificationMethod, type VerificationSite, type VerificationToken, type VerificationWebResource, addSite, deleteSite, deleteSitemap, fetchSitemap, fetchSitemaps, fetchSites, fetchSitesWithSitemaps, getVerificationToken, getVerifiedSite, listVerifiedSites, resolveVerificationTarget, siteUrlToVerificationSite, submitSitemap, unverifySite, verificationMethodsFor, verifySite };
package/dist/sites.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import { addSite, deleteSite, deleteSitemap, fetchSitemap, fetchSitemaps, fetchSites, fetchSitesWithSitemaps, submitSitemap } from "./api/sites.mjs";
2
+ import { getVerificationToken, getVerifiedSite, listVerifiedSites, resolveVerificationTarget, siteUrlToVerificationSite, unverifySite, verificationMethodsFor, verifySite } from "./api/verification.mjs";
3
+ export { addSite, deleteSite, deleteSitemap, fetchSitemap, fetchSitemaps, fetchSites, fetchSitesWithSitemaps, getVerificationToken, getVerifiedSite, listVerifiedSites, resolveVerificationTarget, siteUrlToVerificationSite, submitSitemap, unverifySite, verificationMethodsFor, verifySite };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gscdump",
3
3
  "type": "module",
4
- "version": "3.0.0",
4
+ "version": "3.2.0",
5
5
  "description": "Direct Google Search Console and Bing Webmaster clients with typed queries and Indexing Evidence",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",
@@ -48,6 +48,16 @@
48
48
  "import": "./dist/bing/index.mjs",
49
49
  "default": "./dist/bing/index.mjs"
50
50
  },
51
+ "./client": {
52
+ "types": "./dist/client.d.mts",
53
+ "import": "./dist/client.mjs",
54
+ "default": "./dist/client.mjs"
55
+ },
56
+ "./indexing": {
57
+ "types": "./dist/indexing.d.mts",
58
+ "import": "./dist/indexing.mjs",
59
+ "default": "./dist/indexing.mjs"
60
+ },
51
61
  "./query/plan": {
52
62
  "types": "./dist/query/plan.d.mts",
53
63
  "import": "./dist/query/plan.mjs",
@@ -68,6 +78,11 @@
68
78
  "import": "./dist/dates.mjs",
69
79
  "default": "./dist/dates.mjs"
70
80
  },
81
+ "./errors": {
82
+ "types": "./dist/errors.d.mts",
83
+ "import": "./dist/errors.mjs",
84
+ "default": "./dist/errors.mjs"
85
+ },
71
86
  "./normalize": {
72
87
  "types": "./dist/normalize.d.mts",
73
88
  "import": "./dist/normalize.mjs",
@@ -78,6 +93,11 @@
78
93
  "import": "./dist/sitemap-identity.mjs",
79
94
  "default": "./dist/sitemap-identity.mjs"
80
95
  },
96
+ "./sites": {
97
+ "types": "./dist/sites.d.mts",
98
+ "import": "./dist/sites.mjs",
99
+ "default": "./dist/sites.mjs"
100
+ },
81
101
  "./tenant": {
82
102
  "types": "./dist/tenant.d.mts",
83
103
  "import": "./dist/tenant.mjs",
@@ -94,7 +114,7 @@
94
114
  },
95
115
  "dependencies": {
96
116
  "ofetch": "^1.5.1",
97
- "@gscdump/contracts": "^3.0.0"
117
+ "@gscdump/contracts": "^3.2.0"
98
118
  },
99
119
  "scripts": {
100
120
  "dev": "obuild --stub",