emissions-api-sdk 1.0.7 → 1.0.9
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/dist/coverage/clover.xml +2 -2
- package/dist/coverage/lcov-report/index.html +1 -1
- package/dist/coverage/lcov-report/src/Client.ts.html +1 -1
- package/dist/coverage/lcov-report/src/Constants.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/Calculation.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/EconomicActivity.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/Factor.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/FactorSets.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/Fugitive.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/Location.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/Metadata.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/Mobile.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/RealEstate.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/Stationary.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/TransportationAndDistribution.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/TypeRecommender.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/Usage.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/index.html +1 -1
- package/dist/coverage/lcov-report/src/index.html +1 -1
- package/dist/coverage/lcov-report/src/request.ts.html +1 -1
- package/dist/coverage/lcov-report/src/utils.ts.html +1 -1
- package/dist/coverage/lcov-report/test/index.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/CommonRequest.ts.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/FactorRequest.ts.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/GenericCalculationRequest.ts.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/LocationRequest.ts.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/SearchRequest.ts.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/index.html +1 -1
- package/dist/coverage/lcov-report/test/testUtils.ts.html +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/interfaces/response/EmissionResponse.d.ts +4 -0
- package/dist/types/interfaces/response/EmissionResponseWithDetails.d.ts +62 -124
- package/dist/types/interfaces/response/FactorResponse.d.ts +2 -0
- package/package.json +3 -2
- package/src/index.ts +3 -12
- package/src/interfaces/response/EmissionResponse.ts +6 -0
- package/src/interfaces/response/EmissionResponseWithDetails.ts +79 -146
- package/src/interfaces/response/FactorResponse.ts +3 -0
package/dist/coverage/clover.xml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="
|
|
3
|
-
<project timestamp="
|
|
2
|
+
<coverage generated="1776933588505" clover="3.2.0">
|
|
3
|
+
<project timestamp="1776933588505" name="All files">
|
|
4
4
|
<metrics statements="215" coveredstatements="213" conditionals="60" coveredconditionals="53" methods="31" coveredmethods="29" elements="306" coveredelements="295" complexity="0" loc="215" ncloc="215" packages="4" files="23" classes="23"/>
|
|
5
5
|
<package name="src">
|
|
6
6
|
<metrics statements="86" coveredstatements="84" conditionals="47" coveredconditionals="41" methods="11" coveredmethods="9"/>
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
147
147
|
Code coverage generated by
|
|
148
148
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
149
|
-
at 2026-04-
|
|
149
|
+
at 2026-04-23T08:39:48.484Z
|
|
150
150
|
</div>
|
|
151
151
|
<script src="prettify.js"></script>
|
|
152
152
|
<script>
|
|
@@ -823,7 +823,7 @@ export class Client {
|
|
|
823
823
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
824
824
|
Code coverage generated by
|
|
825
825
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
826
|
-
at 2026-04-
|
|
826
|
+
at 2026-04-23T08:39:48.484Z
|
|
827
827
|
</div>
|
|
828
828
|
<script src="../prettify.js"></script>
|
|
829
829
|
<script>
|
|
@@ -148,7 +148,7 @@ export const CLIENT_SOURCE_SDK = "node-sdk";</pre></td></tr></table></pre>
|
|
|
148
148
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
149
149
|
Code coverage generated by
|
|
150
150
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
151
|
-
at 2026-04-
|
|
151
|
+
at 2026-04-23T08:39:48.484Z
|
|
152
152
|
</div>
|
|
153
153
|
<script src="../prettify.js"></script>
|
|
154
154
|
<script>
|
|
@@ -211,7 +211,7 @@ export async function calculate(
|
|
|
211
211
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
212
212
|
Code coverage generated by
|
|
213
213
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
214
|
-
at 2026-04-
|
|
214
|
+
at 2026-04-23T08:39:48.484Z
|
|
215
215
|
</div>
|
|
216
216
|
<script src="../../prettify.js"></script>
|
|
217
217
|
<script>
|
|
@@ -205,7 +205,7 @@ export async function calculate(
|
|
|
205
205
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
206
206
|
Code coverage generated by
|
|
207
207
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
208
|
-
at 2026-04-
|
|
208
|
+
at 2026-04-23T08:39:48.484Z
|
|
209
209
|
</div>
|
|
210
210
|
<script src="../../prettify.js"></script>
|
|
211
211
|
<script>
|
|
@@ -328,7 +328,7 @@ export async function search(
|
|
|
328
328
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
329
329
|
Code coverage generated by
|
|
330
330
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
331
|
-
at 2026-04-
|
|
331
|
+
at 2026-04-23T08:39:48.484Z
|
|
332
332
|
</div>
|
|
333
333
|
<script src="../../prettify.js"></script>
|
|
334
334
|
<script>
|
|
@@ -142,7 +142,7 @@ const client = Client.getInstance();
|
|
|
142
142
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
143
143
|
Code coverage generated by
|
|
144
144
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
145
|
-
at 2026-04-
|
|
145
|
+
at 2026-04-23T08:39:48.484Z
|
|
146
146
|
</div>
|
|
147
147
|
<script src="../../prettify.js"></script>
|
|
148
148
|
<script>
|
|
@@ -205,7 +205,7 @@ export async function calculate(
|
|
|
205
205
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
206
206
|
Code coverage generated by
|
|
207
207
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
208
|
-
at 2026-04-
|
|
208
|
+
at 2026-04-23T08:39:48.484Z
|
|
209
209
|
</div>
|
|
210
210
|
<script src="../../prettify.js"></script>
|
|
211
211
|
<script>
|
|
@@ -202,7 +202,7 @@ export async function calculate(
|
|
|
202
202
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
203
203
|
Code coverage generated by
|
|
204
204
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
205
|
-
at 2026-04-
|
|
205
|
+
at 2026-04-23T08:39:48.484Z
|
|
206
206
|
</div>
|
|
207
207
|
<script src="../../prettify.js"></script>
|
|
208
208
|
<script>
|
|
@@ -589,7 +589,7 @@ export async function postUnits(
|
|
|
589
589
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
590
590
|
Code coverage generated by
|
|
591
591
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
592
|
-
at 2026-04-
|
|
592
|
+
at 2026-04-23T08:39:48.484Z
|
|
593
593
|
</div>
|
|
594
594
|
<script src="../../prettify.js"></script>
|
|
595
595
|
<script>
|
|
@@ -208,7 +208,7 @@ export async function calculate(
|
|
|
208
208
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
209
209
|
Code coverage generated by
|
|
210
210
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
211
|
-
at 2026-04-
|
|
211
|
+
at 2026-04-23T08:39:48.484Z
|
|
212
212
|
</div>
|
|
213
213
|
<script src="../../prettify.js"></script>
|
|
214
214
|
<script>
|
|
@@ -202,7 +202,7 @@ export async function calculate(
|
|
|
202
202
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
203
203
|
Code coverage generated by
|
|
204
204
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
205
|
-
at 2026-04-
|
|
205
|
+
at 2026-04-23T08:39:48.484Z
|
|
206
206
|
</div>
|
|
207
207
|
<script src="../../prettify.js"></script>
|
|
208
208
|
<script>
|
|
@@ -208,7 +208,7 @@ export async function calculate(
|
|
|
208
208
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
209
209
|
Code coverage generated by
|
|
210
210
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
211
|
-
at 2026-04-
|
|
211
|
+
at 2026-04-23T08:39:48.484Z
|
|
212
212
|
</div>
|
|
213
213
|
<script src="../../prettify.js"></script>
|
|
214
214
|
<script>
|
|
@@ -205,7 +205,7 @@ export async function calculate(
|
|
|
205
205
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
206
206
|
Code coverage generated by
|
|
207
207
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
208
|
-
at 2026-04-
|
|
208
|
+
at 2026-04-23T08:39:48.484Z
|
|
209
209
|
</div>
|
|
210
210
|
<script src="../../prettify.js"></script>
|
|
211
211
|
<script>
|
|
@@ -262,7 +262,7 @@ export async function search(
|
|
|
262
262
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
263
263
|
Code coverage generated by
|
|
264
264
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
265
|
-
at 2026-04-
|
|
265
|
+
at 2026-04-23T08:39:48.484Z
|
|
266
266
|
</div>
|
|
267
267
|
<script src="../../prettify.js"></script>
|
|
268
268
|
<script>
|
|
@@ -145,7 +145,7 @@ export async function getUsage(history : boolean = <span class="branch-0 cbranch
|
|
|
145
145
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
146
146
|
Code coverage generated by
|
|
147
147
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
148
|
-
at 2026-04-
|
|
148
|
+
at 2026-04-23T08:39:48.484Z
|
|
149
149
|
</div>
|
|
150
150
|
<script src="../../prettify.js"></script>
|
|
151
151
|
<script>
|
|
@@ -281,7 +281,7 @@
|
|
|
281
281
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
282
282
|
Code coverage generated by
|
|
283
283
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
284
|
-
at 2026-04-
|
|
284
|
+
at 2026-04-23T08:39:48.484Z
|
|
285
285
|
</div>
|
|
286
286
|
<script src="../../prettify.js"></script>
|
|
287
287
|
<script>
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
147
147
|
Code coverage generated by
|
|
148
148
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
149
|
-
at 2026-04-
|
|
149
|
+
at 2026-04-23T08:39:48.484Z
|
|
150
150
|
</div>
|
|
151
151
|
<script src="../prettify.js"></script>
|
|
152
152
|
<script>
|
|
@@ -220,7 +220,7 @@ export async function makeApiRequest<T>(config: RequestConfig): Promise<
|
|
|
220
220
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
221
221
|
Code coverage generated by
|
|
222
222
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
223
|
-
at 2026-04-
|
|
223
|
+
at 2026-04-23T08:39:48.484Z
|
|
224
224
|
</div>
|
|
225
225
|
<script src="../prettify.js"></script>
|
|
226
226
|
<script>
|
|
@@ -124,7 +124,7 @@ export function findExpiryTime(token: string): any {
|
|
|
124
124
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
125
125
|
Code coverage generated by
|
|
126
126
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
127
|
-
at 2026-04-
|
|
127
|
+
at 2026-04-23T08:39:48.484Z
|
|
128
128
|
</div>
|
|
129
129
|
<script src="../prettify.js"></script>
|
|
130
130
|
<script>
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
102
|
Code coverage generated by
|
|
103
103
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
-
at 2026-04-
|
|
104
|
+
at 2026-04-23T08:39:48.484Z
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../prettify.js"></script>
|
|
107
107
|
<script>
|
|
@@ -127,7 +127,7 @@ export default commonPayload;
|
|
|
127
127
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
128
128
|
Code coverage generated by
|
|
129
129
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
130
|
-
at 2026-04-
|
|
130
|
+
at 2026-04-23T08:39:48.484Z
|
|
131
131
|
</div>
|
|
132
132
|
<script src="../../prettify.js"></script>
|
|
133
133
|
<script>
|
|
@@ -118,7 +118,7 @@ export default FactorPayload;
|
|
|
118
118
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
119
119
|
Code coverage generated by
|
|
120
120
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
121
|
-
at 2026-04-
|
|
121
|
+
at 2026-04-23T08:39:48.484Z
|
|
122
122
|
</div>
|
|
123
123
|
<script src="../../prettify.js"></script>
|
|
124
124
|
<script>
|
|
@@ -127,7 +127,7 @@ export default GenericCalculationPayload;
|
|
|
127
127
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
128
128
|
Code coverage generated by
|
|
129
129
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
130
|
-
at 2026-04-
|
|
130
|
+
at 2026-04-23T08:39:48.484Z
|
|
131
131
|
</div>
|
|
132
132
|
<script src="../../prettify.js"></script>
|
|
133
133
|
<script>
|
|
@@ -124,7 +124,7 @@ export default locationPayload;</pre></td></tr></table></pre>
|
|
|
124
124
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
125
125
|
Code coverage generated by
|
|
126
126
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
127
|
-
at 2026-04-
|
|
127
|
+
at 2026-04-23T08:39:48.484Z
|
|
128
128
|
</div>
|
|
129
129
|
<script src="../../prettify.js"></script>
|
|
130
130
|
<script>
|
|
@@ -127,7 +127,7 @@ export default SearchPayload;
|
|
|
127
127
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
128
128
|
Code coverage generated by
|
|
129
129
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
130
|
-
at 2026-04-
|
|
130
|
+
at 2026-04-23T08:39:48.484Z
|
|
131
131
|
</div>
|
|
132
132
|
<script src="../../prettify.js"></script>
|
|
133
133
|
<script>
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
162
162
|
Code coverage generated by
|
|
163
163
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
164
|
-
at 2026-04-
|
|
164
|
+
at 2026-04-23T08:39:48.484Z
|
|
165
165
|
</div>
|
|
166
166
|
<script src="../../prettify.js"></script>
|
|
167
167
|
<script>
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
83
83
|
Code coverage generated by
|
|
84
84
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
85
|
-
at 2026-04-
|
|
85
|
+
at 2026-04-23T08:39:48.484Z
|
|
86
86
|
</div>
|
|
87
87
|
<script src="../prettify.js"></script>
|
|
88
88
|
<script>
|
package/dist/types/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export * as TypeRecommender from './api/TypeRecommender';
|
|
|
15
15
|
export { ClientConfig } from './interfaces/Config';
|
|
16
16
|
export { AreaResponse, Location as LocationInfo } from './interfaces/response/AreaResponse';
|
|
17
17
|
export { EmissionResponse } from './interfaces/response/EmissionResponse';
|
|
18
|
-
export { EmissionResponseWithDetails,
|
|
18
|
+
export { EmissionResponseWithDetails, FactorDetails, FactorSetDetails, IncludeDetails } from './interfaces/response/EmissionResponseWithDetails';
|
|
19
19
|
export { FactorResponse } from './interfaces/response/FactorResponse';
|
|
20
20
|
export { FactorSetResponse, FactorSet } from './interfaces/response/FactorSetResponse';
|
|
21
21
|
export { SearchResponse, Pagination, PaginationBody, SearchLink } from './interfaces/response/SearchResponse';
|
|
@@ -24,6 +24,10 @@ export interface EmissionResponse {
|
|
|
24
24
|
SF6?: number;
|
|
25
25
|
/** Nitrogen trifluoride emissions value (optional) */
|
|
26
26
|
NF3?: number;
|
|
27
|
+
/** Energy consumption in megawatt-hours (optional) */
|
|
28
|
+
'energy(MWh)'?: number;
|
|
29
|
+
/** Asset turnover ratio (optional) */
|
|
30
|
+
assetTurnoverRatio?: number;
|
|
27
31
|
/** Unit of measurement for emissions (required) */
|
|
28
32
|
unit: string;
|
|
29
33
|
/** Description of the emission calculation (required) */
|
|
@@ -1,148 +1,86 @@
|
|
|
1
1
|
import { EmissionResponse } from './EmissionResponse';
|
|
2
2
|
/**
|
|
3
|
-
* Interface for
|
|
3
|
+
* Interface for factor set details
|
|
4
4
|
*/
|
|
5
|
-
export interface
|
|
6
|
-
/**
|
|
7
|
-
name
|
|
8
|
-
/** Unit description (optional) */
|
|
9
|
-
description?: string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Interface for area information
|
|
13
|
-
*/
|
|
14
|
-
export interface AreaInfo {
|
|
15
|
-
/** Internal name of the area */
|
|
16
|
-
internalName: string;
|
|
17
|
-
/** Standard name of the area */
|
|
18
|
-
standardName: string;
|
|
19
|
-
alpha3?: string;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Interface for area type information
|
|
23
|
-
*/
|
|
24
|
-
export interface AreaType {
|
|
25
|
-
/** Type name (e.g., "Planet", "State") */
|
|
26
|
-
name: string;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Interface for factor data type categories
|
|
30
|
-
*/
|
|
31
|
-
export interface FactorDataTypeCategory {
|
|
32
|
-
/** Category name */
|
|
33
|
-
name: string;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Interface for factor set information
|
|
37
|
-
*/
|
|
38
|
-
export interface FactorSetInfo {
|
|
39
|
-
/** Factor set type */
|
|
40
|
-
type: string;
|
|
5
|
+
export interface FactorSetDetails {
|
|
6
|
+
/** Name of the factor set */
|
|
7
|
+
name?: string;
|
|
41
8
|
/** Description of the factor set */
|
|
42
9
|
description?: string;
|
|
43
10
|
/** Provider of the factor set */
|
|
44
11
|
provider?: string;
|
|
45
12
|
/** Source URL for the factor set */
|
|
46
13
|
sourceUrl?: string;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
export interface FactorSelectionDefault {
|
|
50
|
-
actorDataType?: string;
|
|
51
|
-
areaName?: string;
|
|
52
|
-
factorSetName?: string;
|
|
14
|
+
/** Citation information for the factor set */
|
|
15
|
+
citation?: string;
|
|
53
16
|
}
|
|
54
17
|
/**
|
|
55
|
-
* Interface for factor
|
|
18
|
+
* Interface for factor details
|
|
56
19
|
*/
|
|
57
|
-
export interface
|
|
58
|
-
/**
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
|
|
20
|
+
export interface FactorDetails {
|
|
21
|
+
/** Name of the factor */
|
|
22
|
+
name?: string;
|
|
23
|
+
/** Description of the factor */
|
|
24
|
+
description?: string;
|
|
25
|
+
/** Total CO2 equivalent emissions */
|
|
26
|
+
totalCO2e?: number;
|
|
27
|
+
/** CO2 emissions value */
|
|
28
|
+
CO2?: number;
|
|
29
|
+
/** CH4 (Methane) emissions value */
|
|
30
|
+
CH4?: number;
|
|
31
|
+
/** N2O (Nitrous Oxide) emissions value */
|
|
32
|
+
N2O?: number;
|
|
33
|
+
/** Biogenic CO2 emissions value */
|
|
34
|
+
bioCO2?: number;
|
|
35
|
+
/** Indirect CO2 equivalent emissions value */
|
|
36
|
+
indirectCO2e?: number;
|
|
37
|
+
/** Hydrofluorocarbon emissions value */
|
|
38
|
+
HFC?: number;
|
|
39
|
+
/** Perfluorocarbon emissions value */
|
|
40
|
+
PFC?: number;
|
|
41
|
+
/** Sulfur hexafluoride emissions value */
|
|
42
|
+
SF6?: number;
|
|
43
|
+
/** Nitrogen trifluoride emissions value */
|
|
44
|
+
NF3?: number;
|
|
45
|
+
/** Energy consumption in megawatt-hours */
|
|
46
|
+
'energy(MWh)'?: number;
|
|
47
|
+
/** Input unit of measurement */
|
|
48
|
+
inputUnit?: string;
|
|
49
|
+
/** Unit of measurement for emissions */
|
|
50
|
+
unit?: string;
|
|
51
|
+
/** Conversion ratio */
|
|
52
|
+
conversionRatio?: string;
|
|
53
|
+
/** Type of activity */
|
|
54
|
+
activityType?: string;
|
|
62
55
|
/** Activity subtype */
|
|
63
|
-
|
|
56
|
+
activitySubtype?: string;
|
|
64
57
|
/** Unique factor identifier */
|
|
65
|
-
factorId
|
|
66
|
-
/** activity based or spend based */
|
|
67
|
-
methodology
|
|
68
|
-
/**
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
export interface FactorSetVersion {
|
|
58
|
+
factorId?: number;
|
|
59
|
+
/** Methodology (activity based or spend based) */
|
|
60
|
+
methodology?: string;
|
|
61
|
+
/** Scopes data belongs to */
|
|
62
|
+
scopes?: string[];
|
|
63
|
+
/** Area name */
|
|
64
|
+
areaName?: string;
|
|
65
|
+
/** Area type */
|
|
66
|
+
areaType?: string;
|
|
75
67
|
/** Publication start date */
|
|
76
68
|
publishedFrom?: string;
|
|
77
|
-
/** Publication end date
|
|
69
|
+
/** Publication end date */
|
|
78
70
|
publishedTo?: string;
|
|
79
71
|
/** Source of the factor */
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Interface for factor value
|
|
84
|
-
*/
|
|
85
|
-
export interface FactorValue {
|
|
86
|
-
/** Unit information */
|
|
87
|
-
unit: {
|
|
88
|
-
/** Unit name */
|
|
89
|
-
name: string;
|
|
90
|
-
};
|
|
91
|
-
/** Factor value */
|
|
92
|
-
value: number;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Interface for factor metadata
|
|
96
|
-
*/
|
|
97
|
-
export interface FactorMetaData {
|
|
98
|
-
/** Metadata key */
|
|
99
|
-
key: string;
|
|
100
|
-
/** Metadata value */
|
|
101
|
-
value: string;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Interface for unit conversion information
|
|
105
|
-
*/
|
|
106
|
-
export interface UnitConversion {
|
|
107
|
-
/** Input unit */
|
|
108
|
-
inputUnit: string;
|
|
109
|
-
/** Unit from database */
|
|
110
|
-
unitFromDb: string;
|
|
111
|
-
/** Conversion ratio */
|
|
112
|
-
conversionRatio: string;
|
|
72
|
+
source?: string;
|
|
113
73
|
}
|
|
114
74
|
/**
|
|
115
|
-
* Interface for
|
|
75
|
+
* Interface for include details
|
|
116
76
|
*/
|
|
117
|
-
export interface
|
|
118
|
-
/**
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
|
|
122
|
-
/** Array of area types */
|
|
123
|
-
areaType: AreaType[];
|
|
124
|
-
/** Array of factor data type categories */
|
|
125
|
-
factorDataTypeCategories: FactorDataTypeCategory[];
|
|
126
|
-
factorSelectionDefault?: FactorSelectionDefault[];
|
|
127
|
-
/** Array of factor set information */
|
|
128
|
-
factorSet: FactorSetInfo[];
|
|
129
|
-
/** Array of factor data type codes */
|
|
130
|
-
factorDataTypeCode: FactorDataTypeCode[];
|
|
131
|
-
/** Array of factor set versions */
|
|
132
|
-
factorSetVersion: FactorSetVersion[];
|
|
133
|
-
/** Array of factor values */
|
|
134
|
-
factorValue: FactorValue[];
|
|
135
|
-
/** Array of factor metadata */
|
|
136
|
-
factorMetaData: FactorMetaData[];
|
|
137
|
-
/** Array of unit conversions */
|
|
138
|
-
unitConversion: UnitConversion[];
|
|
77
|
+
export interface IncludeDetails {
|
|
78
|
+
/** Factor set details */
|
|
79
|
+
factorSet?: FactorSetDetails;
|
|
80
|
+
/** Factor details */
|
|
81
|
+
factor?: FactorDetails;
|
|
139
82
|
}
|
|
140
|
-
|
|
141
|
-
* Interface representing the emission calculation response with detailed information
|
|
142
|
-
*/
|
|
143
|
-
export interface EmissionResponseWithDetails {
|
|
144
|
-
/** Emission calculation result */
|
|
145
|
-
result: EmissionResponse;
|
|
83
|
+
export interface EmissionResponseWithDetails extends EmissionResponse {
|
|
146
84
|
/** Detailed emission data */
|
|
147
|
-
|
|
85
|
+
details?: IncludeDetails;
|
|
148
86
|
}
|
|
@@ -24,6 +24,8 @@ export interface FactorResponse {
|
|
|
24
24
|
SF6?: number;
|
|
25
25
|
/** Nitrogen trifluoride emissions value (optional - not present in all responses) */
|
|
26
26
|
NF3?: number;
|
|
27
|
+
/** Energy consumption in megawatt-hours (optional) */
|
|
28
|
+
'energy(MWh)'?: number;
|
|
27
29
|
/** Unit of measurement for emissions */
|
|
28
30
|
unit?: string;
|
|
29
31
|
/** Description of the emission factors (optional)*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "emissions-api-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "sdk for IBM Emissions APIs",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -35,13 +35,14 @@
|
|
|
35
35
|
"author": "santhosh0703,Prakhar-sahu,taylorsteffanj",
|
|
36
36
|
"license": "Apache-2.0",
|
|
37
37
|
"resolutions": {
|
|
38
|
+
"follow-redirects": "^1.16.0",
|
|
38
39
|
"handlebars": "^4.7.9",
|
|
39
40
|
"markdown-it": "^14.1.1",
|
|
40
41
|
"minimatch": "^10.2.5",
|
|
41
42
|
"test-exclude": "^7.0.1"
|
|
42
43
|
},
|
|
43
44
|
"dependencies": {
|
|
44
|
-
"axios": "1.
|
|
45
|
+
"axios": "1.15.0"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"@types/jest": "^30.0.0",
|
package/src/index.ts
CHANGED
|
@@ -19,18 +19,9 @@ export { AreaResponse, Location as LocationInfo } from './interfaces/response/Ar
|
|
|
19
19
|
export { EmissionResponse } from './interfaces/response/EmissionResponse';
|
|
20
20
|
export {
|
|
21
21
|
EmissionResponseWithDetails,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
FactorDataTypeCategory,
|
|
26
|
-
FactorSetInfo,
|
|
27
|
-
FactorSelectionDefault,
|
|
28
|
-
FactorDataTypeCode,
|
|
29
|
-
FactorSetVersion,
|
|
30
|
-
FactorValue,
|
|
31
|
-
FactorMetaData,
|
|
32
|
-
UnitConversion,
|
|
33
|
-
EmissionData
|
|
22
|
+
FactorDetails,
|
|
23
|
+
FactorSetDetails,
|
|
24
|
+
IncludeDetails
|
|
34
25
|
} from './interfaces/response/EmissionResponseWithDetails';
|
|
35
26
|
export { FactorResponse } from './interfaces/response/FactorResponse';
|
|
36
27
|
export {
|
|
@@ -35,6 +35,12 @@ export interface EmissionResponse {
|
|
|
35
35
|
/** Nitrogen trifluoride emissions value (optional) */
|
|
36
36
|
NF3?: number;
|
|
37
37
|
|
|
38
|
+
/** Energy consumption in megawatt-hours (optional) */
|
|
39
|
+
'energy(MWh)'?: number;
|
|
40
|
+
|
|
41
|
+
/** Asset turnover ratio (optional) */
|
|
42
|
+
assetTurnoverRatio?: number;
|
|
43
|
+
|
|
38
44
|
/** Unit of measurement for emissions (required) */
|
|
39
45
|
unit: string;
|
|
40
46
|
|
|
@@ -1,51 +1,11 @@
|
|
|
1
1
|
import { EmissionResponse } from './EmissionResponse';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Interface for
|
|
4
|
+
* Interface for factor set details
|
|
5
5
|
*/
|
|
6
|
-
export interface
|
|
7
|
-
/**
|
|
8
|
-
name
|
|
9
|
-
|
|
10
|
-
/** Unit description (optional) */
|
|
11
|
-
description?: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Interface for area information
|
|
16
|
-
*/
|
|
17
|
-
export interface AreaInfo {
|
|
18
|
-
/** Internal name of the area */
|
|
19
|
-
internalName: string;
|
|
20
|
-
|
|
21
|
-
/** Standard name of the area */
|
|
22
|
-
standardName: string;
|
|
23
|
-
|
|
24
|
-
alpha3?: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Interface for area type information
|
|
29
|
-
*/
|
|
30
|
-
export interface AreaType {
|
|
31
|
-
/** Type name (e.g., "Planet", "State") */
|
|
32
|
-
name: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Interface for factor data type categories
|
|
37
|
-
*/
|
|
38
|
-
export interface FactorDataTypeCategory {
|
|
39
|
-
/** Category name */
|
|
40
|
-
name: string;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Interface for factor set information
|
|
45
|
-
*/
|
|
46
|
-
export interface FactorSetInfo {
|
|
47
|
-
/** Factor set type */
|
|
48
|
-
type: string;
|
|
6
|
+
export interface FactorSetDetails {
|
|
7
|
+
/** Name of the factor set */
|
|
8
|
+
name?: string;
|
|
49
9
|
|
|
50
10
|
/** Description of the factor set */
|
|
51
11
|
description?: string;
|
|
@@ -55,135 +15,108 @@ export interface FactorSetInfo {
|
|
|
55
15
|
|
|
56
16
|
/** Source URL for the factor set */
|
|
57
17
|
sourceUrl?: string;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
export interface FactorSelectionDefault {
|
|
62
|
-
actorDataType?: string;
|
|
63
|
-
areaName?: string;
|
|
64
|
-
factorSetName?: string;
|
|
18
|
+
|
|
19
|
+
/** Citation information for the factor set */
|
|
20
|
+
citation?: string;
|
|
65
21
|
}
|
|
22
|
+
|
|
66
23
|
/**
|
|
67
|
-
* Interface for factor
|
|
24
|
+
* Interface for factor details
|
|
68
25
|
*/
|
|
69
|
-
export interface
|
|
70
|
-
/**
|
|
71
|
-
|
|
26
|
+
export interface FactorDetails {
|
|
27
|
+
/** Name of the factor */
|
|
28
|
+
name?: string;
|
|
72
29
|
|
|
73
|
-
/**
|
|
74
|
-
|
|
30
|
+
/** Description of the factor */
|
|
31
|
+
description?: string;
|
|
75
32
|
|
|
76
|
-
/**
|
|
77
|
-
|
|
33
|
+
/** Total CO2 equivalent emissions */
|
|
34
|
+
totalCO2e?: number;
|
|
78
35
|
|
|
79
|
-
/**
|
|
80
|
-
|
|
36
|
+
/** CO2 emissions value */
|
|
37
|
+
CO2?: number;
|
|
81
38
|
|
|
82
|
-
/**
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
/** scopes data belongs to */
|
|
86
|
-
scope : string[];
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Interface for factor set version information
|
|
91
|
-
*/
|
|
92
|
-
export interface FactorSetVersion {
|
|
93
|
-
/** Publication start date */
|
|
94
|
-
publishedFrom?: string;
|
|
39
|
+
/** CH4 (Methane) emissions value */
|
|
40
|
+
CH4?: number;
|
|
95
41
|
|
|
96
|
-
/**
|
|
97
|
-
|
|
42
|
+
/** N2O (Nitrous Oxide) emissions value */
|
|
43
|
+
N2O?: number;
|
|
98
44
|
|
|
99
|
-
/**
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Interface for factor value
|
|
105
|
-
*/
|
|
106
|
-
export interface FactorValue {
|
|
107
|
-
/** Unit information */
|
|
108
|
-
unit: {
|
|
109
|
-
/** Unit name */
|
|
110
|
-
name: string;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
/** Factor value */
|
|
114
|
-
value: number;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Interface for factor metadata
|
|
119
|
-
*/
|
|
120
|
-
export interface FactorMetaData {
|
|
121
|
-
/** Metadata key */
|
|
122
|
-
key: string;
|
|
45
|
+
/** Biogenic CO2 emissions value */
|
|
46
|
+
bioCO2?: number;
|
|
123
47
|
|
|
124
|
-
/**
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
*/
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
48
|
+
/** Indirect CO2 equivalent emissions value */
|
|
49
|
+
indirectCO2e?: number;
|
|
50
|
+
|
|
51
|
+
/** Hydrofluorocarbon emissions value */
|
|
52
|
+
HFC?: number;
|
|
53
|
+
|
|
54
|
+
/** Perfluorocarbon emissions value */
|
|
55
|
+
PFC?: number;
|
|
56
|
+
|
|
57
|
+
/** Sulfur hexafluoride emissions value */
|
|
58
|
+
SF6?: number;
|
|
59
|
+
|
|
60
|
+
/** Nitrogen trifluoride emissions value */
|
|
61
|
+
NF3?: number;
|
|
134
62
|
|
|
135
|
-
/**
|
|
136
|
-
|
|
63
|
+
/** Energy consumption in megawatt-hours */
|
|
64
|
+
'energy(MWh)'?: number;
|
|
65
|
+
|
|
66
|
+
/** Input unit of measurement */
|
|
67
|
+
inputUnit?: string;
|
|
68
|
+
|
|
69
|
+
/** Unit of measurement for emissions */
|
|
70
|
+
unit?: string;
|
|
137
71
|
|
|
138
72
|
/** Conversion ratio */
|
|
139
|
-
conversionRatio
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Interface for detailed emission data
|
|
144
|
-
*/
|
|
145
|
-
export interface EmissionData {
|
|
146
|
-
/** Array of unit information */
|
|
147
|
-
unit: UnitInfo[];
|
|
73
|
+
conversionRatio?: string;
|
|
148
74
|
|
|
149
|
-
/**
|
|
150
|
-
|
|
75
|
+
/** Type of activity */
|
|
76
|
+
activityType?: string;
|
|
151
77
|
|
|
152
|
-
/**
|
|
153
|
-
|
|
78
|
+
/** Activity subtype */
|
|
79
|
+
activitySubtype?: string;
|
|
154
80
|
|
|
155
|
-
/**
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
factorSelectionDefault? :FactorSelectionDefault[];
|
|
81
|
+
/** Unique factor identifier */
|
|
82
|
+
factorId?: number;
|
|
159
83
|
|
|
160
|
-
/**
|
|
161
|
-
|
|
84
|
+
/** Methodology (activity based or spend based) */
|
|
85
|
+
methodology?: string;
|
|
162
86
|
|
|
163
|
-
/**
|
|
164
|
-
|
|
87
|
+
/** Scopes data belongs to */
|
|
88
|
+
scopes?: string[];
|
|
165
89
|
|
|
166
|
-
/**
|
|
167
|
-
|
|
90
|
+
/** Area name */
|
|
91
|
+
areaName?: string;
|
|
168
92
|
|
|
169
|
-
/**
|
|
170
|
-
|
|
93
|
+
/** Area type */
|
|
94
|
+
areaType?: string;
|
|
171
95
|
|
|
172
|
-
/**
|
|
173
|
-
|
|
96
|
+
/** Publication start date */
|
|
97
|
+
publishedFrom?: string;
|
|
98
|
+
|
|
99
|
+
/** Publication end date */
|
|
100
|
+
publishedTo?: string;
|
|
174
101
|
|
|
175
|
-
/**
|
|
176
|
-
|
|
102
|
+
/** Source of the factor */
|
|
103
|
+
source?: string;
|
|
177
104
|
}
|
|
178
105
|
|
|
179
106
|
/**
|
|
180
|
-
* Interface
|
|
107
|
+
* Interface for include details
|
|
181
108
|
*/
|
|
182
|
-
export interface
|
|
183
|
-
/**
|
|
184
|
-
|
|
109
|
+
export interface IncludeDetails {
|
|
110
|
+
/** Factor set details */
|
|
111
|
+
factorSet?: FactorSetDetails;
|
|
185
112
|
|
|
113
|
+
/** Factor details */
|
|
114
|
+
factor?: FactorDetails;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
export interface EmissionResponseWithDetails extends EmissionResponse {
|
|
186
119
|
/** Detailed emission data */
|
|
187
|
-
|
|
120
|
+
details?: IncludeDetails;
|
|
188
121
|
}
|
|
189
122
|
|