@cliwant/mcp-sam-gov 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +12 -7
- package/README.ko.md +12 -7
- package/README.md +28 -10
- package/dist/bea.d.ts +105 -0
- package/dist/bea.d.ts.map +1 -0
- package/dist/bea.js +303 -0
- package/dist/bea.js.map +1 -0
- package/dist/dol.d.ts +118 -0
- package/dist/dol.d.ts.map +1 -0
- package/dist/dol.js +421 -0
- package/dist/dol.js.map +1 -0
- package/dist/keys.d.ts +10 -8
- package/dist/keys.d.ts.map +1 -1
- package/dist/keys.js +36 -8
- package/dist/keys.js.map +1 -1
- package/dist/lda.d.ts +105 -0
- package/dist/lda.d.ts.map +1 -0
- package/dist/lda.js +317 -0
- package/dist/lda.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +210 -3
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
- package/src/bea.ts +372 -0
- package/src/dol.ts +515 -0
- package/src/keys.ts +39 -8
- package/src/lda.ts +385 -0
- package/src/server.ts +234 -3
package/dist/lda.d.ts
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* lda.ts — US Senate LDA (Lobbying Disclosure Act) filings — the LOBBYING / B2G
|
|
3
|
+
* influence lane (ADR-0052). Who is paid HOW MUCH to lobby WHICH federal agency
|
|
4
|
+
* on WHICH issue — the registrant→client→government-entity signal that no
|
|
5
|
+
* contract/spending/grant source carries.
|
|
6
|
+
*
|
|
7
|
+
* ★ THIS IS A KEYLESS SOURCE WITH AN OPTIONAL KEY (the socrata.ts app-token
|
|
8
|
+
* lineage, NOT the census/fred/bea key-required lineage). The LDA REST API
|
|
9
|
+
* (lda.senate.gov/api/v1) serves anonymous GETs at HTTP 200 — it works with NO
|
|
10
|
+
* key. A free `LDA_API_KEY` only RAISES the shared rate limit; when set it rides
|
|
11
|
+
* ONLY as the `Authorization: Token <value>` request header (never the
|
|
12
|
+
* URL/label/_meta/notes/log — the K-test). When unset, NO auth header is sent
|
|
13
|
+
* (genuine keyless). This mirrors socrata's optional `X-App-Token` discipline.
|
|
14
|
+
*
|
|
15
|
+
* The module writes ZERO fetch/coercion/error/meta code of its own: it REUSES
|
|
16
|
+
* `getJson` (the shared fetch envelope, redirect:"error") / `driftError` /
|
|
17
|
+
* `num`·`str` (coerce.ts, null-never-0/empty) / `withMeta`·`buildMeta`.
|
|
18
|
+
*
|
|
19
|
+
* GET https://lda.senate.gov/api/v1/filings/
|
|
20
|
+
* ?filing_year=&filing_type=®istrant_name=&client_name=&lobbyist_name=
|
|
21
|
+
* &filing_specific_lobbying_issues=&government_entity=&page=&page_size=
|
|
22
|
+
* → { count, next, previous, results:[{ filing_uuid, filing_type,
|
|
23
|
+
* filing_type_display, filing_year, filing_period, filing_period_display,
|
|
24
|
+
* filing_document_url, income, expenses, dt_posted, termination_date,
|
|
25
|
+
* registrant:{name,…}|string, client:{name,…}|string,
|
|
26
|
+
* lobbying_activities:[{ general_issue_code, general_issue_code_display,
|
|
27
|
+
* description, government_entities:[{ name }] }], … }] }
|
|
28
|
+
*
|
|
29
|
+
* ★ HONESTY (ADR-0052 P1–P5):
|
|
30
|
+
* [P1] `count` is the API's REAL total (~1.95M) ⇒ totalAvailable = num(count),
|
|
31
|
+
* NEVER results.length. Page-based pagination (page/page_size, 1-based):
|
|
32
|
+
* returned = results.length, hasMore = page*pageSize < count, and the next
|
|
33
|
+
* page number is surfaced in a note. Reverting totalAvailable to
|
|
34
|
+
* results.length must go RED.
|
|
35
|
+
* [P2] getJson → fetchWithRetry taxonomy: a 400 (bad filter/param) ⇒
|
|
36
|
+
* invalid_input SURFACING the API's error body (re-read once on the error
|
|
37
|
+
* path); a 5xx/timeout ⇒ upstream_unavailable THROW; a 429 ⇒ rate_limited
|
|
38
|
+
* THROW honoring Retry-After (NEVER routed around); a genuine no-match
|
|
39
|
+
* (results:[]) ⇒ honest empty (returned:0); a 200 non-JSON ⇒ schema_drift.
|
|
40
|
+
* [P3] `income`/`expenses` are null-or-decimal-string ⇒ num() (null ⇒ null — NOT
|
|
41
|
+
* reported ≠ 0; a genuine "0" stays 0). A missing `lobbying_activities` /
|
|
42
|
+
* `government_entities` ⇒ empty arrays (never fabricated).
|
|
43
|
+
* [P4] `results` non-array or `count` non-number ⇒ driftError (never a
|
|
44
|
+
* fabricated empty/total).
|
|
45
|
+
* [SSRF] fixed host `lda.senate.gov`; a post-construction hostname/protocol
|
|
46
|
+
* assert + `redirect:"error"`; every filter VALUE rides URLSearchParams;
|
|
47
|
+
* `filingYear` / `page` / `pageSize` are charclass/range-guarded pre-fetch.
|
|
48
|
+
*/
|
|
49
|
+
import { num } from "./coerce.js";
|
|
50
|
+
import { type MetaBundle } from "./meta.js";
|
|
51
|
+
export { num };
|
|
52
|
+
export declare const LDA_HOST = "lda.senate.gov";
|
|
53
|
+
/**
|
|
54
|
+
* The optional Authorization header (keyless-first, socrata app-token lineage).
|
|
55
|
+
* Present ONLY when LDA_API_KEY is set (non-blank); the value is NEVER logged /
|
|
56
|
+
* never placed in the URL, label, `_meta`, or a note. When unset, `{}` (no header).
|
|
57
|
+
*/
|
|
58
|
+
export declare function ldaAuthHeader(): Record<string, string>;
|
|
59
|
+
/** true iff an LDA API key is configured (for the `_meta` note — never the value). */
|
|
60
|
+
export declare function ldaKeyPresent(): boolean;
|
|
61
|
+
export type LdaLobbyingActivity = {
|
|
62
|
+
issueCode: string | null;
|
|
63
|
+
description: string | null;
|
|
64
|
+
governmentEntities: string[];
|
|
65
|
+
};
|
|
66
|
+
export type LdaFiling = {
|
|
67
|
+
filingUuid: string | null;
|
|
68
|
+
filingType: string | null;
|
|
69
|
+
filingYear: number | null;
|
|
70
|
+
filingPeriod: string | null;
|
|
71
|
+
incomeUsd: number | null;
|
|
72
|
+
expensesUsd: number | null;
|
|
73
|
+
registrant: string | null;
|
|
74
|
+
client: string | null;
|
|
75
|
+
lobbyingActivities: LdaLobbyingActivity[];
|
|
76
|
+
documentUrl: string | null;
|
|
77
|
+
postedDate: string | null;
|
|
78
|
+
terminationDate: string | null;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* The registrant/client value may be an OBJECT carrying `name` (with address
|
|
82
|
+
* fields) OR a plain string. Defensively resolve either to the display name (or
|
|
83
|
+
* null when absent) — never fabricate, never surface the whole address object.
|
|
84
|
+
*/
|
|
85
|
+
export declare function nameOf(x: unknown): string | null;
|
|
86
|
+
export type LdaSearchFilingsArgs = {
|
|
87
|
+
registrantName?: string;
|
|
88
|
+
clientName?: string;
|
|
89
|
+
lobbyistName?: string;
|
|
90
|
+
filingYear?: string;
|
|
91
|
+
filingType?: string;
|
|
92
|
+
agency?: string;
|
|
93
|
+
issue?: string;
|
|
94
|
+
page?: number;
|
|
95
|
+
pageSize?: number;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Search US Senate LDA lobbying filings (`/api/v1/filings/`) → curated filing rows
|
|
99
|
+
* + honest `_meta`. KEYLESS (an optional LDA_API_KEY only raises the rate limit,
|
|
100
|
+
* sent as the Authorization header only). ★totalAvailable is the API's REAL `count`
|
|
101
|
+
* (~1.95M corpus) — never results.length; page-based pagination. income/expenses
|
|
102
|
+
* null-or-decimal-string → null-never-0.
|
|
103
|
+
*/
|
|
104
|
+
export declare function searchFilings(args: LdaSearchFilingsArgs): Promise<MetaBundle>;
|
|
105
|
+
//# sourceMappingURL=lda.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lda.d.ts","sourceRoot":"","sources":["../src/lda.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAIH,OAAO,EAAE,GAAG,EAAO,MAAM,aAAa,CAAC;AACvC,OAAO,EAAY,KAAK,UAAU,EAAqB,MAAM,WAAW,CAAC;AAIzE,OAAO,EAAE,GAAG,EAAE,CAAC;AAGf,eAAO,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;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC,UAAU,CAAC,CAyIrB"}
|
package/dist/lda.js
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* lda.ts — US Senate LDA (Lobbying Disclosure Act) filings — the LOBBYING / B2G
|
|
3
|
+
* influence lane (ADR-0052). Who is paid HOW MUCH to lobby WHICH federal agency
|
|
4
|
+
* on WHICH issue — the registrant→client→government-entity signal that no
|
|
5
|
+
* contract/spending/grant source carries.
|
|
6
|
+
*
|
|
7
|
+
* ★ THIS IS A KEYLESS SOURCE WITH AN OPTIONAL KEY (the socrata.ts app-token
|
|
8
|
+
* lineage, NOT the census/fred/bea key-required lineage). The LDA REST API
|
|
9
|
+
* (lda.senate.gov/api/v1) serves anonymous GETs at HTTP 200 — it works with NO
|
|
10
|
+
* key. A free `LDA_API_KEY` only RAISES the shared rate limit; when set it rides
|
|
11
|
+
* ONLY as the `Authorization: Token <value>` request header (never the
|
|
12
|
+
* URL/label/_meta/notes/log — the K-test). When unset, NO auth header is sent
|
|
13
|
+
* (genuine keyless). This mirrors socrata's optional `X-App-Token` discipline.
|
|
14
|
+
*
|
|
15
|
+
* The module writes ZERO fetch/coercion/error/meta code of its own: it REUSES
|
|
16
|
+
* `getJson` (the shared fetch envelope, redirect:"error") / `driftError` /
|
|
17
|
+
* `num`·`str` (coerce.ts, null-never-0/empty) / `withMeta`·`buildMeta`.
|
|
18
|
+
*
|
|
19
|
+
* GET https://lda.senate.gov/api/v1/filings/
|
|
20
|
+
* ?filing_year=&filing_type=®istrant_name=&client_name=&lobbyist_name=
|
|
21
|
+
* &filing_specific_lobbying_issues=&government_entity=&page=&page_size=
|
|
22
|
+
* → { count, next, previous, results:[{ filing_uuid, filing_type,
|
|
23
|
+
* filing_type_display, filing_year, filing_period, filing_period_display,
|
|
24
|
+
* filing_document_url, income, expenses, dt_posted, termination_date,
|
|
25
|
+
* registrant:{name,…}|string, client:{name,…}|string,
|
|
26
|
+
* lobbying_activities:[{ general_issue_code, general_issue_code_display,
|
|
27
|
+
* description, government_entities:[{ name }] }], … }] }
|
|
28
|
+
*
|
|
29
|
+
* ★ HONESTY (ADR-0052 P1–P5):
|
|
30
|
+
* [P1] `count` is the API's REAL total (~1.95M) ⇒ totalAvailable = num(count),
|
|
31
|
+
* NEVER results.length. Page-based pagination (page/page_size, 1-based):
|
|
32
|
+
* returned = results.length, hasMore = page*pageSize < count, and the next
|
|
33
|
+
* page number is surfaced in a note. Reverting totalAvailable to
|
|
34
|
+
* results.length must go RED.
|
|
35
|
+
* [P2] getJson → fetchWithRetry taxonomy: a 400 (bad filter/param) ⇒
|
|
36
|
+
* invalid_input SURFACING the API's error body (re-read once on the error
|
|
37
|
+
* path); a 5xx/timeout ⇒ upstream_unavailable THROW; a 429 ⇒ rate_limited
|
|
38
|
+
* THROW honoring Retry-After (NEVER routed around); a genuine no-match
|
|
39
|
+
* (results:[]) ⇒ honest empty (returned:0); a 200 non-JSON ⇒ schema_drift.
|
|
40
|
+
* [P3] `income`/`expenses` are null-or-decimal-string ⇒ num() (null ⇒ null — NOT
|
|
41
|
+
* reported ≠ 0; a genuine "0" stays 0). A missing `lobbying_activities` /
|
|
42
|
+
* `government_entities` ⇒ empty arrays (never fabricated).
|
|
43
|
+
* [P4] `results` non-array or `count` non-number ⇒ driftError (never a
|
|
44
|
+
* fabricated empty/total).
|
|
45
|
+
* [SSRF] fixed host `lda.senate.gov`; a post-construction hostname/protocol
|
|
46
|
+
* assert + `redirect:"error"`; every filter VALUE rides URLSearchParams;
|
|
47
|
+
* `filingYear` / `page` / `pageSize` are charclass/range-guarded pre-fetch.
|
|
48
|
+
*/
|
|
49
|
+
import { ToolErrorCarrier } from "./errors.js";
|
|
50
|
+
import { getJson, driftError } from "./datasource.js";
|
|
51
|
+
import { num, str } from "./coerce.js";
|
|
52
|
+
import { withMeta } from "./meta.js";
|
|
53
|
+
// Re-export the shared honesty coercion (single audited copy in ./coerce.js —
|
|
54
|
+
// ADR-0005 v2 FIX-C) so a `num` regression fails together across sources.
|
|
55
|
+
export { num };
|
|
56
|
+
// ─── SSRF core: the single fixed host + base path ─────────────────
|
|
57
|
+
export const LDA_HOST = "lda.senate.gov";
|
|
58
|
+
const LDA_FILINGS_PATH = "/api/v1/filings/";
|
|
59
|
+
// HOST+path label — surfaces in ToolError.upstreamEndpoint; the optional key rides
|
|
60
|
+
// ONLY in the Authorization header, so no token can ever appear here.
|
|
61
|
+
const LDA_FILINGS_LABEL = "lda:/api/v1/filings";
|
|
62
|
+
// ─── Validation (SSRF + "verify the input" honesty) ───────────────
|
|
63
|
+
const YEAR_RE = /^\d{4}$/; // a single 4-digit filing year
|
|
64
|
+
const DEFAULT_PAGE = 1;
|
|
65
|
+
const DEFAULT_PAGE_SIZE = 25;
|
|
66
|
+
const MAX_PAGE_SIZE = 25; // the LDA API caps page_size at 25
|
|
67
|
+
// ─── Honesty notes (ADR-0052 required set) ────────────────────────
|
|
68
|
+
const KEYLESS_NOTE = "Keyless by default (anonymous LDA API access returns HTTP 200). An optional free LDA_API_KEY only RAISES the rate limit; when set it is sent ONLY as the `Authorization: Token …` request header and is NEVER logged, echoed, or placed in this response.";
|
|
69
|
+
const AMOUNT_NOTE = "incomeUsd / expensesUsd are parsed from the API's null-or-decimal-string income / expenses. A null (not reported) maps to null — NEVER 0; a genuine reported 0 is preserved as 0. A filing reports EITHER income (lobbying firms) OR expenses (in-house filers), so the other is typically null.";
|
|
70
|
+
const COUNT_TOTAL_NOTE = "totalAvailable is the LDA API's real total match count for the query (the whole corpus is ~1.95M filings) — NOT the number of rows on this page. Pagination is page-based (page / pageSize, 1-based); pass the next page number for more.";
|
|
71
|
+
// ─── The optional-key seam (value NEVER leaked past the Authorization header) ──
|
|
72
|
+
/**
|
|
73
|
+
* The optional Authorization header (keyless-first, socrata app-token lineage).
|
|
74
|
+
* Present ONLY when LDA_API_KEY is set (non-blank); the value is NEVER logged /
|
|
75
|
+
* never placed in the URL, label, `_meta`, or a note. When unset, `{}` (no header).
|
|
76
|
+
*/
|
|
77
|
+
export function ldaAuthHeader() {
|
|
78
|
+
const raw = process.env.LDA_API_KEY;
|
|
79
|
+
const trimmed = typeof raw === "string" ? raw.trim() : "";
|
|
80
|
+
return trimmed ? { Authorization: `Token ${trimmed}` } : {};
|
|
81
|
+
}
|
|
82
|
+
/** true iff an LDA API key is configured (for the `_meta` note — never the value). */
|
|
83
|
+
export function ldaKeyPresent() {
|
|
84
|
+
const raw = process.env.LDA_API_KEY;
|
|
85
|
+
return typeof raw === "string" && raw.trim().length > 0;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The registrant/client value may be an OBJECT carrying `name` (with address
|
|
89
|
+
* fields) OR a plain string. Defensively resolve either to the display name (or
|
|
90
|
+
* null when absent) — never fabricate, never surface the whole address object.
|
|
91
|
+
*/
|
|
92
|
+
export function nameOf(x) {
|
|
93
|
+
if (x === null || x === undefined)
|
|
94
|
+
return null;
|
|
95
|
+
if (typeof x === "string")
|
|
96
|
+
return str(x);
|
|
97
|
+
if (typeof x === "object")
|
|
98
|
+
return str(x.name);
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
/** Map ONE lobbying_activities row → the curated shape (missing arrays ⇒ []). */
|
|
102
|
+
function mapActivity(raw) {
|
|
103
|
+
const a = (raw ?? {});
|
|
104
|
+
const entities = Array.isArray(a.government_entities)
|
|
105
|
+
? a.government_entities
|
|
106
|
+
.map((e) => str(e?.name))
|
|
107
|
+
.filter((n) => n !== null)
|
|
108
|
+
: [];
|
|
109
|
+
return {
|
|
110
|
+
issueCode: str(a.general_issue_code),
|
|
111
|
+
description: str(a.description),
|
|
112
|
+
governmentEntities: entities,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
/** Map ONE `results[]` filing row → the curated LdaFiling shape. */
|
|
116
|
+
function mapFiling(raw) {
|
|
117
|
+
const f = (raw ?? {});
|
|
118
|
+
return {
|
|
119
|
+
filingUuid: str(f.filing_uuid),
|
|
120
|
+
filingType: str(f.filing_type),
|
|
121
|
+
filingYear: num(f.filing_year),
|
|
122
|
+
filingPeriod: str(f.filing_period_display) ?? str(f.filing_period),
|
|
123
|
+
// [P3] null (not reported) ⇒ null, NEVER 0; a genuine "0" ⇒ 0.
|
|
124
|
+
incomeUsd: num(f.income),
|
|
125
|
+
expensesUsd: num(f.expenses),
|
|
126
|
+
registrant: nameOf(f.registrant),
|
|
127
|
+
client: nameOf(f.client),
|
|
128
|
+
lobbyingActivities: Array.isArray(f.lobbying_activities)
|
|
129
|
+
? f.lobbying_activities.map(mapActivity)
|
|
130
|
+
: [],
|
|
131
|
+
documentUrl: str(f.filing_document_url),
|
|
132
|
+
postedDate: str(f.dt_posted),
|
|
133
|
+
terminationDate: str(f.termination_date),
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Search US Senate LDA lobbying filings (`/api/v1/filings/`) → curated filing rows
|
|
138
|
+
* + honest `_meta`. KEYLESS (an optional LDA_API_KEY only raises the rate limit,
|
|
139
|
+
* sent as the Authorization header only). ★totalAvailable is the API's REAL `count`
|
|
140
|
+
* (~1.95M corpus) — never results.length; page-based pagination. income/expenses
|
|
141
|
+
* null-or-decimal-string → null-never-0.
|
|
142
|
+
*/
|
|
143
|
+
export async function searchFilings(args) {
|
|
144
|
+
// ── Validate + default (belt-and-suspenders behind the server Zod; a DIRECT
|
|
145
|
+
// handler call bypasses Zod). filingYear / page / pageSize are charclass/
|
|
146
|
+
// range-guarded; the free-text filters ride URLSearchParams (encoded). ──
|
|
147
|
+
if (args.filingYear !== undefined && !YEAR_RE.test(args.filingYear)) {
|
|
148
|
+
throw new ToolErrorCarrier({
|
|
149
|
+
kind: "invalid_input",
|
|
150
|
+
retryable: false,
|
|
151
|
+
message: `Invalid filingYear ${JSON.stringify(args.filingYear)} — expected a 4-digit year (^\\d{4}$), e.g. "2024".`,
|
|
152
|
+
upstreamEndpoint: LDA_FILINGS_LABEL,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
const page = clampPage(args.page);
|
|
156
|
+
const pageSize = clampPageSize(args.pageSize);
|
|
157
|
+
// ── Build the query from VALIDATED typed args, key-by-key (SSRF: no raw
|
|
158
|
+
// passthrough; every VALUE is URLSearchParams-encoded). ──
|
|
159
|
+
const params = new URLSearchParams();
|
|
160
|
+
const filtersApplied = [];
|
|
161
|
+
const setFilter = (key, val, label) => {
|
|
162
|
+
if (val !== undefined && val !== "") {
|
|
163
|
+
params.set(key, val);
|
|
164
|
+
filtersApplied.push(label);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
setFilter("registrant_name", args.registrantName, "registrantName");
|
|
168
|
+
setFilter("client_name", args.clientName, "clientName");
|
|
169
|
+
setFilter("lobbyist_name", args.lobbyistName, "lobbyistName");
|
|
170
|
+
setFilter("filing_year", args.filingYear, "filingYear");
|
|
171
|
+
setFilter("filing_type", args.filingType, "filingType");
|
|
172
|
+
setFilter("government_entity", args.agency, "agency");
|
|
173
|
+
setFilter("filing_specific_lobbying_issues", args.issue, "issue");
|
|
174
|
+
params.set("page", String(page));
|
|
175
|
+
params.set("page_size", String(pageSize));
|
|
176
|
+
const url = `https://${LDA_HOST}${LDA_FILINGS_PATH}?${params.toString()}`;
|
|
177
|
+
// Belt-and-suspenders: the fixed host + strictly-built query leave nothing to
|
|
178
|
+
// steer the authority; assert the built URL cannot have been moved off-host.
|
|
179
|
+
const built = new URL(url);
|
|
180
|
+
if (built.hostname !== LDA_HOST || built.protocol !== "https:") {
|
|
181
|
+
throw new ToolErrorCarrier({
|
|
182
|
+
kind: "invalid_input",
|
|
183
|
+
retryable: false,
|
|
184
|
+
message: `Constructed LDA URL host ${JSON.stringify(built.hostname)} (${built.protocol}) is not ${LDA_HOST} over https — refusing to fetch (SSRF safety).`,
|
|
185
|
+
upstreamEndpoint: LDA_FILINGS_LABEL,
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
// ── Fetch through the shared envelope. The optional key rides the Authorization
|
|
189
|
+
// header ONLY (never the URL/label/_meta); redirect:"error" fails closed on
|
|
190
|
+
// any off-host 3xx. A 429 ⇒ rate_limited THROW (Retry-After honored by the
|
|
191
|
+
// shared taxonomy, never routed around); a 5xx/timeout ⇒ upstream_unavailable
|
|
192
|
+
// THROW; a 400 ⇒ invalid_input (re-read below to surface the API message); a
|
|
193
|
+
// 200 non-JSON ⇒ getJson's r.json() throws a SyntaxError ⇒ schema_drift. ──
|
|
194
|
+
const headers = ldaAuthHeader();
|
|
195
|
+
let body;
|
|
196
|
+
try {
|
|
197
|
+
body = await getJson(url, {
|
|
198
|
+
label: LDA_FILINGS_LABEL,
|
|
199
|
+
headers,
|
|
200
|
+
redirect: "error",
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
catch (e) {
|
|
204
|
+
if (e instanceof SyntaxError) {
|
|
205
|
+
throw driftError(LDA_FILINGS_LABEL, "LDA /api/v1/filings returned a non-JSON body at HTTP 200 — schema drift (never read as an empty result).");
|
|
206
|
+
}
|
|
207
|
+
// [P2] A 400 (bad filter/param) carries a DRF error body; fetchWithRetry
|
|
208
|
+
// discarded it. Re-read once on the error path ONLY so the caller learns the
|
|
209
|
+
// REAL reason (never a fake-empty). 5xx/429/404/timeout keep their taxonomy.
|
|
210
|
+
if (e instanceof ToolErrorCarrier && e.toolError.upstreamStatus === 400) {
|
|
211
|
+
const apiMsg = await readLdaErrorMessage(url, headers);
|
|
212
|
+
throw new ToolErrorCarrier({
|
|
213
|
+
kind: "invalid_input",
|
|
214
|
+
retryable: false,
|
|
215
|
+
message: apiMsg
|
|
216
|
+
? `LDA rejected the request (HTTP 400): ${apiMsg}. Check the filter parameters (filingYear, filingType, agency, issue, …).`
|
|
217
|
+
: "LDA rejected the request (HTTP 400) — check the filter parameters (filingYear, filingType, agency, issue, …).",
|
|
218
|
+
upstreamStatus: 400,
|
|
219
|
+
upstreamEndpoint: LDA_FILINGS_LABEL,
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
throw e; // 5xx → upstream_unavailable, 404 → not_found, 429 → rate_limited …
|
|
223
|
+
}
|
|
224
|
+
// ── [P4] `results` MUST be an array and `count` MUST be a number (a missing/
|
|
225
|
+
// wrong-typed either is drift, never a fabricated empty/total). ──
|
|
226
|
+
const b = (body ?? {});
|
|
227
|
+
if (!Array.isArray(b.results)) {
|
|
228
|
+
throw driftError(LDA_FILINGS_LABEL, "LDA /api/v1/filings shape drift — `results` must be an array.");
|
|
229
|
+
}
|
|
230
|
+
if (typeof b.count !== "number" || !Number.isFinite(b.count)) {
|
|
231
|
+
throw driftError(LDA_FILINGS_LABEL, "LDA /api/v1/filings shape drift — `count` (the total match count) must be a number.");
|
|
232
|
+
}
|
|
233
|
+
const filings = b.results.map(mapFiling);
|
|
234
|
+
const returned = filings.length;
|
|
235
|
+
// ── [P1] totalAvailable is the API's REAL count (~1.95M), NEVER results.length.
|
|
236
|
+
// Page-based: hasMore = page*pageSize < count; the next page is surfaced. ──
|
|
237
|
+
const totalAvailable = b.count;
|
|
238
|
+
const offset = (page - 1) * pageSize;
|
|
239
|
+
const hasMore = page * pageSize < totalAvailable;
|
|
240
|
+
const nextOffset = hasMore ? page * pageSize : null;
|
|
241
|
+
const notes = [COUNT_TOTAL_NOTE, AMOUNT_NOTE, KEYLESS_NOTE];
|
|
242
|
+
notes.push(`LDA API key: ${ldaKeyPresent() ? "present (Authorization: Token … sent; value never logged)" : "absent (keyless; a free LDA_API_KEY lifts the rate limit)"}.`);
|
|
243
|
+
if (hasMore) {
|
|
244
|
+
notes.push(`This is page ${page} (pageSize ${pageSize}) of ~${Math.ceil(totalAvailable / pageSize)} — pass page=${page + 1} for the next page.`);
|
|
245
|
+
}
|
|
246
|
+
return withMeta({ filings }, {
|
|
247
|
+
source: `${LDA_HOST} /api/v1/filings (US Senate LDA lobbying; keyless)`,
|
|
248
|
+
keylessMode: true, // ★KEYLESS — the optional key only raises the rate limit
|
|
249
|
+
returned,
|
|
250
|
+
totalAvailable,
|
|
251
|
+
filtersApplied,
|
|
252
|
+
filtersDropped: [],
|
|
253
|
+
fieldsUnavailable: [],
|
|
254
|
+
pagination: { offset, limit: pageSize, hasMore, nextOffset },
|
|
255
|
+
notes,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Single bare GET to read an LDA 400's DRF error body (error path ONLY). Returns a
|
|
260
|
+
* compact human-readable message, or null on any failure. Sends the SAME headers
|
|
261
|
+
* (so a keyed re-read honors the key) + redirect:"error"; the key stays header-only.
|
|
262
|
+
*/
|
|
263
|
+
async function readLdaErrorMessage(url, headers) {
|
|
264
|
+
try {
|
|
265
|
+
const r = await fetch(url, {
|
|
266
|
+
signal: AbortSignal.timeout(15_000),
|
|
267
|
+
headers,
|
|
268
|
+
redirect: "error",
|
|
269
|
+
});
|
|
270
|
+
const body = (await r.json());
|
|
271
|
+
return summarizeDrfError(body);
|
|
272
|
+
}
|
|
273
|
+
catch {
|
|
274
|
+
return null;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Summarize a Django-REST-Framework 400 error body into a compact string. DRF
|
|
279
|
+
* emits `{ detail: "…" }` OR `{ field: ["message", …], … }`. Returns null for a
|
|
280
|
+
* shape we can't read (⇒ the caller falls back to the generic 400 message).
|
|
281
|
+
*/
|
|
282
|
+
function summarizeDrfError(body) {
|
|
283
|
+
if (typeof body === "string")
|
|
284
|
+
return str(body);
|
|
285
|
+
if (body === null || typeof body !== "object")
|
|
286
|
+
return null;
|
|
287
|
+
const obj = body;
|
|
288
|
+
if (typeof obj.detail === "string")
|
|
289
|
+
return str(obj.detail);
|
|
290
|
+
const parts = [];
|
|
291
|
+
for (const [k, v] of Object.entries(obj)) {
|
|
292
|
+
const msg = Array.isArray(v)
|
|
293
|
+
? v.map((x) => str(x)).filter((x) => x !== null).join("; ")
|
|
294
|
+
: str(v);
|
|
295
|
+
if (msg)
|
|
296
|
+
parts.push(`${k}: ${msg}`);
|
|
297
|
+
}
|
|
298
|
+
return parts.length > 0 ? parts.join(" | ") : null;
|
|
299
|
+
}
|
|
300
|
+
// ─── Small clamps (defensive, behind the server Zod bounds) ────────
|
|
301
|
+
function clampPage(v) {
|
|
302
|
+
if (typeof v !== "number" || !Number.isFinite(v))
|
|
303
|
+
return DEFAULT_PAGE;
|
|
304
|
+
const n = Math.floor(v);
|
|
305
|
+
return n < 1 ? 1 : n;
|
|
306
|
+
}
|
|
307
|
+
function clampPageSize(v) {
|
|
308
|
+
if (typeof v !== "number" || !Number.isFinite(v))
|
|
309
|
+
return DEFAULT_PAGE_SIZE;
|
|
310
|
+
const n = Math.floor(v);
|
|
311
|
+
if (n < 1)
|
|
312
|
+
return 1;
|
|
313
|
+
if (n > MAX_PAGE_SIZE)
|
|
314
|
+
return MAX_PAGE_SIZE;
|
|
315
|
+
return n;
|
|
316
|
+
}
|
|
317
|
+
//# sourceMappingURL=lda.js.map
|
package/dist/lda.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lda.js","sourceRoot":"","sources":["../src/lda.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAsC,MAAM,WAAW,CAAC;AAEzE,8EAA8E;AAC9E,0EAA0E;AAC1E,OAAO,EAAE,GAAG,EAAE,CAAC;AAEf,qEAAqE;AACrE,MAAM,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C5C,OAAO,CAAC,CAAC;AACX,CAAC"}
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;GAgBG;AAQH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,YAAY,EAKb,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;GAgBG;AAQH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,YAAY,EAKb,MAAM,oBAAoB,CAAC;AAimH5B,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,CAAC,CAAC,UAAU,CAAC;IAO1B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE;QAAE,GAAG,EAAE,YAAY,CAAA;KAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACxE,CAAC;AAoBF,eAAO,MAAM,KAAK,EAAE,OAAO,EAkgD1B,CAAC;AA6IF,wBAAsB,OAAO,CAC3B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,GAAG,EAAE,YAAY,GAChB,OAAO,CAAC,OAAO,CAAC,CAalB"}
|