@scaleway/sdk 2.33.0 → 2.35.0
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/api/baremetal/v1/api.gen.d.ts +1 -1
- package/dist/api/block/v1alpha1/api.gen.d.ts +1 -1
- package/dist/api/cockpit/v1/api.gen.cjs +26 -0
- package/dist/api/cockpit/v1/api.gen.d.ts +12 -1
- package/dist/api/cockpit/v1/api.gen.js +27 -1
- package/dist/api/cockpit/v1/index.gen.d.ts +1 -1
- package/dist/api/cockpit/v1/marshalling.gen.cjs +26 -0
- package/dist/api/cockpit/v1/marshalling.gen.d.ts +2 -1
- package/dist/api/cockpit/v1/marshalling.gen.js +26 -0
- package/dist/api/cockpit/v1/types.gen.d.ts +34 -0
- package/dist/api/cockpit/v1/validation-rules.gen.cjs +10 -0
- package/dist/api/cockpit/v1/validation-rules.gen.d.ts +9 -0
- package/dist/api/cockpit/v1/validation-rules.gen.js +10 -0
- package/dist/api/dedibox/v1/types.gen.d.ts +2 -2
- package/dist/api/function/v1beta1/types.gen.d.ts +1 -1
- package/dist/api/instance/v1/api.utils.cjs +1 -2
- package/dist/api/instance/v1/api.utils.js +1 -2
- package/dist/api/ipam/v1/marshalling.gen.cjs +1 -1
- package/dist/api/ipam/v1/marshalling.gen.js +1 -1
- package/dist/api/ipam/v1/types.gen.d.ts +1 -1
- package/dist/api/lb/v1/types.gen.d.ts +4 -4
- package/dist/api/tem/v1alpha1/api.gen.cjs +7 -1
- package/dist/api/tem/v1alpha1/api.gen.js +7 -1
- package/dist/api/tem/v1alpha1/marshalling.gen.cjs +2 -1
- package/dist/api/tem/v1alpha1/marshalling.gen.js +2 -1
- package/dist/api/tem/v1alpha1/types.gen.d.ts +15 -1
- package/dist/api/tem/v1alpha1/validation-rules.gen.cjs +64 -0
- package/dist/api/tem/v1alpha1/validation-rules.gen.d.ts +57 -0
- package/dist/api/tem/v1alpha1/validation-rules.gen.js +64 -0
- package/dist/helpers/marshalling.cjs +2 -4
- package/dist/helpers/marshalling.js +2 -4
- package/dist/internal/async/interval-retrier.cjs +2 -4
- package/dist/internal/async/interval-retrier.js +2 -4
- package/dist/scw/auth.cjs +2 -4
- package/dist/scw/auth.js +2 -4
- package/dist/scw/constants.cjs +1 -1
- package/dist/scw/constants.d.ts +2 -2
- package/dist/scw/constants.js +1 -1
- package/dist/scw/errors/standard/invalid-arguments-error.cjs +1 -2
- package/dist/scw/errors/standard/invalid-arguments-error.js +1 -2
- package/dist/scw/errors/standard/out-of-stock-error.cjs +1 -2
- package/dist/scw/errors/standard/out-of-stock-error.js +1 -2
- package/dist/scw/errors/standard/permissions-denied-error.cjs +1 -2
- package/dist/scw/errors/standard/permissions-denied-error.js +1 -2
- package/dist/scw/errors/standard/quotas-exceeded-error.cjs +1 -2
- package/dist/scw/errors/standard/quotas-exceeded-error.js +1 -2
- package/dist/scw/errors/standard/too-many-requests-error.cjs +1 -2
- package/dist/scw/errors/standard/too-many-requests-error.js +1 -2
- package/dist/scw/fetch/resource-paginator.cjs +1 -2
- package/dist/scw/fetch/resource-paginator.js +1 -2
- package/dist/scw/fetch/response-parser.cjs +2 -4
- package/dist/scw/fetch/response-parser.js +2 -4
- package/package.json +2 -2
|
@@ -245,7 +245,7 @@ export declare class API extends ParentAPI {
|
|
|
245
245
|
*/
|
|
246
246
|
getOS: (request: Readonly<GetOSRequest>) => Promise<OS>;
|
|
247
247
|
}
|
|
248
|
-
/** Elastic Metal Private Network API. */
|
|
248
|
+
/** Elastic Metal - Private Network API. */
|
|
249
249
|
export declare class PrivateNetworkAPI extends ParentAPI {
|
|
250
250
|
/** Lists the available zones of the API. */
|
|
251
251
|
static readonly LOCALITIES: Zone[];
|
|
@@ -2,7 +2,7 @@ import { API as ParentAPI } from '../../../bridge';
|
|
|
2
2
|
import type { WaitForOptions, Zone } from '../../../bridge';
|
|
3
3
|
import type { CreateSnapshotRequest, CreateVolumeRequest, DeleteSnapshotRequest, DeleteVolumeRequest, ExportSnapshotToObjectStorageRequest, GetSnapshotRequest, GetVolumeRequest, ImportSnapshotFromObjectStorageRequest, ImportSnapshotFromS3Request, ListSnapshotsRequest, ListSnapshotsResponse, ListVolumeTypesRequest, ListVolumeTypesResponse, ListVolumesRequest, ListVolumesResponse, Snapshot, UpdateSnapshotRequest, UpdateVolumeRequest, Volume } from './types.gen';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Block Storage API.
|
|
6
6
|
*
|
|
7
7
|
* This API allows you to manage your Block Storage volumes.
|
|
8
8
|
*/
|
|
@@ -564,6 +564,32 @@ class RegionalAPI extends api.API {
|
|
|
564
564
|
method: "POST",
|
|
565
565
|
path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/contact-points/delete`
|
|
566
566
|
});
|
|
567
|
+
pageOfListManagedAlerts = (request = {}) => this.client.fetch(
|
|
568
|
+
{
|
|
569
|
+
method: "GET",
|
|
570
|
+
path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/managed-alerts`,
|
|
571
|
+
urlParams: marshalling.urlParams(
|
|
572
|
+
["order_by", request.orderBy],
|
|
573
|
+
["page", request.page],
|
|
574
|
+
[
|
|
575
|
+
"page_size",
|
|
576
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
577
|
+
],
|
|
578
|
+
[
|
|
579
|
+
"project_id",
|
|
580
|
+
request.projectId ?? this.client.settings.defaultProjectId
|
|
581
|
+
]
|
|
582
|
+
)
|
|
583
|
+
},
|
|
584
|
+
marshalling_gen.unmarshalListManagedAlertsResponse
|
|
585
|
+
);
|
|
586
|
+
/**
|
|
587
|
+
* List managed alerts. List all managed alerts for the specified Project.
|
|
588
|
+
*
|
|
589
|
+
* @param request - The request {@link RegionalApiListManagedAlertsRequest}
|
|
590
|
+
* @returns A Promise of ListManagedAlertsResponse
|
|
591
|
+
*/
|
|
592
|
+
listManagedAlerts = (request = {}) => resourcePaginator.enrichForPagination("alerts", this.pageOfListManagedAlerts, request);
|
|
567
593
|
/**
|
|
568
594
|
* Enable managed alerts. Enable the sending of managed alerts for the
|
|
569
595
|
* specified Project. Managed alerts are predefined alerts that apply to
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { API as ParentAPI } from '../../../bridge';
|
|
2
2
|
import type { Region } from '../../../bridge';
|
|
3
|
-
import type { AlertManager, ContactPoint, DataSource, GlobalApiCreateGrafanaUserRequest, GlobalApiDeleteGrafanaUserRequest, GlobalApiGetCurrentPlanRequest, GlobalApiGetGrafanaProductDashboardRequest, GlobalApiGetGrafanaRequest, GlobalApiListGrafanaProductDashboardsRequest, GlobalApiListGrafanaUsersRequest, GlobalApiListPlansRequest, GlobalApiResetGrafanaUserPasswordRequest, GlobalApiSelectPlanRequest, GlobalApiSyncGrafanaDataSourcesRequest, Grafana, GrafanaProductDashboard, GrafanaUser, ListContactPointsResponse, ListDataSourcesResponse, ListGrafanaProductDashboardsResponse, ListGrafanaUsersResponse, ListPlansResponse, ListTokensResponse, Plan, RegionalApiCreateContactPointRequest, RegionalApiCreateDataSourceRequest, RegionalApiCreateTokenRequest, RegionalApiDeleteContactPointRequest, RegionalApiDeleteDataSourceRequest, RegionalApiDeleteTokenRequest, RegionalApiDisableAlertManagerRequest, RegionalApiDisableManagedAlertsRequest, RegionalApiEnableAlertManagerRequest, RegionalApiEnableManagedAlertsRequest, RegionalApiGetAlertManagerRequest, RegionalApiGetDataSourceRequest, RegionalApiGetTokenRequest, RegionalApiGetUsageOverviewRequest, RegionalApiListContactPointsRequest, RegionalApiListDataSourcesRequest, RegionalApiListTokensRequest, RegionalApiTriggerTestAlertRequest, Token, UsageOverview } from './types.gen';
|
|
3
|
+
import type { AlertManager, ContactPoint, DataSource, GlobalApiCreateGrafanaUserRequest, GlobalApiDeleteGrafanaUserRequest, GlobalApiGetCurrentPlanRequest, GlobalApiGetGrafanaProductDashboardRequest, GlobalApiGetGrafanaRequest, GlobalApiListGrafanaProductDashboardsRequest, GlobalApiListGrafanaUsersRequest, GlobalApiListPlansRequest, GlobalApiResetGrafanaUserPasswordRequest, GlobalApiSelectPlanRequest, GlobalApiSyncGrafanaDataSourcesRequest, Grafana, GrafanaProductDashboard, GrafanaUser, ListContactPointsResponse, ListDataSourcesResponse, ListGrafanaProductDashboardsResponse, ListGrafanaUsersResponse, ListManagedAlertsResponse, ListPlansResponse, ListTokensResponse, Plan, RegionalApiCreateContactPointRequest, RegionalApiCreateDataSourceRequest, RegionalApiCreateTokenRequest, RegionalApiDeleteContactPointRequest, RegionalApiDeleteDataSourceRequest, RegionalApiDeleteTokenRequest, RegionalApiDisableAlertManagerRequest, RegionalApiDisableManagedAlertsRequest, RegionalApiEnableAlertManagerRequest, RegionalApiEnableManagedAlertsRequest, RegionalApiGetAlertManagerRequest, RegionalApiGetDataSourceRequest, RegionalApiGetTokenRequest, RegionalApiGetUsageOverviewRequest, RegionalApiListContactPointsRequest, RegionalApiListDataSourcesRequest, RegionalApiListManagedAlertsRequest, RegionalApiListTokensRequest, RegionalApiTriggerTestAlertRequest, Token, UsageOverview } from './types.gen';
|
|
4
4
|
/**
|
|
5
5
|
* Cockpit Global API.
|
|
6
6
|
*
|
|
@@ -283,6 +283,17 @@ export declare class RegionalAPI extends ParentAPI {
|
|
|
283
283
|
* @param request - The request {@link RegionalApiDeleteContactPointRequest}
|
|
284
284
|
*/
|
|
285
285
|
deleteContactPoint: (request?: Readonly<RegionalApiDeleteContactPointRequest>) => Promise<void>;
|
|
286
|
+
protected pageOfListManagedAlerts: (request?: Readonly<RegionalApiListManagedAlertsRequest>) => Promise<ListManagedAlertsResponse>;
|
|
287
|
+
/**
|
|
288
|
+
* List managed alerts. List all managed alerts for the specified Project.
|
|
289
|
+
*
|
|
290
|
+
* @param request - The request {@link RegionalApiListManagedAlertsRequest}
|
|
291
|
+
* @returns A Promise of ListManagedAlertsResponse
|
|
292
|
+
*/
|
|
293
|
+
listManagedAlerts: (request?: Readonly<RegionalApiListManagedAlertsRequest>) => Promise<ListManagedAlertsResponse> & {
|
|
294
|
+
all: () => Promise<import("./types.gen").Alert[]>;
|
|
295
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen").Alert[], void, void>;
|
|
296
|
+
};
|
|
286
297
|
/**
|
|
287
298
|
* Enable managed alerts. Enable the sending of managed alerts for the
|
|
288
299
|
* specified Project. Managed alerts are predefined alerts that apply to
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { API as API$1 } from "../../../scw/api.js";
|
|
2
2
|
import { urlParams, validatePathParam } from "../../../helpers/marshalling.js";
|
|
3
3
|
import { enrichForPagination } from "../../../scw/fetch/resource-paginator.js";
|
|
4
|
-
import { unmarshalGrafana, marshalGlobalApiSyncGrafanaDataSourcesRequest, marshalGlobalApiCreateGrafanaUserRequest, unmarshalGrafanaUser, unmarshalListGrafanaUsersResponse, marshalGlobalApiResetGrafanaUserPasswordRequest, unmarshalListGrafanaProductDashboardsResponse, unmarshalGrafanaProductDashboard, unmarshalListPlansResponse, marshalGlobalApiSelectPlanRequest, unmarshalPlan, marshalRegionalApiCreateDataSourceRequest, unmarshalDataSource, unmarshalListDataSourcesResponse, unmarshalUsageOverview, marshalRegionalApiCreateTokenRequest, unmarshalToken, unmarshalListTokensResponse, unmarshalAlertManager, marshalRegionalApiEnableAlertManagerRequest, marshalRegionalApiDisableAlertManagerRequest, marshalRegionalApiCreateContactPointRequest, unmarshalContactPoint, unmarshalListContactPointsResponse, marshalRegionalApiDeleteContactPointRequest, marshalRegionalApiEnableManagedAlertsRequest, marshalRegionalApiDisableManagedAlertsRequest, marshalRegionalApiTriggerTestAlertRequest } from "./marshalling.gen.js";
|
|
4
|
+
import { unmarshalGrafana, marshalGlobalApiSyncGrafanaDataSourcesRequest, marshalGlobalApiCreateGrafanaUserRequest, unmarshalGrafanaUser, unmarshalListGrafanaUsersResponse, marshalGlobalApiResetGrafanaUserPasswordRequest, unmarshalListGrafanaProductDashboardsResponse, unmarshalGrafanaProductDashboard, unmarshalListPlansResponse, marshalGlobalApiSelectPlanRequest, unmarshalPlan, marshalRegionalApiCreateDataSourceRequest, unmarshalDataSource, unmarshalListDataSourcesResponse, unmarshalUsageOverview, marshalRegionalApiCreateTokenRequest, unmarshalToken, unmarshalListTokensResponse, unmarshalAlertManager, marshalRegionalApiEnableAlertManagerRequest, marshalRegionalApiDisableAlertManagerRequest, marshalRegionalApiCreateContactPointRequest, unmarshalContactPoint, unmarshalListContactPointsResponse, marshalRegionalApiDeleteContactPointRequest, unmarshalListManagedAlertsResponse, marshalRegionalApiEnableManagedAlertsRequest, marshalRegionalApiDisableManagedAlertsRequest, marshalRegionalApiTriggerTestAlertRequest } from "./marshalling.gen.js";
|
|
5
5
|
const jsonContentHeaders = {
|
|
6
6
|
"Content-Type": "application/json; charset=utf-8"
|
|
7
7
|
};
|
|
@@ -562,6 +562,32 @@ class RegionalAPI extends API$1 {
|
|
|
562
562
|
method: "POST",
|
|
563
563
|
path: `/cockpit/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/contact-points/delete`
|
|
564
564
|
});
|
|
565
|
+
pageOfListManagedAlerts = (request = {}) => this.client.fetch(
|
|
566
|
+
{
|
|
567
|
+
method: "GET",
|
|
568
|
+
path: `/cockpit/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/managed-alerts`,
|
|
569
|
+
urlParams: urlParams(
|
|
570
|
+
["order_by", request.orderBy],
|
|
571
|
+
["page", request.page],
|
|
572
|
+
[
|
|
573
|
+
"page_size",
|
|
574
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
575
|
+
],
|
|
576
|
+
[
|
|
577
|
+
"project_id",
|
|
578
|
+
request.projectId ?? this.client.settings.defaultProjectId
|
|
579
|
+
]
|
|
580
|
+
)
|
|
581
|
+
},
|
|
582
|
+
unmarshalListManagedAlertsResponse
|
|
583
|
+
);
|
|
584
|
+
/**
|
|
585
|
+
* List managed alerts. List all managed alerts for the specified Project.
|
|
586
|
+
*
|
|
587
|
+
* @param request - The request {@link RegionalApiListManagedAlertsRequest}
|
|
588
|
+
* @returns A Promise of ListManagedAlertsResponse
|
|
589
|
+
*/
|
|
590
|
+
listManagedAlerts = (request = {}) => enrichForPagination("alerts", this.pageOfListManagedAlerts, request);
|
|
565
591
|
/**
|
|
566
592
|
* Enable managed alerts. Enable the sending of managed alerts for the
|
|
567
593
|
* specified Project. Managed alerts are predefined alerts that apply to
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { GlobalAPI, RegionalAPI } from './api.gen';
|
|
2
|
-
export type { AlertManager, ContactPoint, ContactPointEmail, DataSource, DataSourceOrigin, DataSourceType, GlobalApiCreateGrafanaUserRequest, GlobalApiDeleteGrafanaUserRequest, GlobalApiGetCurrentPlanRequest, GlobalApiGetGrafanaProductDashboardRequest, GlobalApiGetGrafanaRequest, GlobalApiListGrafanaProductDashboardsRequest, GlobalApiListGrafanaUsersRequest, GlobalApiListPlansRequest, GlobalApiResetGrafanaUserPasswordRequest, GlobalApiSelectPlanRequest, GlobalApiSyncGrafanaDataSourcesRequest, Grafana, GrafanaProductDashboard, GrafanaUser, GrafanaUserRole, ListContactPointsResponse, ListDataSourcesRequestOrderBy, ListDataSourcesResponse, ListGrafanaProductDashboardsResponse, ListGrafanaUsersRequestOrderBy, ListGrafanaUsersResponse, ListPlansRequestOrderBy, ListPlansResponse, ListTokensRequestOrderBy, ListTokensResponse, Plan, PlanName, RegionalApiCreateContactPointRequest, RegionalApiCreateDataSourceRequest, RegionalApiCreateTokenRequest, RegionalApiDeleteContactPointRequest, RegionalApiDeleteDataSourceRequest, RegionalApiDeleteTokenRequest, RegionalApiDisableAlertManagerRequest, RegionalApiDisableManagedAlertsRequest, RegionalApiEnableAlertManagerRequest, RegionalApiEnableManagedAlertsRequest, RegionalApiGetAlertManagerRequest, RegionalApiGetDataSourceRequest, RegionalApiGetTokenRequest, RegionalApiGetUsageOverviewRequest, RegionalApiListContactPointsRequest, RegionalApiListDataSourcesRequest, RegionalApiListTokensRequest, RegionalApiTriggerTestAlertRequest, Token, TokenScope, Usage, UsageOverview, UsageUnit, } from './types.gen';
|
|
2
|
+
export type { Alert, AlertManager, ContactPoint, ContactPointEmail, DataSource, DataSourceOrigin, DataSourceType, GlobalApiCreateGrafanaUserRequest, GlobalApiDeleteGrafanaUserRequest, GlobalApiGetCurrentPlanRequest, GlobalApiGetGrafanaProductDashboardRequest, GlobalApiGetGrafanaRequest, GlobalApiListGrafanaProductDashboardsRequest, GlobalApiListGrafanaUsersRequest, GlobalApiListPlansRequest, GlobalApiResetGrafanaUserPasswordRequest, GlobalApiSelectPlanRequest, GlobalApiSyncGrafanaDataSourcesRequest, Grafana, GrafanaProductDashboard, GrafanaUser, GrafanaUserRole, ListContactPointsResponse, ListDataSourcesRequestOrderBy, ListDataSourcesResponse, ListGrafanaProductDashboardsResponse, ListGrafanaUsersRequestOrderBy, ListGrafanaUsersResponse, ListManagedAlertsRequestOrderBy, ListManagedAlertsResponse, ListPlansRequestOrderBy, ListPlansResponse, ListTokensRequestOrderBy, ListTokensResponse, Plan, PlanName, RegionalApiCreateContactPointRequest, RegionalApiCreateDataSourceRequest, RegionalApiCreateTokenRequest, RegionalApiDeleteContactPointRequest, RegionalApiDeleteDataSourceRequest, RegionalApiDeleteTokenRequest, RegionalApiDisableAlertManagerRequest, RegionalApiDisableManagedAlertsRequest, RegionalApiEnableAlertManagerRequest, RegionalApiEnableManagedAlertsRequest, RegionalApiGetAlertManagerRequest, RegionalApiGetDataSourceRequest, RegionalApiGetTokenRequest, RegionalApiGetUsageOverviewRequest, RegionalApiListContactPointsRequest, RegionalApiListDataSourcesRequest, RegionalApiListManagedAlertsRequest, RegionalApiListTokensRequest, RegionalApiTriggerTestAlertRequest, Token, TokenScope, Usage, UsageOverview, UsageUnit, } from './types.gen';
|
|
3
3
|
export * as ValidationRules from './validation-rules.gen';
|
|
@@ -181,6 +181,31 @@ const unmarshalListGrafanaUsersResponse = (data) => {
|
|
|
181
181
|
totalCount: data.total_count
|
|
182
182
|
};
|
|
183
183
|
};
|
|
184
|
+
const unmarshalAlert = (data) => {
|
|
185
|
+
if (!json.isJSONObject(data)) {
|
|
186
|
+
throw new TypeError(
|
|
187
|
+
`Unmarshalling the type 'Alert' failed as data isn't a dictionary.`
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
return {
|
|
191
|
+
description: data.description,
|
|
192
|
+
name: data.name,
|
|
193
|
+
product: data.product,
|
|
194
|
+
productFamily: data.product_family,
|
|
195
|
+
rule: data.rule
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
const unmarshalListManagedAlertsResponse = (data) => {
|
|
199
|
+
if (!json.isJSONObject(data)) {
|
|
200
|
+
throw new TypeError(
|
|
201
|
+
`Unmarshalling the type 'ListManagedAlertsResponse' failed as data isn't a dictionary.`
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
return {
|
|
205
|
+
alerts: marshalling.unmarshalArrayOfObject(data.alerts, unmarshalAlert),
|
|
206
|
+
totalCount: data.total_count
|
|
207
|
+
};
|
|
208
|
+
};
|
|
184
209
|
const unmarshalListPlansResponse = (data) => {
|
|
185
210
|
if (!json.isJSONObject(data)) {
|
|
186
211
|
throw new TypeError(
|
|
@@ -318,6 +343,7 @@ exports.unmarshalListContactPointsResponse = unmarshalListContactPointsResponse;
|
|
|
318
343
|
exports.unmarshalListDataSourcesResponse = unmarshalListDataSourcesResponse;
|
|
319
344
|
exports.unmarshalListGrafanaProductDashboardsResponse = unmarshalListGrafanaProductDashboardsResponse;
|
|
320
345
|
exports.unmarshalListGrafanaUsersResponse = unmarshalListGrafanaUsersResponse;
|
|
346
|
+
exports.unmarshalListManagedAlertsResponse = unmarshalListManagedAlertsResponse;
|
|
321
347
|
exports.unmarshalListPlansResponse = unmarshalListPlansResponse;
|
|
322
348
|
exports.unmarshalListTokensResponse = unmarshalListTokensResponse;
|
|
323
349
|
exports.unmarshalPlan = unmarshalPlan;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DefaultValues } from '../../../bridge';
|
|
2
|
-
import type { AlertManager, ContactPoint, DataSource, GlobalApiCreateGrafanaUserRequest, GlobalApiResetGrafanaUserPasswordRequest, GlobalApiSelectPlanRequest, GlobalApiSyncGrafanaDataSourcesRequest, Grafana, GrafanaProductDashboard, GrafanaUser, ListContactPointsResponse, ListDataSourcesResponse, ListGrafanaProductDashboardsResponse, ListGrafanaUsersResponse, ListPlansResponse, ListTokensResponse, Plan, RegionalApiCreateContactPointRequest, RegionalApiCreateDataSourceRequest, RegionalApiCreateTokenRequest, RegionalApiDeleteContactPointRequest, RegionalApiDisableAlertManagerRequest, RegionalApiDisableManagedAlertsRequest, RegionalApiEnableAlertManagerRequest, RegionalApiEnableManagedAlertsRequest, RegionalApiTriggerTestAlertRequest, Token, UsageOverview } from './types.gen';
|
|
2
|
+
import type { AlertManager, ContactPoint, DataSource, GlobalApiCreateGrafanaUserRequest, GlobalApiResetGrafanaUserPasswordRequest, GlobalApiSelectPlanRequest, GlobalApiSyncGrafanaDataSourcesRequest, Grafana, GrafanaProductDashboard, GrafanaUser, ListContactPointsResponse, ListDataSourcesResponse, ListGrafanaProductDashboardsResponse, ListGrafanaUsersResponse, ListManagedAlertsResponse, ListPlansResponse, ListTokensResponse, Plan, RegionalApiCreateContactPointRequest, RegionalApiCreateDataSourceRequest, RegionalApiCreateTokenRequest, RegionalApiDeleteContactPointRequest, RegionalApiDisableAlertManagerRequest, RegionalApiDisableManagedAlertsRequest, RegionalApiEnableAlertManagerRequest, RegionalApiEnableManagedAlertsRequest, RegionalApiTriggerTestAlertRequest, Token, UsageOverview } from './types.gen';
|
|
3
3
|
export declare const unmarshalContactPoint: (data: unknown) => ContactPoint;
|
|
4
4
|
export declare const unmarshalDataSource: (data: unknown) => DataSource;
|
|
5
5
|
export declare const unmarshalGrafanaProductDashboard: (data: unknown) => GrafanaProductDashboard;
|
|
@@ -12,6 +12,7 @@ export declare const unmarshalListContactPointsResponse: (data: unknown) => List
|
|
|
12
12
|
export declare const unmarshalListDataSourcesResponse: (data: unknown) => ListDataSourcesResponse;
|
|
13
13
|
export declare const unmarshalListGrafanaProductDashboardsResponse: (data: unknown) => ListGrafanaProductDashboardsResponse;
|
|
14
14
|
export declare const unmarshalListGrafanaUsersResponse: (data: unknown) => ListGrafanaUsersResponse;
|
|
15
|
+
export declare const unmarshalListManagedAlertsResponse: (data: unknown) => ListManagedAlertsResponse;
|
|
15
16
|
export declare const unmarshalListPlansResponse: (data: unknown) => ListPlansResponse;
|
|
16
17
|
export declare const unmarshalListTokensResponse: (data: unknown) => ListTokensResponse;
|
|
17
18
|
export declare const unmarshalUsageOverview: (data: unknown) => UsageOverview;
|
|
@@ -179,6 +179,31 @@ const unmarshalListGrafanaUsersResponse = (data) => {
|
|
|
179
179
|
totalCount: data.total_count
|
|
180
180
|
};
|
|
181
181
|
};
|
|
182
|
+
const unmarshalAlert = (data) => {
|
|
183
|
+
if (!isJSONObject(data)) {
|
|
184
|
+
throw new TypeError(
|
|
185
|
+
`Unmarshalling the type 'Alert' failed as data isn't a dictionary.`
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
return {
|
|
189
|
+
description: data.description,
|
|
190
|
+
name: data.name,
|
|
191
|
+
product: data.product,
|
|
192
|
+
productFamily: data.product_family,
|
|
193
|
+
rule: data.rule
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
const unmarshalListManagedAlertsResponse = (data) => {
|
|
197
|
+
if (!isJSONObject(data)) {
|
|
198
|
+
throw new TypeError(
|
|
199
|
+
`Unmarshalling the type 'ListManagedAlertsResponse' failed as data isn't a dictionary.`
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
return {
|
|
203
|
+
alerts: unmarshalArrayOfObject(data.alerts, unmarshalAlert),
|
|
204
|
+
totalCount: data.total_count
|
|
205
|
+
};
|
|
206
|
+
};
|
|
182
207
|
const unmarshalListPlansResponse = (data) => {
|
|
183
208
|
if (!isJSONObject(data)) {
|
|
184
209
|
throw new TypeError(
|
|
@@ -317,6 +342,7 @@ export {
|
|
|
317
342
|
unmarshalListDataSourcesResponse,
|
|
318
343
|
unmarshalListGrafanaProductDashboardsResponse,
|
|
319
344
|
unmarshalListGrafanaUsersResponse,
|
|
345
|
+
unmarshalListManagedAlertsResponse,
|
|
320
346
|
unmarshalListPlansResponse,
|
|
321
347
|
unmarshalListTokensResponse,
|
|
322
348
|
unmarshalPlan,
|
|
@@ -4,6 +4,7 @@ export type DataSourceType = 'unknown_type' | 'metrics' | 'logs' | 'traces';
|
|
|
4
4
|
export type GrafanaUserRole = 'unknown_role' | 'editor' | 'viewer';
|
|
5
5
|
export type ListDataSourcesRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'name_asc' | 'name_desc' | 'type_asc' | 'type_desc';
|
|
6
6
|
export type ListGrafanaUsersRequestOrderBy = 'login_asc' | 'login_desc';
|
|
7
|
+
export type ListManagedAlertsRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'name_asc' | 'name_desc' | 'type_asc' | 'type_desc';
|
|
7
8
|
export type ListPlansRequestOrderBy = 'name_asc' | 'name_desc';
|
|
8
9
|
export type ListTokensRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'name_asc' | 'name_desc';
|
|
9
10
|
export type PlanName = 'unknown_name' | 'free' | 'premium' | 'custom';
|
|
@@ -73,6 +74,13 @@ export interface GrafanaUser {
|
|
|
73
74
|
/** Grafana user's password. */
|
|
74
75
|
password?: string;
|
|
75
76
|
}
|
|
77
|
+
export interface Alert {
|
|
78
|
+
productFamily: string;
|
|
79
|
+
product: string;
|
|
80
|
+
name: string;
|
|
81
|
+
rule: string;
|
|
82
|
+
description: string;
|
|
83
|
+
}
|
|
76
84
|
/** Type of pricing plan. */
|
|
77
85
|
export interface Plan {
|
|
78
86
|
/** Name of a given pricing plan. */
|
|
@@ -272,6 +280,13 @@ export interface ListGrafanaUsersResponse {
|
|
|
272
280
|
/** Grafana users information. */
|
|
273
281
|
grafanaUsers: GrafanaUser[];
|
|
274
282
|
}
|
|
283
|
+
/** Response returned when listing data sources. */
|
|
284
|
+
export interface ListManagedAlertsResponse {
|
|
285
|
+
/** Total count of data sources matching the request. */
|
|
286
|
+
totalCount: number;
|
|
287
|
+
/** Alerts matching the request within the pagination. */
|
|
288
|
+
alerts: Alert[];
|
|
289
|
+
}
|
|
275
290
|
/** Output returned when listing pricing plans. */
|
|
276
291
|
export interface ListPlansResponse {
|
|
277
292
|
/** Total count of available pricing plans. */
|
|
@@ -488,6 +503,25 @@ export type RegionalApiListDataSourcesRequest = {
|
|
|
488
503
|
*/
|
|
489
504
|
types?: DataSourceType[];
|
|
490
505
|
};
|
|
506
|
+
/** Enable the sending of managed alerts. */
|
|
507
|
+
export type RegionalApiListManagedAlertsRequest = {
|
|
508
|
+
/**
|
|
509
|
+
* Region to target. If none is passed will use default region from the
|
|
510
|
+
* config.
|
|
511
|
+
*/
|
|
512
|
+
region?: Region;
|
|
513
|
+
/** Page number to return, from the paginated results. */
|
|
514
|
+
page?: number;
|
|
515
|
+
/** Number of data sources to return per page. */
|
|
516
|
+
pageSize?: number;
|
|
517
|
+
/** Sort order for data sources in the response. */
|
|
518
|
+
orderBy?: ListManagedAlertsRequestOrderBy;
|
|
519
|
+
/**
|
|
520
|
+
* Project ID to filter for, only data sources from this Project will be
|
|
521
|
+
* returned.
|
|
522
|
+
*/
|
|
523
|
+
projectId?: string;
|
|
524
|
+
};
|
|
491
525
|
/** List tokens. */
|
|
492
526
|
export type RegionalApiListTokensRequest = {
|
|
493
527
|
/**
|
|
@@ -32,6 +32,15 @@ const RegionalApiListDataSourcesRequest = {
|
|
|
32
32
|
lessThanOrEqual: 1e3
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
+
const RegionalApiListManagedAlertsRequest = {
|
|
36
|
+
page: {
|
|
37
|
+
greaterThanOrEqual: 1
|
|
38
|
+
},
|
|
39
|
+
pageSize: {
|
|
40
|
+
greaterThanOrEqual: 1,
|
|
41
|
+
lessThanOrEqual: 1e3
|
|
42
|
+
}
|
|
43
|
+
};
|
|
35
44
|
const RegionalApiListTokensRequest = {
|
|
36
45
|
page: {
|
|
37
46
|
greaterThanOrEqual: 1
|
|
@@ -45,4 +54,5 @@ exports.RegionalApiCreateDataSourceRequest = RegionalApiCreateDataSourceRequest;
|
|
|
45
54
|
exports.RegionalApiCreateTokenRequest = RegionalApiCreateTokenRequest;
|
|
46
55
|
exports.RegionalApiListContactPointsRequest = RegionalApiListContactPointsRequest;
|
|
47
56
|
exports.RegionalApiListDataSourcesRequest = RegionalApiListDataSourcesRequest;
|
|
57
|
+
exports.RegionalApiListManagedAlertsRequest = RegionalApiListManagedAlertsRequest;
|
|
48
58
|
exports.RegionalApiListTokensRequest = RegionalApiListTokensRequest;
|
|
@@ -30,6 +30,15 @@ export declare const RegionalApiListDataSourcesRequest: {
|
|
|
30
30
|
lessThanOrEqual: number;
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
|
+
export declare const RegionalApiListManagedAlertsRequest: {
|
|
34
|
+
page: {
|
|
35
|
+
greaterThanOrEqual: number;
|
|
36
|
+
};
|
|
37
|
+
pageSize: {
|
|
38
|
+
greaterThanOrEqual: number;
|
|
39
|
+
lessThanOrEqual: number;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
33
42
|
export declare const RegionalApiListTokensRequest: {
|
|
34
43
|
page: {
|
|
35
44
|
greaterThanOrEqual: number;
|
|
@@ -30,6 +30,15 @@ const RegionalApiListDataSourcesRequest = {
|
|
|
30
30
|
lessThanOrEqual: 1e3
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
+
const RegionalApiListManagedAlertsRequest = {
|
|
34
|
+
page: {
|
|
35
|
+
greaterThanOrEqual: 1
|
|
36
|
+
},
|
|
37
|
+
pageSize: {
|
|
38
|
+
greaterThanOrEqual: 1,
|
|
39
|
+
lessThanOrEqual: 1e3
|
|
40
|
+
}
|
|
41
|
+
};
|
|
33
42
|
const RegionalApiListTokensRequest = {
|
|
34
43
|
page: {
|
|
35
44
|
greaterThanOrEqual: 1
|
|
@@ -44,5 +53,6 @@ export {
|
|
|
44
53
|
RegionalApiCreateTokenRequest,
|
|
45
54
|
RegionalApiListContactPointsRequest,
|
|
46
55
|
RegionalApiListDataSourcesRequest,
|
|
56
|
+
RegionalApiListManagedAlertsRequest,
|
|
47
57
|
RegionalApiListTokensRequest
|
|
48
58
|
};
|
|
@@ -93,7 +93,7 @@ export interface OfferStorageInfo {
|
|
|
93
93
|
}
|
|
94
94
|
export interface IP {
|
|
95
95
|
/** ID of the IP. */
|
|
96
|
-
ipId:
|
|
96
|
+
ipId: number;
|
|
97
97
|
/** Address of the IP. */
|
|
98
98
|
address: string;
|
|
99
99
|
/** Reverse IP value. */
|
|
@@ -721,7 +721,7 @@ export interface Log {
|
|
|
721
721
|
export interface ServerEvent {
|
|
722
722
|
/** ID of the event. */
|
|
723
723
|
eventId: number;
|
|
724
|
-
/**
|
|
724
|
+
/** Description of the event. */
|
|
725
725
|
description: string;
|
|
726
726
|
/** Date of the event. */
|
|
727
727
|
date?: Date;
|
|
@@ -3,7 +3,7 @@ export type CronStatus = 'unknown' | 'ready' | 'deleting' | 'error' | 'locked' |
|
|
|
3
3
|
export type DomainStatus = 'unknown' | 'ready' | 'deleting' | 'error' | 'creating' | 'pending';
|
|
4
4
|
export type FunctionHttpOption = 'unknown_http_option' | 'enabled' | 'redirected';
|
|
5
5
|
export type FunctionPrivacy = 'unknown_privacy' | 'public' | 'private';
|
|
6
|
-
export type FunctionRuntime = 'unknown_runtime' | 'golang' | 'python' | 'python3' | 'node8' | 'node10' | 'node14' | 'node16' | 'node17' | 'python37' | 'python38' | 'python39' | 'python310' | 'go113' | 'go117' | 'go118' | 'node18' | 'rust165' | 'go119' | 'python311' | 'php82' | 'node19' | 'go120' | 'node20' | 'go121' | 'node22' | 'python312' | 'php83' | 'go122' | '
|
|
6
|
+
export type FunctionRuntime = 'unknown_runtime' | 'golang' | 'python' | 'python3' | 'node8' | 'node10' | 'node14' | 'node16' | 'node17' | 'python37' | 'python38' | 'python39' | 'python310' | 'go113' | 'go117' | 'go118' | 'node18' | 'rust165' | 'go119' | 'python311' | 'php82' | 'node19' | 'go120' | 'node20' | 'go121' | 'node22' | 'python312' | 'php83' | 'go122' | 'rust179';
|
|
7
7
|
export type FunctionStatus = 'unknown' | 'ready' | 'deleting' | 'error' | 'locked' | 'creating' | 'pending' | 'created';
|
|
8
8
|
export type ListCronsRequestOrderBy = 'created_at_asc' | 'created_at_desc';
|
|
9
9
|
export type ListDomainsRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'hostname_asc' | 'hostname_desc';
|
|
@@ -5,8 +5,7 @@ const marshalling = require("../../../helpers/marshalling.cjs");
|
|
|
5
5
|
const api_gen = require("./api.gen.cjs");
|
|
6
6
|
const content_gen = require("./content.gen.cjs");
|
|
7
7
|
const validateNotUndefined = (obj) => {
|
|
8
|
-
if (obj === void 0)
|
|
9
|
-
throw new TypeError(`object was found undefined`);
|
|
8
|
+
if (obj === void 0) throw new TypeError(`object was found undefined`);
|
|
10
9
|
return obj;
|
|
11
10
|
};
|
|
12
11
|
class InstanceV1UtilsAPI extends api_gen.API {
|
|
@@ -3,8 +3,7 @@ import { validatePathParam } from "../../../helpers/marshalling.js";
|
|
|
3
3
|
import { API } from "./api.gen.js";
|
|
4
4
|
import { IMAGE_TRANSIENT_STATUSES, PRIVATE_NIC_TRANSIENT_STATUSES, SERVER_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES, VOLUME_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
5
5
|
const validateNotUndefined = (obj) => {
|
|
6
|
-
if (obj === void 0)
|
|
7
|
-
throw new TypeError(`object was found undefined`);
|
|
6
|
+
if (obj === void 0) throw new TypeError(`object was found undefined`);
|
|
8
7
|
return obj;
|
|
9
8
|
};
|
|
10
9
|
class InstanceV1UtilsAPI extends API {
|
|
@@ -53,7 +53,7 @@ const unmarshalIP = (data) => {
|
|
|
53
53
|
region: data.region,
|
|
54
54
|
resource: data.resource ? unmarshalResource(data.resource) : void 0,
|
|
55
55
|
reverses: marshalling.unmarshalArrayOfObject(data.reverses, unmarshalReverse),
|
|
56
|
-
source: unmarshalSource(data.source),
|
|
56
|
+
source: data.source ? unmarshalSource(data.source) : void 0,
|
|
57
57
|
tags: data.tags,
|
|
58
58
|
updatedAt: marshalling.unmarshalDate(data.updated_at),
|
|
59
59
|
zone: data.zone
|
|
@@ -51,7 +51,7 @@ const unmarshalIP = (data) => {
|
|
|
51
51
|
region: data.region,
|
|
52
52
|
resource: data.resource ? unmarshalResource(data.resource) : void 0,
|
|
53
53
|
reverses: unmarshalArrayOfObject(data.reverses, unmarshalReverse),
|
|
54
|
-
source: unmarshalSource(data.source),
|
|
54
|
+
source: data.source ? unmarshalSource(data.source) : void 0,
|
|
55
55
|
tags: data.tags,
|
|
56
56
|
updatedAt: unmarshalDate(data.updated_at),
|
|
57
57
|
zone: data.zone
|
|
@@ -57,7 +57,7 @@ export interface IP {
|
|
|
57
57
|
/** Date the IP was last modified. */
|
|
58
58
|
updatedAt?: Date;
|
|
59
59
|
/** Source pool where the IP was booked in. */
|
|
60
|
-
source
|
|
60
|
+
source?: Source;
|
|
61
61
|
/** Resource which the IP is attached to. */
|
|
62
62
|
resource?: Resource;
|
|
63
63
|
/** Tags for the IP. */
|
|
@@ -884,8 +884,8 @@ export type CreateLbRequest = {
|
|
|
884
884
|
*/
|
|
885
885
|
ipId?: string;
|
|
886
886
|
/**
|
|
887
|
-
* Defines whether to automatically assign a flexible public IP to
|
|
888
|
-
* value is `
|
|
887
|
+
* Defines whether to automatically assign a flexible public IP to the Load
|
|
888
|
+
* Balancer. Default value is `true` (assign).
|
|
889
889
|
*/
|
|
890
890
|
assignFlexibleIp?: boolean;
|
|
891
891
|
/**
|
|
@@ -2024,8 +2024,8 @@ export type ZonedApiCreateLbRequest = {
|
|
|
2024
2024
|
*/
|
|
2025
2025
|
ipId?: string;
|
|
2026
2026
|
/**
|
|
2027
|
-
* Defines whether to automatically assign a flexible public IP to
|
|
2028
|
-
* value is `
|
|
2027
|
+
* Defines whether to automatically assign a flexible public IP to the Load
|
|
2028
|
+
* Balancer. Default value is `true` (assign).
|
|
2029
2029
|
*/
|
|
2030
2030
|
assignFlexibleIp?: boolean;
|
|
2031
2031
|
/**
|
|
@@ -295,12 +295,18 @@ class API extends api.API {
|
|
|
295
295
|
method: "GET",
|
|
296
296
|
path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${marshalling.validatePathParam("webhookId", request.webhookId)}/events`,
|
|
297
297
|
urlParams: marshalling.urlParams(
|
|
298
|
+
["domain_id", request.domainId],
|
|
299
|
+
["email_id", request.emailId],
|
|
300
|
+
["event_types", request.eventTypes],
|
|
298
301
|
["order_by", request.orderBy],
|
|
302
|
+
["organization_id", request.organizationId],
|
|
299
303
|
["page", request.page],
|
|
300
304
|
[
|
|
301
305
|
"page_size",
|
|
302
306
|
request.pageSize ?? this.client.settings.defaultPageSize
|
|
303
|
-
]
|
|
307
|
+
],
|
|
308
|
+
["project_id", request.projectId],
|
|
309
|
+
["statuses", request.statuses]
|
|
304
310
|
)
|
|
305
311
|
},
|
|
306
312
|
marshalling_gen.unmarshalListWebhookEventsResponse
|
|
@@ -293,12 +293,18 @@ class API extends API$1 {
|
|
|
293
293
|
method: "GET",
|
|
294
294
|
path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${validatePathParam("webhookId", request.webhookId)}/events`,
|
|
295
295
|
urlParams: urlParams(
|
|
296
|
+
["domain_id", request.domainId],
|
|
297
|
+
["email_id", request.emailId],
|
|
298
|
+
["event_types", request.eventTypes],
|
|
296
299
|
["order_by", request.orderBy],
|
|
300
|
+
["organization_id", request.organizationId],
|
|
297
301
|
["page", request.page],
|
|
298
302
|
[
|
|
299
303
|
"page_size",
|
|
300
304
|
request.pageSize ?? this.client.settings.defaultPageSize
|
|
301
|
-
]
|
|
305
|
+
],
|
|
306
|
+
["project_id", request.projectId],
|
|
307
|
+
["statuses", request.statuses]
|
|
302
308
|
)
|
|
303
309
|
},
|
|
304
310
|
unmarshalListWebhookEventsResponse
|
|
@@ -221,6 +221,7 @@ const unmarshalWebhookEvent = (data) => {
|
|
|
221
221
|
return {
|
|
222
222
|
createdAt: marshalling.unmarshalDate(data.created_at),
|
|
223
223
|
data: data.data,
|
|
224
|
+
domainId: data.domain_id,
|
|
224
225
|
emailId: data.email_id,
|
|
225
226
|
id: data.id,
|
|
226
227
|
organizationId: data.organization_id,
|
|
@@ -298,7 +299,7 @@ const marshalCreateEmailRequest = (request, defaults) => ({
|
|
|
298
299
|
) : void 0,
|
|
299
300
|
bcc: request.bcc !== void 0 ? request.bcc.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0,
|
|
300
301
|
cc: request.cc !== void 0 ? request.cc.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0,
|
|
301
|
-
from:
|
|
302
|
+
from: marshalCreateEmailRequestAddress(request.from),
|
|
302
303
|
html: request.html,
|
|
303
304
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
304
305
|
send_before: request.sendBefore,
|
|
@@ -219,6 +219,7 @@ const unmarshalWebhookEvent = (data) => {
|
|
|
219
219
|
return {
|
|
220
220
|
createdAt: unmarshalDate(data.created_at),
|
|
221
221
|
data: data.data,
|
|
222
|
+
domainId: data.domain_id,
|
|
222
223
|
emailId: data.email_id,
|
|
223
224
|
id: data.id,
|
|
224
225
|
organizationId: data.organization_id,
|
|
@@ -296,7 +297,7 @@ const marshalCreateEmailRequest = (request, defaults) => ({
|
|
|
296
297
|
) : void 0,
|
|
297
298
|
bcc: request.bcc !== void 0 ? request.bcc.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0,
|
|
298
299
|
cc: request.cc !== void 0 ? request.cc.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0,
|
|
299
|
-
from:
|
|
300
|
+
from: marshalCreateEmailRequestAddress(request.from),
|
|
300
301
|
html: request.html,
|
|
301
302
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
302
303
|
send_before: request.sendBefore,
|
|
@@ -186,6 +186,8 @@ export interface WebhookEvent {
|
|
|
186
186
|
organizationId: string;
|
|
187
187
|
/** ID of the Webhook Event Project. */
|
|
188
188
|
projectId: string;
|
|
189
|
+
/** ID of the webhook event domain. */
|
|
190
|
+
domainId: string;
|
|
189
191
|
/** Type of the Webhook Event. */
|
|
190
192
|
type: WebhookEventType;
|
|
191
193
|
/** Status of the Webhook Event. */
|
|
@@ -257,7 +259,7 @@ export type CreateEmailRequest = {
|
|
|
257
259
|
*/
|
|
258
260
|
region?: Region;
|
|
259
261
|
/** Sender information. Must be from a checked domain declared in the Project. */
|
|
260
|
-
from
|
|
262
|
+
from: CreateEmailRequestAddress;
|
|
261
263
|
/** An array of the primary recipient's information. */
|
|
262
264
|
to?: CreateEmailRequestAddress[];
|
|
263
265
|
/** An array of the carbon copy recipient's information. */
|
|
@@ -431,6 +433,18 @@ export type ListWebhookEventsRequest = {
|
|
|
431
433
|
page?: number;
|
|
432
434
|
/** Requested page size. Value must be between 1 and 100. */
|
|
433
435
|
pageSize?: number;
|
|
436
|
+
/** ID of the email linked to the events. */
|
|
437
|
+
emailId?: string;
|
|
438
|
+
/** List of event types linked to the events. */
|
|
439
|
+
eventTypes?: WebhookEventType[];
|
|
440
|
+
/** List of event statuses. */
|
|
441
|
+
statuses?: WebhookEventStatus[];
|
|
442
|
+
/** ID of the webhook Project. */
|
|
443
|
+
projectId?: string;
|
|
444
|
+
/** ID of the webhook Organization. */
|
|
445
|
+
organizationId?: string;
|
|
446
|
+
/** ID of the domain to watch for triggering events. */
|
|
447
|
+
domainId?: string;
|
|
434
448
|
};
|
|
435
449
|
export interface ListWebhookEventsResponse {
|
|
436
450
|
/** Number of Webhook events matching the requested criteria. */
|
|
@@ -1,5 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const CreateDomainRequest = {
|
|
4
|
+
domainName: {
|
|
5
|
+
maxLength: 255,
|
|
6
|
+
minLength: 1
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
const CreateEmailRequest = {
|
|
10
|
+
subject: {
|
|
11
|
+
minLength: 6
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const CreateEmailRequestAddress = {
|
|
15
|
+
email: {
|
|
16
|
+
minLength: 1
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const CreateEmailRequestAttachment = {
|
|
20
|
+
name: {
|
|
21
|
+
minLength: 1
|
|
22
|
+
},
|
|
23
|
+
type: {
|
|
24
|
+
minLength: 1
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const CreateEmailRequestHeader = {
|
|
28
|
+
key: {
|
|
29
|
+
minLength: 1
|
|
30
|
+
},
|
|
31
|
+
value: {
|
|
32
|
+
minLength: 1
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const ListDomainsRequest = {
|
|
36
|
+
page: {
|
|
37
|
+
greaterThan: 0
|
|
38
|
+
},
|
|
39
|
+
pageSize: {
|
|
40
|
+
greaterThanOrEqual: 1,
|
|
41
|
+
lessThanOrEqual: 1e3
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const ListEmailsRequest = {
|
|
45
|
+
page: {
|
|
46
|
+
greaterThan: 0
|
|
47
|
+
},
|
|
48
|
+
pageSize: {
|
|
49
|
+
greaterThanOrEqual: 1,
|
|
50
|
+
lessThanOrEqual: 1e3
|
|
51
|
+
},
|
|
52
|
+
search: {
|
|
53
|
+
maxLength: 100,
|
|
54
|
+
minLength: 3
|
|
55
|
+
},
|
|
56
|
+
subject: {
|
|
57
|
+
minLength: 6
|
|
58
|
+
}
|
|
59
|
+
};
|
|
3
60
|
const ListWebhookEventsRequest = {
|
|
4
61
|
page: {
|
|
5
62
|
greaterThan: 0
|
|
@@ -28,6 +85,13 @@ const UpdateWebhookRequest = {
|
|
|
28
85
|
minLength: 3
|
|
29
86
|
}
|
|
30
87
|
};
|
|
88
|
+
exports.CreateDomainRequest = CreateDomainRequest;
|
|
89
|
+
exports.CreateEmailRequest = CreateEmailRequest;
|
|
90
|
+
exports.CreateEmailRequestAddress = CreateEmailRequestAddress;
|
|
91
|
+
exports.CreateEmailRequestAttachment = CreateEmailRequestAttachment;
|
|
92
|
+
exports.CreateEmailRequestHeader = CreateEmailRequestHeader;
|
|
93
|
+
exports.ListDomainsRequest = ListDomainsRequest;
|
|
94
|
+
exports.ListEmailsRequest = ListEmailsRequest;
|
|
31
95
|
exports.ListWebhookEventsRequest = ListWebhookEventsRequest;
|
|
32
96
|
exports.ListWebhooksRequest = ListWebhooksRequest;
|
|
33
97
|
exports.UpdateWebhookRequest = UpdateWebhookRequest;
|
|
@@ -1,3 +1,60 @@
|
|
|
1
|
+
export declare const CreateDomainRequest: {
|
|
2
|
+
domainName: {
|
|
3
|
+
maxLength: number;
|
|
4
|
+
minLength: number;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export declare const CreateEmailRequest: {
|
|
8
|
+
subject: {
|
|
9
|
+
minLength: number;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare const CreateEmailRequestAddress: {
|
|
13
|
+
email: {
|
|
14
|
+
minLength: number;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export declare const CreateEmailRequestAttachment: {
|
|
18
|
+
name: {
|
|
19
|
+
minLength: number;
|
|
20
|
+
};
|
|
21
|
+
type: {
|
|
22
|
+
minLength: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export declare const CreateEmailRequestHeader: {
|
|
26
|
+
key: {
|
|
27
|
+
minLength: number;
|
|
28
|
+
};
|
|
29
|
+
value: {
|
|
30
|
+
minLength: number;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export declare const ListDomainsRequest: {
|
|
34
|
+
page: {
|
|
35
|
+
greaterThan: number;
|
|
36
|
+
};
|
|
37
|
+
pageSize: {
|
|
38
|
+
greaterThanOrEqual: number;
|
|
39
|
+
lessThanOrEqual: number;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export declare const ListEmailsRequest: {
|
|
43
|
+
page: {
|
|
44
|
+
greaterThan: number;
|
|
45
|
+
};
|
|
46
|
+
pageSize: {
|
|
47
|
+
greaterThanOrEqual: number;
|
|
48
|
+
lessThanOrEqual: number;
|
|
49
|
+
};
|
|
50
|
+
search: {
|
|
51
|
+
maxLength: number;
|
|
52
|
+
minLength: number;
|
|
53
|
+
};
|
|
54
|
+
subject: {
|
|
55
|
+
minLength: number;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
1
58
|
export declare const ListWebhookEventsRequest: {
|
|
2
59
|
page: {
|
|
3
60
|
greaterThan: number;
|
|
@@ -1,3 +1,60 @@
|
|
|
1
|
+
const CreateDomainRequest = {
|
|
2
|
+
domainName: {
|
|
3
|
+
maxLength: 255,
|
|
4
|
+
minLength: 1
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
const CreateEmailRequest = {
|
|
8
|
+
subject: {
|
|
9
|
+
minLength: 6
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const CreateEmailRequestAddress = {
|
|
13
|
+
email: {
|
|
14
|
+
minLength: 1
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const CreateEmailRequestAttachment = {
|
|
18
|
+
name: {
|
|
19
|
+
minLength: 1
|
|
20
|
+
},
|
|
21
|
+
type: {
|
|
22
|
+
minLength: 1
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const CreateEmailRequestHeader = {
|
|
26
|
+
key: {
|
|
27
|
+
minLength: 1
|
|
28
|
+
},
|
|
29
|
+
value: {
|
|
30
|
+
minLength: 1
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const ListDomainsRequest = {
|
|
34
|
+
page: {
|
|
35
|
+
greaterThan: 0
|
|
36
|
+
},
|
|
37
|
+
pageSize: {
|
|
38
|
+
greaterThanOrEqual: 1,
|
|
39
|
+
lessThanOrEqual: 1e3
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const ListEmailsRequest = {
|
|
43
|
+
page: {
|
|
44
|
+
greaterThan: 0
|
|
45
|
+
},
|
|
46
|
+
pageSize: {
|
|
47
|
+
greaterThanOrEqual: 1,
|
|
48
|
+
lessThanOrEqual: 1e3
|
|
49
|
+
},
|
|
50
|
+
search: {
|
|
51
|
+
maxLength: 100,
|
|
52
|
+
minLength: 3
|
|
53
|
+
},
|
|
54
|
+
subject: {
|
|
55
|
+
minLength: 6
|
|
56
|
+
}
|
|
57
|
+
};
|
|
1
58
|
const ListWebhookEventsRequest = {
|
|
2
59
|
page: {
|
|
3
60
|
greaterThan: 0
|
|
@@ -27,6 +84,13 @@ const UpdateWebhookRequest = {
|
|
|
27
84
|
}
|
|
28
85
|
};
|
|
29
86
|
export {
|
|
87
|
+
CreateDomainRequest,
|
|
88
|
+
CreateEmailRequest,
|
|
89
|
+
CreateEmailRequestAddress,
|
|
90
|
+
CreateEmailRequestAttachment,
|
|
91
|
+
CreateEmailRequestHeader,
|
|
92
|
+
ListDomainsRequest,
|
|
93
|
+
ListEmailsRequest,
|
|
30
94
|
ListWebhookEventsRequest,
|
|
31
95
|
ListWebhooksRequest,
|
|
32
96
|
UpdateWebhookRequest
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
function validatePathParam(name, param) {
|
|
4
|
-
if (typeof param === "string" && param.length > 0)
|
|
5
|
-
|
|
6
|
-
if (typeof param === "number")
|
|
7
|
-
return param.toString();
|
|
4
|
+
if (typeof param === "string" && param.length > 0) return param;
|
|
5
|
+
if (typeof param === "number") return param.toString();
|
|
8
6
|
throw new TypeError(`param ${name} cannot be empty in request`);
|
|
9
7
|
}
|
|
10
8
|
const resolveOneOf = (list, isRequired = false) => {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
function validatePathParam(name, param) {
|
|
2
|
-
if (typeof param === "string" && param.length > 0)
|
|
3
|
-
|
|
4
|
-
if (typeof param === "number")
|
|
5
|
-
return param.toString();
|
|
2
|
+
if (typeof param === "string" && param.length > 0) return param;
|
|
3
|
+
if (typeof param === "number") return param.toString();
|
|
6
4
|
throw new TypeError(`param ${name} cannot be empty in request`);
|
|
7
5
|
}
|
|
8
6
|
const resolveOneOf = (list, isRequired = false) => {
|
|
@@ -27,12 +27,10 @@ const tryAtIntervals = async (retry, strategy, timeout = DEFAULT_TIMEOUT_SECONDS
|
|
|
27
27
|
let retryCount = 0;
|
|
28
28
|
while (Date.now() <= timeoutTimestamp) {
|
|
29
29
|
const delay = strategy.next(retryCount += 1).value * 1e3;
|
|
30
|
-
if (timeoutTimestamp <= Date.now() + delay)
|
|
31
|
-
break;
|
|
30
|
+
if (timeoutTimestamp <= Date.now() + delay) break;
|
|
32
31
|
await sleep.sleep(delay);
|
|
33
32
|
const { value, done } = await retry();
|
|
34
|
-
if (done)
|
|
35
|
-
return value;
|
|
33
|
+
if (done) return value;
|
|
36
34
|
}
|
|
37
35
|
throw new Error(`Timeout after ${timeout}s`);
|
|
38
36
|
};
|
|
@@ -25,12 +25,10 @@ const tryAtIntervals = async (retry, strategy, timeout = DEFAULT_TIMEOUT_SECONDS
|
|
|
25
25
|
let retryCount = 0;
|
|
26
26
|
while (Date.now() <= timeoutTimestamp) {
|
|
27
27
|
const delay = strategy.next(retryCount += 1).value * 1e3;
|
|
28
|
-
if (timeoutTimestamp <= Date.now() + delay)
|
|
29
|
-
break;
|
|
28
|
+
if (timeoutTimestamp <= Date.now() + delay) break;
|
|
30
29
|
await sleep(delay);
|
|
31
30
|
const { value, done } = await retry();
|
|
32
|
-
if (done)
|
|
33
|
-
return value;
|
|
31
|
+
if (done) return value;
|
|
34
32
|
}
|
|
35
33
|
throw new Error(`Timeout after ${timeout}s`);
|
|
36
34
|
};
|
package/dist/scw/auth.cjs
CHANGED
|
@@ -15,10 +15,8 @@ const obfuscateAuthHeadersEntry = ([
|
|
|
15
15
|
name,
|
|
16
16
|
value
|
|
17
17
|
]) => {
|
|
18
|
-
if (name === SESSION_HEADER_KEY)
|
|
19
|
-
|
|
20
|
-
if (name === AUTH_HEADER_KEY)
|
|
21
|
-
return [name, obfuscateUUID(value)];
|
|
18
|
+
if (name === SESSION_HEADER_KEY) return [name, obfuscateToken(value)];
|
|
19
|
+
if (name === AUTH_HEADER_KEY) return [name, obfuscateUUID(value)];
|
|
22
20
|
return [name, value];
|
|
23
21
|
};
|
|
24
22
|
exports.authenticateWithSecrets = authenticateWithSecrets;
|
package/dist/scw/auth.js
CHANGED
|
@@ -13,10 +13,8 @@ const obfuscateAuthHeadersEntry = ([
|
|
|
13
13
|
name,
|
|
14
14
|
value
|
|
15
15
|
]) => {
|
|
16
|
-
if (name === SESSION_HEADER_KEY)
|
|
17
|
-
|
|
18
|
-
if (name === AUTH_HEADER_KEY)
|
|
19
|
-
return [name, obfuscateUUID(value)];
|
|
16
|
+
if (name === SESSION_HEADER_KEY) return [name, obfuscateToken(value)];
|
|
17
|
+
if (name === AUTH_HEADER_KEY) return [name, obfuscateUUID(value)];
|
|
20
18
|
return [name, value];
|
|
21
19
|
};
|
|
22
20
|
export {
|
package/dist/scw/constants.cjs
CHANGED
package/dist/scw/constants.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "v2.
|
|
2
|
-
export declare const userAgent = "scaleway-sdk-js/v2.
|
|
1
|
+
export declare const version = "v2.34.0";
|
|
2
|
+
export declare const userAgent = "scaleway-sdk-js/v2.34.0";
|
package/dist/scw/constants.js
CHANGED
|
@@ -36,8 +36,7 @@ class InvalidArgumentsError extends scwError.ScalewayError {
|
|
|
36
36
|
this.name = "InvalidArgumentsError";
|
|
37
37
|
}
|
|
38
38
|
static fromJSON(status, obj) {
|
|
39
|
-
if (!Array.isArray(obj.details))
|
|
40
|
-
return null;
|
|
39
|
+
if (!Array.isArray(obj.details)) return null;
|
|
41
40
|
return new InvalidArgumentsError(
|
|
42
41
|
status,
|
|
43
42
|
obj,
|
|
@@ -34,8 +34,7 @@ class InvalidArgumentsError extends ScalewayError {
|
|
|
34
34
|
this.name = "InvalidArgumentsError";
|
|
35
35
|
}
|
|
36
36
|
static fromJSON(status, obj) {
|
|
37
|
-
if (!Array.isArray(obj.details))
|
|
38
|
-
return null;
|
|
37
|
+
if (!Array.isArray(obj.details)) return null;
|
|
39
38
|
return new InvalidArgumentsError(
|
|
40
39
|
status,
|
|
41
40
|
obj,
|
|
@@ -10,8 +10,7 @@ class OutOfStockError extends scwError.ScalewayError {
|
|
|
10
10
|
this.name = "OutOfStockError";
|
|
11
11
|
}
|
|
12
12
|
static fromJSON(status, obj) {
|
|
13
|
-
if (typeof obj.resource !== "string")
|
|
14
|
-
return null;
|
|
13
|
+
if (typeof obj.resource !== "string") return null;
|
|
15
14
|
return new OutOfStockError(status, obj, obj.resource);
|
|
16
15
|
}
|
|
17
16
|
}
|
|
@@ -8,8 +8,7 @@ class OutOfStockError extends ScalewayError {
|
|
|
8
8
|
this.name = "OutOfStockError";
|
|
9
9
|
}
|
|
10
10
|
static fromJSON(status, obj) {
|
|
11
|
-
if (typeof obj.resource !== "string")
|
|
12
|
-
return null;
|
|
11
|
+
if (typeof obj.resource !== "string") return null;
|
|
13
12
|
return new OutOfStockError(status, obj, obj.resource);
|
|
14
13
|
}
|
|
15
14
|
}
|
|
@@ -12,8 +12,7 @@ class PermissionsDeniedError extends scwError.ScalewayError {
|
|
|
12
12
|
this.name = "PermissionsDeniedError";
|
|
13
13
|
}
|
|
14
14
|
static fromJSON(status, obj) {
|
|
15
|
-
if (!Array.isArray(obj.details))
|
|
16
|
-
return null;
|
|
15
|
+
if (!Array.isArray(obj.details)) return null;
|
|
17
16
|
return new PermissionsDeniedError(
|
|
18
17
|
status,
|
|
19
18
|
obj,
|
|
@@ -10,8 +10,7 @@ class PermissionsDeniedError extends ScalewayError {
|
|
|
10
10
|
this.name = "PermissionsDeniedError";
|
|
11
11
|
}
|
|
12
12
|
static fromJSON(status, obj) {
|
|
13
|
-
if (!Array.isArray(obj.details))
|
|
14
|
-
return null;
|
|
13
|
+
if (!Array.isArray(obj.details)) return null;
|
|
15
14
|
return new PermissionsDeniedError(
|
|
16
15
|
status,
|
|
17
16
|
obj,
|
|
@@ -24,8 +24,7 @@ class QuotasExceededError extends scwError.ScalewayError {
|
|
|
24
24
|
this.name = "QuotasExceededError";
|
|
25
25
|
}
|
|
26
26
|
static fromJSON(status, obj) {
|
|
27
|
-
if (!Array.isArray(obj.details))
|
|
28
|
-
return null;
|
|
27
|
+
if (!Array.isArray(obj.details)) return null;
|
|
29
28
|
return new QuotasExceededError(
|
|
30
29
|
status,
|
|
31
30
|
obj,
|
|
@@ -22,8 +22,7 @@ class QuotasExceededError extends ScalewayError {
|
|
|
22
22
|
this.name = "QuotasExceededError";
|
|
23
23
|
}
|
|
24
24
|
static fromJSON(status, obj) {
|
|
25
|
-
if (!Array.isArray(obj.details))
|
|
26
|
-
return null;
|
|
25
|
+
if (!Array.isArray(obj.details)) return null;
|
|
27
26
|
return new QuotasExceededError(
|
|
28
27
|
status,
|
|
29
28
|
obj,
|
|
@@ -37,8 +37,7 @@ class TooManyRequestsError extends scwError.ScalewayError {
|
|
|
37
37
|
this.name = "TooManyRequestsError";
|
|
38
38
|
}
|
|
39
39
|
static fromJSON(status, obj) {
|
|
40
|
-
if (typeof obj.help_message !== "string")
|
|
41
|
-
return null;
|
|
40
|
+
if (typeof obj.help_message !== "string") return null;
|
|
42
41
|
let limit;
|
|
43
42
|
if (json.isJSONObject(obj.limit) && typeof obj.limit.quota === "number") {
|
|
44
43
|
limit = {
|
|
@@ -35,8 +35,7 @@ class TooManyRequestsError extends ScalewayError {
|
|
|
35
35
|
this.name = "TooManyRequestsError";
|
|
36
36
|
}
|
|
37
37
|
static fromJSON(status, obj) {
|
|
38
|
-
if (typeof obj.help_message !== "string")
|
|
39
|
-
return null;
|
|
38
|
+
if (typeof obj.help_message !== "string") return null;
|
|
40
39
|
let limit;
|
|
41
40
|
if (isJSONObject(obj.limit) && typeof obj.limit.quota === "number") {
|
|
42
41
|
limit = {
|
|
@@ -12,8 +12,7 @@ function* pages(key, fetcher, request, firstPage) {
|
|
|
12
12
|
page += 1;
|
|
13
13
|
}
|
|
14
14
|
const { length } = firstPage[key];
|
|
15
|
-
if (!length)
|
|
16
|
-
return;
|
|
15
|
+
if (!length) return;
|
|
17
16
|
const { totalCount } = firstPage;
|
|
18
17
|
while (page <= Math.floor((totalCount + length - 1) / length)) {
|
|
19
18
|
yield fetcher({ ...request, page }).then(getList);
|
|
@@ -10,8 +10,7 @@ function* pages(key, fetcher, request, firstPage) {
|
|
|
10
10
|
page += 1;
|
|
11
11
|
}
|
|
12
12
|
const { length } = firstPage[key];
|
|
13
|
-
if (!length)
|
|
14
|
-
return;
|
|
13
|
+
if (!length) return;
|
|
15
14
|
const { totalCount } = firstPage;
|
|
16
15
|
while (page <= Math.floor((totalCount + length - 1) / length)) {
|
|
17
16
|
yield fetcher({ ...request, page }).then(getList);
|
|
@@ -25,8 +25,7 @@ const responseParser = (unmarshaller, responseType) => async (response) => {
|
|
|
25
25
|
throw new TypeError("Invalid response object");
|
|
26
26
|
}
|
|
27
27
|
if (response.ok) {
|
|
28
|
-
if (response.status === 204)
|
|
29
|
-
return unmarshaller(void 0);
|
|
28
|
+
if (response.status === 204) return unmarshaller(void 0);
|
|
30
29
|
const contentType = response.headers.get("Content-Type");
|
|
31
30
|
try {
|
|
32
31
|
if (responseType === "json" && contentType === "application/json") {
|
|
@@ -46,8 +45,7 @@ const responseParser = (unmarshaller, responseType) => async (response) => {
|
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
const error = await response.clone().json().catch(() => response.text());
|
|
49
|
-
if (json.isJSONObject(error))
|
|
50
|
-
throw errorParser.parseScalewayError(response.status, error);
|
|
48
|
+
if (json.isJSONObject(error)) throw errorParser.parseScalewayError(response.status, error);
|
|
51
49
|
throw new scwError.ScalewayError(
|
|
52
50
|
response.status,
|
|
53
51
|
typeof error === "string" ? error : "cannot read error response body"
|
|
@@ -23,8 +23,7 @@ const responseParser = (unmarshaller, responseType) => async (response) => {
|
|
|
23
23
|
throw new TypeError("Invalid response object");
|
|
24
24
|
}
|
|
25
25
|
if (response.ok) {
|
|
26
|
-
if (response.status === 204)
|
|
27
|
-
return unmarshaller(void 0);
|
|
26
|
+
if (response.status === 204) return unmarshaller(void 0);
|
|
28
27
|
const contentType = response.headers.get("Content-Type");
|
|
29
28
|
try {
|
|
30
29
|
if (responseType === "json" && contentType === "application/json") {
|
|
@@ -44,8 +43,7 @@ const responseParser = (unmarshaller, responseType) => async (response) => {
|
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
45
|
const error = await response.clone().json().catch(() => response.text());
|
|
47
|
-
if (isJSONObject(error))
|
|
48
|
-
throw parseScalewayError(response.status, error);
|
|
46
|
+
if (isJSONObject(error)) throw parseScalewayError(response.status, error);
|
|
49
47
|
throw new ScalewayError(
|
|
50
48
|
response.status,
|
|
51
49
|
typeof error === "string" ? error : "cannot read error response body"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.35.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Scaleway SDK.",
|
|
6
6
|
"keywords": [
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"bundledDependencies": [
|
|
40
40
|
"@scaleway/random-name"
|
|
41
41
|
],
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "5577d926122ccbc5b25a5c6f54285abd0fb6e9a5"
|
|
43
43
|
}
|