@cyanheads/epa-mcp-server 0.3.3 → 0.4.1
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/AGENTS.md +5 -5
- package/CLAUDE.md +5 -5
- package/Dockerfile +3 -3
- package/README.md +58 -23
- package/changelog/0.4.x/0.4.0.md +35 -0
- package/changelog/0.4.x/0.4.1.md +34 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/resources/definitions/facility.resource.d.ts +8 -1
- package/dist/mcp-server/resources/definitions/facility.resource.d.ts.map +1 -1
- package/dist/mcp-server/resources/definitions/facility.resource.js +13 -7
- package/dist/mcp-server/resources/definitions/facility.resource.js.map +1 -1
- package/dist/mcp-server/resources/definitions/index.d.ts +7 -1
- package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-air-quality.tool.d.ts +23 -9
- package/dist/mcp-server/tools/definitions/get-air-quality.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-air-quality.tool.js +165 -93
- package/dist/mcp-server/tools/definitions/get-air-quality.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-facility.tool.d.ts +30 -2
- package/dist/mcp-server/tools/definitions/get-facility.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-facility.tool.js +211 -53
- package/dist/mcp-server/tools/definitions/get-facility.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-tri-releases.tool.d.ts +5 -2
- package/dist/mcp-server/tools/definitions/get-tri-releases.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-tri-releases.tool.js +18 -15
- package/dist/mcp-server/tools/definitions/get-tri-releases.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +165 -32
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-facilities.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-facilities.tool.js +39 -26
- package/dist/mcp-server/tools/definitions/search-facilities.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-superfund.tool.d.ts +3 -1
- package/dist/mcp-server/tools/definitions/search-superfund.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-superfund.tool.js +13 -9
- package/dist/mcp-server/tools/definitions/search-superfund.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-tri-releases.tool.d.ts +17 -3
- package/dist/mcp-server/tools/definitions/search-tri-releases.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-tri-releases.tool.js +64 -12
- package/dist/mcp-server/tools/definitions/search-tri-releases.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-violations.tool.d.ts +20 -3
- package/dist/mcp-server/tools/definitions/search-violations.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-violations.tool.js +84 -15
- package/dist/mcp-server/tools/definitions/search-violations.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-water-systems.tool.d.ts +3 -1
- package/dist/mcp-server/tools/definitions/search-water-systems.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-water-systems.tool.js +22 -7
- package/dist/mcp-server/tools/definitions/search-water-systems.tool.js.map +1 -1
- package/dist/mcp-server/tools/format-lbs.d.ts +14 -0
- package/dist/mcp-server/tools/format-lbs.d.ts.map +1 -0
- package/dist/mcp-server/tools/format-lbs.js +16 -0
- package/dist/mcp-server/tools/format-lbs.js.map +1 -0
- package/dist/mcp-server/tools/format-location.d.ts +18 -0
- package/dist/mcp-server/tools/format-location.d.ts.map +1 -0
- package/dist/mcp-server/tools/format-location.js +26 -0
- package/dist/mcp-server/tools/format-location.js.map +1 -0
- package/dist/mcp-server/tools/format-tri-release.d.ts +16 -0
- package/dist/mcp-server/tools/format-tri-release.d.ts.map +1 -0
- package/dist/mcp-server/tools/format-tri-release.js +23 -0
- package/dist/mcp-server/tools/format-tri-release.js.map +1 -0
- package/dist/services/airnow/airnow-service.d.ts +10 -29
- package/dist/services/airnow/airnow-service.d.ts.map +1 -1
- package/dist/services/airnow/airnow-service.js +156 -97
- package/dist/services/airnow/airnow-service.js.map +1 -1
- package/dist/services/airnow/types.d.ts +62 -23
- package/dist/services/airnow/types.d.ts.map +1 -1
- package/dist/services/airnow/types.js +2 -1
- package/dist/services/airnow/types.js.map +1 -1
- package/dist/services/call-budget.d.ts +22 -0
- package/dist/services/call-budget.d.ts.map +1 -0
- package/dist/services/call-budget.js +28 -0
- package/dist/services/call-budget.js.map +1 -0
- package/dist/services/dmap/dmap-service.d.ts +76 -7
- package/dist/services/dmap/dmap-service.d.ts.map +1 -1
- package/dist/services/dmap/dmap-service.js +461 -144
- package/dist/services/dmap/dmap-service.js.map +1 -1
- package/dist/services/dmap/types.d.ts +17 -4
- package/dist/services/dmap/types.d.ts.map +1 -1
- package/dist/services/echo/echo-service.d.ts +38 -11
- package/dist/services/echo/echo-service.d.ts.map +1 -1
- package/dist/services/echo/echo-service.js +417 -223
- package/dist/services/echo/echo-service.js.map +1 -1
- package/dist/services/echo/types.d.ts +167 -80
- package/dist/services/echo/types.d.ts.map +1 -1
- package/dist/services/ejscreen/ejscreen-service.d.ts.map +1 -1
- package/dist/services/ejscreen/ejscreen-service.js +9 -3
- package/dist/services/ejscreen/ejscreen-service.js.map +1 -1
- package/package.json +7 -7
- package/server.json +9 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"airnow-service.js","sourceRoot":"","sources":["../../../src/services/airnow/airnow-service.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"airnow-service.js","sourceRoot":"","sources":["../../../src/services/airnow/airnow-service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,GAChB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC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EAAE,CAAC;gBACjB,MAAM,MAAM,qBAAqB,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;YACrE,CAAC;YACD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnC,IAAI,mCAAmC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACnD,MAAM,kBAAkB,CACtB,iEAAiE,CAClE,CAAC;YACJ,CAAC;YACD,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,EACD;YACE,SAAS,EAAE,gBAAgB;YAC3B,WAAW,EAAE,IAAI;YACjB,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,UAAU,EAAE,mBAAmB;SAChC,CACF,CAAC;QAEF,MAAM,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC,CAAC;QAC9E,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,gCAAgC;AAEhC,IAAI,QAAmC,CAAC;AAExC,MAAM,UAAU,iBAAiB,CAAC,MAAiB,EAAE,OAAuB;IAC1E,QAAQ,GAAG,IAAI,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,39 +1,78 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview AirNow API response types and normalized domain types
|
|
2
|
+
* @fileoverview AirNow API response types and normalized domain types for the 2026
|
|
3
|
+
* web services: `observation/current/ziplatlong/` and `forecast/current/`.
|
|
3
4
|
* @module services/airnow/types
|
|
4
5
|
*/
|
|
5
|
-
/**
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
/** Where to look up air quality: a ZIP code, or a latitude/longitude point. */
|
|
7
|
+
export type AirNowLocation = {
|
|
8
|
+
kind: 'zip';
|
|
9
|
+
zipCode: string;
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'latlng';
|
|
12
|
+
latitude: number;
|
|
13
|
+
longitude: number;
|
|
14
|
+
};
|
|
15
|
+
/** Raw record from `observation/current/ziplatlong/` — one pollutant from its closest monitor. */
|
|
16
|
+
export interface RawObservation {
|
|
17
|
+
aqiCategoryName?: string;
|
|
18
|
+
dateObserved?: string;
|
|
19
|
+
/** Local hour as `"HH:00"`. */
|
|
20
|
+
hourObserved?: string;
|
|
21
|
+
localTimeZone?: string;
|
|
22
|
+
nowcastAQI?: number;
|
|
23
|
+
parameterName?: string;
|
|
24
|
+
reportingAgency?: string;
|
|
25
|
+
reportingAreaName?: string;
|
|
26
|
+
siteID?: string;
|
|
27
|
+
siteName?: string;
|
|
28
|
+
}
|
|
29
|
+
/** Raw record from `forecast/current/` — one pollutant for one valid date. */
|
|
30
|
+
export interface RawForecast {
|
|
31
|
+
actionDay?: boolean;
|
|
32
|
+
/** Forecast AQI, or `-1` when the agency issued a category only. */
|
|
33
|
+
aqi?: number;
|
|
34
|
+
categoryName?: string;
|
|
35
|
+
categoryNumber?: number;
|
|
36
|
+
dateIssue?: string;
|
|
37
|
+
dateValid?: string;
|
|
38
|
+
/** Agency discussion, repeated on every row of a reporting area; often empty. */
|
|
39
|
+
discussion?: string;
|
|
40
|
+
forecastAgency?: string;
|
|
41
|
+
parameterName?: string;
|
|
42
|
+
reportingArea?: string;
|
|
43
|
+
reportingAreaCode?: string;
|
|
44
|
+
stateCode?: string;
|
|
20
45
|
}
|
|
21
|
-
/** Normalized AQI reading for a single pollutant. */
|
|
46
|
+
/** Normalized AQI reading for a single pollutant (observation or forecast day). */
|
|
22
47
|
export interface AqiReading {
|
|
23
|
-
|
|
48
|
+
actionDay?: boolean;
|
|
49
|
+
/** Omitted when upstream supplied no AQI number (category-only forecast). */
|
|
50
|
+
aqi?: number;
|
|
24
51
|
categoryName?: string;
|
|
25
52
|
categoryNumber?: number;
|
|
53
|
+
dateIssue?: string;
|
|
54
|
+
dateValid?: string;
|
|
55
|
+
forecastAgency?: string;
|
|
26
56
|
parameterName: string;
|
|
57
|
+
reportingAgency?: string;
|
|
58
|
+
siteID?: string;
|
|
59
|
+
siteName?: string;
|
|
27
60
|
}
|
|
28
|
-
/** Normalized
|
|
29
|
-
export interface
|
|
61
|
+
/** Normalized readings for one reporting area (and, for observations, one observed hour). */
|
|
62
|
+
export interface AirQualityArea {
|
|
30
63
|
dateObserved?: string;
|
|
31
|
-
|
|
32
|
-
|
|
64
|
+
discussion?: string;
|
|
65
|
+
hourObserved?: string;
|
|
33
66
|
localTimeZone?: string;
|
|
34
|
-
longitude?: number;
|
|
35
67
|
readings: AqiReading[];
|
|
36
68
|
reportingArea?: string;
|
|
69
|
+
reportingAreaCode?: string;
|
|
37
70
|
stateCode?: string;
|
|
38
71
|
}
|
|
72
|
+
/** Result of one AirNow lookup. */
|
|
73
|
+
export interface AirQualityLookup {
|
|
74
|
+
areas: AirQualityArea[];
|
|
75
|
+
/** AirNow's own explanation, verbatim, when it answered HTTP 200 with no data for the location. */
|
|
76
|
+
noDataMessage?: string;
|
|
77
|
+
}
|
|
39
78
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/airnow/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/airnow/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,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B,6EAA6E;IAC7E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,6FAA6F;AAC7F,MAAM,WAAW,cAAc;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,mCAAmC;AACnC,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,mGAAmG;IACnG,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview AirNow API response types and normalized domain types
|
|
2
|
+
* @fileoverview AirNow API response types and normalized domain types for the 2026
|
|
3
|
+
* web services: `observation/current/ziplatlong/` and `forecast/current/`.
|
|
3
4
|
* @module services/airnow/types
|
|
4
5
|
*/
|
|
5
6
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/services/airnow/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/services/airnow/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview One wall-clock budget for a service call that chains upstream requests, shared by
|
|
3
|
+
* every request, retry, and backoff the call makes.
|
|
4
|
+
* @module services/call-budget
|
|
5
|
+
*/
|
|
6
|
+
/** The budget a service call threads through each of its requests. */
|
|
7
|
+
export type CallBudget = {
|
|
8
|
+
/** What is left of the budget, for a request's `withRetry` `deadlineMs`. */
|
|
9
|
+
remainingMs: () => number;
|
|
10
|
+
/**
|
|
11
|
+
* Restates an expired budget as one Timeout naming the call and how to narrow it; any other
|
|
12
|
+
* error, caller cancellation included, passes through unchanged.
|
|
13
|
+
*/
|
|
14
|
+
rethrow: (error: unknown) => never;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Start a `deadlineMs` budget for one call to `upstream`. An expiry reads
|
|
18
|
+
* "`{upstream}` did not finish the `{task}` within N seconds. `{narrow}`", since the framework's
|
|
19
|
+
* own message reports only the expiring request's remaining milliseconds.
|
|
20
|
+
*/
|
|
21
|
+
export declare function callBudget(upstream: string, task: string, deadlineMs: number, narrow: string): CallBudget;
|
|
22
|
+
//# sourceMappingURL=call-budget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call-budget.d.ts","sourceRoot":"","sources":["../../src/services/call-budget.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,sEAAsE;AACtE,MAAM,MAAM,UAAU,GAAG;IACvB,4EAA4E;IAC5E,WAAW,EAAE,MAAM,MAAM,CAAC;IAC1B;;;OAGG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,CAAC;CACpC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,UAAU,CAmBZ"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview One wall-clock budget for a service call that chains upstream requests, shared by
|
|
3
|
+
* every request, retry, and backoff the call makes.
|
|
4
|
+
* @module services/call-budget
|
|
5
|
+
*/
|
|
6
|
+
import { McpError, timeout } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
/**
|
|
8
|
+
* Start a `deadlineMs` budget for one call to `upstream`. An expiry reads
|
|
9
|
+
* "`{upstream}` did not finish the `{task}` within N seconds. `{narrow}`", since the framework's
|
|
10
|
+
* own message reports only the expiring request's remaining milliseconds.
|
|
11
|
+
*/
|
|
12
|
+
export function callBudget(upstream, task, deadlineMs, narrow) {
|
|
13
|
+
const startedAt = Date.now();
|
|
14
|
+
return {
|
|
15
|
+
remainingMs: () => Math.max(0, deadlineMs - (Date.now() - startedAt)),
|
|
16
|
+
rethrow: (error) => {
|
|
17
|
+
if (error instanceof McpError && error.data?.reason === 'retry_deadline_exceeded') {
|
|
18
|
+
throw timeout(`${upstream} did not finish the ${task} within ${deadlineMs / 1000} seconds. ${narrow}`, {
|
|
19
|
+
reason: 'retry_deadline_exceeded',
|
|
20
|
+
deadlineMs,
|
|
21
|
+
elapsedMs: Date.now() - startedAt,
|
|
22
|
+
}, { cause: error });
|
|
23
|
+
}
|
|
24
|
+
throw error;
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=call-budget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call-budget.js","sourceRoot":"","sources":["../../src/services/call-budget.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAalE;;;;GAIG;AACH,MAAM,UAAU,UAAU,CACxB,QAAgB,EAChB,IAAY,EACZ,UAAkB,EAClB,MAAc;IAEd,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC7B,OAAO;QACL,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,CAAC;QACrE,OAAO,EAAE,CAAC,KAAc,EAAS,EAAE;YACjC,IAAI,KAAK,YAAY,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,MAAM,KAAK,yBAAyB,EAAE,CAAC;gBAClF,MAAM,OAAO,CACX,GAAG,QAAQ,uBAAuB,IAAI,WAAW,UAAU,GAAG,IAAI,aAAa,MAAM,EAAE,EACvF;oBACE,MAAM,EAAE,yBAAyB;oBACjC,UAAU;oBACV,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;iBAClC,EACD,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;YACJ,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -11,12 +11,43 @@ export declare class DmapService {
|
|
|
11
11
|
private readonly baseUrl;
|
|
12
12
|
constructor(_config: AppConfig, _storage: StorageService);
|
|
13
13
|
/**
|
|
14
|
-
* Build a DMAP REST URL for a multi-filter query.
|
|
15
|
-
* Format: {base}/{schema}.{table}/{col1}/{op1}/{val1}/and/{col2}/{op2}/{val2}/{first}:{last}
|
|
14
|
+
* Build a DMAP REST JSON URL for a multi-filter query.
|
|
15
|
+
* Format: {base}/{schema}.{table}/{col1}/{op1}/{val1}/and/{col2}/{op2}/{val2}/{first}:{last}/json
|
|
16
|
+
* Rows are 1-based and inclusive: `1:50` is 50 rows. DMAP reads a `first` of 0 as row 1, so
|
|
17
|
+
* `0:49` would return only 49.
|
|
18
|
+
*
|
|
19
|
+
* With `join`, an inner join follows the filters:
|
|
20
|
+
* `/join/{schema}.{table}/{leftColumn}/equals/{rightColumn}/and/{filter}…`. Filters before the
|
|
21
|
+
* join bind to the first table only (DMAP rejects a column the first table lacks); filters
|
|
22
|
+
* after the join comparison bind to the joined table. The range then counts joined rows.
|
|
23
|
+
*
|
|
24
|
+
* With `sort`, `/sort/{column}:{asc|desc},…` follows the filters and join, before the range.
|
|
25
|
+
*
|
|
26
|
+
* An `equals` or `in` value goes through exactFilter, so one carrying a character DMAP cannot
|
|
27
|
+
* match throws a ValidationError naming it; `contains` values arrive already rewritten by
|
|
28
|
+
* containsFilter.
|
|
16
29
|
*/
|
|
17
30
|
private buildTableUrl;
|
|
18
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* Fetch a DMAP table result as JSON array. Every attempt and backoff ends within `budget`
|
|
33
|
+
* (shared by every request of one service call); expiry rejects with the budget's Timeout.
|
|
34
|
+
*
|
|
35
|
+
* A request line DMAP would count past DMAP_REQUEST_LINE_LIMIT is never sent: batched `in`
|
|
36
|
+
* lists are chunked to fit, so only caller-supplied filter text can push one over, and it fails
|
|
37
|
+
* as a ValidationError. DMAP answers HTTP 400 only from its front end, for a request it cannot
|
|
38
|
+
* parse, never for a filter value — those are HTTP 500. A 400 that still arrives is a request
|
|
39
|
+
* this server built wrong, not the caller's input, and maps to InternalError rather than the
|
|
40
|
+
* default InvalidParams.
|
|
41
|
+
*/
|
|
19
42
|
private fetchTable;
|
|
43
|
+
/**
|
|
44
|
+
* Fetch up to `wanted` rows. Without a wildcarded filter (containsFilter) that is one request
|
|
45
|
+
* ranged `1:wanted`. With one, DMAP's rows can include near-variants that match only through the
|
|
46
|
+
* wildcard, so pages of at least EXACT_TEXT_PAGE_ROWS are read and narrowed to rows containing
|
|
47
|
+
* the text as given, until `wanted` are found, DMAP runs out, or EXACT_TEXT_MAX_PAGES are read.
|
|
48
|
+
* A walk the page limit ends short of `wanted` carries a notice that more matches may exist.
|
|
49
|
+
*/
|
|
50
|
+
private fetchMatchingRows;
|
|
20
51
|
/** Get TRI releases for a specific facility. */
|
|
21
52
|
getTriReleases(params: {
|
|
22
53
|
facilityId: string;
|
|
@@ -24,24 +55,46 @@ export declare class DmapService {
|
|
|
24
55
|
chemicalName?: string;
|
|
25
56
|
}, ctx: Context): Promise<TriRelease[]>;
|
|
26
57
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
|
|
58
|
+
* Add each release's per-medium routine breakdown (tri.tri_release_qty, joined on doc_ctrl_num).
|
|
59
|
+
* `releases[i]` is the normalized form of `rows[i]`.
|
|
60
|
+
*/
|
|
61
|
+
private withReleaseBreakdown;
|
|
62
|
+
/**
|
|
63
|
+
* Fetch the per-medium routine releases (tri.tri_release_qty) for a set of TRI submissions and
|
|
64
|
+
* roll them up into air/water/land/underground-injection sums keyed by doc_ctrl_num.
|
|
65
|
+
* getTriReleases does this on every call; searchTriReleases only when includeReleaseBreakdown
|
|
66
|
+
* is set — an uncached tri_release_qty request takes ~18 s upstream.
|
|
67
|
+
*
|
|
68
|
+
* The submissions travel as one `doc_ctrl_num in` list per request, split so each request line
|
|
69
|
+
* stays within IN_LIST_REQUEST_LINE_BUDGET (about 230 thirteen-digit numbers per request). The
|
|
70
|
+
* chunks run BREAKDOWN_CONCURRENCY at a time against the call's deadline, and their rows merge
|
|
71
|
+
* into one rollup; the lists are disjoint, so no row is counted twice.
|
|
30
72
|
*
|
|
31
73
|
* Sparsity is preserved: a row flagged release_na="1" (medium not applicable) or carrying only
|
|
32
74
|
* a release_range_code (no hard total_release) contributes nothing — a null quantity is never
|
|
33
75
|
* coerced to 0.
|
|
34
76
|
*/
|
|
35
77
|
private fetchReleaseBreakdown;
|
|
36
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* Search TRI releases by state, optionally filtered by county, year, or chemical.
|
|
80
|
+
* tri.tri_reporting_form carries no state, so one request joins it to tri.tri_facility: the
|
|
81
|
+
* state and county filters bind to the facility table, the year and chemical filters to the
|
|
82
|
+
* forms, and the row range caps the joined rows at `limit`. Without `year` the joined rows are
|
|
83
|
+
* sorted newest reporting year first, so `limit` keeps the most recent filings; with `year` the
|
|
84
|
+
* request is unsorted (table order already pages deterministically). However sparse the
|
|
85
|
+
* filters, the search is one request; with includeReleaseBreakdown, fetchReleaseBreakdown adds
|
|
86
|
+
* the per-medium routine releases to every kept record (one request at the 200-record cap).
|
|
87
|
+
*/
|
|
37
88
|
searchTriReleases(params: {
|
|
38
89
|
state: string;
|
|
39
90
|
county?: string;
|
|
40
91
|
year?: number;
|
|
41
92
|
chemicalName?: string;
|
|
42
93
|
limit?: number;
|
|
94
|
+
includeReleaseBreakdown?: boolean;
|
|
43
95
|
}, ctx: Context): Promise<(TriRelease & {
|
|
44
96
|
facilityName?: string;
|
|
97
|
+
countyName?: string;
|
|
45
98
|
})[]>;
|
|
46
99
|
/** Search Superfund sites by state or coordinates + radius. */
|
|
47
100
|
searchSuperfund(params: {
|
|
@@ -64,6 +117,22 @@ export declare class DmapService {
|
|
|
64
117
|
pwsType?: string;
|
|
65
118
|
limit?: number;
|
|
66
119
|
}, ctx: Context): Promise<WaterSystem[]>;
|
|
120
|
+
/**
|
|
121
|
+
* Water systems in `state` with an open violation. water_system has no violation flag, so this
|
|
122
|
+
* reads the first VIOLATION_SCAN_ROWS open rows of sdwis.violation, then looks up the systems
|
|
123
|
+
* those rows name, PWSID_CHUNK_SIZE IDs per `pwsid in` request, until `limit` is filled. That is
|
|
124
|
+
* at most 1 + VIOLATION_SCAN_ROWS / PWSID_CHUNK_SIZE requests. A state with more open violation
|
|
125
|
+
* rows than the scan reads can have violators it never sees; the result then carries a notice.
|
|
126
|
+
*/
|
|
127
|
+
private searchViolatingWaterSystems;
|
|
128
|
+
/**
|
|
129
|
+
* Water systems in `zipCode` with an open violation. sdwis.violation has no zip column, so this
|
|
130
|
+
* reads the ZIP's systems (up to ZIP_SYSTEM_SCAN_ROWS), then asks sdwis.violation for their open
|
|
131
|
+
* rows PWSID_CHUNK_SIZE IDs at a time, in ZIP order, until `limit` violators are found. A ZIP
|
|
132
|
+
* past the system read, or a chunk whose violation rows fill VIOLATION_SCAN_ROWS, can hide
|
|
133
|
+
* violators; the result then carries a notice.
|
|
134
|
+
*/
|
|
135
|
+
private searchViolatingWaterSystemsInZip;
|
|
67
136
|
}
|
|
68
137
|
export declare function initDmapService(config: AppConfig, storage: StorageService): void;
|
|
69
138
|
export declare function getDmapService(): DmapService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dmap-service.d.ts","sourceRoot":"","sources":["../../../src/services/dmap/dmap-service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"dmap-service.d.ts","sourceRoot":"","sources":["../../../src/services/dmap/dmap-service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAM/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAIrE,OAAO,KAAK,EAOV,aAAa,EACb,UAAU,EACV,WAAW,EACZ,MAAM,YAAY,CAAC;AA6UpB,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IAEjC,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAEvD;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,aAAa;IA4BrB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,UAAU;IAwClB;;;;;;OAMG;YACW,iBAAiB;IA+C/B,gDAAgD;IAC1C,cAAc,CAClB,MAAM,EAAE;QACN,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,EACD,GAAG,EAAE,OAAO,GACX,OAAO,CAAC,UAAU,EAAE,CAAC,CA0Bv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