@scaleway/sdk-environmental-footprint 2.4.0 → 2.5.1
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/dist/v1alpha1/api.gen.js
CHANGED
|
@@ -16,10 +16,7 @@ class UserAPI extends API {
|
|
|
16
16
|
path: `/environmental-footprint/v1alpha1/reports/availability`,
|
|
17
17
|
urlParams: urlParams(
|
|
18
18
|
["end_date", request.endDate],
|
|
19
|
-
[
|
|
20
|
-
"organization_id",
|
|
21
|
-
request.organizationId ?? this.client.settings.defaultOrganizationId
|
|
22
|
-
],
|
|
19
|
+
["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId],
|
|
23
20
|
["start_date", request.startDate]
|
|
24
21
|
)
|
|
25
22
|
},
|
|
@@ -31,27 +28,23 @@ class UserAPI extends API {
|
|
|
31
28
|
* @param request - The request {@link UserApiDownloadImpactReportRequest}
|
|
32
29
|
* @returns A Promise of Blob
|
|
33
30
|
*/
|
|
34
|
-
downloadImpactReport = (request = {}) => this.client.fetch(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
request,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
["type", request.type]
|
|
52
|
-
),
|
|
53
|
-
responseType: "blob"
|
|
54
|
-
});
|
|
31
|
+
downloadImpactReport = (request = {}) => this.client.fetch(
|
|
32
|
+
{
|
|
33
|
+
body: JSON.stringify(
|
|
34
|
+
marshalUserApiDownloadImpactReportRequest(request, this.client.settings)
|
|
35
|
+
),
|
|
36
|
+
headers: jsonContentHeaders,
|
|
37
|
+
method: "POST",
|
|
38
|
+
path: `/environmental-footprint/v1alpha1/reports/download`,
|
|
39
|
+
urlParams: urlParams(
|
|
40
|
+
["dl", 1],
|
|
41
|
+
["date", request.date],
|
|
42
|
+
["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId],
|
|
43
|
+
["type", request.type]
|
|
44
|
+
),
|
|
45
|
+
responseType: "blob"
|
|
46
|
+
}
|
|
47
|
+
);
|
|
55
48
|
/**
|
|
56
49
|
* Retrieve detailed impact data. Retrieve detailed impact data for your Scaleway projects within a specified date range. Filter by project ID, region, zone, service category, and/or product category.
|
|
57
50
|
*
|
|
@@ -64,10 +57,7 @@ class UserAPI extends API {
|
|
|
64
57
|
path: `/environmental-footprint/v1alpha1/data/query`,
|
|
65
58
|
urlParams: urlParams(
|
|
66
59
|
["end_date", request.endDate],
|
|
67
|
-
[
|
|
68
|
-
"organization_id",
|
|
69
|
-
request.organizationId ?? this.client.settings.defaultOrganizationId
|
|
70
|
-
],
|
|
60
|
+
["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId],
|
|
71
61
|
["product_categories", request.productCategories],
|
|
72
62
|
["project_ids", request.projectIds],
|
|
73
63
|
["regions", request.regions],
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { UserAPI } from './api.gen.js';
|
|
1
|
+
export { UserAPI, } from './api.gen.js';
|
|
2
2
|
export * from './marshalling.gen.js';
|
|
3
3
|
export type { Impact, ImpactDataResponse, ImpactReportAvailability, ProductCategory, ProjectImpact, RegionImpact, ReportType, ServiceCategory, SkuImpact, UserApiDownloadImpactReportRequest, UserApiGetImpactDataRequest, UserApiGetImpactReportAvailabilityRequest, ZoneImpact, } from './types.gen.js';
|
|
@@ -79,14 +79,8 @@ const unmarshalImpactReportAvailability = (data) => {
|
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
81
|
return {
|
|
82
|
-
monthSummaryReports: unmarshalArrayOfObject(
|
|
83
|
-
|
|
84
|
-
unmarshalDate
|
|
85
|
-
),
|
|
86
|
-
yearlySummaryReports: unmarshalArrayOfObject(
|
|
87
|
-
data.yearly_summary_reports,
|
|
88
|
-
unmarshalDate
|
|
89
|
-
)
|
|
82
|
+
monthSummaryReports: unmarshalArrayOfObject(data.month_summary_reports, unmarshalDate),
|
|
83
|
+
yearlySummaryReports: unmarshalArrayOfObject(data.yearly_summary_reports, unmarshalDate)
|
|
90
84
|
};
|
|
91
85
|
};
|
|
92
86
|
const marshalUserApiDownloadImpactReportRequest = (request, defaults) => ({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Region as ScwRegion, Zone as ScwZone } from '@scaleway/sdk-client';
|
|
2
|
-
export type ProductCategory = 'unknown_product_category' | 'apple_silicon' | 'block_storage' | 'dedibox' | 'elastic_metal' | 'instances' | 'object_storage' | 'load_balancer';
|
|
2
|
+
export type ProductCategory = 'unknown_product_category' | 'apple_silicon' | 'block_storage' | 'dedibox' | 'elastic_metal' | 'instances' | 'object_storage' | 'load_balancer' | 'kubernetes';
|
|
3
3
|
export type ReportType = 'unknown_report_type' | 'monthly' | 'yearly';
|
|
4
|
-
export type ServiceCategory = 'unknown_service_category' | 'baremetal' | 'compute' | 'storage' | 'network';
|
|
4
|
+
export type ServiceCategory = 'unknown_service_category' | 'baremetal' | 'compute' | 'storage' | 'network' | 'containers';
|
|
5
5
|
export interface Impact {
|
|
6
6
|
/**
|
|
7
7
|
* The estimated carbon emissions in kilograms of CO₂ equivalent (kgCO₂e).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk-environmental-footprint",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"description": "Scaleway SDK environmental-footprint",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"files": [
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@scaleway/random-name": "5.1.2",
|
|
30
|
-
"@scaleway/sdk-std": "2.1.
|
|
30
|
+
"@scaleway/sdk-std": "2.1.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@scaleway/sdk-client": "^2.1.0"
|