emissions-api-sdk 1.0.12 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -2
- package/dist/Constants.js +4 -1
- package/dist/api/AuditLog.js +99 -0
- package/dist/api/EconomicActivity.js +24 -0
- package/dist/api/Factor.js +19 -0
- package/dist/api/PhysicalActivity.js +87 -0
- package/dist/api/RealEstate.js +23 -0
- package/dist/api/TypeRecommender.js +19 -2
- package/dist/coverage/clover.xml +149 -87
- package/dist/coverage/coverage-final.json +14 -8
- package/dist/coverage/lcov-report/index.html +21 -21
- package/dist/coverage/lcov-report/src/Client.ts.html +32 -32
- package/dist/coverage/lcov-report/src/Constants.ts.html +36 -27
- package/dist/coverage/lcov-report/src/api/AuditLog.ts.html +388 -0
- package/dist/coverage/lcov-report/src/api/Calculation.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/EconomicActivity.ts.html +77 -5
- package/dist/coverage/lcov-report/src/api/Factor.ts.html +59 -2
- package/dist/coverage/lcov-report/src/api/FactorSets.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/Fugitive.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/Location.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/Metadata.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/Mobile.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/PhysicalActivity.ts.html +361 -0
- package/dist/coverage/lcov-report/src/api/RealEstate.ts.html +74 -5
- package/dist/coverage/lcov-report/src/api/Stationary.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/TransportationAndDistribution.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/TypeRecommender.ts.html +55 -4
- package/dist/coverage/lcov-report/src/api/Usage.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/index.html +36 -6
- package/dist/coverage/lcov-report/src/index.html +7 -7
- package/dist/coverage/lcov-report/src/request.ts.html +5 -5
- package/dist/coverage/lcov-report/src/utils.ts.html +6 -6
- package/dist/coverage/lcov-report/test/index.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/AttributionRequest.ts.html +151 -0
- package/dist/coverage/lcov-report/test/mocks/CommonRequest.ts.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/EconomicActivityAttributionRequest.ts.html +148 -0
- package/dist/coverage/lcov-report/test/mocks/FactorRequest.ts.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/GenericCalculationRequest.ts.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/LocationRequest.ts.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/PhysicalActivityEVICRequest.ts.html +148 -0
- package/dist/coverage/lcov-report/test/mocks/PhysicalActivityRequest.ts.html +151 -0
- package/dist/coverage/lcov-report/test/mocks/SearchRequest.ts.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/index.html +63 -3
- package/dist/coverage/lcov-report/test/testUtils.ts.html +1 -1
- package/dist/coverage/lcov.info +249 -122
- package/dist/index.js +3 -1
- package/dist/interfaces/response/AuditLogResponse.js +2 -0
- package/dist/types/Constants.d.ts +3 -0
- package/dist/types/api/AuditLog.d.ts +37 -0
- package/dist/types/api/EconomicActivity.d.ts +24 -0
- package/dist/types/api/Factor.d.ts +19 -0
- package/dist/types/api/PhysicalActivity.d.ts +76 -0
- package/dist/types/api/RealEstate.d.ts +23 -0
- package/dist/types/api/TypeRecommender.d.ts +19 -2
- package/dist/types/index.d.ts +4 -0
- package/dist/types/interfaces/Api.d.ts +17 -1
- package/dist/types/interfaces/common.d.ts +40 -0
- package/dist/types/interfaces/response/AuditLogResponse.d.ts +40 -0
- package/dist/types/interfaces/response/TypeRecommenderResponse.d.ts +1 -0
- package/docs/_sources/authentication.rst.txt +26 -4
- package/docs/_sources/getting_started.rst.txt +538 -74
- package/docs/_sources/index.rst.txt +11 -0
- package/docs/_sources/reference.rst.txt +26 -0
- package/docs/_sources/troubleshooting.rst.txt +77 -12
- package/docs/_static/basic.css +8 -0
- package/docs/_static/doctools.js +5 -6
- package/docs/_static/language_data.js +186 -7
- package/docs/_static/pygments.css +146 -164
- package/docs/_static/searchtools.js +60 -121
- package/docs/_static/sphinx_highlight.js +31 -36
- package/docs/_static/styles/furo.css +1 -1
- package/docs/_static/styles/furo.css.map +1 -1
- package/docs/authentication.html +61 -26
- package/docs/client.html +33 -22
- package/docs/genindex.html +52 -23
- package/docs/getting_started.html +745 -103
- package/docs/index.html +65 -21
- package/docs/reference.html +484 -66
- package/docs/sdk.html +32 -21
- package/docs/search.html +32 -21
- package/docs/searchindex.js +1 -1
- package/docs/troubleshooting.html +105 -38
- package/package.json +7 -3
- package/sphinx-build/source/authentication.rst +26 -4
- package/sphinx-build/source/getting_started.rst +538 -74
- package/sphinx-build/source/index.rst +11 -0
- package/sphinx-build/source/reference.rst +26 -0
- package/sphinx-build/source/troubleshooting.rst +77 -12
- package/src/Constants.ts +3 -0
- package/src/api/AuditLog.ts +102 -0
- package/src/api/EconomicActivity.ts +24 -0
- package/src/api/Factor.ts +19 -0
- package/src/api/PhysicalActivity.ts +92 -0
- package/src/api/RealEstate.ts +23 -0
- package/src/api/TypeRecommender.ts +19 -2
- package/src/index.ts +7 -1
- package/src/interfaces/Api.ts +22 -6
- package/src/interfaces/common.ts +46 -0
- package/src/interfaces/response/AuditLogResponse.ts +47 -0
- package/src/interfaces/response/TypeRecommenderResponse.ts +2 -0
- package/test/apiTest.test.ts +59 -3
- package/test/auditLog.test.ts +216 -0
- package/test/mocks/AttributionRequest.ts +23 -0
- package/test/mocks/EconomicActivityAttributionRequest.ts +22 -0
- package/test/mocks/PhysicalActivityEVICRequest.ts +22 -0
- package/test/mocks/PhysicalActivityRequest.ts +23 -0
package/docs/index.html
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
2
|
<html class="no-js" lang="en" data-content_root="./">
|
|
3
|
-
<head><meta charset="utf-8"
|
|
4
|
-
<meta name="viewport" content="width=device-width,initial-scale=1"
|
|
3
|
+
<head><meta charset="utf-8"/>
|
|
4
|
+
<meta name="viewport" content="width=device-width,initial-scale=1"/>
|
|
5
5
|
<meta name="color-scheme" content="light dark"><meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
-
<link rel="index" title="Index" href="genindex.html"
|
|
6
|
+
<link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Getting Started" href="getting_started.html" />
|
|
7
7
|
|
|
8
|
-
<!-- Generated with Sphinx
|
|
8
|
+
<!-- Generated with Sphinx 8.1.3 and Furo 2025.07.19 -->
|
|
9
9
|
<title>IBM Envizi - Emissions API Node.js SDK documentation</title>
|
|
10
10
|
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
|
|
11
|
-
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=
|
|
11
|
+
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=25af2a20" />
|
|
12
12
|
<link rel="stylesheet" type="text/css" href="_static/sphinx_js.css" />
|
|
13
13
|
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
|
|
14
14
|
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=8d04aa46" />
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
}
|
|
25
25
|
@media not print {
|
|
26
26
|
body[data-theme="dark"] {
|
|
27
|
-
--color-code-background: #
|
|
28
|
-
--color-code-foreground: #
|
|
27
|
+
--color-code-background: #2b2b2b;
|
|
28
|
+
--color-code-foreground: #f8f8f2;
|
|
29
29
|
|
|
30
30
|
}
|
|
31
31
|
@media (prefers-color-scheme: dark) {
|
|
32
32
|
body:not([data-theme="light"]) {
|
|
33
|
-
--color-code-background: #
|
|
34
|
-
--color-code-foreground: #
|
|
33
|
+
--color-code-background: #2b2b2b;
|
|
34
|
+
--color-code-foreground: #f8f8f2;
|
|
35
35
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -146,10 +146,14 @@
|
|
|
146
146
|
</symbol>
|
|
147
147
|
</svg>
|
|
148
148
|
|
|
149
|
-
<input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation"
|
|
150
|
-
<input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc"
|
|
151
|
-
<label class="overlay sidebar-overlay" for="__navigation"
|
|
152
|
-
<
|
|
149
|
+
<input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation">
|
|
150
|
+
<input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc">
|
|
151
|
+
<label class="overlay sidebar-overlay" for="__navigation">
|
|
152
|
+
<div class="visually-hidden">Hide navigation sidebar</div>
|
|
153
|
+
</label>
|
|
154
|
+
<label class="overlay toc-overlay" for="__toc">
|
|
155
|
+
<div class="visually-hidden">Hide table of contents sidebar</div>
|
|
156
|
+
</label>
|
|
153
157
|
|
|
154
158
|
<a class="skip-to-content muted-link" href="#furo-main-content">Skip to content</a>
|
|
155
159
|
|
|
@@ -159,7 +163,8 @@
|
|
|
159
163
|
<header class="mobile-header">
|
|
160
164
|
<div class="header-left">
|
|
161
165
|
<label class="nav-overlay-icon" for="__navigation">
|
|
162
|
-
<
|
|
166
|
+
<div class="visually-hidden">Toggle site navigation sidebar</div>
|
|
167
|
+
<i class="icon"><svg><use href="#svg-menu"></use></svg></i>
|
|
163
168
|
</label>
|
|
164
169
|
</div>
|
|
165
170
|
<div class="header-center">
|
|
@@ -167,7 +172,8 @@
|
|
|
167
172
|
</div>
|
|
168
173
|
<div class="header-right">
|
|
169
174
|
<div class="theme-toggle-container theme-toggle-header">
|
|
170
|
-
<button class="theme-toggle"
|
|
175
|
+
<button class="theme-toggle">
|
|
176
|
+
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
|
|
171
177
|
<svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg>
|
|
172
178
|
<svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg>
|
|
173
179
|
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
|
|
@@ -175,7 +181,8 @@
|
|
|
175
181
|
</button>
|
|
176
182
|
</div>
|
|
177
183
|
<label class="toc-overlay-icon toc-header-icon no-toc" for="__toc">
|
|
178
|
-
<
|
|
184
|
+
<div class="visually-hidden">Toggle table of contents sidebar</div>
|
|
185
|
+
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
|
|
179
186
|
</label>
|
|
180
187
|
</div>
|
|
181
188
|
</header>
|
|
@@ -195,11 +202,13 @@
|
|
|
195
202
|
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
|
|
196
203
|
<ul>
|
|
197
204
|
<li class="toctree-l1"><a class="reference internal" href="getting_started.html">Getting Started</a></li>
|
|
198
|
-
<li class="toctree-l1 has-children"><a class="reference internal" href="sdk.html">SDK</a><input
|
|
205
|
+
<li class="toctree-l1 has-children"><a class="reference internal" href="sdk.html">SDK</a><input class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" role="switch" type="checkbox"/><label for="toctree-checkbox-1"><div class="visually-hidden">Toggle navigation of SDK</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
|
|
199
206
|
<li class="toctree-l2"><a class="reference internal" href="client.html">Client</a></li>
|
|
200
207
|
<li class="toctree-l2"><a class="reference internal" href="authentication.html">Authentication</a></li>
|
|
201
208
|
</ul>
|
|
202
209
|
</li>
|
|
210
|
+
<li class="toctree-l1"><a class="reference internal" href="authentication.html">Authentication</a></li>
|
|
211
|
+
<li class="toctree-l1"><a class="reference internal" href="client.html">Client</a></li>
|
|
203
212
|
<li class="toctree-l1"><a class="reference internal" href="reference.html">Reference</a></li>
|
|
204
213
|
<li class="toctree-l1"><a class="reference internal" href="troubleshooting.html">Troubleshooting Guide</a></li>
|
|
205
214
|
</ul>
|
|
@@ -228,7 +237,8 @@
|
|
|
228
237
|
</a>
|
|
229
238
|
</div>
|
|
230
239
|
<div class="theme-toggle-container theme-toggle-content">
|
|
231
|
-
<button class="theme-toggle"
|
|
240
|
+
<button class="theme-toggle">
|
|
241
|
+
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
|
|
232
242
|
<svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg>
|
|
233
243
|
<svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg>
|
|
234
244
|
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
|
|
@@ -236,7 +246,8 @@
|
|
|
236
246
|
</button>
|
|
237
247
|
</div>
|
|
238
248
|
<label class="toc-overlay-icon toc-content-icon no-toc" for="__toc">
|
|
239
|
-
<
|
|
249
|
+
<div class="visually-hidden">Toggle table of contents sidebar</div>
|
|
250
|
+
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
|
|
240
251
|
</label>
|
|
241
252
|
</div>
|
|
242
253
|
<article role="main" id="furo-main-content">
|
|
@@ -251,6 +262,8 @@
|
|
|
251
262
|
<li class="toctree-l2"><a class="reference internal" href="getting_started.html#authentication">Authentication</a></li>
|
|
252
263
|
<li class="toctree-l2"><a class="reference internal" href="getting_started.html#first-api-call">First API Call</a></li>
|
|
253
264
|
<li class="toctree-l2"><a class="reference internal" href="getting_started.html#example-response">Example Response</a></li>
|
|
265
|
+
<li class="toctree-l2"><a class="reference internal" href="getting_started.html#example-response-with-details">Example Response with Details</a></li>
|
|
266
|
+
<li class="toctree-l2"><a class="reference internal" href="getting_started.html#currency-conversion-support">Currency Conversion Support</a></li>
|
|
254
267
|
</ul>
|
|
255
268
|
</li>
|
|
256
269
|
<li class="toctree-l1"><a class="reference internal" href="sdk.html">SDK</a><ul>
|
|
@@ -258,11 +271,32 @@
|
|
|
258
271
|
<li class="toctree-l2"><a class="reference internal" href="authentication.html">Authentication</a></li>
|
|
259
272
|
</ul>
|
|
260
273
|
</li>
|
|
274
|
+
<li class="toctree-l1"><a class="reference internal" href="authentication.html">Authentication</a><ul>
|
|
275
|
+
<li class="toctree-l2"><a class="reference internal" href="authentication.html#overview">Overview</a></li>
|
|
276
|
+
<li class="toctree-l2"><a class="reference internal" href="authentication.html#authentication-methods">Authentication Methods</a></li>
|
|
277
|
+
<li class="toctree-l2"><a class="reference internal" href="authentication.html#authentication-flow">Authentication Flow</a></li>
|
|
278
|
+
<li class="toctree-l2"><a class="reference internal" href="authentication.html#authentication-headers">Authentication Headers</a></li>
|
|
279
|
+
<li class="toctree-l2"><a class="reference internal" href="authentication.html#architecture-diagram">Architecture Diagram</a></li>
|
|
280
|
+
<li class="toctree-l2"><a class="reference internal" href="authentication.html#security-best-practices">Security Best Practices</a></li>
|
|
281
|
+
</ul>
|
|
282
|
+
</li>
|
|
283
|
+
<li class="toctree-l1"><a class="reference internal" href="client.html">Client</a><ul>
|
|
284
|
+
<li class="toctree-l2"><a class="reference internal" href="client.html#overview">Overview</a></li>
|
|
285
|
+
<li class="toctree-l2"><a class="reference internal" href="client.html#client-initialization">Client Initialization</a></li>
|
|
286
|
+
<li class="toctree-l2"><a class="reference internal" href="client.html#configuration-options">Configuration Options</a></li>
|
|
287
|
+
<li class="toctree-l2"><a class="reference internal" href="client.html#client-responsibilities">Client Responsibilities</a></li>
|
|
288
|
+
<li class="toctree-l2"><a class="reference internal" href="client.html#error-handling">Error Handling</a></li>
|
|
289
|
+
<li class="toctree-l2"><a class="reference internal" href="client.html#best-practices">Best Practices</a></li>
|
|
290
|
+
<li class="toctree-l2"><a class="reference internal" href="client.html#authentication-integration">Authentication Integration</a></li>
|
|
291
|
+
</ul>
|
|
292
|
+
</li>
|
|
261
293
|
<li class="toctree-l1"><a class="reference internal" href="reference.html">Reference</a><ul>
|
|
262
294
|
<li class="toctree-l2"><a class="reference internal" href="reference.html#Client"><code class="docutils literal notranslate"><span class="pre">Client</span></code></a></li>
|
|
263
295
|
<li class="toctree-l2"><a class="reference internal" href="reference.html#request.makeApiRequest"><code class="docutils literal notranslate"><span class="pre">request.makeApiRequest()</span></code></a></li>
|
|
264
296
|
<li class="toctree-l2"><a class="reference internal" href="reference.html#utils.findExpiryTime"><code class="docutils literal notranslate"><span class="pre">utils.findExpiryTime()</span></code></a></li>
|
|
265
297
|
<li class="toctree-l2"><a class="reference internal" href="reference.html#api">API</a></li>
|
|
298
|
+
<li class="toctree-l2"><a class="reference internal" href="reference.html#type-recommender-api">Type Recommender API</a></li>
|
|
299
|
+
<li class="toctree-l2"><a class="reference internal" href="reference.html#audit-log-api">Audit Log API</a></li>
|
|
266
300
|
<li class="toctree-l2"><a class="reference internal" href="reference.html#global-metadata-api">Global Metadata API</a></li>
|
|
267
301
|
<li class="toctree-l2"><a class="reference internal" href="reference.html#usage-api">Usage API</a></li>
|
|
268
302
|
<li class="toctree-l2"><a class="reference internal" href="reference.html#interfaces">Interfaces</a></li>
|
|
@@ -302,6 +336,16 @@
|
|
|
302
336
|
</ul>
|
|
303
337
|
<p>The SDK is designed for embedding emission calculations in applications, building sustainability dashboards, automating large-scale datasets, and tracking carbon footprints.</p>
|
|
304
338
|
</section>
|
|
339
|
+
<section id="additional-capabilities">
|
|
340
|
+
<h2>Additional capabilities<a class="headerlink" href="#additional-capabilities" title="Link to this heading">¶</a></h2>
|
|
341
|
+
<ul class="simple">
|
|
342
|
+
<li><p><strong>Metadata API</strong> – query supported types, areas, and units across endpoints</p></li>
|
|
343
|
+
<li><p><strong>Type Recommender API</strong> – semantic search to identify likely activity types, with optional reranker control and scope in results</p></li>
|
|
344
|
+
<li><p><strong>Factor Search API</strong> – search for emission factors with unit and scope filtering, with optional reranker control</p></li>
|
|
345
|
+
<li><p><strong>Usage API</strong> – retrieve organization billing-period or historical usage</p></li>
|
|
346
|
+
<li><p><strong>Audit Log API</strong> – manage whether API requests and responses are stored for auditing</p></li>
|
|
347
|
+
</ul>
|
|
348
|
+
</section>
|
|
305
349
|
</section>
|
|
306
350
|
|
|
307
351
|
</article>
|
|
@@ -344,8 +388,8 @@
|
|
|
344
388
|
</aside>
|
|
345
389
|
</div>
|
|
346
390
|
</div><script src="_static/documentation_options.js?v=5929fcd5"></script>
|
|
347
|
-
<script src="_static/doctools.js?v=
|
|
348
|
-
<script src="_static/sphinx_highlight.js?v=
|
|
391
|
+
<script src="_static/doctools.js?v=9bcbadda"></script>
|
|
392
|
+
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
|
|
349
393
|
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
|
|
350
394
|
</body>
|
|
351
395
|
</html>
|