emissions-api-sdk 1.0.11 → 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.
Files changed (101) hide show
  1. package/README.md +157 -0
  2. package/dist/Constants.js +4 -1
  3. package/dist/api/AuditLog.js +99 -0
  4. package/dist/api/EconomicActivity.js +24 -0
  5. package/dist/api/Factor.js +72 -1
  6. package/dist/api/PhysicalActivity.js +87 -0
  7. package/dist/api/RealEstate.js +23 -0
  8. package/dist/api/TypeRecommender.js +67 -2
  9. package/dist/coverage/clover.xml +154 -89
  10. package/dist/coverage/coverage-final.json +15 -9
  11. package/dist/coverage/lcov-report/index.html +21 -21
  12. package/dist/coverage/lcov-report/src/Client.ts.html +32 -32
  13. package/dist/coverage/lcov-report/src/Constants.ts.html +36 -27
  14. package/dist/coverage/lcov-report/src/api/AuditLog.ts.html +388 -0
  15. package/dist/coverage/lcov-report/src/api/Calculation.ts.html +1 -1
  16. package/dist/coverage/lcov-report/src/api/EconomicActivity.ts.html +77 -5
  17. package/dist/coverage/lcov-report/src/api/Factor.ts.html +216 -3
  18. package/dist/coverage/lcov-report/src/api/FactorSets.ts.html +1 -1
  19. package/dist/coverage/lcov-report/src/api/Fugitive.ts.html +1 -1
  20. package/dist/coverage/lcov-report/src/api/Location.ts.html +1 -1
  21. package/dist/coverage/lcov-report/src/api/Metadata.ts.html +1 -1
  22. package/dist/coverage/lcov-report/src/api/Mobile.ts.html +1 -1
  23. package/dist/coverage/lcov-report/src/api/PhysicalActivity.ts.html +361 -0
  24. package/dist/coverage/lcov-report/src/api/RealEstate.ts.html +74 -5
  25. package/dist/coverage/lcov-report/src/api/Stationary.ts.html +1 -1
  26. package/dist/coverage/lcov-report/src/api/TransportationAndDistribution.ts.html +1 -1
  27. package/dist/coverage/lcov-report/src/api/TypeRecommender.ts.html +199 -4
  28. package/dist/coverage/lcov-report/src/api/Usage.ts.html +1 -1
  29. package/dist/coverage/lcov-report/src/api/index.html +36 -6
  30. package/dist/coverage/lcov-report/src/index.html +7 -7
  31. package/dist/coverage/lcov-report/src/request.ts.html +5 -5
  32. package/dist/coverage/lcov-report/src/utils.ts.html +6 -6
  33. package/dist/coverage/lcov-report/test/index.html +1 -1
  34. package/dist/coverage/lcov-report/test/mocks/AttributionRequest.ts.html +151 -0
  35. package/dist/coverage/lcov-report/test/mocks/CommonRequest.ts.html +1 -1
  36. package/dist/coverage/lcov-report/test/mocks/EconomicActivityAttributionRequest.ts.html +148 -0
  37. package/dist/coverage/lcov-report/test/mocks/FactorRequest.ts.html +1 -1
  38. package/dist/coverage/lcov-report/test/mocks/GenericCalculationRequest.ts.html +1 -1
  39. package/dist/coverage/lcov-report/test/mocks/LocationRequest.ts.html +1 -1
  40. package/dist/coverage/lcov-report/test/mocks/PhysicalActivityEVICRequest.ts.html +148 -0
  41. package/dist/coverage/lcov-report/test/mocks/PhysicalActivityRequest.ts.html +151 -0
  42. package/dist/coverage/lcov-report/test/mocks/SearchRequest.ts.html +148 -4
  43. package/dist/coverage/lcov-report/test/mocks/index.html +64 -4
  44. package/dist/coverage/lcov-report/test/testUtils.ts.html +1 -1
  45. package/dist/coverage/lcov.info +254 -124
  46. package/dist/index.js +3 -1
  47. package/dist/interfaces/response/AuditLogResponse.js +2 -0
  48. package/dist/types/Constants.d.ts +3 -0
  49. package/dist/types/api/AuditLog.d.ts +37 -0
  50. package/dist/types/api/EconomicActivity.d.ts +24 -0
  51. package/dist/types/api/Factor.d.ts +72 -1
  52. package/dist/types/api/PhysicalActivity.d.ts +76 -0
  53. package/dist/types/api/RealEstate.d.ts +23 -0
  54. package/dist/types/api/TypeRecommender.d.ts +67 -2
  55. package/dist/types/index.d.ts +4 -0
  56. package/dist/types/interfaces/Api.d.ts +17 -1
  57. package/dist/types/interfaces/common.d.ts +48 -0
  58. package/dist/types/interfaces/response/AuditLogResponse.d.ts +40 -0
  59. package/dist/types/interfaces/response/TypeRecommenderResponse.d.ts +1 -0
  60. package/docs/_sources/authentication.rst.txt +26 -4
  61. package/docs/_sources/getting_started.rst.txt +538 -74
  62. package/docs/_sources/index.rst.txt +11 -0
  63. package/docs/_sources/reference.rst.txt +26 -0
  64. package/docs/_sources/troubleshooting.rst.txt +77 -12
  65. package/docs/_static/base-stemmer.js +476 -0
  66. package/docs/_static/english-stemmer.js +1066 -0
  67. package/docs/authentication.html +31 -5
  68. package/docs/client.html +3 -1
  69. package/docs/genindex.html +22 -2
  70. package/docs/getting_started.html +715 -82
  71. package/docs/index.html +35 -0
  72. package/docs/reference.html +412 -3
  73. package/docs/sdk.html +2 -0
  74. package/docs/search.html +2 -0
  75. package/docs/searchindex.js +1 -1
  76. package/docs/troubleshooting.html +75 -17
  77. package/package.json +7 -3
  78. package/sphinx-build/source/authentication.rst +26 -4
  79. package/sphinx-build/source/getting_started.rst +538 -74
  80. package/sphinx-build/source/index.rst +11 -0
  81. package/sphinx-build/source/reference.rst +26 -0
  82. package/sphinx-build/source/troubleshooting.rst +77 -12
  83. package/src/Constants.ts +3 -0
  84. package/src/api/AuditLog.ts +102 -0
  85. package/src/api/EconomicActivity.ts +24 -0
  86. package/src/api/Factor.ts +72 -1
  87. package/src/api/PhysicalActivity.ts +92 -0
  88. package/src/api/RealEstate.ts +23 -0
  89. package/src/api/TypeRecommender.ts +67 -2
  90. package/src/index.ts +7 -1
  91. package/src/interfaces/Api.ts +22 -6
  92. package/src/interfaces/common.ts +58 -0
  93. package/src/interfaces/response/AuditLogResponse.ts +47 -0
  94. package/src/interfaces/response/TypeRecommenderResponse.ts +2 -0
  95. package/test/apiTest.test.ts +59 -3
  96. package/test/auditLog.test.ts +216 -0
  97. package/test/mocks/AttributionRequest.ts +23 -0
  98. package/test/mocks/EconomicActivityAttributionRequest.ts +22 -0
  99. package/test/mocks/PhysicalActivityEVICRequest.ts +22 -0
  100. package/test/mocks/PhysicalActivityRequest.ts +23 -0
  101. package/test/mocks/SearchRequest.ts +48 -0
@@ -42,17 +42,88 @@ export declare function retrieveFactor(payload: FactorRequest): Promise<FactorRe
42
42
  * @return {Promise<SearchResponse>} A promise that resolves to the search results returned by the API
43
43
  * @throws {Error} May throw an error if the API request fails
44
44
  *
45
+ * The API applies cross-encoder reranking by default. Set `enableReranker` to
46
+ * `false` to keep semantic similarity ordering without reranking.
47
+ *
45
48
  * @example
49
+ * // Basic search
46
50
  * const searchRequest = {
47
51
  "time":{
48
52
  "date": "2020-06-10"
49
53
  },
50
54
  "activity": {
51
- "search" : "travel"},
55
+ "search" : "travel"
56
+ },
52
57
  "location": {
53
58
  "country": "USA"
54
59
  }
55
60
  };
56
61
  * const results = await search(searchRequest);
62
+ *
63
+ * @example
64
+ * // Search without cross-encoder reranking
65
+ * const searchWithoutReranker = {
66
+ "time":{
67
+ "date": "2020-06-10"
68
+ },
69
+ "activity": {
70
+ "search" : "travel"
71
+ },
72
+ "location": {
73
+ "country": "USA"
74
+ },
75
+ "enableReranker": false
76
+ };
77
+ * const results = await search(searchWithoutReranker);
78
+ *
79
+ * @example
80
+ * // Search with optional unit parameter
81
+ * const searchWithUnit = {
82
+ "time":{
83
+ "date": "2020-06-10"
84
+ },
85
+ "activity": {
86
+ "search": "electricity",
87
+ "unit": "kWh"
88
+ },
89
+ "location": {
90
+ "country": "USA"
91
+ }
92
+ };
93
+ * const results = await search(searchWithUnit);
94
+ *
95
+ * @example
96
+ * // Search with optional scope parameter
97
+ * const searchWithScope = {
98
+ "time":{
99
+ "date": "2020-06-10"
100
+ },
101
+ "activity": {
102
+ "search": "natural gas",
103
+ "scope": "1"
104
+ },
105
+ "location": {
106
+ "country": "USA"
107
+ }
108
+ };
109
+ * const results = await search(searchWithScope);
110
+ *
111
+ * @example
112
+ * // Search with both unit and scope parameters
113
+ * const searchWithBoth = {
114
+ "time":{
115
+ "date": "2020-06-10"
116
+ },
117
+ "activity": {
118
+ "search": "electricity",
119
+ "unit": "MWh",
120
+ "scope": "2"
121
+ },
122
+ "location": {
123
+ "country": "USA",
124
+ "stateProvince": "california"
125
+ }
126
+ };
127
+ * const results = await search(searchWithBoth);
57
128
  */
58
129
  export declare function search(payload: SearchRequest): Promise<SearchResponse>;
@@ -0,0 +1,76 @@
1
+ import { CommonRequest } from "../interfaces/Api";
2
+ import { EmissionResponse } from "../interfaces/response/EmissionResponse";
3
+ import { EmissionResponseWithDetails } from "../interfaces/response/EmissionResponseWithDetails";
4
+ /**
5
+ * Performs scope 3 Physical activity emission calculations by making a POST request to the physical activity API endpoint.
6
+ * Supports attribution for private companies using equity/debt based calculations or EVIC (Enterprise Value Including Cash).
7
+ *
8
+ * @export
9
+ * @param {CommonRequest} payload - The request data to be sent to the API
10
+ * @return {Promise<EmissionResponse | EmissionResponseWithDetails>} A promise that resolves to the emission calculation result. Returns EmissionResponseWithDetails if includeDetails is true, otherwise EmissionResponse
11
+ * @throws {Error} May throw an error if the API request fails
12
+ *
13
+ * @example
14
+ * // Basic physical activity request
15
+ * const request = {
16
+ "time": {
17
+ "date": "2025-01-23"
18
+ },
19
+ "location": {
20
+ "country": "usa"
21
+ },
22
+ "activity": {
23
+ "type": "commercial real estate",
24
+ "value": 0.1,
25
+ "unit": "km2"
26
+ },
27
+ "includeDetails": true
28
+ };
29
+ * const result = await calculate(request);
30
+ *
31
+ * @example
32
+ * // Physical activity request with attribution (equity/debt based for private companies)
33
+ * const requestWithEquityDebt = {
34
+ "time": {
35
+ "date": "2025-01-23"
36
+ },
37
+ "location": {
38
+ "country": "usa"
39
+ },
40
+ "activity": {
41
+ "type": "commercial real estate",
42
+ "value": 0.1,
43
+ "unit": "km2"
44
+ },
45
+ "attribution": {
46
+ "outstandingAmount": 1000000,
47
+ "totalEquity": 3000000,
48
+ "totalDebt": 2000000
49
+ },
50
+ "includeDetails": true
51
+ };
52
+ * const resultWithEquityDebt = await calculate(requestWithEquityDebt);
53
+ *
54
+ * @example
55
+ * // Physical activity request with attribution (EVIC based)
56
+ * const requestWithEVIC = {
57
+ "time": {
58
+ "date": "2025-01-23"
59
+ },
60
+ "location": {
61
+ "country": "usa"
62
+ },
63
+ "activity": {
64
+ "type": "commercial real estate",
65
+ "value": 0.1,
66
+ "unit": "km2"
67
+ },
68
+ "attribution": {
69
+ "outstandingAmount": 1000000.0,
70
+ "evic": 10000000.0
71
+ },
72
+ "includeDetails": true
73
+ };
74
+ * const resultWithEVIC = await calculate(requestWithEVIC);
75
+ */
76
+ export declare function calculate(payload: CommonRequest): Promise<EmissionResponse | EmissionResponseWithDetails>;
@@ -10,6 +10,7 @@ import { EmissionResponseWithDetails } from "../interfaces/response/EmissionResp
10
10
  * @throws {Error} May throw an error if the API request fails
11
11
  *
12
12
  * @example
13
+ * // Basic request without attribution
13
14
  * const request = {
14
15
  "time": {
15
16
  "date": "2025-01-04"
@@ -25,5 +26,27 @@ import { EmissionResponseWithDetails } from "../interfaces/response/EmissionResp
25
26
  "includeDetails": false
26
27
  };
27
28
  * const result = await calculate(request);
29
+ *
30
+ * @example
31
+ * // Request with attribution (property value based)
32
+ * const requestWithAttribution = {
33
+ "time": {
34
+ "date": "2022-01-01"
35
+ },
36
+ "location": {
37
+ "country": "usa",
38
+ "stateProvince": "new york"
39
+ },
40
+ "activity": {
41
+ "type": "Commercial Real Estate:Office",
42
+ "value": 123456.0,
43
+ "unit": "m2"
44
+ },
45
+ "attribution": {
46
+ "outstandingAmount": 1000000.0,
47
+ "propertyValue": 5000000.0
48
+ },
49
+ "includeDetails": true
50
+ };
28
51
  */
29
52
  export declare function calculate(payload: CommonRequest): Promise<EmissionResponse | EmissionResponseWithDetails>;
@@ -1,14 +1,20 @@
1
1
  import { SearchRequest } from "../interfaces/Api";
2
2
  import { TypeRecommenderResponse } from "../interfaces/response/TypeRecommenderResponse";
3
3
  /**
4
- * Search for activity types using semantic search with location, time, and license context. Supports pagination.
4
+ * Search for activity types using semantic search with location, time, and license context. Supports pagination and optional reranker control.
5
5
  *
6
6
  * @export
7
7
  * @param {SearchRequest} payload - The search request data to be sent to the API
8
- * @return {Promise<TypeResponse>} A promise that resolves to the activity types returned by the API
8
+ * @return {Promise<TypeRecommenderResponse>} A promise that resolves to the activity types returned by the API
9
9
  * @throws {Error} May throw an error if the API request fails
10
10
  *
11
+ * The API applies cross-encoder reranking by default. Set `enableReranker` to
12
+ * `false` to keep semantic similarity ordering without reranking. Returned
13
+ * activity type items can include `scope`, a list of distinct GHG Protocol
14
+ * scopes associated with the activity type.
15
+ *
11
16
  * @example
17
+ * // Basic search
12
18
  * const result = await search({
13
19
  "location": {
14
20
  "country": "usa"
@@ -19,6 +25,7 @@ import { TypeRecommenderResponse } from "../interfaces/response/TypeRecommenderR
19
25
  });
20
26
 
21
27
  * @example
28
+ * // Search with time and pagination
22
29
  * const result = await search({
23
30
  "location": {
24
31
  "country": "usa",
@@ -37,6 +44,7 @@ import { TypeRecommenderResponse } from "../interfaces/response/TypeRecommenderR
37
44
  });
38
45
 
39
46
  * @example
47
+ * // Search with power grid
40
48
  * const result = await search({
41
49
  "location": {
42
50
  "country": "usa",
@@ -46,5 +54,62 @@ import { TypeRecommenderResponse } from "../interfaces/response/TypeRecommenderR
46
54
  "search": "renewable energy"
47
55
  }
48
56
  });
57
+ *
58
+ * @example
59
+ * // Search without cross-encoder reranking
60
+ * const result = await search({
61
+ "location": {
62
+ "country": "usa"
63
+ },
64
+ "activity": {
65
+ "search": "electricity"
66
+ },
67
+ "enableReranker": false
68
+ });
69
+ *
70
+ * @example
71
+ * // Search with optional unit parameter
72
+ * const result = await search({
73
+ "location": {
74
+ "country": "usa"
75
+ },
76
+ "activity": {
77
+ "search": "electricity",
78
+ "unit": "kWh"
79
+ }
80
+ });
81
+ *
82
+ * @example
83
+ * // Search with optional scope parameter
84
+ * const result = await search({
85
+ "location": {
86
+ "country": "usa"
87
+ },
88
+ "activity": {
89
+ "search": "natural gas",
90
+ "scope": "1"
91
+ }
92
+ });
93
+ *
94
+ * @example
95
+ * // Search with both unit and scope parameters
96
+ * const result = await search({
97
+ "location": {
98
+ "country": "usa",
99
+ "stateProvince": "california"
100
+ },
101
+ "time": {
102
+ "date": "2025-06-10"
103
+ },
104
+ "activity": {
105
+ "search": "electricity",
106
+ "unit": "MWh",
107
+ "scope": "2"
108
+ },
109
+ "pagination": {
110
+ "page": 1,
111
+ "size": 10
112
+ }
113
+ });
49
114
  */
50
115
  export declare function search(payload: SearchRequest): Promise<TypeRecommenderResponse>;
@@ -10,9 +10,12 @@ export * as Factor from './api/Factor';
10
10
  export * as FactorSets from './api/FactorSets';
11
11
  export * as EconomicActivity from './api/EconomicActivity';
12
12
  export * as RealEstate from './api/RealEstate';
13
+ export * as PhysicalActivity from './api/PhysicalActivity';
13
14
  export * as Metadata from './api/Metadata';
14
15
  export * as TypeRecommender from './api/TypeRecommender';
16
+ export * as AuditLog from './api/AuditLog';
15
17
  export { ClientConfig } from './interfaces/Config';
18
+ export { Attribution } from './interfaces/common';
16
19
  export { AreaResponse, Location as LocationInfo } from './interfaces/response/AreaResponse';
17
20
  export { EmissionResponse } from './interfaces/response/EmissionResponse';
18
21
  export { EmissionResponseWithDetails, FactorDetails, FactorSetDetails, IncludeDetails } from './interfaces/response/EmissionResponseWithDetails';
@@ -23,3 +26,4 @@ export { TypeResponse } from './interfaces/response/TypeResponse';
23
26
  export { UnitResponse } from './interfaces/response/UnitResponse';
24
27
  export { UsageResponse } from './interfaces/response/UsageResponse';
25
28
  export { TypeRecommenderResponse, ActivityRequest } from './interfaces/response/TypeRecommenderResponse';
29
+ export { AuditLogResponse, AuditLogRequest } from './interfaces/response/AuditLogResponse';
@@ -1,4 +1,4 @@
1
- import { Activity, Location, Time, CombinedUnitsActivity, FactorActivity, SearchActivity, Pagination, FactorActivityWithFactorId, CombinedUnitsActivityWithFactorId, ActivityWithFactorId } from "./common";
1
+ import { Activity, Location, Time, CombinedUnitsActivity, FactorActivity, SearchActivity, Pagination, FactorActivityWithFactorId, CombinedUnitsActivityWithFactorId, ActivityWithFactorId, Attribution } from "./common";
2
2
  /**
3
3
  * Represents activity data associated with a location, with simplified requirements.
4
4
  * Derived from the Activity type but makes the 'type' and 'unit' properties optional
@@ -119,6 +119,11 @@ export interface CommonRequestWithoutFactorId {
119
119
  * Contains complete activity information including type, value, and unit.
120
120
  */
121
121
  activity: Activity;
122
+ /**
123
+ * Optional attribution information for FE calculations.
124
+ * Contains outstanding amount, property value, and currency.
125
+ */
126
+ attribution?: Attribution;
122
127
  /**
123
128
  * Whether to include additional details in the response.
124
129
  * When true, the API will return more comprehensive information.
@@ -137,6 +142,11 @@ export interface CommonRequestWithFactorId {
137
142
  * The activity data for the calculation, including the specific factor ID to use.
138
143
  */
139
144
  activity: ActivityWithFactorId;
145
+ /**
146
+ * Optional attribution information for FE calculations.
147
+ * Contains outstanding amount, property value, and currency.
148
+ */
149
+ attribution?: Attribution;
140
150
  /**
141
151
  * Whether to include additional details in the response.
142
152
  * When true, the API will return more comprehensive information.
@@ -254,6 +264,12 @@ export interface SearchRequest {
254
264
  * Used to limit the number of results and implement paging.
255
265
  */
256
266
  pagination?: Pagination;
267
+ /**
268
+ * Optional reranker toggle for factor and type searches.
269
+ * Defaults to true when omitted. Set to false to use semantic similarity
270
+ * results directly without cross-encoder reranking.
271
+ */
272
+ enableReranker?: boolean;
257
273
  }
258
274
  /**
259
275
  * Union type representing either a factor request with or without a specific factor ID.
@@ -135,6 +135,14 @@ export interface SearchActivity {
135
135
  * The search query string.
136
136
  */
137
137
  search: string;
138
+ /**
139
+ * Optional unit (symbol) for search activity.
140
+ */
141
+ unit?: string;
142
+ /**
143
+ * Optional scope(1,2,3,3.1 to 3.15) for search activity.
144
+ */
145
+ scope?: string;
138
146
  }
139
147
  /**
140
148
  * Represents pagination parameters for paginated results.
@@ -150,3 +158,43 @@ export interface Pagination {
150
158
  */
151
159
  size: number;
152
160
  }
161
+ /**
162
+ * Represents attribution information for real estate, physical activity, and economic activity calculations.
163
+ * Supports four scenarios:
164
+ * 1. Property value based (for general real estate)
165
+ * 2. Equity/Debt based (for private companies)
166
+ * 3. EVIC based (Enterprise Value Including Cash for physical activity)
167
+ * 4. Revenue based (for economic activity)
168
+ * @interface Attribution
169
+ */
170
+ export interface Attribution {
171
+ /**
172
+ * The outstanding amount for the property or activity.
173
+ */
174
+ outstandingAmount?: number;
175
+ /**
176
+ * The total property value (used in property value based scenario).
177
+ * Optional - use either propertyValue OR (totalEquity + totalDebt) OR evic OR revenue.
178
+ */
179
+ propertyValue?: number;
180
+ /**
181
+ * The total equity amount (used in equity/debt based scenario for private companies).
182
+ * Optional - use either propertyValue OR (totalEquity + totalDebt) OR evic OR revenue.
183
+ */
184
+ totalEquity?: number;
185
+ /**
186
+ * The total debt amount (used in equity/debt based scenario for private companies).
187
+ * Optional - use either propertyValue OR (totalEquity + totalDebt) OR evic OR revenue.
188
+ */
189
+ totalDebt?: number;
190
+ /**
191
+ * Enterprise Value Including Cash (EVIC) - used in EVIC based scenario for physical activity calculations.
192
+ * Optional - use either propertyValue OR (totalEquity + totalDebt) OR evic OR revenue.
193
+ */
194
+ evic?: number;
195
+ /**
196
+ * Total revenue - used in revenue based scenario for economic activity calculations.
197
+ * Optional - use either propertyValue OR (totalEquity + totalDebt) OR evic OR revenue.
198
+ */
199
+ revenue?: number;
200
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Response interface for audit log configuration.
3
+ * Contains settings for logging requests and responses.
4
+ *
5
+ * @interface AuditLogResponse
6
+ */
7
+ export interface AuditLogResponse {
8
+ /**
9
+ * Whether to log API requests.
10
+ * When true, all incoming requests will be logged.
11
+ */
12
+ logRequest: boolean;
13
+ /**
14
+ * Whether to log API responses.
15
+ * When true, all outgoing responses will be logged.
16
+ */
17
+ logResponse: boolean;
18
+ /**
19
+ * Message providing additional context about the response.
20
+ */
21
+ message: string;
22
+ }
23
+ /**
24
+ * Request interface for updating audit log configuration.
25
+ * Used to configure which parts of API interactions should be logged.
26
+ *
27
+ * @interface AuditLogRequest
28
+ */
29
+ export interface AuditLogRequest {
30
+ /**
31
+ * Whether to log API requests.
32
+ * When true, all incoming requests will be logged.
33
+ */
34
+ logRequest: boolean;
35
+ /**
36
+ * Whether to log API responses.
37
+ * When true, all outgoing responses will be logged.
38
+ */
39
+ logResponse: boolean;
40
+ }
@@ -11,4 +11,5 @@ export interface ActivityRequest {
11
11
  activityUnit: string[];
12
12
  activityDescription: string;
13
13
  confidence: number;
14
+ scope?: string[];
14
15
  }
@@ -10,17 +10,39 @@ The IBM Envizi - Emissions API Node.js SDK uses OAuth 2.0 Bearer Tokens for auth
10
10
  Authentication Methods
11
11
  ----------------------
12
12
 
13
- The SDK provides two authentication methods:
13
+ The SDK provides three authentication methods:
14
14
 
15
- API Key Authentication (Recommended)
16
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
+ Personal Access Token (PAT) Authentication (Recommended)
16
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17
+
18
+ This method uses a personal access token directly:
19
+
20
+ .. code-block:: javascript
21
+
22
+ import { Client } from 'emissions-api-sdk';
23
+
24
+ await Client.getClient({
25
+ patToken: process.env.ENVIZI_PAT_TOKEN,
26
+ clientId: process.env.ENVIZI_CLIENT_ID
27
+ });
28
+
29
+ **Required parameters:**
30
+ - ``patToken``: Your personal access token
31
+ - ``clientId``: Your client identifier
32
+
33
+ .. note::
34
+
35
+ When using a PAT token, do not provide ``orgId``.
36
+
37
+ API Key Authentication
38
+ ~~~~~~~~~~~~~~~~~~~~~~
17
39
 
18
40
  This method automatically handles token generation and refreshing:
19
41
 
20
42
  .. code-block:: javascript
21
43
 
22
44
  import { Client } from 'emissions-api-sdk';
23
-
45
+
24
46
  await Client.getClient({
25
47
  apiKey: process.env.ENVIZI_API_KEY,
26
48
  clientId: process.env.ENVIZI_CLIENT_ID,