oilpriceapi 0.6.0 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +418 -123
  2. package/dist/cjs/client.js +490 -0
  3. package/dist/cjs/errors.js +80 -0
  4. package/dist/cjs/index.js +82 -0
  5. package/dist/cjs/package.json +1 -0
  6. package/dist/cjs/resources/alerts.js +387 -0
  7. package/dist/cjs/resources/analytics.js +226 -0
  8. package/dist/cjs/resources/bunker-fuels.js +196 -0
  9. package/dist/cjs/resources/commodities.js +115 -0
  10. package/dist/cjs/resources/data-quality.js +144 -0
  11. package/dist/cjs/resources/data-sources.js +297 -0
  12. package/dist/cjs/resources/diesel.js +119 -0
  13. package/dist/cjs/resources/drilling.js +269 -0
  14. package/dist/cjs/resources/ei/drilling-productivity.js +108 -0
  15. package/dist/cjs/resources/ei/forecasts.js +106 -0
  16. package/dist/cjs/resources/ei/frac-focus.js +155 -0
  17. package/dist/cjs/resources/ei/index.js +98 -0
  18. package/dist/cjs/resources/ei/oil-inventories.js +97 -0
  19. package/dist/cjs/resources/ei/opec-production.js +97 -0
  20. package/dist/cjs/resources/ei/rig-counts.js +93 -0
  21. package/dist/cjs/resources/ei/well-permits.js +124 -0
  22. package/dist/cjs/resources/forecasts.js +162 -0
  23. package/dist/cjs/resources/futures.js +233 -0
  24. package/dist/cjs/resources/rig-counts.js +161 -0
  25. package/dist/cjs/resources/storage.js +166 -0
  26. package/dist/cjs/resources/webhooks.js +294 -0
  27. package/dist/cjs/types.js +2 -0
  28. package/dist/cjs/version.js +24 -0
  29. package/dist/client.d.ts +116 -5
  30. package/dist/client.js +169 -47
  31. package/dist/errors.d.ts +6 -0
  32. package/dist/errors.js +25 -16
  33. package/dist/index.d.ts +45 -6
  34. package/dist/index.js +40 -3
  35. package/dist/resources/alerts.d.ts +52 -15
  36. package/dist/resources/alerts.js +121 -109
  37. package/dist/resources/analytics.d.ts +325 -0
  38. package/dist/resources/analytics.js +222 -0
  39. package/dist/resources/bunker-fuels.d.ts +270 -0
  40. package/dist/resources/bunker-fuels.js +192 -0
  41. package/dist/resources/commodities.d.ts +148 -0
  42. package/dist/resources/commodities.js +111 -0
  43. package/dist/resources/data-quality.d.ts +229 -0
  44. package/dist/resources/data-quality.js +140 -0
  45. package/dist/resources/data-sources.d.ts +365 -0
  46. package/dist/resources/data-sources.js +293 -0
  47. package/dist/resources/diesel.d.ts +1 -1
  48. package/dist/resources/diesel.js +9 -38
  49. package/dist/resources/drilling.d.ts +403 -0
  50. package/dist/resources/drilling.js +265 -0
  51. package/dist/resources/ei/drilling-productivity.d.ts +173 -0
  52. package/dist/resources/ei/drilling-productivity.js +104 -0
  53. package/dist/resources/ei/forecasts.d.ts +177 -0
  54. package/dist/resources/ei/forecasts.js +102 -0
  55. package/dist/resources/ei/frac-focus.d.ts +212 -0
  56. package/dist/resources/ei/frac-focus.js +151 -0
  57. package/dist/resources/ei/index.d.ts +140 -0
  58. package/dist/resources/ei/index.js +88 -0
  59. package/dist/resources/ei/oil-inventories.d.ts +155 -0
  60. package/dist/resources/ei/oil-inventories.js +93 -0
  61. package/dist/resources/ei/opec-production.d.ts +146 -0
  62. package/dist/resources/ei/opec-production.js +93 -0
  63. package/dist/resources/ei/rig-counts.d.ts +131 -0
  64. package/dist/resources/ei/rig-counts.js +89 -0
  65. package/dist/resources/ei/well-permits.d.ts +178 -0
  66. package/dist/resources/ei/well-permits.js +120 -0
  67. package/dist/resources/forecasts.d.ts +200 -0
  68. package/dist/resources/forecasts.js +158 -0
  69. package/dist/resources/futures.d.ts +322 -0
  70. package/dist/resources/futures.js +229 -0
  71. package/dist/resources/rig-counts.d.ts +221 -0
  72. package/dist/resources/rig-counts.js +157 -0
  73. package/dist/resources/storage.d.ts +182 -0
  74. package/dist/resources/storage.js +162 -0
  75. package/dist/resources/webhooks.d.ts +326 -0
  76. package/dist/resources/webhooks.js +290 -0
  77. package/dist/types.d.ts +79 -8
  78. package/dist/version.d.ts +1 -1
  79. package/dist/version.js +2 -2
  80. package/package.json +17 -8
@@ -0,0 +1,177 @@
1
+ /**
2
+ * Energy Intelligence - Forecasts Resource
3
+ *
4
+ * Access EIA and IEA price and production forecasts with historical accuracy metrics.
5
+ */
6
+ import type { OilPriceAPI } from "../../client.js";
7
+ /**
8
+ * Forecast record
9
+ */
10
+ export interface ForecastRecord {
11
+ /** Record ID */
12
+ id: string;
13
+ /** Forecast source (e.g., "EIA", "IEA") */
14
+ source?: string;
15
+ /** Commodity or metric being forecasted */
16
+ commodity?: string;
17
+ /** Forecast value */
18
+ forecast_value: number;
19
+ /** Unit of measurement */
20
+ unit?: string;
21
+ /** Forecast period (e.g., "Q1 2025", "2025") */
22
+ period?: string;
23
+ /** Publication date */
24
+ published_date: string;
25
+ /** Target date */
26
+ target_date?: string;
27
+ /** ISO timestamp */
28
+ timestamp: string;
29
+ /** Additional metadata */
30
+ metadata?: Record<string, unknown>;
31
+ }
32
+ /**
33
+ * Forecast summary
34
+ */
35
+ export interface ForecastSummary {
36
+ /** Number of forecasts */
37
+ total_forecasts: number;
38
+ /** Latest forecast value */
39
+ latest_forecast?: number;
40
+ /** Average forecast */
41
+ average_forecast?: number;
42
+ /** As of date */
43
+ as_of_date: string;
44
+ }
45
+ /**
46
+ * Price forecast data
47
+ */
48
+ export interface PriceForecast {
49
+ /** Commodity */
50
+ commodity: string;
51
+ /** Forecast source */
52
+ source: string;
53
+ /** Forecast price */
54
+ forecast_price: number;
55
+ /** Unit */
56
+ unit: string;
57
+ /** Target period */
58
+ period: string;
59
+ /** Published date */
60
+ published_date: string;
61
+ }
62
+ /**
63
+ * Production forecast data
64
+ */
65
+ export interface ProductionForecast {
66
+ /** Region or country */
67
+ region: string;
68
+ /** Forecast source */
69
+ source: string;
70
+ /** Forecast production */
71
+ forecast_production: number;
72
+ /** Unit */
73
+ unit: string;
74
+ /** Target period */
75
+ period: string;
76
+ /** Published date */
77
+ published_date: string;
78
+ }
79
+ /**
80
+ * Historical forecast data point
81
+ */
82
+ export interface HistoricalForecast {
83
+ /** Date */
84
+ date: string;
85
+ /** Forecast value */
86
+ forecast_value: number;
87
+ /** Actual value (if available) */
88
+ actual_value?: number;
89
+ /** Accuracy percentage */
90
+ accuracy_percent?: number;
91
+ }
92
+ /**
93
+ * Forecast comparison data
94
+ */
95
+ export interface ForecastComparison {
96
+ /** Period */
97
+ period: string;
98
+ /** EIA forecast */
99
+ eia_forecast?: number;
100
+ /** IEA forecast */
101
+ iea_forecast?: number;
102
+ /** Actual value (if available) */
103
+ actual_value?: number;
104
+ /** Difference between forecasts */
105
+ difference?: number;
106
+ }
107
+ /**
108
+ * EI Forecasts Resource
109
+ *
110
+ * Access EIA and IEA price and production forecasts.
111
+ *
112
+ * @example
113
+ * ```typescript
114
+ * const client = new OilPriceAPI({ apiKey: 'your_key' });
115
+ *
116
+ * // Get latest forecasts
117
+ * const latest = await client.ei.forecasts.latest();
118
+ * console.log(`Latest forecast: ${latest.forecast_value} ${latest.unit}`);
119
+ *
120
+ * // Get price forecasts
121
+ * const prices = await client.ei.forecasts.prices();
122
+ * prices.forEach(p => console.log(`${p.commodity}: $${p.forecast_price} (${p.source})`));
123
+ * ```
124
+ */
125
+ export declare class EIForecastsResource {
126
+ private client;
127
+ constructor(client: OilPriceAPI);
128
+ /**
129
+ * List all forecast records
130
+ *
131
+ * @returns Array of forecast records
132
+ */
133
+ list(): Promise<ForecastRecord[]>;
134
+ /**
135
+ * Get a specific forecast record
136
+ *
137
+ * @param id - Record ID
138
+ * @returns Forecast record
139
+ */
140
+ get(id: string): Promise<ForecastRecord>;
141
+ /**
142
+ * Get latest forecast data
143
+ *
144
+ * @returns Latest forecast record
145
+ */
146
+ latest(): Promise<ForecastRecord>;
147
+ /**
148
+ * Get forecast summary
149
+ *
150
+ * @returns Forecast summary statistics
151
+ */
152
+ summary(): Promise<ForecastSummary>;
153
+ /**
154
+ * Get price forecasts
155
+ *
156
+ * @returns Array of price forecasts
157
+ */
158
+ prices(): Promise<PriceForecast[]>;
159
+ /**
160
+ * Get production forecasts
161
+ *
162
+ * @returns Array of production forecasts
163
+ */
164
+ production(): Promise<ProductionForecast[]>;
165
+ /**
166
+ * Get historical forecast data
167
+ *
168
+ * @returns Array of historical forecasts with accuracy
169
+ */
170
+ historical(): Promise<HistoricalForecast[]>;
171
+ /**
172
+ * Compare forecasts from different sources
173
+ *
174
+ * @returns Array of forecast comparisons
175
+ */
176
+ compare(): Promise<ForecastComparison[]>;
177
+ }
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Energy Intelligence - Forecasts Resource
3
+ *
4
+ * Access EIA and IEA price and production forecasts with historical accuracy metrics.
5
+ */
6
+ import { ValidationError } from "../../errors.js";
7
+ /**
8
+ * EI Forecasts Resource
9
+ *
10
+ * Access EIA and IEA price and production forecasts.
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * const client = new OilPriceAPI({ apiKey: 'your_key' });
15
+ *
16
+ * // Get latest forecasts
17
+ * const latest = await client.ei.forecasts.latest();
18
+ * console.log(`Latest forecast: ${latest.forecast_value} ${latest.unit}`);
19
+ *
20
+ * // Get price forecasts
21
+ * const prices = await client.ei.forecasts.prices();
22
+ * prices.forEach(p => console.log(`${p.commodity}: $${p.forecast_price} (${p.source})`));
23
+ * ```
24
+ */
25
+ export class EIForecastsResource {
26
+ constructor(client) {
27
+ this.client = client;
28
+ }
29
+ /**
30
+ * List all forecast records
31
+ *
32
+ * @returns Array of forecast records
33
+ */
34
+ async list() {
35
+ const response = await this.client["request"]("/v1/ei/forecasts", {});
36
+ return Array.isArray(response) ? response : response.data;
37
+ }
38
+ /**
39
+ * Get a specific forecast record
40
+ *
41
+ * @param id - Record ID
42
+ * @returns Forecast record
43
+ */
44
+ async get(id) {
45
+ if (!id || typeof id !== "string") {
46
+ throw new ValidationError("Record ID must be a non-empty string");
47
+ }
48
+ return this.client["request"](`/v1/ei/forecasts/${id}`, {});
49
+ }
50
+ /**
51
+ * Get latest forecast data
52
+ *
53
+ * @returns Latest forecast record
54
+ */
55
+ async latest() {
56
+ return this.client["request"]("/v1/ei/forecasts/latest", {});
57
+ }
58
+ /**
59
+ * Get forecast summary
60
+ *
61
+ * @returns Forecast summary statistics
62
+ */
63
+ async summary() {
64
+ return this.client["request"]("/v1/ei/forecasts/summary", {});
65
+ }
66
+ /**
67
+ * Get price forecasts
68
+ *
69
+ * @returns Array of price forecasts
70
+ */
71
+ async prices() {
72
+ const response = await this.client["request"]("/v1/ei/forecasts/prices", {});
73
+ return Array.isArray(response) ? response : response.data;
74
+ }
75
+ /**
76
+ * Get production forecasts
77
+ *
78
+ * @returns Array of production forecasts
79
+ */
80
+ async production() {
81
+ const response = await this.client["request"]("/v1/ei/forecasts/production", {});
82
+ return Array.isArray(response) ? response : response.data;
83
+ }
84
+ /**
85
+ * Get historical forecast data
86
+ *
87
+ * @returns Array of historical forecasts with accuracy
88
+ */
89
+ async historical() {
90
+ const response = await this.client["request"]("/v1/ei/forecasts/historical", {});
91
+ return Array.isArray(response) ? response : response.data;
92
+ }
93
+ /**
94
+ * Compare forecasts from different sources
95
+ *
96
+ * @returns Array of forecast comparisons
97
+ */
98
+ async compare() {
99
+ const response = await this.client["request"]("/v1/ei/forecasts/compare", {});
100
+ return Array.isArray(response) ? response : response.data;
101
+ }
102
+ }
@@ -0,0 +1,212 @@
1
+ /**
2
+ * Energy Intelligence - FracFocus Resource
3
+ *
4
+ * Access hydraulic fracturing disclosure data including chemicals, operators,
5
+ * and well-level information from the FracFocus registry.
6
+ */
7
+ import type { OilPriceAPI } from "../../client.js";
8
+ /**
9
+ * FracFocus disclosure record
10
+ */
11
+ export interface FracFocusRecord {
12
+ /** Record ID */
13
+ id: string;
14
+ /** API well number */
15
+ api_number: string;
16
+ /** State */
17
+ state: string;
18
+ /** County */
19
+ county?: string;
20
+ /** Operator name */
21
+ operator?: string;
22
+ /** Well name */
23
+ well_name?: string;
24
+ /** Job start date */
25
+ job_start_date?: string;
26
+ /** Job end date */
27
+ job_end_date?: string;
28
+ /** Total base water volume (gallons) */
29
+ total_base_water_volume?: number;
30
+ /** Total base non-water volume (gallons) */
31
+ total_base_non_water_volume?: number;
32
+ /** ISO timestamp */
33
+ timestamp: string;
34
+ /** Additional metadata */
35
+ metadata?: Record<string, unknown>;
36
+ }
37
+ /**
38
+ * FracFocus summary
39
+ */
40
+ export interface FracFocusSummary {
41
+ /** Total disclosures */
42
+ total_disclosures: number;
43
+ /** Disclosures by state */
44
+ by_state?: Record<string, number>;
45
+ /** Disclosures by operator */
46
+ by_operator?: Record<string, number>;
47
+ /** As of date */
48
+ as_of_date: string;
49
+ }
50
+ /**
51
+ * Disclosures by state
52
+ */
53
+ export interface DisclosuresByState {
54
+ /** State name */
55
+ state: string;
56
+ /** Disclosure count */
57
+ disclosure_count: number;
58
+ /** Date */
59
+ date: string;
60
+ }
61
+ /**
62
+ * Disclosures by operator
63
+ */
64
+ export interface DisclosuresByOperator {
65
+ /** Operator name */
66
+ operator: string;
67
+ /** Disclosure count */
68
+ disclosure_count: number;
69
+ /** Percentage of total */
70
+ percentage?: number;
71
+ /** Date */
72
+ date: string;
73
+ }
74
+ /**
75
+ * Chemical usage data
76
+ */
77
+ export interface ChemicalUsage {
78
+ /** Chemical name */
79
+ chemical_name: string;
80
+ /** CAS number */
81
+ cas_number?: string;
82
+ /** Usage count */
83
+ usage_count: number;
84
+ /** Percentage of total */
85
+ percentage?: number;
86
+ }
87
+ /**
88
+ * Chemical detail for a specific well
89
+ */
90
+ export interface WellChemical {
91
+ /** Chemical name */
92
+ chemical_name: string;
93
+ /** CAS number */
94
+ cas_number?: string;
95
+ /** Purpose */
96
+ purpose?: string;
97
+ /** Ingredient concentration (%) */
98
+ concentration_percent?: number;
99
+ /** Mass used (lbs) */
100
+ mass_lbs?: number;
101
+ }
102
+ /**
103
+ * FracFocus search query
104
+ */
105
+ export interface FracFocusSearchQuery {
106
+ /** State filter */
107
+ state?: string;
108
+ /** Operator filter */
109
+ operator?: string;
110
+ /** Chemical filter */
111
+ chemical?: string;
112
+ /** Start date */
113
+ start_date?: string;
114
+ /** End date */
115
+ end_date?: string;
116
+ }
117
+ /**
118
+ * EI FracFocus Resource
119
+ *
120
+ * Access hydraulic fracturing disclosure data from the FracFocus registry.
121
+ *
122
+ * @example
123
+ * ```typescript
124
+ * const client = new OilPriceAPI({ apiKey: 'your_key' });
125
+ *
126
+ * // Get latest disclosure
127
+ * const latest = await client.ei.fracFocus.latest();
128
+ * console.log(`Well: ${latest.well_name} (API: ${latest.api_number})`);
129
+ *
130
+ * // Get disclosures by state
131
+ * const states = await client.ei.fracFocus.byState();
132
+ * states.forEach(s => console.log(`${s.state}: ${s.disclosure_count} disclosures`));
133
+ *
134
+ * // Get chemicals for a specific well
135
+ * const chemicals = await client.ei.fracFocus.chemicals('42-123-12345');
136
+ * chemicals.forEach(c => console.log(`${c.chemical_name}: ${c.concentration_percent}%`));
137
+ *
138
+ * // Search disclosures
139
+ * const results = await client.ei.fracFocus.search({
140
+ * state: 'Texas',
141
+ * operator: 'EOG Resources'
142
+ * });
143
+ * ```
144
+ */
145
+ export declare class EIFracFocusResource {
146
+ private client;
147
+ constructor(client: OilPriceAPI);
148
+ /**
149
+ * List all FracFocus disclosure records
150
+ *
151
+ * @returns Array of disclosure records
152
+ */
153
+ list(): Promise<FracFocusRecord[]>;
154
+ /**
155
+ * Get a specific FracFocus disclosure record
156
+ *
157
+ * @param id - Record ID
158
+ * @returns Disclosure record
159
+ */
160
+ get(id: string): Promise<FracFocusRecord>;
161
+ /**
162
+ * Get latest FracFocus disclosure
163
+ *
164
+ * @returns Latest disclosure record
165
+ */
166
+ latest(): Promise<FracFocusRecord>;
167
+ /**
168
+ * Get FracFocus summary
169
+ *
170
+ * @returns Disclosure summary statistics
171
+ */
172
+ summary(): Promise<FracFocusSummary>;
173
+ /**
174
+ * Get disclosures by state
175
+ *
176
+ * @returns Array of disclosures grouped by state
177
+ */
178
+ byState(): Promise<DisclosuresByState[]>;
179
+ /**
180
+ * Get disclosures by operator
181
+ *
182
+ * @returns Array of disclosures grouped by operator
183
+ */
184
+ byOperator(): Promise<DisclosuresByOperator[]>;
185
+ /**
186
+ * Get chemical usage statistics
187
+ *
188
+ * @returns Array of chemicals used in fracturing
189
+ */
190
+ byChemical(): Promise<ChemicalUsage[]>;
191
+ /**
192
+ * Search FracFocus disclosures
193
+ *
194
+ * @param query - Search query parameters
195
+ * @returns Array of matching disclosure records
196
+ */
197
+ search(query: FracFocusSearchQuery): Promise<FracFocusRecord[]>;
198
+ /**
199
+ * Get chemicals used in a specific well
200
+ *
201
+ * @param id - Disclosure record ID
202
+ * @returns Array of chemicals used in the well
203
+ */
204
+ chemicals(id: string): Promise<WellChemical[]>;
205
+ /**
206
+ * Get FracFocus disclosures for a specific well by API number
207
+ *
208
+ * @param apiNumber - API well number (e.g., "42-123-12345")
209
+ * @returns Array of disclosure records for the well
210
+ */
211
+ forWell(apiNumber: string): Promise<FracFocusRecord[]>;
212
+ }
@@ -0,0 +1,151 @@
1
+ /**
2
+ * Energy Intelligence - FracFocus Resource
3
+ *
4
+ * Access hydraulic fracturing disclosure data including chemicals, operators,
5
+ * and well-level information from the FracFocus registry.
6
+ */
7
+ import { ValidationError } from "../../errors.js";
8
+ /**
9
+ * EI FracFocus Resource
10
+ *
11
+ * Access hydraulic fracturing disclosure data from the FracFocus registry.
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * const client = new OilPriceAPI({ apiKey: 'your_key' });
16
+ *
17
+ * // Get latest disclosure
18
+ * const latest = await client.ei.fracFocus.latest();
19
+ * console.log(`Well: ${latest.well_name} (API: ${latest.api_number})`);
20
+ *
21
+ * // Get disclosures by state
22
+ * const states = await client.ei.fracFocus.byState();
23
+ * states.forEach(s => console.log(`${s.state}: ${s.disclosure_count} disclosures`));
24
+ *
25
+ * // Get chemicals for a specific well
26
+ * const chemicals = await client.ei.fracFocus.chemicals('42-123-12345');
27
+ * chemicals.forEach(c => console.log(`${c.chemical_name}: ${c.concentration_percent}%`));
28
+ *
29
+ * // Search disclosures
30
+ * const results = await client.ei.fracFocus.search({
31
+ * state: 'Texas',
32
+ * operator: 'EOG Resources'
33
+ * });
34
+ * ```
35
+ */
36
+ export class EIFracFocusResource {
37
+ constructor(client) {
38
+ this.client = client;
39
+ }
40
+ /**
41
+ * List all FracFocus disclosure records
42
+ *
43
+ * @returns Array of disclosure records
44
+ */
45
+ async list() {
46
+ const response = await this.client["request"]("/v1/ei/frac-focus", {});
47
+ return Array.isArray(response) ? response : response.data;
48
+ }
49
+ /**
50
+ * Get a specific FracFocus disclosure record
51
+ *
52
+ * @param id - Record ID
53
+ * @returns Disclosure record
54
+ */
55
+ async get(id) {
56
+ if (!id || typeof id !== "string") {
57
+ throw new ValidationError("Record ID must be a non-empty string");
58
+ }
59
+ return this.client["request"](`/v1/ei/frac-focus/${id}`, {});
60
+ }
61
+ /**
62
+ * Get latest FracFocus disclosure
63
+ *
64
+ * @returns Latest disclosure record
65
+ */
66
+ async latest() {
67
+ return this.client["request"]("/v1/ei/frac-focus/latest", {});
68
+ }
69
+ /**
70
+ * Get FracFocus summary
71
+ *
72
+ * @returns Disclosure summary statistics
73
+ */
74
+ async summary() {
75
+ return this.client["request"]("/v1/ei/frac-focus/summary", {});
76
+ }
77
+ /**
78
+ * Get disclosures by state
79
+ *
80
+ * @returns Array of disclosures grouped by state
81
+ */
82
+ async byState() {
83
+ const response = await this.client["request"]("/v1/ei/frac-focus/by-state", {});
84
+ return Array.isArray(response) ? response : response.data;
85
+ }
86
+ /**
87
+ * Get disclosures by operator
88
+ *
89
+ * @returns Array of disclosures grouped by operator
90
+ */
91
+ async byOperator() {
92
+ const response = await this.client["request"]("/v1/ei/frac-focus/by-operator", {});
93
+ return Array.isArray(response) ? response : response.data;
94
+ }
95
+ /**
96
+ * Get chemical usage statistics
97
+ *
98
+ * @returns Array of chemicals used in fracturing
99
+ */
100
+ async byChemical() {
101
+ const response = await this.client["request"]("/v1/ei/frac-focus/by-chemical", {});
102
+ return Array.isArray(response) ? response : response.data;
103
+ }
104
+ /**
105
+ * Search FracFocus disclosures
106
+ *
107
+ * @param query - Search query parameters
108
+ * @returns Array of matching disclosure records
109
+ */
110
+ async search(query) {
111
+ const params = {};
112
+ if (query.state)
113
+ params.state = query.state;
114
+ if (query.operator)
115
+ params.operator = query.operator;
116
+ if (query.chemical)
117
+ params.chemical = query.chemical;
118
+ if (query.start_date)
119
+ params.start_date = query.start_date;
120
+ if (query.end_date)
121
+ params.end_date = query.end_date;
122
+ const response = await this.client["request"]("/v1/ei/frac-focus/search", params);
123
+ return Array.isArray(response) ? response : response.data;
124
+ }
125
+ /**
126
+ * Get chemicals used in a specific well
127
+ *
128
+ * @param id - Disclosure record ID
129
+ * @returns Array of chemicals used in the well
130
+ */
131
+ async chemicals(id) {
132
+ if (!id || typeof id !== "string") {
133
+ throw new ValidationError("Disclosure ID must be a non-empty string");
134
+ }
135
+ const response = await this.client["request"](`/v1/ei/frac-focus/${id}/chemicals`, {});
136
+ return Array.isArray(response) ? response : response.chemicals;
137
+ }
138
+ /**
139
+ * Get FracFocus disclosures for a specific well by API number
140
+ *
141
+ * @param apiNumber - API well number (e.g., "42-123-12345")
142
+ * @returns Array of disclosure records for the well
143
+ */
144
+ async forWell(apiNumber) {
145
+ if (!apiNumber || typeof apiNumber !== "string") {
146
+ throw new ValidationError("API number must be a non-empty string");
147
+ }
148
+ const response = await this.client["request"](`/v1/ei/frac-focus/for-well/${apiNumber}`, {});
149
+ return Array.isArray(response) ? response : response.data;
150
+ }
151
+ }