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.
- package/README.md +157 -0
- 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 +72 -1
- package/dist/api/PhysicalActivity.js +87 -0
- package/dist/api/RealEstate.js +23 -0
- package/dist/api/TypeRecommender.js +67 -2
- package/dist/coverage/clover.xml +154 -89
- package/dist/coverage/coverage-final.json +15 -9
- 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 +216 -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 +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 +199 -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 +148 -4
- package/dist/coverage/lcov-report/test/mocks/index.html +64 -4
- package/dist/coverage/lcov-report/test/testUtils.ts.html +1 -1
- package/dist/coverage/lcov.info +254 -124
- 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 +72 -1
- 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 +67 -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 +48 -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/base-stemmer.js +476 -0
- package/docs/_static/english-stemmer.js +1066 -0
- package/docs/authentication.html +31 -5
- package/docs/client.html +3 -1
- package/docs/genindex.html +22 -2
- package/docs/getting_started.html +715 -82
- package/docs/index.html +35 -0
- package/docs/reference.html +412 -3
- package/docs/sdk.html +2 -0
- package/docs/search.html +2 -0
- package/docs/searchindex.js +1 -1
- package/docs/troubleshooting.html +75 -17
- 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 +72 -1
- package/src/api/PhysicalActivity.ts +92 -0
- package/src/api/RealEstate.ts +23 -0
- package/src/api/TypeRecommender.ts +67 -2
- package/src/index.ts +7 -1
- package/src/interfaces/Api.ts +22 -6
- package/src/interfaces/common.ts +58 -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/test/mocks/SearchRequest.ts +48 -0
package/dist/coverage/lcov.info
CHANGED
|
@@ -12,59 +12,59 @@ FN:269,(anonymous_9)
|
|
|
12
12
|
FN:303,(anonymous_10)
|
|
13
13
|
FNF:10
|
|
14
14
|
FNH:8
|
|
15
|
-
FNDA:
|
|
16
|
-
FNDA:
|
|
17
|
-
FNDA:
|
|
18
|
-
FNDA:
|
|
15
|
+
FNDA:50,(anonymous_1)
|
|
16
|
+
FNDA:55,(anonymous_2)
|
|
17
|
+
FNDA:80,(anonymous_3)
|
|
18
|
+
FNDA:91,(anonymous_4)
|
|
19
19
|
FNDA:6,(anonymous_5)
|
|
20
20
|
FNDA:4,(anonymous_6)
|
|
21
21
|
FNDA:0,(anonymous_7)
|
|
22
22
|
FNDA:0,(anonymous_8)
|
|
23
23
|
FNDA:4,(anonymous_9)
|
|
24
24
|
FNDA:8,(anonymous_10)
|
|
25
|
-
DA:1,
|
|
26
|
-
DA:3,
|
|
27
|
-
DA:4,
|
|
28
|
-
DA:6,
|
|
29
|
-
DA:7,
|
|
30
|
-
DA:25,
|
|
31
|
-
DA:26,
|
|
32
|
-
DA:27,
|
|
33
|
-
DA:28,
|
|
25
|
+
DA:1,6
|
|
26
|
+
DA:3,6
|
|
27
|
+
DA:4,6
|
|
28
|
+
DA:6,6
|
|
29
|
+
DA:7,6
|
|
30
|
+
DA:25,50
|
|
31
|
+
DA:26,50
|
|
32
|
+
DA:27,50
|
|
33
|
+
DA:28,50
|
|
34
34
|
DA:29,1
|
|
35
35
|
DA:30,1
|
|
36
36
|
DA:31,1
|
|
37
|
-
DA:33,
|
|
38
|
-
DA:34,
|
|
39
|
-
DA:35,
|
|
40
|
-
DA:38,
|
|
41
|
-
DA:39,
|
|
42
|
-
DA:40,
|
|
43
|
-
DA:41,
|
|
44
|
-
DA:42,
|
|
45
|
-
DA:43,
|
|
46
|
-
DA:88,
|
|
37
|
+
DA:33,49
|
|
38
|
+
DA:34,49
|
|
39
|
+
DA:35,49
|
|
40
|
+
DA:38,50
|
|
41
|
+
DA:39,50
|
|
42
|
+
DA:40,50
|
|
43
|
+
DA:41,50
|
|
44
|
+
DA:42,50
|
|
45
|
+
DA:43,50
|
|
46
|
+
DA:88,55
|
|
47
47
|
DA:89,1
|
|
48
|
-
DA:93,
|
|
48
|
+
DA:93,54
|
|
49
49
|
DA:94,1
|
|
50
|
-
DA:98,
|
|
50
|
+
DA:98,53
|
|
51
51
|
DA:99,1
|
|
52
|
-
DA:103,
|
|
52
|
+
DA:103,52
|
|
53
53
|
DA:104,1
|
|
54
|
-
DA:108,
|
|
54
|
+
DA:108,51
|
|
55
55
|
DA:109,1
|
|
56
|
-
DA:114,
|
|
57
|
-
DA:116,
|
|
56
|
+
DA:114,50
|
|
57
|
+
DA:116,50
|
|
58
58
|
DA:117,1
|
|
59
59
|
DA:118,1
|
|
60
|
-
DA:119,
|
|
60
|
+
DA:119,49
|
|
61
61
|
DA:120,6
|
|
62
|
-
DA:122,
|
|
63
|
-
DA:124,
|
|
64
|
-
DA:138,
|
|
65
|
-
DA:160,
|
|
62
|
+
DA:122,43
|
|
63
|
+
DA:124,50
|
|
64
|
+
DA:138,80
|
|
65
|
+
DA:160,91
|
|
66
66
|
DA:161,1
|
|
67
|
-
DA:165,
|
|
67
|
+
DA:165,90
|
|
68
68
|
DA:181,6
|
|
69
69
|
DA:182,5
|
|
70
70
|
DA:183,5
|
|
@@ -89,54 +89,54 @@ LF:63
|
|
|
89
89
|
LH:61
|
|
90
90
|
BRDA:23,0,0,0
|
|
91
91
|
BRDA:25,1,0,7
|
|
92
|
-
BRDA:25,2,0,
|
|
92
|
+
BRDA:25,2,0,44
|
|
93
93
|
BRDA:25,3,0,7
|
|
94
|
-
BRDA:25,4,0,
|
|
94
|
+
BRDA:25,4,0,50
|
|
95
95
|
BRDA:28,5,0,1
|
|
96
|
-
BRDA:28,5,1,
|
|
96
|
+
BRDA:28,5,1,49
|
|
97
97
|
BRDA:40,6,0,0
|
|
98
|
-
BRDA:40,6,1,
|
|
99
|
-
BRDA:40,7,0,
|
|
100
|
-
BRDA:40,7,1,
|
|
98
|
+
BRDA:40,6,1,50
|
|
99
|
+
BRDA:40,7,0,50
|
|
100
|
+
BRDA:40,7,1,50
|
|
101
101
|
BRDA:41,8,0,2
|
|
102
|
-
BRDA:41,8,1,
|
|
103
|
-
BRDA:41,9,0,
|
|
104
|
-
BRDA:41,9,1,
|
|
102
|
+
BRDA:41,8,1,48
|
|
103
|
+
BRDA:41,9,0,50
|
|
104
|
+
BRDA:41,9,1,50
|
|
105
105
|
BRDA:41,10,0,4
|
|
106
|
-
BRDA:41,10,1,
|
|
106
|
+
BRDA:41,10,1,44
|
|
107
107
|
BRDA:43,11,0,0
|
|
108
|
-
BRDA:43,11,1,
|
|
108
|
+
BRDA:43,11,1,50
|
|
109
109
|
BRDA:88,12,0,1
|
|
110
|
-
BRDA:88,12,1,
|
|
111
|
-
BRDA:88,13,0,
|
|
110
|
+
BRDA:88,12,1,54
|
|
111
|
+
BRDA:88,13,0,55
|
|
112
112
|
BRDA:88,13,1,1
|
|
113
113
|
BRDA:93,14,0,1
|
|
114
|
-
BRDA:93,14,1,
|
|
115
|
-
BRDA:93,15,0,
|
|
114
|
+
BRDA:93,14,1,53
|
|
115
|
+
BRDA:93,15,0,54
|
|
116
116
|
BRDA:93,15,1,2
|
|
117
117
|
BRDA:98,16,0,1
|
|
118
|
-
BRDA:98,16,1,
|
|
119
|
-
BRDA:98,17,0,
|
|
120
|
-
BRDA:98,17,1,
|
|
121
|
-
BRDA:98,17,2,
|
|
118
|
+
BRDA:98,16,1,52
|
|
119
|
+
BRDA:98,17,0,53
|
|
120
|
+
BRDA:98,17,1,44
|
|
121
|
+
BRDA:98,17,2,43
|
|
122
122
|
BRDA:103,18,0,1
|
|
123
|
-
BRDA:103,18,1,
|
|
124
|
-
BRDA:103,19,0,
|
|
123
|
+
BRDA:103,18,1,51
|
|
124
|
+
BRDA:103,19,0,52
|
|
125
125
|
BRDA:103,19,1,8
|
|
126
126
|
BRDA:108,20,0,1
|
|
127
|
-
BRDA:108,20,1,
|
|
128
|
-
BRDA:108,21,0,
|
|
127
|
+
BRDA:108,20,1,50
|
|
128
|
+
BRDA:108,21,0,51
|
|
129
129
|
BRDA:108,21,1,7
|
|
130
130
|
BRDA:116,22,0,1
|
|
131
|
-
BRDA:116,22,1,
|
|
132
|
-
BRDA:116,23,0,
|
|
131
|
+
BRDA:116,22,1,49
|
|
132
|
+
BRDA:116,23,0,50
|
|
133
133
|
BRDA:116,23,1,1
|
|
134
134
|
BRDA:119,24,0,6
|
|
135
|
-
BRDA:119,24,1,
|
|
136
|
-
BRDA:119,25,0,
|
|
135
|
+
BRDA:119,24,1,43
|
|
136
|
+
BRDA:119,25,0,49
|
|
137
137
|
BRDA:119,25,1,6
|
|
138
138
|
BRDA:160,26,0,1
|
|
139
|
-
BRDA:160,26,1,
|
|
139
|
+
BRDA:160,26,1,90
|
|
140
140
|
BRDA:181,27,0,5
|
|
141
141
|
BRDA:181,27,1,1
|
|
142
142
|
BRDA:183,28,0,3
|
|
@@ -162,32 +162,35 @@ TN:
|
|
|
162
162
|
SF:src/Constants.ts
|
|
163
163
|
FNF:0
|
|
164
164
|
FNH:0
|
|
165
|
-
DA:1,
|
|
166
|
-
DA:2,
|
|
167
|
-
DA:3,
|
|
168
|
-
DA:4,
|
|
169
|
-
DA:5,
|
|
170
|
-
DA:6,
|
|
171
|
-
DA:7,
|
|
172
|
-
DA:8,
|
|
173
|
-
DA:9,
|
|
174
|
-
DA:10,
|
|
175
|
-
DA:11,
|
|
176
|
-
DA:12,
|
|
177
|
-
DA:13,
|
|
178
|
-
DA:14,
|
|
179
|
-
DA:
|
|
180
|
-
DA:
|
|
181
|
-
DA:
|
|
182
|
-
DA:
|
|
183
|
-
DA:22,
|
|
184
|
-
DA:
|
|
185
|
-
DA:
|
|
186
|
-
DA:26,
|
|
187
|
-
DA:27,
|
|
188
|
-
DA:28,
|
|
189
|
-
|
|
190
|
-
|
|
165
|
+
DA:1,8
|
|
166
|
+
DA:2,8
|
|
167
|
+
DA:3,8
|
|
168
|
+
DA:4,8
|
|
169
|
+
DA:5,8
|
|
170
|
+
DA:6,8
|
|
171
|
+
DA:7,8
|
|
172
|
+
DA:8,8
|
|
173
|
+
DA:9,8
|
|
174
|
+
DA:10,8
|
|
175
|
+
DA:11,8
|
|
176
|
+
DA:12,8
|
|
177
|
+
DA:13,8
|
|
178
|
+
DA:14,8
|
|
179
|
+
DA:15,8
|
|
180
|
+
DA:16,8
|
|
181
|
+
DA:18,8
|
|
182
|
+
DA:20,8
|
|
183
|
+
DA:22,8
|
|
184
|
+
DA:23,8
|
|
185
|
+
DA:24,8
|
|
186
|
+
DA:26,8
|
|
187
|
+
DA:27,8
|
|
188
|
+
DA:28,8
|
|
189
|
+
DA:29,8
|
|
190
|
+
DA:30,8
|
|
191
|
+
DA:31,8
|
|
192
|
+
LF:27
|
|
193
|
+
LH:27
|
|
191
194
|
BRF:0
|
|
192
195
|
BRH:0
|
|
193
196
|
end_of_record
|
|
@@ -197,10 +200,10 @@ FN:30,makeApiRequest
|
|
|
197
200
|
FNF:1
|
|
198
201
|
FNH:1
|
|
199
202
|
FNDA:3,makeApiRequest
|
|
200
|
-
DA:1,
|
|
201
|
-
DA:3,
|
|
202
|
-
DA:4,
|
|
203
|
-
DA:30,
|
|
203
|
+
DA:1,4
|
|
204
|
+
DA:3,4
|
|
205
|
+
DA:4,4
|
|
206
|
+
DA:30,4
|
|
204
207
|
DA:31,3
|
|
205
208
|
DA:32,3
|
|
206
209
|
DA:34,3
|
|
@@ -216,20 +219,82 @@ SF:src/utils.ts
|
|
|
216
219
|
FN:14,findExpiryTime
|
|
217
220
|
FNF:1
|
|
218
221
|
FNH:1
|
|
219
|
-
FNDA:
|
|
220
|
-
DA:14,
|
|
221
|
-
DA:15,
|
|
222
|
-
DA:16,
|
|
223
|
-
DA:17,
|
|
224
|
-
DA:18,
|
|
222
|
+
FNDA:45,findExpiryTime
|
|
223
|
+
DA:14,6
|
|
224
|
+
DA:15,45
|
|
225
|
+
DA:16,45
|
|
226
|
+
DA:17,45
|
|
227
|
+
DA:18,45
|
|
225
228
|
LF:5
|
|
226
229
|
LH:5
|
|
227
230
|
BRDA:17,0,0,0
|
|
228
|
-
BRDA:17,0,1,
|
|
231
|
+
BRDA:17,0,1,45
|
|
229
232
|
BRF:2
|
|
230
233
|
BRH:1
|
|
231
234
|
end_of_record
|
|
232
235
|
TN:
|
|
236
|
+
SF:src/api/AuditLog.ts
|
|
237
|
+
FN:14,handleAuditLogError
|
|
238
|
+
FN:53,getAuditConfig
|
|
239
|
+
FN:87,updateAuditConfig
|
|
240
|
+
FNF:3
|
|
241
|
+
FNH:3
|
|
242
|
+
FNDA:8,handleAuditLogError
|
|
243
|
+
FNDA:5,getAuditConfig
|
|
244
|
+
FNDA:7,updateAuditConfig
|
|
245
|
+
DA:1,2
|
|
246
|
+
DA:2,2
|
|
247
|
+
DA:3,2
|
|
248
|
+
DA:5,2
|
|
249
|
+
DA:15,8
|
|
250
|
+
DA:16,6
|
|
251
|
+
DA:17,6
|
|
252
|
+
DA:20,6
|
|
253
|
+
DA:21,1
|
|
254
|
+
DA:25,5
|
|
255
|
+
DA:26,1
|
|
256
|
+
DA:30,4
|
|
257
|
+
DA:31,2
|
|
258
|
+
DA:36,4
|
|
259
|
+
DA:53,2
|
|
260
|
+
DA:54,5
|
|
261
|
+
DA:55,5
|
|
262
|
+
DA:57,5
|
|
263
|
+
DA:58,5
|
|
264
|
+
DA:63,3
|
|
265
|
+
DA:87,2
|
|
266
|
+
DA:90,7
|
|
267
|
+
DA:91,7
|
|
268
|
+
DA:93,7
|
|
269
|
+
DA:94,7
|
|
270
|
+
DA:100,5
|
|
271
|
+
LF:26
|
|
272
|
+
LH:26
|
|
273
|
+
BRDA:14,0,0,3
|
|
274
|
+
BRDA:15,1,0,6
|
|
275
|
+
BRDA:15,1,1,2
|
|
276
|
+
BRDA:15,2,0,8
|
|
277
|
+
BRDA:15,2,1,6
|
|
278
|
+
BRDA:20,3,0,1
|
|
279
|
+
BRDA:20,3,1,5
|
|
280
|
+
BRDA:20,4,0,6
|
|
281
|
+
BRDA:20,4,1,1
|
|
282
|
+
BRDA:25,5,0,1
|
|
283
|
+
BRDA:25,5,1,4
|
|
284
|
+
BRDA:26,6,0,0
|
|
285
|
+
BRDA:26,6,1,1
|
|
286
|
+
BRDA:26,7,0,1
|
|
287
|
+
BRDA:26,7,1,1
|
|
288
|
+
BRDA:30,8,0,2
|
|
289
|
+
BRDA:30,8,1,2
|
|
290
|
+
BRDA:31,9,0,0
|
|
291
|
+
BRDA:31,9,1,2
|
|
292
|
+
BRDA:31,10,0,2
|
|
293
|
+
BRDA:31,10,1,2
|
|
294
|
+
BRF:21
|
|
295
|
+
BRH:19
|
|
296
|
+
end_of_record
|
|
297
|
+
TN:
|
|
233
298
|
SF:src/api/Calculation.ts
|
|
234
299
|
FN:35,calculate
|
|
235
300
|
FNF:1
|
|
@@ -249,17 +314,17 @@ BRH:0
|
|
|
249
314
|
end_of_record
|
|
250
315
|
TN:
|
|
251
316
|
SF:src/api/EconomicActivity.ts
|
|
252
|
-
FN:
|
|
317
|
+
FN:58,calculate
|
|
253
318
|
FNF:1
|
|
254
319
|
FNH:1
|
|
255
|
-
FNDA:
|
|
320
|
+
FNDA:2,calculate
|
|
256
321
|
DA:1,1
|
|
257
322
|
DA:2,1
|
|
258
323
|
DA:6,1
|
|
259
|
-
DA:
|
|
260
|
-
DA:
|
|
261
|
-
DA:
|
|
262
|
-
DA:
|
|
324
|
+
DA:58,1
|
|
325
|
+
DA:61,2
|
|
326
|
+
DA:62,2
|
|
327
|
+
DA:64,2
|
|
263
328
|
LF:7
|
|
264
329
|
LH:7
|
|
265
330
|
BRF:0
|
|
@@ -268,7 +333,7 @@ end_of_record
|
|
|
268
333
|
TN:
|
|
269
334
|
SF:src/api/Factor.ts
|
|
270
335
|
FN:41,retrieveFactor
|
|
271
|
-
FN:
|
|
336
|
+
FN:147,search
|
|
272
337
|
FNF:2
|
|
273
338
|
FNH:2
|
|
274
339
|
FNDA:1,retrieveFactor
|
|
@@ -280,10 +345,10 @@ DA:41,1
|
|
|
280
345
|
DA:44,1
|
|
281
346
|
DA:45,1
|
|
282
347
|
DA:47,1
|
|
283
|
-
DA:
|
|
284
|
-
DA:
|
|
285
|
-
DA:
|
|
286
|
-
DA:
|
|
348
|
+
DA:147,1
|
|
349
|
+
DA:150,1
|
|
350
|
+
DA:151,1
|
|
351
|
+
DA:153,1
|
|
287
352
|
LF:11
|
|
288
353
|
LH:11
|
|
289
354
|
BRF:0
|
|
@@ -422,18 +487,36 @@ BRF:0
|
|
|
422
487
|
BRH:0
|
|
423
488
|
end_of_record
|
|
424
489
|
TN:
|
|
490
|
+
SF:src/api/PhysicalActivity.ts
|
|
491
|
+
FN:81,calculate
|
|
492
|
+
FNF:1
|
|
493
|
+
FNH:1
|
|
494
|
+
FNDA:3,calculate
|
|
495
|
+
DA:1,1
|
|
496
|
+
DA:2,1
|
|
497
|
+
DA:6,1
|
|
498
|
+
DA:81,1
|
|
499
|
+
DA:84,3
|
|
500
|
+
DA:85,3
|
|
501
|
+
DA:87,3
|
|
502
|
+
LF:7
|
|
503
|
+
LH:7
|
|
504
|
+
BRF:0
|
|
505
|
+
BRH:0
|
|
506
|
+
end_of_record
|
|
507
|
+
TN:
|
|
425
508
|
SF:src/api/RealEstate.ts
|
|
426
|
-
FN:
|
|
509
|
+
FN:57,calculate
|
|
427
510
|
FNF:1
|
|
428
511
|
FNH:1
|
|
429
|
-
FNDA:
|
|
512
|
+
FNDA:2,calculate
|
|
430
513
|
DA:1,1
|
|
431
514
|
DA:2,1
|
|
432
515
|
DA:6,1
|
|
433
|
-
DA:
|
|
434
|
-
DA:
|
|
435
|
-
DA:
|
|
436
|
-
DA:
|
|
516
|
+
DA:57,1
|
|
517
|
+
DA:60,2
|
|
518
|
+
DA:61,2
|
|
519
|
+
DA:63,2
|
|
437
520
|
LF:7
|
|
438
521
|
LH:7
|
|
439
522
|
BRF:0
|
|
@@ -477,17 +560,17 @@ BRH:0
|
|
|
477
560
|
end_of_record
|
|
478
561
|
TN:
|
|
479
562
|
SF:src/api/TypeRecommender.ts
|
|
480
|
-
FN:
|
|
563
|
+
FN:119,search
|
|
481
564
|
FNF:1
|
|
482
565
|
FNH:1
|
|
483
566
|
FNDA:1,search
|
|
484
567
|
DA:1,1
|
|
485
568
|
DA:2,1
|
|
486
569
|
DA:5,1
|
|
487
|
-
DA:
|
|
488
|
-
DA:
|
|
489
|
-
DA:
|
|
490
|
-
DA:
|
|
570
|
+
DA:119,1
|
|
571
|
+
DA:122,1
|
|
572
|
+
DA:123,1
|
|
573
|
+
DA:125,1
|
|
491
574
|
LF:7
|
|
492
575
|
LH:7
|
|
493
576
|
BRF:0
|
|
@@ -528,6 +611,17 @@ BRF:0
|
|
|
528
611
|
BRH:0
|
|
529
612
|
end_of_record
|
|
530
613
|
TN:
|
|
614
|
+
SF:test/mocks/AttributionRequest.ts
|
|
615
|
+
FNF:0
|
|
616
|
+
FNH:0
|
|
617
|
+
DA:3,1
|
|
618
|
+
DA:23,1
|
|
619
|
+
LF:2
|
|
620
|
+
LH:2
|
|
621
|
+
BRF:0
|
|
622
|
+
BRH:0
|
|
623
|
+
end_of_record
|
|
624
|
+
TN:
|
|
531
625
|
SF:test/mocks/CommonRequest.ts
|
|
532
626
|
FNF:0
|
|
533
627
|
FNH:0
|
|
@@ -539,6 +633,17 @@ BRF:0
|
|
|
539
633
|
BRH:0
|
|
540
634
|
end_of_record
|
|
541
635
|
TN:
|
|
636
|
+
SF:test/mocks/EconomicActivityAttributionRequest.ts
|
|
637
|
+
FNF:0
|
|
638
|
+
FNH:0
|
|
639
|
+
DA:3,1
|
|
640
|
+
DA:22,1
|
|
641
|
+
LF:2
|
|
642
|
+
LH:2
|
|
643
|
+
BRF:0
|
|
644
|
+
BRH:0
|
|
645
|
+
end_of_record
|
|
646
|
+
TN:
|
|
542
647
|
SF:test/mocks/FactorRequest.ts
|
|
543
648
|
FNF:0
|
|
544
649
|
FNH:0
|
|
@@ -572,13 +677,38 @@ BRF:0
|
|
|
572
677
|
BRH:0
|
|
573
678
|
end_of_record
|
|
574
679
|
TN:
|
|
575
|
-
SF:test/mocks/
|
|
680
|
+
SF:test/mocks/PhysicalActivityEVICRequest.ts
|
|
576
681
|
FNF:0
|
|
577
682
|
FNH:0
|
|
578
683
|
DA:3,1
|
|
579
|
-
DA:
|
|
684
|
+
DA:22,1
|
|
685
|
+
LF:2
|
|
686
|
+
LH:2
|
|
687
|
+
BRF:0
|
|
688
|
+
BRH:0
|
|
689
|
+
end_of_record
|
|
690
|
+
TN:
|
|
691
|
+
SF:test/mocks/PhysicalActivityRequest.ts
|
|
692
|
+
FNF:0
|
|
693
|
+
FNH:0
|
|
694
|
+
DA:3,1
|
|
695
|
+
DA:23,1
|
|
580
696
|
LF:2
|
|
581
697
|
LH:2
|
|
582
698
|
BRF:0
|
|
583
699
|
BRH:0
|
|
584
700
|
end_of_record
|
|
701
|
+
TN:
|
|
702
|
+
SF:test/mocks/SearchRequest.ts
|
|
703
|
+
FNF:0
|
|
704
|
+
FNH:0
|
|
705
|
+
DA:3,1
|
|
706
|
+
DA:20,1
|
|
707
|
+
DA:34,1
|
|
708
|
+
DA:48,1
|
|
709
|
+
DA:67,1
|
|
710
|
+
LF:5
|
|
711
|
+
LH:5
|
|
712
|
+
BRF:0
|
|
713
|
+
BRH:0
|
|
714
|
+
end_of_record
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.TypeRecommender = exports.Metadata = exports.RealEstate = exports.EconomicActivity = exports.FactorSets = exports.Factor = exports.Usage = exports.TransportationAndDistribution = exports.Calculation = exports.Stationary = exports.Mobile = exports.Fugitive = exports.Location = exports.Client = void 0;
|
|
36
|
+
exports.AuditLog = exports.TypeRecommender = exports.Metadata = exports.PhysicalActivity = exports.RealEstate = exports.EconomicActivity = exports.FactorSets = exports.Factor = exports.Usage = exports.TransportationAndDistribution = exports.Calculation = exports.Stationary = exports.Mobile = exports.Fugitive = exports.Location = exports.Client = void 0;
|
|
37
37
|
var Client_1 = require("./Client");
|
|
38
38
|
Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return Client_1.Client; } });
|
|
39
39
|
exports.Location = __importStar(require("./api/Location"));
|
|
@@ -47,5 +47,7 @@ exports.Factor = __importStar(require("./api/Factor"));
|
|
|
47
47
|
exports.FactorSets = __importStar(require("./api/FactorSets"));
|
|
48
48
|
exports.EconomicActivity = __importStar(require("./api/EconomicActivity"));
|
|
49
49
|
exports.RealEstate = __importStar(require("./api/RealEstate"));
|
|
50
|
+
exports.PhysicalActivity = __importStar(require("./api/PhysicalActivity"));
|
|
50
51
|
exports.Metadata = __importStar(require("./api/Metadata"));
|
|
51
52
|
exports.TypeRecommender = __importStar(require("./api/TypeRecommender"));
|
|
53
|
+
exports.AuditLog = __importStar(require("./api/AuditLog"));
|
|
@@ -12,6 +12,8 @@ export declare const FACTOR_SET_API_PATH = "/v3/carbon/factorset";
|
|
|
12
12
|
export declare const SEARCH_API_PATH = "/v3/carbon/factor/search";
|
|
13
13
|
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
|
+
export declare const PHYSICAL_ACTIVITY_API_PATH = "/v3/carbon/physical-activity";
|
|
16
|
+
export declare const AUDIT_LOG_API_PATH = "/v3/carbon/admin/audit-log";
|
|
15
17
|
export declare const TYPE_RECOMMENDER_API_PATH = "/v3/carbon/recommender/type/search";
|
|
16
18
|
export declare const USAGE_API = "/v3/carbon/usage";
|
|
17
19
|
export declare const METADATA_TYPES_ENDPOINT = "/v3/carbon/metadata/types";
|
|
@@ -19,6 +21,7 @@ export declare const METADATA_AREA_ENDPOINT = "/v3/carbon/metadata/area";
|
|
|
19
21
|
export declare const METADATA_UNITS_ENDPOINT = "/v3/carbon/metadata/units";
|
|
20
22
|
export declare const GET = "GET";
|
|
21
23
|
export declare const POST = "POST";
|
|
24
|
+
export declare const PUT = "PUT";
|
|
22
25
|
export declare const CLIENT_SOURCE_HEADER = "X-Client-Source";
|
|
23
26
|
export declare const CLIENT_SOURCE_EXCEL = "excel";
|
|
24
27
|
export declare const CLIENT_SOURCE_SDK = "node-sdk";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { AuditLogRequest, AuditLogResponse } from "../interfaces/response/AuditLogResponse";
|
|
2
|
+
/**
|
|
3
|
+
* Retrieves the audit log configuration for the organization.
|
|
4
|
+
*
|
|
5
|
+
* Controls whether the organization's API requests and responses are stored for auditing.
|
|
6
|
+
* Organizations can disable this if they don't need their API calls to be audited.
|
|
7
|
+
*
|
|
8
|
+
* @export
|
|
9
|
+
* @return {Promise<AuditLogResponse>} Current audit log configuration
|
|
10
|
+
* @throws {Error} Throws error for 403 (Forbidden) or other failures
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* const config = await getConfig();
|
|
14
|
+
* // Output: { logRequest: true, logResponse: false }
|
|
15
|
+
*/
|
|
16
|
+
export declare function getAuditConfig(): Promise<AuditLogResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* Updates the audit log configuration for the organization.
|
|
19
|
+
*
|
|
20
|
+
* Controls whether the organization's API requests and responses are stored for auditing.
|
|
21
|
+
* Organizations can disable this if they don't need their API calls to be audited.
|
|
22
|
+
*
|
|
23
|
+
* Note: If the configuration is already set to the requested values, the API will return
|
|
24
|
+
* a 409 Conflict status with a message indicating no change was made. This is handled
|
|
25
|
+
* gracefully and the current configuration is returned.
|
|
26
|
+
*
|
|
27
|
+
* @export
|
|
28
|
+
* @param {AuditLogRequest} payload - Audit log configuration
|
|
29
|
+
* @return {Promise<AuditLogResponse>} Updated configuration or current configuration if no change
|
|
30
|
+
* @throws {Error} Throws error for 400 (Bad Request), 403 (Forbidden), or other failures
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* const result = await update({ logRequest: false, logResponse: false });
|
|
34
|
+
* // If already set to these values:
|
|
35
|
+
* // { logRequest: false, logResponse: false, message: "No change in audit log configuration" }
|
|
36
|
+
*/
|
|
37
|
+
export declare function updateAuditConfig(payload: AuditLogRequest): Promise<AuditLogResponse>;
|
|
@@ -3,6 +3,7 @@ import { EmissionResponse } from "../interfaces/response/EmissionResponse";
|
|
|
3
3
|
import { EmissionResponseWithDetails } from "../interfaces/response/EmissionResponseWithDetails";
|
|
4
4
|
/**
|
|
5
5
|
* Performs scope 3 Spend based emission calculations by making a POST request to the economic activity API endpoint.
|
|
6
|
+
* Supports optional attribution with revenue for proportional allocation.
|
|
6
7
|
*
|
|
7
8
|
* @export
|
|
8
9
|
* @param {CommonRequest} payload - The request data to be sent to the API
|
|
@@ -10,6 +11,7 @@ import { EmissionResponseWithDetails } from "../interfaces/response/EmissionResp
|
|
|
10
11
|
* @throws {Error} May throw an error if the API request fails
|
|
11
12
|
*
|
|
12
13
|
* @example
|
|
14
|
+
* // Basic economic activity request
|
|
13
15
|
* const request = {
|
|
14
16
|
"time": {
|
|
15
17
|
"date": "2025-01-04"
|
|
@@ -25,5 +27,27 @@ import { EmissionResponseWithDetails } from "../interfaces/response/EmissionResp
|
|
|
25
27
|
"includeDetails": false
|
|
26
28
|
};
|
|
27
29
|
* const result = await calculate(request);
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* // Economic activity request with revenue attribution
|
|
33
|
+
* const requestWithAttribution = {
|
|
34
|
+
"time": {
|
|
35
|
+
"date": "2025-01-04"
|
|
36
|
+
},
|
|
37
|
+
"location": {
|
|
38
|
+
"country": "usa"
|
|
39
|
+
},
|
|
40
|
+
"activity": {
|
|
41
|
+
"type": "accomodation",
|
|
42
|
+
"value": 1500.12,
|
|
43
|
+
"unit": "usd"
|
|
44
|
+
},
|
|
45
|
+
"attribution": {
|
|
46
|
+
"outstandingAmount": 500000.0,
|
|
47
|
+
"revenue": 2000000.0
|
|
48
|
+
},
|
|
49
|
+
"includeDetails": true
|
|
50
|
+
};
|
|
51
|
+
* const resultWithAttribution = await calculate(requestWithAttribution);
|
|
28
52
|
*/
|
|
29
53
|
export declare function calculate(payload: CommonRequest): Promise<EmissionResponse | EmissionResponseWithDetails>;
|