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,210 +0,0 @@
1
- /* eslint-disable */
2
- var addSorting = (function() {
3
- 'use strict';
4
- var cols,
5
- currentSort = {
6
- index: 0,
7
- desc: false
8
- };
9
-
10
- // returns the summary table element
11
- function getTable() {
12
- return document.querySelector('.coverage-summary');
13
- }
14
- // returns the thead element of the summary table
15
- function getTableHeader() {
16
- return getTable().querySelector('thead tr');
17
- }
18
- // returns the tbody element of the summary table
19
- function getTableBody() {
20
- return getTable().querySelector('tbody');
21
- }
22
- // returns the th element for nth column
23
- function getNthColumn(n) {
24
- return getTableHeader().querySelectorAll('th')[n];
25
- }
26
-
27
- function onFilterInput() {
28
- const searchValue = document.getElementById('fileSearch').value;
29
- const rows = document.getElementsByTagName('tbody')[0].children;
30
-
31
- // Try to create a RegExp from the searchValue. If it fails (invalid regex),
32
- // it will be treated as a plain text search
33
- let searchRegex;
34
- try {
35
- searchRegex = new RegExp(searchValue, 'i'); // 'i' for case-insensitive
36
- } catch (error) {
37
- searchRegex = null;
38
- }
39
-
40
- for (let i = 0; i < rows.length; i++) {
41
- const row = rows[i];
42
- let isMatch = false;
43
-
44
- if (searchRegex) {
45
- // If a valid regex was created, use it for matching
46
- isMatch = searchRegex.test(row.textContent);
47
- } else {
48
- // Otherwise, fall back to the original plain text search
49
- isMatch = row.textContent
50
- .toLowerCase()
51
- .includes(searchValue.toLowerCase());
52
- }
53
-
54
- row.style.display = isMatch ? '' : 'none';
55
- }
56
- }
57
-
58
- // loads the search box
59
- function addSearchBox() {
60
- var template = document.getElementById('filterTemplate');
61
- var templateClone = template.content.cloneNode(true);
62
- templateClone.getElementById('fileSearch').oninput = onFilterInput;
63
- template.parentElement.appendChild(templateClone);
64
- }
65
-
66
- // loads all columns
67
- function loadColumns() {
68
- var colNodes = getTableHeader().querySelectorAll('th'),
69
- colNode,
70
- cols = [],
71
- col,
72
- i;
73
-
74
- for (i = 0; i < colNodes.length; i += 1) {
75
- colNode = colNodes[i];
76
- col = {
77
- key: colNode.getAttribute('data-col'),
78
- sortable: !colNode.getAttribute('data-nosort'),
79
- type: colNode.getAttribute('data-type') || 'string'
80
- };
81
- cols.push(col);
82
- if (col.sortable) {
83
- col.defaultDescSort = col.type === 'number';
84
- colNode.innerHTML =
85
- colNode.innerHTML + '<span class="sorter"></span>';
86
- }
87
- }
88
- return cols;
89
- }
90
- // attaches a data attribute to every tr element with an object
91
- // of data values keyed by column name
92
- function loadRowData(tableRow) {
93
- var tableCols = tableRow.querySelectorAll('td'),
94
- colNode,
95
- col,
96
- data = {},
97
- i,
98
- val;
99
- for (i = 0; i < tableCols.length; i += 1) {
100
- colNode = tableCols[i];
101
- col = cols[i];
102
- val = colNode.getAttribute('data-value');
103
- if (col.type === 'number') {
104
- val = Number(val);
105
- }
106
- data[col.key] = val;
107
- }
108
- return data;
109
- }
110
- // loads all row data
111
- function loadData() {
112
- var rows = getTableBody().querySelectorAll('tr'),
113
- i;
114
-
115
- for (i = 0; i < rows.length; i += 1) {
116
- rows[i].data = loadRowData(rows[i]);
117
- }
118
- }
119
- // sorts the table using the data for the ith column
120
- function sortByIndex(index, desc) {
121
- var key = cols[index].key,
122
- sorter = function(a, b) {
123
- a = a.data[key];
124
- b = b.data[key];
125
- return a < b ? -1 : a > b ? 1 : 0;
126
- },
127
- finalSorter = sorter,
128
- tableBody = document.querySelector('.coverage-summary tbody'),
129
- rowNodes = tableBody.querySelectorAll('tr'),
130
- rows = [],
131
- i;
132
-
133
- if (desc) {
134
- finalSorter = function(a, b) {
135
- return -1 * sorter(a, b);
136
- };
137
- }
138
-
139
- for (i = 0; i < rowNodes.length; i += 1) {
140
- rows.push(rowNodes[i]);
141
- tableBody.removeChild(rowNodes[i]);
142
- }
143
-
144
- rows.sort(finalSorter);
145
-
146
- for (i = 0; i < rows.length; i += 1) {
147
- tableBody.appendChild(rows[i]);
148
- }
149
- }
150
- // removes sort indicators for current column being sorted
151
- function removeSortIndicators() {
152
- var col = getNthColumn(currentSort.index),
153
- cls = col.className;
154
-
155
- cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
156
- col.className = cls;
157
- }
158
- // adds sort indicators for current column being sorted
159
- function addSortIndicators() {
160
- getNthColumn(currentSort.index).className += currentSort.desc
161
- ? ' sorted-desc'
162
- : ' sorted';
163
- }
164
- // adds event listeners for all sorter widgets
165
- function enableUI() {
166
- var i,
167
- el,
168
- ithSorter = function ithSorter(i) {
169
- var col = cols[i];
170
-
171
- return function() {
172
- var desc = col.defaultDescSort;
173
-
174
- if (currentSort.index === i) {
175
- desc = !currentSort.desc;
176
- }
177
- sortByIndex(i, desc);
178
- removeSortIndicators();
179
- currentSort.index = i;
180
- currentSort.desc = desc;
181
- addSortIndicators();
182
- };
183
- };
184
- for (i = 0; i < cols.length; i += 1) {
185
- if (cols[i].sortable) {
186
- // add the click event handler on the th so users
187
- // dont have to click on those tiny arrows
188
- el = getNthColumn(i).querySelector('.sorter').parentElement;
189
- if (el.addEventListener) {
190
- el.addEventListener('click', ithSorter(i));
191
- } else {
192
- el.attachEvent('onclick', ithSorter(i));
193
- }
194
- }
195
- }
196
- }
197
- // adds sorting functionality to the UI
198
- return function() {
199
- if (!getTable()) {
200
- return;
201
- }
202
- cols = loadColumns();
203
- loadData();
204
- addSearchBox();
205
- addSortIndicators();
206
- enableUI();
207
- };
208
- })();
209
-
210
- window.addEventListener('load', addSorting);