@mailwoman/bdc 8.3.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 +7 -0
- package/index.ts +2 -0
- package/out/index.d.ts +3 -0
- package/out/index.d.ts.map +1 -0
- package/out/index.js +3 -0
- package/out/index.js.map +1 -0
- package/out/schema.d.ts +138 -0
- package/out/schema.d.ts.map +1 -0
- package/out/schema.js +88 -0
- package/out/schema.js.map +1 -0
- package/out/sdk/build-bdc.d.ts +214 -0
- package/out/sdk/build-bdc.d.ts.map +1 -0
- package/out/sdk/build-bdc.js +500 -0
- package/out/sdk/build-bdc.js.map +1 -0
- package/out/sdk/buildings.d.ts +84 -0
- package/out/sdk/buildings.d.ts.map +1 -0
- package/out/sdk/buildings.js +75 -0
- package/out/sdk/buildings.js.map +1 -0
- package/out/sdk/client.d.ts +237 -0
- package/out/sdk/client.d.ts.map +1 -0
- package/out/sdk/client.js +430 -0
- package/out/sdk/client.js.map +1 -0
- package/out/sdk/common.d.ts +279 -0
- package/out/sdk/common.d.ts.map +1 -0
- package/out/sdk/common.js +162 -0
- package/out/sdk/common.js.map +1 -0
- package/out/sdk/data-collection.d.ts +244 -0
- package/out/sdk/data-collection.d.ts.map +1 -0
- package/out/sdk/data-collection.js +50 -0
- package/out/sdk/data-collection.js.map +1 -0
- package/out/sdk/download.d.ts +36 -0
- package/out/sdk/download.d.ts.map +1 -0
- package/out/sdk/download.js +76 -0
- package/out/sdk/download.js.map +1 -0
- package/out/sdk/filing-dates.d.ts +57 -0
- package/out/sdk/filing-dates.d.ts.map +1 -0
- package/out/sdk/filing-dates.js +50 -0
- package/out/sdk/filing-dates.js.map +1 -0
- package/out/sdk/filing-landscape.d.ts +124 -0
- package/out/sdk/filing-landscape.d.ts.map +1 -0
- package/out/sdk/filing-landscape.js +216 -0
- package/out/sdk/filing-landscape.js.map +1 -0
- package/out/sdk/index.d.ts +15 -0
- package/out/sdk/index.d.ts.map +1 -0
- package/out/sdk/index.js +15 -0
- package/out/sdk/index.js.map +1 -0
- package/out/sdk/list-files.d.ts +39 -0
- package/out/sdk/list-files.d.ts.map +1 -0
- package/out/sdk/list-files.js +26 -0
- package/out/sdk/list-files.js.map +1 -0
- package/out/sdk/location.d.ts +40 -0
- package/out/sdk/location.d.ts.map +1 -0
- package/out/sdk/location.js +23 -0
- package/out/sdk/location.js.map +1 -0
- package/out/sdk/nearest-infrastructure.d.ts +84 -0
- package/out/sdk/nearest-infrastructure.d.ts.map +1 -0
- package/out/sdk/nearest-infrastructure.js +84 -0
- package/out/sdk/nearest-infrastructure.js.map +1 -0
- package/out/sdk/parsing.d.ts +57 -0
- package/out/sdk/parsing.d.ts.map +1 -0
- package/out/sdk/parsing.js +87 -0
- package/out/sdk/parsing.js.map +1 -0
- package/out/sdk/plausibility.d.ts +256 -0
- package/out/sdk/plausibility.d.ts.map +1 -0
- package/out/sdk/plausibility.js +334 -0
- package/out/sdk/plausibility.js.map +1 -0
- package/out/sdk/technologies.d.ts +229 -0
- package/out/sdk/technologies.d.ts.map +1 -0
- package/out/sdk/technologies.js +217 -0
- package/out/sdk/technologies.js.map +1 -0
- package/package.json +97 -0
- package/schema.ts +172 -0
- package/sdk/build-bdc.ts +810 -0
- package/sdk/buildings.ts +87 -0
- package/sdk/client.ts +643 -0
- package/sdk/common.ts +363 -0
- package/sdk/data-collection.ts +268 -0
- package/sdk/download.ts +91 -0
- package/sdk/filing-dates.ts +88 -0
- package/sdk/filing-landscape.ts +287 -0
- package/sdk/index.ts +14 -0
- package/sdk/list-files.ts +72 -0
- package/sdk/location.ts +45 -0
- package/sdk/nearest-infrastructure.ts +129 -0
- package/sdk/parsing.ts +124 -0
- package/sdk/plausibility.ts +512 -0
- package/sdk/technologies.ts +258 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software.
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
* @file FCC/NITA Building Type Codes
|
|
6
|
+
* @see https://www.fcc.gov/sites/default/files/2019-08/Building%20Type%20Code%20List.pdf
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Code indicating the type of building at the location.
|
|
10
|
+
*
|
|
11
|
+
* @category NTIA
|
|
12
|
+
* @category FCC
|
|
13
|
+
* @title Building Type Code
|
|
14
|
+
*/
|
|
15
|
+
export const BuildingTypeCode = {
|
|
16
|
+
/**
|
|
17
|
+
* A single-family home, apartment building, or condominium.
|
|
18
|
+
*
|
|
19
|
+
* @title Residential Building
|
|
20
|
+
*/
|
|
21
|
+
Residential: "R",
|
|
22
|
+
/**
|
|
23
|
+
* A office building, retail store, or warehouse.
|
|
24
|
+
*
|
|
25
|
+
* @title Non-residential Building
|
|
26
|
+
*/
|
|
27
|
+
NonResidential: "B",
|
|
28
|
+
/**
|
|
29
|
+
* Both residential and non-residential units.
|
|
30
|
+
*
|
|
31
|
+
* @title Mixed-use Building
|
|
32
|
+
*/
|
|
33
|
+
Mixed: "X",
|
|
34
|
+
/**
|
|
35
|
+
* A dormitory, nursing home, or prison.
|
|
36
|
+
*
|
|
37
|
+
* @title Group Quarters
|
|
38
|
+
*/
|
|
39
|
+
GroupQuarters: "G",
|
|
40
|
+
/**
|
|
41
|
+
* @title Community Anchor Institution
|
|
42
|
+
* @see {@link https://help.bdc.fcc.gov/hc/en-us/articles/13471550784411-How-to-Identify-a-Community-Anchor-Institution-as-a-Broadband-Serviceable-Location CAI Guide}
|
|
43
|
+
*/
|
|
44
|
+
CAI: "C",
|
|
45
|
+
/**
|
|
46
|
+
* @title Enterprise or business park.
|
|
47
|
+
*/
|
|
48
|
+
Enterprise: "E",
|
|
49
|
+
/**
|
|
50
|
+
* Building type not covered by the above categories.
|
|
51
|
+
*
|
|
52
|
+
* @title Other
|
|
53
|
+
*/
|
|
54
|
+
Other: "O",
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Code indicating the type of building at the location.
|
|
58
|
+
*
|
|
59
|
+
* @title Business/Residential Code
|
|
60
|
+
*/
|
|
61
|
+
export const BusinessResidentialCode = {
|
|
62
|
+
/**
|
|
63
|
+
* @title Business-only service.
|
|
64
|
+
*/
|
|
65
|
+
Business: BuildingTypeCode.NonResidential,
|
|
66
|
+
/**
|
|
67
|
+
* @title Residential-only service.
|
|
68
|
+
*/
|
|
69
|
+
Residential: BuildingTypeCode.Residential,
|
|
70
|
+
/**
|
|
71
|
+
* @title Mixed business and residential service.
|
|
72
|
+
*/
|
|
73
|
+
Mixed: BuildingTypeCode.Mixed,
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=buildings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildings.js","sourceRoot":"","sources":["../../sdk/buildings.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC/B;;;;OAIG;IACH,WAAW,EAAE,GAAG;IAChB;;;;OAIG;IACH,cAAc,EAAE,GAAG;IACnB;;;;OAIG;IACH,KAAK,EAAE,GAAG;IACV;;;;OAIG;IACH,aAAa,EAAE,GAAG;IAClB;;;OAGG;IACH,GAAG,EAAE,GAAG;IACR;;OAEG;IACH,UAAU,EAAE,GAAG;IACf;;;;OAIG;IACH,KAAK,EAAE,GAAG;CACD,CAAA;AAQV;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACtC;;OAEG;IACH,QAAQ,EAAE,gBAAgB,CAAC,cAAc;IACzC;;OAEG;IACH,WAAW,EAAE,gBAAgB,CAAC,WAAW;IACzC;;OAEG;IACH,KAAK,EAAE,gBAAgB,CAAC,KAAK;CACpB,CAAA"}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software.
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
* @file FCC Broadband Data Collection (BDC) public-API client, built on {@linkcode APIClient}.
|
|
6
|
+
*
|
|
7
|
+
* Originally re-homed from Nexus's `sync/fcc/bdc/client.ts` (relicense-by-copy, no provenance
|
|
8
|
+
* headers) as a raw-`fetch` factory. That version had no throttle, no cache and no retry at all, and
|
|
9
|
+
* threw a bespoke `Error` a caller could only branch on by reading its prose. All four now come from
|
|
10
|
+
* `@mailwoman/core/api`, the repo's default base for HTTP clients (see `AGENTS.md`).
|
|
11
|
+
* `filer/sdk/sec-client.ts` is the worked example this follows. What stays BDC-specific:
|
|
12
|
+
*
|
|
13
|
+
* 1. The credential fail-fast off `$private.FCC_MAP_USERNAME`/`FCC_MAP_API_KEY`. A
|
|
14
|
+
* silently-unauthenticated client just 401s on first use, which is a worse failure mode than
|
|
15
|
+
* failing at construction.
|
|
16
|
+
* 2. The `username` + `hash_value` PLAIN HEADER PAIR — read carefully off the Nexus original's
|
|
17
|
+
* `axios.headers` config, this is NOT bearer or basic auth.
|
|
18
|
+
* 3. The request budget: {@linkcode BDC_DEFAULT_REQUESTS_PER_MINUTE} requests per MINUTE, six
|
|
19
|
+
* seconds apart. See that constant for the sourcing and for why the interval gate is set too.
|
|
20
|
+
* 4. UN-UNWRAPPED response bodies. Every BDC endpoint nests its payload under a `data` key
|
|
21
|
+
* (`{ data: [...] }`), and callers pluck `.data` themselves at the call site — `filing-dates.ts`
|
|
22
|
+
* and `list-files.ts` both do. {@linkcode BDCClient.get} deliberately does NOT unwrap, so the
|
|
23
|
+
* envelope stays visible in the caller's own response type.
|
|
24
|
+
* 5. The zip path ({@linkcode BDCClient.getArrayBuffer}), which is binary and UNCACHED. See its
|
|
25
|
+
* docstring.
|
|
26
|
+
*
|
|
27
|
+
* ERROR CONTRACT. Every failure past construction is a {@linkcode ResourceError}, so an ingestion run
|
|
28
|
+
* branches on `status` plus {@linkcode isTransientResourceError} and never on message prose:
|
|
29
|
+
*
|
|
30
|
+
* | Outcome | Caller action | Test |
|
|
31
|
+
* | --------------------------------- | ---------------- | ------------------------------------------ |
|
|
32
|
+
* | 401 / 403 | abort the run | `error.status === 401 \|\| === 403` |
|
|
33
|
+
* | 404 | skip this file | `error.status === 404` |
|
|
34
|
+
* | exhausted 429/5xx | requeue | `isTransientResourceError(error)` |
|
|
35
|
+
* | exhausted network/timeout | requeue | `isTransientResourceError(error)` |
|
|
36
|
+
* | undecodable body | programmer bug | `isTransientResourceError(error)` is false |
|
|
37
|
+
*/
|
|
38
|
+
import { APIClient, type APIClientConfig, type ClockLike } from "@mailwoman/core/api";
|
|
39
|
+
export { isTransientResourceError } from "@mailwoman/core/api";
|
|
40
|
+
export { ResourceError } from "@mailwoman/core/errors";
|
|
41
|
+
/**
|
|
42
|
+
* The FCC BDC public-API base URL every request is resolved against.
|
|
43
|
+
*/
|
|
44
|
+
export declare const BDC_API_BASE_URL = "https://broadbandmap.fcc.gov/api/public";
|
|
45
|
+
/**
|
|
46
|
+
* The FCC's published request ceiling for the Broadband Map public API: **10 requests per MINUTE**, i.e. one every six
|
|
47
|
+
* seconds. Sixty times tighter than SEC EDGAR's per-second cap, so it is the dominant cost of any BDC ingestion run.
|
|
48
|
+
*
|
|
49
|
+
* SOURCING, stated precisely because it could not be verified from here: this figure comes from the operator's reading
|
|
50
|
+
* of the FCC's own API documentation. It was NOT confirmed against a fetchable source — the API spec is a Box-hosted
|
|
51
|
+
* PDF, and `broadbandmap.fcc.gov/api-documentation` does not resolve. Treat it as the published limit as reported, not
|
|
52
|
+
* as something this repo checked.
|
|
53
|
+
*
|
|
54
|
+
* This is the DEFAULT, not a clamp. `createSECClient` clamps because SEC's limit is verifiable, actively policed, and
|
|
55
|
+
* published in fetchable HTML; none of that holds here, so pinning an unverified number as law would be false
|
|
56
|
+
* precision. {@linkcode CreateBDCClientOptions.requestsPerMinute} tunes it in either direction, and the throttle meter
|
|
57
|
+
* (see {@linkcode BDCClient.throttleStats}) is how a real run reports what the setting actually cost.
|
|
58
|
+
*
|
|
59
|
+
* If FCC ever answers with a 429, drop this to 9 before anything else: pacing exactly AT a published rate leaves no
|
|
60
|
+
* headroom for event-loop jitter, and a grant that lands a millisecond late shifts into the following window. See
|
|
61
|
+
* `core/api/pacer.ts`'s real-clock caveat, and `SEC_DEFAULT_REQUESTS_PER_SECOND` for the same decision taken under a
|
|
62
|
+
* measurement.
|
|
63
|
+
*/
|
|
64
|
+
export declare const BDC_DEFAULT_REQUESTS_PER_MINUTE = 10;
|
|
65
|
+
/**
|
|
66
|
+
* Options for {@linkcode createBDCClient}.
|
|
67
|
+
*/
|
|
68
|
+
export interface CreateBDCClientOptions {
|
|
69
|
+
/**
|
|
70
|
+
* FCC Broadband Map username. Defaults to `$private.FCC_MAP_USERNAME` when omitted.
|
|
71
|
+
*/
|
|
72
|
+
username?: string;
|
|
73
|
+
/**
|
|
74
|
+
* FCC Broadband Map API key, sent as the `hash_value` header. Defaults to `$private.FCC_MAP_API_KEY` when omitted.
|
|
75
|
+
*/
|
|
76
|
+
apiKey?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Requests per minute this client will dispatch. Defaults to {@linkcode BDC_DEFAULT_REQUESTS_PER_MINUTE}. NOT clamped
|
|
79
|
+
* — see that constant for why an unverified limit gets a default rather than a law.
|
|
80
|
+
*/
|
|
81
|
+
requestsPerMinute?: number;
|
|
82
|
+
/**
|
|
83
|
+
* Time source powering the throttle, the cooldown timer, and the retry backoff. Defaults to the system clock. Tests
|
|
84
|
+
* inject a fake clock so throttle and retry behavior are deterministic and instant — no wall-clock sleeps in the
|
|
85
|
+
* suite, which matters more here than anywhere else in the repo: one real grant costs six seconds.
|
|
86
|
+
*/
|
|
87
|
+
clock?: ClockLike;
|
|
88
|
+
/**
|
|
89
|
+
* On-disk cache root. Defaults to `dataRootPath("bdc", "cache", "http")`, resolved once at construction — construct
|
|
90
|
+
* the client after setting `$MAILWOMAN_DATA_ROOT`, not before.
|
|
91
|
+
*/
|
|
92
|
+
cacheDir?: string;
|
|
93
|
+
/**
|
|
94
|
+
* How long a cached JSON response stays fresh, in milliseconds. See {@linkcode DEFAULT_CACHE_TTL_MS}.
|
|
95
|
+
*/
|
|
96
|
+
cacheTTLMs?: number;
|
|
97
|
+
/**
|
|
98
|
+
* Total attempts (including the first) before giving up on a 429/5xx or a network-class failure. A STATED CEILING,
|
|
99
|
+
* not "until it works". Never applies to a 401/403/404.
|
|
100
|
+
*/
|
|
101
|
+
maxAttempts?: number;
|
|
102
|
+
/**
|
|
103
|
+
* Base delay for the exponential backoff between retry attempts, in milliseconds. Attempt `n`'s wait is
|
|
104
|
+
* `baseRetryDelayMs * 2^(n-1)`, UNLESS the response carried a `Retry-After` header, which is honored instead.
|
|
105
|
+
*/
|
|
106
|
+
baseRetryDelayMs?: number;
|
|
107
|
+
/**
|
|
108
|
+
* Per-attempt socket-inactivity timeout for a JSON request, in milliseconds.
|
|
109
|
+
*/
|
|
110
|
+
requestTimeoutMs?: number;
|
|
111
|
+
/**
|
|
112
|
+
* Per-attempt socket-inactivity timeout for a zip download, in milliseconds. See
|
|
113
|
+
* {@linkcode DEFAULT_DOWNLOAD_TIMEOUT_MS}.
|
|
114
|
+
*/
|
|
115
|
+
downloadTimeoutMs?: number;
|
|
116
|
+
/**
|
|
117
|
+
* Axios overrides, merged over this client's own defaults. THE TEST SEAM, replacing the old `fetchImpl` option: every
|
|
118
|
+
* test passes an `adapter` here, so no test in this workspace ever performs a live network call. Overriding `headers`
|
|
119
|
+
* wholesale would drop the credential pair, so don't.
|
|
120
|
+
*/
|
|
121
|
+
axios?: APIClientConfig["axios"];
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Query-string parameter values a {@linkcode BDCClient.get} call may carry. `undefined` values are omitted rather than
|
|
125
|
+
* serialized as the literal string `"undefined"`.
|
|
126
|
+
*/
|
|
127
|
+
export type BDCQueryParams = Record<string, string | number | undefined>;
|
|
128
|
+
/**
|
|
129
|
+
* Per-call overrides for {@linkcode BDCClient.get}.
|
|
130
|
+
*/
|
|
131
|
+
export interface BDCGetOptions {
|
|
132
|
+
/**
|
|
133
|
+
* Bypass the response cache for THIS call — both the read and the write. The request still clears the throttle, so a
|
|
134
|
+
* caller cannot use this to dodge the rate budget, only the staleness.
|
|
135
|
+
*/
|
|
136
|
+
skipCache?: boolean;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* What a run spent waiting on the request throttle, as reported by {@linkcode BDCClient.throttleStats}.
|
|
140
|
+
*/
|
|
141
|
+
export interface BDCThrottleStats {
|
|
142
|
+
/**
|
|
143
|
+
* Milliseconds since the client was constructed, on the client's own clock.
|
|
144
|
+
*/
|
|
145
|
+
elapsedMs: number;
|
|
146
|
+
/**
|
|
147
|
+
* Milliseconds this client spent asleep. Almost entirely throttle waits; a retry backoff after a 429/5xx also lands
|
|
148
|
+
* here, which is deliberate — both are time the upstream's limits cost the run, and separating them would need a hook
|
|
149
|
+
* `APIClient` does not expose.
|
|
150
|
+
*/
|
|
151
|
+
waitingMs: number;
|
|
152
|
+
/**
|
|
153
|
+
* How many separate waits made up {@linkcode BDCThrottleStats.waitingMs}.
|
|
154
|
+
*/
|
|
155
|
+
waits: number;
|
|
156
|
+
/**
|
|
157
|
+
* How many times the per-minute BUDGET gate opened a cooldown, counted off `APIClient`'s `cooldown_start` event. With
|
|
158
|
+
* the interval gate also configured this is one per budget's worth of requests, and each is a REAL wait, not a
|
|
159
|
+
* zero-length window-rollover marker: the budget's cooldown runs to the end of the minute the window opened in
|
|
160
|
+
* (`APIClient.#reserveCooldownSlot`), and the interval gate has by then spent only `(N-1) * 60000/N` ms of it. At
|
|
161
|
+
* 10/minute that is a 6 s cooldown per 10 requests. Some of {@linkcode BDCThrottleStats.waitingMs} is therefore
|
|
162
|
+
* cooldown, not pacing. See {@linkcode createBDCClient} for the full arrival trace.
|
|
163
|
+
*/
|
|
164
|
+
cooldowns: number;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* {@linkcode APIClient} configuration plus the BDC-specific fields {@linkcode BDCClient} reads back off `config`.
|
|
168
|
+
*/
|
|
169
|
+
export interface BDCClientConfig extends APIClientConfig {
|
|
170
|
+
/**
|
|
171
|
+
* The username half of the credential pair. Named in the 401/403 explanation so a maintainer can see which account
|
|
172
|
+
* was actually used; the key half is never echoed.
|
|
173
|
+
*/
|
|
174
|
+
username: string;
|
|
175
|
+
/**
|
|
176
|
+
* Per-attempt socket-inactivity timeout applied to the binary path only, overriding the instance-wide `axios.timeout`
|
|
177
|
+
* that governs JSON requests.
|
|
178
|
+
*/
|
|
179
|
+
downloadTimeoutMs: number;
|
|
180
|
+
/**
|
|
181
|
+
* Snapshot the throttle meter. Installed by {@linkcode createBDCClient}, which owns the metering clock the meter reads
|
|
182
|
+
* through.
|
|
183
|
+
*/
|
|
184
|
+
readThrottleStats: () => BDCThrottleStats;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* A constructed FCC BDC public-API client. Build one with {@linkcode createBDCClient}, which resolves the credentials,
|
|
188
|
+
* the throttle, the cache, and every default.
|
|
189
|
+
*/
|
|
190
|
+
export declare class BDCClient extends APIClient<BDCClientConfig> {
|
|
191
|
+
#private;
|
|
192
|
+
/**
|
|
193
|
+
* Issue an authenticated `GET` against the BDC public API and parse the JSON response body, subject to the on-disk
|
|
194
|
+
* cache, the request throttle, and bounded retry.
|
|
195
|
+
*
|
|
196
|
+
* `path` is appended to {@linkcode BDC_API_BASE_URL} as-is (a leading slash, e.g. `/map/listAsOfDates`). `params`
|
|
197
|
+
* become the request's query string; the response body is returned UN-unwrapped — every BDC endpoint nests its
|
|
198
|
+
* payload under a `data` key (`{ data: [...] }`), so callers pluck `.data` themselves at the call site.
|
|
199
|
+
*
|
|
200
|
+
* Concurrent calls for the same URL that both miss the cache share a single in-flight request — the cache
|
|
201
|
+
* interceptor's own stampede guard, which the raw-`fetch` client had no equivalent of.
|
|
202
|
+
*/
|
|
203
|
+
get<T>(path: string, params?: BDCQueryParams, options?: BDCGetOptions): Promise<T>;
|
|
204
|
+
/**
|
|
205
|
+
* Issue an authenticated `GET` and return the raw response body as an `ArrayBuffer` — the binary counterpart to
|
|
206
|
+
* {@linkcode BDCClient.get}. Used for the zip-wrapped availability downloads (`downloadBDCFile` in `./download.ts`),
|
|
207
|
+
* where the response is a `.zip` archive rather than a JSON envelope.
|
|
208
|
+
*
|
|
209
|
+
* CACHING IS OFF FOR THIS PATH, deliberately, and it is not a tunable. The response cache validates and persists
|
|
210
|
+
* JSON: it would reject a zip on the way in (the validator requires a `data`-keyed object), and even if it accepted
|
|
211
|
+
* one, serializing a multi-hundred-megabyte archive through `JSON.stringify` into a hash-named file would be a second
|
|
212
|
+
* copy of a thing `downloadBDCFile` already writes to disk itself — which is also where its real cache check lives
|
|
213
|
+
* (it returns the extracted CSV's path without issuing any request when that file exists). Two disk copies of the
|
|
214
|
+
* same archive, one of them unreadable.
|
|
215
|
+
*
|
|
216
|
+
* The throttle still applies: skipping the cache is not a way around the rate budget.
|
|
217
|
+
*/
|
|
218
|
+
getArrayBuffer(path: string, params?: BDCQueryParams): Promise<ArrayBuffer>;
|
|
219
|
+
/**
|
|
220
|
+
* What this client has spent waiting on the throttle so far. At six seconds a grant, a bulk ingest is throttle-bound
|
|
221
|
+
* by construction, and this is the measurement to assess a rate change against — see
|
|
222
|
+
* {@linkcode formatBDCThrottleStats} for the one-line rendering `gazetteer build bdc` prints.
|
|
223
|
+
*/
|
|
224
|
+
throttleStats(): BDCThrottleStats;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Render {@linkcode BDCThrottleStats} as one human-readable line, for the end of an ingestion run.
|
|
228
|
+
*/
|
|
229
|
+
export declare function formatBDCThrottleStats(stats: BDCThrottleStats): string;
|
|
230
|
+
/**
|
|
231
|
+
* Create an FCC Broadband Data Collection public-API client. See the file header for the full rationale.
|
|
232
|
+
*
|
|
233
|
+
* Throws immediately, before any request is made, when constructed without explicit credentials AND without the
|
|
234
|
+
* `FCC_MAP_USERNAME`/`FCC_MAP_API_KEY` environment values.
|
|
235
|
+
*/
|
|
236
|
+
export declare function createBDCClient(options?: CreateBDCClientOptions): BDCClient;
|
|
237
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../sdk/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,KAAK,SAAS,EAAe,MAAM,qBAAqB,CAAA;AAOlG,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAEtD;;GAEG;AACH,eAAO,MAAM,gBAAgB,4CAA4C,CAAA;AAEzE;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,+BAA+B,KAAK,CAAA;AAqEjD;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B;;;;OAIG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CAAA;CAChC;AAED;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAA;AAExE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;;;;;OAOG;IACH,SAAS,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACvD;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAA;IACzB;;;OAGG;IACH,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;CACzC;AAoGD;;;GAGG;AACH,qBAAa,SAAU,SAAQ,SAAS,CAAC,eAAe,CAAC;;IACxD;;;;;;;;;;OAUG;IACU,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,EAAE,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,CAAC,CAAC;IAUnG;;;;;;;;;;;;;OAaG;IACU,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC;IAaxF;;;;OAIG;IACI,aAAa,IAAI,gBAAgB;CAiBxC;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAOtE;AAyED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,SAAS,CAwG/E"}
|