@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.
@@ -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 ?? this.client.settings.defaultZone)}/images/${validatePathParam('id', imageReq.id)}`
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) => ({
@@ -1,4 +1,2 @@
1
- import * as index$1 from './v1alpha1/index.js';
2
- export { index$1 as v1alpha1 };
3
1
  import * as index_gen from './v1/index.gen.js';
4
2
  export { index_gen as v1 };
@@ -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) === false && objT === 'object';
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 };