@scaleway/sdk 0.1.0-beta.34 → 0.1.0-beta.35
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.utils.js +0 -3
- package/dist/api/domain/v2beta1/marshalling.gen.js +3 -0
- package/dist/api/instance/v1/api.utils.js +5 -1
- package/dist/api/lb/v1/marshalling.gen.js +17 -0
- package/dist/api/redis/index.js +0 -2
- package/dist/helpers/json.js +1 -1
- package/dist/index.cjs +429 -975
- package/dist/index.d.ts +1531 -2175
- package/dist/internal/async/interval-retrier.js +1 -0
- package/dist/internal/interceptors/interceptor.js +3 -1
- package/dist/scw/client-settings.js +3 -3
- package/dist/scw/constants.js +1 -1
- package/dist/scw/errors/scw-error.js +3 -0
- package/dist/scw/errors/standard/quotas-exceeded-error.js +1 -1
- package/dist/scw/fetch/response-parser.js +1 -1
- package/package.json +4 -5
- package/dist/api/redis/v1alpha1/api.gen.js +0 -158
- package/dist/api/redis/v1alpha1/content.gen.js +0 -7
- package/dist/api/redis/v1alpha1/index.js +0 -2
- package/dist/api/redis/v1alpha1/marshalling.gen.js +0 -266
|
@@ -12,9 +12,6 @@ class BaremetalV1UtilsAPI extends API {
|
|
|
12
12
|
}
|
|
13
13
|
return server.install;
|
|
14
14
|
});
|
|
15
|
-
if (!value) {
|
|
16
|
-
throw new Error(`Server creation has not begun for server ${request.serverId}`);
|
|
17
|
-
}
|
|
18
15
|
return {
|
|
19
16
|
done: !SERVER_INSTALL_TRANSIENT_STATUSES.includes(value.status),
|
|
20
17
|
value
|
|
@@ -443,7 +443,10 @@ const unmarshalRenewableDomain = data => {
|
|
|
443
443
|
}
|
|
444
444
|
return {
|
|
445
445
|
domain: data.domain,
|
|
446
|
+
estimatedDeleteAt: unmarshalDate(data.estimated_delete_at),
|
|
446
447
|
expiredAt: unmarshalDate(data.expired_at),
|
|
448
|
+
limitRedemptionAt: unmarshalDate(data.limit_redemption_at),
|
|
449
|
+
limitRenewAt: unmarshalDate(data.limit_renew_at),
|
|
447
450
|
organizationId: data.organization_id,
|
|
448
451
|
projectId: data.project_id,
|
|
449
452
|
renewableDurationInYears: data.renewable_duration_in_years,
|
|
@@ -240,10 +240,14 @@ class InstanceV1UtilsAPI extends API {
|
|
|
240
240
|
'Content-Type': 'application/json; charset=utf-8'
|
|
241
241
|
},
|
|
242
242
|
method: 'PUT',
|
|
243
|
-
path: `/instance/v1/zones/${validatePathParam('zone', imageReq.zone
|
|
243
|
+
path: `/instance/v1/zones/${validatePathParam('zone', imageReq.zone)}/images/${validatePathParam('id', imageReq.id)}`
|
|
244
244
|
}, unmarshalSetImageResponse)).then(res => ({
|
|
245
245
|
image: res.image
|
|
246
246
|
}));
|
|
247
|
+
this.getServerUserData = request => this.client.fetch({
|
|
248
|
+
method: 'GET',
|
|
249
|
+
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/user_data/${validatePathParam('key', request.key)}`
|
|
250
|
+
});
|
|
247
251
|
this.setServerUserData = request => this.client.fetch({
|
|
248
252
|
body: request.content,
|
|
249
253
|
headers: {
|
|
@@ -162,6 +162,16 @@ const unmarshalLb = data => {
|
|
|
162
162
|
zone: data.zone
|
|
163
163
|
};
|
|
164
164
|
};
|
|
165
|
+
const unmarshalAclActionRedirect = data => {
|
|
166
|
+
if (!isJSONObject(data)) {
|
|
167
|
+
throw new TypeError(`Unmarshalling the type 'AclActionRedirect' failed as data isn't a dictionary.`);
|
|
168
|
+
}
|
|
169
|
+
return {
|
|
170
|
+
code: data.code,
|
|
171
|
+
target: data.target,
|
|
172
|
+
type: data.type
|
|
173
|
+
};
|
|
174
|
+
};
|
|
165
175
|
const unmarshalBackend = data => {
|
|
166
176
|
if (!isJSONObject(data)) {
|
|
167
177
|
throw new TypeError(`Unmarshalling the type 'Backend' failed as data isn't a dictionary.`);
|
|
@@ -215,6 +225,7 @@ const unmarshalAclAction = data => {
|
|
|
215
225
|
throw new TypeError(`Unmarshalling the type 'AclAction' failed as data isn't a dictionary.`);
|
|
216
226
|
}
|
|
217
227
|
return {
|
|
228
|
+
redirect: data.redirect ? unmarshalAclActionRedirect(data.redirect) : undefined,
|
|
218
229
|
type: data.type
|
|
219
230
|
};
|
|
220
231
|
};
|
|
@@ -455,7 +466,13 @@ const unmarshalSetAclsResponse = data => {
|
|
|
455
466
|
totalCount: data.total_count
|
|
456
467
|
};
|
|
457
468
|
};
|
|
469
|
+
const marshalAclActionRedirect = (request, defaults) => ({
|
|
470
|
+
code: request.code,
|
|
471
|
+
target: request.target,
|
|
472
|
+
type: request.type
|
|
473
|
+
});
|
|
458
474
|
const marshalAclAction = (request, defaults) => ({
|
|
475
|
+
redirect: request.redirect ? marshalAclActionRedirect(request.redirect) : undefined,
|
|
459
476
|
type: request.type
|
|
460
477
|
});
|
|
461
478
|
const marshalAclMatch = (request, defaults) => ({
|
package/dist/api/redis/index.js
CHANGED
package/dist/helpers/json.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
const isJSONObject = obj => {
|
|
7
7
|
const objT = typeof obj;
|
|
8
|
-
return obj !== undefined && obj !== null && objT !== 'string' && objT !== 'number' && objT !== 'boolean' && Array.isArray(obj)
|
|
8
|
+
return obj !== undefined && obj !== null && objT !== 'string' && objT !== 'number' && objT !== 'boolean' && !Array.isArray(obj) && objT === 'object';
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { isJSONObject };
|