emissions-api-sdk 1.0.1 → 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 (106) hide show
  1. package/dist/api/Calculation.js +4 -4
  2. package/dist/api/Factor.js +7 -7
  3. package/dist/api/FactorSets.js +1 -1
  4. package/dist/api/Fugitive.js +4 -4
  5. package/dist/api/Location.js +4 -4
  6. package/dist/api/Mobile.js +4 -6
  7. package/dist/api/Stationary.js +4 -4
  8. package/dist/api/TransportationAndDistribution.js +5 -5
  9. package/dist/coverage/clover.xml +335 -0
  10. package/dist/coverage/coverage-final.json +19 -0
  11. package/dist/coverage/lcov-report/base.css +224 -0
  12. package/dist/coverage/lcov-report/block-navigation.js +87 -0
  13. package/dist/coverage/lcov-report/favicon.png +0 -0
  14. package/dist/coverage/lcov-report/index.html +161 -0
  15. package/dist/coverage/lcov-report/prettify.css +1 -0
  16. package/dist/coverage/lcov-report/prettify.js +2 -0
  17. package/dist/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  18. package/dist/coverage/lcov-report/sorter.js +210 -0
  19. package/dist/coverage/lcov-report/src/Client.ts.html +838 -0
  20. package/dist/coverage/lcov-report/src/Constants.ts.html +208 -0
  21. package/dist/coverage/lcov-report/src/api/Calculation.ts.html +436 -0
  22. package/dist/coverage/lcov-report/src/api/Factor.ts.html +622 -0
  23. package/dist/coverage/lcov-report/src/api/FactorSets.ts.html +157 -0
  24. package/dist/coverage/lcov-report/src/api/Fugitive.ts.html +436 -0
  25. package/dist/coverage/lcov-report/src/api/Location.ts.html +433 -0
  26. package/dist/coverage/lcov-report/src/api/Mobile.ts.html +448 -0
  27. package/dist/coverage/lcov-report/src/api/Stationary.ts.html +442 -0
  28. package/dist/coverage/lcov-report/src/api/TransportationAndDistribution.ts.html +436 -0
  29. package/dist/coverage/lcov-report/src/api/index.html +221 -0
  30. package/dist/coverage/lcov-report/src/index.html +161 -0
  31. package/dist/coverage/lcov-report/src/request.ts.html +235 -0
  32. package/dist/coverage/lcov-report/src/utils.ts.html +139 -0
  33. package/dist/coverage/lcov-report/test/index.html +116 -0
  34. package/dist/coverage/lcov-report/test/mocks/CommonRequest.ts.html +142 -0
  35. package/dist/coverage/lcov-report/test/mocks/FactorRequest.ts.html +133 -0
  36. package/dist/coverage/lcov-report/test/mocks/GenericCalculationRequest.ts.html +142 -0
  37. package/dist/coverage/lcov-report/test/mocks/LocationRequest.ts.html +139 -0
  38. package/dist/coverage/lcov-report/test/mocks/SearchRequest.ts.html +142 -0
  39. package/dist/coverage/lcov-report/test/mocks/index.html +176 -0
  40. package/dist/coverage/lcov-report/test/testUtils.ts.html +97 -0
  41. package/dist/coverage/lcov.info +558 -0
  42. package/dist/interfaces/response/AreaResponse.js +2 -0
  43. package/dist/interfaces/response/EmissionResponse.js +2 -0
  44. package/dist/interfaces/response/EmissionResponseWithDetails.js +2 -0
  45. package/dist/interfaces/response/FactorResponse.js +2 -0
  46. package/dist/interfaces/response/FactorSetResponse.js +2 -0
  47. package/dist/interfaces/response/SearchResponse.js +2 -0
  48. package/dist/interfaces/response/TypeResponse.js +2 -0
  49. package/dist/interfaces/response/UnitResponse.js +2 -0
  50. package/dist/types/api/Calculation.d.ts +13 -8
  51. package/dist/types/api/Factor.d.ts +18 -13
  52. package/dist/types/api/FactorSets.d.ts +3 -2
  53. package/dist/types/api/Fugitive.d.ts +13 -8
  54. package/dist/types/api/Location.d.ts +13 -8
  55. package/dist/types/api/Mobile.d.ts +13 -10
  56. package/dist/types/api/Stationary.d.ts +13 -8
  57. package/dist/types/api/TransportationAndDistribution.d.ts +14 -9
  58. package/dist/types/index.d.ts +8 -0
  59. package/dist/types/interfaces/response/AreaResponse.d.ts +20 -0
  60. package/dist/types/interfaces/response/EmissionResponse.d.ts +31 -0
  61. package/dist/types/interfaces/response/EmissionResponseWithDetails.d.ts +144 -0
  62. package/dist/types/interfaces/response/FactorResponse.d.ts +53 -0
  63. package/dist/types/interfaces/response/FactorSetResponse.d.ts +38 -0
  64. package/dist/types/interfaces/response/SearchResponse.d.ts +41 -0
  65. package/dist/types/interfaces/response/TypeResponse.d.ts +7 -0
  66. package/dist/types/interfaces/response/UnitResponse.d.ts +7 -0
  67. package/docs/_sources/index.rst.txt +1 -0
  68. package/docs/_sources/troubleshooting.rst.txt +486 -0
  69. package/docs/_static/basic.css +8 -0
  70. package/docs/_static/pygments.css +146 -164
  71. package/docs/_static/searchtools.js +5 -8
  72. package/docs/_static/styles/furo.css +1 -1
  73. package/docs/_static/styles/furo.css.map +1 -1
  74. package/docs/authentication.html +29 -19
  75. package/docs/client.html +29 -19
  76. package/docs/genindex.html +29 -19
  77. package/docs/getting_started.html +29 -19
  78. package/docs/index.html +42 -19
  79. package/docs/objects.inv +0 -0
  80. package/docs/reference.html +69 -53
  81. package/docs/sdk.html +29 -19
  82. package/docs/search.html +29 -19
  83. package/docs/searchindex.js +1 -1
  84. package/docs/troubleshooting.html +786 -0
  85. package/package.json +1 -1
  86. package/sphinx-build/requirements.txt +5 -0
  87. package/sphinx-build/source/index.rst +1 -0
  88. package/sphinx-build/source/troubleshooting.rst +486 -0
  89. package/src/api/Calculation.ts +19 -14
  90. package/src/api/Factor.ts +27 -22
  91. package/src/api/FactorSets.ts +4 -3
  92. package/src/api/Fugitive.ts +19 -14
  93. package/src/api/Location.ts +20 -15
  94. package/src/api/Mobile.ts +19 -16
  95. package/src/api/Stationary.ts +19 -14
  96. package/src/api/TransportationAndDistribution.ts +21 -16
  97. package/src/index.ts +33 -1
  98. package/src/interfaces/response/AreaResponse.ts +25 -0
  99. package/src/interfaces/response/EmissionResponse.ts +44 -0
  100. package/src/interfaces/response/EmissionResponseWithDetails.ts +183 -0
  101. package/src/interfaces/response/FactorResponse.ts +78 -0
  102. package/src/interfaces/response/FactorSetResponse.ts +52 -0
  103. package/src/interfaces/response/SearchResponse.ts +52 -0
  104. package/src/interfaces/response/TypeResponse.ts +7 -0
  105. package/src/interfaces/response/UnitResponse.ts +7 -0
  106. package/test/apiTest.test.ts +1 -1
@@ -1,10 +1,15 @@
1
1
  import { CalculationRequest } from "../interfaces/Api";
2
+ import { AreaResponse } from "../interfaces/response/AreaResponse";
3
+ import { EmissionResponse } from "../interfaces/response/EmissionResponse";
4
+ import { EmissionResponseWithDetails } from "../interfaces/response/EmissionResponseWithDetails";
5
+ import { TypeResponse } from "../interfaces/response/TypeResponse";
6
+ import { UnitResponse } from "../interfaces/response/UnitResponse";
2
7
  /**
3
8
  * Performs emission calculations by making a POST request to the generic calculation API endpoint.
4
9
  *
5
10
  * @export
6
11
  * @param {CalculationRequest} payload - The calculation request data to be sent to the API
7
- * @return {Promise<string>} A promise that resolves to the calculation result string returned by the API
12
+ * @return {Promise<EmissionResponse | EmissionResponseWithDetails>} A promise that resolves to the emission calculation result. Returns EmissionResponseWithDetails if includeDetails is true, otherwise EmissionResponse
8
13
  * @throws {Error} May throw an error if the API request fails
9
14
  *
10
15
  * @example
@@ -25,35 +30,35 @@ import { CalculationRequest } from "../interfaces/Api";
25
30
  };
26
31
  * const result = await calculate(calculationRequest);
27
32
  */
28
- export declare function calculate(payload: CalculationRequest): Promise<string>;
33
+ export declare function calculate(payload: CalculationRequest): Promise<EmissionResponse | EmissionResponseWithDetails>;
29
34
  /**
30
35
  * Retrieves available calculation types by making a GET request to the calculation types API endpoint.
31
36
  *
32
37
  * @export
33
- * @return {Promise<string>} A promise that resolves to a string containing the available calculation types
38
+ * @return {Promise<TypeResponse>} A promise that resolves to a TypeResponse containing the available calculation types
34
39
  * @throws {Error} May throw an error if the API request fails
35
40
  *
36
41
  * @example
37
42
  * const types = await getTypes();
38
43
  */
39
- export declare function getTypes(): Promise<string>;
44
+ export declare function getTypes(): Promise<TypeResponse>;
40
45
  /**
41
46
  * Retrieves information about geographical areas supported by the calculation API.
42
47
  *
43
48
  * @export
44
- * @return {Promise<string>} A promise that resolves to a string containing the supported geographical areas
49
+ * @return {Promise<AreaResponse>} A promise that resolves to an AreaResponse containing the supported geographical areas
45
50
  * @throws {Error} May throw an error if the API request fails
46
51
  *
47
52
  * @example
48
53
  * const areas = await getArea();
49
54
  */
50
- export declare function getArea(): Promise<string>;
55
+ export declare function getArea(): Promise<AreaResponse>;
51
56
  /**
52
57
  * Retrieves available units for a specific calculation type.
53
58
  *
54
59
  * @export
55
60
  * @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
61
+ * @return {Promise<UnitResponse>} A promise that resolves to a UnitResponse containing the available units
57
62
  * @throws {Error} May throw an error if the API request fails
58
63
  *
59
64
  * @example
@@ -63,4 +68,4 @@ export declare function getArea(): Promise<string>;
63
68
  * // Get units for the "HFC-263fb" emission calculation type without subtype
64
69
  * const units = await getUnits("HFC-263fb");
65
70
  */
66
- export declare function getUnits(type: string): Promise<string>;
71
+ export declare function getUnits(type: string): Promise<UnitResponse>;
@@ -1,10 +1,15 @@
1
1
  import { FactorRequest, SearchRequest } from "../interfaces/Api";
2
+ import { AreaResponse } from "../interfaces/response/AreaResponse";
3
+ import { FactorResponse } from "../interfaces/response/FactorResponse";
4
+ import { SearchResponse } from "../interfaces/response/SearchResponse";
5
+ import { TypeResponse } from "../interfaces/response/TypeResponse";
6
+ import { UnitResponse } from "../interfaces/response/UnitResponse";
2
7
  /**
3
8
  * Retrieves a factor details by making a POST request to the factor API endpoint.
4
9
  *
5
10
  * @export
6
11
  * @param {FactorRequest} payload - The factor request data to be sent to the API
7
- * @return {Promise<string>} A promise that resolves to the factor string returned by the API
12
+ * @return {Promise<FactorResponse>} A promise that resolves to the FactorResponse returned by the API
8
13
  * @throws {Error} May throw an error if the API request fails
9
14
  *
10
15
  * @example
@@ -31,13 +36,13 @@ import { FactorRequest, SearchRequest } from "../interfaces/Api";
31
36
  };
32
37
  * const factor = await retrieveFactor(factorRequest);
33
38
  */
34
- export declare function retrieveFactor(payload: FactorRequest): Promise<string>;
39
+ export declare function retrieveFactor(payload: FactorRequest): Promise<FactorResponse>;
35
40
  /**
36
41
  * Performs a search operation by making a POST request to the search API endpoint.
37
42
  *
38
43
  * @export
39
44
  * @param {SearchRequest} payload - The search request data to be sent to the API
40
- * @return {Promise<string>} A promise that resolves to the search results string returned by the API
45
+ * @return {Promise<SearchResponse>} A promise that resolves to the search results returned by the API
41
46
  * @throws {Error} May throw an error if the API request fails
42
47
  *
43
48
  * @example
@@ -53,46 +58,46 @@ export declare function retrieveFactor(payload: FactorRequest): Promise<string>;
53
58
  };
54
59
  * const results = await search(searchRequest);
55
60
  */
56
- export declare function search(payload: SearchRequest): Promise<string>;
61
+ export declare function search(payload: SearchRequest): Promise<SearchResponse>;
57
62
  /**
58
63
  * Retrieves available emission factor types by making a GET request to the API endpoint.
59
64
  *
60
65
  * @export
61
- * @return {Promise<string>} A promise that resolves to a string containing the available emission factor types
66
+ * @return {Promise<TypeResponse>} A promise that resolves to a TypeResponse containing the available emission factor types
62
67
  * @throws {Error} May throw an error if the API request fails
63
68
  *
64
69
  * @example
65
70
  * const types = await getTypes();
66
71
  */
67
- export declare function getTypes(): Promise<string>;
72
+ export declare function getTypes(): Promise<TypeResponse>;
68
73
  /**
69
74
  * Retrieves information about geographical areas supported by the factor search API.
70
75
  *
71
76
  * @export
72
- * @return {Promise<string>} A promise that resolves to a string containing the supported geographical areas
77
+ * @return {Promise<AreaResponse>} A promise that resolves to an AreaResponse containing the supported geographical areas
73
78
  * @throws {Error} May throw an error if the API request fails
74
79
  *
75
80
  * @example
76
- * const areas = await getArea();
81
+ * const areas = await getSearchArea();
77
82
  */
78
- export declare function getSearchArea(): Promise<string>;
83
+ export declare function getSearchArea(): Promise<AreaResponse>;
79
84
  /**
80
85
  * Retrieves information about geographical areas supported by the factor API.
81
86
  *
82
87
  * @export
83
- * @return {Promise<string>} A promise that resolves to a string containing the supported geographical areas
88
+ * @return {Promise<AreaResponse>} A promise that resolves to an AreaResponse containing the supported geographical areas
84
89
  * @throws {Error} May throw an error if the API request fails
85
90
  *
86
91
  * @example
87
92
  * const areas = await getArea();
88
93
  */
89
- export declare function getArea(): Promise<string>;
94
+ export declare function getArea(): Promise<AreaResponse>;
90
95
  /**
91
96
  * Retrieves available units for a specific emission factor type.
92
97
  *
93
98
  * @export
94
99
  * @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
100
+ * @return {Promise<UnitResponse>} A promise that resolves to a UnitResponse containing the available units
96
101
  * @throws {Error} May throw an error if the API request fails
97
102
  *
98
103
  * @example
@@ -102,4 +107,4 @@ export declare function getArea(): Promise<string>;
102
107
  * // Get units for the "HFC-263fb" emission factor type without subtype
103
108
  * const units = await getUnits("HFC-263fb");
104
109
  */
105
- export declare function getUnits(type: string): Promise<string>;
110
+ export declare function getUnits(type: string): Promise<UnitResponse>;
@@ -1,11 +1,12 @@
1
+ import { FactorSetResponse } from "../interfaces/response/FactorSetResponse";
1
2
  /**
2
3
  * Retrieves factor sets by making a GET request to the factor set API endpoint.
3
4
  *
4
5
  * @export
5
- * @return {Promise<string>} A promise that resolves to the factor sets string returned by the API
6
+ * @return {Promise<FactorSetResponse>} A promise that resolves to the FactorSetResponse returned by the API
6
7
  * @throws {Error} May throw an error if the API request fails
7
8
  *
8
9
  * @example
9
10
  * const factorSets = await get();
10
11
  */
11
- export declare function get(): Promise<string>;
12
+ export declare function get(): Promise<FactorSetResponse>;
@@ -1,10 +1,15 @@
1
1
  import { CommonRequest } from "../interfaces/Api";
2
+ import { AreaResponse } from "../interfaces/response/AreaResponse";
3
+ import { EmissionResponse } from "../interfaces/response/EmissionResponse";
4
+ import { EmissionResponseWithDetails } from "../interfaces/response/EmissionResponseWithDetails";
5
+ import { TypeResponse } from "../interfaces/response/TypeResponse";
6
+ import { UnitResponse } from "../interfaces/response/UnitResponse";
2
7
  /**
3
8
  * Performs scope 1 fugitve emission calculations by making a POST request to the fugitive API endpoint.
4
9
  *
5
10
  * @export
6
11
  * @param {CommonRequest} payload - The request data to be sent to the API
7
- * @return {Promise<string>} A promise that resolves to the calculation result string returned by the API
12
+ * @return {Promise<EmissionResponse | EmissionResponseWithDetails>} A promise that resolves to the emission calculation result. Returns EmissionResponseWithDetails if includeDetails is true, otherwise EmissionResponse
8
13
  * @throws {Error} May throw an error if the API request fails
9
14
  *
10
15
  * @example
@@ -24,35 +29,35 @@ import { CommonRequest } from "../interfaces/Api";
24
29
  };
25
30
  * const result = await calculate(request);
26
31
  */
27
- export declare function calculate(payload: CommonRequest): Promise<string>;
32
+ export declare function calculate(payload: CommonRequest): Promise<EmissionResponse | EmissionResponseWithDetails>;
28
33
  /**
29
34
  * Retrieves available fugitive emission calculation types by making a GET request to the API endpoint.
30
35
  *
31
36
  * @export
32
- * @return {Promise<string>} A promise that resolves to a string containing the available fugitive emission types
37
+ * @return {Promise<TypeResponse>} A promise that resolves to a TypeResponse containing the available fugitive emission types
33
38
  * @throws {Error} May throw an error if the API request fails
34
39
  *
35
40
  * @example
36
41
  * const types = await getTypes();
37
42
  */
38
- export declare function getTypes(): Promise<string>;
43
+ export declare function getTypes(): Promise<TypeResponse>;
39
44
  /**
40
45
  * Retrieves information about geographical areas supported by the fugitive emissions API.
41
46
  *
42
47
  * @export
43
- * @return {Promise<string>} A promise that resolves to a string containing the supported geographical areas
48
+ * @return {Promise<AreaResponse>} A promise that resolves to an AreaResponse containing the supported geographical areas
44
49
  * @throws {Error} May throw an error if the API request fails
45
50
  *
46
51
  * @example
47
52
  * const areas = await getArea();
48
53
  */
49
- export declare function getArea(): Promise<string>;
54
+ export declare function getArea(): Promise<AreaResponse>;
50
55
  /**
51
56
  * Retrieves available units for a specific fugitive emission type.
52
57
  *
53
58
  * @export
54
59
  * @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
60
+ * @return {Promise<UnitResponse>} A promise that resolves to a UnitResponse containing the available units
56
61
  * @throws {Error} May throw an error if the API request fails
57
62
  *
58
63
  * @example
@@ -62,4 +67,4 @@ export declare function getArea(): Promise<string>;
62
67
  * // Get units for the "R-426A" emission fugitive type without subtype
63
68
  * const units = await getUnits("R-426A");
64
69
  */
65
- export declare function getUnits(type: string): Promise<string>;
70
+ export declare function getUnits(type: string): Promise<UnitResponse>;
@@ -1,10 +1,15 @@
1
1
  import { LocationRequest } from "../interfaces/Api";
2
+ import { AreaResponse } from "../interfaces/response/AreaResponse";
3
+ import { EmissionResponse } from "../interfaces/response/EmissionResponse";
4
+ import { EmissionResponseWithDetails } from "../interfaces/response/EmissionResponseWithDetails";
5
+ import { TypeResponse } from "../interfaces/response/TypeResponse";
6
+ import { UnitResponse } from "../interfaces/response/UnitResponse";
2
7
  /**
3
8
  * Performs scope 2 purchased energy Emission calculations by making a POST request to the location API endpoint.
4
9
  *
5
10
  * @export
6
11
  * @param {LocationRequest} payload - The location request data to be sent to the API
7
- * @return {Promise<string>} A promise that resolves to the purchased energy emission result string returned by the API
12
+ * @return {Promise<EmissionResponse | EmissionResponseWithDetails>} A promise that resolves to the emission calculation result. Returns EmissionResponseWithDetails if includeDetails is true, otherwise EmissionResponse
8
13
  * @throws {Error} May throw an error if the API request fails
9
14
  *
10
15
  * @example
@@ -25,40 +30,40 @@ import { LocationRequest } from "../interfaces/Api";
25
30
  };
26
31
  * const result = await calculate(calculationRequest);
27
32
  */
28
- export declare function calculate(payload: LocationRequest): Promise<string>;
33
+ export declare function calculate(payload: LocationRequest): Promise<EmissionResponse | EmissionResponseWithDetails>;
29
34
  /**
30
35
  * Retrieves available location-based calculation types by making a GET request to the location types API endpoint.
31
36
  *
32
37
  * @export
33
- * @return {Promise<string>} A promise that resolves to a string containing the available location-based calculation types
38
+ * @return {Promise<TypeResponse>} A promise that resolves to a TypeResponse containing the available location-based calculation types
34
39
  * @throws {Error} May throw an error if the API request fails
35
40
  *
36
41
  * @example
37
42
  *
38
43
  * const types = await getTypes();
39
44
  */
40
- export declare function getTypes(): Promise<string>;
45
+ export declare function getTypes(): Promise<TypeResponse>;
41
46
  /**
42
47
  * Retrieves information about geographical areas supported by the location-based calculation API.
43
48
  *
44
49
  * @export
45
- * @return {Promise<string>} A promise that resolves to a string containing the supported geographical areas
50
+ * @return {Promise<AreaResponse>} A promise that resolves to an AreaResponse containing the supported geographical areas
46
51
  * @throws {Error} May throw an error if the API request fails
47
52
  *
48
53
  * @example
49
54
  * const areas = await getArea();
50
55
  */
51
- export declare function getArea(): Promise<string>;
56
+ export declare function getArea(): Promise<AreaResponse>;
52
57
  /**
53
58
  * Retrieves available units for a specific location-based calculation type.
54
59
  *
55
60
  * @export
56
61
  * @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
62
+ * @return {Promise<UnitResponse>} A promise that resolves to a UnitResponse containing the available units
58
63
  * @throws {Error} May throw an error if the API request fails
59
64
  *
60
65
  * @example
61
66
  * // Get units for the "electricity" location type
62
67
  * const units = await getUnits("electricity");
63
68
  */
64
- export declare function getUnits(type: string): Promise<string>;
69
+ export declare function getUnits(type: string): Promise<UnitResponse>;
@@ -1,10 +1,15 @@
1
1
  import { CommonRequest } from "../interfaces/Api";
2
+ import { AreaResponse } from "../interfaces/response/AreaResponse";
3
+ import { EmissionResponse } from "../interfaces/response/EmissionResponse";
4
+ import { EmissionResponseWithDetails } from "../interfaces/response/EmissionResponseWithDetails";
5
+ import { TypeResponse } from "../interfaces/response/TypeResponse";
6
+ import { UnitResponse } from "../interfaces/response/UnitResponse";
2
7
  /**
3
8
  * Performs Scope 1 mobile emissions related calculations by making a POST request to the mobile API endpoint.
4
9
  *
5
10
  * @export
6
11
  * @param {CommonRequest} payload - The request data to be sent to the mobile API
7
- * @return {Promise<string>} A promise that resolves to the calculation result string returned by the API
12
+ * @return {Promise<EmissionResponse | EmissionResponseWithDetails>} A promise that resolves to the emission calculation result. Returns EmissionResponseWithDetails if includeDetails is true, otherwise EmissionResponse
8
13
  * @throws {Error} May throw an error if the API request fails
9
14
  *
10
15
  * @example
@@ -25,38 +30,36 @@ import { CommonRequest } from "../interfaces/Api";
25
30
  };
26
31
  * const result = await calculate(request);
27
32
  */
28
- export declare function calculate(payload: CommonRequest): Promise<string>;
33
+ export declare function calculate(payload: CommonRequest): Promise<EmissionResponse | EmissionResponseWithDetails>;
29
34
  /**
30
35
  * Retrieves available mobile emission calculation types by making a GET request to the API endpoint.
31
36
  *
32
37
  * @export
33
- * @return {Promise<string>} A promise that resolves to a string containing the available mobile emission types
38
+ * @return {Promise<TypeResponse>} A promise that resolves to a TypeResponse containing the available mobile emission types
34
39
  * @throws {Error} May throw an error if the API request fails
35
40
  *
36
41
  * @example
37
42
  * // Get all available mobile emission types
38
43
  * const types = await getTypes();
39
- * const typesData = JSON.parse(types);
40
- * console.log("Available mobile emission types:", typesData);
41
44
  */
42
- export declare function getTypes(): Promise<string>;
45
+ export declare function getTypes(): Promise<TypeResponse>;
43
46
  /**
44
47
  * Retrieves information about geographical areas supported by the mobile emissions API.
45
48
  *
46
49
  * @export
47
- * @return {Promise<string>} A promise that resolves to a string containing the supported geographical areas
50
+ * @return {Promise<AreaResponse>} A promise that resolves to an AreaResponse containing the supported geographical areas
48
51
  * @throws {Error} May throw an error if the API request fails
49
52
  *
50
53
  * @example
51
54
  * const areas = await getArea();
52
55
  */
53
- export declare function getArea(): Promise<string>;
56
+ export declare function getArea(): Promise<AreaResponse>;
54
57
  /**
55
58
  * Retrieves available units for a specific mobile emission type.
56
59
  *
57
60
  * @export
58
61
  * @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
62
+ * @return {Promise<UnitResponse>} A promise that resolves to a UnitResponse containing the available units
60
63
  * @throws {Error} May throw an error if the API request fails
61
64
  *
62
65
  * @example
@@ -66,4 +69,4 @@ export declare function getArea(): Promise<string>;
66
69
  * Get units for the "Cars by Size - Large Car - Hybrid" emission mobile type without subtype
67
70
  * const units = await getUnits("Cars by Size - Large Car - Hybrid");
68
71
  */
69
- export declare function getUnits(type: string): Promise<string>;
72
+ export declare function getUnits(type: string): Promise<UnitResponse>;
@@ -1,10 +1,15 @@
1
1
  import { CommonRequest } from "../interfaces/Api";
2
+ import { AreaResponse } from "../interfaces/response/AreaResponse";
3
+ import { EmissionResponse } from "../interfaces/response/EmissionResponse";
4
+ import { EmissionResponseWithDetails } from "../interfaces/response/EmissionResponseWithDetails";
5
+ import { TypeResponse } from "../interfaces/response/TypeResponse";
6
+ import { UnitResponse } from "../interfaces/response/UnitResponse";
2
7
  /**
3
8
  * Performs Scope 1 stationary calculations by making a POST request to the stationary API endpoint.
4
9
  *
5
10
  * @export
6
11
  * @param {CommonRequest} payload - The request data to be sent to the stationary API
7
- * @return {Promise<string>} A promise that resolves to the calculation result string returned by the API
12
+ * @return {Promise<EmissionResponse | EmissionResponseWithDetails>} A promise that resolves to the emission calculation result. Returns EmissionResponseWithDetails if includeDetails is true, otherwise EmissionResponse
8
13
  * @throws {Error} May throw an error if the API request fails
9
14
  *
10
15
  * @example
@@ -25,35 +30,35 @@ import { CommonRequest } from "../interfaces/Api";
25
30
  };
26
31
  * const result = await calculate(request);
27
32
  */
28
- export declare function calculate(payload: CommonRequest): Promise<string>;
33
+ export declare function calculate(payload: CommonRequest): Promise<EmissionResponse | EmissionResponseWithDetails>;
29
34
  /**
30
35
  * Retrieves available stationary emission calculation types by making a GET request to the API endpoint.
31
36
  *
32
37
  * @export
33
- * @return {Promise<string>} A promise that resolves to a string containing the available stationary emission types
38
+ * @return {Promise<TypeResponse>} A promise that resolves to a TypeResponse containing the available stationary emission types
34
39
  * @throws {Error} May throw an error if the API request fails
35
40
  *
36
41
  * @example
37
42
  * const types = await getTypes();
38
43
  */
39
- export declare function getTypes(): Promise<string>;
44
+ export declare function getTypes(): Promise<TypeResponse>;
40
45
  /**
41
46
  * Retrieves information about geographical areas supported by the stationary emissions API.
42
47
  *
43
48
  * @export
44
- * @return {Promise<string>} A promise that resolves to a string containing the supported geographical areas
49
+ * @return {Promise<AreaResponse>} A promise that resolves to an AreaResponse containing the supported geographical areas
45
50
  * @throws {Error} May throw an error if the API request fails
46
51
  *
47
52
  * @example
48
53
  * const areas = await getArea();
49
54
  */
50
- export declare function getArea(): Promise<string>;
55
+ export declare function getArea(): Promise<AreaResponse>;
51
56
  /**
52
57
  * Retrieves available units for a specific stationary emission type.
53
58
  *
54
59
  * @export
55
60
  * @param {string} type - The stationary emission type to get units for (e.g., "Coal - Lignite")
56
- * @return {Promise<string>} A promise that resolves to a string containing the available units
61
+ * @return {Promise<UnitResponse>} A promise that resolves to a UnitResponse containing the available units
57
62
  * @throws {Error} May throw an error if the API request fails
58
63
  *
59
64
  * @example
@@ -63,4 +68,4 @@ export declare function getArea(): Promise<string>;
63
68
  * Get units for the "Jet Kerosene" emission stationary type without subtype
64
69
  * const units = await getUnits("Jet Kerosene");
65
70
  */
66
- export declare function getUnits(type: string): Promise<string>;
71
+ export declare function getUnits(type: string): Promise<UnitResponse>;
@@ -1,10 +1,15 @@
1
1
  import { CalculationRequest } from "../interfaces/Api";
2
+ import { AreaResponse } from "../interfaces/response/AreaResponse";
3
+ import { EmissionResponse } from "../interfaces/response/EmissionResponse";
4
+ import { EmissionResponseWithDetails } from "../interfaces/response/EmissionResponseWithDetails";
5
+ import { TypeResponse } from "../interfaces/response/TypeResponse";
6
+ import { UnitResponse } from "../interfaces/response/UnitResponse";
2
7
  /**
3
- * Performs Scope 2 transportation and distribution emission calculations by making a POST request to the transportation and distribution API endpoint.
8
+ * Performs Scope 3 transportation and distribution emission calculations by making a POST request to the transportation and distribution API endpoint.
4
9
  *
5
10
  * @export
6
11
  * @param {CalculationRequest} payload - The calculation request data for transportation and distribution operations
7
- * @return {Promise<string>} A promise that resolves to the calculation result string returned by the API
12
+ * @return {Promise<EmissionResponse | EmissionResponseWithDetails>} A promise that resolves to the emission calculation result. Returns EmissionResponseWithDetails if includeDetails is true, otherwise EmissionResponse
8
13
  * @throws {Error} May throw an error if the API request fails
9
14
  *
10
15
  * @example
@@ -24,35 +29,35 @@ import { CalculationRequest } from "../interfaces/Api";
24
29
  };
25
30
  * const result = await calculate(request);
26
31
  */
27
- export declare function calculate(payload: CalculationRequest): Promise<string>;
32
+ export declare function calculate(payload: CalculationRequest): Promise<EmissionResponse | EmissionResponseWithDetails>;
28
33
  /**
29
34
  * Retrieves available transportation and distribution calculation types by making a GET request to the API endpoint.
30
35
  *
31
36
  * @export
32
- * @return {Promise<string>} A promise that resolves to a string containing the available transportation and distribution calculation types
37
+ * @return {Promise<TypeResponse>} A promise that resolves to a TypeResponse containing the available transportation and distribution calculation types
33
38
  * @throws {Error} May throw an error if the API request fails
34
39
  *
35
40
  * @example
36
41
  * const types = await getTypes();
37
42
  */
38
- export declare function getTypes(): Promise<string>;
43
+ export declare function getTypes(): Promise<TypeResponse>;
39
44
  /**
40
45
  * Retrieves information about geographical areas supported by the transportation and distribution API.
41
46
  *
42
47
  * @export
43
- * @return {Promise<string>} A promise that resolves to a string containing the supported geographical areas
48
+ * @return {Promise<AreaResponse>} A promise that resolves to an AreaResponse containing the supported geographical areas
44
49
  * @throws {Error} May throw an error if the API request fails
45
50
  *
46
51
  * @example
47
52
  * const areas = await getArea();
48
53
  */
49
- export declare function getArea(): Promise<string>;
54
+ export declare function getArea(): Promise<AreaResponse>;
50
55
  /**
51
56
  * Retrieves available units for a specific transportation and distribution calculation type.
52
57
  *
53
58
  * @export
54
59
  * @param {string} type - The transportation and distribution calculation type to get units for (e.g., "Freight - Cargo Ship")
55
- * @return {Promise<string>} A promise that resolves to a string containing the available units
60
+ * @return {Promise<UnitResponse>} A promise that resolves to a UnitResponse containing the available units
56
61
  * @throws {Error} May throw an error if the API request fails
57
62
  *
58
63
  * @example
@@ -62,4 +67,4 @@ export declare function getArea(): Promise<string>;
62
67
  * // Get units for the "Business Travel - Cars" transportation and distribution type with subtype
63
68
  * const units = await getUnits("Business Travel - Cars");
64
69
  */
65
- export declare function getUnits(type: string): Promise<string>;
70
+ export declare function getUnits(type: string): Promise<UnitResponse>;
@@ -8,3 +8,11 @@ export * as TransportationAndDistribution from './api/TransportationAndDistribut
8
8
  export * as Factor from './api/Factor';
9
9
  export * as FactorSets from './api/FactorSets';
10
10
  export { ClientConfig } from './interfaces/Config';
11
+ export { AreaResponse, Location as LocationInfo } from './interfaces/response/AreaResponse';
12
+ export { EmissionResponse } from './interfaces/response/EmissionResponse';
13
+ export { EmissionResponseWithDetails, UnitInfo, AreaInfo, AreaType, FactorDataTypeCategory, FactorSetInfo, FactorSelectionDefault, FactorDataTypeCode, FactorSetVersion, FactorValue, FactorMetaData, UnitConversion, EmissionData } from './interfaces/response/EmissionResponseWithDetails';
14
+ export { FactorResponse } from './interfaces/response/FactorResponse';
15
+ export { FactorSetResponse, FactorSet } from './interfaces/response/FactorSetResponse';
16
+ export { SearchResponse, Pagination, PaginationBody, SearchLink } from './interfaces/response/SearchResponse';
17
+ export { TypeResponse } from './interfaces/response/TypeResponse';
18
+ export { UnitResponse } from './interfaces/response/UnitResponse';
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Interface representing a location with geographical and power grid information
3
+ */
4
+ export interface Location {
5
+ /** ISO 3166-1 alpha-3 country code */
6
+ alpha3: string;
7
+ /** Full country name */
8
+ countryName: string;
9
+ /** List of state or province names (optional) */
10
+ stateProvinces?: string[];
11
+ /** List of power grid identifiers (optional) */
12
+ powerGrids?: string[];
13
+ }
14
+ /**
15
+ * Interface representing the response from the area/location API
16
+ */
17
+ export interface AreaResponse {
18
+ /** Array of location objects */
19
+ locations: Location[];
20
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Interface representing the emission calculation response
3
+ */
4
+ export interface EmissionResponse {
5
+ /** Unique transaction identifier (required) */
6
+ transactionId: string;
7
+ /** Total CO2 equivalent emissions (required) */
8
+ totalCO2e: number;
9
+ /** CO2 emissions value (optional) */
10
+ CO2?: number;
11
+ /** CH4 (Methane) emissions value (optional) */
12
+ CH4?: number;
13
+ /** N2O (Nitrous Oxide) emissions value (optional) */
14
+ N2O?: number;
15
+ /** Biogenic CO2 emissions value (optional) */
16
+ bioCO2?: number;
17
+ /** Indirect CO2 equivalent emissions value (optional) */
18
+ indirectCO2e?: number;
19
+ /** Hydrofluorocarbon emissions value (optional) */
20
+ HFC?: number;
21
+ /** Perfluorocarbon emissions value (optional) */
22
+ PFC?: number;
23
+ /** Sulfur hexafluoride emissions value (optional) */
24
+ SF6?: number;
25
+ /** Nitrogen trifluoride emissions value (optional) */
26
+ NF3?: number;
27
+ /** Unit of measurement for emissions (required) */
28
+ unit: string;
29
+ /** Description of the emission calculation (required) */
30
+ description: string;
31
+ }