townshipamerica 2.0.0 → 2.1.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.md CHANGED
@@ -198,7 +198,7 @@ const fc = await client.raw("NW 25 24N 1E 6th Meridian");
198
198
 
199
199
  Energy parcel report for a PLSS section — state-regulator wells, operators,
200
200
  BLM federal leases, ONRR county royalties, orphaned wells, pipelines,
201
- FracFocus disclosures, and development constraints.
201
+ FracFocus disclosures, development constraints, and renewable siting.
202
202
 
203
203
  ```typescript
204
204
  const report = await client.energyReport("25 24N 1E 6th Meridian");
@@ -217,12 +217,46 @@ const withGeometry = await client.energyReport("25 24N 1E 6th Meridian", {
217
217
  ```
218
218
 
219
219
  **Options:** `include` — any of `wells`, `operators`, `leases`, `royalties`,
220
- `orphaned_wells`, `pipelines`, `fracfocus`, `constraints`, `geometry`.
220
+ `orphaned_wells`, `pipelines`, `fracfocus`, `constraints`, `renewables`,
221
+ `geometry`.
221
222
 
222
223
  **Returns:** `EnergyReport`. Array sections are
223
224
  `{total, returned, truncated, more, rows}` envelopes; a failed section lands
224
225
  in `meta.unavailable` instead of failing the report.
225
226
 
227
+ #### Renewable siting (`include: ["renewables"]`)
228
+
229
+ ```typescript
230
+ const siting = await client.energyReport("25 24N 1E 6th Meridian", {
231
+ include: ["renewables"]
232
+ });
233
+ const r = siting.renewables;
234
+ console.log(siting.summary.nearest_transmission_100kv_plus_miles);
235
+ console.log(r?.grid?.nearest_substation_230kv_plus?.distance_miles);
236
+ console.log(r?.nrel?.find((c) => c.technology === "solar")?.lcoe_all_in_usd_per_mwh);
237
+ console.log(r?.interconnection_queue?.active_requests);
238
+
239
+ // Each part fails on its own: it is null and listed in meta.unavailable
240
+ const failed = siting.meta.unavailable.filter((u) => u.section.startsWith("renewables."));
241
+ ```
242
+
243
+ `renewables` has nine parts — `grid`, `projects`, `nrel`,
244
+ `lesser_prairie_chicken`, `aviation`, `blm`, `obstacles`, `whooping_crane`,
245
+ `interconnection_queue` — and any of them may be `null` (a failed part is
246
+ listed in `meta.unavailable` as `{section: "renewables.<part>", reason}`).
247
+ `summary` gains `nearest_transmission_100kv_plus_miles` and
248
+ `nearest_substation_230kv_plus_miles`.
249
+
250
+ - Substations are **inferred** from ORNL/HIFLD transmission-line endpoints
251
+ (no open federal substation layer exists); every substation row carries
252
+ `inferred: true`.
253
+ - NREL supply-curve values describe the surrounding 11.5 km cell, not the
254
+ section itself. NREL (`nrel`) and LBNL Queued Up (`interconnection_queue`)
255
+ values are licensed CC-BY 4.0; attribute them when you redistribute.
256
+ - The interconnection queue is county-level (`scope: "county"`).
257
+ - Lesser prairie-chicken habitat is the WAFWA range-wide plan, not ESA
258
+ critical habitat.
259
+
226
260
  ---
227
261
 
228
262
  ### `client.federalLandReport(legalLocation, options?)`
@@ -364,6 +398,17 @@ try {
364
398
  }
365
399
  ```
366
400
 
401
+ ## What's new in v2.1.0
402
+
403
+ - `energyReport` accepts `include: ["renewables"]` and types the new
404
+ `renewables` section (`EnergyRenewables` and its part types: grid
405
+ proximity with inferred substations, EIA-860M generators, USPVDB
406
+ footprints, USGS turbines, NREL 2024 supply-curve cells, lesser
407
+ prairie-chicken habitat, FAA aviation and obstacles, BLM designations
408
+ and ROW cases, whooping crane corridor, LBNL interconnection queue).
409
+ - `EnergySummary` gains `nearest_transmission_100kv_plus_miles` and
410
+ `nearest_substation_230kv_plus_miles`.
411
+
367
412
  ## What's new in v2.0.0
368
413
 
369
414
  v2.0.0 adds the parcel-report APIs:
package/dist/index.cjs CHANGED
@@ -117,7 +117,7 @@ var TownshipClient = class {
117
117
  ...init,
118
118
  headers: {
119
119
  "X-API-Key": this.apiKey,
120
- "User-Agent": "townshipamerica-js/2.0.0",
120
+ "User-Agent": "townshipamerica-js/2.1.0",
121
121
  ...init?.headers ?? {}
122
122
  },
123
123
  signal: controller.signal
@@ -337,7 +337,9 @@ var TownshipClient = class {
337
337
  /**
338
338
  * Get the energy parcel report for a PLSS section. Covers state-regulator
339
339
  * wells, operators, federal leases, county royalties, orphaned wells,
340
- * pipelines, FracFocus disclosures, and development constraints.
340
+ * pipelines, FracFocus disclosures, development constraints, and
341
+ * renewable siting (grid proximity, generators, NREL supply curve,
342
+ * wildlife, aviation, BLM designations, obstacles, interconnection queue).
341
343
  *
342
344
  * @param legalLocation - A PLSS legal description, e.g. "NW 25 24N 1E 6th Meridian"
343
345
  * @param options - Optional section projection (`include`)
@@ -353,6 +355,12 @@ var TownshipClient = class {
353
355
  * const slim = await client.energyReport('25 24N 1E 6th Meridian', {
354
356
  * include: ['wells', 'pipelines']
355
357
  * })
358
+ *
359
+ * // Renewable siting only
360
+ * const siting = await client.energyReport('25 24N 1E 6th Meridian', {
361
+ * include: ['renewables']
362
+ * })
363
+ * console.log(siting.renewables?.grid?.nearest_line_100kv_plus?.distance_miles)
356
364
  * ```
357
365
  */
358
366
  async energyReport(legalLocation, options) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/errors.ts","../src/client.ts"],"sourcesContent":["export { TownshipClient } from \"./client.js\";\nexport {\n TownshipError,\n AuthenticationError,\n NotFoundError,\n RateLimitError,\n ValidationError,\n PayloadTooLargeError\n} from \"./errors.js\";\nexport type {\n TownshipClientOptions,\n GeoJSONPoint,\n GeoJSONPolygon,\n GeoJSONMultiPolygon,\n GeoJSONBoundary,\n GeoJSONFeature,\n GeoJSONFeatureCollection,\n FeatureProperties,\n Unit,\n SurveySystem,\n SearchResult,\n ReverseOptions,\n AutocompleteOptions,\n BatchSearchOptions,\n BatchReverseOptions,\n // Shared report types\n LatLng,\n EntityRef,\n SectionEnvelope,\n UnavailableSection,\n SectionSource,\n ReportMeta,\n ReportParcel,\n // Energy API\n EnergyReportSection,\n EnergyReportOptions,\n EnergyWellRow,\n EnergyOrphanedWellRow,\n EnergyLeaseRow,\n EnergyOperatorRow,\n EnergyRoyaltyItem,\n EnergyRoyalties,\n EnergyPipelineRow,\n FracFocusRow,\n EnergySplitEstateSide,\n EnergySplitEstate,\n EnergySageGrouseHabitat,\n EnergySageGrouse,\n EnergyRenewableSiting,\n EnergyConstraints,\n EnergySummary,\n EnergyWells,\n EnergyReport,\n // Federal Land API\n FederalLandReportSection,\n FederalLandReportOptions,\n SurfaceManagementRow,\n FederalLeaseRow,\n RightOfWayRow,\n FloodZoneRow,\n MiningClaimRow,\n WetlandRow,\n FireshedRow,\n SoilRow,\n OrphanedWellRow,\n CriticalHabitatRow,\n PublicAccessRow,\n WildfireRiskRow,\n CropHistory,\n Elevation,\n FederalLandReport,\n // Texas API\n TexasReportSection,\n TexasReportOptions,\n TexasStateLeaseRow,\n TexasStateUnitRow,\n TexasPsfLandRow,\n TexasStateAgencyLandRow,\n TexasUplandLeaseRow,\n TexasActiveWellRow,\n TexasPipelineRow,\n TexasPendingPermitRow,\n TexasCoastalErosionRow,\n TexasMonthlyVolume,\n TexasProductionLease,\n TexasAbstractRef,\n TexasProductionSummary,\n TexasProductionBlock,\n TexasProduction,\n TexasReport,\n TexasProductionOptions,\n TexasWellLocation,\n TexasWellUnit,\n TexasWellSeriesPoint,\n TexasDeclineFit,\n TexasDecline,\n TexasDeclineCurvePoint,\n TexasWellSeriesUnit,\n TexasWell\n} from \"./types.js\";\n","/**\n * Base error class for all Township SDK errors.\n *\n * `code` carries the machine-readable error code the Energy, Federal Land,\n * and Texas APIs return in v1 error bodies (`{\"error\": {\"code\", \"message\"}}`),\n * e.g. `invalid_parameter`, `missing_parameter`, `plss_not_supported`,\n * `ambiguous_location`, `not_found`, `rate_limit_exceeded`. It is null for\n * endpoints that do not send one.\n */\nexport class TownshipError extends Error {\n constructor(\n message: string,\n public readonly statusCode: number | null = null,\n public readonly code: string | null = null\n ) {\n super(message);\n this.name = \"TownshipError\";\n }\n}\n\n/**\n * Thrown when the API key is missing or invalid (HTTP 401).\n */\nexport class AuthenticationError extends TownshipError {\n constructor(message = \"Invalid or missing API key\", code: string | null = null) {\n super(message, 401, code);\n this.name = \"AuthenticationError\";\n }\n}\n\n/**\n * Thrown when no result is found for the given input.\n */\nexport class NotFoundError extends TownshipError {\n constructor(message = \"Location not found\", code: string | null = null) {\n super(message, 404, code);\n this.name = \"NotFoundError\";\n }\n}\n\n/**\n * Thrown when the API rate limit is exceeded (HTTP 429).\n */\nexport class RateLimitError extends TownshipError {\n constructor(\n message = \"Rate limit exceeded. Please slow down your requests.\",\n code: string | null = null\n ) {\n super(message, 429, code);\n this.name = \"RateLimitError\";\n }\n}\n\n/**\n * Thrown when the request is malformed (HTTP 400).\n */\nexport class ValidationError extends TownshipError {\n constructor(message = \"Invalid request\", code: string | null = null) {\n super(message, 400, code);\n this.name = \"ValidationError\";\n }\n}\n\n/**\n * Thrown when the batch payload exceeds the maximum size (HTTP 413).\n */\nexport class PayloadTooLargeError extends TownshipError {\n constructor(\n message = \"Batch payload exceeds the maximum of 100 records per request\",\n code: string | null = null\n ) {\n super(message, 413, code);\n this.name = \"PayloadTooLargeError\";\n }\n}\n","import {\n AuthenticationError,\n NotFoundError,\n PayloadTooLargeError,\n RateLimitError,\n TownshipError,\n ValidationError\n} from \"./errors.js\";\nimport type {\n AutocompleteOptions,\n BatchReverseOptions,\n BatchSearchOptions,\n EnergyReport,\n EnergyReportOptions,\n FederalLandReport,\n FederalLandReportOptions,\n GeoJSONBoundary,\n GeoJSONFeatureCollection,\n ReverseOptions,\n SearchResult,\n TexasProduction,\n TexasProductionOptions,\n TexasReport,\n TexasReportOptions,\n TexasWell,\n TownshipClientOptions\n} from \"./types.js\";\n\nconst DEFAULT_BASE_URL = \"https://developer.townshipamerica.com\";\nconst DEFAULT_TIMEOUT = 30_000;\nconst MAX_BATCH_SIZE = 100;\n\nfunction toSearchResult(fc: GeoJSONFeatureCollection): SearchResult {\n const centroid = fc.features.find((f) => f.properties.shape === \"centroid\");\n const grid = fc.features.find((f) => f.properties.shape === \"grid\");\n\n const props = centroid?.properties ?? grid?.properties;\n if (!props) {\n throw new TownshipError(\"Unexpected API response: no features returned\");\n }\n\n const [lng, lat] = centroid ? (centroid.geometry.coordinates as [number, number]) : [0, 0];\n\n return {\n legalLocation: props.legal_location,\n latitude: lat,\n longitude: lng,\n state: props.state,\n county: props.county,\n unit: props.unit,\n surveySystem: props.survey_system,\n alternateLegalLocation: props.alternate_legal_location,\n boundary: grid ? (grid.geometry as GeoJSONBoundary) : null,\n raw: fc\n };\n}\n\nexport class TownshipClient {\n private readonly baseUrl: string;\n private readonly apiKey: string;\n private readonly timeout: number;\n\n constructor(options: TownshipClientOptions) {\n this.apiKey = options.apiKey;\n this.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\\/+$/, \"\");\n this.timeout = options.timeout ?? DEFAULT_TIMEOUT;\n\n if (!this.apiKey) {\n throw new TownshipError(\"apiKey is required\");\n }\n }\n\n // --- Internal ---\n\n private async request<T>(path: string, init?: RequestInit): Promise<T> {\n const url = `${this.baseUrl}${path}`;\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), this.timeout);\n\n try {\n const response = await fetch(url, {\n ...init,\n headers: {\n \"X-API-Key\": this.apiKey,\n \"User-Agent\": \"townshipamerica-js/2.0.0\",\n ...(init?.headers ?? {})\n },\n signal: controller.signal\n });\n\n if (!response.ok) {\n await this.handleError(response);\n }\n\n return (await response.json()) as T;\n } catch (error) {\n if (error instanceof TownshipError) throw error;\n if (error instanceof DOMException && error.name === \"AbortError\") {\n throw new TownshipError(\"Request timed out\");\n }\n throw new TownshipError(error instanceof Error ? error.message : \"Unknown error\");\n } finally {\n clearTimeout(timer);\n }\n }\n\n private async handleError(response: Response): Promise<never> {\n let message: string;\n let code: string | null = null;\n try {\n const body = (await response.json()) as {\n error?: { code?: string; message?: string } | string;\n message?: string;\n };\n // Energy/Federal Land/Texas v1 error bodies are {\"error\": {\"code\", \"message\"}}\n if (body.error && typeof body.error === \"object\") {\n message = body.error.message ?? response.statusText;\n code = body.error.code ?? null;\n } else {\n message =\n (typeof body.error === \"string\" ? body.error : undefined) ??\n body.message ??\n response.statusText;\n }\n } catch {\n message = response.statusText;\n }\n\n const status = response.status;\n if (status === 400) throw new ValidationError(message, code);\n if (status === 401) throw new AuthenticationError(message, code);\n if (status === 404) throw new NotFoundError(message, code);\n if (status === 413) throw new PayloadTooLargeError(message, code);\n if (status === 429) throw new RateLimitError(message, code);\n throw new TownshipError(message, status, code);\n }\n\n // --- Search ---\n\n /**\n * Convert a PLSS or Texas TXSS legal land description to GPS coordinates.\n *\n * @param legalLocation - e.g. \"NW 25 24N 1E 6th Meridian\" or \"A-175 Reeves County\"\n * @returns A SearchResult with coordinates, boundary, and metadata.\n * @throws {ValidationError} If the location string is invalid.\n * @throws {NotFoundError} If no match is found.\n */\n async search(legalLocation: string): Promise<SearchResult> {\n const params = new URLSearchParams({ location: legalLocation });\n const data = await this.request<GeoJSONFeatureCollection | Record<string, never>>(\n `/search/legal-location?${params}`\n );\n\n if (!(\"features\" in data) || !data.features?.length) {\n throw new NotFoundError(`No results found for \"${legalLocation}\"`);\n }\n\n return toSearchResult(data as GeoJSONFeatureCollection);\n }\n\n /**\n * Find the legal land description at the given GPS coordinates (PLSS or Texas TXSS).\n *\n * @param longitude - Longitude (x) coordinate.\n * @param latitude - Latitude (y) coordinate.\n * @param options - Optional PLSS unit filter (ignored for TXSS results).\n * @returns A SearchResult or array of SearchResults (when unit is 'all').\n */\n async reverse(\n longitude: number,\n latitude: number,\n options?: ReverseOptions\n ): Promise<SearchResult | SearchResult[]> {\n const params = new URLSearchParams({\n location: `${longitude},${latitude}`\n });\n if (options?.unit) {\n params.set(\"unit\", options.unit);\n }\n\n const data = await this.request<GeoJSONFeatureCollection | Record<string, never>>(\n `/search/coordinates?${params}`\n );\n\n if (!(\"features\" in data) || !data.features?.length) {\n throw new NotFoundError(`No results found for coordinates [${longitude}, ${latitude}]`);\n }\n\n const fc = data as GeoJSONFeatureCollection;\n\n if (options?.unit === \"all\") {\n const groups = new Map<string, typeof fc.features>();\n for (const feature of fc.features) {\n const key = feature.properties.legal_location;\n if (!groups.has(key)) groups.set(key, []);\n groups.get(key)!.push(feature);\n }\n\n return Array.from(groups.values()).map((features) => {\n return toSearchResult({ type: \"FeatureCollection\", features });\n });\n }\n\n return toSearchResult(fc);\n }\n\n // --- Autocomplete ---\n\n /**\n * Get autocomplete suggestions for a partial PLSS or Texas TXSS description.\n *\n * @param query - Partial search query (minimum 2 characters).\n * @param options - Optional limit (1–10, default 3) and proximity.\n * @returns Raw GeoJSON FeatureCollection with suggestion features.\n */\n async autocomplete(\n query: string,\n options?: AutocompleteOptions\n ): Promise<GeoJSONFeatureCollection> {\n const params = new URLSearchParams({ location: query });\n if (options?.limit != null) {\n params.set(\"limit\", String(options.limit));\n }\n if (options?.proximity) {\n params.set(\"proximity\", `${options.proximity[0]},${options.proximity[1]}`);\n }\n\n return this.request<GeoJSONFeatureCollection>(`/autocomplete/legal-location?${params}`);\n }\n\n // --- Batch ---\n\n /**\n * Convert multiple legal land descriptions to GPS coordinates in one request.\n * Auto-chunks if more than 100 items. Mix PLSS and Texas TXSS inputs freely.\n *\n * @param locations - Array of legal land descriptions.\n * @param options - Optional chunk size.\n * @returns Array of SearchResult or null for each input.\n */\n async batchSearch(\n locations: string[],\n options?: BatchSearchOptions\n ): Promise<(SearchResult | null)[]> {\n const chunkSize = Math.min(options?.chunkSize ?? MAX_BATCH_SIZE, MAX_BATCH_SIZE);\n const results: (SearchResult | null)[] = [];\n\n for (let i = 0; i < locations.length; i += chunkSize) {\n const chunk = locations.slice(i, i + chunkSize);\n const data = await this.request<(GeoJSONFeatureCollection | null)[]>(\n \"/batch/legal-location\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(chunk)\n }\n );\n\n for (const fc of data) {\n if (!fc || !fc.features?.length) {\n results.push(null);\n } else {\n results.push(toSearchResult(fc));\n }\n }\n }\n\n return results;\n }\n\n /**\n * Find legal land descriptions for multiple coordinate pairs in one request.\n * Auto-chunks if more than 100 items.\n *\n * @param coordinates - Array of [longitude, latitude] pairs.\n * @param options - Optional PLSS unit filter and chunk size.\n * @returns Array of SearchResult or null for each input.\n */\n async batchReverse(\n coordinates: [number, number][],\n options?: BatchReverseOptions\n ): Promise<(SearchResult | null)[]> {\n const chunkSize = Math.min(options?.chunkSize ?? MAX_BATCH_SIZE, MAX_BATCH_SIZE);\n const results: (SearchResult | null)[] = [];\n\n for (let i = 0; i < coordinates.length; i += chunkSize) {\n const chunk = coordinates.slice(i, i + chunkSize);\n const body: Record<string, unknown> = { coordinates: chunk };\n if (options?.unit) {\n body.unit = options.unit;\n }\n\n const data = await this.request<\n (GeoJSONFeatureCollection | null)[] | GeoJSONFeatureCollection\n >(\"/batch/coordinates\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(body)\n });\n\n if (Array.isArray(data)) {\n for (const fc of data) {\n if (!fc || !fc.features?.length) {\n results.push(null);\n } else {\n results.push(toSearchResult(fc));\n }\n }\n } else if (data && \"features\" in data) {\n // unit=all returns a single FeatureCollection — split by legal_location\n const groups = new Map<string, typeof data.features>();\n for (const feature of data.features) {\n const key = JSON.stringify(feature.properties.search_term);\n if (!groups.has(key)) groups.set(key, []);\n groups.get(key)!.push(feature);\n }\n for (const features of groups.values()) {\n results.push(toSearchResult({ type: \"FeatureCollection\", features }));\n }\n }\n }\n\n return results;\n }\n\n // --- Convenience ---\n\n /**\n * Get the boundary polygon for a legal land description.\n *\n * @param legalLocation - e.g. \"NW 25 24N 1E 6th Meridian\"\n * @returns The boundary GeoJSON Polygon, or null if not found.\n */\n async boundary(legalLocation: string): Promise<GeoJSONBoundary | null> {\n const result = await this.search(legalLocation);\n return result.boundary;\n }\n\n /**\n * Get the raw GeoJSON FeatureCollection for a legal land description.\n *\n * @param legalLocation - e.g. \"NW 25 24N 1E 6th Meridian\"\n * @returns The raw GeoJSON FeatureCollection from the API.\n */\n async raw(legalLocation: string): Promise<GeoJSONFeatureCollection> {\n const params = new URLSearchParams({ location: legalLocation });\n const data = await this.request<GeoJSONFeatureCollection | Record<string, never>>(\n `/search/legal-location?${params}`\n );\n\n if (!(\"features\" in data)) {\n return { type: \"FeatureCollection\", features: [] };\n }\n\n return data as GeoJSONFeatureCollection;\n }\n\n // --- Energy API ---\n\n /**\n * Get the energy parcel report for a PLSS section. Covers state-regulator\n * wells, operators, federal leases, county royalties, orphaned wells,\n * pipelines, FracFocus disclosures, and development constraints.\n *\n * @param legalLocation - A PLSS legal description, e.g. \"NW 25 24N 1E 6th Meridian\"\n * @param options - Optional section projection (`include`)\n * @returns The energy report\n *\n * @example\n * ```ts\n * const report = await client.energyReport('25 24N 1E 6th Meridian')\n * console.log(report.summary.wells_in_section)\n * console.log(report.wells?.in_section.rows[0]?.api_number)\n *\n * // Only the sections you need — the rest are never queried\n * const slim = await client.energyReport('25 24N 1E 6th Meridian', {\n * include: ['wells', 'pipelines']\n * })\n * ```\n */\n async energyReport(legalLocation: string, options?: EnergyReportOptions): Promise<EnergyReport> {\n const params = new URLSearchParams({ legal_location: legalLocation });\n if (options?.include?.length) params.set(\"include\", options.include.join(\",\"));\n return this.request<EnergyReport>(`/energy/report?${params}`);\n }\n\n // --- Federal Land API ---\n\n /**\n * Get the federal-land parcel report for a PLSS tract. Covers surface\n * management, BLM leases and rights-of-way, flood zones, mining claims,\n * wetlands, firesheds, soils, crop history, orphaned wells, critical\n * habitat, public access, wildfire risk, and elevation.\n *\n * @param legalLocation - A PLSS legal description, e.g. \"NW 25 24N 1E 6th Meridian\"\n * @param options - Optional section projection (`include`)\n * @returns The federal-land report\n *\n * @example\n * ```ts\n * const report = await client.federalLandReport('NW 25 24N 1E 6th Meridian')\n * console.log(report.surface_management?.rows[0]?.agency)\n *\n * // Only the sections you need — the pruned layers' queries never run\n * const slim = await client.federalLandReport('NW 25 24N 1E 6th Meridian', {\n * include: ['og_leases', 'flood_zones']\n * })\n * ```\n */\n async federalLandReport(\n legalLocation: string,\n options?: FederalLandReportOptions\n ): Promise<FederalLandReport> {\n const params = new URLSearchParams({ legal_location: legalLocation });\n if (options?.include?.length) params.set(\"include\", options.include.join(\",\"));\n return this.request<FederalLandReport>(`/federal-land/report?${params}`);\n }\n\n // --- Texas API ---\n\n /**\n * Get the Texas abstract report for a TXSS legal description. Covers GLO\n * state leases and units, PSF lands, RRC wells and pipelines, pending\n * permits, coastal erosion, federal overlays, and RRC lease production.\n *\n * @param legalLocation - A Texas legal description, e.g. \"A-175 Reeves County\"\n * @param options - Optional section projection (`include`)\n * @returns The Texas report\n *\n * @example\n * ```ts\n * const report = await client.texasReport('A-175 Reeves County')\n * console.log(report.active_wells?.rows[0]?.api_number)\n * console.log(report.production?.summary.total_cum_boe)\n *\n * // Only the sections you need — the rest are never queried\n * const slim = await client.texasReport('A-175 Reeves County', {\n * include: ['state_leases', 'production']\n * })\n * ```\n */\n async texasReport(legalLocation: string, options?: TexasReportOptions): Promise<TexasReport> {\n const params = new URLSearchParams({ legal_location: legalLocation });\n if (options?.include?.length) params.set(\"include\", options.include.join(\",\"));\n return this.request<TexasReport>(`/texas/report?${params}`);\n }\n\n /**\n * Get RRC lease production for a Texas abstract — per-lease lifetime\n * totals, trailing-12-month volumes, and the 60-month monthly series.\n * Production is reported by RRC at the LEASE level: rows are the leases\n * whose wells fall on the abstract, never sub-allocated to the tract.\n *\n * @param options - Either `{legalLocation}` or `{countyFips, abstractNo, blockNo?}`\n * @returns The abstract production rollup\n *\n * @example\n * ```ts\n * const byLocation = await client.texasProduction({ legalLocation: 'A-175 Reeves County' })\n * const byKeys = await client.texasProduction({ countyFips: '48389', abstractNo: '175' })\n * console.log(byKeys.summary.total_cum_boe)\n * ```\n */\n async texasProduction(options: TexasProductionOptions): Promise<TexasProduction> {\n const params = new URLSearchParams();\n if (options.legalLocation != null) {\n params.set(\"legal_location\", options.legalLocation);\n } else if (options.countyFips != null && options.abstractNo != null) {\n params.set(\"county_fips\", options.countyFips);\n params.set(\"abstract_no\", options.abstractNo);\n if (options.blockNo != null) params.set(\"block_no\", options.blockNo);\n } else {\n throw new TownshipError(\n \"texasProduction requires either legalLocation or countyFips + abstractNo\"\n );\n }\n return this.request<TexasProduction>(`/texas/production?${params}`);\n }\n\n /**\n * Get per-well allocated production for a Texas well by API number —\n * summary scalars for every lease edge, the monthly series (when\n * provisioned), and an Arps decline fit. Volumes are allocated estimates:\n * RRC reports production by lease, never by well.\n *\n * @param api - API-8 or API-14 number (e.g. \"42-389-32345\" or \"42389323450000\")\n * @returns The well's units, series, and decline analysis\n *\n * @example\n * ```ts\n * const well = await client.texasWell('42-389-32345')\n * console.log(well.units[0]?.cum_boe)\n * console.log(well.decline.available && well.decline.value?.di)\n * ```\n */\n async texasWell(api: string): Promise<TexasWell> {\n return this.request<TexasWell>(`/texas/wells/${encodeURIComponent(api)}`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACSO,IAAM,gBAAN,cAA4B,MAAM;AAAA,EACvC,YACE,SACgB,aAA4B,MAC5B,OAAsB,MACtC;AACA,UAAM,OAAO;AAHG;AACA;AAGhB,SAAK,OAAO;AAAA,EACd;AACF;AAKO,IAAM,sBAAN,cAAkC,cAAc;AAAA,EACrD,YAAY,UAAU,8BAA8B,OAAsB,MAAM;AAC9E,UAAM,SAAS,KAAK,IAAI;AACxB,SAAK,OAAO;AAAA,EACd;AACF;AAKO,IAAM,gBAAN,cAA4B,cAAc;AAAA,EAC/C,YAAY,UAAU,sBAAsB,OAAsB,MAAM;AACtE,UAAM,SAAS,KAAK,IAAI;AACxB,SAAK,OAAO;AAAA,EACd;AACF;AAKO,IAAM,iBAAN,cAA6B,cAAc;AAAA,EAChD,YACE,UAAU,wDACV,OAAsB,MACtB;AACA,UAAM,SAAS,KAAK,IAAI;AACxB,SAAK,OAAO;AAAA,EACd;AACF;AAKO,IAAM,kBAAN,cAA8B,cAAc;AAAA,EACjD,YAAY,UAAU,mBAAmB,OAAsB,MAAM;AACnE,UAAM,SAAS,KAAK,IAAI;AACxB,SAAK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nexport {\n TownshipError,\n AuthenticationError,\n NotFoundError,\n RateLimitError,\n ValidationError,\n PayloadTooLargeError\n} from \"./errors.js\";\nexport type {\n TownshipClientOptions,\n GeoJSONPoint,\n GeoJSONPolygon,\n GeoJSONMultiPolygon,\n GeoJSONBoundary,\n GeoJSONFeature,\n GeoJSONFeatureCollection,\n FeatureProperties,\n Unit,\n SurveySystem,\n SearchResult,\n ReverseOptions,\n AutocompleteOptions,\n BatchSearchOptions,\n BatchReverseOptions,\n // Shared report types\n LatLng,\n EntityRef,\n SectionEnvelope,\n UnavailableSection,\n SectionSource,\n ReportMeta,\n ReportParcel,\n // Energy API\n EnergyReportSection,\n EnergyReportOptions,\n EnergyWellRow,\n EnergyOrphanedWellRow,\n EnergyLeaseRow,\n EnergyOperatorRow,\n EnergyRoyaltyItem,\n EnergyRoyalties,\n EnergyPipelineRow,\n FracFocusRow,\n EnergySplitEstateSide,\n EnergySplitEstate,\n EnergySageGrouseHabitat,\n EnergySageGrouse,\n EnergyRenewableSiting,\n EnergyConstraints,\n EnergyTransmissionLine,\n EnergyInferredSubstation,\n EnergyRenewablesGrid,\n EnergyGeneratorGroup,\n EnergyGeneratorTotals,\n EnergyPlant,\n EnergyPvFootprint,\n EnergyWindTurbines,\n EnergyRenewablesProjects,\n EnergyNrelCell,\n EnergyLpcCategory,\n EnergyLesserPrairieChicken,\n EnergyAltitude,\n EnergyMilitaryTrainingRoute,\n EnergySpecialUseAirspace,\n EnergyRenewablesAviation,\n EnergySolarEnergyZone,\n EnergySection368Corridor,\n EnergyRenewableRowCase,\n EnergyRenewablesBlm,\n EnergyObstacleGroup,\n EnergyTallestObstacle,\n EnergyObstacles,\n EnergyWhoopingCrane,\n EnergyQueueProject,\n EnergyInterconnectionQueue,\n EnergyRenewables,\n EnergySummary,\n EnergyWells,\n EnergyReport,\n // Federal Land API\n FederalLandReportSection,\n FederalLandReportOptions,\n SurfaceManagementRow,\n FederalLeaseRow,\n RightOfWayRow,\n FloodZoneRow,\n MiningClaimRow,\n WetlandRow,\n FireshedRow,\n SoilRow,\n OrphanedWellRow,\n CriticalHabitatRow,\n PublicAccessRow,\n WildfireRiskRow,\n CropHistory,\n Elevation,\n FederalLandReport,\n // Texas API\n TexasReportSection,\n TexasReportOptions,\n TexasStateLeaseRow,\n TexasStateUnitRow,\n TexasPsfLandRow,\n TexasStateAgencyLandRow,\n TexasUplandLeaseRow,\n TexasActiveWellRow,\n TexasPipelineRow,\n TexasPendingPermitRow,\n TexasCoastalErosionRow,\n TexasMonthlyVolume,\n TexasProductionLease,\n TexasAbstractRef,\n TexasProductionSummary,\n TexasProductionBlock,\n TexasProduction,\n TexasReport,\n TexasProductionOptions,\n TexasWellLocation,\n TexasWellUnit,\n TexasWellSeriesPoint,\n TexasDeclineFit,\n TexasDecline,\n TexasDeclineCurvePoint,\n TexasWellSeriesUnit,\n TexasWell\n} from \"./types.js\";\n","/**\n * Base error class for all Township SDK errors.\n *\n * `code` carries the machine-readable error code the Energy, Federal Land,\n * and Texas APIs return in v1 error bodies (`{\"error\": {\"code\", \"message\"}}`),\n * e.g. `invalid_parameter`, `missing_parameter`, `plss_not_supported`,\n * `ambiguous_location`, `not_found`, `rate_limit_exceeded`. It is null for\n * endpoints that do not send one.\n */\nexport class TownshipError extends Error {\n constructor(\n message: string,\n public readonly statusCode: number | null = null,\n public readonly code: string | null = null\n ) {\n super(message);\n this.name = \"TownshipError\";\n }\n}\n\n/**\n * Thrown when the API key is missing or invalid (HTTP 401).\n */\nexport class AuthenticationError extends TownshipError {\n constructor(message = \"Invalid or missing API key\", code: string | null = null) {\n super(message, 401, code);\n this.name = \"AuthenticationError\";\n }\n}\n\n/**\n * Thrown when no result is found for the given input.\n */\nexport class NotFoundError extends TownshipError {\n constructor(message = \"Location not found\", code: string | null = null) {\n super(message, 404, code);\n this.name = \"NotFoundError\";\n }\n}\n\n/**\n * Thrown when the API rate limit is exceeded (HTTP 429).\n */\nexport class RateLimitError extends TownshipError {\n constructor(\n message = \"Rate limit exceeded. Please slow down your requests.\",\n code: string | null = null\n ) {\n super(message, 429, code);\n this.name = \"RateLimitError\";\n }\n}\n\n/**\n * Thrown when the request is malformed (HTTP 400).\n */\nexport class ValidationError extends TownshipError {\n constructor(message = \"Invalid request\", code: string | null = null) {\n super(message, 400, code);\n this.name = \"ValidationError\";\n }\n}\n\n/**\n * Thrown when the batch payload exceeds the maximum size (HTTP 413).\n */\nexport class PayloadTooLargeError extends TownshipError {\n constructor(\n message = \"Batch payload exceeds the maximum of 100 records per request\",\n code: string | null = null\n ) {\n super(message, 413, code);\n this.name = \"PayloadTooLargeError\";\n }\n}\n","import {\n AuthenticationError,\n NotFoundError,\n PayloadTooLargeError,\n RateLimitError,\n TownshipError,\n ValidationError\n} from \"./errors.js\";\nimport type {\n AutocompleteOptions,\n BatchReverseOptions,\n BatchSearchOptions,\n EnergyReport,\n EnergyReportOptions,\n FederalLandReport,\n FederalLandReportOptions,\n GeoJSONBoundary,\n GeoJSONFeatureCollection,\n ReverseOptions,\n SearchResult,\n TexasProduction,\n TexasProductionOptions,\n TexasReport,\n TexasReportOptions,\n TexasWell,\n TownshipClientOptions\n} from \"./types.js\";\n\nconst DEFAULT_BASE_URL = \"https://developer.townshipamerica.com\";\nconst DEFAULT_TIMEOUT = 30_000;\nconst MAX_BATCH_SIZE = 100;\n\nfunction toSearchResult(fc: GeoJSONFeatureCollection): SearchResult {\n const centroid = fc.features.find((f) => f.properties.shape === \"centroid\");\n const grid = fc.features.find((f) => f.properties.shape === \"grid\");\n\n const props = centroid?.properties ?? grid?.properties;\n if (!props) {\n throw new TownshipError(\"Unexpected API response: no features returned\");\n }\n\n const [lng, lat] = centroid ? (centroid.geometry.coordinates as [number, number]) : [0, 0];\n\n return {\n legalLocation: props.legal_location,\n latitude: lat,\n longitude: lng,\n state: props.state,\n county: props.county,\n unit: props.unit,\n surveySystem: props.survey_system,\n alternateLegalLocation: props.alternate_legal_location,\n boundary: grid ? (grid.geometry as GeoJSONBoundary) : null,\n raw: fc\n };\n}\n\nexport class TownshipClient {\n private readonly baseUrl: string;\n private readonly apiKey: string;\n private readonly timeout: number;\n\n constructor(options: TownshipClientOptions) {\n this.apiKey = options.apiKey;\n this.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\\/+$/, \"\");\n this.timeout = options.timeout ?? DEFAULT_TIMEOUT;\n\n if (!this.apiKey) {\n throw new TownshipError(\"apiKey is required\");\n }\n }\n\n // --- Internal ---\n\n private async request<T>(path: string, init?: RequestInit): Promise<T> {\n const url = `${this.baseUrl}${path}`;\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), this.timeout);\n\n try {\n const response = await fetch(url, {\n ...init,\n headers: {\n \"X-API-Key\": this.apiKey,\n \"User-Agent\": \"townshipamerica-js/2.1.0\",\n ...(init?.headers ?? {})\n },\n signal: controller.signal\n });\n\n if (!response.ok) {\n await this.handleError(response);\n }\n\n return (await response.json()) as T;\n } catch (error) {\n if (error instanceof TownshipError) throw error;\n if (error instanceof DOMException && error.name === \"AbortError\") {\n throw new TownshipError(\"Request timed out\");\n }\n throw new TownshipError(error instanceof Error ? error.message : \"Unknown error\");\n } finally {\n clearTimeout(timer);\n }\n }\n\n private async handleError(response: Response): Promise<never> {\n let message: string;\n let code: string | null = null;\n try {\n const body = (await response.json()) as {\n error?: { code?: string; message?: string } | string;\n message?: string;\n };\n // Energy/Federal Land/Texas v1 error bodies are {\"error\": {\"code\", \"message\"}}\n if (body.error && typeof body.error === \"object\") {\n message = body.error.message ?? response.statusText;\n code = body.error.code ?? null;\n } else {\n message =\n (typeof body.error === \"string\" ? body.error : undefined) ??\n body.message ??\n response.statusText;\n }\n } catch {\n message = response.statusText;\n }\n\n const status = response.status;\n if (status === 400) throw new ValidationError(message, code);\n if (status === 401) throw new AuthenticationError(message, code);\n if (status === 404) throw new NotFoundError(message, code);\n if (status === 413) throw new PayloadTooLargeError(message, code);\n if (status === 429) throw new RateLimitError(message, code);\n throw new TownshipError(message, status, code);\n }\n\n // --- Search ---\n\n /**\n * Convert a PLSS or Texas TXSS legal land description to GPS coordinates.\n *\n * @param legalLocation - e.g. \"NW 25 24N 1E 6th Meridian\" or \"A-175 Reeves County\"\n * @returns A SearchResult with coordinates, boundary, and metadata.\n * @throws {ValidationError} If the location string is invalid.\n * @throws {NotFoundError} If no match is found.\n */\n async search(legalLocation: string): Promise<SearchResult> {\n const params = new URLSearchParams({ location: legalLocation });\n const data = await this.request<GeoJSONFeatureCollection | Record<string, never>>(\n `/search/legal-location?${params}`\n );\n\n if (!(\"features\" in data) || !data.features?.length) {\n throw new NotFoundError(`No results found for \"${legalLocation}\"`);\n }\n\n return toSearchResult(data as GeoJSONFeatureCollection);\n }\n\n /**\n * Find the legal land description at the given GPS coordinates (PLSS or Texas TXSS).\n *\n * @param longitude - Longitude (x) coordinate.\n * @param latitude - Latitude (y) coordinate.\n * @param options - Optional PLSS unit filter (ignored for TXSS results).\n * @returns A SearchResult or array of SearchResults (when unit is 'all').\n */\n async reverse(\n longitude: number,\n latitude: number,\n options?: ReverseOptions\n ): Promise<SearchResult | SearchResult[]> {\n const params = new URLSearchParams({\n location: `${longitude},${latitude}`\n });\n if (options?.unit) {\n params.set(\"unit\", options.unit);\n }\n\n const data = await this.request<GeoJSONFeatureCollection | Record<string, never>>(\n `/search/coordinates?${params}`\n );\n\n if (!(\"features\" in data) || !data.features?.length) {\n throw new NotFoundError(`No results found for coordinates [${longitude}, ${latitude}]`);\n }\n\n const fc = data as GeoJSONFeatureCollection;\n\n if (options?.unit === \"all\") {\n const groups = new Map<string, typeof fc.features>();\n for (const feature of fc.features) {\n const key = feature.properties.legal_location;\n if (!groups.has(key)) groups.set(key, []);\n groups.get(key)!.push(feature);\n }\n\n return Array.from(groups.values()).map((features) => {\n return toSearchResult({ type: \"FeatureCollection\", features });\n });\n }\n\n return toSearchResult(fc);\n }\n\n // --- Autocomplete ---\n\n /**\n * Get autocomplete suggestions for a partial PLSS or Texas TXSS description.\n *\n * @param query - Partial search query (minimum 2 characters).\n * @param options - Optional limit (1–10, default 3) and proximity.\n * @returns Raw GeoJSON FeatureCollection with suggestion features.\n */\n async autocomplete(\n query: string,\n options?: AutocompleteOptions\n ): Promise<GeoJSONFeatureCollection> {\n const params = new URLSearchParams({ location: query });\n if (options?.limit != null) {\n params.set(\"limit\", String(options.limit));\n }\n if (options?.proximity) {\n params.set(\"proximity\", `${options.proximity[0]},${options.proximity[1]}`);\n }\n\n return this.request<GeoJSONFeatureCollection>(`/autocomplete/legal-location?${params}`);\n }\n\n // --- Batch ---\n\n /**\n * Convert multiple legal land descriptions to GPS coordinates in one request.\n * Auto-chunks if more than 100 items. Mix PLSS and Texas TXSS inputs freely.\n *\n * @param locations - Array of legal land descriptions.\n * @param options - Optional chunk size.\n * @returns Array of SearchResult or null for each input.\n */\n async batchSearch(\n locations: string[],\n options?: BatchSearchOptions\n ): Promise<(SearchResult | null)[]> {\n const chunkSize = Math.min(options?.chunkSize ?? MAX_BATCH_SIZE, MAX_BATCH_SIZE);\n const results: (SearchResult | null)[] = [];\n\n for (let i = 0; i < locations.length; i += chunkSize) {\n const chunk = locations.slice(i, i + chunkSize);\n const data = await this.request<(GeoJSONFeatureCollection | null)[]>(\n \"/batch/legal-location\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(chunk)\n }\n );\n\n for (const fc of data) {\n if (!fc || !fc.features?.length) {\n results.push(null);\n } else {\n results.push(toSearchResult(fc));\n }\n }\n }\n\n return results;\n }\n\n /**\n * Find legal land descriptions for multiple coordinate pairs in one request.\n * Auto-chunks if more than 100 items.\n *\n * @param coordinates - Array of [longitude, latitude] pairs.\n * @param options - Optional PLSS unit filter and chunk size.\n * @returns Array of SearchResult or null for each input.\n */\n async batchReverse(\n coordinates: [number, number][],\n options?: BatchReverseOptions\n ): Promise<(SearchResult | null)[]> {\n const chunkSize = Math.min(options?.chunkSize ?? MAX_BATCH_SIZE, MAX_BATCH_SIZE);\n const results: (SearchResult | null)[] = [];\n\n for (let i = 0; i < coordinates.length; i += chunkSize) {\n const chunk = coordinates.slice(i, i + chunkSize);\n const body: Record<string, unknown> = { coordinates: chunk };\n if (options?.unit) {\n body.unit = options.unit;\n }\n\n const data = await this.request<\n (GeoJSONFeatureCollection | null)[] | GeoJSONFeatureCollection\n >(\"/batch/coordinates\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(body)\n });\n\n if (Array.isArray(data)) {\n for (const fc of data) {\n if (!fc || !fc.features?.length) {\n results.push(null);\n } else {\n results.push(toSearchResult(fc));\n }\n }\n } else if (data && \"features\" in data) {\n // unit=all returns a single FeatureCollection — split by legal_location\n const groups = new Map<string, typeof data.features>();\n for (const feature of data.features) {\n const key = JSON.stringify(feature.properties.search_term);\n if (!groups.has(key)) groups.set(key, []);\n groups.get(key)!.push(feature);\n }\n for (const features of groups.values()) {\n results.push(toSearchResult({ type: \"FeatureCollection\", features }));\n }\n }\n }\n\n return results;\n }\n\n // --- Convenience ---\n\n /**\n * Get the boundary polygon for a legal land description.\n *\n * @param legalLocation - e.g. \"NW 25 24N 1E 6th Meridian\"\n * @returns The boundary GeoJSON Polygon, or null if not found.\n */\n async boundary(legalLocation: string): Promise<GeoJSONBoundary | null> {\n const result = await this.search(legalLocation);\n return result.boundary;\n }\n\n /**\n * Get the raw GeoJSON FeatureCollection for a legal land description.\n *\n * @param legalLocation - e.g. \"NW 25 24N 1E 6th Meridian\"\n * @returns The raw GeoJSON FeatureCollection from the API.\n */\n async raw(legalLocation: string): Promise<GeoJSONFeatureCollection> {\n const params = new URLSearchParams({ location: legalLocation });\n const data = await this.request<GeoJSONFeatureCollection | Record<string, never>>(\n `/search/legal-location?${params}`\n );\n\n if (!(\"features\" in data)) {\n return { type: \"FeatureCollection\", features: [] };\n }\n\n return data as GeoJSONFeatureCollection;\n }\n\n // --- Energy API ---\n\n /**\n * Get the energy parcel report for a PLSS section. Covers state-regulator\n * wells, operators, federal leases, county royalties, orphaned wells,\n * pipelines, FracFocus disclosures, development constraints, and\n * renewable siting (grid proximity, generators, NREL supply curve,\n * wildlife, aviation, BLM designations, obstacles, interconnection queue).\n *\n * @param legalLocation - A PLSS legal description, e.g. \"NW 25 24N 1E 6th Meridian\"\n * @param options - Optional section projection (`include`)\n * @returns The energy report\n *\n * @example\n * ```ts\n * const report = await client.energyReport('25 24N 1E 6th Meridian')\n * console.log(report.summary.wells_in_section)\n * console.log(report.wells?.in_section.rows[0]?.api_number)\n *\n * // Only the sections you need — the rest are never queried\n * const slim = await client.energyReport('25 24N 1E 6th Meridian', {\n * include: ['wells', 'pipelines']\n * })\n *\n * // Renewable siting only\n * const siting = await client.energyReport('25 24N 1E 6th Meridian', {\n * include: ['renewables']\n * })\n * console.log(siting.renewables?.grid?.nearest_line_100kv_plus?.distance_miles)\n * ```\n */\n async energyReport(legalLocation: string, options?: EnergyReportOptions): Promise<EnergyReport> {\n const params = new URLSearchParams({ legal_location: legalLocation });\n if (options?.include?.length) params.set(\"include\", options.include.join(\",\"));\n return this.request<EnergyReport>(`/energy/report?${params}`);\n }\n\n // --- Federal Land API ---\n\n /**\n * Get the federal-land parcel report for a PLSS tract. Covers surface\n * management, BLM leases and rights-of-way, flood zones, mining claims,\n * wetlands, firesheds, soils, crop history, orphaned wells, critical\n * habitat, public access, wildfire risk, and elevation.\n *\n * @param legalLocation - A PLSS legal description, e.g. \"NW 25 24N 1E 6th Meridian\"\n * @param options - Optional section projection (`include`)\n * @returns The federal-land report\n *\n * @example\n * ```ts\n * const report = await client.federalLandReport('NW 25 24N 1E 6th Meridian')\n * console.log(report.surface_management?.rows[0]?.agency)\n *\n * // Only the sections you need — the pruned layers' queries never run\n * const slim = await client.federalLandReport('NW 25 24N 1E 6th Meridian', {\n * include: ['og_leases', 'flood_zones']\n * })\n * ```\n */\n async federalLandReport(\n legalLocation: string,\n options?: FederalLandReportOptions\n ): Promise<FederalLandReport> {\n const params = new URLSearchParams({ legal_location: legalLocation });\n if (options?.include?.length) params.set(\"include\", options.include.join(\",\"));\n return this.request<FederalLandReport>(`/federal-land/report?${params}`);\n }\n\n // --- Texas API ---\n\n /**\n * Get the Texas abstract report for a TXSS legal description. Covers GLO\n * state leases and units, PSF lands, RRC wells and pipelines, pending\n * permits, coastal erosion, federal overlays, and RRC lease production.\n *\n * @param legalLocation - A Texas legal description, e.g. \"A-175 Reeves County\"\n * @param options - Optional section projection (`include`)\n * @returns The Texas report\n *\n * @example\n * ```ts\n * const report = await client.texasReport('A-175 Reeves County')\n * console.log(report.active_wells?.rows[0]?.api_number)\n * console.log(report.production?.summary.total_cum_boe)\n *\n * // Only the sections you need — the rest are never queried\n * const slim = await client.texasReport('A-175 Reeves County', {\n * include: ['state_leases', 'production']\n * })\n * ```\n */\n async texasReport(legalLocation: string, options?: TexasReportOptions): Promise<TexasReport> {\n const params = new URLSearchParams({ legal_location: legalLocation });\n if (options?.include?.length) params.set(\"include\", options.include.join(\",\"));\n return this.request<TexasReport>(`/texas/report?${params}`);\n }\n\n /**\n * Get RRC lease production for a Texas abstract — per-lease lifetime\n * totals, trailing-12-month volumes, and the 60-month monthly series.\n * Production is reported by RRC at the LEASE level: rows are the leases\n * whose wells fall on the abstract, never sub-allocated to the tract.\n *\n * @param options - Either `{legalLocation}` or `{countyFips, abstractNo, blockNo?}`\n * @returns The abstract production rollup\n *\n * @example\n * ```ts\n * const byLocation = await client.texasProduction({ legalLocation: 'A-175 Reeves County' })\n * const byKeys = await client.texasProduction({ countyFips: '48389', abstractNo: '175' })\n * console.log(byKeys.summary.total_cum_boe)\n * ```\n */\n async texasProduction(options: TexasProductionOptions): Promise<TexasProduction> {\n const params = new URLSearchParams();\n if (options.legalLocation != null) {\n params.set(\"legal_location\", options.legalLocation);\n } else if (options.countyFips != null && options.abstractNo != null) {\n params.set(\"county_fips\", options.countyFips);\n params.set(\"abstract_no\", options.abstractNo);\n if (options.blockNo != null) params.set(\"block_no\", options.blockNo);\n } else {\n throw new TownshipError(\n \"texasProduction requires either legalLocation or countyFips + abstractNo\"\n );\n }\n return this.request<TexasProduction>(`/texas/production?${params}`);\n }\n\n /**\n * Get per-well allocated production for a Texas well by API number —\n * summary scalars for every lease edge, the monthly series (when\n * provisioned), and an Arps decline fit. Volumes are allocated estimates:\n * RRC reports production by lease, never by well.\n *\n * @param api - API-8 or API-14 number (e.g. \"42-389-32345\" or \"42389323450000\")\n * @returns The well's units, series, and decline analysis\n *\n * @example\n * ```ts\n * const well = await client.texasWell('42-389-32345')\n * console.log(well.units[0]?.cum_boe)\n * console.log(well.decline.available && well.decline.value?.di)\n * ```\n */\n async texasWell(api: string): Promise<TexasWell> {\n return this.request<TexasWell>(`/texas/wells/${encodeURIComponent(api)}`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACSO,IAAM,gBAAN,cAA4B,MAAM;AAAA,EACvC,YACE,SACgB,aAA4B,MAC5B,OAAsB,MACtC;AACA,UAAM,OAAO;AAHG;AACA;AAGhB,SAAK,OAAO;AAAA,EACd;AACF;AAKO,IAAM,sBAAN,cAAkC,cAAc;AAAA,EACrD,YAAY,UAAU,8BAA8B,OAAsB,MAAM;AAC9E,UAAM,SAAS,KAAK,IAAI;AACxB,SAAK,OAAO;AAAA,EACd;AACF;AAKO,IAAM,gBAAN,cAA4B,cAAc;AAAA,EAC/C,YAAY,UAAU,sBAAsB,OAAsB,MAAM;AACtE,UAAM,SAAS,KAAK,IAAI;AACxB,SAAK,OAAO;AAAA,EACd;AACF;AAKO,IAAM,iBAAN,cAA6B,cAAc;AAAA,EAChD,YACE,UAAU,wDACV,OAAsB,MACtB;AACA,UAAM,SAAS,KAAK,IAAI;AACxB,SAAK,OAAO;AAAA,EACd;AACF;AAKO,IAAM,kBAAN,cAA8B,cAAc;AAAA,EACjD,YAAY,UAAU,mBAAmB,OAAsB,MAAM;AACnE,UAAM,SAAS,KAAK,IAAI;AACxB,SAAK,OAAO;AAAA,EACd;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
143
  [key: string]: unknown;
144
144
  }
145
145
  /** Sections of the energy report addressable through `include=`. */
146
- type EnergyReportSection = "wells" | "operators" | "leases" | "royalties" | "orphaned_wells" | "pipelines" | "fracfocus" | "constraints" | "geometry";
146
+ type EnergyReportSection = "wells" | "operators" | "leases" | "royalties" | "orphaned_wells" | "pipelines" | "fracfocus" | "constraints" | "renewables" | "geometry";
147
147
  /** Options for `energyReport`. */
148
148
  interface EnergyReportOptions {
149
149
  /**
@@ -282,6 +282,280 @@ interface EnergyConstraints {
282
282
  renewable_siting: EnergyRenewableSiting | null;
283
283
  [key: string]: unknown;
284
284
  }
285
+ /** Nearest ORNL/HIFLD transmission line of one voltage class. */
286
+ interface EnergyTransmissionLine {
287
+ /** "100-161", "220-287", "345", "500", "735 AND ABOVE", or "DC" */
288
+ volt_class: string | null;
289
+ voltage_kv: number | null;
290
+ owner: EntityRef | null;
291
+ status: string | null;
292
+ distance_miles: number | null;
293
+ /** True when the line runs through the section (distance under 1 m). */
294
+ crosses_section: boolean;
295
+ [key: string]: unknown;
296
+ }
297
+ /**
298
+ * A substation inferred from ORNL/HIFLD transmission-line endpoints. No open
299
+ * federal substation layer exists, so every row is inferred (`inferred: true`).
300
+ */
301
+ interface EnergyInferredSubstation {
302
+ name: string | null;
303
+ max_voltage_kv: number | null;
304
+ max_volt_class: string | null;
305
+ line_count: number;
306
+ distance_miles: number | null;
307
+ inferred: true;
308
+ [key: string]: unknown;
309
+ }
310
+ /** Grid proximity: nearest line per kV class + inferred substations. */
311
+ interface EnergyRenewablesGrid {
312
+ radius_mi: number;
313
+ /** Nearest line per voltage class within `radius_mi`, ordered by class. */
314
+ transmission_by_class: EnergyTransmissionLine[];
315
+ /** Nearest AC line of 100 kV or more (DC lines excluded). */
316
+ nearest_line_100kv_plus: EnergyTransmissionLine | null;
317
+ /** Up to five nearest inferred substations. */
318
+ substations: EnergyInferredSubstation[];
319
+ nearest_substation_230kv_plus: EnergyInferredSubstation | null;
320
+ nearest_substation_345kv_plus: EnergyInferredSubstation | null;
321
+ [key: string]: unknown;
322
+ }
323
+ /** Generator group an EIA-860M energy source rolls up to. */
324
+ type EnergyGeneratorGroup = "solar" | "wind" | "storage" | "hydro" | "geothermal" | "gas" | "nuclear" | "coal" | "other" | (string & {});
325
+ /** Operating vs planned nameplate MW for one generator group. */
326
+ interface EnergyGeneratorTotals {
327
+ operating: number;
328
+ planned: number;
329
+ [key: string]: unknown;
330
+ }
331
+ /** One EIA-860M plant (operating or planned) near the section. */
332
+ interface EnergyPlant {
333
+ eia_plant_id: number;
334
+ name: string | null;
335
+ operator: EntityRef | null;
336
+ inventory: "operating" | "planned" | (string & {});
337
+ /** The group holding the plant's largest share of capacity. */
338
+ group: EnergyGeneratorGroup;
339
+ technologies: string[];
340
+ capacity_mw: number;
341
+ capacity_mw_by_group: Partial<Record<EnergyGeneratorGroup, number>>;
342
+ online_year: number | null;
343
+ status: string | null;
344
+ distance_miles: number | null;
345
+ [key: string]: unknown;
346
+ }
347
+ /** One USGS/LBNL USPVDB solar-array footprint. */
348
+ interface EnergyPvFootprint {
349
+ uspvdb_case_id: number | null;
350
+ eia_plant_id: number | null;
351
+ name: string | null;
352
+ capacity_ac_mw: number | null;
353
+ online_year: number | null;
354
+ on_section: boolean;
355
+ distance_miles: number | null;
356
+ [key: string]: unknown;
357
+ }
358
+ /** USGS wind-turbine (USWTDB) counts near the section. */
359
+ interface EnergyWindTurbines {
360
+ within_2mi: number;
361
+ within_5mi: number;
362
+ projects_within_5mi: string[];
363
+ [key: string]: unknown;
364
+ }
365
+ /** Existing + planned generators, solar footprints, and turbines. */
366
+ interface EnergyRenewablesProjects {
367
+ radius_mi: number;
368
+ totals_mw: Partial<Record<EnergyGeneratorGroup, EnergyGeneratorTotals>>;
369
+ /** Up to 40 nearest plants. */
370
+ plants: EnergyPlant[];
371
+ pv_footprints: EnergyPvFootprint[];
372
+ wind_turbines: EnergyWindTurbines;
373
+ [key: string]: unknown;
374
+ }
375
+ /**
376
+ * NREL 2024 supply-curve cell nearest the section, one per technology.
377
+ * Values describe the surrounding 11.5 km cell, not the section itself.
378
+ * NREL values are CC-BY 4.0.
379
+ */
380
+ interface EnergyNrelCell {
381
+ technology: "solar" | "wind" | (string & {});
382
+ sc_point_gid: number | null;
383
+ resource: number | null;
384
+ /** "kWh/m2/day (GHI)" for solar, "m/s (115 m hub height)" for wind */
385
+ resource_unit: string;
386
+ capacity_factor_pct: number | null;
387
+ lcoe_all_in_usd_per_mwh: number | null;
388
+ lcoe_site_usd_per_mwh: number | null;
389
+ /** National percentile of all-in LCOE within the technology (0 = cheapest). */
390
+ lcoe_percentile: number | null;
391
+ capacity_ac_mw: number | null;
392
+ dist_spur_miles: number | null;
393
+ dist_reinforcement_miles: number | null;
394
+ cell_distance_miles: number | null;
395
+ [key: string]: unknown;
396
+ }
397
+ /** One WAFWA CHAT habitat category overlapping the section. */
398
+ interface EnergyLpcCategory {
399
+ chat_category: number;
400
+ label: string | null;
401
+ overlap_acres: number | null;
402
+ [key: string]: unknown;
403
+ }
404
+ /**
405
+ * Lesser prairie-chicken range-wide plan habitat (WAFWA CHAT). Not ESA
406
+ * critical habitat.
407
+ */
408
+ interface EnergyLesserPrairieChicken {
409
+ in_occupied_range: boolean;
410
+ ecoregion: string | null;
411
+ /** Lowest (highest-priority) CHAT category on the section. */
412
+ top_category: number | null;
413
+ categories: EnergyLpcCategory[];
414
+ status_note: string;
415
+ [key: string]: unknown;
416
+ }
417
+ /** An airspace floor or ceiling. */
418
+ interface EnergyAltitude {
419
+ /** Feet; null when the source unit is not feet. */
420
+ value_ft: number | null;
421
+ /** "SFC", "AGL", "MSL", or the raw source code */
422
+ reference: string | null;
423
+ label: string;
424
+ [key: string]: unknown;
425
+ }
426
+ /** One FAA military training route near the section. */
427
+ interface EnergyMilitaryTrainingRoute {
428
+ ident: string | null;
429
+ floor: EnergyAltitude | null;
430
+ ceiling: EnergyAltitude | null;
431
+ inside_corridor: boolean;
432
+ centerline_distance_miles: number | null;
433
+ [key: string]: unknown;
434
+ }
435
+ /** One FAA special use airspace overlapping the section. */
436
+ interface EnergySpecialUseAirspace {
437
+ name: string | null;
438
+ type_code: string | null;
439
+ floor: EnergyAltitude | null;
440
+ ceiling: EnergyAltitude | null;
441
+ times_of_use: string | null;
442
+ controlling_agency: string | null;
443
+ [key: string]: unknown;
444
+ }
445
+ /** FAA military training routes + special use airspace. */
446
+ interface EnergyRenewablesAviation {
447
+ military_training_routes: EnergyMilitaryTrainingRoute[];
448
+ special_use_airspace: EnergySpecialUseAirspace[];
449
+ [key: string]: unknown;
450
+ }
451
+ /** One BLM Solar Energy Zone the section sits in. */
452
+ interface EnergySolarEnergyZone {
453
+ name: string | null;
454
+ status: string | null;
455
+ state_office: string | null;
456
+ [key: string]: unknown;
457
+ }
458
+ /** One BLM Section 368 energy corridor near the section. */
459
+ interface EnergySection368Corridor {
460
+ name: string | null;
461
+ status: string | null;
462
+ width_feet: number | null;
463
+ distance_miles: number | null;
464
+ [key: string]: unknown;
465
+ }
466
+ /** One BLM solar/wind right-of-way case near the section. */
467
+ interface EnergyRenewableRowCase {
468
+ serial_number: string | null;
469
+ case_type: string | null;
470
+ status: string | null;
471
+ holder: EntityRef | null;
472
+ acres: number | null;
473
+ on_section: boolean;
474
+ [key: string]: unknown;
475
+ }
476
+ /** BLM Solar Energy Zones, Section 368 corridors, and renewable ROW cases. */
477
+ interface EnergyRenewablesBlm {
478
+ solar_energy_zones: EnergySolarEnergyZone[];
479
+ section_368_corridors: EnergySection368Corridor[];
480
+ renewable_row_cases: EnergyRenewableRowCase[];
481
+ [key: string]: unknown;
482
+ }
483
+ /** Group an FAA Digital Obstacle File obstacle type rolls up to. */
484
+ type EnergyObstacleGroup = "wind_turbine" | "met_tower" | "transmission_tower" | "tower" | "stack" | "other" | (string & {});
485
+ /** The tallest obstacle within the obstacle radius. */
486
+ interface EnergyTallestObstacle {
487
+ type: string | null;
488
+ agl_ft: number | null;
489
+ distance_miles: number | null;
490
+ faa_study: string | null;
491
+ [key: string]: unknown;
492
+ }
493
+ /** FAA Digital Obstacle File summary near the section. */
494
+ interface EnergyObstacles {
495
+ radius_mi: number;
496
+ total: number;
497
+ at_least_200ft_agl: number;
498
+ on_section: number;
499
+ by_group: Partial<Record<EnergyObstacleGroup, number>>;
500
+ tallest: EnergyTallestObstacle | null;
501
+ /** Nearest meteorological tower within 10 miles. */
502
+ nearest_met_tower_miles: number | null;
503
+ [key: string]: unknown;
504
+ }
505
+ /** USGS whooping crane migration corridor. */
506
+ interface EnergyWhoopingCrane {
507
+ /** Narrowest corridor band (percent) the section falls in; null when outside. */
508
+ band_pct: number | null;
509
+ note: string;
510
+ [key: string]: unknown;
511
+ }
512
+ /** One active LBNL Queued Up interconnection request in the county. */
513
+ interface EnergyQueueProject {
514
+ name: string | null;
515
+ type: string | null;
516
+ mw: number | null;
517
+ point_of_interconnection: string | null;
518
+ ia_phase: string | null;
519
+ proposed_year: number | null;
520
+ developer: EntityRef | null;
521
+ transmission_provider: string | null;
522
+ [key: string]: unknown;
523
+ }
524
+ /**
525
+ * LBNL Queued Up interconnection queue, county-wide (never parcel-precise).
526
+ * LBNL values are CC-BY 4.0.
527
+ */
528
+ interface EnergyInterconnectionQueue {
529
+ scope: "county" | (string & {});
530
+ county: string;
531
+ state_code: string;
532
+ vintage: string | null;
533
+ active_requests: number;
534
+ active_mw_by_type: Record<string, number>;
535
+ withdrawn_requests: number;
536
+ operational_requests: number;
537
+ /** Up to 10 largest active requests. */
538
+ active_projects: EnergyQueueProject[];
539
+ [key: string]: unknown;
540
+ }
541
+ /**
542
+ * Renewable-siting section. Every part degrades on its own: a failed part is
543
+ * null and listed in `meta.unavailable` as `{section: "renewables.<part>"}`.
544
+ */
545
+ interface EnergyRenewables {
546
+ grid: EnergyRenewablesGrid | null;
547
+ projects: EnergyRenewablesProjects | null;
548
+ /** Up to one cell per technology (solar, wind) within 12 km. */
549
+ nrel: EnergyNrelCell[] | null;
550
+ lesser_prairie_chicken: EnergyLesserPrairieChicken | null;
551
+ aviation: EnergyRenewablesAviation | null;
552
+ blm: EnergyRenewablesBlm | null;
553
+ obstacles: EnergyObstacles | null;
554
+ whooping_crane: EnergyWhoopingCrane | null;
555
+ /** Also null when the section has no state/county to match on. */
556
+ interconnection_queue: EnergyInterconnectionQueue | null;
557
+ [key: string]: unknown;
558
+ }
285
559
  /** Per-section counts. A null count means that section was not fetched. */
286
560
  interface EnergySummary {
287
561
  wells_in_section: number | null;
@@ -291,6 +565,10 @@ interface EnergySummary {
291
565
  orphaned_wells: number | null;
292
566
  pipelines_within_radius: number | null;
293
567
  fracfocus_disclosures: number | null;
568
+ /** From `renewables.grid`; null when not fetched or nothing within range. */
569
+ nearest_transmission_100kv_plus_miles: number | null;
570
+ /** From `renewables.grid`; null when not fetched or nothing within range. */
571
+ nearest_substation_230kv_plus_miles: number | null;
294
572
  [key: string]: unknown;
295
573
  }
296
574
  /** Wells section: in-section rows + the nearby radius envelope. */
@@ -335,6 +613,7 @@ interface EnergyReport {
335
613
  radius_mi: number;
336
614
  } & SectionEnvelope<FracFocusRow>;
337
615
  constraints?: EnergyConstraints | null;
616
+ renewables?: EnergyRenewables | null;
338
617
  meta: ReportMeta;
339
618
  [key: string]: unknown;
340
619
  }
@@ -876,7 +1155,9 @@ declare class TownshipClient {
876
1155
  /**
877
1156
  * Get the energy parcel report for a PLSS section. Covers state-regulator
878
1157
  * wells, operators, federal leases, county royalties, orphaned wells,
879
- * pipelines, FracFocus disclosures, and development constraints.
1158
+ * pipelines, FracFocus disclosures, development constraints, and
1159
+ * renewable siting (grid proximity, generators, NREL supply curve,
1160
+ * wildlife, aviation, BLM designations, obstacles, interconnection queue).
880
1161
  *
881
1162
  * @param legalLocation - A PLSS legal description, e.g. "NW 25 24N 1E 6th Meridian"
882
1163
  * @param options - Optional section projection (`include`)
@@ -892,6 +1173,12 @@ declare class TownshipClient {
892
1173
  * const slim = await client.energyReport('25 24N 1E 6th Meridian', {
893
1174
  * include: ['wells', 'pipelines']
894
1175
  * })
1176
+ *
1177
+ * // Renewable siting only
1178
+ * const siting = await client.energyReport('25 24N 1E 6th Meridian', {
1179
+ * include: ['renewables']
1180
+ * })
1181
+ * console.log(siting.renewables?.grid?.nearest_line_100kv_plus?.distance_miles)
895
1182
  * ```
896
1183
  */
897
1184
  energyReport(legalLocation: string, options?: EnergyReportOptions): Promise<EnergyReport>;
@@ -1020,4 +1307,4 @@ declare class PayloadTooLargeError extends TownshipError {
1020
1307
  constructor(message?: string, code?: string | null);
1021
1308
  }
1022
1309
 
1023
- export { AuthenticationError, type AutocompleteOptions, type BatchReverseOptions, type BatchSearchOptions, type CriticalHabitatRow, type CropHistory, type Elevation, type EnergyConstraints, type EnergyLeaseRow, type EnergyOperatorRow, type EnergyOrphanedWellRow, type EnergyPipelineRow, type EnergyRenewableSiting, type EnergyReport, type EnergyReportOptions, type EnergyReportSection, type EnergyRoyalties, type EnergyRoyaltyItem, type EnergySageGrouse, type EnergySageGrouseHabitat, type EnergySplitEstate, type EnergySplitEstateSide, type EnergySummary, type EnergyWellRow, type EnergyWells, type EntityRef, type FeatureProperties, type FederalLandReport, type FederalLandReportOptions, type FederalLandReportSection, type FederalLeaseRow, type FireshedRow, type FloodZoneRow, type FracFocusRow, type GeoJSONBoundary, type GeoJSONFeature, type GeoJSONFeatureCollection, type GeoJSONMultiPolygon, type GeoJSONPoint, type GeoJSONPolygon, type LatLng, type MiningClaimRow, NotFoundError, type OrphanedWellRow, PayloadTooLargeError, type PublicAccessRow, RateLimitError, type ReportMeta, type ReportParcel, type ReverseOptions, type RightOfWayRow, type SearchResult, type SectionEnvelope, type SectionSource, type SoilRow, type SurfaceManagementRow, type SurveySystem, type TexasAbstractRef, type TexasActiveWellRow, type TexasCoastalErosionRow, type TexasDecline, type TexasDeclineCurvePoint, type TexasDeclineFit, type TexasMonthlyVolume, type TexasPendingPermitRow, type TexasPipelineRow, type TexasProduction, type TexasProductionBlock, type TexasProductionLease, type TexasProductionOptions, type TexasProductionSummary, type TexasPsfLandRow, type TexasReport, type TexasReportOptions, type TexasReportSection, type TexasStateAgencyLandRow, type TexasStateLeaseRow, type TexasStateUnitRow, type TexasUplandLeaseRow, type TexasWell, type TexasWellLocation, type TexasWellSeriesPoint, type TexasWellSeriesUnit, type TexasWellUnit, TownshipClient, type TownshipClientOptions, TownshipError, type UnavailableSection, type Unit, ValidationError, type WetlandRow, type WildfireRiskRow };
1310
+ export { AuthenticationError, type AutocompleteOptions, type BatchReverseOptions, type BatchSearchOptions, type CriticalHabitatRow, type CropHistory, type Elevation, type EnergyAltitude, type EnergyConstraints, type EnergyGeneratorGroup, type EnergyGeneratorTotals, type EnergyInferredSubstation, type EnergyInterconnectionQueue, type EnergyLeaseRow, type EnergyLesserPrairieChicken, type EnergyLpcCategory, type EnergyMilitaryTrainingRoute, type EnergyNrelCell, type EnergyObstacleGroup, type EnergyObstacles, type EnergyOperatorRow, type EnergyOrphanedWellRow, type EnergyPipelineRow, type EnergyPlant, type EnergyPvFootprint, type EnergyQueueProject, type EnergyRenewableRowCase, type EnergyRenewableSiting, type EnergyRenewables, type EnergyRenewablesAviation, type EnergyRenewablesBlm, type EnergyRenewablesGrid, type EnergyRenewablesProjects, type EnergyReport, type EnergyReportOptions, type EnergyReportSection, type EnergyRoyalties, type EnergyRoyaltyItem, type EnergySageGrouse, type EnergySageGrouseHabitat, type EnergySection368Corridor, type EnergySolarEnergyZone, type EnergySpecialUseAirspace, type EnergySplitEstate, type EnergySplitEstateSide, type EnergySummary, type EnergyTallestObstacle, type EnergyTransmissionLine, type EnergyWellRow, type EnergyWells, type EnergyWhoopingCrane, type EnergyWindTurbines, type EntityRef, type FeatureProperties, type FederalLandReport, type FederalLandReportOptions, type FederalLandReportSection, type FederalLeaseRow, type FireshedRow, type FloodZoneRow, type FracFocusRow, type GeoJSONBoundary, type GeoJSONFeature, type GeoJSONFeatureCollection, type GeoJSONMultiPolygon, type GeoJSONPoint, type GeoJSONPolygon, type LatLng, type MiningClaimRow, NotFoundError, type OrphanedWellRow, PayloadTooLargeError, type PublicAccessRow, RateLimitError, type ReportMeta, type ReportParcel, type ReverseOptions, type RightOfWayRow, type SearchResult, type SectionEnvelope, type SectionSource, type SoilRow, type SurfaceManagementRow, type SurveySystem, type TexasAbstractRef, type TexasActiveWellRow, type TexasCoastalErosionRow, type TexasDecline, type TexasDeclineCurvePoint, type TexasDeclineFit, type TexasMonthlyVolume, type TexasPendingPermitRow, type TexasPipelineRow, type TexasProduction, type TexasProductionBlock, type TexasProductionLease, type TexasProductionOptions, type TexasProductionSummary, type TexasPsfLandRow, type TexasReport, type TexasReportOptions, type TexasReportSection, type TexasStateAgencyLandRow, type TexasStateLeaseRow, type TexasStateUnitRow, type TexasUplandLeaseRow, type TexasWell, type TexasWellLocation, type TexasWellSeriesPoint, type TexasWellSeriesUnit, type TexasWellUnit, TownshipClient, type TownshipClientOptions, TownshipError, type UnavailableSection, type Unit, ValidationError, type WetlandRow, type WildfireRiskRow };
package/dist/index.d.ts CHANGED
@@ -143,7 +143,7 @@ interface ReportParcel {
143
143
  [key: string]: unknown;
144
144
  }
145
145
  /** Sections of the energy report addressable through `include=`. */
146
- type EnergyReportSection = "wells" | "operators" | "leases" | "royalties" | "orphaned_wells" | "pipelines" | "fracfocus" | "constraints" | "geometry";
146
+ type EnergyReportSection = "wells" | "operators" | "leases" | "royalties" | "orphaned_wells" | "pipelines" | "fracfocus" | "constraints" | "renewables" | "geometry";
147
147
  /** Options for `energyReport`. */
148
148
  interface EnergyReportOptions {
149
149
  /**
@@ -282,6 +282,280 @@ interface EnergyConstraints {
282
282
  renewable_siting: EnergyRenewableSiting | null;
283
283
  [key: string]: unknown;
284
284
  }
285
+ /** Nearest ORNL/HIFLD transmission line of one voltage class. */
286
+ interface EnergyTransmissionLine {
287
+ /** "100-161", "220-287", "345", "500", "735 AND ABOVE", or "DC" */
288
+ volt_class: string | null;
289
+ voltage_kv: number | null;
290
+ owner: EntityRef | null;
291
+ status: string | null;
292
+ distance_miles: number | null;
293
+ /** True when the line runs through the section (distance under 1 m). */
294
+ crosses_section: boolean;
295
+ [key: string]: unknown;
296
+ }
297
+ /**
298
+ * A substation inferred from ORNL/HIFLD transmission-line endpoints. No open
299
+ * federal substation layer exists, so every row is inferred (`inferred: true`).
300
+ */
301
+ interface EnergyInferredSubstation {
302
+ name: string | null;
303
+ max_voltage_kv: number | null;
304
+ max_volt_class: string | null;
305
+ line_count: number;
306
+ distance_miles: number | null;
307
+ inferred: true;
308
+ [key: string]: unknown;
309
+ }
310
+ /** Grid proximity: nearest line per kV class + inferred substations. */
311
+ interface EnergyRenewablesGrid {
312
+ radius_mi: number;
313
+ /** Nearest line per voltage class within `radius_mi`, ordered by class. */
314
+ transmission_by_class: EnergyTransmissionLine[];
315
+ /** Nearest AC line of 100 kV or more (DC lines excluded). */
316
+ nearest_line_100kv_plus: EnergyTransmissionLine | null;
317
+ /** Up to five nearest inferred substations. */
318
+ substations: EnergyInferredSubstation[];
319
+ nearest_substation_230kv_plus: EnergyInferredSubstation | null;
320
+ nearest_substation_345kv_plus: EnergyInferredSubstation | null;
321
+ [key: string]: unknown;
322
+ }
323
+ /** Generator group an EIA-860M energy source rolls up to. */
324
+ type EnergyGeneratorGroup = "solar" | "wind" | "storage" | "hydro" | "geothermal" | "gas" | "nuclear" | "coal" | "other" | (string & {});
325
+ /** Operating vs planned nameplate MW for one generator group. */
326
+ interface EnergyGeneratorTotals {
327
+ operating: number;
328
+ planned: number;
329
+ [key: string]: unknown;
330
+ }
331
+ /** One EIA-860M plant (operating or planned) near the section. */
332
+ interface EnergyPlant {
333
+ eia_plant_id: number;
334
+ name: string | null;
335
+ operator: EntityRef | null;
336
+ inventory: "operating" | "planned" | (string & {});
337
+ /** The group holding the plant's largest share of capacity. */
338
+ group: EnergyGeneratorGroup;
339
+ technologies: string[];
340
+ capacity_mw: number;
341
+ capacity_mw_by_group: Partial<Record<EnergyGeneratorGroup, number>>;
342
+ online_year: number | null;
343
+ status: string | null;
344
+ distance_miles: number | null;
345
+ [key: string]: unknown;
346
+ }
347
+ /** One USGS/LBNL USPVDB solar-array footprint. */
348
+ interface EnergyPvFootprint {
349
+ uspvdb_case_id: number | null;
350
+ eia_plant_id: number | null;
351
+ name: string | null;
352
+ capacity_ac_mw: number | null;
353
+ online_year: number | null;
354
+ on_section: boolean;
355
+ distance_miles: number | null;
356
+ [key: string]: unknown;
357
+ }
358
+ /** USGS wind-turbine (USWTDB) counts near the section. */
359
+ interface EnergyWindTurbines {
360
+ within_2mi: number;
361
+ within_5mi: number;
362
+ projects_within_5mi: string[];
363
+ [key: string]: unknown;
364
+ }
365
+ /** Existing + planned generators, solar footprints, and turbines. */
366
+ interface EnergyRenewablesProjects {
367
+ radius_mi: number;
368
+ totals_mw: Partial<Record<EnergyGeneratorGroup, EnergyGeneratorTotals>>;
369
+ /** Up to 40 nearest plants. */
370
+ plants: EnergyPlant[];
371
+ pv_footprints: EnergyPvFootprint[];
372
+ wind_turbines: EnergyWindTurbines;
373
+ [key: string]: unknown;
374
+ }
375
+ /**
376
+ * NREL 2024 supply-curve cell nearest the section, one per technology.
377
+ * Values describe the surrounding 11.5 km cell, not the section itself.
378
+ * NREL values are CC-BY 4.0.
379
+ */
380
+ interface EnergyNrelCell {
381
+ technology: "solar" | "wind" | (string & {});
382
+ sc_point_gid: number | null;
383
+ resource: number | null;
384
+ /** "kWh/m2/day (GHI)" for solar, "m/s (115 m hub height)" for wind */
385
+ resource_unit: string;
386
+ capacity_factor_pct: number | null;
387
+ lcoe_all_in_usd_per_mwh: number | null;
388
+ lcoe_site_usd_per_mwh: number | null;
389
+ /** National percentile of all-in LCOE within the technology (0 = cheapest). */
390
+ lcoe_percentile: number | null;
391
+ capacity_ac_mw: number | null;
392
+ dist_spur_miles: number | null;
393
+ dist_reinforcement_miles: number | null;
394
+ cell_distance_miles: number | null;
395
+ [key: string]: unknown;
396
+ }
397
+ /** One WAFWA CHAT habitat category overlapping the section. */
398
+ interface EnergyLpcCategory {
399
+ chat_category: number;
400
+ label: string | null;
401
+ overlap_acres: number | null;
402
+ [key: string]: unknown;
403
+ }
404
+ /**
405
+ * Lesser prairie-chicken range-wide plan habitat (WAFWA CHAT). Not ESA
406
+ * critical habitat.
407
+ */
408
+ interface EnergyLesserPrairieChicken {
409
+ in_occupied_range: boolean;
410
+ ecoregion: string | null;
411
+ /** Lowest (highest-priority) CHAT category on the section. */
412
+ top_category: number | null;
413
+ categories: EnergyLpcCategory[];
414
+ status_note: string;
415
+ [key: string]: unknown;
416
+ }
417
+ /** An airspace floor or ceiling. */
418
+ interface EnergyAltitude {
419
+ /** Feet; null when the source unit is not feet. */
420
+ value_ft: number | null;
421
+ /** "SFC", "AGL", "MSL", or the raw source code */
422
+ reference: string | null;
423
+ label: string;
424
+ [key: string]: unknown;
425
+ }
426
+ /** One FAA military training route near the section. */
427
+ interface EnergyMilitaryTrainingRoute {
428
+ ident: string | null;
429
+ floor: EnergyAltitude | null;
430
+ ceiling: EnergyAltitude | null;
431
+ inside_corridor: boolean;
432
+ centerline_distance_miles: number | null;
433
+ [key: string]: unknown;
434
+ }
435
+ /** One FAA special use airspace overlapping the section. */
436
+ interface EnergySpecialUseAirspace {
437
+ name: string | null;
438
+ type_code: string | null;
439
+ floor: EnergyAltitude | null;
440
+ ceiling: EnergyAltitude | null;
441
+ times_of_use: string | null;
442
+ controlling_agency: string | null;
443
+ [key: string]: unknown;
444
+ }
445
+ /** FAA military training routes + special use airspace. */
446
+ interface EnergyRenewablesAviation {
447
+ military_training_routes: EnergyMilitaryTrainingRoute[];
448
+ special_use_airspace: EnergySpecialUseAirspace[];
449
+ [key: string]: unknown;
450
+ }
451
+ /** One BLM Solar Energy Zone the section sits in. */
452
+ interface EnergySolarEnergyZone {
453
+ name: string | null;
454
+ status: string | null;
455
+ state_office: string | null;
456
+ [key: string]: unknown;
457
+ }
458
+ /** One BLM Section 368 energy corridor near the section. */
459
+ interface EnergySection368Corridor {
460
+ name: string | null;
461
+ status: string | null;
462
+ width_feet: number | null;
463
+ distance_miles: number | null;
464
+ [key: string]: unknown;
465
+ }
466
+ /** One BLM solar/wind right-of-way case near the section. */
467
+ interface EnergyRenewableRowCase {
468
+ serial_number: string | null;
469
+ case_type: string | null;
470
+ status: string | null;
471
+ holder: EntityRef | null;
472
+ acres: number | null;
473
+ on_section: boolean;
474
+ [key: string]: unknown;
475
+ }
476
+ /** BLM Solar Energy Zones, Section 368 corridors, and renewable ROW cases. */
477
+ interface EnergyRenewablesBlm {
478
+ solar_energy_zones: EnergySolarEnergyZone[];
479
+ section_368_corridors: EnergySection368Corridor[];
480
+ renewable_row_cases: EnergyRenewableRowCase[];
481
+ [key: string]: unknown;
482
+ }
483
+ /** Group an FAA Digital Obstacle File obstacle type rolls up to. */
484
+ type EnergyObstacleGroup = "wind_turbine" | "met_tower" | "transmission_tower" | "tower" | "stack" | "other" | (string & {});
485
+ /** The tallest obstacle within the obstacle radius. */
486
+ interface EnergyTallestObstacle {
487
+ type: string | null;
488
+ agl_ft: number | null;
489
+ distance_miles: number | null;
490
+ faa_study: string | null;
491
+ [key: string]: unknown;
492
+ }
493
+ /** FAA Digital Obstacle File summary near the section. */
494
+ interface EnergyObstacles {
495
+ radius_mi: number;
496
+ total: number;
497
+ at_least_200ft_agl: number;
498
+ on_section: number;
499
+ by_group: Partial<Record<EnergyObstacleGroup, number>>;
500
+ tallest: EnergyTallestObstacle | null;
501
+ /** Nearest meteorological tower within 10 miles. */
502
+ nearest_met_tower_miles: number | null;
503
+ [key: string]: unknown;
504
+ }
505
+ /** USGS whooping crane migration corridor. */
506
+ interface EnergyWhoopingCrane {
507
+ /** Narrowest corridor band (percent) the section falls in; null when outside. */
508
+ band_pct: number | null;
509
+ note: string;
510
+ [key: string]: unknown;
511
+ }
512
+ /** One active LBNL Queued Up interconnection request in the county. */
513
+ interface EnergyQueueProject {
514
+ name: string | null;
515
+ type: string | null;
516
+ mw: number | null;
517
+ point_of_interconnection: string | null;
518
+ ia_phase: string | null;
519
+ proposed_year: number | null;
520
+ developer: EntityRef | null;
521
+ transmission_provider: string | null;
522
+ [key: string]: unknown;
523
+ }
524
+ /**
525
+ * LBNL Queued Up interconnection queue, county-wide (never parcel-precise).
526
+ * LBNL values are CC-BY 4.0.
527
+ */
528
+ interface EnergyInterconnectionQueue {
529
+ scope: "county" | (string & {});
530
+ county: string;
531
+ state_code: string;
532
+ vintage: string | null;
533
+ active_requests: number;
534
+ active_mw_by_type: Record<string, number>;
535
+ withdrawn_requests: number;
536
+ operational_requests: number;
537
+ /** Up to 10 largest active requests. */
538
+ active_projects: EnergyQueueProject[];
539
+ [key: string]: unknown;
540
+ }
541
+ /**
542
+ * Renewable-siting section. Every part degrades on its own: a failed part is
543
+ * null and listed in `meta.unavailable` as `{section: "renewables.<part>"}`.
544
+ */
545
+ interface EnergyRenewables {
546
+ grid: EnergyRenewablesGrid | null;
547
+ projects: EnergyRenewablesProjects | null;
548
+ /** Up to one cell per technology (solar, wind) within 12 km. */
549
+ nrel: EnergyNrelCell[] | null;
550
+ lesser_prairie_chicken: EnergyLesserPrairieChicken | null;
551
+ aviation: EnergyRenewablesAviation | null;
552
+ blm: EnergyRenewablesBlm | null;
553
+ obstacles: EnergyObstacles | null;
554
+ whooping_crane: EnergyWhoopingCrane | null;
555
+ /** Also null when the section has no state/county to match on. */
556
+ interconnection_queue: EnergyInterconnectionQueue | null;
557
+ [key: string]: unknown;
558
+ }
285
559
  /** Per-section counts. A null count means that section was not fetched. */
286
560
  interface EnergySummary {
287
561
  wells_in_section: number | null;
@@ -291,6 +565,10 @@ interface EnergySummary {
291
565
  orphaned_wells: number | null;
292
566
  pipelines_within_radius: number | null;
293
567
  fracfocus_disclosures: number | null;
568
+ /** From `renewables.grid`; null when not fetched or nothing within range. */
569
+ nearest_transmission_100kv_plus_miles: number | null;
570
+ /** From `renewables.grid`; null when not fetched or nothing within range. */
571
+ nearest_substation_230kv_plus_miles: number | null;
294
572
  [key: string]: unknown;
295
573
  }
296
574
  /** Wells section: in-section rows + the nearby radius envelope. */
@@ -335,6 +613,7 @@ interface EnergyReport {
335
613
  radius_mi: number;
336
614
  } & SectionEnvelope<FracFocusRow>;
337
615
  constraints?: EnergyConstraints | null;
616
+ renewables?: EnergyRenewables | null;
338
617
  meta: ReportMeta;
339
618
  [key: string]: unknown;
340
619
  }
@@ -876,7 +1155,9 @@ declare class TownshipClient {
876
1155
  /**
877
1156
  * Get the energy parcel report for a PLSS section. Covers state-regulator
878
1157
  * wells, operators, federal leases, county royalties, orphaned wells,
879
- * pipelines, FracFocus disclosures, and development constraints.
1158
+ * pipelines, FracFocus disclosures, development constraints, and
1159
+ * renewable siting (grid proximity, generators, NREL supply curve,
1160
+ * wildlife, aviation, BLM designations, obstacles, interconnection queue).
880
1161
  *
881
1162
  * @param legalLocation - A PLSS legal description, e.g. "NW 25 24N 1E 6th Meridian"
882
1163
  * @param options - Optional section projection (`include`)
@@ -892,6 +1173,12 @@ declare class TownshipClient {
892
1173
  * const slim = await client.energyReport('25 24N 1E 6th Meridian', {
893
1174
  * include: ['wells', 'pipelines']
894
1175
  * })
1176
+ *
1177
+ * // Renewable siting only
1178
+ * const siting = await client.energyReport('25 24N 1E 6th Meridian', {
1179
+ * include: ['renewables']
1180
+ * })
1181
+ * console.log(siting.renewables?.grid?.nearest_line_100kv_plus?.distance_miles)
895
1182
  * ```
896
1183
  */
897
1184
  energyReport(legalLocation: string, options?: EnergyReportOptions): Promise<EnergyReport>;
@@ -1020,4 +1307,4 @@ declare class PayloadTooLargeError extends TownshipError {
1020
1307
  constructor(message?: string, code?: string | null);
1021
1308
  }
1022
1309
 
1023
- export { AuthenticationError, type AutocompleteOptions, type BatchReverseOptions, type BatchSearchOptions, type CriticalHabitatRow, type CropHistory, type Elevation, type EnergyConstraints, type EnergyLeaseRow, type EnergyOperatorRow, type EnergyOrphanedWellRow, type EnergyPipelineRow, type EnergyRenewableSiting, type EnergyReport, type EnergyReportOptions, type EnergyReportSection, type EnergyRoyalties, type EnergyRoyaltyItem, type EnergySageGrouse, type EnergySageGrouseHabitat, type EnergySplitEstate, type EnergySplitEstateSide, type EnergySummary, type EnergyWellRow, type EnergyWells, type EntityRef, type FeatureProperties, type FederalLandReport, type FederalLandReportOptions, type FederalLandReportSection, type FederalLeaseRow, type FireshedRow, type FloodZoneRow, type FracFocusRow, type GeoJSONBoundary, type GeoJSONFeature, type GeoJSONFeatureCollection, type GeoJSONMultiPolygon, type GeoJSONPoint, type GeoJSONPolygon, type LatLng, type MiningClaimRow, NotFoundError, type OrphanedWellRow, PayloadTooLargeError, type PublicAccessRow, RateLimitError, type ReportMeta, type ReportParcel, type ReverseOptions, type RightOfWayRow, type SearchResult, type SectionEnvelope, type SectionSource, type SoilRow, type SurfaceManagementRow, type SurveySystem, type TexasAbstractRef, type TexasActiveWellRow, type TexasCoastalErosionRow, type TexasDecline, type TexasDeclineCurvePoint, type TexasDeclineFit, type TexasMonthlyVolume, type TexasPendingPermitRow, type TexasPipelineRow, type TexasProduction, type TexasProductionBlock, type TexasProductionLease, type TexasProductionOptions, type TexasProductionSummary, type TexasPsfLandRow, type TexasReport, type TexasReportOptions, type TexasReportSection, type TexasStateAgencyLandRow, type TexasStateLeaseRow, type TexasStateUnitRow, type TexasUplandLeaseRow, type TexasWell, type TexasWellLocation, type TexasWellSeriesPoint, type TexasWellSeriesUnit, type TexasWellUnit, TownshipClient, type TownshipClientOptions, TownshipError, type UnavailableSection, type Unit, ValidationError, type WetlandRow, type WildfireRiskRow };
1310
+ export { AuthenticationError, type AutocompleteOptions, type BatchReverseOptions, type BatchSearchOptions, type CriticalHabitatRow, type CropHistory, type Elevation, type EnergyAltitude, type EnergyConstraints, type EnergyGeneratorGroup, type EnergyGeneratorTotals, type EnergyInferredSubstation, type EnergyInterconnectionQueue, type EnergyLeaseRow, type EnergyLesserPrairieChicken, type EnergyLpcCategory, type EnergyMilitaryTrainingRoute, type EnergyNrelCell, type EnergyObstacleGroup, type EnergyObstacles, type EnergyOperatorRow, type EnergyOrphanedWellRow, type EnergyPipelineRow, type EnergyPlant, type EnergyPvFootprint, type EnergyQueueProject, type EnergyRenewableRowCase, type EnergyRenewableSiting, type EnergyRenewables, type EnergyRenewablesAviation, type EnergyRenewablesBlm, type EnergyRenewablesGrid, type EnergyRenewablesProjects, type EnergyReport, type EnergyReportOptions, type EnergyReportSection, type EnergyRoyalties, type EnergyRoyaltyItem, type EnergySageGrouse, type EnergySageGrouseHabitat, type EnergySection368Corridor, type EnergySolarEnergyZone, type EnergySpecialUseAirspace, type EnergySplitEstate, type EnergySplitEstateSide, type EnergySummary, type EnergyTallestObstacle, type EnergyTransmissionLine, type EnergyWellRow, type EnergyWells, type EnergyWhoopingCrane, type EnergyWindTurbines, type EntityRef, type FeatureProperties, type FederalLandReport, type FederalLandReportOptions, type FederalLandReportSection, type FederalLeaseRow, type FireshedRow, type FloodZoneRow, type FracFocusRow, type GeoJSONBoundary, type GeoJSONFeature, type GeoJSONFeatureCollection, type GeoJSONMultiPolygon, type GeoJSONPoint, type GeoJSONPolygon, type LatLng, type MiningClaimRow, NotFoundError, type OrphanedWellRow, PayloadTooLargeError, type PublicAccessRow, RateLimitError, type ReportMeta, type ReportParcel, type ReverseOptions, type RightOfWayRow, type SearchResult, type SectionEnvelope, type SectionSource, type SoilRow, type SurfaceManagementRow, type SurveySystem, type TexasAbstractRef, type TexasActiveWellRow, type TexasCoastalErosionRow, type TexasDecline, type TexasDeclineCurvePoint, type TexasDeclineFit, type TexasMonthlyVolume, type TexasPendingPermitRow, type TexasPipelineRow, type TexasProduction, type TexasProductionBlock, type TexasProductionLease, type TexasProductionOptions, type TexasProductionSummary, type TexasPsfLandRow, type TexasReport, type TexasReportOptions, type TexasReportSection, type TexasStateAgencyLandRow, type TexasStateLeaseRow, type TexasStateUnitRow, type TexasUplandLeaseRow, type TexasWell, type TexasWellLocation, type TexasWellSeriesPoint, type TexasWellSeriesUnit, type TexasWellUnit, TownshipClient, type TownshipClientOptions, TownshipError, type UnavailableSection, type Unit, ValidationError, type WetlandRow, type WildfireRiskRow };
package/dist/index.js CHANGED
@@ -85,7 +85,7 @@ var TownshipClient = class {
85
85
  ...init,
86
86
  headers: {
87
87
  "X-API-Key": this.apiKey,
88
- "User-Agent": "townshipamerica-js/2.0.0",
88
+ "User-Agent": "townshipamerica-js/2.1.0",
89
89
  ...init?.headers ?? {}
90
90
  },
91
91
  signal: controller.signal
@@ -305,7 +305,9 @@ var TownshipClient = class {
305
305
  /**
306
306
  * Get the energy parcel report for a PLSS section. Covers state-regulator
307
307
  * wells, operators, federal leases, county royalties, orphaned wells,
308
- * pipelines, FracFocus disclosures, and development constraints.
308
+ * pipelines, FracFocus disclosures, development constraints, and
309
+ * renewable siting (grid proximity, generators, NREL supply curve,
310
+ * wildlife, aviation, BLM designations, obstacles, interconnection queue).
309
311
  *
310
312
  * @param legalLocation - A PLSS legal description, e.g. "NW 25 24N 1E 6th Meridian"
311
313
  * @param options - Optional section projection (`include`)
@@ -321,6 +323,12 @@ var TownshipClient = class {
321
323
  * const slim = await client.energyReport('25 24N 1E 6th Meridian', {
322
324
  * include: ['wells', 'pipelines']
323
325
  * })
326
+ *
327
+ * // Renewable siting only
328
+ * const siting = await client.energyReport('25 24N 1E 6th Meridian', {
329
+ * include: ['renewables']
330
+ * })
331
+ * console.log(siting.renewables?.grid?.nearest_line_100kv_plus?.distance_miles)
324
332
  * ```
325
333
  */
326
334
  async energyReport(legalLocation, options) {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/errors.ts","../src/client.ts"],"sourcesContent":["/**\n * Base error class for all Township SDK errors.\n *\n * `code` carries the machine-readable error code the Energy, Federal Land,\n * and Texas APIs return in v1 error bodies (`{\"error\": {\"code\", \"message\"}}`),\n * e.g. `invalid_parameter`, `missing_parameter`, `plss_not_supported`,\n * `ambiguous_location`, `not_found`, `rate_limit_exceeded`. It is null for\n * endpoints that do not send one.\n */\nexport class TownshipError extends Error {\n constructor(\n message: string,\n public readonly statusCode: number | null = null,\n public readonly code: string | null = null\n ) {\n super(message);\n this.name = \"TownshipError\";\n }\n}\n\n/**\n * Thrown when the API key is missing or invalid (HTTP 401).\n */\nexport class AuthenticationError extends TownshipError {\n constructor(message = \"Invalid or missing API key\", code: string | null = null) {\n super(message, 401, code);\n this.name = \"AuthenticationError\";\n }\n}\n\n/**\n * Thrown when no result is found for the given input.\n */\nexport class NotFoundError extends TownshipError {\n constructor(message = \"Location not found\", code: string | null = null) {\n super(message, 404, code);\n this.name = \"NotFoundError\";\n }\n}\n\n/**\n * Thrown when the API rate limit is exceeded (HTTP 429).\n */\nexport class RateLimitError extends TownshipError {\n constructor(\n message = \"Rate limit exceeded. Please slow down your requests.\",\n code: string | null = null\n ) {\n super(message, 429, code);\n this.name = \"RateLimitError\";\n }\n}\n\n/**\n * Thrown when the request is malformed (HTTP 400).\n */\nexport class ValidationError extends TownshipError {\n constructor(message = \"Invalid request\", code: string | null = null) {\n super(message, 400, code);\n this.name = \"ValidationError\";\n }\n}\n\n/**\n * Thrown when the batch payload exceeds the maximum size (HTTP 413).\n */\nexport class PayloadTooLargeError extends TownshipError {\n constructor(\n message = \"Batch payload exceeds the maximum of 100 records per request\",\n code: string | null = null\n ) {\n super(message, 413, code);\n this.name = \"PayloadTooLargeError\";\n }\n}\n","import {\n AuthenticationError,\n NotFoundError,\n PayloadTooLargeError,\n RateLimitError,\n TownshipError,\n ValidationError\n} from \"./errors.js\";\nimport type {\n AutocompleteOptions,\n BatchReverseOptions,\n BatchSearchOptions,\n EnergyReport,\n EnergyReportOptions,\n FederalLandReport,\n FederalLandReportOptions,\n GeoJSONBoundary,\n GeoJSONFeatureCollection,\n ReverseOptions,\n SearchResult,\n TexasProduction,\n TexasProductionOptions,\n TexasReport,\n TexasReportOptions,\n TexasWell,\n TownshipClientOptions\n} from \"./types.js\";\n\nconst DEFAULT_BASE_URL = \"https://developer.townshipamerica.com\";\nconst DEFAULT_TIMEOUT = 30_000;\nconst MAX_BATCH_SIZE = 100;\n\nfunction toSearchResult(fc: GeoJSONFeatureCollection): SearchResult {\n const centroid = fc.features.find((f) => f.properties.shape === \"centroid\");\n const grid = fc.features.find((f) => f.properties.shape === \"grid\");\n\n const props = centroid?.properties ?? grid?.properties;\n if (!props) {\n throw new TownshipError(\"Unexpected API response: no features returned\");\n }\n\n const [lng, lat] = centroid ? (centroid.geometry.coordinates as [number, number]) : [0, 0];\n\n return {\n legalLocation: props.legal_location,\n latitude: lat,\n longitude: lng,\n state: props.state,\n county: props.county,\n unit: props.unit,\n surveySystem: props.survey_system,\n alternateLegalLocation: props.alternate_legal_location,\n boundary: grid ? (grid.geometry as GeoJSONBoundary) : null,\n raw: fc\n };\n}\n\nexport class TownshipClient {\n private readonly baseUrl: string;\n private readonly apiKey: string;\n private readonly timeout: number;\n\n constructor(options: TownshipClientOptions) {\n this.apiKey = options.apiKey;\n this.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\\/+$/, \"\");\n this.timeout = options.timeout ?? DEFAULT_TIMEOUT;\n\n if (!this.apiKey) {\n throw new TownshipError(\"apiKey is required\");\n }\n }\n\n // --- Internal ---\n\n private async request<T>(path: string, init?: RequestInit): Promise<T> {\n const url = `${this.baseUrl}${path}`;\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), this.timeout);\n\n try {\n const response = await fetch(url, {\n ...init,\n headers: {\n \"X-API-Key\": this.apiKey,\n \"User-Agent\": \"townshipamerica-js/2.0.0\",\n ...(init?.headers ?? {})\n },\n signal: controller.signal\n });\n\n if (!response.ok) {\n await this.handleError(response);\n }\n\n return (await response.json()) as T;\n } catch (error) {\n if (error instanceof TownshipError) throw error;\n if (error instanceof DOMException && error.name === \"AbortError\") {\n throw new TownshipError(\"Request timed out\");\n }\n throw new TownshipError(error instanceof Error ? error.message : \"Unknown error\");\n } finally {\n clearTimeout(timer);\n }\n }\n\n private async handleError(response: Response): Promise<never> {\n let message: string;\n let code: string | null = null;\n try {\n const body = (await response.json()) as {\n error?: { code?: string; message?: string } | string;\n message?: string;\n };\n // Energy/Federal Land/Texas v1 error bodies are {\"error\": {\"code\", \"message\"}}\n if (body.error && typeof body.error === \"object\") {\n message = body.error.message ?? response.statusText;\n code = body.error.code ?? null;\n } else {\n message =\n (typeof body.error === \"string\" ? body.error : undefined) ??\n body.message ??\n response.statusText;\n }\n } catch {\n message = response.statusText;\n }\n\n const status = response.status;\n if (status === 400) throw new ValidationError(message, code);\n if (status === 401) throw new AuthenticationError(message, code);\n if (status === 404) throw new NotFoundError(message, code);\n if (status === 413) throw new PayloadTooLargeError(message, code);\n if (status === 429) throw new RateLimitError(message, code);\n throw new TownshipError(message, status, code);\n }\n\n // --- Search ---\n\n /**\n * Convert a PLSS or Texas TXSS legal land description to GPS coordinates.\n *\n * @param legalLocation - e.g. \"NW 25 24N 1E 6th Meridian\" or \"A-175 Reeves County\"\n * @returns A SearchResult with coordinates, boundary, and metadata.\n * @throws {ValidationError} If the location string is invalid.\n * @throws {NotFoundError} If no match is found.\n */\n async search(legalLocation: string): Promise<SearchResult> {\n const params = new URLSearchParams({ location: legalLocation });\n const data = await this.request<GeoJSONFeatureCollection | Record<string, never>>(\n `/search/legal-location?${params}`\n );\n\n if (!(\"features\" in data) || !data.features?.length) {\n throw new NotFoundError(`No results found for \"${legalLocation}\"`);\n }\n\n return toSearchResult(data as GeoJSONFeatureCollection);\n }\n\n /**\n * Find the legal land description at the given GPS coordinates (PLSS or Texas TXSS).\n *\n * @param longitude - Longitude (x) coordinate.\n * @param latitude - Latitude (y) coordinate.\n * @param options - Optional PLSS unit filter (ignored for TXSS results).\n * @returns A SearchResult or array of SearchResults (when unit is 'all').\n */\n async reverse(\n longitude: number,\n latitude: number,\n options?: ReverseOptions\n ): Promise<SearchResult | SearchResult[]> {\n const params = new URLSearchParams({\n location: `${longitude},${latitude}`\n });\n if (options?.unit) {\n params.set(\"unit\", options.unit);\n }\n\n const data = await this.request<GeoJSONFeatureCollection | Record<string, never>>(\n `/search/coordinates?${params}`\n );\n\n if (!(\"features\" in data) || !data.features?.length) {\n throw new NotFoundError(`No results found for coordinates [${longitude}, ${latitude}]`);\n }\n\n const fc = data as GeoJSONFeatureCollection;\n\n if (options?.unit === \"all\") {\n const groups = new Map<string, typeof fc.features>();\n for (const feature of fc.features) {\n const key = feature.properties.legal_location;\n if (!groups.has(key)) groups.set(key, []);\n groups.get(key)!.push(feature);\n }\n\n return Array.from(groups.values()).map((features) => {\n return toSearchResult({ type: \"FeatureCollection\", features });\n });\n }\n\n return toSearchResult(fc);\n }\n\n // --- Autocomplete ---\n\n /**\n * Get autocomplete suggestions for a partial PLSS or Texas TXSS description.\n *\n * @param query - Partial search query (minimum 2 characters).\n * @param options - Optional limit (1–10, default 3) and proximity.\n * @returns Raw GeoJSON FeatureCollection with suggestion features.\n */\n async autocomplete(\n query: string,\n options?: AutocompleteOptions\n ): Promise<GeoJSONFeatureCollection> {\n const params = new URLSearchParams({ location: query });\n if (options?.limit != null) {\n params.set(\"limit\", String(options.limit));\n }\n if (options?.proximity) {\n params.set(\"proximity\", `${options.proximity[0]},${options.proximity[1]}`);\n }\n\n return this.request<GeoJSONFeatureCollection>(`/autocomplete/legal-location?${params}`);\n }\n\n // --- Batch ---\n\n /**\n * Convert multiple legal land descriptions to GPS coordinates in one request.\n * Auto-chunks if more than 100 items. Mix PLSS and Texas TXSS inputs freely.\n *\n * @param locations - Array of legal land descriptions.\n * @param options - Optional chunk size.\n * @returns Array of SearchResult or null for each input.\n */\n async batchSearch(\n locations: string[],\n options?: BatchSearchOptions\n ): Promise<(SearchResult | null)[]> {\n const chunkSize = Math.min(options?.chunkSize ?? MAX_BATCH_SIZE, MAX_BATCH_SIZE);\n const results: (SearchResult | null)[] = [];\n\n for (let i = 0; i < locations.length; i += chunkSize) {\n const chunk = locations.slice(i, i + chunkSize);\n const data = await this.request<(GeoJSONFeatureCollection | null)[]>(\n \"/batch/legal-location\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(chunk)\n }\n );\n\n for (const fc of data) {\n if (!fc || !fc.features?.length) {\n results.push(null);\n } else {\n results.push(toSearchResult(fc));\n }\n }\n }\n\n return results;\n }\n\n /**\n * Find legal land descriptions for multiple coordinate pairs in one request.\n * Auto-chunks if more than 100 items.\n *\n * @param coordinates - Array of [longitude, latitude] pairs.\n * @param options - Optional PLSS unit filter and chunk size.\n * @returns Array of SearchResult or null for each input.\n */\n async batchReverse(\n coordinates: [number, number][],\n options?: BatchReverseOptions\n ): Promise<(SearchResult | null)[]> {\n const chunkSize = Math.min(options?.chunkSize ?? MAX_BATCH_SIZE, MAX_BATCH_SIZE);\n const results: (SearchResult | null)[] = [];\n\n for (let i = 0; i < coordinates.length; i += chunkSize) {\n const chunk = coordinates.slice(i, i + chunkSize);\n const body: Record<string, unknown> = { coordinates: chunk };\n if (options?.unit) {\n body.unit = options.unit;\n }\n\n const data = await this.request<\n (GeoJSONFeatureCollection | null)[] | GeoJSONFeatureCollection\n >(\"/batch/coordinates\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(body)\n });\n\n if (Array.isArray(data)) {\n for (const fc of data) {\n if (!fc || !fc.features?.length) {\n results.push(null);\n } else {\n results.push(toSearchResult(fc));\n }\n }\n } else if (data && \"features\" in data) {\n // unit=all returns a single FeatureCollection — split by legal_location\n const groups = new Map<string, typeof data.features>();\n for (const feature of data.features) {\n const key = JSON.stringify(feature.properties.search_term);\n if (!groups.has(key)) groups.set(key, []);\n groups.get(key)!.push(feature);\n }\n for (const features of groups.values()) {\n results.push(toSearchResult({ type: \"FeatureCollection\", features }));\n }\n }\n }\n\n return results;\n }\n\n // --- Convenience ---\n\n /**\n * Get the boundary polygon for a legal land description.\n *\n * @param legalLocation - e.g. \"NW 25 24N 1E 6th Meridian\"\n * @returns The boundary GeoJSON Polygon, or null if not found.\n */\n async boundary(legalLocation: string): Promise<GeoJSONBoundary | null> {\n const result = await this.search(legalLocation);\n return result.boundary;\n }\n\n /**\n * Get the raw GeoJSON FeatureCollection for a legal land description.\n *\n * @param legalLocation - e.g. \"NW 25 24N 1E 6th Meridian\"\n * @returns The raw GeoJSON FeatureCollection from the API.\n */\n async raw(legalLocation: string): Promise<GeoJSONFeatureCollection> {\n const params = new URLSearchParams({ location: legalLocation });\n const data = await this.request<GeoJSONFeatureCollection | Record<string, never>>(\n `/search/legal-location?${params}`\n );\n\n if (!(\"features\" in data)) {\n return { type: \"FeatureCollection\", features: [] };\n }\n\n return data as GeoJSONFeatureCollection;\n }\n\n // --- Energy API ---\n\n /**\n * Get the energy parcel report for a PLSS section. Covers state-regulator\n * wells, operators, federal leases, county royalties, orphaned wells,\n * pipelines, FracFocus disclosures, and development constraints.\n *\n * @param legalLocation - A PLSS legal description, e.g. \"NW 25 24N 1E 6th Meridian\"\n * @param options - Optional section projection (`include`)\n * @returns The energy report\n *\n * @example\n * ```ts\n * const report = await client.energyReport('25 24N 1E 6th Meridian')\n * console.log(report.summary.wells_in_section)\n * console.log(report.wells?.in_section.rows[0]?.api_number)\n *\n * // Only the sections you need — the rest are never queried\n * const slim = await client.energyReport('25 24N 1E 6th Meridian', {\n * include: ['wells', 'pipelines']\n * })\n * ```\n */\n async energyReport(legalLocation: string, options?: EnergyReportOptions): Promise<EnergyReport> {\n const params = new URLSearchParams({ legal_location: legalLocation });\n if (options?.include?.length) params.set(\"include\", options.include.join(\",\"));\n return this.request<EnergyReport>(`/energy/report?${params}`);\n }\n\n // --- Federal Land API ---\n\n /**\n * Get the federal-land parcel report for a PLSS tract. Covers surface\n * management, BLM leases and rights-of-way, flood zones, mining claims,\n * wetlands, firesheds, soils, crop history, orphaned wells, critical\n * habitat, public access, wildfire risk, and elevation.\n *\n * @param legalLocation - A PLSS legal description, e.g. \"NW 25 24N 1E 6th Meridian\"\n * @param options - Optional section projection (`include`)\n * @returns The federal-land report\n *\n * @example\n * ```ts\n * const report = await client.federalLandReport('NW 25 24N 1E 6th Meridian')\n * console.log(report.surface_management?.rows[0]?.agency)\n *\n * // Only the sections you need — the pruned layers' queries never run\n * const slim = await client.federalLandReport('NW 25 24N 1E 6th Meridian', {\n * include: ['og_leases', 'flood_zones']\n * })\n * ```\n */\n async federalLandReport(\n legalLocation: string,\n options?: FederalLandReportOptions\n ): Promise<FederalLandReport> {\n const params = new URLSearchParams({ legal_location: legalLocation });\n if (options?.include?.length) params.set(\"include\", options.include.join(\",\"));\n return this.request<FederalLandReport>(`/federal-land/report?${params}`);\n }\n\n // --- Texas API ---\n\n /**\n * Get the Texas abstract report for a TXSS legal description. Covers GLO\n * state leases and units, PSF lands, RRC wells and pipelines, pending\n * permits, coastal erosion, federal overlays, and RRC lease production.\n *\n * @param legalLocation - A Texas legal description, e.g. \"A-175 Reeves County\"\n * @param options - Optional section projection (`include`)\n * @returns The Texas report\n *\n * @example\n * ```ts\n * const report = await client.texasReport('A-175 Reeves County')\n * console.log(report.active_wells?.rows[0]?.api_number)\n * console.log(report.production?.summary.total_cum_boe)\n *\n * // Only the sections you need — the rest are never queried\n * const slim = await client.texasReport('A-175 Reeves County', {\n * include: ['state_leases', 'production']\n * })\n * ```\n */\n async texasReport(legalLocation: string, options?: TexasReportOptions): Promise<TexasReport> {\n const params = new URLSearchParams({ legal_location: legalLocation });\n if (options?.include?.length) params.set(\"include\", options.include.join(\",\"));\n return this.request<TexasReport>(`/texas/report?${params}`);\n }\n\n /**\n * Get RRC lease production for a Texas abstract — per-lease lifetime\n * totals, trailing-12-month volumes, and the 60-month monthly series.\n * Production is reported by RRC at the LEASE level: rows are the leases\n * whose wells fall on the abstract, never sub-allocated to the tract.\n *\n * @param options - Either `{legalLocation}` or `{countyFips, abstractNo, blockNo?}`\n * @returns The abstract production rollup\n *\n * @example\n * ```ts\n * const byLocation = await client.texasProduction({ legalLocation: 'A-175 Reeves County' })\n * const byKeys = await client.texasProduction({ countyFips: '48389', abstractNo: '175' })\n * console.log(byKeys.summary.total_cum_boe)\n * ```\n */\n async texasProduction(options: TexasProductionOptions): Promise<TexasProduction> {\n const params = new URLSearchParams();\n if (options.legalLocation != null) {\n params.set(\"legal_location\", options.legalLocation);\n } else if (options.countyFips != null && options.abstractNo != null) {\n params.set(\"county_fips\", options.countyFips);\n params.set(\"abstract_no\", options.abstractNo);\n if (options.blockNo != null) params.set(\"block_no\", options.blockNo);\n } else {\n throw new TownshipError(\n \"texasProduction requires either legalLocation or countyFips + abstractNo\"\n );\n }\n return this.request<TexasProduction>(`/texas/production?${params}`);\n }\n\n /**\n * Get per-well allocated production for a Texas well by API number —\n * summary scalars for every lease edge, the monthly series (when\n * provisioned), and an Arps decline fit. Volumes are allocated estimates:\n * RRC reports production by lease, never by well.\n *\n * @param api - API-8 or API-14 number (e.g. \"42-389-32345\" or \"42389323450000\")\n * @returns The well's units, series, and decline analysis\n *\n * @example\n * ```ts\n * const well = await client.texasWell('42-389-32345')\n * console.log(well.units[0]?.cum_boe)\n * console.log(well.decline.available && well.decline.value?.di)\n * ```\n */\n async texasWell(api: string): Promise<TexasWell> {\n return this.request<TexasWell>(`/texas/wells/${encodeURIComponent(api)}`);\n }\n}\n"],"mappings":";AASO,IAAM,gBAAN,cAA4B,MAAM;AAAA,EACvC,YACE,SACgB,aAA4B,MAC5B,OAAsB,MACtC;AACA,UAAM,OAAO;AAHG;AACA;AAGhB,SAAK,OAAO;AAAA,EACd;AACF;AAKO,IAAM,sBAAN,cAAkC,cAAc;AAAA,EACrD,YAAY,UAAU,8BAA8B,OAAsB,MAAM;AAC9E,UAAM,SAAS,KAAK,IAAI;AACxB,SAAK,OAAO;AAAA,EACd;AACF;AAKO,IAAM,gBAAN,cAA4B,cAAc;AAAA,EAC/C,YAAY,UAAU,sBAAsB,OAAsB,MAAM;AACtE,UAAM,SAAS,KAAK,IAAI;AACxB,SAAK,OAAO;AAAA,EACd;AACF;AAKO,IAAM,iBAAN,cAA6B,cAAc;AAAA,EAChD,YACE,UAAU,wDACV,OAAsB,MACtB;AACA,UAAM,SAAS,KAAK,IAAI;AACxB,SAAK,OAAO;AAAA,EACd;AACF;AAKO,IAAM,kBAAN,cAA8B,cAAc;AAAA,EACjD,YAAY,UAAU,m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errors.ts","../src/client.ts"],"sourcesContent":["/**\n * Base error class for all Township SDK errors.\n *\n * `code` carries the machine-readable error code the Energy, Federal Land,\n * and Texas APIs return in v1 error bodies (`{\"error\": {\"code\", \"message\"}}`),\n * e.g. `invalid_parameter`, `missing_parameter`, `plss_not_supported`,\n * `ambiguous_location`, `not_found`, `rate_limit_exceeded`. It is null for\n * endpoints that do not send one.\n */\nexport class TownshipError extends Error {\n constructor(\n message: string,\n public readonly statusCode: number | null = null,\n public readonly code: string | null = null\n ) {\n super(message);\n this.name = \"TownshipError\";\n }\n}\n\n/**\n * Thrown when the API key is missing or invalid (HTTP 401).\n */\nexport class AuthenticationError extends TownshipError {\n constructor(message = \"Invalid or missing API key\", code: string | null = null) {\n super(message, 401, code);\n this.name = \"AuthenticationError\";\n }\n}\n\n/**\n * Thrown when no result is found for the given input.\n */\nexport class NotFoundError extends TownshipError {\n constructor(message = \"Location not found\", code: string | null = null) {\n super(message, 404, code);\n this.name = \"NotFoundError\";\n }\n}\n\n/**\n * Thrown when the API rate limit is exceeded (HTTP 429).\n */\nexport class RateLimitError extends TownshipError {\n constructor(\n message = \"Rate limit exceeded. Please slow down your requests.\",\n code: string | null = null\n ) {\n super(message, 429, code);\n this.name = \"RateLimitError\";\n }\n}\n\n/**\n * Thrown when the request is malformed (HTTP 400).\n */\nexport class ValidationError extends TownshipError {\n constructor(message = \"Invalid request\", code: string | null = null) {\n super(message, 400, code);\n this.name = \"ValidationError\";\n }\n}\n\n/**\n * Thrown when the batch payload exceeds the maximum size (HTTP 413).\n */\nexport class PayloadTooLargeError extends TownshipError {\n constructor(\n message = \"Batch payload exceeds the maximum of 100 records per request\",\n code: string | null = null\n ) {\n super(message, 413, code);\n this.name = \"PayloadTooLargeError\";\n }\n}\n","import {\n AuthenticationError,\n NotFoundError,\n PayloadTooLargeError,\n RateLimitError,\n TownshipError,\n ValidationError\n} from \"./errors.js\";\nimport type {\n AutocompleteOptions,\n BatchReverseOptions,\n BatchSearchOptions,\n EnergyReport,\n EnergyReportOptions,\n FederalLandReport,\n FederalLandReportOptions,\n GeoJSONBoundary,\n GeoJSONFeatureCollection,\n ReverseOptions,\n SearchResult,\n TexasProduction,\n TexasProductionOptions,\n TexasReport,\n TexasReportOptions,\n TexasWell,\n TownshipClientOptions\n} from \"./types.js\";\n\nconst DEFAULT_BASE_URL = \"https://developer.townshipamerica.com\";\nconst DEFAULT_TIMEOUT = 30_000;\nconst MAX_BATCH_SIZE = 100;\n\nfunction toSearchResult(fc: GeoJSONFeatureCollection): SearchResult {\n const centroid = fc.features.find((f) => f.properties.shape === \"centroid\");\n const grid = fc.features.find((f) => f.properties.shape === \"grid\");\n\n const props = centroid?.properties ?? grid?.properties;\n if (!props) {\n throw new TownshipError(\"Unexpected API response: no features returned\");\n }\n\n const [lng, lat] = centroid ? (centroid.geometry.coordinates as [number, number]) : [0, 0];\n\n return {\n legalLocation: props.legal_location,\n latitude: lat,\n longitude: lng,\n state: props.state,\n county: props.county,\n unit: props.unit,\n surveySystem: props.survey_system,\n alternateLegalLocation: props.alternate_legal_location,\n boundary: grid ? (grid.geometry as GeoJSONBoundary) : null,\n raw: fc\n };\n}\n\nexport class TownshipClient {\n private readonly baseUrl: string;\n private readonly apiKey: string;\n private readonly timeout: number;\n\n constructor(options: TownshipClientOptions) {\n this.apiKey = options.apiKey;\n this.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\\/+$/, \"\");\n this.timeout = options.timeout ?? DEFAULT_TIMEOUT;\n\n if (!this.apiKey) {\n throw new TownshipError(\"apiKey is required\");\n }\n }\n\n // --- Internal ---\n\n private async request<T>(path: string, init?: RequestInit): Promise<T> {\n const url = `${this.baseUrl}${path}`;\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), this.timeout);\n\n try {\n const response = await fetch(url, {\n ...init,\n headers: {\n \"X-API-Key\": this.apiKey,\n \"User-Agent\": \"townshipamerica-js/2.1.0\",\n ...(init?.headers ?? {})\n },\n signal: controller.signal\n });\n\n if (!response.ok) {\n await this.handleError(response);\n }\n\n return (await response.json()) as T;\n } catch (error) {\n if (error instanceof TownshipError) throw error;\n if (error instanceof DOMException && error.name === \"AbortError\") {\n throw new TownshipError(\"Request timed out\");\n }\n throw new TownshipError(error instanceof Error ? error.message : \"Unknown error\");\n } finally {\n clearTimeout(timer);\n }\n }\n\n private async handleError(response: Response): Promise<never> {\n let message: string;\n let code: string | null = null;\n try {\n const body = (await response.json()) as {\n error?: { code?: string; message?: string } | string;\n message?: string;\n };\n // Energy/Federal Land/Texas v1 error bodies are {\"error\": {\"code\", \"message\"}}\n if (body.error && typeof body.error === \"object\") {\n message = body.error.message ?? response.statusText;\n code = body.error.code ?? null;\n } else {\n message =\n (typeof body.error === \"string\" ? body.error : undefined) ??\n body.message ??\n response.statusText;\n }\n } catch {\n message = response.statusText;\n }\n\n const status = response.status;\n if (status === 400) throw new ValidationError(message, code);\n if (status === 401) throw new AuthenticationError(message, code);\n if (status === 404) throw new NotFoundError(message, code);\n if (status === 413) throw new PayloadTooLargeError(message, code);\n if (status === 429) throw new RateLimitError(message, code);\n throw new TownshipError(message, status, code);\n }\n\n // --- Search ---\n\n /**\n * Convert a PLSS or Texas TXSS legal land description to GPS coordinates.\n *\n * @param legalLocation - e.g. \"NW 25 24N 1E 6th Meridian\" or \"A-175 Reeves County\"\n * @returns A SearchResult with coordinates, boundary, and metadata.\n * @throws {ValidationError} If the location string is invalid.\n * @throws {NotFoundError} If no match is found.\n */\n async search(legalLocation: string): Promise<SearchResult> {\n const params = new URLSearchParams({ location: legalLocation });\n const data = await this.request<GeoJSONFeatureCollection | Record<string, never>>(\n `/search/legal-location?${params}`\n );\n\n if (!(\"features\" in data) || !data.features?.length) {\n throw new NotFoundError(`No results found for \"${legalLocation}\"`);\n }\n\n return toSearchResult(data as GeoJSONFeatureCollection);\n }\n\n /**\n * Find the legal land description at the given GPS coordinates (PLSS or Texas TXSS).\n *\n * @param longitude - Longitude (x) coordinate.\n * @param latitude - Latitude (y) coordinate.\n * @param options - Optional PLSS unit filter (ignored for TXSS results).\n * @returns A SearchResult or array of SearchResults (when unit is 'all').\n */\n async reverse(\n longitude: number,\n latitude: number,\n options?: ReverseOptions\n ): Promise<SearchResult | SearchResult[]> {\n const params = new URLSearchParams({\n location: `${longitude},${latitude}`\n });\n if (options?.unit) {\n params.set(\"unit\", options.unit);\n }\n\n const data = await this.request<GeoJSONFeatureCollection | Record<string, never>>(\n `/search/coordinates?${params}`\n );\n\n if (!(\"features\" in data) || !data.features?.length) {\n throw new NotFoundError(`No results found for coordinates [${longitude}, ${latitude}]`);\n }\n\n const fc = data as GeoJSONFeatureCollection;\n\n if (options?.unit === \"all\") {\n const groups = new Map<string, typeof fc.features>();\n for (const feature of fc.features) {\n const key = feature.properties.legal_location;\n if (!groups.has(key)) groups.set(key, []);\n groups.get(key)!.push(feature);\n }\n\n return Array.from(groups.values()).map((features) => {\n return toSearchResult({ type: \"FeatureCollection\", features });\n });\n }\n\n return toSearchResult(fc);\n }\n\n // --- Autocomplete ---\n\n /**\n * Get autocomplete suggestions for a partial PLSS or Texas TXSS description.\n *\n * @param query - Partial search query (minimum 2 characters).\n * @param options - Optional limit (1–10, default 3) and proximity.\n * @returns Raw GeoJSON FeatureCollection with suggestion features.\n */\n async autocomplete(\n query: string,\n options?: AutocompleteOptions\n ): Promise<GeoJSONFeatureCollection> {\n const params = new URLSearchParams({ location: query });\n if (options?.limit != null) {\n params.set(\"limit\", String(options.limit));\n }\n if (options?.proximity) {\n params.set(\"proximity\", `${options.proximity[0]},${options.proximity[1]}`);\n }\n\n return this.request<GeoJSONFeatureCollection>(`/autocomplete/legal-location?${params}`);\n }\n\n // --- Batch ---\n\n /**\n * Convert multiple legal land descriptions to GPS coordinates in one request.\n * Auto-chunks if more than 100 items. Mix PLSS and Texas TXSS inputs freely.\n *\n * @param locations - Array of legal land descriptions.\n * @param options - Optional chunk size.\n * @returns Array of SearchResult or null for each input.\n */\n async batchSearch(\n locations: string[],\n options?: BatchSearchOptions\n ): Promise<(SearchResult | null)[]> {\n const chunkSize = Math.min(options?.chunkSize ?? MAX_BATCH_SIZE, MAX_BATCH_SIZE);\n const results: (SearchResult | null)[] = [];\n\n for (let i = 0; i < locations.length; i += chunkSize) {\n const chunk = locations.slice(i, i + chunkSize);\n const data = await this.request<(GeoJSONFeatureCollection | null)[]>(\n \"/batch/legal-location\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(chunk)\n }\n );\n\n for (const fc of data) {\n if (!fc || !fc.features?.length) {\n results.push(null);\n } else {\n results.push(toSearchResult(fc));\n }\n }\n }\n\n return results;\n }\n\n /**\n * Find legal land descriptions for multiple coordinate pairs in one request.\n * Auto-chunks if more than 100 items.\n *\n * @param coordinates - Array of [longitude, latitude] pairs.\n * @param options - Optional PLSS unit filter and chunk size.\n * @returns Array of SearchResult or null for each input.\n */\n async batchReverse(\n coordinates: [number, number][],\n options?: BatchReverseOptions\n ): Promise<(SearchResult | null)[]> {\n const chunkSize = Math.min(options?.chunkSize ?? MAX_BATCH_SIZE, MAX_BATCH_SIZE);\n const results: (SearchResult | null)[] = [];\n\n for (let i = 0; i < coordinates.length; i += chunkSize) {\n const chunk = coordinates.slice(i, i + chunkSize);\n const body: Record<string, unknown> = { coordinates: chunk };\n if (options?.unit) {\n body.unit = options.unit;\n }\n\n const data = await this.request<\n (GeoJSONFeatureCollection | null)[] | GeoJSONFeatureCollection\n >(\"/batch/coordinates\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(body)\n });\n\n if (Array.isArray(data)) {\n for (const fc of data) {\n if (!fc || !fc.features?.length) {\n results.push(null);\n } else {\n results.push(toSearchResult(fc));\n }\n }\n } else if (data && \"features\" in data) {\n // unit=all returns a single FeatureCollection — split by legal_location\n const groups = new Map<string, typeof data.features>();\n for (const feature of data.features) {\n const key = JSON.stringify(feature.properties.search_term);\n if (!groups.has(key)) groups.set(key, []);\n groups.get(key)!.push(feature);\n }\n for (const features of groups.values()) {\n results.push(toSearchResult({ type: \"FeatureCollection\", features }));\n }\n }\n }\n\n return results;\n }\n\n // --- Convenience ---\n\n /**\n * Get the boundary polygon for a legal land description.\n *\n * @param legalLocation - e.g. \"NW 25 24N 1E 6th Meridian\"\n * @returns The boundary GeoJSON Polygon, or null if not found.\n */\n async boundary(legalLocation: string): Promise<GeoJSONBoundary | null> {\n const result = await this.search(legalLocation);\n return result.boundary;\n }\n\n /**\n * Get the raw GeoJSON FeatureCollection for a legal land description.\n *\n * @param legalLocation - e.g. \"NW 25 24N 1E 6th Meridian\"\n * @returns The raw GeoJSON FeatureCollection from the API.\n */\n async raw(legalLocation: string): Promise<GeoJSONFeatureCollection> {\n const params = new URLSearchParams({ location: legalLocation });\n const data = await this.request<GeoJSONFeatureCollection | Record<string, never>>(\n `/search/legal-location?${params}`\n );\n\n if (!(\"features\" in data)) {\n return { type: \"FeatureCollection\", features: [] };\n }\n\n return data as GeoJSONFeatureCollection;\n }\n\n // --- Energy API ---\n\n /**\n * Get the energy parcel report for a PLSS section. Covers state-regulator\n * wells, operators, federal leases, county royalties, orphaned wells,\n * pipelines, FracFocus disclosures, development constraints, and\n * renewable siting (grid proximity, generators, NREL supply curve,\n * wildlife, aviation, BLM designations, obstacles, interconnection queue).\n *\n * @param legalLocation - A PLSS legal description, e.g. \"NW 25 24N 1E 6th Meridian\"\n * @param options - Optional section projection (`include`)\n * @returns The energy report\n *\n * @example\n * ```ts\n * const report = await client.energyReport('25 24N 1E 6th Meridian')\n * console.log(report.summary.wells_in_section)\n * console.log(report.wells?.in_section.rows[0]?.api_number)\n *\n * // Only the sections you need — the rest are never queried\n * const slim = await client.energyReport('25 24N 1E 6th Meridian', {\n * include: ['wells', 'pipelines']\n * })\n *\n * // Renewable siting only\n * const siting = await client.energyReport('25 24N 1E 6th Meridian', {\n * include: ['renewables']\n * })\n * console.log(siting.renewables?.grid?.nearest_line_100kv_plus?.distance_miles)\n * ```\n */\n async energyReport(legalLocation: string, options?: EnergyReportOptions): Promise<EnergyReport> {\n const params = new URLSearchParams({ legal_location: legalLocation });\n if (options?.include?.length) params.set(\"include\", options.include.join(\",\"));\n return this.request<EnergyReport>(`/energy/report?${params}`);\n }\n\n // --- Federal Land API ---\n\n /**\n * Get the federal-land parcel report for a PLSS tract. Covers surface\n * management, BLM leases and rights-of-way, flood zones, mining claims,\n * wetlands, firesheds, soils, crop history, orphaned wells, critical\n * habitat, public access, wildfire risk, and elevation.\n *\n * @param legalLocation - A PLSS legal description, e.g. \"NW 25 24N 1E 6th Meridian\"\n * @param options - Optional section projection (`include`)\n * @returns The federal-land report\n *\n * @example\n * ```ts\n * const report = await client.federalLandReport('NW 25 24N 1E 6th Meridian')\n * console.log(report.surface_management?.rows[0]?.agency)\n *\n * // Only the sections you need — the pruned layers' queries never run\n * const slim = await client.federalLandReport('NW 25 24N 1E 6th Meridian', {\n * include: ['og_leases', 'flood_zones']\n * })\n * ```\n */\n async federalLandReport(\n legalLocation: string,\n options?: FederalLandReportOptions\n ): Promise<FederalLandReport> {\n const params = new URLSearchParams({ legal_location: legalLocation });\n if (options?.include?.length) params.set(\"include\", options.include.join(\",\"));\n return this.request<FederalLandReport>(`/federal-land/report?${params}`);\n }\n\n // --- Texas API ---\n\n /**\n * Get the Texas abstract report for a TXSS legal description. Covers GLO\n * state leases and units, PSF lands, RRC wells and pipelines, pending\n * permits, coastal erosion, federal overlays, and RRC lease production.\n *\n * @param legalLocation - A Texas legal description, e.g. \"A-175 Reeves County\"\n * @param options - Optional section projection (`include`)\n * @returns The Texas report\n *\n * @example\n * ```ts\n * const report = await client.texasReport('A-175 Reeves County')\n * console.log(report.active_wells?.rows[0]?.api_number)\n * console.log(report.production?.summary.total_cum_boe)\n *\n * // Only the sections you need — the rest are never queried\n * const slim = await client.texasReport('A-175 Reeves County', {\n * include: ['state_leases', 'production']\n * })\n * ```\n */\n async texasReport(legalLocation: string, options?: TexasReportOptions): Promise<TexasReport> {\n const params = new URLSearchParams({ legal_location: legalLocation });\n if (options?.include?.length) params.set(\"include\", options.include.join(\",\"));\n return this.request<TexasReport>(`/texas/report?${params}`);\n }\n\n /**\n * Get RRC lease production for a Texas abstract — per-lease lifetime\n * totals, trailing-12-month volumes, and the 60-month monthly series.\n * Production is reported by RRC at the LEASE level: rows are the leases\n * whose wells fall on the abstract, never sub-allocated to the tract.\n *\n * @param options - Either `{legalLocation}` or `{countyFips, abstractNo, blockNo?}`\n * @returns The abstract production rollup\n *\n * @example\n * ```ts\n * const byLocation = await client.texasProduction({ legalLocation: 'A-175 Reeves County' })\n * const byKeys = await client.texasProduction({ countyFips: '48389', abstractNo: '175' })\n * console.log(byKeys.summary.total_cum_boe)\n * ```\n */\n async texasProduction(options: TexasProductionOptions): Promise<TexasProduction> {\n const params = new URLSearchParams();\n if (options.legalLocation != null) {\n params.set(\"legal_location\", options.legalLocation);\n } else if (options.countyFips != null && options.abstractNo != null) {\n params.set(\"county_fips\", options.countyFips);\n params.set(\"abstract_no\", options.abstractNo);\n if (options.blockNo != null) params.set(\"block_no\", options.blockNo);\n } else {\n throw new TownshipError(\n \"texasProduction requires either legalLocation or countyFips + abstractNo\"\n );\n }\n return this.request<TexasProduction>(`/texas/production?${params}`);\n }\n\n /**\n * Get per-well allocated production for a Texas well by API number —\n * summary scalars for every lease edge, the monthly series (when\n * provisioned), and an Arps decline fit. Volumes are allocated estimates:\n * RRC reports production by lease, never by well.\n *\n * @param api - API-8 or API-14 number (e.g. \"42-389-32345\" or \"42389323450000\")\n * @returns The well's units, series, and decline analysis\n *\n * @example\n * ```ts\n * const well = await client.texasWell('42-389-32345')\n * console.log(well.units[0]?.cum_boe)\n * console.log(well.decline.available && well.decline.value?.di)\n * ```\n */\n async texasWell(api: string): Promise<TexasWell> {\n return this.request<TexasWell>(`/texas/wells/${encodeURIComponent(api)}`);\n }\n}\n"],"mappings":";AASO,IAAM,gBAAN,cAA4B,MAAM;AAAA,EACvC,YACE,SACgB,aAA4B,MAC5B,OAAsB,MACtC;AACA,UAA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I,kBAAkB,QAAQ,aAAa;AAAA,IACpD,WAAW,QAAQ,cAAc,QAAQ,QAAQ,cAAc,MAAM;AACnE,aAAO,IAAI,eAAe,QAAQ,UAAU;AAC5C,aAAO,IAAI,eAAe,QAAQ,UAAU;AAC5C,UAAI,QAAQ,WAAW,KAAM,QAAO,IAAI,YAAY,QAAQ,OAAO;AAAA,IACrE,OAAO;AACL,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AACA,WAAO,KAAK,QAAyB,qBAAqB,MAAM,EAAE;AAAA,EACpE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBA,MAAM,UAAU,KAAiC;AAC/C,WAAO,KAAK,QAAmB,gBAAgB,mBAAmB,GAAG,CAAC,EAAE;AAAA,EAC1E;AACF;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "townshipamerica",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Official TypeScript SDK for the Township America API — convert PLSS and Texas TXSS legal land descriptions to GPS coordinates and back, plus Energy, Federal Land, and Texas parcel reports.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",