emissions-api-sdk 1.0.12 → 1.0.14
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 +65 -2
- package/dist/Constants.js +7 -1
- package/dist/api/AuditExport.js +73 -0
- package/dist/api/AuditLog.js +99 -0
- package/dist/api/EconomicActivity.js +69 -0
- package/dist/api/Factor.js +16 -0
- package/dist/api/PhysicalActivity.js +87 -0
- package/dist/api/RealEstate.js +25 -1
- package/dist/api/TypeRecommender.js +19 -2
- package/dist/coverage/clover.xml +172 -89
- package/dist/coverage/coverage-final.json +15 -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 +45 -27
- package/dist/coverage/lcov-report/src/api/AuditExport.ts.html +355 -0
- 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 +212 -5
- package/dist/coverage/lcov-report/src/api/Factor.ts.html +54 -3
- 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 +78 -6
- 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 +51 -6
- package/dist/coverage/lcov-report/src/index.html +7 -7
- package/dist/coverage/lcov-report/src/request.ts.html +8 -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 +284 -124
- package/dist/index.js +4 -1
- package/dist/interfaces/response/AuditExportResponse.js +2 -0
- package/dist/interfaces/response/AuditLogResponse.js +2 -0
- package/dist/request.js +1 -0
- package/dist/types/Constants.d.ts +6 -0
- package/dist/types/api/AuditExport.d.ts +42 -0
- package/dist/types/api/AuditLog.d.ts +37 -0
- package/dist/types/api/EconomicActivity.d.ts +69 -0
- package/dist/types/api/Factor.d.ts +16 -0
- package/dist/types/api/PhysicalActivity.d.ts +76 -0
- package/dist/types/api/RealEstate.d.ts +25 -1
- package/dist/types/api/TypeRecommender.d.ts +19 -2
- package/dist/types/index.d.ts +6 -0
- package/dist/types/interfaces/Api.d.ts +17 -1
- package/dist/types/interfaces/Config.d.ts +5 -1
- package/dist/types/interfaces/common.d.ts +40 -0
- package/dist/types/interfaces/response/AuditExportResponse.d.ts +66 -0
- package/dist/types/interfaces/response/AuditLogResponse.d.ts +40 -0
- package/dist/types/interfaces/response/TypeRecommenderResponse.d.ts +2 -0
- package/docs/_sources/authentication.rst.txt +26 -4
- package/docs/_sources/getting_started.rst.txt +762 -74
- package/docs/_sources/index.rst.txt +13 -0
- package/docs/_sources/reference.rst.txt +48 -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 +77 -24
- package/docs/getting_started.html +969 -103
- package/docs/index.html +69 -21
- package/docs/reference.html +747 -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 +8 -3
- package/sphinx-build/source/authentication.rst +26 -4
- package/sphinx-build/source/getting_started.rst +762 -74
- package/sphinx-build/source/index.rst +13 -0
- package/sphinx-build/source/reference.rst +48 -0
- package/sphinx-build/source/troubleshooting.rst +77 -12
- package/src/Constants.ts +6 -0
- package/src/api/AuditExport.ts +90 -0
- package/src/api/AuditLog.ts +102 -0
- package/src/api/EconomicActivity.ts +69 -0
- package/src/api/Factor.ts +17 -1
- package/src/api/PhysicalActivity.ts +92 -0
- package/src/api/RealEstate.ts +25 -1
- package/src/api/TypeRecommender.ts +19 -2
- package/src/index.ts +15 -1
- package/src/interfaces/Api.ts +22 -6
- package/src/interfaces/Config.ts +6 -1
- package/src/interfaces/common.ts +46 -0
- package/src/interfaces/response/AuditExportResponse.ts +88 -0
- package/src/interfaces/response/AuditLogResponse.ts +47 -0
- package/src/interfaces/response/TypeRecommenderResponse.ts +3 -0
- package/src/request.ts +1 -0
- package/test/apiTest.test.ts +59 -3
- package/test/auditExport.test.ts +68 -0
- 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/_static/base-stemmer.js +0 -476
- package/docs/_static/english-stemmer.js +0 -1066
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,9 @@
|
|
|
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>
|
|
267
|
+
<li class="toctree-l2"><a class="reference internal" href="getting_started.html#finance-emissions-apis">Finance Emissions APIs</a></li>
|
|
254
268
|
</ul>
|
|
255
269
|
</li>
|
|
256
270
|
<li class="toctree-l1"><a class="reference internal" href="sdk.html">SDK</a><ul>
|
|
@@ -258,11 +272,33 @@
|
|
|
258
272
|
<li class="toctree-l2"><a class="reference internal" href="authentication.html">Authentication</a></li>
|
|
259
273
|
</ul>
|
|
260
274
|
</li>
|
|
275
|
+
<li class="toctree-l1"><a class="reference internal" href="authentication.html">Authentication</a><ul>
|
|
276
|
+
<li class="toctree-l2"><a class="reference internal" href="authentication.html#overview">Overview</a></li>
|
|
277
|
+
<li class="toctree-l2"><a class="reference internal" href="authentication.html#authentication-methods">Authentication Methods</a></li>
|
|
278
|
+
<li class="toctree-l2"><a class="reference internal" href="authentication.html#authentication-flow">Authentication Flow</a></li>
|
|
279
|
+
<li class="toctree-l2"><a class="reference internal" href="authentication.html#authentication-headers">Authentication Headers</a></li>
|
|
280
|
+
<li class="toctree-l2"><a class="reference internal" href="authentication.html#architecture-diagram">Architecture Diagram</a></li>
|
|
281
|
+
<li class="toctree-l2"><a class="reference internal" href="authentication.html#security-best-practices">Security Best Practices</a></li>
|
|
282
|
+
</ul>
|
|
283
|
+
</li>
|
|
284
|
+
<li class="toctree-l1"><a class="reference internal" href="client.html">Client</a><ul>
|
|
285
|
+
<li class="toctree-l2"><a class="reference internal" href="client.html#overview">Overview</a></li>
|
|
286
|
+
<li class="toctree-l2"><a class="reference internal" href="client.html#client-initialization">Client Initialization</a></li>
|
|
287
|
+
<li class="toctree-l2"><a class="reference internal" href="client.html#configuration-options">Configuration Options</a></li>
|
|
288
|
+
<li class="toctree-l2"><a class="reference internal" href="client.html#client-responsibilities">Client Responsibilities</a></li>
|
|
289
|
+
<li class="toctree-l2"><a class="reference internal" href="client.html#error-handling">Error Handling</a></li>
|
|
290
|
+
<li class="toctree-l2"><a class="reference internal" href="client.html#best-practices">Best Practices</a></li>
|
|
291
|
+
<li class="toctree-l2"><a class="reference internal" href="client.html#authentication-integration">Authentication Integration</a></li>
|
|
292
|
+
</ul>
|
|
293
|
+
</li>
|
|
261
294
|
<li class="toctree-l1"><a class="reference internal" href="reference.html">Reference</a><ul>
|
|
262
295
|
<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
296
|
<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
297
|
<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
298
|
<li class="toctree-l2"><a class="reference internal" href="reference.html#api">API</a></li>
|
|
299
|
+
<li class="toctree-l2"><a class="reference internal" href="reference.html#type-recommender-api">Type Recommender API</a></li>
|
|
300
|
+
<li class="toctree-l2"><a class="reference internal" href="reference.html#audit-log-api">Audit Log API</a></li>
|
|
301
|
+
<li class="toctree-l2"><a class="reference internal" href="reference.html#audit-export-api">Audit Export API</a></li>
|
|
266
302
|
<li class="toctree-l2"><a class="reference internal" href="reference.html#global-metadata-api">Global Metadata API</a></li>
|
|
267
303
|
<li class="toctree-l2"><a class="reference internal" href="reference.html#usage-api">Usage API</a></li>
|
|
268
304
|
<li class="toctree-l2"><a class="reference internal" href="reference.html#interfaces">Interfaces</a></li>
|
|
@@ -298,10 +334,22 @@
|
|
|
298
334
|
<li><p><strong>Transportation & distribution</strong> – logistics and supply chain activities</p></li>
|
|
299
335
|
<li><p><strong>Real Estate</strong> – emissions from commercial and residential properties</p></li>
|
|
300
336
|
<li><p><strong>Economic Activity</strong> – spend-based emissions from business activities</p></li>
|
|
337
|
+
<li><p><strong>Physical Activity</strong> – scope 3 emissions from physical activities with attribution for private companies (equity/debt or EVIC-based)</p></li>
|
|
301
338
|
<li><p><strong>Generic</strong> – custom emission calculations</p></li>
|
|
302
339
|
</ul>
|
|
303
340
|
<p>The SDK is designed for embedding emission calculations in applications, building sustainability dashboards, automating large-scale datasets, and tracking carbon footprints.</p>
|
|
304
341
|
</section>
|
|
342
|
+
<section id="additional-capabilities">
|
|
343
|
+
<h2>Additional capabilities<a class="headerlink" href="#additional-capabilities" title="Link to this heading">¶</a></h2>
|
|
344
|
+
<ul class="simple">
|
|
345
|
+
<li><p><strong>Metadata API</strong> – query supported types, areas, and units across endpoints</p></li>
|
|
346
|
+
<li><p><strong>Type Recommender API</strong> – semantic search to identify likely activity types, with optional reranker control and scope in results</p></li>
|
|
347
|
+
<li><p><strong>Factor Search API</strong> – search for emission factors with unit and scope filtering, with optional reranker control</p></li>
|
|
348
|
+
<li><p><strong>Usage API</strong> – retrieve organization billing-period or historical usage</p></li>
|
|
349
|
+
<li><p><strong>Audit Log API</strong> – manage whether API requests and responses are stored for auditing</p></li>
|
|
350
|
+
<li><p><strong>Audit Export API</strong> – export, monitor, and download organization audit data</p></li>
|
|
351
|
+
</ul>
|
|
352
|
+
</section>
|
|
305
353
|
</section>
|
|
306
354
|
|
|
307
355
|
</article>
|
|
@@ -344,8 +392,8 @@
|
|
|
344
392
|
</aside>
|
|
345
393
|
</div>
|
|
346
394
|
</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=
|
|
395
|
+
<script src="_static/doctools.js?v=9bcbadda"></script>
|
|
396
|
+
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
|
|
349
397
|
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
|
|
350
398
|
</body>
|
|
351
399
|
</html>
|