@usa-open-data-connectors/usa-sources 0.1.8 → 0.1.9

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 (113) hide show
  1. package/README.md +225 -31
  2. package/dist/btsTransportationStats.d.ts +4 -0
  3. package/dist/btsTransportationStats.d.ts.map +1 -1
  4. package/dist/btsTransportationStats.js +3 -0
  5. package/dist/btsTransportationStats.js.map +1 -1
  6. package/dist/californiaOpenDataCatalogue.d.ts +84 -0
  7. package/dist/californiaOpenDataCatalogue.d.ts.map +1 -0
  8. package/dist/californiaOpenDataCatalogue.js +153 -0
  9. package/dist/californiaOpenDataCatalogue.js.map +1 -0
  10. package/dist/cdcSocrataCatalogue.d.ts +4 -0
  11. package/dist/cdcSocrataCatalogue.d.ts.map +1 -1
  12. package/dist/cdcSocrataCatalogue.js +3 -0
  13. package/dist/cdcSocrataCatalogue.js.map +1 -1
  14. package/dist/chicagoOpenDataCatalogue.d.ts +91 -0
  15. package/dist/chicagoOpenDataCatalogue.d.ts.map +1 -0
  16. package/dist/chicagoOpenDataCatalogue.js +133 -0
  17. package/dist/chicagoOpenDataCatalogue.js.map +1 -0
  18. package/dist/coloradoOpenDataCatalogue.d.ts +42 -0
  19. package/dist/coloradoOpenDataCatalogue.d.ts.map +1 -0
  20. package/dist/coloradoOpenDataCatalogue.js +45 -0
  21. package/dist/coloradoOpenDataCatalogue.js.map +1 -0
  22. package/dist/fccSocrataCatalogue.d.ts +91 -0
  23. package/dist/fccSocrataCatalogue.d.ts.map +1 -0
  24. package/dist/fccSocrataCatalogue.js +133 -0
  25. package/dist/fccSocrataCatalogue.js.map +1 -0
  26. package/dist/federalRegisterDocuments.d.ts +78 -0
  27. package/dist/federalRegisterDocuments.d.ts.map +1 -0
  28. package/dist/federalRegisterDocuments.js +119 -0
  29. package/dist/federalRegisterDocuments.js.map +1 -0
  30. package/dist/healthdataSocrataCatalogue.d.ts +4 -0
  31. package/dist/healthdataSocrataCatalogue.d.ts.map +1 -1
  32. package/dist/healthdataSocrataCatalogue.js +3 -0
  33. package/dist/healthdataSocrataCatalogue.js.map +1 -1
  34. package/dist/http.d.ts +14 -0
  35. package/dist/http.d.ts.map +1 -1
  36. package/dist/http.js +29 -1
  37. package/dist/http.js.map +1 -1
  38. package/dist/illinoisOpenDataCatalogue.d.ts +42 -0
  39. package/dist/illinoisOpenDataCatalogue.d.ts.map +1 -0
  40. package/dist/illinoisOpenDataCatalogue.js +45 -0
  41. package/dist/illinoisOpenDataCatalogue.js.map +1 -0
  42. package/dist/index.d.ts +76 -0
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +38 -0
  45. package/dist/index.js.map +1 -1
  46. package/dist/losAngelesOpenDataCatalogue.d.ts +42 -0
  47. package/dist/losAngelesOpenDataCatalogue.d.ts.map +1 -0
  48. package/dist/losAngelesOpenDataCatalogue.js +48 -0
  49. package/dist/losAngelesOpenDataCatalogue.js.map +1 -0
  50. package/dist/michiganOpenDataCatalogue.d.ts +42 -0
  51. package/dist/michiganOpenDataCatalogue.d.ts.map +1 -0
  52. package/dist/michiganOpenDataCatalogue.js +45 -0
  53. package/dist/michiganOpenDataCatalogue.js.map +1 -0
  54. package/dist/newJerseyOpenDataCatalogue.d.ts +42 -0
  55. package/dist/newJerseyOpenDataCatalogue.d.ts.map +1 -0
  56. package/dist/newJerseyOpenDataCatalogue.js +48 -0
  57. package/dist/newJerseyOpenDataCatalogue.js.map +1 -0
  58. package/dist/nhtsaVehicleModels.d.ts +74 -0
  59. package/dist/nhtsaVehicleModels.d.ts.map +1 -0
  60. package/dist/nhtsaVehicleModels.js +139 -0
  61. package/dist/nhtsaVehicleModels.js.map +1 -0
  62. package/dist/nihReporterProjects.d.ts +98 -0
  63. package/dist/nihReporterProjects.d.ts.map +1 -0
  64. package/dist/nihReporterProjects.js +188 -0
  65. package/dist/nihReporterProjects.js.map +1 -0
  66. package/dist/nyStateOpenDataCatalogue.d.ts +91 -0
  67. package/dist/nyStateOpenDataCatalogue.d.ts.map +1 -0
  68. package/dist/nyStateOpenDataCatalogue.js +133 -0
  69. package/dist/nyStateOpenDataCatalogue.js.map +1 -0
  70. package/dist/nycOpenDataCatalogue.d.ts +4 -0
  71. package/dist/nycOpenDataCatalogue.d.ts.map +1 -1
  72. package/dist/nycOpenDataCatalogue.js +3 -0
  73. package/dist/nycOpenDataCatalogue.js.map +1 -1
  74. package/dist/oregonOpenDataCatalogue.d.ts +42 -0
  75. package/dist/oregonOpenDataCatalogue.d.ts.map +1 -0
  76. package/dist/oregonOpenDataCatalogue.js +45 -0
  77. package/dist/oregonOpenDataCatalogue.js.map +1 -0
  78. package/dist/pennsylvaniaOpenDataCatalogue.d.ts +42 -0
  79. package/dist/pennsylvaniaOpenDataCatalogue.d.ts.map +1 -0
  80. package/dist/pennsylvaniaOpenDataCatalogue.js +48 -0
  81. package/dist/pennsylvaniaOpenDataCatalogue.js.map +1 -0
  82. package/dist/registry.d.ts.map +1 -1
  83. package/dist/registry.js +38 -0
  84. package/dist/registry.js.map +1 -1
  85. package/dist/sanFranciscoOpenDataCatalogue.d.ts +42 -0
  86. package/dist/sanFranciscoOpenDataCatalogue.d.ts.map +1 -0
  87. package/dist/sanFranciscoOpenDataCatalogue.js +48 -0
  88. package/dist/sanFranciscoOpenDataCatalogue.js.map +1 -0
  89. package/dist/seattleOpenDataCatalogue.d.ts +91 -0
  90. package/dist/seattleOpenDataCatalogue.d.ts.map +1 -0
  91. package/dist/seattleOpenDataCatalogue.js +133 -0
  92. package/dist/seattleOpenDataCatalogue.js.map +1 -0
  93. package/dist/socrataCatalogue.d.ts +121 -0
  94. package/dist/socrataCatalogue.d.ts.map +1 -0
  95. package/dist/socrataCatalogue.js +151 -0
  96. package/dist/socrataCatalogue.js.map +1 -0
  97. package/dist/socrataCatalogueMetadata.d.ts +19 -0
  98. package/dist/socrataCatalogueMetadata.d.ts.map +1 -0
  99. package/dist/socrataCatalogueMetadata.js +40 -0
  100. package/dist/socrataCatalogueMetadata.js.map +1 -0
  101. package/dist/texasOpenDataCatalogue.d.ts +91 -0
  102. package/dist/texasOpenDataCatalogue.d.ts.map +1 -0
  103. package/dist/texasOpenDataCatalogue.js +133 -0
  104. package/dist/texasOpenDataCatalogue.js.map +1 -0
  105. package/dist/vermontOpenDataCatalogue.d.ts +42 -0
  106. package/dist/vermontOpenDataCatalogue.d.ts.map +1 -0
  107. package/dist/vermontOpenDataCatalogue.js +45 -0
  108. package/dist/vermontOpenDataCatalogue.js.map +1 -0
  109. package/dist/washingtonStateOpenDataCatalogue.d.ts +42 -0
  110. package/dist/washingtonStateOpenDataCatalogue.d.ts.map +1 -0
  111. package/dist/washingtonStateOpenDataCatalogue.js +48 -0
  112. package/dist/washingtonStateOpenDataCatalogue.js.map +1 -0
  113. package/package.json +1 -1
package/README.md CHANGED
@@ -4,7 +4,7 @@ Uniform TypeScript adapters for US public data sources, with live probes and off
4
4
 
5
5
  ## What this package does
6
6
 
7
- - Exposes 28 source adapters behind one interface.
7
+ - Exposes source adapters behind one interface.
8
8
  - Fetches live data from each source and parses it into plain objects.
9
9
  - Loads committed fixtures in tests only; a live fetch never falls back.
10
10
  - Publishes the `US_DATA_SOURCES` registry for the API and the CLI.
@@ -48,15 +48,34 @@ console.log(probes.map((probe) => `${probe.id}: ${probe.ok ? 'ok' : probe.status
48
48
  | `usaspending-agencies` | USAspending | Top-tier federal agencies, with budget authority, obligations, and outlays for the active quarter. |
49
49
  | `epa-envirofacts-facilities` | Environmental Protection Agency | Toxics Release Inventory facilities, with county, address, and open or closed status. |
50
50
  | `ncbi-pubmed-search` | National Center for Biotechnology Information | PubMed literature search results, with the match count and a page of PubMed ids. |
51
- | `cdc-socrata-catalogue` | Centers for Disease Control and Prevention | The CDC Socrata catalogue, one row per dataset, chart, or story. |
52
- | `healthdata-socrata-catalogue` | HealthData.gov | The HealthData.gov Socrata catalogue, one row per dataset, chart, or story. |
53
- | `bts-transportation-stats` | Bureau of Transportation Statistics | The BTS Socrata catalogue, one row per dataset, chart, or story. |
51
+ | `nih-reporter-projects` | National Institutes of Health | NIH-funded projects for one fiscal year, with the title, award amount, organization, principal investigators, and administering institute. |
52
+ | `cdc-socrata-catalogue` | Centers for Disease Control and Prevention | The CDC Socrata catalogue, one row per dataset, chart, or story, with the portal's licence and attribution values when present. |
53
+ | `healthdata-socrata-catalogue` | HealthData.gov | The HealthData.gov Socrata catalogue, one row per dataset, chart, or story, with the portal's licence and attribution values. |
54
+ | `bts-transportation-stats` | Bureau of Transportation Statistics | The BTS Socrata catalogue, one row per dataset, chart, or story, with the portal's licence and attribution values. |
54
55
  | `estimatetax-income-tax` | EstimateTax | US federal, state, and local income tax for one salary, with the official document behind every figure. |
55
- | `nyc-open-data-catalogue` | New York City Open Data | The NYC Socrata catalogue, one row per published dataset or map. |
56
+ | `nyc-open-data-catalogue` | New York City Open Data | The NYC Socrata catalogue, one row per published dataset or map, with licence and attribution fields that are empty when the portal supplies none. |
56
57
  | `callook-callsigns` | Callook.info | US amateur radio callsign records from the FCC licence file, with the licence class, location, and expiry. |
57
58
  | `college-scorecard-institutions` | College Scorecard, US Department of Education | Institution-level enrollment, cost, completion, debt, and earnings ten years after entry for US colleges. |
58
59
  | `publicdatahub-hospital-quality` | PublicDataHub, from the Centers for Medicare & Medicaid Services | Medicare-certified hospital quality measures, with national ranks and provenance. |
59
60
  | `nextbus-transit-vehicles` | Portland Streetcar, through the NextBus XML feed | Live positions, headings, speeds, and report ages for the streetcars on the NS line. |
61
+ | `federal-register-documents` | Office of the Federal Register | Documents published in the Federal Register, with type, publication date, agencies, abstract, and public HTML and PDF links. |
62
+ | `nhtsa-vehicle-models` | National Highway Traffic Safety Administration | Vehicle models for one model year and make, with the service total and next-page URL. |
63
+ | `fcc-socrata-catalogue` | Federal Communications Commission | The FCC Open Data Socrata catalogue, one row per dataset, chart, or story, with category, view count, and download count. |
64
+ | `ny-state-open-data-catalogue` | New York State Open Data | The New York State Socrata catalogue, one row per dataset or file, with state topic, view count, and download count. |
65
+ | `chicago-open-data-catalogue` | City of Chicago | The Chicago Data Portal Socrata catalogue, one row per dataset, chart, map, or story, with city topic, view count, and download count. |
66
+ | `seattle-open-data-catalogue` | City of Seattle | The Seattle Open Data Socrata catalogue, one row per dataset, map, chart, or story, with city topic, view count, and download count. |
67
+ | `texas-open-data-catalogue` | State of Texas | The Texas Open Data Socrata catalogue, one row per dataset, map, chart, or linked resource, with state topic, view count, and download count. |
68
+ | `colorado-open-data-catalogue` | State of Colorado | The Colorado Open Data Socrata catalogue, one row per dataset, map, chart, or linked resource, with state topic, view count, and download count. |
69
+ | `washington-state-open-data-catalogue` | State of Washington | The Washington State Open Data Socrata catalogue, one row per dataset, chart, story, or other resource, with state topic, view count, and download count. |
70
+ | `michigan-open-data-catalogue` | State of Michigan | The Michigan Open Data Socrata catalogue, one row per dataset, map, chart, story, or other resource, with state topic, view count, and download count. |
71
+ | `oregon-open-data-catalogue` | State of Oregon | The Oregon Open Data Socrata catalogue, one row per dataset, file, or filtered view, with state topic, view count, and download count. |
72
+ | `pennsylvania-open-data-catalogue` | Commonwealth of Pennsylvania | The Pennsylvania Open Data Socrata catalogue, one row per dataset, chart, or linked resource, with state topic, view count, and download count. |
73
+ | `illinois-open-data-catalogue` | State of Illinois | The Illinois Open Data Socrata catalogue, one row per dataset, chart, story, or filtered view, with state topic, view count, and download count. |
74
+ | `new-jersey-open-data-catalogue` | State of New Jersey | The New Jersey Open Data Socrata catalogue, one row per dataset, file, story, or other resource, with state topic, view count, and download count. |
75
+ | `vermont-open-data-catalogue` | State of Vermont | The Vermont Open Data Socrata catalogue, one row per dataset or filtered view, with state topic, view count, and download count. |
76
+ | `los-angeles-open-data-catalogue` | City of Los Angeles | The Los Angeles Open Data Socrata catalogue, one row per dataset, map, or filtered view, with city topic, view count, and download count. |
77
+ | `san-francisco-open-data-catalogue` | City and County of San Francisco | The San Francisco Open Data Socrata catalogue, one row per dataset, map, or filtered view, with city topic, view count, and download count. |
78
+ | `california-open-data-catalogue` | State of California | The California Open Data CKAN catalogue, one row per dataset package, with title, groups, resources, licence, and publishing organisation. |
60
79
 
61
80
  The HTTP API and the CLI read this package's registry. A new adapter is exposed on
62
81
  `/api/sources`, `/api/sources/{id}/probe`, and `/api/sources/{id}/data` as soon as it is registered.
@@ -277,9 +296,11 @@ The public API is `CDC_SOCRATA_CATALOGUE_API_BASE`,
277
296
  `CdcSocrataCategoryCount`, and `CdcSocrataCatalogue` types. The parser
278
297
  validates a bare JSON array against a zod schema over `id`, `name`,
279
298
  `assetType`, `category`, `viewType`, `createdAt`, `viewLastModified`,
280
- `viewCount`, and `downloadCount`. A row missing `id`, `name`, or `createdAt`
281
- throws `UsSourceParseError`. A response with no rows also throws, because an
282
- empty catalogue is not a usable answer.
299
+ `viewCount`, `downloadCount`, and `metadata`. Every entry carries `licenceUrl`
300
+ and `attribution`, copied from the entry's `License` and `Publisher` metadata
301
+ and empty when the portal supplies none. A row missing `id`, `name`, or
302
+ `createdAt` throws `UsSourceParseError`. A response with no rows also throws,
303
+ because an empty catalogue is not a usable answer.
283
304
 
284
305
  `bts-transportation-stats`:
285
306
 
@@ -305,9 +326,11 @@ The public API is `BTS_TRANSPORTATION_STATS_API_BASE`,
305
326
  `BtsCatalogueCategoryCount`, and `BtsTransportationCatalogue` types. The parser
306
327
  validates a bare JSON array against a zod schema over `id`, `name`,
307
328
  `assetType`, `category`, `viewType`, `createdAt`, `viewLastModified`,
308
- `viewCount`, and `downloadCount`. A row missing `id`, `name`, or `createdAt`
309
- throws `UsSourceParseError`. A response with no rows also throws, because an
310
- empty catalogue is not a usable answer.
329
+ `viewCount`, `downloadCount`, and `metadata`. Every entry carries `licenceUrl`
330
+ and `attribution`, copied from the entry's `License` and `Publisher` metadata
331
+ and empty when the portal supplies none. A row missing `id`, `name`, or
332
+ `createdAt` throws `UsSourceParseError`. A response with no rows also throws,
333
+ because an empty catalogue is not a usable answer.
311
334
 
312
335
  `nextbus-transit-vehicles`:
313
336
 
@@ -420,6 +443,27 @@ schema over `header` and `esearchresult`, where `esearchresult` can carry
420
443
  An `esearchresult.error` is thrown as `UsSourceApiError` even though the HTTP
421
444
  status is 200.
422
445
 
446
+ `nih-reporter-projects`:
447
+
448
+ ```ts
449
+ import { fetchNihReporterProjects } from '@usa-open-data-connectors/usa-sources';
450
+
451
+ const page = await fetchNihReporterProjects({ fiscalYear: 2025, limit: 10 });
452
+ console.log(page.totalCount, page.pageAwardAmountUsd, page.projects[0]);
453
+ ```
454
+
455
+ The public API is `NIH_REPORTER_SEARCH_URL`, `NIH_REPORTER_SOURCE_ID`,
456
+ `NIH_REPORTER_DEFAULT_FISCAL_YEAR`, `NIH_REPORTER_PAGE_SIZE`,
457
+ `buildNihReporterSearchBody`, `parseNihReporterProjectsPayload`,
458
+ `fetchNihReporterProjects`, and `nihReporterProjectsAdapter`, with the
459
+ `NihReporterProject`, `NihReporterProjectPage`, `NihReporterProjectQuery`, and
460
+ `NihReporterSearchBody` types. The parser validates `meta` and `results`, keeps
461
+ the project number, core project number, title, fiscal year, award amount,
462
+ organization, city and state, investigators, administering institute, start and
463
+ end dates, and detail URL, and adds the agency total and the award sum for the
464
+ page. A top-level `message` throws `UsSourceApiError` even when the HTTP status
465
+ is 200. The default search is fiscal 2025, ten rows, largest award first.
466
+
423
467
  `clinicaltrials-studies`:
424
468
 
425
469
  ```ts
@@ -470,11 +514,11 @@ Three shape notes. A start date can be day precision (`2024-12-10`) or month
470
514
  precision (`2026-05`), and the adapter keeps the string as the registry wrote
471
515
  it. A start date can be planned rather than actual, so a recent year can still
472
516
  gain studies. `query.cond` is the registry's own condition search rather than a
473
- filter over the `conditions` array; a long COVID search returned 737 studies on
474
- 2026-10-20 while only 315 of them carried a condition string containing "long
475
- COVID", because keywords and related terms also match. The response has no
476
- total count unless the request adds `countTotal=true`, so count `studies` for
477
- the page or ask for the total separately.
517
+ filter over the `conditions` array; a long COVID search returns more studies
518
+ than the subset whose condition string contains "long COVID", because keywords
519
+ and related terms also match. The response has no total count unless the
520
+ request adds `countTotal=true`, so count `studies` for the page or ask for the
521
+ total separately.
478
522
 
479
523
  `nws-point-forecast`:
480
524
 
@@ -535,6 +579,132 @@ The adapter reads the keyless institution-level bulk download, not the keyed
535
579
  College Scorecard API. The archive is a zip that holds one wide CSV, and a live
536
580
  fetch takes about 20 seconds on a fast connection.
537
581
 
582
+ `federal-register-documents`:
583
+
584
+ ```ts
585
+ import { fetchFederalRegisterDocuments } from '@usa-open-data-connectors/usa-sources';
586
+
587
+ const page = await fetchFederalRegisterDocuments({ perPage: 10, order: 'newest' });
588
+ console.log(page.documentCount, page.reportedCount, page.documents[0]?.documentNumber);
589
+ ```
590
+
591
+ The public API is `FEDERAL_REGISTER_API_BASE`,
592
+ `FEDERAL_REGISTER_DEFAULT_PAGE_SIZE`, `FEDERAL_REGISTER_DEFAULT_ORDER`,
593
+ `FEDERAL_REGISTER_DOCUMENTS_SOURCE_ID`, `buildFederalRegisterDocumentsUrl`,
594
+ `parseFederalRegisterDocumentsPayload`, `fetchFederalRegisterDocuments`, and
595
+ `federalRegisterDocumentsAdapter`, with the `FederalRegisterDocument`,
596
+ `FederalRegisterDocumentsPage`, and `FederalRegisterDocumentsQuery` types. The
597
+ parser keeps the document number, title, type, publication date, abstract,
598
+ agency names, and HTML and PDF links. It also keeps the service's `count` and
599
+ `total_pages` as `reportedCount` and `totalPages`. A document without its
600
+ number, title, type, HTML page, or a readable `YYYY-MM-DD` publication date
601
+ throws `UsSourceParseError`.
602
+
603
+ `nhtsa-vehicle-models`:
604
+
605
+ ```ts
606
+ import { fetchNhtsaVehicleModels } from '@usa-open-data-connectors/usa-sources';
607
+
608
+ const page = await fetchNhtsaVehicleModels({ modelYear: 2025, make: 'Honda' });
609
+ console.log(page.modelCount, page.totalCount, page.models[0]?.vehicleModel);
610
+ ```
611
+
612
+ The public API is `NHTSA_VEHICLE_MODELS_API_BASE`,
613
+ `NHTSA_VEHICLE_MODELS_SOURCE_ID`, `NHTSA_DEFAULT_MODEL_YEAR`,
614
+ `NHTSA_DEFAULT_MAKE`, `NHTSA_MODEL_PAGE_SIZE`, `NHTSA_MIN_MODEL_YEAR`,
615
+ `NHTSA_MAX_MODEL_YEAR`, `buildNhtsaVehicleModelsUrl`,
616
+ `parseNhtsaVehicleModelsPayload`, `fetchNhtsaVehicleModels`, and
617
+ `nhtsaVehicleModelsAdapter`, with the `NhtsaVehicleModel`,
618
+ `NhtsaVehicleModelPage`, and `NhtsaVehicleModelsQuery` types. A blank make or a
619
+ model year outside 1900-2100 throws `UsSourceApiError` before a request leaves.
620
+ A non-200 service status in the body also throws `UsSourceApiError`.
621
+
622
+ `fcc-socrata-catalogue`:
623
+
624
+ ```ts
625
+ import { fetchFccSocrataCatalogue } from '@usa-open-data-connectors/usa-sources';
626
+
627
+ const catalogue = await fetchFccSocrataCatalogue({ limit: 10 });
628
+ console.log(catalogue.entryCount, catalogue.datasetCount, catalogue.categories[0]);
629
+ ```
630
+
631
+ The public API is `FCC_SOCRATA_CATALOGUE_API_BASE`,
632
+ `FCC_SOCRATA_CATALOGUE_LIMIT`, `FCC_SOCRATA_CATALOGUE_SOURCE_ID`,
633
+ `buildFccSocrataCatalogueUrl`, `parseFccSocrataCataloguePayload`,
634
+ `fetchFccSocrataCatalogue`, and `fccSocrataCatalogueAdapter`, with the
635
+ `FccSocrataCatalogueEntry`, `FccSocrataCategoryCount`, and
636
+ `FccSocrataCatalogue` types. The parser folds the entries into a dataset count,
637
+ the newest entry, and category counts. A missing id, name, or creation time
638
+ throws `UsSourceParseError`, and so does an empty page.
639
+
640
+ `ny-state-open-data-catalogue`:
641
+
642
+ ```ts
643
+ import { fetchNyStateOpenDataCatalogue } from '@usa-open-data-connectors/usa-sources';
644
+
645
+ const catalogue = await fetchNyStateOpenDataCatalogue({ limit: 10 });
646
+ console.log(catalogue.entryCount, catalogue.datasetCount, catalogue.categories[0]);
647
+ ```
648
+
649
+ The public API is `NY_STATE_OPEN_DATA_API_BASE`,
650
+ `NY_STATE_OPEN_DATA_CATALOGUE_LIMIT`, `NY_STATE_OPEN_DATA_CATALOGUE_SOURCE_ID`,
651
+ `buildNyStateOpenDataCatalogueUrl`, `parseNyStateOpenDataCataloguePayload`,
652
+ `fetchNyStateOpenDataCatalogue`, and `nyStateOpenDataCatalogueAdapter`, with the
653
+ `NyStateOpenDataCatalogueEntry`, `NyStateOpenDataCategoryCount`, and
654
+ `NyStateOpenDataCatalogue` types. The parser follows the same Socrata catalogue
655
+ shape as the FCC adapter.
656
+
657
+ `chicago-open-data-catalogue`:
658
+
659
+ ```ts
660
+ import { fetchChicagoOpenDataCatalogue } from '@usa-open-data-connectors/usa-sources';
661
+
662
+ const catalogue = await fetchChicagoOpenDataCatalogue({ limit: 10 });
663
+ console.log(catalogue.entryCount, catalogue.datasetCount, catalogue.categories[0]);
664
+ ```
665
+
666
+ The public API is `CHICAGO_OPEN_DATA_API_BASE`,
667
+ `CHICAGO_OPEN_DATA_CATALOGUE_LIMIT`, `CHICAGO_OPEN_DATA_CATALOGUE_SOURCE_ID`,
668
+ `buildChicagoOpenDataCatalogueUrl`, `parseChicagoOpenDataCataloguePayload`,
669
+ `fetchChicagoOpenDataCatalogue`, and `chicagoOpenDataCatalogueAdapter`, with the
670
+ `ChicagoOpenDataCatalogueEntry`, `ChicagoOpenDataCategoryCount`, and
671
+ `ChicagoOpenDataCatalogue` types. The parser folds the entries into a dataset
672
+ count, the newest entry, and category counts.
673
+
674
+ `seattle-open-data-catalogue`:
675
+
676
+ ```ts
677
+ import { fetchSeattleOpenDataCatalogue } from '@usa-open-data-connectors/usa-sources';
678
+
679
+ const catalogue = await fetchSeattleOpenDataCatalogue({ limit: 10 });
680
+ console.log(catalogue.entryCount, catalogue.datasetCount, catalogue.categories[0]);
681
+ ```
682
+
683
+ The public API is `SEATTLE_OPEN_DATA_API_BASE`,
684
+ `SEATTLE_OPEN_DATA_CATALOGUE_LIMIT`, `SEATTLE_OPEN_DATA_CATALOGUE_SOURCE_ID`,
685
+ `buildSeattleOpenDataCatalogueUrl`, `parseSeattleOpenDataCataloguePayload`,
686
+ `fetchSeattleOpenDataCatalogue`, and `seattleOpenDataCatalogueAdapter`, with the
687
+ `SeattleOpenDataCatalogueEntry`, `SeattleOpenDataCategoryCount`, and
688
+ `SeattleOpenDataCatalogue` types. The parser follows the same Socrata catalogue
689
+ shape as the Chicago adapter.
690
+
691
+ `texas-open-data-catalogue`:
692
+
693
+ ```ts
694
+ import { fetchTexasOpenDataCatalogue } from '@usa-open-data-connectors/usa-sources';
695
+
696
+ const catalogue = await fetchTexasOpenDataCatalogue({ limit: 10 });
697
+ console.log(catalogue.entryCount, catalogue.datasetCount, catalogue.categories[0]);
698
+ ```
699
+
700
+ The public API is `TEXAS_OPEN_DATA_API_BASE`,
701
+ `TEXAS_OPEN_DATA_CATALOGUE_LIMIT`, `TEXAS_OPEN_DATA_CATALOGUE_SOURCE_ID`,
702
+ `buildTexasOpenDataCatalogueUrl`, `parseTexasOpenDataCataloguePayload`,
703
+ `fetchTexasOpenDataCatalogue`, and `texasOpenDataCatalogueAdapter`, with the
704
+ `TexasOpenDataCatalogueEntry`, `TexasOpenDataCategoryCount`, and
705
+ `TexasOpenDataCatalogue` types. The parser follows the same Socrata catalogue
706
+ shape as the Chicago and Seattle adapters.
707
+
538
708
  ## Notes and limits
539
709
 
540
710
  - `bls-unemployment-rate`: the public API refuses a window longer than ten years. `fetchBlsSeries` splits a longer range into windows, so two decades cost three calls once the range reaches the current year.
@@ -583,13 +753,13 @@ fetch takes about 20 seconds on a fast connection.
583
753
  - `cfpb-consumer-complaints`: the API answers one question per request and has no date sort. The window costs one request per year plus one for the tallies plus one or two to find the newest day. `findNewestCfpComplaintDate` walks back from today. It stops at the first day with a complaint.
584
754
  - `cfpb-consumer-complaints`: the first year in the window, 2011, holds only December. The bureau published its first complaints on 1 December 2011. The adapter keeps the year, and the page's data note says the first bar covers one month.
585
755
  - `cfpb-consumer-complaints`: the product tally splits credit reporting across more than one label because the bureau changed its product taxonomy over the years. The adapter keeps whatever the API sends, so the labels in `topProducts` are not stable.
586
- - `cfpb-consumer-complaints`: the committed snapshot holds the folded counts, not the eighteen million raw rows.
587
- - `fdic-bank-directory`: the default request asks for ten rows and sets no active filter. The full file held 27,835 records on 2026-10-16, including historical institutions the FDIC marks inactive, so the first page is not a current bank count. Add `filters=ACTIVE:1` to the URL to read the active directory, which held 4,219 institutions that day.
756
+ - `cfpb-consumer-complaints`: the committed snapshot holds the folded counts, not the raw complaint rows.
757
+ - `fdic-bank-directory`: the default request asks for ten rows and sets no active filter. The full file includes historical institutions the FDIC marks inactive, so the first page is not a current bank count. Add `filters=ACTIVE:1` to the URL to read the active directory.
588
758
  - `fdic-bank-directory`: the filtered count arrives in both `meta.total` and `totals.count`. Both fields describe the filtered result, not the size of the unfiltered file, so `totalBanks` is the active count when the request carries the active filter.
589
759
  - `fdic-bank-directory`: `banks.data.fdic.gov` answers with a redirect to `api.fdic.gov`. `fetch` follows it. Both hosts answer 200 to a scripted request, and neither needs a key.
590
760
  - `fdic-bank-directory`: `FDIC_BANK_FIELDS` asks for `NAME,CITY,STALP`, but the parser requires `ID` as well. The service adds `ID` to the response even when it is not in `fields`, but a caller should ask for `ID,NAME,CITY,STALP` so the request and the parser agree without relying on that behaviour.
591
761
  - `fdic-bank-directory`: each row sits inside a `data` wrapper with a separate `score` field. The parser reads `row.data`, not the wrapper.
592
- - `fdic-bank-directory`: the active rows cover 55 state-level codes, not 50. DC, Puerto Rico, Guam, Micronesia, and the US Virgin Islands each hold active banks, so a caller that labels the counts as states will overstate the map.
762
+ - `fdic-bank-directory`: the active rows cover state-level codes beyond the 50 states. DC, Puerto Rico, Guam, Micronesia, and the US Virgin Islands each hold active banks, so a caller that labels the counts as states will overstate the map.
593
763
  - `fdic-bank-directory`: the directory counts institutions at the state of the main office. It is not a branch count, and a bank with branches across several states appears once.
594
764
  - `sec-edgar-filings`: the SEC asks every caller to identify itself with a User-Agent header. The adapter sends `SEC_EDGAR_USER_AGENT`, which carries a placeholder contact address. A deployment should override it with its own application name and address before the request leaves a shared host.
595
765
  - `sec-edgar-filings`: the submissions file carries the last 1,000 filings, not the issuer's full history. Apple's block ran from 18 September 2015 to 16 October 2026 on 2026-10-19. A caller that needs older rows has to read the filing archive rather than this endpoint.
@@ -600,7 +770,7 @@ fetch takes about 20 seconds on a fast connection.
600
770
  - `epa-envirofacts-facilities`: the default row window is the first ten rows. `fetchEpaEnvirofactsFacilities` takes a state but not a row window, so a caller that needs the whole state builds the URL with `buildEpaEnvirofactsFacilitiesUrl({ stateAbbr, rowWindow })` and parses the response with `parseEpaEnvirofactsFacilitiesPayload`.
601
771
  - `epa-envirofacts-facilities`: the table holds facility records, not release amounts. It is the Toxics Release Inventory facility register, so a row says where a site is and whether the EPA marks it closed (`fac_closed_ind` of `1`), not how much it released in a year.
602
772
  - `epa-envirofacts-facilities`: every key arrives in lower case, and the parent company is sometimes the literal text `NA`. The parser reads that as null rather than a company name.
603
- - `epa-envirofacts-facilities`: a state response can be large. California held 5,110 facilities on 2026-10-19, about 7.7 MB with the full record and about 1 MB after trimming to the ten fields the parser keeps.
773
+ - `epa-envirofacts-facilities`: a state response can be large. A full California response runs to several megabytes, and trimming it to the ten fields the parser keeps reduces it to about a megabyte.
604
774
  - `estimatetax-income-tax`: one keyless request answers the federal, state, and local income tax for one salary. The endpoint is limited to 60 requests a minute per address.
605
775
  - `estimatetax-income-tax`: the response is a calculation from the publisher's own engine, not a row from an official statistical release. Every layer cites the IRS or state document it was read from, so the source and the date are visible in the response.
606
776
  - `estimatetax-income-tax`: the engine assumes the standard deduction unless `preTaxDeductions` is supplied. It does not model itemised deductions, capital gains, or credits, and the response carries that disclaimer.
@@ -610,18 +780,21 @@ fetch takes about 20 seconds on a fast connection.
610
780
  - `ncbi-pubmed-search`: keyless NCBI allows about three requests a second. The adapter makes one request per call and does not add a delay, so a caller reading six years must space the calls itself.
611
781
  - `ncbi-pubmed-search`: a query field tag such as `[tiab]` restricts the match to the title and abstract. Without a tag, PubMed maps the words through MeSH and searches every indexed field, which answers a wider and different count. `queryTranslation` shows what PubMed actually ran.
612
782
  - `ncbi-pubmed-search`: a bad query answers HTTP 200 with `esearchresult.error` instead of a result block. The parser turns that into `UsSourceApiError`, so a caller does not count an error as zero papers.
613
- - `cdc-socrata-catalogue`: the default request asks for ten rows. The discovery API answers the whole catalogue when the limit is high enough, and the CDC catalogue held 1,478 entries on 2026-10-20. Call `buildCdcSocrataCatalogueUrl({ limit: 10_000 })` or pass `limit` to `fetchCdcSocrataCatalogue` when you need every entry. A limit below the catalogue size truncates the response without an error.
783
+ - `cdc-socrata-catalogue`: the default request asks for ten rows. The discovery API answers the whole catalogue when the limit is high enough. Call `buildCdcSocrataCatalogueUrl({ limit: 10_000 })` or pass `limit` to `fetchCdcSocrataCatalogue` when you need every entry. A limit below the catalogue size truncates the response without an error.
614
784
  - `cdc-socrata-catalogue`: each row is a catalogue entry, not a dataset record. `assetType` can be `dataset`, `file`, `href`, `filter`, `chart`, `story`, or `map`. A category can hold one type or a mix, so count the asset type before you describe a category as a dataset collection.
615
785
  - `cdc-socrata-catalogue`: an entry without a category has `null` in the response. The adapter keeps the null on the entry and counts it under `Uncategorised` in `categories`. That bucket is an adapter label, not a category the CDC assigned.
616
- - `cdc-socrata-catalogue`: the full response is large because each row carries portal metadata. The 1,478-row response was about 7.9 MB on 2026-10-20. The parser keeps nine fields, and a fixture trimmed to those fields was about 491 KB.
617
- - `cdc-socrata-catalogue`: the discovery API can carry rights and metadata fields, but this parser does not keep them. Check the portal entry before you reuse an item.
786
+ - `cdc-socrata-catalogue`: the full response is large because each row carries portal metadata. The parser keeps eleven fields, and a fixture trimmed to those fields is much smaller.
787
+ - `cdc-socrata-catalogue`: the entry carries `licenceUrl` and `attribution` when the portal supplies a `License` and `Publisher` value. On the captured page no entry named a licence URL and only some named a publisher. An empty value means the portal supplied none; check the entry before reuse.
618
788
  - `bts-transportation-stats`: the default request asks for ten rows. The story that consumed this adapter needed the whole catalogue, so it calls `buildBtsTransportationStatsUrl({ limit: 10_000 })` and parses the full response with `parseBtsTransportationStatsPayload`. A lower limit truncates the catalogue without an error.
619
- - `bts-transportation-stats`: each row is a catalogue entry, not a dataset record. `assetType` can be `story`, `dataset`, `chart`, `measure`, `filter`, `href`, `map`, or `file`. The story and dataset counts are different questions, and the 2026-10-20 catalogue held 177 stories against 153 datasets.
620
- - `bts-transportation-stats`: `viewCount` and `downloadCount` are the portal's own counters for an item page and its files. They are not unique people. Stories carry views and a zero download count because Socrata does not give a story a download counter, while 268 entries reported no downloads at all on 2026-10-20.
621
- - `bts-transportation-stats`: the response is large because every entry carries portal metadata. The 589-row response was about 2.2 MB on 2026-10-20. The parser keeps nine fields, and a fixture trimmed to those fields was about 172 KB.
789
+ - `bts-transportation-stats`: each row is a catalogue entry, not a dataset record. `assetType` can be `story`, `dataset`, `chart`, `measure`, `filter`, `href`, `map`, or `file`. The story and dataset counts are different questions, and the catalogue carries both.
790
+ - `bts-transportation-stats`: `viewCount` and `downloadCount` are the portal's own counters for an item page and its files. They are not unique people. Stories carry views and a zero download count because Socrata does not give a story a download counter, while many entries report no downloads at all.
791
+ - `bts-transportation-stats`: the response is large because every entry carries portal metadata. The parser keeps eleven fields, and a fixture trimmed to those fields is much smaller.
792
+ - `bts-transportation-stats`: every entry carries `licenceUrl` and `attribution` from the portal's Common Core metadata. The captured page names the USA.gov public-domain label and the Bureau of Transportation Statistics for every entry.
622
793
  - `bts-transportation-stats`: an entry without a category has `null` in the response. The adapter keeps the null on the entry and counts it under `Uncategorised` in `categories`. That bucket is an adapter label, not a category the bureau assigned.
794
+ - `healthdata-socrata-catalogue`: each entry carries `licenceUrl` and `attribution` from the portal's Common Core metadata. The captured page uses the USA.gov government-works label, ODbL, and PDDL, with publishers including federal agencies and state and city governments.
623
795
  - `nyc-open-data-catalogue`: the discovery API answers a bare JSON array of catalogue entries, not dataset rows. An entry can arrive without a category, which the adapter counts under `Uncategorised`.
624
796
  - `nyc-open-data-catalogue`: the page captured on 2026-10-19 mixes datasets and maps. The adapter counts both, and keeps the view and download totals for the page it read.
797
+ - `nyc-open-data-catalogue`: entries carry `licenceUrl` and `attribution`, but the captured page supplied neither, so both are empty. Check the portal entry before reusing an item.
625
798
  - Unit tests use the committed fixtures and run offline. Run them with `npm run test --workspace @usa-open-data-connectors/usa-sources`.
626
799
  - Smoke tests hit the live APIs and need `RUN_SMOKE=1`. Run them with `npm run test:smoke --workspace @usa-open-data-connectors/usa-sources`.
627
800
 
@@ -641,6 +814,20 @@ fetch takes about 20 seconds on a fast connection.
641
814
  - `nextbus-transit-vehicles`: `t=0` asks for every report the feed still holds for the route. The feed returns the current set of streetcars, not a history, so the snapshot describes one moment and is replaced on the next request.
642
815
  - `nextbus-transit-vehicles`: a route with no service returns a snapshot with zero vehicles and a valid timestamp. That is a real answer, not a failure, so the parser keeps it.
643
816
  - `nextbus-transit-vehicles`: the feed carries a copyright notice for the transit agency and Umo IQ, and states no open licence. Check the agency's terms before republishing the positions.
817
+ - `federal-register-documents`: the newest-documents query answered `count` 10,000 and `total_pages` 50 on 2026-11-08 even though the request asked for ten rows. The adapter preserves both values as the service reported them and does not treat either as the page size.
818
+ - `federal-register-documents`: a document can have several agencies, and a Presidential Document can have an empty abstract. Both are valid and the parser keeps them.
819
+ - `nhtsa-vehicle-models`: the service echoes the make in upper case, so a request for `Honda` returns rows whose `make` is `HONDA`. The adapter keeps the response value.
820
+ - `nhtsa-vehicle-models`: the default query is the 2025 Honda list, which returned 50 models in one page with `max=100` on 2026-11-08. A model year or page window outside the validator's range is refused before a request leaves.
821
+ - `fcc-socrata-catalogue`: the ten-entry page captured on 2026-11-08 mixed one story with nine datasets. The adapter counts only `assetType` values equal to `dataset` in `datasetCount`.
822
+ - `fcc-socrata-catalogue`: the captured page supplied no Common Core `License` or `Publisher` value, so `licenceUrl` and `attribution` are empty. Check each portal entry before reuse.
823
+ - `ny-state-open-data-catalogue`: the ten-entry page captured on 2026-11-08 mixed nine datasets with one file. The adapter counts only `assetType` values equal to `dataset` in `datasetCount`.
824
+ - `ny-state-open-data-catalogue`: the captured page supplied no Common Core `License` or `Publisher` value, so `licenceUrl` and `attribution` are empty. Check each portal entry before reuse.
825
+ - `chicago-open-data-catalogue`: the ten-entry page captured on 2026-11-08 mixed five datasets with charts, maps, and stories. The adapter counts only `assetType` values equal to `dataset` in `datasetCount`.
826
+ - `chicago-open-data-catalogue`: the captured page supplied no Common Core `License` or `Publisher` value, so `licenceUrl` and `attribution` are empty. Check each portal entry before reuse.
827
+ - `seattle-open-data-catalogue`: the ten-entry page captured on 2026-11-08 held three datasets and seven `federated_href` entries. The adapter counts only `assetType` values equal to `dataset` in `datasetCount`.
828
+ - `seattle-open-data-catalogue`: the first captured entry supplied licence text that begins "The City of Seattle makes no representation or warranty" and publisher `City of Seattle ArcGIS Online`. The adapter keeps both values per entry; other entries can supply neither.
829
+ - `texas-open-data-catalogue`: the ten-entry page captured on 2026-11-08 held five datasets, three linked resources, one map, and one measure. The adapter counts only `assetType` values equal to `dataset` in `datasetCount`.
830
+ - `texas-open-data-catalogue`: the captured page supplied no Common Core `License` or `Publisher` value, so `licenceUrl` and `attribution` are empty. Check each portal entry before reuse.
644
831
 
645
832
  ## Data sources and licences
646
833
 
@@ -673,11 +860,18 @@ The data comes from US federal agencies and the open data catalogue services the
673
860
  | College Scorecard, US Department of Education | `https://ed-public-download.scorecard.network/downloads/Most-Recent-Cohorts-Institution_10152026.zip` |
674
861
  | PublicDataHub, from the Centers for Medicare & Medicaid Services | `https://publicdatahub.org/api/export/hospital/{slug}.json` |
675
862
  | Portland Streetcar, through the NextBus XML feed | `https://retro.umoiq.com/service/publicXMLFeed?command=vehicleLocations&a=portland-sc&r=193&t=0` |
676
-
677
- Each publisher sets its own terms for its data. The Socrata discovery responses can carry rights and
678
- metadata fields, but the catalogue adapters in this package keep a subset of the entry fields and do not
679
- retain those terms. Check the licence on the portal entry before you reuse an item. A catalogue can list
680
- entries under terms such as these:
863
+ | Office of the Federal Register | `https://www.federalregister.gov/api/v1/documents.json` |
864
+ | National Highway Traffic Safety Administration | `https://api.nhtsa.gov/vehicles/models` |
865
+ | Federal Communications Commission | `https://opendata.fcc.gov/api/views.json` |
866
+ | New York State Open Data | `https://data.ny.gov/api/views.json` |
867
+ | City of Chicago | `https://data.cityofchicago.org/api/views.json` |
868
+ | City of Seattle | `https://data.seattle.gov/api/views.json` |
869
+ | State of Texas | `https://data.texas.gov/api/views.json` |
870
+
871
+ Each publisher sets its own terms for its data. The Socrata and CKAN catalogue adapters keep the `License` and
872
+ `Publisher` values from an entry's Common Core metadata as `licenceUrl` and `attribution`. An empty
873
+ value means the portal supplied none. Check the licence on the portal entry before you reuse an item.
874
+ A catalogue can list entries under terms such as these:
681
875
 
682
876
  - USA.gov public-domain label: `http://www.usa.gov/publicdomain/label/1.0/`
683
877
  - USA.gov government works: `https://www.usa.gov/government-works`
@@ -21,6 +21,10 @@ export interface BtsCatalogueEntry {
21
21
  viewCount: number;
22
22
  /** How many times the entry has been downloaded. */
23
23
  downloadCount: number;
24
+ /** Licence URL the portal attaches to the entry, or "" when it supplies none. */
25
+ licenceUrl: string;
26
+ /** Publishing organisation the portal attaches to the entry, or "" when it supplies none. */
27
+ attribution: string;
24
28
  }
25
29
  /** One category and how many catalogue entries carry it. */
26
30
  export interface BtsCatalogueCategoryCount {
@@ -1 +1 @@
1
- {"version":3,"file":"btsTransportationStats.d.ts","sourceRoot":"","sources":["../src/btsTransportationStats.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,0DAA0D;AAC1D,eAAO,MAAM,kCAAkC,6BAA6B,CAAC;AAE7E,0DAA0D;AAC1D,MAAM,WAAW,iBAAiB;IAChC,yDAAyD;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,SAAS,EAAE,MAAM,CAAC;IAClB,qFAAqF;IACrF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAC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 {"version":3,"file":"btsTransportationStats.d.ts","sourceRoot":"","sources":["../src/btsTransportationStats.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,0DAA0D;AAC1D,eAAO,MAAM,kCAAkC,6BAA6B,CAAC;AAE7E,0DAA0D;AAC1D,MAAM,WAAW,iBAAiB;IAChC,yDAAyD;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,SAAS,EAAE,MAAM,CAAC;IAClB,qFAAqF;IACrF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,qEAAqE;IACrE,QAAQ,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,qBAAqB,EAAE,MAAM,CAAC;IAC9B,yEAAyE;IACzE,4BAA4B,EAAE,MAAM,CAAC;IACrC,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,aAAa,EAAE,MAAM,CAAC;IACtB,iFAAiF;IACjF,UAAU,EAAE,MAAM,CAAC;IACnB,6FAA6F;IAC7F,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,4DAA4D;AAC5D,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qDAAqD;AACrD,MAAM,WAAW,0BAA0B;IACzC,gDAAgD;IAChD,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,YAAY,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,WAAW,EAAE,iBAAiB,CAAC;IAC/B;;;OAGG;IACH,UAAU,EAAE,yBAAyB,EAAE,CAAC;CACzC;AAED,8EAA8E;AAC9E,eAAO,MAAM,iCAAiC,wCAAwC,CAAC;AAEvF,oDAAoD;AACpD,eAAO,MAAM,8BAA8B,KAAK,CAAC;AAmDjD;;;;;;;;GAQG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAKnF;AAED;;;;;;;;;GASG;AACH,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,OAAO,GAAG,0BAA0B,CAwC/F;AAED;;;;;;;;GAQG;AACH,wBAAsB,2BAA2B,CAAC,OAAO,CAAC,EAAE;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;CACrC,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAOtC;AAED,+FAA+F;AAC/F,eAAO,MAAM,6BAA6B,EAAE,aAAa,CAAC,0BAA0B,CAanF,CAAC"}
@@ -2,6 +2,7 @@ import { z } from 'zod';
2
2
  import { UsSourceParseError } from './errors.js';
3
3
  import { httpGet } from './http.js';
4
4
  import { readFixtureJson } from './fixtures.js';
5
+ import { parseSocrataCatalogueMetadata } from './socrataCatalogueMetadata.js';
5
6
  /** Adapter id for the bts-transportation-stats source. */
6
7
  export const BTS_TRANSPORTATION_STATS_SOURCE_ID = 'bts-transportation-stats';
7
8
  /** Base URL for the Bureau of Transportation Statistics Socrata catalogue. */
@@ -24,6 +25,7 @@ const BTS_TRANSPORTATION_STATS_ENTRY_SCHEMA = z.object({
24
25
  viewLastModified: z.number().optional(),
25
26
  viewCount: z.number().optional(),
26
27
  downloadCount: z.number().optional(),
28
+ metadata: z.unknown().optional(),
27
29
  });
28
30
  const BTS_TRANSPORTATION_STATS_PAYLOAD_SCHEMA = z.array(BTS_TRANSPORTATION_STATS_ENTRY_SCHEMA);
29
31
  /** Counts entries per category, most entries first, ties by name. */
@@ -92,6 +94,7 @@ export function parseBtsTransportationStatsPayload(payload) {
92
94
  viewLastModifiedEpochSeconds: row.viewLastModified ?? row.createdAt,
93
95
  viewCount: row.viewCount ?? 0,
94
96
  downloadCount: row.downloadCount ?? 0,
97
+ ...parseSocrataCatalogueMetadata(row.metadata),
95
98
  };
96
99
  });
97
100
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"btsTransportationStats.js","sourceRoot":"","sources":["../src/btsTransportationStats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,0DAA0D;AAC1D,MAAM,CAAC,MAAM,kCAAkC,GAAG,0BAA0B,CAAC;AA8C7E,8EAA8E;AAC9E,MAAM,CAAC,MAAM,iCAAiC,GAAG,qCAAqC,CAAC;AAEvF,oDAAoD;AACpD,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,CAAC;AAEjD,6GAA6G;AAC7G,MAAM,yCAAyC,GAAG,0CAA0C,CAAC;AAE7F,qFAAqF;AACrF,MAAM,gCAAgC,GAAG,eAAe,CAAC;AAEzD,4EAA4E;AAC5E,8DAA8D;AAC9D,MAAM,qCAAqC,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC1C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACvC,S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AC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,OAGjD;IACC,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,UAAU,CAAC,KAAK,CAAC;IACzD,MAAM,GAAG,GAAG,8BAA8B,CACxC,OAAO,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAC7D,CAAC;IACF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,kCAAkC,EAAE,GAAG,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;IACvF,OAAO,kCAAkC,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;AACnE,CAAC;AAED,+FAA+F;AAC/F,MAAM,CAAC,MAAM,6BAA6B,GAA8C;IACtF,EAAE,EAAE,kCAAkC;IACtC,IAAI,EAAE,+BAA+B;IACrC,IAAI,EAAE,MAAM;IACZ,WAAW,EACT,+JAA+J;IACjK,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAC3B,2BAA2B,CACzB,OAAO,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CACzE;IACH,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,kCAAkC,CAAC,OAAO,CAAC;IAC/D,WAAW,EAAE,GAAG,EAAE,CAChB,kCAAkC,CAAC,eAAe,CAAC,yCAAyC,CAAC,CAAC;CACjG,CAAC"}
@@ -0,0 +1,84 @@
1
+ import type { SocrataCatalogueCategoryCount } from './socrataCatalogue.js';
2
+ import type { UsDataAdapter } from './types.js';
3
+ /** Adapter id for the California Open Data catalogue source. */
4
+ export declare const CALIFORNIA_OPEN_DATA_CATALOGUE_SOURCE_ID = "california-open-data-catalogue";
5
+ /** Keyless CKAN package-search URL for the California Open Data catalogue. */
6
+ export declare const CALIFORNIA_OPEN_DATA_API_BASE = "https://data.ca.gov/api/3/action/package_search";
7
+ /** How many catalogue entries one request reads. */
8
+ export declare const CALIFORNIA_OPEN_DATA_CATALOGUE_LIMIT = 10;
9
+ /** One CKAN package from the California Open Data catalogue. */
10
+ export interface CaliforniaOpenDataCatalogueEntry {
11
+ /** CKAN package UUID. */
12
+ id: string;
13
+ /** CKAN package slug. */
14
+ name: string;
15
+ /** Human-readable dataset title. */
16
+ title: string;
17
+ /** CKAN package type, usually "dataset". */
18
+ assetType: string;
19
+ /** First CKAN group title, or null when the package belongs to no group. */
20
+ category: string | null;
21
+ /** When the package was created, in seconds since the Unix epoch. */
22
+ createdAtEpochSeconds: number;
23
+ /** When the package was last modified, in seconds since the Unix epoch. */
24
+ viewLastModifiedEpochSeconds: number;
25
+ /** Number of resources attached to the package. */
26
+ resourceCount: number;
27
+ /** Licence URL or title the portal attaches, or "" when it supplies none. */
28
+ licenceUrl: string;
29
+ /** Publishing organisation the portal attaches, or "" when it supplies none. */
30
+ attribution: string;
31
+ }
32
+ /** One catalogue topic and how many entries carry it. */
33
+ export type CaliforniaOpenDataCategoryCount = SocrataCatalogueCategoryCount;
34
+ /** One page of the California catalogue, folded for a story. */
35
+ export interface CaliforniaOpenDataCatalogue {
36
+ /** One entry per package in the page. */
37
+ entries: CaliforniaOpenDataCatalogueEntry[];
38
+ entryCount: number;
39
+ /** Total packages the CKAN search reports for the query. */
40
+ catalogueCount: number;
41
+ /** Entries whose package type is "dataset". */
42
+ datasetCount: number;
43
+ /** Entry with the latest creation time. Ties go to the earlier list entry. */
44
+ newestEntry: CaliforniaOpenDataCatalogueEntry;
45
+ /** Categories in the page, most entries first, ties broken by name. */
46
+ categories: CaliforniaOpenDataCategoryCount[];
47
+ }
48
+ /**
49
+ * Builds the request URL for one page of the California CKAN catalogue.
50
+ *
51
+ * The endpoint is keyless. CKAN calls the entry cap `rows`.
52
+ *
53
+ * @param options - an optional entry cap
54
+ * @returns the full request URL
55
+ */
56
+ export declare function buildCaliforniaOpenDataCatalogueUrl(options?: {
57
+ limit?: number;
58
+ }): string;
59
+ /**
60
+ * Parses one page of the California CKAN catalogue into entries and topic counts.
61
+ *
62
+ * An entry without an id, a name, a title, or a creation time is a changed
63
+ * shape and stops the parse. An empty page also stops the parse.
64
+ *
65
+ * @param payload - the JSON body from the California CKAN package search
66
+ * @returns the entries in the page, the counts, and the newest entry
67
+ */
68
+ export declare function parseCaliforniaOpenDataCataloguePayload(payload: unknown): CaliforniaOpenDataCatalogue;
69
+ /**
70
+ * Reads one page of the California Open Data catalogue through CKAN.
71
+ *
72
+ * One keyless request covers the page. The Socrata discovery endpoint on the
73
+ * same host answers HTTP 404, while CKAN package search answers JSON.
74
+ *
75
+ * @param options - an optional entry cap and fetch stub
76
+ * @returns the entries in the page, the counts, and the newest entry
77
+ */
78
+ export declare function fetchCaliforniaOpenDataCatalogue(options?: {
79
+ limit?: number;
80
+ fetchImpl?: typeof globalThis.fetch;
81
+ }): Promise<CaliforniaOpenDataCatalogue>;
82
+ /** California Open Data catalogue of datasets and resources, keyless through CKAN. */
83
+ export declare const californiaOpenDataCatalogueAdapter: UsDataAdapter<CaliforniaOpenDataCatalogue>;
84
+ //# sourceMappingURL=californiaOpenDataCatalogue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"californiaOpenDataCatalogue.d.ts","sourceRoot":"","sources":["../src/californiaOpenDataCatalogue.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,gEAAgE;AAChE,eAAO,MAAM,wCAAwC,mCAAmC,CAAC;AAEzF,8EAA8E;AAC9E,eAAO,MAAM,6BAA6B,oDAAoD,CAAC;AAE/F,oDAAoD;AACpD,eAAO,MAAM,oCAAoC,KAAK,CAAC;AAEvD,gEAAgE;AAChE,MAAM,WAAW,gC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