@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.
Files changed (87) hide show
  1. package/README.md +7 -0
  2. package/index.ts +2 -0
  3. package/out/index.d.ts +3 -0
  4. package/out/index.d.ts.map +1 -0
  5. package/out/index.js +3 -0
  6. package/out/index.js.map +1 -0
  7. package/out/schema.d.ts +138 -0
  8. package/out/schema.d.ts.map +1 -0
  9. package/out/schema.js +88 -0
  10. package/out/schema.js.map +1 -0
  11. package/out/sdk/build-bdc.d.ts +214 -0
  12. package/out/sdk/build-bdc.d.ts.map +1 -0
  13. package/out/sdk/build-bdc.js +500 -0
  14. package/out/sdk/build-bdc.js.map +1 -0
  15. package/out/sdk/buildings.d.ts +84 -0
  16. package/out/sdk/buildings.d.ts.map +1 -0
  17. package/out/sdk/buildings.js +75 -0
  18. package/out/sdk/buildings.js.map +1 -0
  19. package/out/sdk/client.d.ts +237 -0
  20. package/out/sdk/client.d.ts.map +1 -0
  21. package/out/sdk/client.js +430 -0
  22. package/out/sdk/client.js.map +1 -0
  23. package/out/sdk/common.d.ts +279 -0
  24. package/out/sdk/common.d.ts.map +1 -0
  25. package/out/sdk/common.js +162 -0
  26. package/out/sdk/common.js.map +1 -0
  27. package/out/sdk/data-collection.d.ts +244 -0
  28. package/out/sdk/data-collection.d.ts.map +1 -0
  29. package/out/sdk/data-collection.js +50 -0
  30. package/out/sdk/data-collection.js.map +1 -0
  31. package/out/sdk/download.d.ts +36 -0
  32. package/out/sdk/download.d.ts.map +1 -0
  33. package/out/sdk/download.js +76 -0
  34. package/out/sdk/download.js.map +1 -0
  35. package/out/sdk/filing-dates.d.ts +57 -0
  36. package/out/sdk/filing-dates.d.ts.map +1 -0
  37. package/out/sdk/filing-dates.js +50 -0
  38. package/out/sdk/filing-dates.js.map +1 -0
  39. package/out/sdk/filing-landscape.d.ts +124 -0
  40. package/out/sdk/filing-landscape.d.ts.map +1 -0
  41. package/out/sdk/filing-landscape.js +216 -0
  42. package/out/sdk/filing-landscape.js.map +1 -0
  43. package/out/sdk/index.d.ts +15 -0
  44. package/out/sdk/index.d.ts.map +1 -0
  45. package/out/sdk/index.js +15 -0
  46. package/out/sdk/index.js.map +1 -0
  47. package/out/sdk/list-files.d.ts +39 -0
  48. package/out/sdk/list-files.d.ts.map +1 -0
  49. package/out/sdk/list-files.js +26 -0
  50. package/out/sdk/list-files.js.map +1 -0
  51. package/out/sdk/location.d.ts +40 -0
  52. package/out/sdk/location.d.ts.map +1 -0
  53. package/out/sdk/location.js +23 -0
  54. package/out/sdk/location.js.map +1 -0
  55. package/out/sdk/nearest-infrastructure.d.ts +84 -0
  56. package/out/sdk/nearest-infrastructure.d.ts.map +1 -0
  57. package/out/sdk/nearest-infrastructure.js +84 -0
  58. package/out/sdk/nearest-infrastructure.js.map +1 -0
  59. package/out/sdk/parsing.d.ts +57 -0
  60. package/out/sdk/parsing.d.ts.map +1 -0
  61. package/out/sdk/parsing.js +87 -0
  62. package/out/sdk/parsing.js.map +1 -0
  63. package/out/sdk/plausibility.d.ts +256 -0
  64. package/out/sdk/plausibility.d.ts.map +1 -0
  65. package/out/sdk/plausibility.js +334 -0
  66. package/out/sdk/plausibility.js.map +1 -0
  67. package/out/sdk/technologies.d.ts +229 -0
  68. package/out/sdk/technologies.d.ts.map +1 -0
  69. package/out/sdk/technologies.js +217 -0
  70. package/out/sdk/technologies.js.map +1 -0
  71. package/package.json +97 -0
  72. package/schema.ts +172 -0
  73. package/sdk/build-bdc.ts +810 -0
  74. package/sdk/buildings.ts +87 -0
  75. package/sdk/client.ts +643 -0
  76. package/sdk/common.ts +363 -0
  77. package/sdk/data-collection.ts +268 -0
  78. package/sdk/download.ts +91 -0
  79. package/sdk/filing-dates.ts +88 -0
  80. package/sdk/filing-landscape.ts +287 -0
  81. package/sdk/index.ts +14 -0
  82. package/sdk/list-files.ts +72 -0
  83. package/sdk/location.ts +45 -0
  84. package/sdk/nearest-infrastructure.ts +129 -0
  85. package/sdk/parsing.ts +124 -0
  86. package/sdk/plausibility.ts +512 -0
  87. package/sdk/technologies.ts +258 -0
@@ -0,0 +1,279 @@
1
+ /**
2
+ * @copyright Sister Software.
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ * @file BDC file metadata model — dictionaries for the FCC's `bdc_file` listing rows, the
6
+ * raw-to-parsed record shape, and file-ordering comparators.
7
+ */
8
+ import type { Tagged } from "type-fest";
9
+ import type { BroadbandTechnologyCode } from "./technologies.ts";
10
+ /**
11
+ * Unique identifier for an FCC BDC broadband provider.
12
+ *
13
+ * Re-homed locally as `Tagged<number, ...>` — the Nexus original imported this from `@isp.nexus/fcc`
14
+ * (`BroadbandProvider.ts`), where it's defined identically.
15
+ *
16
+ * @category BDC
17
+ * @category FCC
18
+ */
19
+ export type ProviderID = Tagged<number, "ProviderID">;
20
+ /**
21
+ * The data type of the file, e.g. what kind of data is in the file.
22
+ *
23
+ * @category BDC
24
+ * @category FCC
25
+ */
26
+ export declare const BDCFilingDataType: {
27
+ /**
28
+ * The file contains data about the availability of broadband with a specific provider.
29
+ */
30
+ readonly Availability: "availability";
31
+ /**
32
+ * The file contains data about the challenge process.
33
+ */
34
+ readonly Challenge: "challenge";
35
+ };
36
+ /**
37
+ * @category BDC
38
+ * @category FCC
39
+ */
40
+ export type BDCFilingDataType = (typeof BDCFilingDataType)[keyof typeof BDCFilingDataType];
41
+ /**
42
+ * @category BDC
43
+ * @category FCC
44
+ */
45
+ export declare const BDCGISFileType: {
46
+ readonly ShapeFile: 1;
47
+ readonly GeoPackage: 2;
48
+ };
49
+ /**
50
+ * @category BDC
51
+ * @category FCC
52
+ */
53
+ export type BDCGISFileType = (typeof BDCGISFileType)[keyof typeof BDCGISFileType];
54
+ /**
55
+ * The type of file, e.g. what format the file is in.
56
+ *
57
+ * @category BDC
58
+ * @category FCC
59
+ */
60
+ export declare const BDCFileFormat: {
61
+ readonly CSV: "csv";
62
+ readonly GIS: "gis";
63
+ };
64
+ /**
65
+ * @category BDC
66
+ * @category FCC
67
+ */
68
+ export type BDCFileFormat = (typeof BDCFileFormat)[keyof typeof BDCFileFormat];
69
+ /**
70
+ * @category BDC
71
+ * @category FCC
72
+ */
73
+ export declare const BDCFileCategory: {
74
+ readonly Provider: "Provider";
75
+ readonly Summary: "Summary";
76
+ readonly State: "State";
77
+ };
78
+ /**
79
+ * @category BDC
80
+ * @category FCC
81
+ */
82
+ export type BDCFileCategory = (typeof BDCFileCategory)[keyof typeof BDCFileCategory];
83
+ /**
84
+ * @category BDC
85
+ * @category FCC
86
+ */
87
+ export declare const BDCProviderSubCategory: {
88
+ readonly FixedBroadband: "Fixed Broadband";
89
+ readonly MobileBroadband: "Mobile Broadband";
90
+ readonly MobileVoice: "Mobile Voice";
91
+ readonly SupportingData: "Supporting Data";
92
+ };
93
+ /**
94
+ * @category BDC
95
+ * @category FCC
96
+ */
97
+ export type BDCProviderSubCategory = (typeof BDCProviderSubCategory)[keyof typeof BDCProviderSubCategory];
98
+ /**
99
+ * @category BDC
100
+ * @category FCC
101
+ */
102
+ export declare const BDCSummarySubCategory: {
103
+ readonly BroadbandSummaryByGeography: "Broadband Summary by Geography Type";
104
+ readonly ProviderSummaryByGeography: "Provider Summary by Geography Type";
105
+ readonly ProviderSummaryFixedBroadband: "Provider Summary - Fixed Broadband";
106
+ readonly ProviderSummaryMobileBroadband: "Provider Summary - Mobile Broadband";
107
+ };
108
+ /**
109
+ * @category BDC
110
+ * @category FCC
111
+ */
112
+ export type BDCSummarySubCategory = (typeof BDCSummarySubCategory)[keyof typeof BDCSummarySubCategory];
113
+ /**
114
+ * @category BDC
115
+ * @category FCC
116
+ */
117
+ export declare const BDCStateSubCategory: {
118
+ readonly FixedBroadband: "Fixed Broadband";
119
+ readonly MobileBroadband: "Mobile Broadband";
120
+ readonly MobileVoice: "Mobile Voice";
121
+ };
122
+ /**
123
+ * @category BDC
124
+ * @category FCC
125
+ */
126
+ export type BDCStateSubCategory = (typeof BDCStateSubCategory)[keyof typeof BDCStateSubCategory];
127
+ export type BDCSubCategory = BDCProviderSubCategory | BDCStateSubCategory | BDCSummarySubCategory;
128
+ /**
129
+ * A single row from the FCC's BDC file listing, as returned by the API before parsing.
130
+ *
131
+ * @category BDC
132
+ * @category FCC
133
+ */
134
+ export interface RawBDCFile {
135
+ file_id: number;
136
+ category: BDCFileCategory;
137
+ subcategory: BDCSubCategory;
138
+ /**
139
+ * Comma-separated list of technology codes.
140
+ *
141
+ * Nullable in live data: the FCC's `/map/downloads/listAvailabilityData` response carries `technology_code: null` for
142
+ * at least some State-category rows (first observed in the live FCC smoke test, see
143
+ * `.superpowers/sdd/2026-07-30-bdc-2b-plan/live-smoke-findings.md`). Guarded in {@linkcode parseRawBDCFile} — a null
144
+ * value parses to an empty `technologyCodes` set rather than throwing.
145
+ *
146
+ * @see {@link BroadbandTechnologyCode}
147
+ */
148
+ technology_code: string | null;
149
+ technology_code_desc: string;
150
+ /**
151
+ * 2-digit state or territory FIPS code.
152
+ *
153
+ * Loosely typed as `string` for now. The Nexus original was `AdminLevel1Code` (via `@isp.nexus/tiger`); this port
154
+ * drops that dependency, same as `data-collection.ts`'s `FCCStateID`. Task 2c tightens this against
155
+ * `@mailwoman/tiger` if a downstream dictionary needs the literal union.
156
+ *
157
+ * Nullable in live data for rows not scoped to a specific state (e.g. Provider-category rows). Guarded in
158
+ * {@linkcode parseRawBDCFile} — a null value parses to an empty `stateCode` string.
159
+ */
160
+ state_fips: string | null;
161
+ /**
162
+ * State or territory name.
163
+ *
164
+ * Loosely typed as `string` — the Nexus original was `StateName` (via `@isp.nexus/tiger`). Same task-2c deferral as
165
+ * `state_fips` above.
166
+ */
167
+ state_name: string;
168
+ /**
169
+ * Nullable in live data for rows not scoped to a specific provider (e.g. State/Summary-category rows). Guarded in
170
+ * {@linkcode parseRawBDCFile} — a null value parses to a `providerID` of `0`.
171
+ */
172
+ provider_id: string | null;
173
+ /**
174
+ * Nullable in live data — travels with `provider_id` (see above). Guarded in {@linkcode parseRawBDCFile} — a null
175
+ * value parses to an empty `providerName` string.
176
+ */
177
+ provider_name: string | null;
178
+ file_type: string;
179
+ file_name: string;
180
+ record_count: string;
181
+ }
182
+ /**
183
+ * A parsed FCC BDC file-listing entry.
184
+ *
185
+ * @category BDC
186
+ * @category FCC
187
+ */
188
+ export interface BDCFile {
189
+ /**
190
+ * Unique identifier for the file, defined by the FCC.
191
+ */
192
+ fileID: number;
193
+ revision: Date;
194
+ vintage: Date;
195
+ /**
196
+ * The date the file was was downloaded, parsed, and stored in the database.
197
+ */
198
+ synchronizedAt?: Date;
199
+ /**
200
+ * The category of the file.
201
+ */
202
+ category: BDCFileCategory;
203
+ /**
204
+ * The subcategory of the file.
205
+ */
206
+ subcategory: BDCSubCategory;
207
+ /**
208
+ * The technology codes in the file. Empty when the raw `technology_code` was `null`.
209
+ */
210
+ technologyCodes: Set<BroadbandTechnologyCode>;
211
+ /**
212
+ * The state or territory FIPS code.
213
+ *
214
+ * Loosely typed as `string` — see {@linkcode RawBDCFile} for the task-2c deferral. Empty string when the raw
215
+ * `state_fips` was `null`.
216
+ */
217
+ stateCode: string;
218
+ /**
219
+ * The provider ID associated with the file. `0` when the raw `provider_id` was `null` (no specific provider — see
220
+ * {@linkcode RawBDCFile}).
221
+ */
222
+ providerID: ProviderID;
223
+ /**
224
+ * The provider name associated with the file. Empty string when the raw `provider_name` was `null`.
225
+ */
226
+ providerName: string;
227
+ /**
228
+ * The number of records in the file.
229
+ */
230
+ recordCount: number;
231
+ /**
232
+ * The type of file, e.g. what format the file is in.
233
+ */
234
+ fileType: string;
235
+ /**
236
+ * The name of the file, as provided by the FCC.
237
+ */
238
+ fileName: string;
239
+ }
240
+ declare const MonthAbbreviation: {
241
+ readonly jan: 0;
242
+ readonly feb: 1;
243
+ readonly mar: 2;
244
+ readonly apr: 3;
245
+ readonly may: 4;
246
+ readonly jun: 5;
247
+ readonly jul: 6;
248
+ readonly aug: 7;
249
+ readonly sep: 8;
250
+ readonly oct: 9;
251
+ readonly nov: 10;
252
+ readonly dec: 11;
253
+ };
254
+ export type MonthAbbreviation = keyof typeof MonthAbbreviation;
255
+ /**
256
+ * Given a BDC file, parse the components of the file name.
257
+ */
258
+ export declare function parseBDCFileTimestamps(fileName: string): {
259
+ revision: Date;
260
+ vintage: Date;
261
+ };
262
+ /**
263
+ * Parses a raw BDC file-listing entry into a {@linkcode BDCFile}.
264
+ */
265
+ export declare function parseRawBDCFile(raw: RawBDCFile): BDCFile;
266
+ /**
267
+ * Comparator for sorting {@linkcode BDCFile} records ascending by revision date.
268
+ */
269
+ export declare function compareRevisionAsc(a: BDCFile, b: BDCFile): number;
270
+ /**
271
+ * Comparator for sorting {@linkcode BDCFile} records ascending by provider ID.
272
+ */
273
+ export declare function compareProviderIDAsc(a: BDCFile, b: BDCFile): number;
274
+ /**
275
+ * Comparator for sorting {@linkcode BDCFile} records ascending by state FIPS code.
276
+ */
277
+ export declare function compareStateCodeAsc(a: BDCFile, b: BDCFile): number;
278
+ export {};
279
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../sdk/common.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAEhE;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;AAErD;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;IAC7B;;OAEG;;IAEH;;OAEG;;CAEM,CAAA;AAEV;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAA;AAE1F;;;GAGG;AACH,eAAO,MAAM,cAAc;;;CAGjB,CAAA;AAEV;;;GAGG;A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C,EAAE,OAAO,GAAG,MAAM,CAEjE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,MAAM,CAEnE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,MAAM,CAElE"}
@@ -0,0 +1,162 @@
1
+ /**
2
+ * @copyright Sister Software.
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ * @file BDC file metadata model — dictionaries for the FCC's `bdc_file` listing rows, the
6
+ * raw-to-parsed record shape, and file-ordering comparators.
7
+ */
8
+ /**
9
+ * The data type of the file, e.g. what kind of data is in the file.
10
+ *
11
+ * @category BDC
12
+ * @category FCC
13
+ */
14
+ export const BDCFilingDataType = {
15
+ /**
16
+ * The file contains data about the availability of broadband with a specific provider.
17
+ */
18
+ Availability: "availability",
19
+ /**
20
+ * The file contains data about the challenge process.
21
+ */
22
+ Challenge: "challenge",
23
+ };
24
+ /**
25
+ * @category BDC
26
+ * @category FCC
27
+ */
28
+ export const BDCGISFileType = {
29
+ ShapeFile: 1,
30
+ GeoPackage: 2,
31
+ };
32
+ /**
33
+ * The type of file, e.g. what format the file is in.
34
+ *
35
+ * @category BDC
36
+ * @category FCC
37
+ */
38
+ export const BDCFileFormat = {
39
+ CSV: "csv",
40
+ GIS: "gis",
41
+ };
42
+ /**
43
+ * @category BDC
44
+ * @category FCC
45
+ */
46
+ export const BDCFileCategory = {
47
+ Provider: "Provider",
48
+ Summary: "Summary",
49
+ State: "State",
50
+ };
51
+ /**
52
+ * @category BDC
53
+ * @category FCC
54
+ */
55
+ export const BDCProviderSubCategory = {
56
+ FixedBroadband: "Fixed Broadband",
57
+ MobileBroadband: "Mobile Broadband",
58
+ MobileVoice: "Mobile Voice",
59
+ SupportingData: "Supporting Data",
60
+ };
61
+ /**
62
+ * @category BDC
63
+ * @category FCC
64
+ */
65
+ export const BDCSummarySubCategory = {
66
+ BroadbandSummaryByGeography: "Broadband Summary by Geography Type",
67
+ ProviderSummaryByGeography: "Provider Summary by Geography Type",
68
+ ProviderSummaryFixedBroadband: "Provider Summary - Fixed Broadband",
69
+ ProviderSummaryMobileBroadband: "Provider Summary - Mobile Broadband",
70
+ };
71
+ /**
72
+ * @category BDC
73
+ * @category FCC
74
+ */
75
+ export const BDCStateSubCategory = {
76
+ FixedBroadband: "Fixed Broadband",
77
+ MobileBroadband: "Mobile Broadband",
78
+ MobileVoice: "Mobile Voice",
79
+ };
80
+ const BDCFileNamePattern = /([A-Z])(\d+)_(\d{2})([a-z]{3})(\d{4})$/;
81
+ const MonthAbbreviation = {
82
+ jan: 0,
83
+ feb: 1,
84
+ mar: 2,
85
+ apr: 3,
86
+ may: 4,
87
+ jun: 5,
88
+ jul: 6,
89
+ aug: 7,
90
+ sep: 8,
91
+ oct: 9,
92
+ nov: 10,
93
+ dec: 11,
94
+ };
95
+ const VintageMonthLetter = {
96
+ /**
97
+ * December
98
+ */
99
+ D: 11,
100
+ /**
101
+ * June
102
+ */
103
+ J: 5,
104
+ };
105
+ /**
106
+ * Given a BDC file, parse the components of the file name.
107
+ */
108
+ export function parseBDCFileTimestamps(fileName) {
109
+ const match = fileName.match(BDCFileNamePattern);
110
+ if (!match)
111
+ throw new Error(`Invalid BDC file name: ${fileName}`);
112
+ const [, vintageMonthLetter, vintageYearAbbreviation, revisionDay, revisionMonthAbbreviation, revisionYear] = match;
113
+ const revisionMonth = MonthAbbreviation[revisionMonthAbbreviation];
114
+ const revision = new Date(Number.parseInt(revisionYear, 10), revisionMonth, Number.parseInt(revisionDay, 10));
115
+ const vintageMonth = VintageMonthLetter[vintageMonthLetter];
116
+ const vintageYear = Number.parseInt(`20${vintageYearAbbreviation}`, 10);
117
+ const vintage = new Date(vintageYear, vintageMonth);
118
+ return {
119
+ revision,
120
+ vintage,
121
+ };
122
+ }
123
+ /**
124
+ * Parses a raw BDC file-listing entry into a {@linkcode BDCFile}.
125
+ */
126
+ export function parseRawBDCFile(raw) {
127
+ const parsedBDC = {
128
+ ...parseBDCFileTimestamps(raw.file_name),
129
+ fileName: raw.file_name,
130
+ fileType: raw.file_type,
131
+ fileID: raw.file_id,
132
+ recordCount: Number.parseInt(raw.record_count, 10),
133
+ category: raw.category,
134
+ subcategory: raw.subcategory,
135
+ technologyCodes: new Set(raw.technology_code === null
136
+ ? []
137
+ : raw.technology_code.split(",").map((code) => Number.parseInt(code, 10))),
138
+ stateCode: raw.state_fips ?? "",
139
+ providerID: (raw.provider_id === null ? 0 : Number.parseInt(raw.provider_id, 10)),
140
+ providerName: raw.provider_name ?? "",
141
+ };
142
+ return parsedBDC;
143
+ }
144
+ /**
145
+ * Comparator for sorting {@linkcode BDCFile} records ascending by revision date.
146
+ */
147
+ export function compareRevisionAsc(a, b) {
148
+ return a.revision.getTime() - b.revision.getTime();
149
+ }
150
+ /**
151
+ * Comparator for sorting {@linkcode BDCFile} records ascending by provider ID.
152
+ */
153
+ export function compareProviderIDAsc(a, b) {
154
+ return a.providerID - b.providerID;
155
+ }
156
+ /**
157
+ * Comparator for sorting {@linkcode BDCFile} records ascending by state FIPS code.
158
+ */
159
+ export function compareStateCodeAsc(a, b) {
160
+ return Number.parseInt(a.stateCode, 10) - Number.parseInt(b.stateCode, 10);
161
+ }
162
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../sdk/common.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAiBH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC;;OAEG;IACH,YAAY,EAAE,cAAc;IAC5B;;OAEG;IACH,SAAS,EAAE,WAAW;CACb,CAAA;AAQV;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B,SAAS,EAAE,CAAC;IACZ,UAAU,EAAE,CAAC;CACJ,CAAA;AAQV;;;;;GAKG;AACH,MAAM,CAAC,MA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,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAA4B,CAAC,CACrG;QACD,SAAS,EAAE,GAAG,CAAC,UAAU,IAAI,EAAE;QAC/B,UAAU,EAAE,CAAC,GAAG,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAe;QAC/F,YAAY,EAAE,GAAG,CAAC,aAAa,IAAI,EAAE;KACrC,CAAA;IAED,OAAO,SAAS,CAAA;AACjB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,CAAU,EAAE,CAAU;IACxD,OAAO,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAA;AACnD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,CAAU,EAAE,CAAU;IAC1D,OAAO,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU,CAAA;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,CAAU,EAAE,CAAU;IACzD,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;AAC3E,CAAC"}
@@ -0,0 +1,244 @@
1
+ /**
2
+ * @copyright Sister Software.
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ * @file FCC Broadband Data Collection System
6
+ */
7
+ import type { BuildingTypeCode } from "./buildings.ts";
8
+ import type { BroadbandServicableLocationID } from "./location.ts";
9
+ /**
10
+ * Snake_case identifier for a US State or Territory.
11
+ *
12
+ * Loosely typed as `string` for now. The Nexus original derived this from `StateName` (via `@isp.nexus/tiger`); this
13
+ * port drops that dependency since 2a doesn't consume the literal union anywhere. Task 2c tightens this against
14
+ * `@mailwoman/tiger`'s `StateName` if a downstream dictionary needs it.
15
+ *
16
+ * @category FCC
17
+ * @title FCC State Identifier
18
+ */
19
+ export type FCCStateID = string;
20
+ /**
21
+ * Code indicating confidence in the association between the textual address and the location.
22
+ *
23
+ * @category NTIA
24
+ * @category FCC
25
+ */
26
+ export declare const AddressConfidenceCode: {
27
+ readonly High: "1";
28
+ readonly Medium: "2";
29
+ readonly Low: "3";
30
+ readonly SuccessfulChallenge: "4";
31
+ };
32
+ /**
33
+ * @category NTIA
34
+ * @category FCC
35
+ */
36
+ export type AddressConfidenceCode = (typeof AddressConfidenceCode)[keyof typeof AddressConfidenceCode];
37
+ /**
38
+ * A modeled land use designation estimated from assembled county assessor information.
39
+ *
40
+ * @category NTIA
41
+ * @category FCC
42
+ */
43
+ export declare const LandUseCode: {
44
+ readonly Residential: 1;
45
+ readonly Land: 2;
46
+ readonly Business: 3;
47
+ readonly Unknown: 4;
48
+ readonly Agriculture: 5;
49
+ readonly Community: 6;
50
+ readonly Industrial: 7;
51
+ readonly Recreation: 8;
52
+ readonly Utility: 9;
53
+ readonly MixedUse: 10;
54
+ readonly Transportation: 11;
55
+ readonly Water: 12;
56
+ readonly Communications: 13;
57
+ readonly Row: 14;
58
+ readonly Wireless: 15;
59
+ readonly Other: 0;
60
+ };
61
+ /**
62
+ * @category NTIA
63
+ * @category FCC
64
+ */
65
+ export type LandUseCode = (typeof LandUseCode)[keyof typeof LandUseCode];
66
+ /**
67
+ * Flag indicating if the location is a broadband serviceable location.
68
+ */
69
+ export declare const BSLFlag: {
70
+ readonly Serviceable: 1;
71
+ readonly NotServiceable: 0;
72
+ };
73
+ export type BSLFlag = (typeof BSLFlag)[keyof typeof BSLFlag];
74
+ /**
75
+ * Interface representing a record from the NTIA data dictionary.
76
+ *
77
+ * @category NTIA
78
+ * @title NTIA Record
79
+ */
80
+ export interface NTIARecord {
81
+ /**
82
+ * Unique ID for the Fabric location. Remains persistent across versions, even if the location's position or building
83
+ * changes.
84
+ *
85
+ * @title Location ID
86
+ * @pattern ^\d{10}$
87
+ */
88
+ location_id: BroadbandServicableLocationID;
89
+ /**
90
+ * Primary postal address excluding city, state, and ZIP code.
91
+ *
92
+ * @example
93
+ * 123 Main St
94
+ *
95
+ * @title Primary Address
96
+ */
97
+ address_primary: string;
98
+ /**
99
+ * City name from the postal address. Also known as the locality.
100
+ *
101
+ * @example
102
+ * San Francisco
103
+ *
104
+ * @title City
105
+ */
106
+ city: string;
107
+ /**
108
+ * 2-character state abbreviation from the postal address.
109
+ *
110
+ * Loosely typed as `string` — see {@linkcode FCCStateID} for why the tiger-backed literal union is deferred to task
111
+ * 2c.
112
+ *
113
+ * @example
114
+ * CA
115
+ *
116
+ * @title State Abbreviation
117
+ */
118
+ state: string;
119
+ /**
120
+ * 5-digit ZIP code associated with the address.
121
+ *
122
+ * @example
123
+ * 94103
124
+ *
125
+ * @title ZIP Code
126
+ */
127
+ zip: string;
128
+ /**
129
+ * USPS ZIP+4 extension.
130
+ *
131
+ * @example
132
+ * e.g. 94103-1234
133
+ *
134
+ * @title ZIP+4
135
+ */
136
+ zip_suffix?: string;
137
+ /**
138
+ * Estimate of the number of units at the location. Includes both residential and non-residential units.
139
+ *
140
+ * @example
141
+ * 10
142
+ *
143
+ * @title Unit Count
144
+ */
145
+ unit_count: number;
146
+ /**
147
+ * Flag indicating if the location is a broadband serviceable location. 1 for serviceable, 0 for not.
148
+ *
149
+ * @example
150
+ * 1
151
+ *
152
+ * @title BSL Flag
153
+ */
154
+ bsl_flag: BSLFlag;
155
+ /**
156
+ * Code indicating the type of building at the location. Can be residential (R), non-residential (B), mixed (X), group
157
+ * quarters (G), CAI (C), enterprise (E), or other (O).
158
+ *
159
+ * @example
160
+ * R
161
+ *
162
+ * @title Building Type Code
163
+ */
164
+ building_type_code: BuildingTypeCode;
165
+ /**
166
+ * Modeled land use designation from county assessor information. Possible values range from 0 (Other) to 15
167
+ * (Wireless).
168
+ *
169
+ * @example
170
+ * 1
171
+ *
172
+ * @title Land Use Code
173
+ */
174
+ land_use_code: LandUseCode | null;
175
+ /**
176
+ * Code indicating confidence in the association between the textual address and the location. 1 = High, 2 = Medium, 3
177
+ * = Low, 4 = successful address challenge.
178
+ *
179
+ * @example
180
+ * 1
181
+ *
182
+ * @title Address Confidence Code
183
+ */
184
+ address_confidence_code: AddressConfidenceCode;
185
+ /**
186
+ * 5-digit TIGER 2020 identifier for the county based on the latitude and longitude.
187
+ *
188
+ * @example
189
+ * 06075
190
+ *
191
+ * @title County GEOID
192
+ */
193
+ county_geoid: string;
194
+ /**
195
+ * 15-digit 2020 U.S. Census Bureau FIPS code for the census block, based on the latitude and longitude.
196
+ *
197
+ * @example
198
+ * 060750001000123
199
+ *
200
+ * @title Block GEOID
201
+ */
202
+ block_geoid: string;
203
+ /**
204
+ * H3 hex cell ID, level 9, for geospatial referencing.
205
+ *
206
+ * @example
207
+ * 8928308280fffff
208
+ *
209
+ * @title H3 Cell ID (9)
210
+ */
211
+ h3_9: string;
212
+ /**
213
+ * Latitude coordinate of the location in decimal degrees. Uses WGS84 format with 5-digit precision.
214
+ *
215
+ * @example
216
+ * 37.774929
217
+ *
218
+ * @minimum -90
219
+ * @maximum 90
220
+ * @title Latitude
221
+ */
222
+ latitude: number;
223
+ /**
224
+ * Longitude coordinate of the location in decimal degrees. Uses WGS84 format with 5-digit precision.
225
+ *
226
+ * @example
227
+ * e.g. -122.419416
228
+ *
229
+ * @minimum -180
230
+ * @maximum 180
231
+ * @title Longitude
232
+ */
233
+ longitude: number;
234
+ /**
235
+ * FCC Fabric Release Date, present only for tier 2, 3, and 4 licensees.
236
+ *
237
+ * @example
238
+ * 07212023
239
+ *
240
+ * @title FCC Fabric Release Date
241
+ */
242
+ fcc_rel?: string;
243
+ }
244
+ //# sourceMappingURL=data-collection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-collection.d.ts","sourceRoot":"","sources":["../../sdk/data-collection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAA;AAElE;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAA;AAE/B;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB;;;;;CAKxB,CAAA;AAEV;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAA;AAEtG;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;CAiBd,CAAA;AAEV;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAA;AAExE;;GAEG;AACH,eAAO,MAAM,OAAO;;;CAGV,CAAA;AAEV,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAA;AAE5D;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IAC1B;;;;;;OAMG;IACH,WAAW,EAAE,6BAA6B,CAAA;IAE1C;;;;;;;OAOG;IACH,eAAe,EAAE,MAAM,CAAA;IAEvB;;;;;;;OAOG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;;;;;;;;;OAUG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;;;;;;OAOG;IACH,GAAG,EAAE,MAAM,CAAA;IAEX;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;;;;;;OAOG;IACH,UAAU,EAAE,MAAM,CAAA;IAElB;;;;;;;OAOG;IACH,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