emissions-api-sdk 1.0.0 → 1.0.1

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 (129) hide show
  1. package/README.md +33 -2
  2. package/dist/Constants.js +23 -1
  3. package/dist/api/Calculation.js +77 -14
  4. package/dist/api/Factor.js +97 -16
  5. package/dist/api/Fugitive.js +75 -12
  6. package/dist/api/Location.js +75 -14
  7. package/dist/api/Mobile.js +66 -0
  8. package/dist/api/Stationary.js +77 -14
  9. package/dist/api/TransportationAndDistribution.js +75 -12
  10. package/dist/types/Constants.d.ts +22 -0
  11. package/dist/types/api/Calculation.d.ts +52 -14
  12. package/dist/types/api/Factor.d.ts +64 -16
  13. package/dist/types/api/Fugitive.d.ts +50 -12
  14. package/dist/types/api/Location.d.ts +50 -14
  15. package/dist/types/api/Mobile.d.ts +41 -0
  16. package/dist/types/api/Stationary.d.ts +52 -14
  17. package/dist/types/api/TransportationAndDistribution.d.ts +50 -12
  18. package/docs/.nojekyll +0 -0
  19. package/docs/_sources/authentication.rst.txt +164 -0
  20. package/docs/_sources/client.rst.txt +137 -0
  21. package/docs/_sources/getting_started.rst.txt +164 -0
  22. package/docs/_sources/index.rst.txt +29 -0
  23. package/docs/_sources/reference.rst.txt +129 -0
  24. package/docs/_sources/sdk.rst.txt +13 -0
  25. package/docs/_static/basic.css +906 -0
  26. package/docs/_static/custom.css +16 -0
  27. package/docs/_static/debug.css +69 -0
  28. package/docs/_static/doctools.js +149 -0
  29. package/docs/_static/documentation_options.js +13 -0
  30. package/docs/_static/file.png +0 -0
  31. package/docs/_static/language_data.js +192 -0
  32. package/docs/_static/minus.png +0 -0
  33. package/docs/_static/plus.png +0 -0
  34. package/docs/_static/pygments.css +250 -0
  35. package/docs/_static/scripts/furo-extensions.js +0 -0
  36. package/docs/_static/scripts/furo.js +3 -0
  37. package/docs/_static/scripts/furo.js.LICENSE.txt +7 -0
  38. package/docs/_static/scripts/furo.js.map +1 -0
  39. package/docs/_static/searchtools.js +635 -0
  40. package/docs/_static/skeleton.css +296 -0
  41. package/docs/_static/sphinx_highlight.js +154 -0
  42. package/docs/_static/sphinx_js.css +0 -0
  43. package/docs/_static/styles/furo-extensions.css +2 -0
  44. package/docs/_static/styles/furo-extensions.css.map +1 -0
  45. package/docs/_static/styles/furo.css +2 -0
  46. package/docs/_static/styles/furo.css.map +1 -0
  47. package/docs/authentication.html +513 -0
  48. package/docs/client.html +467 -0
  49. package/docs/genindex.html +482 -0
  50. package/docs/getting_started.html +481 -0
  51. package/docs/index.html +334 -0
  52. package/docs/objects.inv +0 -0
  53. package/docs/reference.html +1568 -0
  54. package/docs/sdk.html +324 -0
  55. package/docs/search.html +287 -0
  56. package/docs/searchindex.js +1 -0
  57. package/package.json +1 -1
  58. package/sphinx-build/Makefile +49 -0
  59. package/sphinx-build/source/_static/custom.css +16 -0
  60. package/sphinx-build/source/authentication.rst +164 -0
  61. package/sphinx-build/source/client.rst +137 -0
  62. package/sphinx-build/source/conf.py +56 -0
  63. package/sphinx-build/source/getting_started.rst +164 -0
  64. package/sphinx-build/source/index.rst +29 -0
  65. package/sphinx-build/source/reference.rst +129 -0
  66. package/sphinx-build/source/sdk.rst +13 -0
  67. package/src/Constants.ts +26 -0
  68. package/src/api/Calculation.ts +84 -15
  69. package/src/api/Factor.ts +108 -19
  70. package/src/api/Fugitive.ts +83 -13
  71. package/src/api/Location.ts +84 -15
  72. package/src/api/Mobile.ts +75 -1
  73. package/src/api/Stationary.ts +85 -15
  74. package/src/api/TransportationAndDistribution.ts +84 -13
  75. package/test/apiTest.test.ts +172 -5
  76. package/dist/api/Factors.js +0 -98
  77. package/dist/api/FugitiveEmission.js +0 -40
  78. package/dist/api/GenericCalculation.js +0 -41
  79. package/dist/api/LocationEmission.js +0 -41
  80. package/dist/api/MobileEmission.js +0 -41
  81. package/dist/api/StationaryEmission.js +0 -41
  82. package/dist/api/TransportationDistributionEmission.js +0 -40
  83. package/dist/coverage/clover.xml +0 -225
  84. package/dist/coverage/coverage-final.json +0 -19
  85. package/dist/coverage/lcov-report/base.css +0 -224
  86. package/dist/coverage/lcov-report/block-navigation.js +0 -87
  87. package/dist/coverage/lcov-report/favicon.png +0 -0
  88. package/dist/coverage/lcov-report/index.html +0 -161
  89. package/dist/coverage/lcov-report/prettify.css +0 -1
  90. package/dist/coverage/lcov-report/prettify.js +0 -2
  91. package/dist/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  92. package/dist/coverage/lcov-report/sorter.js +0 -210
  93. package/dist/coverage/lcov-report/src/Client.ts.html +0 -838
  94. package/dist/coverage/lcov-report/src/Constants.ts.html +0 -130
  95. package/dist/coverage/lcov-report/src/api/Calculation.ts.html +0 -217
  96. package/dist/coverage/lcov-report/src/api/Factor.ts.html +0 -343
  97. package/dist/coverage/lcov-report/src/api/FactorSets.ts.html +0 -154
  98. package/dist/coverage/lcov-report/src/api/Factors.ts.html +0 -403
  99. package/dist/coverage/lcov-report/src/api/Fugitive.ts.html +0 -214
  100. package/dist/coverage/lcov-report/src/api/FugitiveEmission.ts.html +0 -214
  101. package/dist/coverage/lcov-report/src/api/GenericCalculation.ts.html +0 -217
  102. package/dist/coverage/lcov-report/src/api/Location.ts.html +0 -214
  103. package/dist/coverage/lcov-report/src/api/LocationEmission.ts.html +0 -214
  104. package/dist/coverage/lcov-report/src/api/Mobile.ts.html +0 -220
  105. package/dist/coverage/lcov-report/src/api/MobileEmission.ts.html +0 -220
  106. package/dist/coverage/lcov-report/src/api/Stationary.ts.html +0 -220
  107. package/dist/coverage/lcov-report/src/api/StationaryEmission.ts.html +0 -220
  108. package/dist/coverage/lcov-report/src/api/TransportationAndDistribution.ts.html +0 -211
  109. package/dist/coverage/lcov-report/src/api/TransportationDistributionEmission.ts.html +0 -211
  110. package/dist/coverage/lcov-report/src/api/index.html +0 -221
  111. package/dist/coverage/lcov-report/src/index.html +0 -161
  112. package/dist/coverage/lcov-report/src/request.ts.html +0 -235
  113. package/dist/coverage/lcov-report/src/utils.ts.html +0 -139
  114. package/dist/coverage/lcov-report/test/index.html +0 -116
  115. package/dist/coverage/lcov-report/test/mocks/CommonRequest.ts.html +0 -142
  116. package/dist/coverage/lcov-report/test/mocks/FactorRequest.ts.html +0 -133
  117. package/dist/coverage/lcov-report/test/mocks/GenericCalculationRequest.ts.html +0 -142
  118. package/dist/coverage/lcov-report/test/mocks/LocationRequest.ts.html +0 -139
  119. package/dist/coverage/lcov-report/test/mocks/SearchRequest.ts.html +0 -142
  120. package/dist/coverage/lcov-report/test/mocks/index.html +0 -176
  121. package/dist/coverage/lcov-report/test/testUtils.ts.html +0 -97
  122. package/dist/coverage/lcov.info +0 -404
  123. package/dist/types/api/Factors.d.ts +0 -68
  124. package/dist/types/api/FugitiveEmission.d.ts +0 -27
  125. package/dist/types/api/GenericCalculation.d.ts +0 -28
  126. package/dist/types/api/LocationEmission.d.ts +0 -28
  127. package/dist/types/api/MobileEmission.d.ts +0 -28
  128. package/dist/types/api/StationaryEmission.d.ts +0 -28
  129. 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");
@@ -14,20 +17,20 @@ const request_1 = require("../request");
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<string>} A promise that resolves to a string 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<string>} A promise that resolves to a string 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<string>} A promise that resolves to a string 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,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");
@@ -14,18 +17,18 @@ const request_1 = require("../request");
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<string>} A promise that resolves to a string 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<string>} A promise that resolves to a string 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<string>} A promise that resolves to a string 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
+ }
@@ -9,6 +9,28 @@ export declare const TRANSPORTATION_AND_DISTRIBUTION_API_PATH = "/v3/carbon/tran
9
9
  export declare const FACTOR_API_PATH = "/v3/carbon/factor";
10
10
  export declare const FACTOR_SET_API_PATH = "/v3/carbon/factorset";
11
11
  export declare const SEARCH_API_PATH = "/v3/carbon/factor/search";
12
+ export declare const CALCULATION_TYPES = "/v3/carbon/calculation/types";
13
+ export declare const LOCATION_TYPES = "/v3/carbon/location/types";
14
+ export declare const FUGITIVE_API_TYPES = "/v3/carbon/fugitive/types";
15
+ export declare const MOBILE_API_TYPES = "/v3/carbon/mobile/types";
16
+ export declare const STATIONARY_API_TYPES = "/v3/carbon/stationary/types";
17
+ export declare const FACTOR_API_TYPES = "/v3/carbon/factor/types";
18
+ export declare const TRANSPORTATION_AND_DISTRIBUTION_API_TYPES = "/v3/carbon/transportation-and-distribution/types";
19
+ export declare const FUGITIVE_API_AREA = "/v3/carbon/fugitive/area";
20
+ export declare const GENERAL_API_AREA = "/v3/carbon/calculation/area";
21
+ export declare const LOCATION_API_AREA = "/v3/carbon/location/area";
22
+ export declare const MOBILE_API_AREA = "/v3/carbon/mobile/area";
23
+ export declare const STATIONARY_API_AREA = "/v3/carbon/stationary/area";
24
+ export declare const TRANSPORTATION_AND_DISTRIBUTION_API_AREA = "/v3/carbon/transportation-and-distribution/area";
25
+ export declare const SEARCH_API_AREA = "/v3/carbon/factor/search/area";
26
+ export declare const FACTOR_API_AREA = "/v3/carbon/factor/area";
27
+ export declare const FUGITIVE_API_UNITS = "/v3/carbon/fugitive/units";
28
+ export declare const LOCATION_API_UNITS = "/v3/carbon/location/units";
29
+ export declare const MOBILE_API_UNITS = "/v3/carbon/mobile/units";
30
+ export declare const STATIONARY_API_UNITS = "/v3/carbon/stationary/units";
31
+ export declare const GENERAL_API_UNITS = "/v3/carbon/calculation/units";
32
+ export declare const FACTOR_API_UNITS = "/v3/carbon/factor/units";
33
+ export declare const TRANSPORTATION_AND_DISTRIBUTION_API_UNITS = "/v3/carbon/transportation-and-distribution/units";
12
34
  export declare const GET = "GET";
13
35
  export declare const POST = "POST";
14
36
  export declare const CLIENT_SOURCE_HEADER = "X-Client-Source";
@@ -9,20 +9,58 @@ import { CalculationRequest } from "../interfaces/Api";
9
9
  *
10
10
  * @example
11
11
  * const calculationRequest = {
12
- "time" : {
13
- "date": "2025-01-04"
14
- },
15
- "location": {
16
- "country": "usa",
17
- "stateProvince": "new york"
18
- },
19
- "activity": {
20
- "type":"Waste Combusted - Steel Cans:Default factor",
21
- "unit": "kg",
22
- "value": 1223123.121
23
- },
24
- "includeDetails": true
25
- };
12
+ "time" : {
13
+ "date": "2025-01-04"
14
+ },
15
+ "location": {
16
+ "country": "usa",
17
+ "stateProvince": "new york"
18
+ },
19
+ "activity": {
20
+ "type":"Waste Combusted - Steel Cans:Default factor",
21
+ "unit": "kg",
22
+ "value": 1223123.121
23
+ },
24
+ "includeDetails": true
25
+ };
26
26
  * const result = await calculate(calculationRequest);
27
27
  */
28
28
  export declare function calculate(payload: CalculationRequest): Promise<string>;
29
+ /**
30
+ * Retrieves available calculation types by making a GET request to the calculation types API endpoint.
31
+ *
32
+ * @export
33
+ * @return {Promise<string>} A promise that resolves to a string containing the available calculation types
34
+ * @throws {Error} May throw an error if the API request fails
35
+ *
36
+ * @example
37
+ * const types = await getTypes();
38
+ */
39
+ export declare function getTypes(): Promise<string>;
40
+ /**
41
+ * Retrieves information about geographical areas supported by the calculation API.
42
+ *
43
+ * @export
44
+ * @return {Promise<string>} A promise that resolves to a string containing the supported geographical areas
45
+ * @throws {Error} May throw an error if the API request fails
46
+ *
47
+ * @example
48
+ * const areas = await getArea();
49
+ */
50
+ export declare function getArea(): Promise<string>;
51
+ /**
52
+ * Retrieves available units for a specific calculation type.
53
+ *
54
+ * @export
55
+ * @param {string} type - The calculation type to get units for
56
+ * @return {Promise<string>} A promise that resolves to a string containing the available units
57
+ * @throws {Error} May throw an error if the API request fails
58
+ *
59
+ * @example
60
+ * // Get units for the "Natural Gas - Scope 3:AAA" emission calculation type with subtype
61
+ * const units = await getUnits("Natural Gas - Scope 3:AAA");
62
+
63
+ * // Get units for the "HFC-263fb" emission calculation type without subtype
64
+ * const units = await getUnits("HFC-263fb");
65
+ */
66
+ export declare function getUnits(type: string): Promise<string>;
@@ -9,27 +9,26 @@ import { FactorRequest, SearchRequest } from "../interfaces/Api";
9
9
  *
10
10
  * @example
11
11
  * const factorRequest = {
12
-
13
12
  "activity": {
14
- "factorId": 12345
13
+ "factorId": 12345
15
14
  }
16
15
  };
17
16
 
18
- or
17
+ OR
19
18
 
20
19
  const factorRequest = {
21
- "time" : {
22
- "date": "2025-01-04"
23
- },
24
- "location": {
25
- "country": "usa",
26
- "stateProvince": "new york"
27
- },
28
- "activity": {
29
- "type":"natural gas"
30
- },
31
- "includeDetails": true
32
- };
20
+ "time" : {
21
+ "date": "2025-01-04"
22
+ },
23
+ "location": {
24
+ "country": "usa",
25
+ "stateProvince": "new york"
26
+ },
27
+ "activity": {
28
+ "type":"natural gas"
29
+ },
30
+ "includeDetails": true
31
+ };
33
32
  * const factor = await retrieveFactor(factorRequest);
34
33
  */
35
34
  export declare function retrieveFactor(payload: FactorRequest): Promise<string>;
@@ -48,10 +47,59 @@ export declare function retrieveFactor(payload: FactorRequest): Promise<string>;
48
47
  },
49
48
  "activity": {
50
49
  "search" : "travel"},
51
- "location": {
50
+ "location": {
52
51
  "country": "USA"
53
52
  }
54
53
  };
55
54
  * const results = await search(searchRequest);
56
55
  */
57
56
  export declare function search(payload: SearchRequest): Promise<string>;
57
+ /**
58
+ * Retrieves available emission factor types by making a GET request to the API endpoint.
59
+ *
60
+ * @export
61
+ * @return {Promise<string>} A promise that resolves to a string containing the available emission factor types
62
+ * @throws {Error} May throw an error if the API request fails
63
+ *
64
+ * @example
65
+ * const types = await getTypes();
66
+ */
67
+ export declare function getTypes(): Promise<string>;
68
+ /**
69
+ * Retrieves information about geographical areas supported by the factor search API.
70
+ *
71
+ * @export
72
+ * @return {Promise<string>} A promise that resolves to a string containing the supported geographical areas
73
+ * @throws {Error} May throw an error if the API request fails
74
+ *
75
+ * @example
76
+ * const areas = await getArea();
77
+ */
78
+ export declare function getSearchArea(): Promise<string>;
79
+ /**
80
+ * Retrieves information about geographical areas supported by the factor API.
81
+ *
82
+ * @export
83
+ * @return {Promise<string>} A promise that resolves to a string containing the supported geographical areas
84
+ * @throws {Error} May throw an error if the API request fails
85
+ *
86
+ * @example
87
+ * const areas = await getArea();
88
+ */
89
+ export declare function getArea(): Promise<string>;
90
+ /**
91
+ * Retrieves available units for a specific emission factor type.
92
+ *
93
+ * @export
94
+ * @param {string} type - The emission factor type to get units for (e.g., "Natural Gas - Scope 3:AAA")
95
+ * @return {Promise<string>} A promise that resolves to a string containing the available units
96
+ * @throws {Error} May throw an error if the API request fails
97
+ *
98
+ * @example
99
+ * // Get units for the "Natural Gas - Scope 3:AAA" emission factor type with subtype
100
+ * const units = await getUnits("Natural Gas - Scope 3:AAA");
101
+
102
+ * // Get units for the "HFC-263fb" emission factor type without subtype
103
+ * const units = await getUnits("HFC-263fb");
104
+ */
105
+ export declare function getUnits(type: string): Promise<string>;
@@ -9,19 +9,57 @@ import { CommonRequest } from "../interfaces/Api";
9
9
  *
10
10
  * @example
11
11
  * const request = {
12
- "time": {
13
- "date": "2025-01-04"
14
- },
15
- "location": {
16
- "country": "usa"
17
- },
18
- "activity": {
19
- "type": "R134A",
20
- "value": 150,
21
- "unit": "kg"
22
- },
23
- "includeDetails": false
12
+ "time": {
13
+ "date": "2025-01-04"
14
+ },
15
+ "location": {
16
+ "country": "usa"
17
+ },
18
+ "activity": {
19
+ "type": "R134A",
20
+ "value": 150,
21
+ "unit": "kg"
22
+ },
23
+ "includeDetails": false
24
24
  };
25
25
  * const result = await calculate(request);
26
26
  */
27
27
  export declare function calculate(payload: CommonRequest): Promise<string>;
28
+ /**
29
+ * Retrieves available fugitive emission calculation types by making a GET request to the API endpoint.
30
+ *
31
+ * @export
32
+ * @return {Promise<string>} A promise that resolves to a string containing the available fugitive emission types
33
+ * @throws {Error} May throw an error if the API request fails
34
+ *
35
+ * @example
36
+ * const types = await getTypes();
37
+ */
38
+ export declare function getTypes(): Promise<string>;
39
+ /**
40
+ * Retrieves information about geographical areas supported by the fugitive emissions API.
41
+ *
42
+ * @export
43
+ * @return {Promise<string>} A promise that resolves to a string containing the supported geographical areas
44
+ * @throws {Error} May throw an error if the API request fails
45
+ *
46
+ * @example
47
+ * const areas = await getArea();
48
+ */
49
+ export declare function getArea(): Promise<string>;
50
+ /**
51
+ * Retrieves available units for a specific fugitive emission type.
52
+ *
53
+ * @export
54
+ * @param {string} type - The fugitive emission type to get units for (e.g., "R134A")
55
+ * @return {Promise<string>} A promise that resolves to a string containing the available units
56
+ * @throws {Error} May throw an error if the API request fails
57
+ *
58
+ * @example
59
+ * // Get units for the "Natural Gas - Scope 3:AAA" emission fugitive type with subtype
60
+ * const units = await getUnits("Natural Gas - Scope 3:AAA");
61
+
62
+ * // Get units for the "R-426A" emission fugitive type without subtype
63
+ * const units = await getUnits("R-426A");
64
+ */
65
+ export declare function getUnits(type: string): Promise<string>;
@@ -9,20 +9,56 @@ import { LocationRequest } from "../interfaces/Api";
9
9
  *
10
10
  * @example
11
11
  * const calculationRequest = {
12
- "time" : {
13
- "date": "2025-01-04"
14
- },
15
- "location": {
16
- "country": "usa",
17
- "stateProvince": "new york"
18
- },
19
- "activity": {
20
- "type":"electricity",
21
- "unit": "kwh",
22
- "value": 14123143
23
- },
24
- "includeDetails": true
25
- };
12
+ "time" : {
13
+ "date": "2025-01-04"
14
+ },
15
+ "location": {
16
+ "country": "usa",
17
+ "stateProvince": "new york"
18
+ },
19
+ "activity": {
20
+ "type":"electricity",
21
+ "unit": "kwh",
22
+ "value": 14123143
23
+ },
24
+ "includeDetails": true
25
+ };
26
26
  * const result = await calculate(calculationRequest);
27
27
  */
28
28
  export declare function calculate(payload: LocationRequest): Promise<string>;
29
+ /**
30
+ * Retrieves available location-based calculation types by making a GET request to the location types API endpoint.
31
+ *
32
+ * @export
33
+ * @return {Promise<string>} A promise that resolves to a string containing the available location-based calculation types
34
+ * @throws {Error} May throw an error if the API request fails
35
+ *
36
+ * @example
37
+ *
38
+ * const types = await getTypes();
39
+ */
40
+ export declare function getTypes(): Promise<string>;
41
+ /**
42
+ * Retrieves information about geographical areas supported by the location-based calculation API.
43
+ *
44
+ * @export
45
+ * @return {Promise<string>} A promise that resolves to a string containing the supported geographical areas
46
+ * @throws {Error} May throw an error if the API request fails
47
+ *
48
+ * @example
49
+ * const areas = await getArea();
50
+ */
51
+ export declare function getArea(): Promise<string>;
52
+ /**
53
+ * Retrieves available units for a specific location-based calculation type.
54
+ *
55
+ * @export
56
+ * @param {string} type - The location-based calculation type to get units for (e.g., "electricity")
57
+ * @return {Promise<string>} A promise that resolves to a string containing the available units
58
+ * @throws {Error} May throw an error if the API request fails
59
+ *
60
+ * @example
61
+ * // Get units for the "electricity" location type
62
+ * const units = await getUnits("electricity");
63
+ */
64
+ export declare function getUnits(type: string): Promise<string>;
@@ -26,3 +26,44 @@ import { CommonRequest } from "../interfaces/Api";
26
26
  * const result = await calculate(request);
27
27
  */
28
28
  export declare function calculate(payload: CommonRequest): Promise<string>;
29
+ /**
30
+ * Retrieves available mobile emission calculation types by making a GET request to the API endpoint.
31
+ *
32
+ * @export
33
+ * @return {Promise<string>} A promise that resolves to a string containing the available mobile emission types
34
+ * @throws {Error} May throw an error if the API request fails
35
+ *
36
+ * @example
37
+ * // Get all available mobile emission types
38
+ * const types = await getTypes();
39
+ * const typesData = JSON.parse(types);
40
+ * console.log("Available mobile emission types:", typesData);
41
+ */
42
+ export declare function getTypes(): Promise<string>;
43
+ /**
44
+ * Retrieves information about geographical areas supported by the mobile emissions API.
45
+ *
46
+ * @export
47
+ * @return {Promise<string>} A promise that resolves to a string containing the supported geographical areas
48
+ * @throws {Error} May throw an error if the API request fails
49
+ *
50
+ * @example
51
+ * const areas = await getArea();
52
+ */
53
+ export declare function getArea(): Promise<string>;
54
+ /**
55
+ * Retrieves available units for a specific mobile emission type.
56
+ *
57
+ * @export
58
+ * @param {string} type - The mobile emission type to get units for (e.g., "Diesel Fuel")
59
+ * @return {Promise<string>} A promise that resolves to a string containing the available units
60
+ * @throws {Error} May throw an error if the API request fails
61
+ *
62
+ * @example
63
+ * Get units for the "Cars:B20:(NE)" emission mobile type with subtype
64
+ * const units = await getUnits("Cars:B20:(NE)");
65
+
66
+ * Get units for the "Cars by Size - Large Car - Hybrid" emission mobile type without subtype
67
+ * const units = await getUnits("Cars by Size - Large Car - Hybrid");
68
+ */
69
+ export declare function getUnits(type: string): Promise<string>;