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.
Files changed (155) hide show
  1. package/README.md +33 -2
  2. package/dist/Constants.js +23 -1
  3. package/dist/api/Calculation.js +78 -15
  4. package/dist/api/Factor.js +99 -18
  5. package/dist/api/FactorSets.js +1 -1
  6. package/dist/api/Fugitive.js +76 -13
  7. package/dist/api/Location.js +76 -15
  8. package/dist/api/Mobile.js +65 -1
  9. package/dist/api/Stationary.js +78 -15
  10. package/dist/api/TransportationAndDistribution.js +77 -14
  11. package/dist/coverage/clover.xml +191 -81
  12. package/dist/coverage/coverage-final.json +11 -11
  13. package/dist/coverage/lcov-report/index.html +16 -16
  14. package/dist/coverage/lcov-report/src/Client.ts.html +23 -23
  15. package/dist/coverage/lcov-report/src/Constants.ts.html +82 -4
  16. package/dist/coverage/lcov-report/src/api/Calculation.ts.html +245 -26
  17. package/dist/coverage/lcov-report/src/api/Factor.ts.html +313 -34
  18. package/dist/coverage/lcov-report/src/api/FactorSets.ts.html +8 -5
  19. package/dist/coverage/lcov-report/src/api/Fugitive.ts.html +246 -24
  20. package/dist/coverage/lcov-report/src/api/Location.ts.html +245 -26
  21. package/dist/coverage/lcov-report/src/api/Mobile.ts.html +240 -12
  22. package/dist/coverage/lcov-report/src/api/Stationary.ts.html +248 -26
  23. package/dist/coverage/lcov-report/src/api/TransportationAndDistribution.ts.html +250 -25
  24. package/dist/coverage/lcov-report/src/api/index.html +25 -25
  25. package/dist/coverage/lcov-report/src/index.html +7 -7
  26. package/dist/coverage/lcov-report/src/request.ts.html +1 -1
  27. package/dist/coverage/lcov-report/src/utils.ts.html +5 -5
  28. package/dist/coverage/lcov-report/test/index.html +1 -1
  29. package/dist/coverage/lcov-report/test/mocks/CommonRequest.ts.html +1 -1
  30. package/dist/coverage/lcov-report/test/mocks/FactorRequest.ts.html +1 -1
  31. package/dist/coverage/lcov-report/test/mocks/GenericCalculationRequest.ts.html +1 -1
  32. package/dist/coverage/lcov-report/test/mocks/LocationRequest.ts.html +1 -1
  33. package/dist/coverage/lcov-report/test/mocks/SearchRequest.ts.html +1 -1
  34. package/dist/coverage/lcov-report/test/mocks/index.html +1 -1
  35. package/dist/coverage/lcov-report/test/testUtils.ts.html +1 -1
  36. package/dist/coverage/lcov.info +287 -133
  37. package/dist/interfaces/response/AreaResponse.js +2 -0
  38. package/dist/interfaces/response/EmissionResponse.js +2 -0
  39. package/dist/interfaces/response/EmissionResponseWithDetails.js +2 -0
  40. package/dist/interfaces/response/FactorResponse.js +2 -0
  41. package/dist/interfaces/response/FactorSetResponse.js +2 -0
  42. package/dist/interfaces/response/SearchResponse.js +2 -0
  43. package/dist/interfaces/response/TypeResponse.js +2 -0
  44. package/dist/interfaces/response/UnitResponse.js +2 -0
  45. package/dist/types/Constants.d.ts +22 -0
  46. package/dist/types/api/Calculation.d.ts +59 -16
  47. package/dist/types/api/Factor.d.ts +73 -20
  48. package/dist/types/api/FactorSets.d.ts +3 -2
  49. package/dist/types/api/Fugitive.d.ts +57 -14
  50. package/dist/types/api/Location.d.ts +57 -16
  51. package/dist/types/api/Mobile.d.ts +46 -2
  52. package/dist/types/api/Stationary.d.ts +59 -16
  53. package/dist/types/api/TransportationAndDistribution.d.ts +58 -15
  54. package/dist/types/index.d.ts +8 -0
  55. package/dist/types/interfaces/response/AreaResponse.d.ts +20 -0
  56. package/dist/types/interfaces/response/EmissionResponse.d.ts +31 -0
  57. package/dist/types/interfaces/response/EmissionResponseWithDetails.d.ts +144 -0
  58. package/dist/types/interfaces/response/FactorResponse.d.ts +53 -0
  59. package/dist/types/interfaces/response/FactorSetResponse.d.ts +38 -0
  60. package/dist/types/interfaces/response/SearchResponse.d.ts +41 -0
  61. package/dist/types/interfaces/response/TypeResponse.d.ts +7 -0
  62. package/dist/types/interfaces/response/UnitResponse.d.ts +7 -0
  63. package/docs/.nojekyll +0 -0
  64. package/docs/_sources/authentication.rst.txt +164 -0
  65. package/docs/_sources/client.rst.txt +137 -0
  66. package/docs/_sources/getting_started.rst.txt +164 -0
  67. package/docs/_sources/index.rst.txt +30 -0
  68. package/docs/_sources/reference.rst.txt +129 -0
  69. package/docs/_sources/sdk.rst.txt +13 -0
  70. package/docs/_sources/troubleshooting.rst.txt +486 -0
  71. package/docs/_static/basic.css +914 -0
  72. package/docs/_static/custom.css +16 -0
  73. package/docs/_static/debug.css +69 -0
  74. package/docs/_static/doctools.js +149 -0
  75. package/docs/_static/documentation_options.js +13 -0
  76. package/docs/_static/file.png +0 -0
  77. package/docs/_static/language_data.js +192 -0
  78. package/docs/_static/minus.png +0 -0
  79. package/docs/_static/plus.png +0 -0
  80. package/docs/_static/pygments.css +232 -0
  81. package/docs/_static/scripts/furo-extensions.js +0 -0
  82. package/docs/_static/scripts/furo.js +3 -0
  83. package/docs/_static/scripts/furo.js.LICENSE.txt +7 -0
  84. package/docs/_static/scripts/furo.js.map +1 -0
  85. package/docs/_static/searchtools.js +632 -0
  86. package/docs/_static/skeleton.css +296 -0
  87. package/docs/_static/sphinx_highlight.js +154 -0
  88. package/docs/_static/sphinx_js.css +0 -0
  89. package/docs/_static/styles/furo-extensions.css +2 -0
  90. package/docs/_static/styles/furo-extensions.css.map +1 -0
  91. package/docs/_static/styles/furo.css +2 -0
  92. package/docs/_static/styles/furo.css.map +1 -0
  93. package/docs/authentication.html +523 -0
  94. package/docs/client.html +477 -0
  95. package/docs/genindex.html +492 -0
  96. package/docs/getting_started.html +491 -0
  97. package/docs/index.html +357 -0
  98. package/docs/objects.inv +0 -0
  99. package/docs/reference.html +1584 -0
  100. package/docs/sdk.html +334 -0
  101. package/docs/search.html +297 -0
  102. package/docs/searchindex.js +1 -0
  103. package/docs/troubleshooting.html +786 -0
  104. package/package.json +1 -1
  105. package/sphinx-build/Makefile +49 -0
  106. package/sphinx-build/requirements.txt +5 -0
  107. package/sphinx-build/source/_static/custom.css +16 -0
  108. package/sphinx-build/source/authentication.rst +164 -0
  109. package/sphinx-build/source/client.rst +137 -0
  110. package/sphinx-build/source/conf.py +56 -0
  111. package/sphinx-build/source/getting_started.rst +164 -0
  112. package/sphinx-build/source/index.rst +30 -0
  113. package/sphinx-build/source/reference.rst +129 -0
  114. package/sphinx-build/source/sdk.rst +13 -0
  115. package/sphinx-build/source/troubleshooting.rst +486 -0
  116. package/src/Constants.ts +26 -0
  117. package/src/api/Calculation.ts +94 -20
  118. package/src/api/Factor.ts +122 -28
  119. package/src/api/FactorSets.ts +4 -3
  120. package/src/api/Fugitive.ts +93 -18
  121. package/src/api/Location.ts +94 -20
  122. package/src/api/Mobile.ts +83 -6
  123. package/src/api/Stationary.ts +95 -20
  124. package/src/api/TransportationAndDistribution.ts +95 -19
  125. package/src/index.ts +33 -1
  126. package/src/interfaces/response/AreaResponse.ts +25 -0
  127. package/src/interfaces/response/EmissionResponse.ts +44 -0
  128. package/src/interfaces/response/EmissionResponseWithDetails.ts +183 -0
  129. package/src/interfaces/response/FactorResponse.ts +78 -0
  130. package/src/interfaces/response/FactorSetResponse.ts +52 -0
  131. package/src/interfaces/response/SearchResponse.ts +52 -0
  132. package/src/interfaces/response/TypeResponse.ts +7 -0
  133. package/src/interfaces/response/UnitResponse.ts +7 -0
  134. package/test/apiTest.test.ts +173 -6
  135. package/dist/api/Factors.js +0 -98
  136. package/dist/api/FugitiveEmission.js +0 -40
  137. package/dist/api/GenericCalculation.js +0 -41
  138. package/dist/api/LocationEmission.js +0 -41
  139. package/dist/api/MobileEmission.js +0 -41
  140. package/dist/api/StationaryEmission.js +0 -41
  141. package/dist/api/TransportationDistributionEmission.js +0 -40
  142. package/dist/coverage/lcov-report/src/api/Factors.ts.html +0 -403
  143. package/dist/coverage/lcov-report/src/api/FugitiveEmission.ts.html +0 -214
  144. package/dist/coverage/lcov-report/src/api/GenericCalculation.ts.html +0 -217
  145. package/dist/coverage/lcov-report/src/api/LocationEmission.ts.html +0 -214
  146. package/dist/coverage/lcov-report/src/api/MobileEmission.ts.html +0 -220
  147. package/dist/coverage/lcov-report/src/api/StationaryEmission.ts.html +0 -220
  148. package/dist/coverage/lcov-report/src/api/TransportationDistributionEmission.ts.html +0 -211
  149. package/dist/types/api/Factors.d.ts +0 -68
  150. package/dist/types/api/FugitiveEmission.d.ts +0 -27
  151. package/dist/types/api/GenericCalculation.d.ts +0 -28
  152. package/dist/types/api/LocationEmission.d.ts +0 -28
  153. package/dist/types/api/MobileEmission.d.ts +0 -28
  154. package/dist/types/api/StationaryEmission.d.ts +0 -28
  155. package/dist/types/api/TransportationDistributionEmission.d.ts +0 -27
@@ -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<string>} A promise that resolves to the calculation result string returned by the API
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
- "time" : {
18
- "date": "2025-01-04"
19
- },
20
- "location": {
21
- "country": "usa",
22
- "stateProvince": "new york"
23
- },
24
- "activity": {
25
- "type":"Coal - Lignite",
26
- "unit": "KJ",
27
- "value": 3
28
- },
29
- "includeDetails": true
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 2 transportation and distribution emission calculations by making a POST request to the transportation and distribution API endpoint.
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<string>} A promise that resolves to the calculation result string returned by the API
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
- "time" : {
18
- "date": "2025-01-04"
19
- },
20
- "location": {
21
- "country": "usa"
22
- },
23
- "activity": {
24
- "type": "Freight - Cargo Ship - Bulk Carrier - 0-9999 dwt",
25
- "unit": ["t","km"],
26
- "value": [1.0,1.0]
27
- },
28
- "includeDetails": true
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
+ }
@@ -1,9 +1,9 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <coverage generated="1759140528343" clover="3.2.0">
3
- <project timestamp="1759140528343" name="All files">
4
- <metrics statements="153" coveredstatements="151" conditionals="47" coveredconditionals="41" methods="21" coveredmethods="19" elements="221" coveredelements="211" complexity="0" loc="153" ncloc="153" packages="4" files="18" classes="18"/>
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="79" coveredstatements="77" conditionals="47" coveredconditionals="41" methods="11" coveredmethods="9"/>
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="13" type="cond" truecount="3" falsecount="0"/>
15
- <line num="25" count="13" type="stmt"/>
16
- <line num="26" count="13" type="stmt"/>
17
- <line num="27" count="13" type="cond" truecount="2" falsecount="0"/>
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="12" type="stmt"/>
21
- <line num="32" count="12" type="stmt"/>
22
- <line num="35" count="13" type="stmt"/>
23
- <line num="36" count="13" type="stmt"/>
24
- <line num="37" count="13" type="cond" truecount="3" falsecount="1"/>
25
- <line num="38" count="13" type="cond" truecount="3" falsecount="1"/>
26
- <line num="39" count="13" type="stmt"/>
27
- <line num="40" count="13" type="cond" truecount="1" falsecount="1"/>
28
- <line num="78" count="16" type="cond" truecount="4" falsecount="0"/>
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="15" type="cond" truecount="4" falsecount="0"/>
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="14" type="cond" truecount="5" falsecount="0"/>
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="13" type="stmt"/>
35
- <line num="96" count="13" type="cond" truecount="4" falsecount="0"/>
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="12" type="stmt"/>
39
- <line num="100" count="13" type="stmt"/>
40
- <line num="114" count="18" type="stmt"/>
41
- <line num="136" count="23" type="cond" truecount="2" falsecount="0"/>
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="22" type="stmt"/>
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="16" coveredstatements="16" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
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="11" type="stmt"/>
94
- <line num="16" count="11" type="stmt"/>
95
- <line num="17" count="11" type="cond" truecount="1" falsecount="1"/>
96
- <line num="18" count="11" type="stmt"/>
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="60" coveredstatements="60" conditionals="0" coveredconditionals="0" methods="9" coveredmethods="9"/>
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="7" coveredstatements="7" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1"/>
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="4" count="1" type="stmt"/>
106
- <line num="33" count="1" type="stmt"/>
107
- <line num="36" count="1" type="stmt"/>
108
- <line num="37" count="1" type="stmt"/>
109
- <line num="39" count="1" type="stmt"/>
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="11" coveredstatements="11" conditionals="0" coveredconditionals="0" methods="2" coveredmethods="2"/>
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="4" count="1" type="stmt"/>
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="46" count="1" type="stmt"/>
120
- <line num="75" count="1" type="stmt"/>
121
- <line num="78" count="1" type="stmt"/>
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="81" count="1" type="stmt"/>
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="3" count="1" type="stmt"/>
130
- <line num="15" count="1" type="stmt"/>
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="20" count="1" type="stmt"/>
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="7" coveredstatements="7" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1"/>
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="4" count="1" type="stmt"/>
140
- <line num="32" count="1" type="stmt"/>
141
- <line num="35" count="1" type="stmt"/>
142
- <line num="36" count="1" type="stmt"/>
143
- <line num="38" count="1" type="stmt"/>
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="7" coveredstatements="7" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1"/>
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="4" count="1" type="stmt"/>
150
- <line num="32" count="1" type="stmt"/>
151
- <line num="35" count="1" type="stmt"/>
152
- <line num="36" count="1" type="stmt"/>
153
- <line num="38" count="1" type="stmt"/>
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="7" coveredstatements="7" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1"/>
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="4" count="1" type="stmt"/>
160
- <line num="34" count="1" type="stmt"/>
161
- <line num="37" count="1" type="stmt"/>
162
- <line num="38" count="1" type="stmt"/>
163
- <line num="40" count="1" type="stmt"/>
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="7" coveredstatements="7" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1"/>
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="4" count="1" type="stmt"/>
170
- <line num="34" count="1" type="stmt"/>
171
- <line num="37" count="1" type="stmt"/>
172
- <line num="38" count="1" type="stmt"/>
173
- <line num="40" count="1" type="stmt"/>
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="7" coveredstatements="7" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1"/>
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="4" count="1" type="stmt"/>
180
- <line num="31" count="1" type="stmt"/>
181
- <line num="34" count="1" type="stmt"/>
182
- <line num="35" count="1" type="stmt"/>
183
- <line num="37" count="1" type="stmt"/>
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">