@usa-open-data-connectors/usa-sources 0.1.1 → 0.1.3
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/dist/btsTransportationStats.d.ts +87 -0
- package/dist/btsTransportationStats.d.ts.map +1 -0
- package/dist/btsTransportationStats.js +132 -0
- package/dist/btsTransportationStats.js.map +1 -0
- package/dist/cdcSocrataCatalogue.d.ts +87 -0
- package/dist/cdcSocrataCatalogue.d.ts.map +1 -0
- package/dist/cdcSocrataCatalogue.js +132 -0
- package/dist/cdcSocrataCatalogue.js.map +1 -0
- package/dist/clinicalTrialsStudies.d.ts +92 -0
- package/dist/clinicalTrialsStudies.d.ts.map +1 -0
- package/dist/clinicalTrialsStudies.js +149 -0
- package/dist/clinicalTrialsStudies.js.map +1 -0
- package/dist/epaEnvirofactsFacilities.d.ts +94 -0
- package/dist/epaEnvirofactsFacilities.d.ts.map +1 -0
- package/dist/epaEnvirofactsFacilities.js +142 -0
- package/dist/epaEnvirofactsFacilities.js.map +1 -0
- package/dist/fdicBankDirectory.d.ts +78 -0
- package/dist/fdicBankDirectory.d.ts.map +1 -0
- package/dist/fdicBankDirectory.js +124 -0
- package/dist/fdicBankDirectory.js.map +1 -0
- package/dist/healthdataSocrataCatalogue.d.ts +87 -0
- package/dist/healthdataSocrataCatalogue.d.ts.map +1 -0
- package/dist/healthdataSocrataCatalogue.js +132 -0
- package/dist/healthdataSocrataCatalogue.js.map +1 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -1
- package/dist/ncbiPubmedSearch.d.ts +71 -0
- package/dist/ncbiPubmedSearch.d.ts.map +1 -0
- package/dist/ncbiPubmedSearch.js +128 -0
- package/dist/ncbiPubmedSearch.js.map +1 -0
- package/dist/nwsPointForecast.d.ts +99 -0
- package/dist/nwsPointForecast.d.ts.map +1 -0
- package/dist/nwsPointForecast.js +146 -0
- package/dist/nwsPointForecast.js.map +1 -0
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +22 -0
- package/dist/registry.js.map +1 -1
- package/dist/secEdgarFilings.d.ts +103 -0
- package/dist/secEdgarFilings.d.ts.map +1 -0
- package/dist/secEdgarFilings.js +214 -0
- package/dist/secEdgarFilings.js.map +1 -0
- package/dist/treasuryDebtToPenny.d.ts +90 -0
- package/dist/treasuryDebtToPenny.d.ts.map +1 -0
- package/dist/treasuryDebtToPenny.js +170 -0
- package/dist/treasuryDebtToPenny.js.map +1 -0
- package/dist/usaspendingAgencies.d.ts +78 -0
- package/dist/usaspendingAgencies.d.ts.map +1 -0
- package/dist/usaspendingAgencies.js +121 -0
- package/dist/usaspendingAgencies.js.map +1 -0
- package/package.json +10 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secEdgarFilings.js","sourceRoot":"","sources":["../src/secEdgarFilings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,uDAAuD;AACvD,MAAM,CAAC,MAAM,2BAA2B,GAAG,mBAAmB,CAAC;AAE/D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,8CAA8C,CAAC;AAuDnF,sDAAsD;AACtD,MAAM,CAAC,MAAM,8BAA8B,GAAG,kCAAkC,CAAC;AAEjF,0EAA0E;AAC1E,MAAM,CAAC,MAAM,mBAAmB,GAAG,YAAY,CAAC;AAEhD,6EAA6E;AAC7E,MAAM,0BAA0B,GAAG,mCAAmC,CAAC;AAEvE,yDAAyD;AACzD,MAAM,WAAW,GAAG,YAAY,CAAC;AAEjC,iDAAiD;AACjD,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AAE/C,6EAA6E;AAC7E,6EAA6E;AAC7E,6CAA6C;AA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M,IAAI,gBAAgB,CACxB,2BAA2B,EAC3B,QAAQ,QAAQ,CAAC,MAAM,+BAA+B,CACvD,CAAC;IACJ,CAAC;IACD,OAAO,2BAA2B,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;AAC5D,CAAC;AAED,gEAAgE;AAChE,MAAM,CAAC,MAAM,sBAAsB,GAA0C;IAC3E,EAAE,EAAE,2BAA2B;IAC/B,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,MAAM;IACZ,WAAW,EACT,2HAA2H;IAC7H,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAC3B,oBAAoB,CAAC,OAAO,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;IAChG,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,2BAA2B,CAAC,OAAO,CAAC;IACxD,WAAW,EAAE,GAAG,EAAE,CAAC,2BAA2B,CAAC,eAAe,CAAC,0BAA0B,CAAC,CAAC;CAC5F,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { UsDataAdapter } from './types.js';
|
|
2
|
+
/** Adapter id for the Treasury debt-to-the-penny source. */
|
|
3
|
+
export declare const TREASURY_DEBT_TO_PENNY_SOURCE_ID = "treasury-debt-to-penny";
|
|
4
|
+
/** One business day of the Treasury's outstanding public debt. */
|
|
5
|
+
export interface TreasuryDebtToPennyDay {
|
|
6
|
+
/** The agency's own record date, e.g. "1993-04-01". */
|
|
7
|
+
recordDate: string;
|
|
8
|
+
/** Total public debt outstanding that day, in US dollars. */
|
|
9
|
+
totalPublicDebtOutstandingUsd: number;
|
|
10
|
+
/** Debt held by the public, in US dollars, or null when the row omits it. */
|
|
11
|
+
debtHeldByPublicUsd: number | null;
|
|
12
|
+
/** Intragovernmental holdings, in US dollars, or null when the row omits it. */
|
|
13
|
+
intragovernmentalHoldingsUsd: number | null;
|
|
14
|
+
}
|
|
15
|
+
/** One page of the debt file, folded down to the days a story leans on. */
|
|
16
|
+
export interface TreasuryDebtToPennyPage {
|
|
17
|
+
/** One entry per business day in the page, oldest first. */
|
|
18
|
+
days: TreasuryDebtToPennyDay[];
|
|
19
|
+
dayCount: number;
|
|
20
|
+
/** Oldest day in the page. */
|
|
21
|
+
firstDay: TreasuryDebtToPennyDay;
|
|
22
|
+
/** Newest day in the page. */
|
|
23
|
+
lastDay: TreasuryDebtToPennyDay;
|
|
24
|
+
/** Day in the page with the largest total debt outstanding. Ties go to the earlier date. */
|
|
25
|
+
highestTotalDebt: TreasuryDebtToPennyDay;
|
|
26
|
+
/** Day in the page with the smallest total debt outstanding. Ties go to the earlier date. */
|
|
27
|
+
lowestTotalDebt: TreasuryDebtToPennyDay;
|
|
28
|
+
}
|
|
29
|
+
/** Base URL for the Treasury Fiscal Data API. */
|
|
30
|
+
export declare const TREASURY_DEBT_TO_PENNY_API_BASE = "https://api.fiscaldata.treasury.gov/services/api/fiscal_service";
|
|
31
|
+
/** Dataset path for the debt to the penny file. */
|
|
32
|
+
export declare const TREASURY_DEBT_TO_PENNY_PATH = "/v2/accounting/od/debt_to_penny";
|
|
33
|
+
/**
|
|
34
|
+
* Row cap for one request.
|
|
35
|
+
*
|
|
36
|
+
* The file runs to hundreds of thousands of daily rows, so the adapter reads
|
|
37
|
+
* a short recent page rather than the whole run. The API defaults to
|
|
38
|
+
* oldest-first, the same order the endpoint was probed in on 2026-10-05.
|
|
39
|
+
*/
|
|
40
|
+
export declare const TREASURY_DEBT_TO_PENNY_ROW_LIMIT = 10;
|
|
41
|
+
/**
|
|
42
|
+
* Builds the request URL for one page of the debt file.
|
|
43
|
+
*
|
|
44
|
+
* The endpoint is keyless. The page size is small on purpose: the file holds
|
|
45
|
+
* one row per business day since 1993, so a caller asking for the whole run
|
|
46
|
+
* would read hundreds of thousands of rows.
|
|
47
|
+
*
|
|
48
|
+
* @param options - an optional row cap
|
|
49
|
+
* @returns the full request URL
|
|
50
|
+
*/
|
|
51
|
+
export declare function buildTreasuryDebtToPennyUrl(options?: {
|
|
52
|
+
rowLimit?: number;
|
|
53
|
+
}): string;
|
|
54
|
+
/**
|
|
55
|
+
* Parses one response into the days that carry a total debt figure.
|
|
56
|
+
*
|
|
57
|
+
* A row without a readable date stops the parse, because the file is a date
|
|
58
|
+
* series and an undated row cannot be placed. A row without a total debt
|
|
59
|
+
* figure is dropped, which is how a day the agency could not report arrives.
|
|
60
|
+
*
|
|
61
|
+
* @param payload - the JSON body from the Fiscal Data API
|
|
62
|
+
* @returns the days that carry a total, in the order the agency sent them
|
|
63
|
+
*/
|
|
64
|
+
export declare function parseTreasuryDebtToPennyPayload(payload: unknown): TreasuryDebtToPennyDay[];
|
|
65
|
+
/**
|
|
66
|
+
* Folds the parsed days into one page with the headline days named.
|
|
67
|
+
*
|
|
68
|
+
* The days are sorted oldest first, so a caller reading index 0 gets the
|
|
69
|
+
* oldest day in the page and index -1 gets the newest.
|
|
70
|
+
*
|
|
71
|
+
* @param days - the parsed days, in any order
|
|
72
|
+
* @returns the sorted days, the first and last, and the highest and lowest on the page
|
|
73
|
+
*/
|
|
74
|
+
export declare function buildTreasuryDebtToPennyPage(days: TreasuryDebtToPennyDay[]): TreasuryDebtToPennyPage;
|
|
75
|
+
/**
|
|
76
|
+
* Reads one page of the Treasury's debt to the penny file.
|
|
77
|
+
*
|
|
78
|
+
* One keyless request covers the short page the endpoint answers by default,
|
|
79
|
+
* one row per business day.
|
|
80
|
+
*
|
|
81
|
+
* @param options - an optional row cap and fetch stub
|
|
82
|
+
* @returns the daily totals in the page, oldest first, with the extremes named
|
|
83
|
+
*/
|
|
84
|
+
export declare function fetchTreasuryDebtToPenny(options?: {
|
|
85
|
+
rowLimit?: number;
|
|
86
|
+
fetchImpl?: typeof globalThis.fetch;
|
|
87
|
+
}): Promise<TreasuryDebtToPennyPage>;
|
|
88
|
+
/** US Treasury debt to the penny, one row per business day, keyless. */
|
|
89
|
+
export declare const treasuryDebtToPennyAdapter: UsDataAdapter<TreasuryDebtToPennyPage>;
|
|
90
|
+
//# sourceMappingURL=treasuryDebtToPenny.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"treasuryDebtToPenny.d.ts","sourceRoot":"","sources":["../src/treasuryDebtToPenny.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,4DAA4D;AAC5D,eAAO,MAAM,gCAAgC,2BAA2B,CAAC;AAEzE,kEAAkE;AAClE,MAAM,WAAW,sBAAsB;IACrC,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,6BAA6B,EAAE,MAAM,CAAC;IACtC,6EAA6E;IAC7E,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,gFAAgF;IAChF,4BAA4B,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7C;AAED,2EAA2E;AAC3E,MAAM,WAAW,uBAAuB;IACtC,4DAA4D;IAC5D,IAAI,EAAE,sBAAsB,EAAE,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,QAAQ,EAAE,sBAAsB,CAAC;IACjC,8BAA8B;IAC9B,OAAO,EAAE,sBAAsB,CAAC;IAChC,4FAA4F;IAC5F,gBAAgB,EAAE,sBAAsB,CAAC;IACzC,6FAA6F;IAC7F,eAAe,EAAE,sBAAsB,CAAC;CACzC;AAED,iDAAiD;AACjD,eAAO,MAAM,+BAA+B,oEACuB,CAAC;AAEpE,mDAAmD;AACnD,eAAO,MAAM,2BAA2B,oCAAoC,CAAC;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,gCAAgC,KAAK,CAAC;AAyBnD;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAKnF;AAiBD;;;;;;;;;GASG;AACH,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,OAAO,GAAG,sBAAsB,EAAE,CA6C1F;AAED;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,sBAAsB,EAAE,GAC7B,uBAAuB,CA2BzB;AAED;;;;;;;;GAQG;AACH,wBAAsB,wBAAwB,CAAC,OAAO,CAAC,EAAE;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;CACrC,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAanC;AAED,wEAAwE;AACxE,eAAO,MAAM,0BAA0B,EAAE,aAAa,CAAC,uBAAuB,CAe7E,CAAC"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UsSourceApiError, UsSourceParseError } from './errors.js';
|
|
3
|
+
import { readFixtureJson } from './fixtures.js';
|
|
4
|
+
/** Adapter id for the Treasury debt-to-the-penny source. */
|
|
5
|
+
export const TREASURY_DEBT_TO_PENNY_SOURCE_ID = 'treasury-debt-to-penny';
|
|
6
|
+
/** Base URL for the Treasury Fiscal Data API. */
|
|
7
|
+
export const TREASURY_DEBT_TO_PENNY_API_BASE = 'https://api.fiscaldata.treasury.gov/services/api/fiscal_service';
|
|
8
|
+
/** Dataset path for the debt to the penny file. */
|
|
9
|
+
export const TREASURY_DEBT_TO_PENNY_PATH = '/v2/accounting/od/debt_to_penny';
|
|
10
|
+
/**
|
|
11
|
+
* Row cap for one request.
|
|
12
|
+
*
|
|
13
|
+
* The file runs to hundreds of thousands of daily rows, so the adapter reads
|
|
14
|
+
* a short recent page rather than the whole run. The API defaults to
|
|
15
|
+
* oldest-first, the same order the endpoint was probed in on 2026-10-05.
|
|
16
|
+
*/
|
|
17
|
+
export const TREASURY_DEBT_TO_PENNY_ROW_LIMIT = 10;
|
|
18
|
+
/** Committed snapshot, so a build works when the Treasury host is unreachable. */
|
|
19
|
+
const TREASURY_DEBT_TO_PENNY_FIXTURE_FILENAME = 'treasury-debt-to-penny-2026-10-05.json';
|
|
20
|
+
/** Shape of the agency's record date, e.g. "1993-04-01". */
|
|
21
|
+
const ISO_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
|
|
22
|
+
// Every field arrives as a string, and a value the agency could not report
|
|
23
|
+
// arrives as the literal text "null". A rejected request answers with an HTTP
|
|
24
|
+
// error and a body of {error, message} instead of the data.
|
|
25
|
+
const TREASURY_DEBT_ROW_SCHEMA = z.object({
|
|
26
|
+
record_date: z.string().optional(),
|
|
27
|
+
debt_held_public_amt: z.string().optional(),
|
|
28
|
+
intragov_hold_amt: z.string().optional(),
|
|
29
|
+
tot_pub_debt_out_amt: z.string().optional(),
|
|
30
|
+
});
|
|
31
|
+
const TREASURY_DEBT_PAYLOAD_SCHEMA = z.object({
|
|
32
|
+
data: z.array(TREASURY_DEBT_ROW_SCHEMA).optional(),
|
|
33
|
+
meta: z.object({ count: z.number().optional() }).optional(),
|
|
34
|
+
error: z.string().optional(),
|
|
35
|
+
message: z.string().optional(),
|
|
36
|
+
});
|
|
37
|
+
/**
|
|
38
|
+
* Builds the request URL for one page of the debt file.
|
|
39
|
+
*
|
|
40
|
+
* The endpoint is keyless. The page size is small on purpose: the file holds
|
|
41
|
+
* one row per business day since 1993, so a caller asking for the whole run
|
|
42
|
+
* would read hundreds of thousands of rows.
|
|
43
|
+
*
|
|
44
|
+
* @param options - an optional row cap
|
|
45
|
+
* @returns the full request URL
|
|
46
|
+
*/
|
|
47
|
+
export function buildTreasuryDebtToPennyUrl(options) {
|
|
48
|
+
const params = new URLSearchParams({
|
|
49
|
+
'page[size]': String(options?.rowLimit ?? TREASURY_DEBT_TO_PENNY_ROW_LIMIT),
|
|
50
|
+
});
|
|
51
|
+
return `${TREASURY_DEBT_TO_PENNY_API_BASE}${TREASURY_DEBT_TO_PENNY_PATH}?${params.toString()}`;
|
|
52
|
+
}
|
|
53
|
+
/** Reads an amount the agency sends as a string, or null when it is missing. */
|
|
54
|
+
function readTreasuryDebtAmount(value) {
|
|
55
|
+
if (value === undefined || value.trim() === '' || value === 'null') {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
const parsed = Number(value);
|
|
59
|
+
if (!Number.isFinite(parsed)) {
|
|
60
|
+
throw new UsSourceParseError(TREASURY_DEBT_TO_PENNY_SOURCE_ID, `Unreadable debt amount: ${value}`);
|
|
61
|
+
}
|
|
62
|
+
return parsed;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Parses one response into the days that carry a total debt figure.
|
|
66
|
+
*
|
|
67
|
+
* A row without a readable date stops the parse, because the file is a date
|
|
68
|
+
* series and an undated row cannot be placed. A row without a total debt
|
|
69
|
+
* figure is dropped, which is how a day the agency could not report arrives.
|
|
70
|
+
*
|
|
71
|
+
* @param payload - the JSON body from the Fiscal Data API
|
|
72
|
+
* @returns the days that carry a total, in the order the agency sent them
|
|
73
|
+
*/
|
|
74
|
+
export function parseTreasuryDebtToPennyPayload(payload) {
|
|
75
|
+
const parsed = TREASURY_DEBT_PAYLOAD_SCHEMA.safeParse(payload);
|
|
76
|
+
if (!parsed.success) {
|
|
77
|
+
throw new UsSourceParseError(TREASURY_DEBT_TO_PENNY_SOURCE_ID, parsed.error.message);
|
|
78
|
+
}
|
|
79
|
+
if (parsed.data.error !== undefined) {
|
|
80
|
+
throw new UsSourceApiError(TREASURY_DEBT_TO_PENNY_SOURCE_ID, parsed.data.message ?? `The API rejected the request: ${parsed.data.error}`);
|
|
81
|
+
}
|
|
82
|
+
const rows = parsed.data.data ?? [];
|
|
83
|
+
if (rows.length === 0) {
|
|
84
|
+
throw new UsSourceParseError(TREASURY_DEBT_TO_PENNY_SOURCE_ID, 'The response carried no rows');
|
|
85
|
+
}
|
|
86
|
+
const days = [];
|
|
87
|
+
for (const row of rows) {
|
|
88
|
+
if (row.record_date === undefined || !ISO_DATE_PATTERN.test(row.record_date)) {
|
|
89
|
+
throw new UsSourceParseError(TREASURY_DEBT_TO_PENNY_SOURCE_ID, `Unreadable record date: ${row.record_date ?? 'missing'}`);
|
|
90
|
+
}
|
|
91
|
+
const totalPublicDebtOutstandingUsd = readTreasuryDebtAmount(row.tot_pub_debt_out_amt);
|
|
92
|
+
if (totalPublicDebtOutstandingUsd === null) {
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
days.push({
|
|
96
|
+
recordDate: row.record_date,
|
|
97
|
+
totalPublicDebtOutstandingUsd,
|
|
98
|
+
debtHeldByPublicUsd: readTreasuryDebtAmount(row.debt_held_public_amt),
|
|
99
|
+
intragovernmentalHoldingsUsd: readTreasuryDebtAmount(row.intragov_hold_amt),
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
if (days.length === 0) {
|
|
103
|
+
throw new UsSourceParseError(TREASURY_DEBT_TO_PENNY_SOURCE_ID, 'No daily values in the response');
|
|
104
|
+
}
|
|
105
|
+
return days;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Folds the parsed days into one page with the headline days named.
|
|
109
|
+
*
|
|
110
|
+
* The days are sorted oldest first, so a caller reading index 0 gets the
|
|
111
|
+
* oldest day in the page and index -1 gets the newest.
|
|
112
|
+
*
|
|
113
|
+
* @param days - the parsed days, in any order
|
|
114
|
+
* @returns the sorted days, the first and last, and the highest and lowest on the page
|
|
115
|
+
*/
|
|
116
|
+
export function buildTreasuryDebtToPennyPage(days) {
|
|
117
|
+
const sorted = [...days].sort((left, right) => left.recordDate.localeCompare(right.recordDate));
|
|
118
|
+
const first = sorted[0];
|
|
119
|
+
const last = sorted[sorted.length - 1];
|
|
120
|
+
if (first === undefined || last === undefined) {
|
|
121
|
+
throw new UsSourceParseError(TREASURY_DEBT_TO_PENNY_SOURCE_ID, 'No days to summarise');
|
|
122
|
+
}
|
|
123
|
+
let highest = first;
|
|
124
|
+
let lowest = first;
|
|
125
|
+
for (const day of sorted) {
|
|
126
|
+
if (day.totalPublicDebtOutstandingUsd > highest.totalPublicDebtOutstandingUsd) {
|
|
127
|
+
highest = day;
|
|
128
|
+
}
|
|
129
|
+
if (day.totalPublicDebtOutstandingUsd < lowest.totalPublicDebtOutstandingUsd) {
|
|
130
|
+
lowest = day;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
days: sorted,
|
|
135
|
+
dayCount: sorted.length,
|
|
136
|
+
firstDay: first,
|
|
137
|
+
lastDay: last,
|
|
138
|
+
highestTotalDebt: highest,
|
|
139
|
+
lowestTotalDebt: lowest,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Reads one page of the Treasury's debt to the penny file.
|
|
144
|
+
*
|
|
145
|
+
* One keyless request covers the short page the endpoint answers by default,
|
|
146
|
+
* one row per business day.
|
|
147
|
+
*
|
|
148
|
+
* @param options - an optional row cap and fetch stub
|
|
149
|
+
* @returns the daily totals in the page, oldest first, with the extremes named
|
|
150
|
+
*/
|
|
151
|
+
export async function fetchTreasuryDebtToPenny(options) {
|
|
152
|
+
const fetchImpl = options?.fetchImpl ?? globalThis.fetch;
|
|
153
|
+
const url = buildTreasuryDebtToPennyUrl(options?.rowLimit === undefined ? {} : { rowLimit: options.rowLimit });
|
|
154
|
+
const response = await fetchImpl(url);
|
|
155
|
+
if (!response.ok) {
|
|
156
|
+
throw new UsSourceApiError(TREASURY_DEBT_TO_PENNY_SOURCE_ID, `HTTP ${response.status} reading the debt to the penny file`);
|
|
157
|
+
}
|
|
158
|
+
return buildTreasuryDebtToPennyPage(parseTreasuryDebtToPennyPayload(await response.json()));
|
|
159
|
+
}
|
|
160
|
+
/** US Treasury debt to the penny, one row per business day, keyless. */
|
|
161
|
+
export const treasuryDebtToPennyAdapter = {
|
|
162
|
+
id: TREASURY_DEBT_TO_PENNY_SOURCE_ID,
|
|
163
|
+
name: 'US Treasury debt to the penny',
|
|
164
|
+
auth: 'none',
|
|
165
|
+
description: 'Daily total public debt outstanding the US Treasury reports, in dollars, from the debt to the penny file.',
|
|
166
|
+
fetchLive: async (options) => fetchTreasuryDebtToPenny(options?.fetchImpl === undefined ? {} : { fetchImpl: options.fetchImpl }),
|
|
167
|
+
parse: (payload) => buildTreasuryDebtToPennyPage(parseTreasuryDebtToPennyPayload(payload)),
|
|
168
|
+
loadFixture: () => buildTreasuryDebtToPennyPage(parseTreasuryDebtToPennyPayload(readFixtureJson(TREASURY_DEBT_TO_PENNY_FIXTURE_FILENAME))),
|
|
169
|
+
};
|
|
170
|
+
//# sourceMappingURL=treasuryDebtToPenny.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"treasuryDebtToPenny.js","sourceRoot":"","sources":["../src/treasuryDebtToPenny.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,4DAA4D;AAC5D,MAAM,CAAC,MAAM,gCAAgC,GAAG,wBAAwB,CAAC;AA6BzE,iDAAiD;AACjD,MAAM,CAAC,MAAM,+BAA+B,GAC1C,iEAAiE,CAAC;AAEpE,mDAAmD;AACnD,MAAM,CAAC,MAAM,2BAA2B,GAAG,iCAAiC,CAAC;AAE7E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,CAAC;AAEnD,kFAAkF;AAClF,MAAM,uCAAuC,GAAG,wCAAwC,CAAC;AAEzF,4DAA4D;AAC5D,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AAE/C,2EAA2E;AAC3E,8EAA8E;AAC9E,4DAA4D;AAC5D,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,oBAAoB,EAAE,CAAC,CAAC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,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,4BAA4B,CAAC,+BAA+B,CAAC,OAAO,CAAC,CAAC;IAC1F,WAAW,EAAE,GAAG,EAAE,CAChB,4BAA4B,CAC1B,+BAA+B,CAAC,eAAe,CAAC,uCAAuC,CAAC,CAAC,CAC1F;CACJ,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { UsDataAdapter } from './types.js';
|
|
2
|
+
/** Adapter id for the USAspending top-tier agencies source. */
|
|
3
|
+
export declare const USASPENDING_AGENCIES_SOURCE_ID = "usaspending-agencies";
|
|
4
|
+
/** One top-tier federal agency and its budget figures for the active quarter. */
|
|
5
|
+
export interface UsaSpendingAgency {
|
|
6
|
+
/** USAspending's own id for the agency. */
|
|
7
|
+
agencyId: number;
|
|
8
|
+
/** The agency's top-tier code, e.g. "247". */
|
|
9
|
+
toptierCode: string;
|
|
10
|
+
/** Short abbreviation, e.g. "HHS". */
|
|
11
|
+
abbreviation: string;
|
|
12
|
+
/** Full agency name. */
|
|
13
|
+
agencyName: string;
|
|
14
|
+
/** Fiscal year the figures describe, e.g. "2026". */
|
|
15
|
+
activeFiscalYear: string;
|
|
16
|
+
/** Fiscal quarter the figures describe, e.g. "4". */
|
|
17
|
+
activeFiscalQuarter: string;
|
|
18
|
+
/** Money spent during the active quarter, in dollars. */
|
|
19
|
+
outlayAmount: number;
|
|
20
|
+
/** Money committed by contract or grant, in dollars. */
|
|
21
|
+
obligatedAmount: number;
|
|
22
|
+
/** Budget authority for the active fiscal year, in dollars. */
|
|
23
|
+
budgetAuthorityAmount: number;
|
|
24
|
+
/** Total budget authority across the whole government, in dollars. */
|
|
25
|
+
currentTotalBudgetAuthorityAmount: number;
|
|
26
|
+
/** This agency's share of the whole budget authority, as a fraction. */
|
|
27
|
+
percentageOfTotalBudgetAuthority: number;
|
|
28
|
+
/** URL slug the agency uses, e.g. "department-of-health-and-human-services". */
|
|
29
|
+
agencySlug: string;
|
|
30
|
+
/** URL of the agency's congressional budget justification, or null when none. */
|
|
31
|
+
congressionalJustificationUrl: string | null;
|
|
32
|
+
}
|
|
33
|
+
/** The agency list folded for a story. */
|
|
34
|
+
export interface UsaSpendingAgencyDirectory {
|
|
35
|
+
/** One entry per top-tier agency. */
|
|
36
|
+
agencies: UsaSpendingAgency[];
|
|
37
|
+
agencyCount: number;
|
|
38
|
+
/** Fiscal year the figures describe. */
|
|
39
|
+
fiscalYear: string;
|
|
40
|
+
/** Fiscal quarter the figures describe. */
|
|
41
|
+
fiscalQuarter: string;
|
|
42
|
+
/** Total budget authority across the whole government, in dollars. */
|
|
43
|
+
currentTotalBudgetAuthorityAmount: number;
|
|
44
|
+
/** Agency with the largest obligated amount. Ties go to the earlier list entry. */
|
|
45
|
+
largestByObligation: UsaSpendingAgency;
|
|
46
|
+
/** Agency with the largest outlay amount. Ties go to the earlier list entry. */
|
|
47
|
+
largestByOutlay: UsaSpendingAgency;
|
|
48
|
+
}
|
|
49
|
+
/** Base URL for the USAspending API. */
|
|
50
|
+
export declare const USASPENDING_API_BASE = "https://api.usaspending.gov/api/v2";
|
|
51
|
+
/** Path of the top-tier agency reference list. */
|
|
52
|
+
export declare const USASPENDING_TOP_TIER_AGENCIES_PATH = "/references/toptier_agencies/";
|
|
53
|
+
/**
|
|
54
|
+
* Parses one response into the top-tier agency list and the headline agencies.
|
|
55
|
+
*
|
|
56
|
+
* A row without an id or a name is a changed shape and stops the parse. The
|
|
57
|
+
* first row's fiscal year and quarter describe the whole list, which is how
|
|
58
|
+
* the API builds it.
|
|
59
|
+
*
|
|
60
|
+
* @param payload - the JSON body from the USAspending agencies endpoint
|
|
61
|
+
* @returns the agencies, the fiscal period, and the largest by obligation and outlay
|
|
62
|
+
*/
|
|
63
|
+
export declare function parseUsaSpendingAgenciesPayload(payload: unknown): UsaSpendingAgencyDirectory;
|
|
64
|
+
/**
|
|
65
|
+
* Reads the top-tier federal agency reference list from USAspending.
|
|
66
|
+
*
|
|
67
|
+
* One keyless request covers every top-tier agency and the budget figures for
|
|
68
|
+
* the active fiscal quarter.
|
|
69
|
+
*
|
|
70
|
+
* @param options - an optional fetch stub
|
|
71
|
+
* @returns the agencies, the fiscal period, and the largest by obligation and outlay
|
|
72
|
+
*/
|
|
73
|
+
export declare function fetchUsaSpendingAgencies(options?: {
|
|
74
|
+
fetchImpl?: typeof globalThis.fetch;
|
|
75
|
+
}): Promise<UsaSpendingAgencyDirectory>;
|
|
76
|
+
/** USAspending top-tier federal agencies, one row per agency, keyless. */
|
|
77
|
+
export declare const usaspendingAgenciesAdapter: UsDataAdapter<UsaSpendingAgencyDirectory>;
|
|
78
|
+
//# sourceMappingURL=usaspendingAgencies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usaspendingAgencies.d.ts","sourceRoot":"","sources":["../src/usaspendingAgencies.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,+DAA+D;AAC/D,eAAO,MAAM,8BAA8B,yBAAyB,CAAC;AAErE,iFAAiF;AACjF,MAAM,WAAW,iBAAiB;IAChC,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,wBAAwB;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,gBAAgB,EAAE,MAAM,CAAC;IACzB,qDAAqD;IACrD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,yDAAyD;IACzD,YAAY,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,eAAe,EAAE,MAAM,CAAC;IACxB,+DAA+D;IAC/D,qBAAqB,EAAE,MAAM,CAAC;IAC9B,sEAAsE;IACtE,iCAAiC,EAAE,MAAM,CAAC;IAC1C,wEAAwE;IACxE,gCAAgC,EAAE,MAAM,CAAC;IACzC,gFAAgF;IAChF,UAAU,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,6BAA6B,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9C;AAED,0CAA0C;AAC1C,MAAM,WAAW,0BAA0B;IACzC,qCAAqC;IACrC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,wCAAwC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,sEAAsE;IACtE,iCAAiC,EAAE,MAAM,CAAC;IAC1C,mFAAmF;IACnF,mBAAmB,EAAE,iBAAiB,CAAC;IACvC,gFAAgF;IAChF,eAAe,EAAE,iBAAiB,CAAC;CACpC;AAED,wCAAwC;AACxC,eAAO,MAAM,oBAAoB,uCAAuC,CAAC;AAEzE,kDAAkD;AAClD,eAAO,MAAM,kCAAkC,kCAAkC,CAAC;AAuClF;;;;;;;;;GASG;AACH,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,OAAO,GAAG,0BAA0B,CAoD5F;AAED;;;;;;;;GAQG;AACH,wBAAsB,wBAAwB,CAAC,OAAO,CAAC,EAAE;IACvD,SAAS,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;CACrC,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAWtC;AAED,0EAA0E;AAC1E,eAAO,MAAM,0BAA0B,EAAE,aAAa,CAAC,0BAA0B,CAahF,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UsSourceApiError, UsSourceParseError } from './errors.js';
|
|
3
|
+
import { readFixtureJson } from './fixtures.js';
|
|
4
|
+
/** Adapter id for the USAspending top-tier agencies source. */
|
|
5
|
+
export const USASPENDING_AGENCIES_SOURCE_ID = 'usaspending-agencies';
|
|
6
|
+
/** Base URL for the USAspending API. */
|
|
7
|
+
export const USASPENDING_API_BASE = 'https://api.usaspending.gov/api/v2';
|
|
8
|
+
/** Path of the top-tier agency reference list. */
|
|
9
|
+
export const USASPENDING_TOP_TIER_AGENCIES_PATH = '/references/toptier_agencies/';
|
|
10
|
+
/** Committed snapshot, so a build works when the USAspending host is unreachable. */
|
|
11
|
+
const USASPENDING_AGENCIES_FIXTURE_FILENAME = 'usaspending-agencies-2026-10-05.json';
|
|
12
|
+
// The list arrives as rows with typed numbers. A row the agency could not
|
|
13
|
+
// complete arrives with null in the optional fields.
|
|
14
|
+
const USASPENDING_AGENCY_SCHEMA = z.object({
|
|
15
|
+
agency_id: z.number().optional(),
|
|
16
|
+
toptier_code: z.string().optional(),
|
|
17
|
+
abbreviation: z.string().optional(),
|
|
18
|
+
agency_name: z.string().optional(),
|
|
19
|
+
congressional_justification_url: z.string().nullable().optional(),
|
|
20
|
+
active_fy: z.string().optional(),
|
|
21
|
+
active_fq: z.string().optional(),
|
|
22
|
+
outlay_amount: z.number().optional(),
|
|
23
|
+
obligated_amount: z.number().optional(),
|
|
24
|
+
budget_authority_amount: z.number().optional(),
|
|
25
|
+
current_total_budget_authority_amount: z.number().optional(),
|
|
26
|
+
percentage_of_total_budget_authority: z.number().optional(),
|
|
27
|
+
agency_slug: z.string().optional(),
|
|
28
|
+
});
|
|
29
|
+
const USASPENDING_AGENCIES_SCHEMA = z.object({
|
|
30
|
+
results: z.array(USASPENDING_AGENCY_SCHEMA).optional(),
|
|
31
|
+
});
|
|
32
|
+
/** Picks the agency with the largest value, ties to the earlier entry. */
|
|
33
|
+
function largestAgencyBy(agencies, field) {
|
|
34
|
+
const first = agencies[0];
|
|
35
|
+
if (first === undefined) {
|
|
36
|
+
throw new UsSourceParseError(USASPENDING_AGENCIES_SOURCE_ID, 'No agencies to summarise');
|
|
37
|
+
}
|
|
38
|
+
return agencies.reduce((best, agency) => (agency[field] > best[field] ? agency : best), first);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Parses one response into the top-tier agency list and the headline agencies.
|
|
42
|
+
*
|
|
43
|
+
* A row without an id or a name is a changed shape and stops the parse. The
|
|
44
|
+
* first row's fiscal year and quarter describe the whole list, which is how
|
|
45
|
+
* the API builds it.
|
|
46
|
+
*
|
|
47
|
+
* @param payload - the JSON body from the USAspending agencies endpoint
|
|
48
|
+
* @returns the agencies, the fiscal period, and the largest by obligation and outlay
|
|
49
|
+
*/
|
|
50
|
+
export function parseUsaSpendingAgenciesPayload(payload) {
|
|
51
|
+
const parsed = USASPENDING_AGENCIES_SCHEMA.safeParse(payload);
|
|
52
|
+
if (!parsed.success) {
|
|
53
|
+
throw new UsSourceParseError(USASPENDING_AGENCIES_SOURCE_ID, parsed.error.message);
|
|
54
|
+
}
|
|
55
|
+
const rows = parsed.data.results ?? [];
|
|
56
|
+
if (rows.length === 0) {
|
|
57
|
+
throw new UsSourceParseError(USASPENDING_AGENCIES_SOURCE_ID, 'The response carried no agencies');
|
|
58
|
+
}
|
|
59
|
+
const agencies = rows.map((row) => {
|
|
60
|
+
if (row.agency_id === undefined || row.agency_name === undefined) {
|
|
61
|
+
throw new UsSourceParseError(USASPENDING_AGENCIES_SOURCE_ID, 'An agency row arrived without its id or name');
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
agencyId: row.agency_id,
|
|
65
|
+
toptierCode: row.toptier_code ?? '',
|
|
66
|
+
abbreviation: row.abbreviation ?? '',
|
|
67
|
+
agencyName: row.agency_name,
|
|
68
|
+
activeFiscalYear: row.active_fy ?? '',
|
|
69
|
+
activeFiscalQuarter: row.active_fq ?? '',
|
|
70
|
+
outlayAmount: row.outlay_amount ?? 0,
|
|
71
|
+
obligatedAmount: row.obligated_amount ?? 0,
|
|
72
|
+
budgetAuthorityAmount: row.budget_authority_amount ?? 0,
|
|
73
|
+
currentTotalBudgetAuthorityAmount: row.current_total_budget_authority_amount ?? 0,
|
|
74
|
+
percentageOfTotalBudgetAuthority: row.percentage_of_total_budget_authority ?? 0,
|
|
75
|
+
agencySlug: row.agency_slug ?? '',
|
|
76
|
+
congressionalJustificationUrl: row.congressional_justification_url ?? null,
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
const first = agencies[0];
|
|
80
|
+
if (first === undefined) {
|
|
81
|
+
throw new UsSourceParseError(USASPENDING_AGENCIES_SOURCE_ID, 'No agencies to summarise');
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
agencies,
|
|
85
|
+
agencyCount: agencies.length,
|
|
86
|
+
fiscalYear: first.activeFiscalYear,
|
|
87
|
+
fiscalQuarter: first.activeFiscalQuarter,
|
|
88
|
+
currentTotalBudgetAuthorityAmount: first.currentTotalBudgetAuthorityAmount,
|
|
89
|
+
largestByObligation: largestAgencyBy(agencies, 'obligatedAmount'),
|
|
90
|
+
largestByOutlay: largestAgencyBy(agencies, 'outlayAmount'),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Reads the top-tier federal agency reference list from USAspending.
|
|
95
|
+
*
|
|
96
|
+
* One keyless request covers every top-tier agency and the budget figures for
|
|
97
|
+
* the active fiscal quarter.
|
|
98
|
+
*
|
|
99
|
+
* @param options - an optional fetch stub
|
|
100
|
+
* @returns the agencies, the fiscal period, and the largest by obligation and outlay
|
|
101
|
+
*/
|
|
102
|
+
export async function fetchUsaSpendingAgencies(options) {
|
|
103
|
+
const fetchImpl = options?.fetchImpl ?? globalThis.fetch;
|
|
104
|
+
const url = `${USASPENDING_API_BASE}${USASPENDING_TOP_TIER_AGENCIES_PATH}`;
|
|
105
|
+
const response = await fetchImpl(url);
|
|
106
|
+
if (!response.ok) {
|
|
107
|
+
throw new UsSourceApiError(USASPENDING_AGENCIES_SOURCE_ID, `HTTP ${response.status} reading the top-tier agencies`);
|
|
108
|
+
}
|
|
109
|
+
return parseUsaSpendingAgenciesPayload(await response.json());
|
|
110
|
+
}
|
|
111
|
+
/** USAspending top-tier federal agencies, one row per agency, keyless. */
|
|
112
|
+
export const usaspendingAgenciesAdapter = {
|
|
113
|
+
id: USASPENDING_AGENCIES_SOURCE_ID,
|
|
114
|
+
name: 'USAspending agencies',
|
|
115
|
+
auth: 'none',
|
|
116
|
+
description: 'Top-tier federal agencies from USAspending, one row per agency, with the budget authority, obligations, and outlays for the active fiscal quarter.',
|
|
117
|
+
fetchLive: async (options) => fetchUsaSpendingAgencies(options?.fetchImpl === undefined ? {} : { fetchImpl: options.fetchImpl }),
|
|
118
|
+
parse: (payload) => parseUsaSpendingAgenciesPayload(payload),
|
|
119
|
+
loadFixture: () => parseUsaSpendingAgenciesPayload(readFixtureJson(USASPENDING_AGENCIES_FIXTURE_FILENAME)),
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=usaspendingAgencies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usaspendingAgencies.js","sourceRoot":"","sources":["../src/usaspendingAgencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,+DAA+D;AAC/D,MAAM,CAAC,MAAM,8BAA8B,GAAG,sBAAsB,CAAC;AAiDrE,wCAAwC;AACxC,MAAM,CAAC,MAAM,oBAAoB,GAAG,oCAAoC,CAAC;AAEzE,kDAAkD;AAClD,MAAM,CAAC,MAAM,kCAAkC,GAAG,+BAA+B,CAAC;AAElF,qFAAqF;AACrF,MAAM,qCAAqC,GAAG,sCAAsC,CAAC;AAErF,0EAA0E;AAC1E,qDAAqD;AACrD,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,WAAW,EAAE,CAAC,CAAC,MAAM,EA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M,0BAA0B,GAA8C;IACnF,EAAE,EAAE,8BAA8B;IAClC,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE,MAAM;IACZ,WAAW,EACT,oJAAoJ;IACtJ,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAC3B,wBAAwB,CACtB,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,+BAA+B,CAAC,OAAO,CAAC;IAC5D,WAAW,EAAE,GAAG,EAAE,CAChB,+BAA+B,CAAC,eAAe,CAAC,qCAAqC,CAAC,CAAC;CAC1F,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usa-open-data-connectors/usa-sources",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,5 +42,13 @@
|
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
|
-
"description": "Uniform TypeScript adapters for US public data sources"
|
|
45
|
+
"description": "Uniform TypeScript adapters for US public data sources",
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "git+https://github.com/olitreadwell/usa-open-data-connectors.git"
|
|
49
|
+
},
|
|
50
|
+
"homepage": "https://github.com/olitreadwell/usa-open-data-connectors#readme",
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/olitreadwell/usa-open-data-connectors/issues"
|
|
53
|
+
}
|
|
46
54
|
}
|