gscdump 3.0.0 → 3.1.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 +6 -0
- package/dist/bing/client.mjs +9 -1
- package/dist/bing/index.d.mts +3 -3
- package/dist/bing/index.mjs +2 -2
- package/dist/bing/normalize.d.mts +4 -2
- package/dist/bing/normalize.mjs +56 -7
- package/dist/bing/types.d.mts +49 -4
- package/dist/client.d.mts +4 -0
- package/dist/client.mjs +4 -0
- package/dist/contracts.d.mts +3 -3
- package/dist/core/window.d.mts +20 -0
- package/dist/core/window.mjs +63 -0
- package/dist/dates.d.mts +3 -1
- package/dist/dates.mjs +2 -1
- package/dist/errors.d.mts +2 -0
- package/dist/errors.mjs +2 -0
- package/dist/index.d.mts +5 -5
- package/dist/indexing.d.mts +5 -0
- package/dist/indexing.mjs +4 -0
- package/dist/query/constants.d.mts +2 -10
- package/dist/query/constants.mjs +1 -8
- package/dist/query/index.d.mts +1 -1
- package/dist/sites.d.mts +5 -0
- package/dist/sites.mjs +3 -0
- package/package.json +22 -2
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
|
package/dist/bing/client.mjs
CHANGED
|
@@ -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, 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,14 @@ 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
|
+
getCrawlStats: (siteUrl, callOptions) => request("GetCrawlStats", parseList(normalizeBingCrawlStats), {
|
|
214
|
+
query: { siteUrl },
|
|
215
|
+
signal: callOptions?.signal
|
|
216
|
+
}),
|
|
209
217
|
getCrawlIssues: (siteUrl, callOptions) => request("GetCrawlIssues", parseList(normalizeBingCrawlIssue), {
|
|
210
218
|
query: { siteUrl },
|
|
211
219
|
signal: callOptions?.signal
|
package/dist/bing/index.d.mts
CHANGED
|
@@ -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, 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, 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 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, normalizeBingSite, normalizeBingUrlInfo, normalizeBingUrlTrafficInfo };
|
package/dist/bing/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { normalizeBingCrawlIssue, normalizeBingIndexingEvidence, normalizeBingPageStats, normalizeBingSite, normalizeBingUrlInfo, normalizeBingUrlTrafficInfo } from "./normalize.mjs";
|
|
1
|
+
import { normalizeBingCrawlIssue, normalizeBingCrawlStats, normalizeBingIndexingEvidence, normalizeBingPageStats, normalizeBingQueryStats, 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, normalizeBingSite, normalizeBingUrlInfo, normalizeBingUrlTrafficInfo };
|
|
@@ -1,9 +1,11 @@
|
|
|
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, 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 normalizeBingCrawlStats(value: unknown): Result<BingCrawlStats, 'invalid-payload'>;
|
|
7
9
|
declare function normalizeBingCrawlIssue(value: unknown): Result<BingUrlWithCrawlIssues, 'invalid-payload'>;
|
|
8
10
|
declare function normalizeBingIndexingEvidence(info: BingUrlInfo | null, url: string, observedAt: Date): Result<BingIndexingEvidence, BingEvidenceError>;
|
|
9
|
-
export { normalizeBingCrawlIssue, normalizeBingIndexingEvidence, normalizeBingPageStats, normalizeBingSite, normalizeBingUrlInfo, normalizeBingUrlTrafficInfo };
|
|
11
|
+
export { normalizeBingCrawlIssue, normalizeBingCrawlStats, normalizeBingIndexingEvidence, normalizeBingPageStats, normalizeBingQueryStats, normalizeBingSite, normalizeBingUrlInfo, normalizeBingUrlTrafficInfo };
|
package/dist/bing/normalize.mjs
CHANGED
|
@@ -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,57 @@ function normalizeBingUrlTrafficInfo(value) {
|
|
|
51
60
|
url: value.Url
|
|
52
61
|
});
|
|
53
62
|
}
|
|
54
|
-
function
|
|
55
|
-
if (!isRecord(value) || !
|
|
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");
|
|
56
65
|
const date = parseBingDate(value.Date);
|
|
57
66
|
if (!date.ok || !date.value) return err("invalid-payload");
|
|
58
67
|
return ok({
|
|
59
|
-
averageClickPosition: value.AvgClickPosition,
|
|
60
|
-
averageImpressionPosition: value.AvgImpressionPosition,
|
|
68
|
+
averageClickPosition: normalizeBingAveragePosition(value.AvgClickPosition),
|
|
69
|
+
averageImpressionPosition: normalizeBingAveragePosition(value.AvgImpressionPosition),
|
|
61
70
|
clicks: value.Clicks,
|
|
62
71
|
date: date.value,
|
|
63
|
-
|
|
64
|
-
|
|
72
|
+
dimension: value.Query,
|
|
73
|
+
impressions: value.Impressions
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function normalizeBingPageStats(value) {
|
|
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 normalizeBingCrawlStats(value) {
|
|
95
|
+
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");
|
|
96
|
+
const date = parseBingDate(value.Date);
|
|
97
|
+
if (!date.ok || !date.value) return err("invalid-payload");
|
|
98
|
+
return ok({
|
|
99
|
+
allOtherCodes: value.AllOtherCodes,
|
|
100
|
+
blockedByRobotsTxt: value.BlockedByRobotsTxt,
|
|
101
|
+
code2xx: value.Code2xx,
|
|
102
|
+
code301: value.Code301,
|
|
103
|
+
code302: value.Code302,
|
|
104
|
+
code4xx: value.Code4xx,
|
|
105
|
+
code5xx: value.Code5xx,
|
|
106
|
+
...value.ConnectionTimeout === void 0 ? {} : { connectionTimeout: value.ConnectionTimeout },
|
|
107
|
+
containsMalware: value.ContainsMalware,
|
|
108
|
+
crawlErrors: value.CrawlErrors,
|
|
109
|
+
crawledPages: value.CrawledPages,
|
|
110
|
+
date: date.value,
|
|
111
|
+
...value.DnsFailures === void 0 ? {} : { dnsFailures: value.DnsFailures },
|
|
112
|
+
inIndex: value.InIndex,
|
|
113
|
+
inLinks: value.InLinks
|
|
65
114
|
});
|
|
66
115
|
}
|
|
67
116
|
const CRAWL_ISSUES = {
|
|
@@ -121,4 +170,4 @@ function normalizeBingIndexingEvidence(info, url, observedAt) {
|
|
|
121
170
|
url
|
|
122
171
|
});
|
|
123
172
|
}
|
|
124
|
-
export { normalizeBingCrawlIssue, normalizeBingIndexingEvidence, normalizeBingPageStats, normalizeBingSite, normalizeBingUrlInfo, normalizeBingUrlTrafficInfo };
|
|
173
|
+
export { normalizeBingCrawlIssue, normalizeBingCrawlStats, normalizeBingIndexingEvidence, normalizeBingPageStats, normalizeBingQueryStats, normalizeBingSite, normalizeBingUrlInfo, normalizeBingUrlTrafficInfo };
|
package/dist/bing/types.d.mts
CHANGED
|
@@ -33,6 +33,24 @@ interface BingQueryStatsWire {
|
|
|
33
33
|
Impressions: number;
|
|
34
34
|
Query: string;
|
|
35
35
|
}
|
|
36
|
+
interface BingCrawlStatsWire {
|
|
37
|
+
__type?: string;
|
|
38
|
+
AllOtherCodes: number;
|
|
39
|
+
BlockedByRobotsTxt: number;
|
|
40
|
+
Code2xx: number;
|
|
41
|
+
Code301: number;
|
|
42
|
+
Code302: number;
|
|
43
|
+
Code4xx: number;
|
|
44
|
+
Code5xx: number;
|
|
45
|
+
ConnectionTimeout?: number;
|
|
46
|
+
ContainsMalware: number;
|
|
47
|
+
CrawlErrors: number;
|
|
48
|
+
CrawledPages: number;
|
|
49
|
+
Date: string;
|
|
50
|
+
DnsFailures?: number;
|
|
51
|
+
InIndex: number;
|
|
52
|
+
InLinks: number;
|
|
53
|
+
}
|
|
36
54
|
interface BingCrawlIssueWire {
|
|
37
55
|
__type?: string;
|
|
38
56
|
HttpCode: number;
|
|
@@ -64,13 +82,38 @@ interface BingUrlTrafficInfo {
|
|
|
64
82
|
url: string;
|
|
65
83
|
}
|
|
66
84
|
interface BingPageStats {
|
|
67
|
-
averageClickPosition: number;
|
|
68
|
-
averageImpressionPosition: number;
|
|
85
|
+
averageClickPosition: number | null;
|
|
86
|
+
averageImpressionPosition: number | null;
|
|
87
|
+
clicks: number;
|
|
88
|
+
date: string;
|
|
89
|
+
impressions: number;
|
|
90
|
+
page: string;
|
|
91
|
+
}
|
|
92
|
+
interface BingQueryStats {
|
|
93
|
+
averageClickPosition: number | null;
|
|
94
|
+
averageImpressionPosition: number | null;
|
|
69
95
|
clicks: number;
|
|
70
96
|
date: string;
|
|
71
97
|
impressions: number;
|
|
72
98
|
query: string;
|
|
73
99
|
}
|
|
100
|
+
interface BingCrawlStats {
|
|
101
|
+
allOtherCodes: number;
|
|
102
|
+
blockedByRobotsTxt: number;
|
|
103
|
+
code2xx: number;
|
|
104
|
+
code301: number;
|
|
105
|
+
code302: number;
|
|
106
|
+
code4xx: number;
|
|
107
|
+
code5xx: number;
|
|
108
|
+
connectionTimeout?: number;
|
|
109
|
+
containsMalware: number;
|
|
110
|
+
crawlErrors: number;
|
|
111
|
+
crawledPages: number;
|
|
112
|
+
date: string;
|
|
113
|
+
dnsFailures?: number;
|
|
114
|
+
inIndex: number;
|
|
115
|
+
inLinks: number;
|
|
116
|
+
}
|
|
74
117
|
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
118
|
interface BingUrlWithCrawlIssues {
|
|
76
119
|
httpCode: number;
|
|
@@ -143,7 +186,7 @@ interface BingEvidenceError {
|
|
|
143
186
|
reason: 'not-a-page';
|
|
144
187
|
url: string;
|
|
145
188
|
}
|
|
146
|
-
type BingOperation = 'GetUserSites' | 'GetUrlInfo' | 'GetUrlTrafficInfo' | 'GetChildrenUrlInfo' | 'GetPageStats' | 'GetCrawlIssues';
|
|
189
|
+
type BingOperation = 'GetUserSites' | 'GetUrlInfo' | 'GetUrlTrafficInfo' | 'GetChildrenUrlInfo' | 'GetPageStats' | 'GetQueryStats' | 'GetCrawlStats' | 'GetCrawlIssues';
|
|
147
190
|
interface BingCallOptions {
|
|
148
191
|
signal?: AbortSignal;
|
|
149
192
|
}
|
|
@@ -169,6 +212,8 @@ interface BingWebmasterClient {
|
|
|
169
212
|
getUrlTrafficInfo: (siteUrl: string, url: string, options?: BingCallOptions) => Promise<Result<BingUrlTrafficInfo | null, BingProviderError>>;
|
|
170
213
|
getChildrenUrlInfo: (siteUrl: string, url: string, options?: BingChildrenOptions) => Promise<Result<BingUrlInfo[], BingProviderError>>;
|
|
171
214
|
getPageStats: (siteUrl: string, options?: BingCallOptions) => Promise<Result<BingPageStats[], BingProviderError>>;
|
|
215
|
+
getQueryStats: (siteUrl: string, options?: BingCallOptions) => Promise<Result<BingQueryStats[], BingProviderError>>;
|
|
216
|
+
getCrawlStats: (siteUrl: string, options?: BingCallOptions) => Promise<Result<BingCrawlStats[], BingProviderError>>;
|
|
172
217
|
getCrawlIssues: (siteUrl: string, options?: BingCallOptions) => Promise<Result<BingUrlWithCrawlIssues[], BingProviderError>>;
|
|
173
218
|
}
|
|
174
219
|
type BingFetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
@@ -178,4 +223,4 @@ interface BingWebmasterOptions {
|
|
|
178
223
|
clock?: () => Date;
|
|
179
224
|
fetch?: BingFetch;
|
|
180
225
|
}
|
|
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 };
|
|
226
|
+
export { BingCallOptions, BingChildrenFilters, BingChildrenOptions, BingCrawlDateFilter, BingCrawlEvidence, BingCrawlIssue, BingCrawlIssueWire, BingCrawlStats, BingCrawlStatsWire, BingDiscoveredDateFilter, BingDocumentFilter, BingEvidenceError, BingFetch, BingHttpCodeFilter, BingIndexingEvidence, BingOperation, BingPageStats, BingProviderError, BingQueryStats, BingQueryStatsWire, 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 };
|
package/dist/client.mjs
ADDED
|
@@ -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 };
|
package/dist/contracts.d.mts
CHANGED
|
@@ -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
|
-
|
|
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 };
|
package/dist/errors.mjs
ADDED
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 };
|
package/dist/query/constants.mjs
CHANGED
|
@@ -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 };
|
package/dist/query/index.d.mts
CHANGED
|
@@ -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";
|
package/dist/sites.d.mts
ADDED
|
@@ -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.
|
|
4
|
+
"version": "3.1.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.
|
|
117
|
+
"@gscdump/contracts": "^3.1.0"
|
|
98
118
|
},
|
|
99
119
|
"scripts": {
|
|
100
120
|
"dev": "obuild --stub",
|