emissions-api-sdk 1.0.0 → 1.0.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 +33 -2
- package/dist/Constants.js +23 -1
- package/dist/api/Calculation.js +78 -15
- package/dist/api/Factor.js +99 -18
- package/dist/api/FactorSets.js +1 -1
- package/dist/api/Fugitive.js +76 -13
- package/dist/api/Location.js +76 -15
- package/dist/api/Mobile.js +65 -1
- package/dist/api/Stationary.js +78 -15
- package/dist/api/TransportationAndDistribution.js +77 -14
- package/dist/coverage/clover.xml +191 -81
- package/dist/coverage/coverage-final.json +11 -11
- package/dist/coverage/lcov-report/index.html +16 -16
- package/dist/coverage/lcov-report/src/Client.ts.html +23 -23
- package/dist/coverage/lcov-report/src/Constants.ts.html +82 -4
- package/dist/coverage/lcov-report/src/api/Calculation.ts.html +245 -26
- package/dist/coverage/lcov-report/src/api/Factor.ts.html +313 -34
- package/dist/coverage/lcov-report/src/api/FactorSets.ts.html +8 -5
- package/dist/coverage/lcov-report/src/api/Fugitive.ts.html +246 -24
- package/dist/coverage/lcov-report/src/api/Location.ts.html +245 -26
- package/dist/coverage/lcov-report/src/api/Mobile.ts.html +240 -12
- package/dist/coverage/lcov-report/src/api/Stationary.ts.html +248 -26
- package/dist/coverage/lcov-report/src/api/TransportationAndDistribution.ts.html +250 -25
- package/dist/coverage/lcov-report/src/api/index.html +25 -25
- package/dist/coverage/lcov-report/src/index.html +7 -7
- package/dist/coverage/lcov-report/src/request.ts.html +1 -1
- package/dist/coverage/lcov-report/src/utils.ts.html +5 -5
- 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/coverage/lcov.info +287 -133
- package/dist/interfaces/response/AreaResponse.js +2 -0
- package/dist/interfaces/response/EmissionResponse.js +2 -0
- package/dist/interfaces/response/EmissionResponseWithDetails.js +2 -0
- package/dist/interfaces/response/FactorResponse.js +2 -0
- package/dist/interfaces/response/FactorSetResponse.js +2 -0
- package/dist/interfaces/response/SearchResponse.js +2 -0
- package/dist/interfaces/response/TypeResponse.js +2 -0
- package/dist/interfaces/response/UnitResponse.js +2 -0
- package/dist/types/Constants.d.ts +22 -0
- package/dist/types/api/Calculation.d.ts +59 -16
- package/dist/types/api/Factor.d.ts +73 -20
- package/dist/types/api/FactorSets.d.ts +3 -2
- package/dist/types/api/Fugitive.d.ts +57 -14
- package/dist/types/api/Location.d.ts +57 -16
- package/dist/types/api/Mobile.d.ts +46 -2
- package/dist/types/api/Stationary.d.ts +59 -16
- package/dist/types/api/TransportationAndDistribution.d.ts +58 -15
- package/dist/types/index.d.ts +8 -0
- package/dist/types/interfaces/response/AreaResponse.d.ts +20 -0
- package/dist/types/interfaces/response/EmissionResponse.d.ts +31 -0
- package/dist/types/interfaces/response/EmissionResponseWithDetails.d.ts +144 -0
- package/dist/types/interfaces/response/FactorResponse.d.ts +53 -0
- package/dist/types/interfaces/response/FactorSetResponse.d.ts +38 -0
- package/dist/types/interfaces/response/SearchResponse.d.ts +41 -0
- package/dist/types/interfaces/response/TypeResponse.d.ts +7 -0
- package/dist/types/interfaces/response/UnitResponse.d.ts +7 -0
- package/docs/.nojekyll +0 -0
- package/docs/_sources/authentication.rst.txt +164 -0
- package/docs/_sources/client.rst.txt +137 -0
- package/docs/_sources/getting_started.rst.txt +164 -0
- package/docs/_sources/index.rst.txt +30 -0
- package/docs/_sources/reference.rst.txt +129 -0
- package/docs/_sources/sdk.rst.txt +13 -0
- package/docs/_sources/troubleshooting.rst.txt +486 -0
- package/docs/_static/basic.css +914 -0
- package/docs/_static/custom.css +16 -0
- package/docs/_static/debug.css +69 -0
- package/docs/_static/doctools.js +149 -0
- package/docs/_static/documentation_options.js +13 -0
- package/docs/_static/file.png +0 -0
- package/docs/_static/language_data.js +192 -0
- package/docs/_static/minus.png +0 -0
- package/docs/_static/plus.png +0 -0
- package/docs/_static/pygments.css +232 -0
- package/docs/_static/scripts/furo-extensions.js +0 -0
- package/docs/_static/scripts/furo.js +3 -0
- package/docs/_static/scripts/furo.js.LICENSE.txt +7 -0
- package/docs/_static/scripts/furo.js.map +1 -0
- package/docs/_static/searchtools.js +632 -0
- package/docs/_static/skeleton.css +296 -0
- package/docs/_static/sphinx_highlight.js +154 -0
- package/docs/_static/sphinx_js.css +0 -0
- package/docs/_static/styles/furo-extensions.css +2 -0
- package/docs/_static/styles/furo-extensions.css.map +1 -0
- package/docs/_static/styles/furo.css +2 -0
- package/docs/_static/styles/furo.css.map +1 -0
- package/docs/authentication.html +523 -0
- package/docs/client.html +477 -0
- package/docs/genindex.html +492 -0
- package/docs/getting_started.html +491 -0
- package/docs/index.html +357 -0
- package/docs/objects.inv +0 -0
- package/docs/reference.html +1584 -0
- package/docs/sdk.html +334 -0
- package/docs/search.html +297 -0
- package/docs/searchindex.js +1 -0
- package/docs/troubleshooting.html +786 -0
- package/package.json +1 -1
- package/sphinx-build/Makefile +49 -0
- package/sphinx-build/requirements.txt +5 -0
- package/sphinx-build/source/_static/custom.css +16 -0
- package/sphinx-build/source/authentication.rst +164 -0
- package/sphinx-build/source/client.rst +137 -0
- package/sphinx-build/source/conf.py +56 -0
- package/sphinx-build/source/getting_started.rst +164 -0
- package/sphinx-build/source/index.rst +30 -0
- package/sphinx-build/source/reference.rst +129 -0
- package/sphinx-build/source/sdk.rst +13 -0
- package/sphinx-build/source/troubleshooting.rst +486 -0
- package/src/Constants.ts +26 -0
- package/src/api/Calculation.ts +94 -20
- package/src/api/Factor.ts +122 -28
- package/src/api/FactorSets.ts +4 -3
- package/src/api/Fugitive.ts +93 -18
- package/src/api/Location.ts +94 -20
- package/src/api/Mobile.ts +83 -6
- package/src/api/Stationary.ts +95 -20
- package/src/api/TransportationAndDistribution.ts +95 -19
- package/src/index.ts +33 -1
- package/src/interfaces/response/AreaResponse.ts +25 -0
- package/src/interfaces/response/EmissionResponse.ts +44 -0
- package/src/interfaces/response/EmissionResponseWithDetails.ts +183 -0
- package/src/interfaces/response/FactorResponse.ts +78 -0
- package/src/interfaces/response/FactorSetResponse.ts +52 -0
- package/src/interfaces/response/SearchResponse.ts +52 -0
- package/src/interfaces/response/TypeResponse.ts +7 -0
- package/src/interfaces/response/UnitResponse.ts +7 -0
- package/test/apiTest.test.ts +173 -6
- package/dist/api/Factors.js +0 -98
- package/dist/api/FugitiveEmission.js +0 -40
- package/dist/api/GenericCalculation.js +0 -41
- package/dist/api/LocationEmission.js +0 -41
- package/dist/api/MobileEmission.js +0 -41
- package/dist/api/StationaryEmission.js +0 -41
- package/dist/api/TransportationDistributionEmission.js +0 -40
- package/dist/coverage/lcov-report/src/api/Factors.ts.html +0 -403
- package/dist/coverage/lcov-report/src/api/FugitiveEmission.ts.html +0 -214
- package/dist/coverage/lcov-report/src/api/GenericCalculation.ts.html +0 -217
- package/dist/coverage/lcov-report/src/api/LocationEmission.ts.html +0 -214
- package/dist/coverage/lcov-report/src/api/MobileEmission.ts.html +0 -220
- package/dist/coverage/lcov-report/src/api/StationaryEmission.ts.html +0 -220
- package/dist/coverage/lcov-report/src/api/TransportationDistributionEmission.ts.html +0 -211
- package/dist/types/api/Factors.d.ts +0 -68
- package/dist/types/api/FugitiveEmission.d.ts +0 -27
- package/dist/types/api/GenericCalculation.d.ts +0 -28
- package/dist/types/api/LocationEmission.d.ts +0 -28
- package/dist/types/api/MobileEmission.d.ts +0 -28
- package/dist/types/api/StationaryEmission.d.ts +0 -28
- package/dist/types/api/TransportationDistributionEmission.d.ts +0 -27
package/dist/api/Stationary.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.calculate = calculate;
|
|
4
|
+
exports.getTypes = getTypes;
|
|
5
|
+
exports.getArea = getArea;
|
|
6
|
+
exports.getUnits = getUnits;
|
|
4
7
|
const Client_1 = require("../Client");
|
|
5
8
|
const Constants_1 = require("../Constants");
|
|
6
9
|
const request_1 = require("../request");
|
|
@@ -9,25 +12,25 @@ const request_1 = require("../request");
|
|
|
9
12
|
*
|
|
10
13
|
* @export
|
|
11
14
|
* @param {CommonRequest} payload - The request data to be sent to the stationary API
|
|
12
|
-
* @return {Promise<
|
|
15
|
+
* @return {Promise<EmissionResponse | EmissionResponseWithDetails>} A promise that resolves to the emission calculation result. Returns EmissionResponseWithDetails if includeDetails is true, otherwise EmissionResponse
|
|
13
16
|
* @throws {Error} May throw an error if the API request fails
|
|
14
17
|
*
|
|
15
18
|
* @example
|
|
16
19
|
* const request = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
"time" : {
|
|
21
|
+
"date": "2025-01-04"
|
|
22
|
+
},
|
|
23
|
+
"location": {
|
|
24
|
+
"country": "usa",
|
|
25
|
+
"stateProvince": "new york"
|
|
26
|
+
},
|
|
27
|
+
"activity": {
|
|
28
|
+
"type":"Coal - Lignite",
|
|
29
|
+
"unit": "KJ",
|
|
30
|
+
"value": 3
|
|
31
|
+
},
|
|
32
|
+
"includeDetails": true
|
|
33
|
+
};
|
|
31
34
|
* const result = await calculate(request);
|
|
32
35
|
*/
|
|
33
36
|
async function calculate(payload) {
|
|
@@ -39,3 +42,63 @@ async function calculate(payload) {
|
|
|
39
42
|
data: payload,
|
|
40
43
|
});
|
|
41
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Retrieves available stationary emission calculation types by making a GET request to the API endpoint.
|
|
47
|
+
*
|
|
48
|
+
* @export
|
|
49
|
+
* @return {Promise<TypeResponse>} A promise that resolves to a TypeResponse containing the available stationary emission types
|
|
50
|
+
* @throws {Error} May throw an error if the API request fails
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* const types = await getTypes();
|
|
54
|
+
*/
|
|
55
|
+
async function getTypes() {
|
|
56
|
+
const client = Client_1.Client.getInstance();
|
|
57
|
+
const url = client.getDomain() + Constants_1.STATIONARY_API_TYPES;
|
|
58
|
+
return (0, request_1.makeApiRequest)({
|
|
59
|
+
method: Constants_1.GET,
|
|
60
|
+
url
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Retrieves information about geographical areas supported by the stationary emissions API.
|
|
65
|
+
*
|
|
66
|
+
* @export
|
|
67
|
+
* @return {Promise<AreaResponse>} A promise that resolves to an AreaResponse containing the supported geographical areas
|
|
68
|
+
* @throws {Error} May throw an error if the API request fails
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* const areas = await getArea();
|
|
72
|
+
*/
|
|
73
|
+
async function getArea() {
|
|
74
|
+
const client = Client_1.Client.getInstance();
|
|
75
|
+
const url = client.getDomain() + Constants_1.STATIONARY_API_AREA;
|
|
76
|
+
return (0, request_1.makeApiRequest)({
|
|
77
|
+
method: Constants_1.GET,
|
|
78
|
+
url
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Retrieves available units for a specific stationary emission type.
|
|
83
|
+
*
|
|
84
|
+
* @export
|
|
85
|
+
* @param {string} type - The stationary emission type to get units for (e.g., "Coal - Lignite")
|
|
86
|
+
* @return {Promise<UnitResponse>} A promise that resolves to a UnitResponse containing the available units
|
|
87
|
+
* @throws {Error} May throw an error if the API request fails
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* Get units for the "Petroleum Based Greases - NC:A" emission stationary type with subtype
|
|
91
|
+
* const units = await getUnits("Petroleum Based Greases - NC:A");
|
|
92
|
+
|
|
93
|
+
* Get units for the "Jet Kerosene" emission stationary type without subtype
|
|
94
|
+
* const units = await getUnits("Jet Kerosene");
|
|
95
|
+
*/
|
|
96
|
+
async function getUnits(type) {
|
|
97
|
+
const client = Client_1.Client.getInstance();
|
|
98
|
+
const url = client.getDomain() + Constants_1.STATIONARY_API_UNITS;
|
|
99
|
+
return (0, request_1.makeApiRequest)({
|
|
100
|
+
method: Constants_1.GET,
|
|
101
|
+
url,
|
|
102
|
+
params: { type }
|
|
103
|
+
});
|
|
104
|
+
}
|
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.calculate = calculate;
|
|
4
|
+
exports.getTypes = getTypes;
|
|
5
|
+
exports.getArea = getArea;
|
|
6
|
+
exports.getUnits = getUnits;
|
|
4
7
|
const Client_1 = require("../Client");
|
|
5
8
|
const Constants_1 = require("../Constants");
|
|
6
9
|
const request_1 = require("../request");
|
|
7
10
|
/**
|
|
8
|
-
* Performs Scope
|
|
11
|
+
* Performs Scope 3 transportation and distribution emission calculations by making a POST request to the transportation and distribution API endpoint.
|
|
9
12
|
*
|
|
10
13
|
* @export
|
|
11
14
|
* @param {CalculationRequest} payload - The calculation request data for transportation and distribution operations
|
|
12
|
-
* @return {Promise<
|
|
15
|
+
* @return {Promise<EmissionResponse | EmissionResponseWithDetails>} A promise that resolves to the emission calculation result. Returns EmissionResponseWithDetails if includeDetails is true, otherwise EmissionResponse
|
|
13
16
|
* @throws {Error} May throw an error if the API request fails
|
|
14
17
|
*
|
|
15
18
|
* @example
|
|
16
19
|
* const request = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
"time" : {
|
|
21
|
+
"date": "2025-01-04"
|
|
22
|
+
},
|
|
23
|
+
"location": {
|
|
24
|
+
"country": "usa"
|
|
25
|
+
},
|
|
26
|
+
"activity": {
|
|
27
|
+
"type": "Freight - Cargo Ship - Bulk Carrier - 0-9999 dwt",
|
|
28
|
+
"unit": ["t","km"],
|
|
29
|
+
"value": [1.0,1.0]
|
|
30
|
+
},
|
|
31
|
+
"includeDetails": true
|
|
29
32
|
};
|
|
30
33
|
* const result = await calculate(request);
|
|
31
34
|
*/
|
|
@@ -38,3 +41,63 @@ async function calculate(payload) {
|
|
|
38
41
|
data: payload,
|
|
39
42
|
});
|
|
40
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Retrieves available transportation and distribution calculation types by making a GET request to the API endpoint.
|
|
46
|
+
*
|
|
47
|
+
* @export
|
|
48
|
+
* @return {Promise<TypeResponse>} A promise that resolves to a TypeResponse containing the available transportation and distribution calculation types
|
|
49
|
+
* @throws {Error} May throw an error if the API request fails
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* const types = await getTypes();
|
|
53
|
+
*/
|
|
54
|
+
async function getTypes() {
|
|
55
|
+
const client = Client_1.Client.getInstance();
|
|
56
|
+
const url = client.getDomain() + Constants_1.TRANSPORTATION_AND_DISTRIBUTION_API_TYPES;
|
|
57
|
+
return (0, request_1.makeApiRequest)({
|
|
58
|
+
method: Constants_1.GET,
|
|
59
|
+
url
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Retrieves information about geographical areas supported by the transportation and distribution API.
|
|
64
|
+
*
|
|
65
|
+
* @export
|
|
66
|
+
* @return {Promise<AreaResponse>} A promise that resolves to an AreaResponse containing the supported geographical areas
|
|
67
|
+
* @throws {Error} May throw an error if the API request fails
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* const areas = await getArea();
|
|
71
|
+
*/
|
|
72
|
+
async function getArea() {
|
|
73
|
+
const client = Client_1.Client.getInstance();
|
|
74
|
+
const url = client.getDomain() + Constants_1.TRANSPORTATION_AND_DISTRIBUTION_API_AREA;
|
|
75
|
+
return (0, request_1.makeApiRequest)({
|
|
76
|
+
method: Constants_1.GET,
|
|
77
|
+
url
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Retrieves available units for a specific transportation and distribution calculation type.
|
|
82
|
+
*
|
|
83
|
+
* @export
|
|
84
|
+
* @param {string} type - The transportation and distribution calculation type to get units for (e.g., "Freight - Cargo Ship")
|
|
85
|
+
* @return {Promise<UnitResponse>} A promise that resolves to a UnitResponse containing the available units
|
|
86
|
+
* @throws {Error} May throw an error if the API request fails
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* // Get units for the "Business Travel - Cars:Diesel - Small" transportation and distribution type without subtype
|
|
90
|
+
* const units = await getUnits("Business Travel - Cars:Diesel - Small");
|
|
91
|
+
*
|
|
92
|
+
* // Get units for the "Business Travel - Cars" transportation and distribution type with subtype
|
|
93
|
+
* const units = await getUnits("Business Travel - Cars");
|
|
94
|
+
*/
|
|
95
|
+
async function getUnits(type) {
|
|
96
|
+
const client = Client_1.Client.getInstance();
|
|
97
|
+
const url = client.getDomain() + Constants_1.TRANSPORTATION_AND_DISTRIBUTION_API_UNITS;
|
|
98
|
+
return (0, request_1.makeApiRequest)({
|
|
99
|
+
method: Constants_1.GET,
|
|
100
|
+
url,
|
|
101
|
+
params: { type }
|
|
102
|
+
});
|
|
103
|
+
}
|
package/dist/coverage/clover.xml
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="
|
|
3
|
-
<project timestamp="
|
|
4
|
-
<metrics statements="
|
|
2
|
+
<coverage generated="1765472780037" clover="3.2.0">
|
|
3
|
+
<project timestamp="1765472780037" name="All files">
|
|
4
|
+
<metrics statements="263" coveredstatements="261" conditionals="47" coveredconditionals="41" methods="43" coveredmethods="41" elements="353" coveredelements="343" complexity="0" loc="263" ncloc="263" packages="4" files="18" classes="18"/>
|
|
5
5
|
<package name="src">
|
|
6
|
-
<metrics statements="
|
|
6
|
+
<metrics statements="101" coveredstatements="99" conditionals="47" coveredconditionals="41" methods="11" coveredmethods="9"/>
|
|
7
7
|
<file name="Client.ts" path="/Users/santhosh/Documents/GIT/open-source/ibm-envizi-emissions-api-nodejs-sdk/src/Client.ts">
|
|
8
8
|
<metrics statements="49" coveredstatements="47" conditionals="45" coveredconditionals="40" methods="9" coveredmethods="7"/>
|
|
9
9
|
<line num="1" count="4" type="stmt"/>
|
|
@@ -11,36 +11,36 @@
|
|
|
11
11
|
<line num="4" count="4" type="stmt"/>
|
|
12
12
|
<line num="6" count="4" type="stmt"/>
|
|
13
13
|
<line num="7" count="4" type="stmt"/>
|
|
14
|
-
<line num="24" count="
|
|
15
|
-
<line num="25" count="
|
|
16
|
-
<line num="26" count="
|
|
17
|
-
<line num="27" count="
|
|
14
|
+
<line num="24" count="35" type="cond" truecount="3" falsecount="0"/>
|
|
15
|
+
<line num="25" count="35" type="stmt"/>
|
|
16
|
+
<line num="26" count="35" type="stmt"/>
|
|
17
|
+
<line num="27" count="35" type="cond" truecount="2" falsecount="0"/>
|
|
18
18
|
<line num="28" count="1" type="stmt"/>
|
|
19
19
|
<line num="29" count="1" type="stmt"/>
|
|
20
|
-
<line num="31" count="
|
|
21
|
-
<line num="32" count="
|
|
22
|
-
<line num="35" count="
|
|
23
|
-
<line num="36" count="
|
|
24
|
-
<line num="37" count="
|
|
25
|
-
<line num="38" count="
|
|
26
|
-
<line num="39" count="
|
|
27
|
-
<line num="40" count="
|
|
28
|
-
<line num="78" count="
|
|
20
|
+
<line num="31" count="34" type="stmt"/>
|
|
21
|
+
<line num="32" count="34" type="stmt"/>
|
|
22
|
+
<line num="35" count="35" type="stmt"/>
|
|
23
|
+
<line num="36" count="35" type="stmt"/>
|
|
24
|
+
<line num="37" count="35" type="cond" truecount="3" falsecount="1"/>
|
|
25
|
+
<line num="38" count="35" type="cond" truecount="3" falsecount="1"/>
|
|
26
|
+
<line num="39" count="35" type="stmt"/>
|
|
27
|
+
<line num="40" count="35" type="cond" truecount="1" falsecount="1"/>
|
|
28
|
+
<line num="78" count="38" type="cond" truecount="4" falsecount="0"/>
|
|
29
29
|
<line num="79" count="1" type="stmt"/>
|
|
30
|
-
<line num="83" count="
|
|
30
|
+
<line num="83" count="37" type="cond" truecount="4" falsecount="0"/>
|
|
31
31
|
<line num="84" count="1" type="stmt"/>
|
|
32
|
-
<line num="88" count="
|
|
32
|
+
<line num="88" count="36" type="cond" truecount="5" falsecount="0"/>
|
|
33
33
|
<line num="89" count="1" type="stmt"/>
|
|
34
|
-
<line num="94" count="
|
|
35
|
-
<line num="96" count="
|
|
34
|
+
<line num="94" count="35" type="stmt"/>
|
|
35
|
+
<line num="96" count="35" type="cond" truecount="4" falsecount="0"/>
|
|
36
36
|
<line num="97" count="1" type="stmt"/>
|
|
37
37
|
<line num="98" count="1" type="stmt"/>
|
|
38
|
-
<line num="99" count="
|
|
39
|
-
<line num="100" count="
|
|
40
|
-
<line num="114" count="
|
|
41
|
-
<line num="136" count="
|
|
38
|
+
<line num="99" count="34" type="stmt"/>
|
|
39
|
+
<line num="100" count="35" type="stmt"/>
|
|
40
|
+
<line num="114" count="62" type="stmt"/>
|
|
41
|
+
<line num="136" count="67" type="cond" truecount="2" falsecount="0"/>
|
|
42
42
|
<line num="137" count="1" type="stmt"/>
|
|
43
|
-
<line num="141" count="
|
|
43
|
+
<line num="141" count="66" type="stmt"/>
|
|
44
44
|
<line num="157" count="3" type="cond" truecount="2" falsecount="0"/>
|
|
45
45
|
<line num="158" count="2" type="stmt"/>
|
|
46
46
|
<line num="159" count="2" type="cond" truecount="2" falsecount="0"/>
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
<line num="250" count="4" type="stmt"/>
|
|
58
58
|
</file>
|
|
59
59
|
<file name="Constants.ts" path="/Users/santhosh/Documents/GIT/open-source/ibm-envizi-emissions-api-nodejs-sdk/src/Constants.ts">
|
|
60
|
-
<metrics statements="
|
|
60
|
+
<metrics statements="38" coveredstatements="38" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
|
|
61
61
|
<line num="1" count="4" type="stmt"/>
|
|
62
62
|
<line num="2" count="4" type="stmt"/>
|
|
63
63
|
<line num="3" count="4" type="stmt"/>
|
|
@@ -69,11 +69,33 @@
|
|
|
69
69
|
<line num="9" count="4" type="stmt"/>
|
|
70
70
|
<line num="10" count="4" type="stmt"/>
|
|
71
71
|
<line num="11" count="4" type="stmt"/>
|
|
72
|
-
<line num="12" count="4" type="stmt"/>
|
|
73
72
|
<line num="13" count="4" type="stmt"/>
|
|
74
73
|
<line num="14" count="4" type="stmt"/>
|
|
75
74
|
<line num="15" count="4" type="stmt"/>
|
|
76
75
|
<line num="16" count="4" type="stmt"/>
|
|
76
|
+
<line num="17" count="4" type="stmt"/>
|
|
77
|
+
<line num="18" count="4" type="stmt"/>
|
|
78
|
+
<line num="19" count="4" type="stmt"/>
|
|
79
|
+
<line num="21" count="4" type="stmt"/>
|
|
80
|
+
<line num="22" count="4" type="stmt"/>
|
|
81
|
+
<line num="23" count="4" type="stmt"/>
|
|
82
|
+
<line num="24" count="4" type="stmt"/>
|
|
83
|
+
<line num="25" count="4" type="stmt"/>
|
|
84
|
+
<line num="26" count="4" type="stmt"/>
|
|
85
|
+
<line num="27" count="4" type="stmt"/>
|
|
86
|
+
<line num="28" count="4" type="stmt"/>
|
|
87
|
+
<line num="30" count="4" type="stmt"/>
|
|
88
|
+
<line num="31" count="4" type="stmt"/>
|
|
89
|
+
<line num="32" count="4" type="stmt"/>
|
|
90
|
+
<line num="33" count="4" type="stmt"/>
|
|
91
|
+
<line num="34" count="4" type="stmt"/>
|
|
92
|
+
<line num="35" count="4" type="stmt"/>
|
|
93
|
+
<line num="36" count="4" type="stmt"/>
|
|
94
|
+
<line num="38" count="4" type="stmt"/>
|
|
95
|
+
<line num="39" count="4" type="stmt"/>
|
|
96
|
+
<line num="40" count="4" type="stmt"/>
|
|
97
|
+
<line num="41" count="4" type="stmt"/>
|
|
98
|
+
<line num="42" count="4" type="stmt"/>
|
|
77
99
|
</file>
|
|
78
100
|
<file name="request.ts" path="/Users/santhosh/Documents/GIT/open-source/ibm-envizi-emissions-api-nodejs-sdk/src/request.ts">
|
|
79
101
|
<metrics statements="9" coveredstatements="9" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1"/>
|
|
@@ -90,97 +112,185 @@
|
|
|
90
112
|
<file name="utils.ts" path="/Users/santhosh/Documents/GIT/open-source/ibm-envizi-emissions-api-nodejs-sdk/src/utils.ts">
|
|
91
113
|
<metrics statements="5" coveredstatements="5" conditionals="2" coveredconditionals="1" methods="1" coveredmethods="1"/>
|
|
92
114
|
<line num="14" count="4" type="stmt"/>
|
|
93
|
-
<line num="15" count="
|
|
94
|
-
<line num="16" count="
|
|
95
|
-
<line num="17" count="
|
|
96
|
-
<line num="18" count="
|
|
115
|
+
<line num="15" count="33" type="stmt"/>
|
|
116
|
+
<line num="16" count="33" type="stmt"/>
|
|
117
|
+
<line num="17" count="33" type="cond" truecount="1" falsecount="1"/>
|
|
118
|
+
<line num="18" count="33" type="stmt"/>
|
|
97
119
|
</file>
|
|
98
120
|
</package>
|
|
99
121
|
<package name="src.api">
|
|
100
|
-
<metrics statements="
|
|
122
|
+
<metrics statements="148" coveredstatements="148" conditionals="0" coveredconditionals="0" methods="31" coveredmethods="31"/>
|
|
101
123
|
<file name="Calculation.ts" path="/Users/santhosh/Documents/GIT/open-source/ibm-envizi-emissions-api-nodejs-sdk/src/api/Calculation.ts">
|
|
102
|
-
<metrics statements="
|
|
124
|
+
<metrics statements="19" coveredstatements="19" conditionals="0" coveredconditionals="0" methods="4" coveredmethods="4"/>
|
|
103
125
|
<line num="1" count="1" type="stmt"/>
|
|
104
126
|
<line num="2" count="1" type="stmt"/>
|
|
105
|
-
<line num="
|
|
106
|
-
<line num="
|
|
107
|
-
<line num="
|
|
108
|
-
<line num="
|
|
109
|
-
<line num="
|
|
127
|
+
<line num="9" count="1" type="stmt"/>
|
|
128
|
+
<line num="38" count="1" type="stmt"/>
|
|
129
|
+
<line num="41" count="1" type="stmt"/>
|
|
130
|
+
<line num="42" count="1" type="stmt"/>
|
|
131
|
+
<line num="44" count="1" type="stmt"/>
|
|
132
|
+
<line num="62" count="1" type="stmt"/>
|
|
133
|
+
<line num="63" count="1" type="stmt"/>
|
|
134
|
+
<line num="64" count="1" type="stmt"/>
|
|
135
|
+
<line num="66" count="1" type="stmt"/>
|
|
136
|
+
<line num="82" count="1" type="stmt"/>
|
|
137
|
+
<line num="83" count="1" type="stmt"/>
|
|
138
|
+
<line num="84" count="1" type="stmt"/>
|
|
139
|
+
<line num="86" count="1" type="stmt"/>
|
|
140
|
+
<line num="107" count="1" type="stmt"/>
|
|
141
|
+
<line num="110" count="1" type="stmt"/>
|
|
142
|
+
<line num="111" count="1" type="stmt"/>
|
|
143
|
+
<line num="113" count="1" type="stmt"/>
|
|
110
144
|
</file>
|
|
111
145
|
<file name="Factor.ts" path="/Users/santhosh/Documents/GIT/open-source/ibm-envizi-emissions-api-nodejs-sdk/src/api/Factor.ts">
|
|
112
|
-
<metrics statements="
|
|
146
|
+
<metrics statements="27" coveredstatements="27" conditionals="0" coveredconditionals="0" methods="6" coveredmethods="6"/>
|
|
113
147
|
<line num="1" count="1" type="stmt"/>
|
|
114
148
|
<line num="2" count="1" type="stmt"/>
|
|
115
|
-
<line num="
|
|
116
|
-
<line num="40" count="1" type="stmt"/>
|
|
117
|
-
<line num="43" count="1" type="stmt"/>
|
|
149
|
+
<line num="9" count="1" type="stmt"/>
|
|
118
150
|
<line num="44" count="1" type="stmt"/>
|
|
119
|
-
<line num="
|
|
120
|
-
<line num="
|
|
121
|
-
<line num="
|
|
151
|
+
<line num="47" count="1" type="stmt"/>
|
|
152
|
+
<line num="48" count="1" type="stmt"/>
|
|
153
|
+
<line num="50" count="1" type="stmt"/>
|
|
122
154
|
<line num="79" count="1" type="stmt"/>
|
|
123
|
-
<line num="
|
|
155
|
+
<line num="82" count="1" type="stmt"/>
|
|
156
|
+
<line num="83" count="1" type="stmt"/>
|
|
157
|
+
<line num="85" count="1" type="stmt"/>
|
|
158
|
+
<line num="102" count="1" type="stmt"/>
|
|
159
|
+
<line num="104" count="1" type="stmt"/>
|
|
160
|
+
<line num="105" count="1" type="stmt"/>
|
|
161
|
+
<line num="107" count="1" type="stmt"/>
|
|
162
|
+
<line num="123" count="1" type="stmt"/>
|
|
163
|
+
<line num="125" count="1" type="stmt"/>
|
|
164
|
+
<line num="126" count="1" type="stmt"/>
|
|
165
|
+
<line num="128" count="1" type="stmt"/>
|
|
166
|
+
<line num="144" count="1" type="stmt"/>
|
|
167
|
+
<line num="145" count="1" type="stmt"/>
|
|
168
|
+
<line num="146" count="1" type="stmt"/>
|
|
169
|
+
<line num="148" count="1" type="stmt"/>
|
|
170
|
+
<line num="169" count="1" type="stmt"/>
|
|
171
|
+
<line num="172" count="1" type="stmt"/>
|
|
172
|
+
<line num="173" count="1" type="stmt"/>
|
|
173
|
+
<line num="175" count="1" type="stmt"/>
|
|
124
174
|
</file>
|
|
125
175
|
<file name="FactorSets.ts" path="/Users/santhosh/Documents/GIT/open-source/ibm-envizi-emissions-api-nodejs-sdk/src/api/FactorSets.ts">
|
|
126
176
|
<metrics statements="7" coveredstatements="7" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1"/>
|
|
127
177
|
<line num="1" count="1" type="stmt"/>
|
|
128
178
|
<line num="2" count="1" type="stmt"/>
|
|
129
|
-
<line num="
|
|
130
|
-
<line num="
|
|
131
|
-
<line num="17" count="1" type="stmt"/>
|
|
179
|
+
<line num="4" count="1" type="stmt"/>
|
|
180
|
+
<line num="16" count="1" type="stmt"/>
|
|
132
181
|
<line num="18" count="1" type="stmt"/>
|
|
133
|
-
<line num="
|
|
182
|
+
<line num="19" count="1" type="stmt"/>
|
|
183
|
+
<line num="21" count="1" type="stmt"/>
|
|
134
184
|
</file>
|
|
135
185
|
<file name="Fugitive.ts" path="/Users/santhosh/Documents/GIT/open-source/ibm-envizi-emissions-api-nodejs-sdk/src/api/Fugitive.ts">
|
|
136
|
-
<metrics statements="
|
|
186
|
+
<metrics statements="19" coveredstatements="19" conditionals="0" coveredconditionals="0" methods="4" coveredmethods="4"/>
|
|
137
187
|
<line num="1" count="1" type="stmt"/>
|
|
138
188
|
<line num="2" count="1" type="stmt"/>
|
|
139
|
-
<line num="
|
|
140
|
-
<line num="
|
|
141
|
-
<line num="
|
|
142
|
-
<line num="
|
|
143
|
-
<line num="
|
|
189
|
+
<line num="9" count="1" type="stmt"/>
|
|
190
|
+
<line num="37" count="1" type="stmt"/>
|
|
191
|
+
<line num="40" count="1" type="stmt"/>
|
|
192
|
+
<line num="41" count="1" type="stmt"/>
|
|
193
|
+
<line num="43" count="1" type="stmt"/>
|
|
194
|
+
<line num="60" count="1" type="stmt"/>
|
|
195
|
+
<line num="62" count="1" type="stmt"/>
|
|
196
|
+
<line num="63" count="1" type="stmt"/>
|
|
197
|
+
<line num="65" count="1" type="stmt"/>
|
|
198
|
+
<line num="81" count="1" type="stmt"/>
|
|
199
|
+
<line num="83" count="1" type="stmt"/>
|
|
200
|
+
<line num="84" count="1" type="stmt"/>
|
|
201
|
+
<line num="86" count="1" type="stmt"/>
|
|
202
|
+
<line num="107" count="1" type="stmt"/>
|
|
203
|
+
<line num="110" count="1" type="stmt"/>
|
|
204
|
+
<line num="111" count="1" type="stmt"/>
|
|
205
|
+
<line num="113" count="1" type="stmt"/>
|
|
144
206
|
</file>
|
|
145
207
|
<file name="Location.ts" path="/Users/santhosh/Documents/GIT/open-source/ibm-envizi-emissions-api-nodejs-sdk/src/api/Location.ts">
|
|
146
|
-
<metrics statements="
|
|
208
|
+
<metrics statements="19" coveredstatements="19" conditionals="0" coveredconditionals="0" methods="4" coveredmethods="4"/>
|
|
147
209
|
<line num="1" count="1" type="stmt"/>
|
|
148
210
|
<line num="2" count="1" type="stmt"/>
|
|
149
|
-
<line num="
|
|
150
|
-
<line num="
|
|
151
|
-
<line num="
|
|
152
|
-
<line num="
|
|
153
|
-
<line num="
|
|
211
|
+
<line num="9" count="1" type="stmt"/>
|
|
212
|
+
<line num="37" count="1" type="stmt"/>
|
|
213
|
+
<line num="40" count="1" type="stmt"/>
|
|
214
|
+
<line num="41" count="1" type="stmt"/>
|
|
215
|
+
<line num="43" count="1" type="stmt"/>
|
|
216
|
+
<line num="62" count="1" type="stmt"/>
|
|
217
|
+
<line num="64" count="1" type="stmt"/>
|
|
218
|
+
<line num="65" count="1" type="stmt"/>
|
|
219
|
+
<line num="67" count="1" type="stmt"/>
|
|
220
|
+
<line num="83" count="1" type="stmt"/>
|
|
221
|
+
<line num="85" count="1" type="stmt"/>
|
|
222
|
+
<line num="86" count="1" type="stmt"/>
|
|
223
|
+
<line num="88" count="1" type="stmt"/>
|
|
224
|
+
<line num="106" count="1" type="stmt"/>
|
|
225
|
+
<line num="109" count="1" type="stmt"/>
|
|
226
|
+
<line num="110" count="1" type="stmt"/>
|
|
227
|
+
<line num="112" count="1" type="stmt"/>
|
|
154
228
|
</file>
|
|
155
229
|
<file name="Mobile.ts" path="/Users/santhosh/Documents/GIT/open-source/ibm-envizi-emissions-api-nodejs-sdk/src/api/Mobile.ts">
|
|
156
|
-
<metrics statements="
|
|
230
|
+
<metrics statements="19" coveredstatements="19" conditionals="0" coveredconditionals="0" methods="4" coveredmethods="4"/>
|
|
157
231
|
<line num="1" count="1" type="stmt"/>
|
|
158
232
|
<line num="2" count="1" type="stmt"/>
|
|
159
|
-
<line num="
|
|
160
|
-
<line num="
|
|
161
|
-
<line num="
|
|
162
|
-
<line num="
|
|
163
|
-
<line num="
|
|
233
|
+
<line num="9" count="1" type="stmt"/>
|
|
234
|
+
<line num="39" count="1" type="stmt"/>
|
|
235
|
+
<line num="42" count="1" type="stmt"/>
|
|
236
|
+
<line num="43" count="1" type="stmt"/>
|
|
237
|
+
<line num="45" count="1" type="stmt"/>
|
|
238
|
+
<line num="64" count="1" type="stmt"/>
|
|
239
|
+
<line num="66" count="1" type="stmt"/>
|
|
240
|
+
<line num="67" count="1" type="stmt"/>
|
|
241
|
+
<line num="69" count="1" type="stmt"/>
|
|
242
|
+
<line num="85" count="1" type="stmt"/>
|
|
243
|
+
<line num="87" count="1" type="stmt"/>
|
|
244
|
+
<line num="88" count="1" type="stmt"/>
|
|
245
|
+
<line num="90" count="1" type="stmt"/>
|
|
246
|
+
<line num="111" count="1" type="stmt"/>
|
|
247
|
+
<line num="114" count="1" type="stmt"/>
|
|
248
|
+
<line num="115" count="1" type="stmt"/>
|
|
249
|
+
<line num="117" count="1" type="stmt"/>
|
|
164
250
|
</file>
|
|
165
251
|
<file name="Stationary.ts" path="/Users/santhosh/Documents/GIT/open-source/ibm-envizi-emissions-api-nodejs-sdk/src/api/Stationary.ts">
|
|
166
|
-
<metrics statements="
|
|
252
|
+
<metrics statements="19" coveredstatements="19" conditionals="0" coveredconditionals="0" methods="4" coveredmethods="4"/>
|
|
167
253
|
<line num="1" count="1" type="stmt"/>
|
|
168
254
|
<line num="2" count="1" type="stmt"/>
|
|
169
|
-
<line num="
|
|
170
|
-
<line num="
|
|
171
|
-
<line num="
|
|
172
|
-
<line num="
|
|
173
|
-
<line num="
|
|
255
|
+
<line num="9" count="1" type="stmt"/>
|
|
256
|
+
<line num="39" count="1" type="stmt"/>
|
|
257
|
+
<line num="42" count="1" type="stmt"/>
|
|
258
|
+
<line num="43" count="1" type="stmt"/>
|
|
259
|
+
<line num="45" count="1" type="stmt"/>
|
|
260
|
+
<line num="62" count="1" type="stmt"/>
|
|
261
|
+
<line num="64" count="1" type="stmt"/>
|
|
262
|
+
<line num="65" count="1" type="stmt"/>
|
|
263
|
+
<line num="67" count="1" type="stmt"/>
|
|
264
|
+
<line num="83" count="1" type="stmt"/>
|
|
265
|
+
<line num="85" count="1" type="stmt"/>
|
|
266
|
+
<line num="86" count="1" type="stmt"/>
|
|
267
|
+
<line num="88" count="1" type="stmt"/>
|
|
268
|
+
<line num="109" count="1" type="stmt"/>
|
|
269
|
+
<line num="112" count="1" type="stmt"/>
|
|
270
|
+
<line num="113" count="1" type="stmt"/>
|
|
271
|
+
<line num="115" count="1" type="stmt"/>
|
|
174
272
|
</file>
|
|
175
273
|
<file name="TransportationAndDistribution.ts" path="/Users/santhosh/Documents/GIT/open-source/ibm-envizi-emissions-api-nodejs-sdk/src/api/TransportationAndDistribution.ts">
|
|
176
|
-
<metrics statements="
|
|
274
|
+
<metrics statements="19" coveredstatements="19" conditionals="0" coveredconditionals="0" methods="4" coveredmethods="4"/>
|
|
177
275
|
<line num="1" count="1" type="stmt"/>
|
|
178
276
|
<line num="2" count="1" type="stmt"/>
|
|
179
|
-
<line num="
|
|
180
|
-
<line num="
|
|
181
|
-
<line num="
|
|
182
|
-
<line num="
|
|
183
|
-
<line num="
|
|
277
|
+
<line num="9" count="1" type="stmt"/>
|
|
278
|
+
<line num="36" count="1" type="stmt"/>
|
|
279
|
+
<line num="39" count="1" type="stmt"/>
|
|
280
|
+
<line num="40" count="1" type="stmt"/>
|
|
281
|
+
<line num="42" count="1" type="stmt"/>
|
|
282
|
+
<line num="60" count="1" type="stmt"/>
|
|
283
|
+
<line num="62" count="1" type="stmt"/>
|
|
284
|
+
<line num="63" count="1" type="stmt"/>
|
|
285
|
+
<line num="65" count="1" type="stmt"/>
|
|
286
|
+
<line num="81" count="1" type="stmt"/>
|
|
287
|
+
<line num="83" count="1" type="stmt"/>
|
|
288
|
+
<line num="84" count="1" type="stmt"/>
|
|
289
|
+
<line num="86" count="1" type="stmt"/>
|
|
290
|
+
<line num="107" count="1" type="stmt"/>
|
|
291
|
+
<line num="110" count="1" type="stmt"/>
|
|
292
|
+
<line num="111" count="1" type="stmt"/>
|
|
293
|
+
<line num="113" count="1" type="stmt"/>
|
|
184
294
|
</file>
|
|
185
295
|
</package>
|
|
186
296
|
<package name="test">
|