emissions-api-sdk 1.0.13 → 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 +23 -0
- package/dist/Constants.js +4 -1
- package/dist/api/AuditExport.js +73 -0
- package/dist/api/EconomicActivity.js +45 -0
- package/dist/api/Factor.js +1 -4
- package/dist/api/RealEstate.js +2 -1
- package/dist/coverage/clover.xml +75 -54
- package/dist/coverage/coverage-final.json +8 -7
- package/dist/coverage/lcov-report/index.html +15 -15
- package/dist/coverage/lcov-report/src/Client.ts.html +6 -6
- package/dist/coverage/lcov-report/src/Constants.ts.html +39 -30
- package/dist/coverage/lcov-report/src/api/AuditExport.ts.html +355 -0
- package/dist/coverage/lcov-report/src/api/AuditLog.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/Calculation.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/EconomicActivity.ts.html +137 -2
- package/dist/coverage/lcov-report/src/api/Factor.ts.html +6 -12
- 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 +1 -1
- package/dist/coverage/lcov-report/src/api/RealEstate.ts.html +6 -3
- 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 +1 -1
- package/dist/coverage/lcov-report/src/api/Usage.ts.html +1 -1
- package/dist/coverage/lcov-report/src/api/index.html +19 -4
- 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 +2 -2
- package/dist/coverage/lcov-report/test/index.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/AttributionRequest.ts.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/CommonRequest.ts.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/EconomicActivityAttributionRequest.ts.html +1 -1
- 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 +1 -1
- package/dist/coverage/lcov-report/test/mocks/PhysicalActivityRequest.ts.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/SearchRequest.ts.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/index.html +1 -1
- package/dist/coverage/lcov-report/test/testUtils.ts.html +1 -1
- package/dist/coverage/lcov.info +86 -53
- package/dist/index.js +2 -1
- package/dist/interfaces/response/AuditExportResponse.js +2 -0
- package/dist/request.js +1 -0
- package/dist/types/Constants.d.ts +3 -0
- package/dist/types/api/AuditExport.d.ts +42 -0
- package/dist/types/api/EconomicActivity.d.ts +45 -0
- package/dist/types/api/Factor.d.ts +1 -4
- package/dist/types/api/RealEstate.d.ts +2 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/interfaces/Config.d.ts +5 -1
- package/dist/types/interfaces/response/AuditExportResponse.d.ts +66 -0
- package/dist/types/interfaces/response/TypeRecommenderResponse.d.ts +1 -0
- package/docs/_sources/getting_started.rst.txt +226 -2
- package/docs/_sources/index.rst.txt +2 -0
- package/docs/_sources/reference.rst.txt +22 -0
- package/docs/genindex.html +27 -3
- package/docs/getting_started.html +226 -2
- package/docs/index.html +4 -0
- package/docs/reference.html +267 -4
- package/docs/searchindex.js +1 -1
- package/package.json +6 -5
- package/sphinx-build/source/getting_started.rst +226 -2
- package/sphinx-build/source/index.rst +2 -0
- package/sphinx-build/source/reference.rst +22 -0
- package/src/Constants.ts +3 -0
- package/src/api/AuditExport.ts +90 -0
- package/src/api/EconomicActivity.ts +45 -0
- package/src/api/Factor.ts +2 -5
- package/src/api/RealEstate.ts +2 -1
- package/src/index.ts +9 -1
- package/src/interfaces/Config.ts +6 -1
- package/src/interfaces/response/AuditExportResponse.ts +88 -0
- package/src/interfaces/response/TypeRecommenderResponse.ts +1 -0
- package/src/request.ts +1 -0
- package/test/auditExport.test.ts +68 -0
- package/docs/_static/base-stemmer.js +0 -476
- package/docs/_static/english-stemmer.js +0 -1066
|
@@ -14,6 +14,9 @@ export declare const ECONOMIC_ACTIVITY_API_PATH = "/v3/carbon/economic-activity"
|
|
|
14
14
|
export declare const REAL_ESTATE_API_PATH = "/v3/carbon/real-estate";
|
|
15
15
|
export declare const PHYSICAL_ACTIVITY_API_PATH = "/v3/carbon/physical-activity";
|
|
16
16
|
export declare const AUDIT_LOG_API_PATH = "/v3/carbon/admin/audit-log";
|
|
17
|
+
export declare const AUDIT_EXPORT_API_PATH = "/v3/carbon/audit";
|
|
18
|
+
export declare const AUDIT_EXPORT_STATUS_API_PATH = "/v3/carbon/audit/status";
|
|
19
|
+
export declare const AUDIT_EXPORT_DOWNLOAD_API_PATH = "/v3/carbon/audit/download";
|
|
17
20
|
export declare const TYPE_RECOMMENDER_API_PATH = "/v3/carbon/recommender/type/search";
|
|
18
21
|
export declare const USAGE_API = "/v3/carbon/usage";
|
|
19
22
|
export declare const METADATA_TYPES_ENDPOINT = "/v3/carbon/metadata/types";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
import { AuditExportRequest, AuditExportResponse, AuditExportStatusResponse } from "../interfaces/response/AuditExportResponse";
|
|
3
|
+
/**
|
|
4
|
+
* Triggers an asynchronous audit data export.
|
|
5
|
+
*
|
|
6
|
+
* @export
|
|
7
|
+
* @param {AuditExportRequest} payload - Date range and optional API-name filter for the export
|
|
8
|
+
* @return {Promise<AuditExportResponse>} The accepted export request, including its request ID
|
|
9
|
+
* @throws {Error} Throws if the request is invalid, the caller is not an admin, or a matching export already exists
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const auditExport = await trigger({
|
|
13
|
+
* fromDate: "2025-01-01",
|
|
14
|
+
* toDate: "2025-03-31",
|
|
15
|
+
* apiName: "location"
|
|
16
|
+
* });
|
|
17
|
+
*/
|
|
18
|
+
export declare function trigger(payload: AuditExportRequest): Promise<AuditExportResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Retrieves the processing status of an audit export.
|
|
21
|
+
*
|
|
22
|
+
* @export
|
|
23
|
+
* @param {string} requestId - Request ID returned by trigger
|
|
24
|
+
* @return {Promise<AuditExportStatusResponse>} Current export status and, when complete, download details
|
|
25
|
+
* @throws {Error} Throws if the request ID is invalid or the caller is not an admin
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* const status = await getStatus(auditExport.requestId);
|
|
29
|
+
*/
|
|
30
|
+
export declare function getStatus(requestId: string): Promise<AuditExportStatusResponse>;
|
|
31
|
+
/**
|
|
32
|
+
* Downloads a completed audit export as a ZIP archive.
|
|
33
|
+
*
|
|
34
|
+
* @export
|
|
35
|
+
* @param {string} requestId - Request ID returned by trigger
|
|
36
|
+
* @return {Promise<Buffer>} ZIP archive containing audit-export.csv
|
|
37
|
+
* @throws {Error} Throws while processing, when the export failed or expired, or if the caller is not an admin
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* const auditExportZip = await download(auditExport.requestId);
|
|
41
|
+
*/
|
|
42
|
+
export declare function download(requestId: string): Promise<Buffer>;
|
|
@@ -49,5 +49,50 @@ import { EmissionResponseWithDetails } from "../interfaces/response/EmissionResp
|
|
|
49
49
|
"includeDetails": true
|
|
50
50
|
};
|
|
51
51
|
* const resultWithAttribution = await calculate(requestWithAttribution);
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* // Economic activity request with attribution (equity/debt based for private companies)
|
|
55
|
+
* const requestWithEquityDebt = {
|
|
56
|
+
"time": {
|
|
57
|
+
"date": "2025-01-04"
|
|
58
|
+
},
|
|
59
|
+
"location": {
|
|
60
|
+
"country": "usa"
|
|
61
|
+
},
|
|
62
|
+
"activity": {
|
|
63
|
+
"type": "accomodation",
|
|
64
|
+
"value": 1500.12,
|
|
65
|
+
"unit": "usd"
|
|
66
|
+
},
|
|
67
|
+
"attribution": {
|
|
68
|
+
"outstandingAmount": 500000.0,
|
|
69
|
+
"totalEquity": 3000000.0,
|
|
70
|
+
"totalDebt": 2000000.0
|
|
71
|
+
},
|
|
72
|
+
"includeDetails": true
|
|
73
|
+
};
|
|
74
|
+
* const resultWithEquityDebt = await calculate(requestWithEquityDebt);
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* // Economic activity request with attribution (EVIC based for listed companies)
|
|
78
|
+
* const requestWithEvic = {
|
|
79
|
+
"time": {
|
|
80
|
+
"date": "2025-01-04"
|
|
81
|
+
},
|
|
82
|
+
"location": {
|
|
83
|
+
"country": "usa"
|
|
84
|
+
},
|
|
85
|
+
"activity": {
|
|
86
|
+
"type": "accomodation",
|
|
87
|
+
"value": 1500.12,
|
|
88
|
+
"unit": "usd"
|
|
89
|
+
},
|
|
90
|
+
"attribution": {
|
|
91
|
+
"outstandingAmount": 500000.0,
|
|
92
|
+
"evic": 10000000.0
|
|
93
|
+
},
|
|
94
|
+
"includeDetails": true
|
|
95
|
+
};
|
|
96
|
+
* const resultWithEvic = await calculate(requestWithEvic);
|
|
52
97
|
*/
|
|
53
98
|
export declare function calculate(payload: CommonRequest): Promise<EmissionResponse | EmissionResponseWithDetails>;
|
|
@@ -63,11 +63,8 @@ export declare function retrieveFactor(payload: FactorRequest): Promise<FactorRe
|
|
|
63
63
|
* @example
|
|
64
64
|
* // Search without cross-encoder reranking
|
|
65
65
|
* const searchWithoutReranker = {
|
|
66
|
-
"time":{
|
|
67
|
-
"date": "2020-06-10"
|
|
68
|
-
},
|
|
69
66
|
"activity": {
|
|
70
|
-
"search"
|
|
67
|
+
"search": "travel"
|
|
71
68
|
},
|
|
72
69
|
"location": {
|
|
73
70
|
"country": "USA"
|
|
@@ -48,5 +48,6 @@ import { EmissionResponseWithDetails } from "../interfaces/response/EmissionResp
|
|
|
48
48
|
},
|
|
49
49
|
"includeDetails": true
|
|
50
50
|
};
|
|
51
|
-
|
|
51
|
+
* const resultWithAttribution = await calculate(requestWithAttribution);
|
|
52
|
+
*/
|
|
52
53
|
export declare function calculate(payload: CommonRequest): Promise<EmissionResponse | EmissionResponseWithDetails>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * as PhysicalActivity from './api/PhysicalActivity';
|
|
|
14
14
|
export * as Metadata from './api/Metadata';
|
|
15
15
|
export * as TypeRecommender from './api/TypeRecommender';
|
|
16
16
|
export * as AuditLog from './api/AuditLog';
|
|
17
|
+
export * as AuditExport from './api/AuditExport';
|
|
17
18
|
export { ClientConfig } from './interfaces/Config';
|
|
18
19
|
export { Attribution } from './interfaces/common';
|
|
19
20
|
export { AreaResponse, Location as LocationInfo } from './interfaces/response/AreaResponse';
|
|
@@ -27,3 +28,4 @@ export { UnitResponse } from './interfaces/response/UnitResponse';
|
|
|
27
28
|
export { UsageResponse } from './interfaces/response/UsageResponse';
|
|
28
29
|
export { TypeRecommenderResponse, ActivityRequest } from './interfaces/response/TypeRecommenderResponse';
|
|
29
30
|
export { AuditLogResponse, AuditLogRequest } from './interfaces/response/AuditLogResponse';
|
|
31
|
+
export { AuditExportRequest, AuditExportResponse, AuditExportStatus, AuditExportStatusResponse, AuditExportLinks } from './interfaces/response/AuditExportResponse';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Method } from "axios";
|
|
1
|
+
import { Method, ResponseType } from "axios";
|
|
2
2
|
/**
|
|
3
3
|
* Configuration for making HTTP requests.
|
|
4
4
|
* @interface RequestConfig
|
|
@@ -24,6 +24,10 @@ export interface RequestConfig {
|
|
|
24
24
|
* Optional HTTP headers to be included with the request.
|
|
25
25
|
*/
|
|
26
26
|
headers?: Record<string, string>;
|
|
27
|
+
/**
|
|
28
|
+
* Optional response type expected from the API.
|
|
29
|
+
*/
|
|
30
|
+
responseType?: ResponseType;
|
|
27
31
|
}
|
|
28
32
|
/**
|
|
29
33
|
* Configuration for initializing a client instance.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request body used to trigger an audit data export.
|
|
3
|
+
*
|
|
4
|
+
* @interface AuditExportRequest
|
|
5
|
+
*/
|
|
6
|
+
export interface AuditExportRequest {
|
|
7
|
+
/** Inclusive start date in yyyy-MM-dd format. */
|
|
8
|
+
fromDate: string;
|
|
9
|
+
/** Inclusive end date in yyyy-MM-dd format. */
|
|
10
|
+
toDate: string;
|
|
11
|
+
/** Optional case-insensitive endpoint filter. */
|
|
12
|
+
apiName?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Processing states for an audit export.
|
|
16
|
+
*/
|
|
17
|
+
export type AuditExportStatus = "QUEUED" | "IN_PROGRESS" | "COMPLETED" | "FAILED" | "EXPIRED";
|
|
18
|
+
/**
|
|
19
|
+
* Follow-up links returned by the audit export API.
|
|
20
|
+
*
|
|
21
|
+
* @interface AuditExportLinks
|
|
22
|
+
*/
|
|
23
|
+
export interface AuditExportLinks {
|
|
24
|
+
/** URL for retrieving the export status. */
|
|
25
|
+
status?: string;
|
|
26
|
+
/** URL for downloading a completed export. */
|
|
27
|
+
download?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Response returned when an audit export is accepted.
|
|
31
|
+
*
|
|
32
|
+
* @interface AuditExportResponse
|
|
33
|
+
*/
|
|
34
|
+
export interface AuditExportResponse {
|
|
35
|
+
/** Unique identifier used to retrieve the export status and download. */
|
|
36
|
+
requestId: string;
|
|
37
|
+
/** Current processing state. A newly accepted export is QUEUED. */
|
|
38
|
+
status: AuditExportStatus;
|
|
39
|
+
/** Human-readable result message. */
|
|
40
|
+
message?: string;
|
|
41
|
+
/** ISO-8601 timestamp for when the export was submitted. */
|
|
42
|
+
submittedAt?: string;
|
|
43
|
+
/** Links for retrieving the export status and download. */
|
|
44
|
+
links?: AuditExportLinks;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Response returned when checking an audit export's status.
|
|
48
|
+
*
|
|
49
|
+
* @interface AuditExportStatusResponse
|
|
50
|
+
*/
|
|
51
|
+
export interface AuditExportStatusResponse {
|
|
52
|
+
/** Unique identifier returned when the export was triggered. */
|
|
53
|
+
requestId: string;
|
|
54
|
+
/** Current processing state. */
|
|
55
|
+
status: AuditExportStatus;
|
|
56
|
+
/** ISO-8601 timestamp for when the export was submitted. */
|
|
57
|
+
submittedAt?: string;
|
|
58
|
+
/** ISO-8601 timestamp for when processing completed. */
|
|
59
|
+
completedAt?: string;
|
|
60
|
+
/** ISO-8601 timestamp after which the completed export is unavailable. */
|
|
61
|
+
expiresAt?: string;
|
|
62
|
+
/** Download link when the export is completed. */
|
|
63
|
+
links?: Pick<AuditExportLinks, "download">;
|
|
64
|
+
/** Human-readable failure or expiry message. */
|
|
65
|
+
message?: string;
|
|
66
|
+
}
|
|
@@ -248,8 +248,7 @@ The SDK supports automatic currency conversion for API methods that accept monet
|
|
|
248
248
|
Currency conversion is available for the following calculation methods:
|
|
249
249
|
|
|
250
250
|
- ``EconomicActivity.calculate()``
|
|
251
|
-
- ``
|
|
252
|
-
- ``PhysicalActivity.calculate()``
|
|
251
|
+
- ``Calculation.calculate()``
|
|
253
252
|
|
|
254
253
|
Supported Currencies
|
|
255
254
|
~~~~~~~~~~~~~~~~~~~~
|
|
@@ -626,3 +625,228 @@ The exchange rate database is automatically synchronized with the Treasury API t
|
|
|
626
625
|
|
|
627
626
|
|
|
628
627
|
- ``source``: Source citation and license information
|
|
628
|
+
|
|
629
|
+
Finance Emissions APIs
|
|
630
|
+
----------------------
|
|
631
|
+
|
|
632
|
+
The SDK supports three scope 3 finance-based emission APIs: **Real Estate**, **Physical Activity**, and **Economic Activity**. Each supports optional PCAF attribution to proportionally allocate emissions.
|
|
633
|
+
|
|
634
|
+
Real Estate
|
|
635
|
+
~~~~~~~~~~~
|
|
636
|
+
|
|
637
|
+
Real Estate calculates scope 3 emissions from commercial and residential property. Attribution uses ``propertyValue`` to compute an attribution factor.
|
|
638
|
+
|
|
639
|
+
**Without attribution:**
|
|
640
|
+
|
|
641
|
+
.. code-block:: javascript
|
|
642
|
+
|
|
643
|
+
const result = await RealEstate.calculate({
|
|
644
|
+
"time": { "date": "2022-01-01" },
|
|
645
|
+
"location": { "country": "usa", "stateProvince": "new york" },
|
|
646
|
+
"activity": {
|
|
647
|
+
"type": "Commercial Real Estate:Office",
|
|
648
|
+
"value": 123456.0,
|
|
649
|
+
"unit": "m2"
|
|
650
|
+
},
|
|
651
|
+
"includeDetails": false
|
|
652
|
+
});
|
|
653
|
+
|
|
654
|
+
**With attribution (property value based):**
|
|
655
|
+
|
|
656
|
+
.. code-block:: javascript
|
|
657
|
+
|
|
658
|
+
const result = await RealEstate.calculate({
|
|
659
|
+
"time": { "date": "2022-01-01" },
|
|
660
|
+
"location": { "country": "usa", "stateProvince": "new york" },
|
|
661
|
+
"activity": {
|
|
662
|
+
"type": "Commercial Real Estate:Office",
|
|
663
|
+
"value": 123456.0,
|
|
664
|
+
"unit": "m2"
|
|
665
|
+
},
|
|
666
|
+
"attribution": {
|
|
667
|
+
"outstandingAmount": 1000000.0,
|
|
668
|
+
"propertyValue": 5000000.0
|
|
669
|
+
},
|
|
670
|
+
"includeDetails": true
|
|
671
|
+
});
|
|
672
|
+
|
|
673
|
+
.. note::
|
|
674
|
+
|
|
675
|
+
Real estate attribution only accepts ``propertyValue``. Using ``totalEquity``, ``totalDebt``, ``evic``, or ``revenue`` will result in a 400 error.
|
|
676
|
+
|
|
677
|
+
Physical Activity
|
|
678
|
+
~~~~~~~~~~~~~~~~~
|
|
679
|
+
|
|
680
|
+
Physical Activity calculates scope 3 emissions from physical activities. Attribution supports two methods: equity/debt for private companies, or EVIC for listed companies.
|
|
681
|
+
|
|
682
|
+
**Without attribution:**
|
|
683
|
+
|
|
684
|
+
.. code-block:: javascript
|
|
685
|
+
|
|
686
|
+
const result = await PhysicalActivity.calculate({
|
|
687
|
+
"time": { "date": "2022-01-01" },
|
|
688
|
+
"location": { "country": "usa", "stateProvince": "new york" },
|
|
689
|
+
"activity": {
|
|
690
|
+
"type": "Physical Activity Type",
|
|
691
|
+
"value": 123456.0,
|
|
692
|
+
"unit": "kg"
|
|
693
|
+
},
|
|
694
|
+
"includeDetails": false
|
|
695
|
+
});
|
|
696
|
+
|
|
697
|
+
**With attribution (equity/debt — private companies):**
|
|
698
|
+
|
|
699
|
+
.. code-block:: javascript
|
|
700
|
+
|
|
701
|
+
const result = await PhysicalActivity.calculate({
|
|
702
|
+
"time": { "date": "2022-01-01" },
|
|
703
|
+
"location": { "country": "usa", "stateProvince": "new york" },
|
|
704
|
+
"activity": {
|
|
705
|
+
"type": "Physical Activity Type",
|
|
706
|
+
"value": 123456.0,
|
|
707
|
+
"unit": "kg"
|
|
708
|
+
},
|
|
709
|
+
"attribution": {
|
|
710
|
+
"outstandingAmount": 1000000.0,
|
|
711
|
+
"totalEquity": 3000000.0,
|
|
712
|
+
"totalDebt": 2000000.0
|
|
713
|
+
},
|
|
714
|
+
"includeDetails": true
|
|
715
|
+
});
|
|
716
|
+
|
|
717
|
+
**With attribution (EVIC — listed companies):**
|
|
718
|
+
|
|
719
|
+
.. code-block:: javascript
|
|
720
|
+
|
|
721
|
+
const result = await PhysicalActivity.calculate({
|
|
722
|
+
"time": { "date": "2022-01-01" },
|
|
723
|
+
"location": { "country": "usa", "stateProvince": "new york" },
|
|
724
|
+
"activity": {
|
|
725
|
+
"type": "Physical Activity Type",
|
|
726
|
+
"value": 123456.0,
|
|
727
|
+
"unit": "kg"
|
|
728
|
+
},
|
|
729
|
+
"attribution": {
|
|
730
|
+
"outstandingAmount": 1000000.0,
|
|
731
|
+
"evic": 10000000.0
|
|
732
|
+
},
|
|
733
|
+
"includeDetails": true
|
|
734
|
+
});
|
|
735
|
+
|
|
736
|
+
.. note::
|
|
737
|
+
|
|
738
|
+
Physical activity attribution does not accept ``propertyValue`` or ``revenue``. Use ``totalEquity + totalDebt`` for private companies, or ``evic`` for listed companies — not both.
|
|
739
|
+
|
|
740
|
+
Economic Activity
|
|
741
|
+
~~~~~~~~~~~~~~~~~
|
|
742
|
+
|
|
743
|
+
Economic Activity calculates scope 3 spend-based emissions. Attribution supports equity/debt, EVIC, or revenue-based allocation.
|
|
744
|
+
|
|
745
|
+
**Without attribution:**
|
|
746
|
+
|
|
747
|
+
.. code-block:: javascript
|
|
748
|
+
|
|
749
|
+
const result = await EconomicActivity.calculate({
|
|
750
|
+
"time": { "date": "2022-01-01" },
|
|
751
|
+
"location": { "country": "usa", "stateProvince": "new york" },
|
|
752
|
+
"activity": {
|
|
753
|
+
"type": "Accomodation",
|
|
754
|
+
"value": 123456.0,
|
|
755
|
+
"unit": "usd"
|
|
756
|
+
},
|
|
757
|
+
"includeDetails": false
|
|
758
|
+
});
|
|
759
|
+
|
|
760
|
+
**With attribution (revenue based):**
|
|
761
|
+
|
|
762
|
+
.. code-block:: javascript
|
|
763
|
+
|
|
764
|
+
const result = await EconomicActivity.calculate({
|
|
765
|
+
"time": { "date": "2025-01-04" },
|
|
766
|
+
"location": { "country": "usa" },
|
|
767
|
+
"activity": {
|
|
768
|
+
"type": "accomodation",
|
|
769
|
+
"value": 1500.12,
|
|
770
|
+
"unit": "usd"
|
|
771
|
+
},
|
|
772
|
+
"attribution": {
|
|
773
|
+
"outstandingAmount": 500000.0,
|
|
774
|
+
"revenue": 2000000.0
|
|
775
|
+
},
|
|
776
|
+
"includeDetails": true
|
|
777
|
+
});
|
|
778
|
+
|
|
779
|
+
**With attribution (equity/debt — private companies):**
|
|
780
|
+
|
|
781
|
+
.. code-block:: javascript
|
|
782
|
+
|
|
783
|
+
const result = await EconomicActivity.calculate({
|
|
784
|
+
"time": { "date": "2025-01-04" },
|
|
785
|
+
"location": { "country": "usa" },
|
|
786
|
+
"activity": {
|
|
787
|
+
"type": "accomodation",
|
|
788
|
+
"value": 1500.12,
|
|
789
|
+
"unit": "usd"
|
|
790
|
+
},
|
|
791
|
+
"attribution": {
|
|
792
|
+
"outstandingAmount": 500000.0,
|
|
793
|
+
"totalEquity": 3000000.0,
|
|
794
|
+
"totalDebt": 2000000.0
|
|
795
|
+
},
|
|
796
|
+
"includeDetails": true
|
|
797
|
+
});
|
|
798
|
+
|
|
799
|
+
**With attribution (EVIC — listed companies):**
|
|
800
|
+
|
|
801
|
+
.. code-block:: javascript
|
|
802
|
+
|
|
803
|
+
const result = await EconomicActivity.calculate({
|
|
804
|
+
"time": { "date": "2025-01-04" },
|
|
805
|
+
"location": { "country": "usa" },
|
|
806
|
+
"activity": {
|
|
807
|
+
"type": "accomodation",
|
|
808
|
+
"value": 1500.12,
|
|
809
|
+
"unit": "usd"
|
|
810
|
+
},
|
|
811
|
+
"attribution": {
|
|
812
|
+
"outstandingAmount": 500000.0,
|
|
813
|
+
"evic": 10000000.0
|
|
814
|
+
},
|
|
815
|
+
"includeDetails": true
|
|
816
|
+
});
|
|
817
|
+
|
|
818
|
+
.. note::
|
|
819
|
+
|
|
820
|
+
``propertyValue`` is not supported for economic activity. ``totalEquity`` and ``totalDebt`` must always be provided together.
|
|
821
|
+
|
|
822
|
+
Attribution Summary
|
|
823
|
+
~~~~~~~~~~~~~~~~~~~
|
|
824
|
+
|
|
825
|
+
.. list-table::
|
|
826
|
+
:header-rows: 1
|
|
827
|
+
:widths: 30 14 20 12 12 12
|
|
828
|
+
|
|
829
|
+
* - API
|
|
830
|
+
- ``propertyValue``
|
|
831
|
+
- ``totalEquity`` + ``totalDebt``
|
|
832
|
+
- ``evic``
|
|
833
|
+
- ``revenue``
|
|
834
|
+
- ``outstandingAmount``
|
|
835
|
+
* - Real Estate
|
|
836
|
+
- ✓
|
|
837
|
+
- ✗
|
|
838
|
+
- ✗
|
|
839
|
+
- ✗
|
|
840
|
+
- Required
|
|
841
|
+
* - Physical Activity
|
|
842
|
+
- ✗
|
|
843
|
+
- ✓
|
|
844
|
+
- ✓
|
|
845
|
+
- ✗
|
|
846
|
+
- Required
|
|
847
|
+
* - Economic Activity
|
|
848
|
+
- ✗
|
|
849
|
+
- ✓
|
|
850
|
+
- ✓
|
|
851
|
+
- ✓
|
|
852
|
+
- Required
|
|
@@ -29,6 +29,7 @@ Supported Emission Types
|
|
|
29
29
|
* **Transportation & distribution** – logistics and supply chain activities
|
|
30
30
|
* **Real Estate** – emissions from commercial and residential properties
|
|
31
31
|
* **Economic Activity** – spend-based emissions from business activities
|
|
32
|
+
* **Physical Activity** – scope 3 emissions from physical activities with attribution for private companies (equity/debt or EVIC-based)
|
|
32
33
|
* **Generic** – custom emission calculations
|
|
33
34
|
|
|
34
35
|
The SDK is designed for embedding emission calculations in applications, building sustainability dashboards, automating large-scale datasets, and tracking carbon footprints.
|
|
@@ -41,3 +42,4 @@ Additional capabilities
|
|
|
41
42
|
* **Factor Search API** – search for emission factors with unit and scope filtering, with optional reranker control
|
|
42
43
|
* **Usage API** – retrieve organization billing-period or historical usage
|
|
43
44
|
* **Audit Log API** – manage whether API requests and responses are stored for auditing
|
|
45
|
+
* **Audit Export API** – export, monitor, and download organization audit data
|
|
@@ -32,6 +32,8 @@ API
|
|
|
32
32
|
.. js:autofunction:: RealEstate.calculate
|
|
33
33
|
|
|
34
34
|
.. js:autofunction:: EconomicActivity.calculate
|
|
35
|
+
|
|
36
|
+
.. js:autofunction:: PhysicalActivity.calculate
|
|
35
37
|
|
|
36
38
|
Type Recommender API
|
|
37
39
|
====================
|
|
@@ -50,6 +52,18 @@ Organizations can disable storage if they don't need their API calls to be audit
|
|
|
50
52
|
.. js:autofunction:: AuditLog.updateAuditConfig
|
|
51
53
|
|
|
52
54
|
|
|
55
|
+
Audit Export API
|
|
56
|
+
================
|
|
57
|
+
|
|
58
|
+
The Audit Export API asynchronously generates an audit-data ZIP archive for an admin user. Call ``trigger`` to create an export, ``getStatus`` until it is complete, and ``download`` to retrieve the archive.
|
|
59
|
+
|
|
60
|
+
.. js:autofunction:: AuditExport.trigger
|
|
61
|
+
|
|
62
|
+
.. js:autofunction:: AuditExport.getStatus
|
|
63
|
+
|
|
64
|
+
.. js:autofunction:: AuditExport.download
|
|
65
|
+
|
|
66
|
+
|
|
53
67
|
Global Metadata API
|
|
54
68
|
====================
|
|
55
69
|
|
|
@@ -139,3 +153,11 @@ Interfaces
|
|
|
139
153
|
.. js:autoclass:: TypeRecommenderResponse.TypeRecommenderResponse
|
|
140
154
|
|
|
141
155
|
.. js:autoclass:: TypeRecommenderResponse.ActivityRequest
|
|
156
|
+
|
|
157
|
+
.. js:autoclass:: AuditExportResponse.AuditExportRequest
|
|
158
|
+
|
|
159
|
+
.. js:autoclass:: AuditExportResponse.AuditExportResponse
|
|
160
|
+
|
|
161
|
+
.. js:autoclass:: AuditExportResponse.AuditExportStatusResponse
|
|
162
|
+
|
|
163
|
+
.. js:autoclass:: AuditExportResponse.AuditExportLinks
|
package/docs/genindex.html
CHANGED
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
|
|
247
247
|
<section class="genindex-section">
|
|
248
248
|
<h1 id="index">Index</h1>
|
|
249
|
-
<div class="genindex-jumpbox"><a href="#A"><strong>A</strong></a> | <a href="#C"><strong>C</strong></a> | <a href="#E"><strong>E</strong></a> | <a href="#F"><strong>F</strong></a> | <a href="#L"><strong>L</strong></a> | <a href="#M"><strong>M</strong></a> | <a href="#R"><strong>R</strong></a> | <a href="#S"><strong>S</strong></a> | <a href="#T"><strong>T</strong></a> | <a href="#U"><strong>U</strong></a></div>
|
|
249
|
+
<div class="genindex-jumpbox"><a href="#A"><strong>A</strong></a> | <a href="#C"><strong>C</strong></a> | <a href="#E"><strong>E</strong></a> | <a href="#F"><strong>F</strong></a> | <a href="#L"><strong>L</strong></a> | <a href="#M"><strong>M</strong></a> | <a href="#P"><strong>P</strong></a> | <a href="#R"><strong>R</strong></a> | <a href="#S"><strong>S</strong></a> | <a href="#T"><strong>T</strong></a> | <a href="#U"><strong>U</strong></a></div>
|
|
250
250
|
</section>
|
|
251
251
|
<section id="A" class="genindex-section">
|
|
252
252
|
<h2>A</h2>
|
|
@@ -264,13 +264,27 @@
|
|
|
264
264
|
</li>
|
|
265
265
|
<li><a href="reference.html#Api.GenericCalculationRequestWithoutFactorId">Api.GenericCalculationRequestWithoutFactorId() (interface)</a>
|
|
266
266
|
</li>
|
|
267
|
-
</ul></td>
|
|
268
|
-
<td style="width: 33%; vertical-align: top;"><ul>
|
|
269
267
|
<li><a href="reference.html#Api.LocationRequestWithFactorId">Api.LocationRequestWithFactorId() (interface)</a>
|
|
270
268
|
</li>
|
|
271
269
|
<li><a href="reference.html#Api.LocationRequestWithoutFactorId">Api.LocationRequestWithoutFactorId() (interface)</a>
|
|
272
270
|
</li>
|
|
273
271
|
<li><a href="reference.html#Api.SearchRequest">Api.SearchRequest() (interface)</a>
|
|
272
|
+
</li>
|
|
273
|
+
<li><a href="reference.html#AuditExport.download">AuditExport.download() (AuditExport method)</a>
|
|
274
|
+
</li>
|
|
275
|
+
</ul></td>
|
|
276
|
+
<td style="width: 33%; vertical-align: top;"><ul>
|
|
277
|
+
<li><a href="reference.html#AuditExport.getStatus">AuditExport.getStatus() (AuditExport method)</a>
|
|
278
|
+
</li>
|
|
279
|
+
<li><a href="reference.html#AuditExport.trigger">AuditExport.trigger() (AuditExport method)</a>
|
|
280
|
+
</li>
|
|
281
|
+
<li><a href="reference.html#AuditExportResponse.AuditExportLinks">AuditExportResponse.AuditExportLinks() (interface)</a>
|
|
282
|
+
</li>
|
|
283
|
+
<li><a href="reference.html#AuditExportResponse.AuditExportRequest">AuditExportResponse.AuditExportRequest() (interface)</a>
|
|
284
|
+
</li>
|
|
285
|
+
<li><a href="reference.html#AuditExportResponse.AuditExportResponse">AuditExportResponse.AuditExportResponse() (interface)</a>
|
|
286
|
+
</li>
|
|
287
|
+
<li><a href="reference.html#AuditExportResponse.AuditExportStatusResponse">AuditExportResponse.AuditExportStatusResponse() (interface)</a>
|
|
274
288
|
</li>
|
|
275
289
|
<li><a href="reference.html#AuditLog.getAuditConfig">AuditLog.getAuditConfig() (AuditLog method)</a>
|
|
276
290
|
</li>
|
|
@@ -396,6 +410,16 @@
|
|
|
396
410
|
</tr></table>
|
|
397
411
|
</section>
|
|
398
412
|
|
|
413
|
+
<section id="P" class="genindex-section">
|
|
414
|
+
<h2>P</h2>
|
|
415
|
+
<table style="width: 100%" class="indextable genindextable"><tr>
|
|
416
|
+
<td style="width: 33%; vertical-align: top;"><ul>
|
|
417
|
+
<li><a href="reference.html#PhysicalActivity.calculate">PhysicalActivity.calculate() (PhysicalActivity method)</a>
|
|
418
|
+
</li>
|
|
419
|
+
</ul></td>
|
|
420
|
+
</tr></table>
|
|
421
|
+
</section>
|
|
422
|
+
|
|
399
423
|
<section id="R" class="genindex-section">
|
|
400
424
|
<h2>R</h2>
|
|
401
425
|
<table style="width: 100%" class="indextable genindextable"><tr>
|