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.
- package/README.md +418 -123
- package/dist/cjs/client.js +490 -0
- package/dist/cjs/errors.js +80 -0
- package/dist/cjs/index.js +82 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/resources/alerts.js +387 -0
- package/dist/cjs/resources/analytics.js +226 -0
- package/dist/cjs/resources/bunker-fuels.js +196 -0
- package/dist/cjs/resources/commodities.js +115 -0
- package/dist/cjs/resources/data-quality.js +144 -0
- package/dist/cjs/resources/data-sources.js +297 -0
- package/dist/cjs/resources/diesel.js +119 -0
- package/dist/cjs/resources/drilling.js +269 -0
- package/dist/cjs/resources/ei/drilling-productivity.js +108 -0
- package/dist/cjs/resources/ei/forecasts.js +106 -0
- package/dist/cjs/resources/ei/frac-focus.js +155 -0
- package/dist/cjs/resources/ei/index.js +98 -0
- package/dist/cjs/resources/ei/oil-inventories.js +97 -0
- package/dist/cjs/resources/ei/opec-production.js +97 -0
- package/dist/cjs/resources/ei/rig-counts.js +93 -0
- package/dist/cjs/resources/ei/well-permits.js +124 -0
- package/dist/cjs/resources/forecasts.js +162 -0
- package/dist/cjs/resources/futures.js +233 -0
- package/dist/cjs/resources/rig-counts.js +161 -0
- package/dist/cjs/resources/storage.js +166 -0
- package/dist/cjs/resources/webhooks.js +294 -0
- package/dist/cjs/types.js +2 -0
- package/dist/cjs/version.js +24 -0
- package/dist/client.d.ts +116 -5
- package/dist/client.js +169 -47
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +25 -16
- package/dist/index.d.ts +45 -6
- package/dist/index.js +40 -3
- package/dist/resources/alerts.d.ts +52 -15
- package/dist/resources/alerts.js +121 -109
- package/dist/resources/analytics.d.ts +325 -0
- package/dist/resources/analytics.js +222 -0
- package/dist/resources/bunker-fuels.d.ts +270 -0
- package/dist/resources/bunker-fuels.js +192 -0
- package/dist/resources/commodities.d.ts +148 -0
- package/dist/resources/commodities.js +111 -0
- package/dist/resources/data-quality.d.ts +229 -0
- package/dist/resources/data-quality.js +140 -0
- package/dist/resources/data-sources.d.ts +365 -0
- package/dist/resources/data-sources.js +293 -0
- package/dist/resources/diesel.d.ts +1 -1
- package/dist/resources/diesel.js +9 -38
- package/dist/resources/drilling.d.ts +403 -0
- package/dist/resources/drilling.js +265 -0
- package/dist/resources/ei/drilling-productivity.d.ts +173 -0
- package/dist/resources/ei/drilling-productivity.js +104 -0
- package/dist/resources/ei/forecasts.d.ts +177 -0
- package/dist/resources/ei/forecasts.js +102 -0
- package/dist/resources/ei/frac-focus.d.ts +212 -0
- package/dist/resources/ei/frac-focus.js +151 -0
- package/dist/resources/ei/index.d.ts +140 -0
- package/dist/resources/ei/index.js +88 -0
- package/dist/resources/ei/oil-inventories.d.ts +155 -0
- package/dist/resources/ei/oil-inventories.js +93 -0
- package/dist/resources/ei/opec-production.d.ts +146 -0
- package/dist/resources/ei/opec-production.js +93 -0
- package/dist/resources/ei/rig-counts.d.ts +131 -0
- package/dist/resources/ei/rig-counts.js +89 -0
- package/dist/resources/ei/well-permits.d.ts +178 -0
- package/dist/resources/ei/well-permits.js +120 -0
- package/dist/resources/forecasts.d.ts +200 -0
- package/dist/resources/forecasts.js +158 -0
- package/dist/resources/futures.d.ts +322 -0
- package/dist/resources/futures.js +229 -0
- package/dist/resources/rig-counts.d.ts +221 -0
- package/dist/resources/rig-counts.js +157 -0
- package/dist/resources/storage.d.ts +182 -0
- package/dist/resources/storage.js +162 -0
- package/dist/resources/webhooks.d.ts +326 -0
- package/dist/resources/webhooks.js +290 -0
- package/dist/types.d.ts +79 -8
- package/dist/version.d.ts +1 -1
- package/dist/version.js +2 -2
- package/package.json +17 -8
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Energy Intelligence - OPEC Production Resource
|
|
3
|
+
*
|
|
4
|
+
* Access OPEC crude oil production data by country with historical trends.
|
|
5
|
+
*/
|
|
6
|
+
import { ValidationError } from "../../errors.js";
|
|
7
|
+
/**
|
|
8
|
+
* EI OPEC Production Resource
|
|
9
|
+
*
|
|
10
|
+
* Access OPEC crude oil production data and analytics.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const client = new OilPriceAPI({ apiKey: 'your_key' });
|
|
15
|
+
*
|
|
16
|
+
* // Get total OPEC production
|
|
17
|
+
* const total = await client.ei.opecProduction.total();
|
|
18
|
+
* console.log(`Total OPEC: ${total.total_production_bpd} bpd`);
|
|
19
|
+
*
|
|
20
|
+
* // Get top producers
|
|
21
|
+
* const top = await client.ei.opecProduction.topProducers();
|
|
22
|
+
* top.forEach(p => console.log(`${p.rank}. ${p.country}: ${p.production_bpd} bpd`));
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export class EIOPECProductionResource {
|
|
26
|
+
constructor(client) {
|
|
27
|
+
this.client = client;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* List all OPEC production records
|
|
31
|
+
*
|
|
32
|
+
* @returns Array of production records
|
|
33
|
+
*/
|
|
34
|
+
async list() {
|
|
35
|
+
const response = await this.client["request"]("/v1/ei/opec_productions", {});
|
|
36
|
+
return Array.isArray(response) ? response : response.data;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Get a specific production record
|
|
40
|
+
*
|
|
41
|
+
* @param id - Record ID
|
|
42
|
+
* @returns Production 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/opec_productions/${id}`, {});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Get latest OPEC production data
|
|
52
|
+
*
|
|
53
|
+
* @returns Latest production record
|
|
54
|
+
*/
|
|
55
|
+
async latest() {
|
|
56
|
+
return this.client["request"]("/v1/ei/opec_productions/latest", {});
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Get total OPEC production
|
|
60
|
+
*
|
|
61
|
+
* @returns Total OPEC production summary
|
|
62
|
+
*/
|
|
63
|
+
async total() {
|
|
64
|
+
return this.client["request"]("/v1/ei/opec_productions/total", {});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Get production by country
|
|
68
|
+
*
|
|
69
|
+
* @returns Array of production by country
|
|
70
|
+
*/
|
|
71
|
+
async byCountry() {
|
|
72
|
+
const response = await this.client["request"]("/v1/ei/opec_productions/by_country", {});
|
|
73
|
+
return Array.isArray(response) ? response : response.data;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Get historical production data
|
|
77
|
+
*
|
|
78
|
+
* @returns Array of historical production levels
|
|
79
|
+
*/
|
|
80
|
+
async historical() {
|
|
81
|
+
const response = await this.client["request"]("/v1/ei/opec_productions/historical", {});
|
|
82
|
+
return Array.isArray(response) ? response : response.data;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Get top OPEC producers
|
|
86
|
+
*
|
|
87
|
+
* @returns Array of top producing countries
|
|
88
|
+
*/
|
|
89
|
+
async topProducers() {
|
|
90
|
+
const response = await this.client["request"]("/v1/ei/opec_productions/top_producers", {});
|
|
91
|
+
return Array.isArray(response) ? response : response.data;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Energy Intelligence - Rig Counts Resource
|
|
3
|
+
*
|
|
4
|
+
* Access Baker Hughes rig count data with basin, state, and historical breakdowns.
|
|
5
|
+
*/
|
|
6
|
+
import type { OilPriceAPI } from "../../client.js";
|
|
7
|
+
/**
|
|
8
|
+
* Rig count record
|
|
9
|
+
*/
|
|
10
|
+
export interface RigCountRecord {
|
|
11
|
+
/** Record ID */
|
|
12
|
+
id: string;
|
|
13
|
+
/** Total rig count */
|
|
14
|
+
total_rigs: number;
|
|
15
|
+
/** Oil rigs */
|
|
16
|
+
oil_rigs?: number;
|
|
17
|
+
/** Gas rigs */
|
|
18
|
+
gas_rigs?: number;
|
|
19
|
+
/** Miscellaneous rigs */
|
|
20
|
+
misc_rigs?: number;
|
|
21
|
+
/** Report date */
|
|
22
|
+
date: string;
|
|
23
|
+
/** Week number */
|
|
24
|
+
week?: number;
|
|
25
|
+
/** ISO timestamp */
|
|
26
|
+
timestamp: string;
|
|
27
|
+
/** Additional metadata */
|
|
28
|
+
metadata?: Record<string, unknown>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Rig count by basin
|
|
32
|
+
*/
|
|
33
|
+
export interface RigCountByBasin {
|
|
34
|
+
/** Basin name */
|
|
35
|
+
basin: string;
|
|
36
|
+
/** Rig count */
|
|
37
|
+
rig_count: number;
|
|
38
|
+
/** Change from previous week */
|
|
39
|
+
change?: number;
|
|
40
|
+
/** Date */
|
|
41
|
+
date: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Rig count by state
|
|
45
|
+
*/
|
|
46
|
+
export interface RigCountByState {
|
|
47
|
+
/** State name */
|
|
48
|
+
state: string;
|
|
49
|
+
/** Rig count */
|
|
50
|
+
rig_count: number;
|
|
51
|
+
/** Change from previous week */
|
|
52
|
+
change?: number;
|
|
53
|
+
/** Date */
|
|
54
|
+
date: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Historical rig count data point
|
|
58
|
+
*/
|
|
59
|
+
export interface HistoricalRigCount {
|
|
60
|
+
/** Date */
|
|
61
|
+
date: string;
|
|
62
|
+
/** Total rigs */
|
|
63
|
+
total_rigs: number;
|
|
64
|
+
/** Oil rigs */
|
|
65
|
+
oil_rigs?: number;
|
|
66
|
+
/** Gas rigs */
|
|
67
|
+
gas_rigs?: number;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* EI Rig Counts Resource
|
|
71
|
+
*
|
|
72
|
+
* Access Baker Hughes rig count data with comprehensive breakdowns.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* const client = new OilPriceAPI({ apiKey: 'your_key' });
|
|
77
|
+
*
|
|
78
|
+
* // Get latest rig count
|
|
79
|
+
* const latest = await client.ei.rigCounts.latest();
|
|
80
|
+
* console.log(`Total rigs: ${latest.total_rigs}`);
|
|
81
|
+
*
|
|
82
|
+
* // Get by basin
|
|
83
|
+
* const basins = await client.ei.rigCounts.byBasin();
|
|
84
|
+
* basins.forEach(b => console.log(`${b.basin}: ${b.rig_count} rigs`));
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export declare class EIRigCountsResource {
|
|
88
|
+
private client;
|
|
89
|
+
constructor(client: OilPriceAPI);
|
|
90
|
+
/**
|
|
91
|
+
* List all rig count records
|
|
92
|
+
*
|
|
93
|
+
* @returns Array of rig count records
|
|
94
|
+
*
|
|
95
|
+
* @throws {OilPriceAPIError} If API request fails
|
|
96
|
+
*/
|
|
97
|
+
list(): Promise<RigCountRecord[]>;
|
|
98
|
+
/**
|
|
99
|
+
* Get a specific rig count record
|
|
100
|
+
*
|
|
101
|
+
* @param id - Record ID
|
|
102
|
+
* @returns Rig count record
|
|
103
|
+
*
|
|
104
|
+
* @throws {NotFoundError} If record not found
|
|
105
|
+
*/
|
|
106
|
+
get(id: string): Promise<RigCountRecord>;
|
|
107
|
+
/**
|
|
108
|
+
* Get latest rig count
|
|
109
|
+
*
|
|
110
|
+
* @returns Latest rig count data
|
|
111
|
+
*/
|
|
112
|
+
latest(): Promise<RigCountRecord>;
|
|
113
|
+
/**
|
|
114
|
+
* Get rig counts by basin
|
|
115
|
+
*
|
|
116
|
+
* @returns Array of rig counts by basin
|
|
117
|
+
*/
|
|
118
|
+
byBasin(): Promise<RigCountByBasin[]>;
|
|
119
|
+
/**
|
|
120
|
+
* Get rig counts by state
|
|
121
|
+
*
|
|
122
|
+
* @returns Array of rig counts by state
|
|
123
|
+
*/
|
|
124
|
+
byState(): Promise<RigCountByState[]>;
|
|
125
|
+
/**
|
|
126
|
+
* Get historical rig count data
|
|
127
|
+
*
|
|
128
|
+
* @returns Array of historical rig counts
|
|
129
|
+
*/
|
|
130
|
+
historical(): Promise<HistoricalRigCount[]>;
|
|
131
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Energy Intelligence - Rig Counts Resource
|
|
3
|
+
*
|
|
4
|
+
* Access Baker Hughes rig count data with basin, state, and historical breakdowns.
|
|
5
|
+
*/
|
|
6
|
+
import { ValidationError } from "../../errors.js";
|
|
7
|
+
/**
|
|
8
|
+
* EI Rig Counts Resource
|
|
9
|
+
*
|
|
10
|
+
* Access Baker Hughes rig count data with comprehensive breakdowns.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const client = new OilPriceAPI({ apiKey: 'your_key' });
|
|
15
|
+
*
|
|
16
|
+
* // Get latest rig count
|
|
17
|
+
* const latest = await client.ei.rigCounts.latest();
|
|
18
|
+
* console.log(`Total rigs: ${latest.total_rigs}`);
|
|
19
|
+
*
|
|
20
|
+
* // Get by basin
|
|
21
|
+
* const basins = await client.ei.rigCounts.byBasin();
|
|
22
|
+
* basins.forEach(b => console.log(`${b.basin}: ${b.rig_count} rigs`));
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export class EIRigCountsResource {
|
|
26
|
+
constructor(client) {
|
|
27
|
+
this.client = client;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* List all rig count records
|
|
31
|
+
*
|
|
32
|
+
* @returns Array of rig count records
|
|
33
|
+
*
|
|
34
|
+
* @throws {OilPriceAPIError} If API request fails
|
|
35
|
+
*/
|
|
36
|
+
async list() {
|
|
37
|
+
const response = await this.client["request"]("/v1/ei/rig_counts", {});
|
|
38
|
+
return Array.isArray(response) ? response : response.data;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Get a specific rig count record
|
|
42
|
+
*
|
|
43
|
+
* @param id - Record ID
|
|
44
|
+
* @returns Rig count record
|
|
45
|
+
*
|
|
46
|
+
* @throws {NotFoundError} If record not found
|
|
47
|
+
*/
|
|
48
|
+
async get(id) {
|
|
49
|
+
if (!id || typeof id !== "string") {
|
|
50
|
+
throw new ValidationError("Record ID must be a non-empty string");
|
|
51
|
+
}
|
|
52
|
+
return this.client["request"](`/v1/ei/rig_counts/${id}`, {});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Get latest rig count
|
|
56
|
+
*
|
|
57
|
+
* @returns Latest rig count data
|
|
58
|
+
*/
|
|
59
|
+
async latest() {
|
|
60
|
+
return this.client["request"]("/v1/ei/rig_counts/latest", {});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Get rig counts by basin
|
|
64
|
+
*
|
|
65
|
+
* @returns Array of rig counts by basin
|
|
66
|
+
*/
|
|
67
|
+
async byBasin() {
|
|
68
|
+
const response = await this.client["request"]("/v1/ei/rig_counts/by_basin", {});
|
|
69
|
+
return Array.isArray(response) ? response : response.data;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Get rig counts by state
|
|
73
|
+
*
|
|
74
|
+
* @returns Array of rig counts by state
|
|
75
|
+
*/
|
|
76
|
+
async byState() {
|
|
77
|
+
const response = await this.client["request"]("/v1/ei/rig_counts/by_state", {});
|
|
78
|
+
return Array.isArray(response) ? response : response.data;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Get historical rig count data
|
|
82
|
+
*
|
|
83
|
+
* @returns Array of historical rig counts
|
|
84
|
+
*/
|
|
85
|
+
async historical() {
|
|
86
|
+
const response = await this.client["request"]("/v1/ei/rig_counts/historical", {});
|
|
87
|
+
return Array.isArray(response) ? response : response.data;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Energy Intelligence - Well Permits Resource
|
|
3
|
+
*
|
|
4
|
+
* Access oil and gas well permit data by state, operator, and formation.
|
|
5
|
+
*/
|
|
6
|
+
import type { OilPriceAPI } from "../../client.js";
|
|
7
|
+
/**
|
|
8
|
+
* Well permit record
|
|
9
|
+
*/
|
|
10
|
+
export interface WellPermitRecord {
|
|
11
|
+
/** Record ID */
|
|
12
|
+
id: string;
|
|
13
|
+
/** Permit number */
|
|
14
|
+
permit_number?: string;
|
|
15
|
+
/** State */
|
|
16
|
+
state: string;
|
|
17
|
+
/** County */
|
|
18
|
+
county?: string;
|
|
19
|
+
/** Operator name */
|
|
20
|
+
operator?: string;
|
|
21
|
+
/** Well name */
|
|
22
|
+
well_name?: string;
|
|
23
|
+
/** Formation/target */
|
|
24
|
+
formation?: string;
|
|
25
|
+
/** Well type (e.g., "oil", "gas", "injection") */
|
|
26
|
+
well_type?: string;
|
|
27
|
+
/** Permit issue date */
|
|
28
|
+
issue_date: string;
|
|
29
|
+
/** ISO timestamp */
|
|
30
|
+
timestamp: string;
|
|
31
|
+
/** Additional metadata */
|
|
32
|
+
metadata?: Record<string, unknown>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Well permit summary
|
|
36
|
+
*/
|
|
37
|
+
export interface WellPermitSummary {
|
|
38
|
+
/** Total permits */
|
|
39
|
+
total_permits: number;
|
|
40
|
+
/** Permits by state */
|
|
41
|
+
by_state?: Record<string, number>;
|
|
42
|
+
/** Permits by operator */
|
|
43
|
+
by_operator?: Record<string, number>;
|
|
44
|
+
/** As of date */
|
|
45
|
+
as_of_date: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Permits by state
|
|
49
|
+
*/
|
|
50
|
+
export interface PermitsByState {
|
|
51
|
+
/** State name */
|
|
52
|
+
state: string;
|
|
53
|
+
/** Permit count */
|
|
54
|
+
permit_count: number;
|
|
55
|
+
/** Change from previous period */
|
|
56
|
+
change?: number;
|
|
57
|
+
/** Date */
|
|
58
|
+
date: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Permits by operator
|
|
62
|
+
*/
|
|
63
|
+
export interface PermitsByOperator {
|
|
64
|
+
/** Operator name */
|
|
65
|
+
operator: string;
|
|
66
|
+
/** Permit count */
|
|
67
|
+
permit_count: number;
|
|
68
|
+
/** Percentage of total */
|
|
69
|
+
percentage?: number;
|
|
70
|
+
/** Date */
|
|
71
|
+
date: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Permits by formation
|
|
75
|
+
*/
|
|
76
|
+
export interface PermitsByFormation {
|
|
77
|
+
/** Formation name */
|
|
78
|
+
formation: string;
|
|
79
|
+
/** Permit count */
|
|
80
|
+
permit_count: number;
|
|
81
|
+
/** Percentage of total */
|
|
82
|
+
percentage?: number;
|
|
83
|
+
/** Date */
|
|
84
|
+
date: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Well permit search query
|
|
88
|
+
*/
|
|
89
|
+
export interface WellPermitSearchQuery {
|
|
90
|
+
/** State filter */
|
|
91
|
+
state?: string;
|
|
92
|
+
/** Operator filter */
|
|
93
|
+
operator?: string;
|
|
94
|
+
/** Formation filter */
|
|
95
|
+
formation?: string;
|
|
96
|
+
/** Start date */
|
|
97
|
+
start_date?: string;
|
|
98
|
+
/** End date */
|
|
99
|
+
end_date?: string;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* EI Well Permits Resource
|
|
103
|
+
*
|
|
104
|
+
* Access oil and gas well permit data with detailed breakdowns.
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```typescript
|
|
108
|
+
* const client = new OilPriceAPI({ apiKey: 'your_key' });
|
|
109
|
+
*
|
|
110
|
+
* // Get latest permits
|
|
111
|
+
* const latest = await client.ei.wellPermits.latest();
|
|
112
|
+
* console.log(`Permit: ${latest.permit_number} - ${latest.operator}`);
|
|
113
|
+
*
|
|
114
|
+
* // Get permits by state
|
|
115
|
+
* const states = await client.ei.wellPermits.byState();
|
|
116
|
+
* states.forEach(s => console.log(`${s.state}: ${s.permit_count} permits`));
|
|
117
|
+
*
|
|
118
|
+
* // Search permits
|
|
119
|
+
* const results = await client.ei.wellPermits.search({
|
|
120
|
+
* state: 'Texas',
|
|
121
|
+
* operator: 'ConocoPhillips'
|
|
122
|
+
* });
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
export declare class EIWellPermitsResource {
|
|
126
|
+
private client;
|
|
127
|
+
constructor(client: OilPriceAPI);
|
|
128
|
+
/**
|
|
129
|
+
* List all well permit records
|
|
130
|
+
*
|
|
131
|
+
* @returns Array of well permit records
|
|
132
|
+
*/
|
|
133
|
+
list(): Promise<WellPermitRecord[]>;
|
|
134
|
+
/**
|
|
135
|
+
* Get a specific well permit record
|
|
136
|
+
*
|
|
137
|
+
* @param id - Record ID
|
|
138
|
+
* @returns Well permit record
|
|
139
|
+
*/
|
|
140
|
+
get(id: string): Promise<WellPermitRecord>;
|
|
141
|
+
/**
|
|
142
|
+
* Get latest well permit
|
|
143
|
+
*
|
|
144
|
+
* @returns Latest well permit record
|
|
145
|
+
*/
|
|
146
|
+
latest(): Promise<WellPermitRecord>;
|
|
147
|
+
/**
|
|
148
|
+
* Get well permit summary
|
|
149
|
+
*
|
|
150
|
+
* @returns Well permit summary statistics
|
|
151
|
+
*/
|
|
152
|
+
summary(): Promise<WellPermitSummary>;
|
|
153
|
+
/**
|
|
154
|
+
* Get permits by state
|
|
155
|
+
*
|
|
156
|
+
* @returns Array of permits grouped by state
|
|
157
|
+
*/
|
|
158
|
+
byState(): Promise<PermitsByState[]>;
|
|
159
|
+
/**
|
|
160
|
+
* Get permits by operator
|
|
161
|
+
*
|
|
162
|
+
* @returns Array of permits grouped by operator
|
|
163
|
+
*/
|
|
164
|
+
byOperator(): Promise<PermitsByOperator[]>;
|
|
165
|
+
/**
|
|
166
|
+
* Get permits by formation
|
|
167
|
+
*
|
|
168
|
+
* @returns Array of permits grouped by formation
|
|
169
|
+
*/
|
|
170
|
+
byFormation(): Promise<PermitsByFormation[]>;
|
|
171
|
+
/**
|
|
172
|
+
* Search well permits
|
|
173
|
+
*
|
|
174
|
+
* @param query - Search query parameters
|
|
175
|
+
* @returns Array of matching well permit records
|
|
176
|
+
*/
|
|
177
|
+
search(query: WellPermitSearchQuery): Promise<WellPermitRecord[]>;
|
|
178
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Energy Intelligence - Well Permits Resource
|
|
3
|
+
*
|
|
4
|
+
* Access oil and gas well permit data by state, operator, and formation.
|
|
5
|
+
*/
|
|
6
|
+
import { ValidationError } from "../../errors.js";
|
|
7
|
+
/**
|
|
8
|
+
* EI Well Permits Resource
|
|
9
|
+
*
|
|
10
|
+
* Access oil and gas well permit data with detailed breakdowns.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const client = new OilPriceAPI({ apiKey: 'your_key' });
|
|
15
|
+
*
|
|
16
|
+
* // Get latest permits
|
|
17
|
+
* const latest = await client.ei.wellPermits.latest();
|
|
18
|
+
* console.log(`Permit: ${latest.permit_number} - ${latest.operator}`);
|
|
19
|
+
*
|
|
20
|
+
* // Get permits by state
|
|
21
|
+
* const states = await client.ei.wellPermits.byState();
|
|
22
|
+
* states.forEach(s => console.log(`${s.state}: ${s.permit_count} permits`));
|
|
23
|
+
*
|
|
24
|
+
* // Search permits
|
|
25
|
+
* const results = await client.ei.wellPermits.search({
|
|
26
|
+
* state: 'Texas',
|
|
27
|
+
* operator: 'ConocoPhillips'
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export class EIWellPermitsResource {
|
|
32
|
+
constructor(client) {
|
|
33
|
+
this.client = client;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* List all well permit records
|
|
37
|
+
*
|
|
38
|
+
* @returns Array of well permit records
|
|
39
|
+
*/
|
|
40
|
+
async list() {
|
|
41
|
+
const response = await this.client["request"]("/v1/ei/well-permits", {});
|
|
42
|
+
return Array.isArray(response) ? response : response.data;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Get a specific well permit record
|
|
46
|
+
*
|
|
47
|
+
* @param id - Record ID
|
|
48
|
+
* @returns Well permit record
|
|
49
|
+
*/
|
|
50
|
+
async get(id) {
|
|
51
|
+
if (!id || typeof id !== "string") {
|
|
52
|
+
throw new ValidationError("Record ID must be a non-empty string");
|
|
53
|
+
}
|
|
54
|
+
return this.client["request"](`/v1/ei/well-permits/${id}`, {});
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Get latest well permit
|
|
58
|
+
*
|
|
59
|
+
* @returns Latest well permit record
|
|
60
|
+
*/
|
|
61
|
+
async latest() {
|
|
62
|
+
return this.client["request"]("/v1/ei/well-permits/latest", {});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Get well permit summary
|
|
66
|
+
*
|
|
67
|
+
* @returns Well permit summary statistics
|
|
68
|
+
*/
|
|
69
|
+
async summary() {
|
|
70
|
+
return this.client["request"]("/v1/ei/well-permits/summary", {});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Get permits by state
|
|
74
|
+
*
|
|
75
|
+
* @returns Array of permits grouped by state
|
|
76
|
+
*/
|
|
77
|
+
async byState() {
|
|
78
|
+
const response = await this.client["request"]("/v1/ei/well-permits/by-state", {});
|
|
79
|
+
return Array.isArray(response) ? response : response.data;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Get permits by operator
|
|
83
|
+
*
|
|
84
|
+
* @returns Array of permits grouped by operator
|
|
85
|
+
*/
|
|
86
|
+
async byOperator() {
|
|
87
|
+
const response = await this.client["request"]("/v1/ei/well-permits/by-operator", {});
|
|
88
|
+
return Array.isArray(response) ? response : response.data;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Get permits by formation
|
|
92
|
+
*
|
|
93
|
+
* @returns Array of permits grouped by formation
|
|
94
|
+
*/
|
|
95
|
+
async byFormation() {
|
|
96
|
+
const response = await this.client["request"]("/v1/ei/well-permits/by-formation", {});
|
|
97
|
+
return Array.isArray(response) ? response : response.data;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Search well permits
|
|
101
|
+
*
|
|
102
|
+
* @param query - Search query parameters
|
|
103
|
+
* @returns Array of matching well permit records
|
|
104
|
+
*/
|
|
105
|
+
async search(query) {
|
|
106
|
+
const params = {};
|
|
107
|
+
if (query.state)
|
|
108
|
+
params.state = query.state;
|
|
109
|
+
if (query.operator)
|
|
110
|
+
params.operator = query.operator;
|
|
111
|
+
if (query.formation)
|
|
112
|
+
params.formation = query.formation;
|
|
113
|
+
if (query.start_date)
|
|
114
|
+
params.start_date = query.start_date;
|
|
115
|
+
if (query.end_date)
|
|
116
|
+
params.end_date = query.end_date;
|
|
117
|
+
const response = await this.client["request"]("/v1/ei/well-permits/search", params);
|
|
118
|
+
return Array.isArray(response) ? response : response.data;
|
|
119
|
+
}
|
|
120
|
+
}
|