@scaleway/sdk 1.6.0 → 1.8.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.
Files changed (38) hide show
  1. package/dist/api/applesilicon/v1alpha1/api.gen.js +5 -4
  2. package/dist/api/baremetal/v1/api.gen.js +6 -6
  3. package/dist/api/baremetal/v1/api.utils.js +1 -1
  4. package/dist/api/cockpit/v1beta1/api.gen.js +39 -30
  5. package/dist/api/container/v1beta1/api.gen.js +35 -33
  6. package/dist/api/container/v1beta1/marshalling.gen.js +3 -1
  7. package/dist/api/domain/v2beta1/api.gen.js +63 -54
  8. package/dist/api/flexibleip/v1alpha1/api.gen.js +28 -15
  9. package/dist/api/function/v1beta1/api.gen.js +39 -30
  10. package/dist/api/function/v1beta1/marshalling.gen.js +1 -0
  11. package/dist/api/iam/v1alpha1/api.gen.js +2 -3
  12. package/dist/api/iam/v1alpha1/marshalling.gen.js +1 -0
  13. package/dist/api/instance/v1/api.gen.js +2 -2
  14. package/dist/api/instance/v1/api.utils.js +7 -13
  15. package/dist/api/iot/v1/api.gen.js +68 -36
  16. package/dist/api/k8s/v1/api.gen.js +4 -4
  17. package/dist/api/lb/v1/api.gen.js +4 -4
  18. package/dist/api/lb/v1/api.utils.js +4 -4
  19. package/dist/api/marketplace/v2/api.gen.js +46 -3
  20. package/dist/api/mnq/v1alpha1/api.gen.js +36 -13
  21. package/dist/api/mnq/v1alpha1/marshalling.gen.js +3 -9
  22. package/dist/api/rdb/v1/api.gen.js +5 -5
  23. package/dist/api/redis/v1/api.gen.js +1 -1
  24. package/dist/api/registry/v1/api.gen.js +44 -22
  25. package/dist/api/secret/v1alpha1/api.gen.js +29 -18
  26. package/dist/api/secret/v1alpha1/marshalling.gen.js +8 -1
  27. package/dist/api/tem/v1alpha1/api.gen.js +3 -7
  28. package/dist/api/test/v1/api.gen.js +1 -1
  29. package/dist/api/vpc/v1/api.gen.js +13 -5
  30. package/dist/api/vpcgw/v1/api.gen.js +2 -2
  31. package/dist/api/webhosting/v1alpha1/api.gen.js +1 -1
  32. package/dist/helpers/marshalling.js +1 -1
  33. package/dist/index.cjs +457 -269
  34. package/dist/index.d.ts +1412 -736
  35. package/dist/internal/async/interval-retrier.js +2 -2
  36. package/dist/scw/constants.js +1 -1
  37. package/dist/scw/custom-marshalling.js +4 -7
  38. package/package.json +2 -2
@@ -31,7 +31,8 @@ class API extends API$1 {
31
31
  }, unmarshalListNamespacesResponse);
32
32
  };
33
33
  /**
34
- * List all your namespaces.
34
+ * List all your namespaces. List all existing namespaces in the specified
35
+ * region.
35
36
  *
36
37
  * @param request - The request {@link ListNamespacesRequest}
37
38
  * @returns A Promise of ListNamespacesResponse
@@ -43,7 +44,7 @@ class API extends API$1 {
43
44
  return enrichForPagination('namespaces', _this.pageOfListNamespaces, request);
44
45
  };
45
46
  /**
46
- * Get a namespace. Get the namespace associated with the given id.
47
+ * Get a namespace. Get the namespace associated with the specified ID.
47
48
  *
48
49
  * @param request - The request {@link GetNamespaceRequest}
49
50
  * @returns A Promise of Namespace
@@ -59,9 +60,10 @@ class API extends API$1 {
59
60
  * @param options - The waiting options
60
61
  * @returns A Promise of Namespace
61
62
  */
62
- this.waitForNamespace = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES.includes(res.status))), this.getNamespace, request, options);
63
+ this.waitForNamespace = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES.includes(res.status))), this.getNamespace, request, options);
63
64
  /**
64
- * Create a new namespace.
65
+ * Create a new namespace. Create a new namespace in a specified Organization
66
+ * or Proejct.
65
67
  *
66
68
  * @param request - The request {@link CreateNamespaceRequest}
67
69
  * @returns A Promise of Namespace
@@ -78,8 +80,8 @@ class API extends API$1 {
78
80
  }, unmarshalNamespace);
79
81
  };
80
82
  /**
81
- * Update an existing namespace. Update the space associated with the given
82
- * id.
83
+ * Update an existing namespace. Update the namespace associated with the
84
+ * specified ID.
83
85
  *
84
86
  * @param request - The request {@link UpdateNamespaceRequest}
85
87
  * @returns A Promise of Namespace
@@ -92,7 +94,7 @@ class API extends API$1 {
92
94
  }, unmarshalNamespace);
93
95
  /**
94
96
  * Delete an existing namespace. Delete the namespace associated with the
95
- * given id.
97
+ * specified ID.
96
98
  *
97
99
  * @param request - The request {@link DeleteNamespaceRequest}
98
100
  * @returns A Promise of Namespace
@@ -114,7 +116,7 @@ class API extends API$1 {
114
116
  */
115
117
  this.listFunctions = request => enrichForPagination('functions', this.pageOfListFunctions, request);
116
118
  /**
117
- * Get a function. Get the function associated with the given id.
119
+ * Get a function. Get the function associated with the specified ID.
118
120
  *
119
121
  * @param request - The request {@link GetFunctionRequest}
120
122
  * @returns A Promise of Function
@@ -130,9 +132,10 @@ class API extends API$1 {
130
132
  * @param options - The waiting options
131
133
  * @returns A Promise of Function
132
134
  */
133
- this.waitForFunction = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!FUNCTION_TRANSIENT_STATUSES.includes(res.status))), this.getFunction, request, options);
135
+ this.waitForFunction = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!FUNCTION_TRANSIENT_STATUSES.includes(res.status))), this.getFunction, request, options);
134
136
  /**
135
- * Create a new function.
137
+ * Create a new function. Create a new function in the specified region for a
138
+ * specified Organization or Project.
136
139
  *
137
140
  * @param request - The request {@link CreateFunctionRequest}
138
141
  * @returns A Promise of Function
@@ -144,8 +147,8 @@ class API extends API$1 {
144
147
  path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions`
145
148
  }, unmarshalFunction);
146
149
  /**
147
- * Update an existing function. Update the function associated with the given
148
- * id.
150
+ * Update an existing function. Update the function associated with the
151
+ * specified ID.
149
152
  *
150
153
  * @param request - The request {@link UpdateFunctionRequest}
151
154
  * @returns A Promise of Function
@@ -157,7 +160,7 @@ class API extends API$1 {
157
160
  path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}`
158
161
  }, unmarshalFunction);
159
162
  /**
160
- * Delete a function. Delete the function associated with the given id.
163
+ * Delete a function. Delete the function associated with the specified ID.
161
164
  *
162
165
  * @param request - The request {@link DeleteFunctionRequest}
163
166
  * @returns A Promise of Function
@@ -167,7 +170,7 @@ class API extends API$1 {
167
170
  path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}`
168
171
  }, unmarshalFunction);
169
172
  /**
170
- * Deploy a function. Deploy a function associated with the given id.
173
+ * Deploy a function. Deploy a function associated with the specified ID.
171
174
  *
172
175
  * @param request - The request {@link DeployFunctionRequest}
173
176
  * @returns A Promise of Function
@@ -195,7 +198,7 @@ class API extends API$1 {
195
198
  };
196
199
  /**
197
200
  * Get an upload URL of a function. Get an upload URL of a function associated
198
- * with the given id.
201
+ * with the specified ID.
199
202
  *
200
203
  * @param request - The request {@link GetFunctionUploadURLRequest}
201
204
  * @returns A Promise of UploadURL
@@ -207,7 +210,7 @@ class API extends API$1 {
207
210
  }, unmarshalUploadURL);
208
211
  /**
209
212
  * Get a download URL of a function. Get a download URL for a function
210
- * associated with the given id.
213
+ * associated with the specified ID.
211
214
  *
212
215
  * @param request - The request {@link GetFunctionDownloadURLRequest}
213
216
  * @returns A Promise of DownloadURL
@@ -222,14 +225,14 @@ class API extends API$1 {
222
225
  urlParams: urlParams(['function_id', request.functionId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
223
226
  }, unmarshalListCronsResponse);
224
227
  /**
225
- * List all your crons.
228
+ * List all crons. List all the cronjobs in a specified region.
226
229
  *
227
230
  * @param request - The request {@link ListCronsRequest}
228
231
  * @returns A Promise of ListCronsResponse
229
232
  */
230
233
  this.listCrons = request => enrichForPagination('crons', this.pageOfListCrons, request);
231
234
  /**
232
- * Get a cron. Get the cron associated with the given id.
235
+ * Get a cron. Get the cron associated with the specified ID.
233
236
  *
234
237
  * @param request - The request {@link GetCronRequest}
235
238
  * @returns A Promise of Cron
@@ -245,9 +248,10 @@ class API extends API$1 {
245
248
  * @param options - The waiting options
246
249
  * @returns A Promise of Cron
247
250
  */
248
- this.waitForCron = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!CRON_TRANSIENT_STATUSES.includes(res.status))), this.getCron, request, options);
251
+ this.waitForCron = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CRON_TRANSIENT_STATUSES.includes(res.status))), this.getCron, request, options);
249
252
  /**
250
- * Create a new cron.
253
+ * Create a new cron. Create a new cronjob for a function with the specified
254
+ * ID.
251
255
  *
252
256
  * @param request - The request {@link CreateCronRequest}
253
257
  * @returns A Promise of Cron
@@ -259,7 +263,7 @@ class API extends API$1 {
259
263
  path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons`
260
264
  }, unmarshalCron);
261
265
  /**
262
- * Update an existing cron. Update the cron associated with the given id.
266
+ * Update an existing cron. Update the cron associated with the specified ID.
263
267
  *
264
268
  * @param request - The request {@link UpdateCronRequest}
265
269
  * @returns A Promise of Cron
@@ -271,7 +275,7 @@ class API extends API$1 {
271
275
  path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}`
272
276
  }, unmarshalCron);
273
277
  /**
274
- * Delete an existing cron. Delete the cron associated with the given id.
278
+ * Delete an existing cron. Delete the cron associated with the specified ID.
275
279
  *
276
280
  * @param request - The request {@link DeleteCronRequest}
277
281
  * @returns A Promise of Cron
@@ -286,7 +290,8 @@ class API extends API$1 {
286
290
  urlParams: urlParams(['order_by', request.orderBy ?? 'timestamp_desc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
287
291
  }, unmarshalListLogsResponse);
288
292
  /**
289
- * List your application logs.
293
+ * List application logs. List the application logs of the function with the
294
+ * specified ID.
290
295
  *
291
296
  * @param request - The request {@link ListLogsRequest}
292
297
  * @returns A Promise of ListLogsResponse
@@ -298,14 +303,16 @@ class API extends API$1 {
298
303
  urlParams: urlParams(['function_id', request.functionId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
299
304
  }, unmarshalListDomainsResponse);
300
305
  /**
301
- * List all domain name bindings.
306
+ * List all domain name bindings. List all domain name bindings in a specified
307
+ * region.
302
308
  *
303
309
  * @param request - The request {@link ListDomainsRequest}
304
310
  * @returns A Promise of ListDomainsResponse
305
311
  */
306
312
  this.listDomains = request => enrichForPagination('domains', this.pageOfListDomains, request);
307
313
  /**
308
- * Get a domain name binding.
314
+ * Get a domain name binding. Get a domain name binding for the function with
315
+ * the specified ID.
309
316
  *
310
317
  * @param request - The request {@link GetDomainRequest}
311
318
  * @returns A Promise of Domain
@@ -321,9 +328,10 @@ class API extends API$1 {
321
328
  * @param options - The waiting options
322
329
  * @returns A Promise of Domain
323
330
  */
324
- this.waitForDomain = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
331
+ this.waitForDomain = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
325
332
  /**
326
- * Create a domain name binding.
333
+ * Create a domain name binding. Create a domain name binding for the function
334
+ * with the specified ID.
327
335
  *
328
336
  * @param request - The request {@link CreateDomainRequest}
329
337
  * @returns A Promise of Domain
@@ -335,7 +343,8 @@ class API extends API$1 {
335
343
  path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains`
336
344
  }, unmarshalDomain);
337
345
  /**
338
- * Delete a domain name binding.
346
+ * Delete a domain name binding. Delete a domain name binding for the function
347
+ * with the specified ID.
339
348
  *
340
349
  * @param request - The request {@link DeleteDomainRequest}
341
350
  * @returns A Promise of Domain
@@ -399,7 +408,7 @@ class API extends API$1 {
399
408
  * @param options - The waiting options
400
409
  * @returns A Promise of Token
401
410
  */
402
- this.waitForToken = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!TOKEN_TRANSIENT_STATUSES.includes(res.status))), this.getToken, request, options);
411
+ this.waitForToken = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!TOKEN_TRANSIENT_STATUSES.includes(res.status))), this.getToken, request, options);
403
412
  this.pageOfListTokens = function (request) {
404
413
  if (request === void 0) {
405
414
  request = {};
@@ -449,7 +458,7 @@ class API extends API$1 {
449
458
  * @param options - The waiting options
450
459
  * @returns A Promise of Trigger
451
460
  */
452
- this.waitForTrigger = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!TRIGGER_TRANSIENT_STATUSES.includes(res.status))), this.getTrigger, request, options);
461
+ this.waitForTrigger = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!TRIGGER_TRANSIENT_STATUSES.includes(res.status))), this.getTrigger, request, options);
453
462
  this.pageOfListTriggers = function (request) {
454
463
  if (request === void 0) {
455
464
  request = {};
@@ -78,6 +78,7 @@ const unmarshalFunction = data => {
78
78
  throw new TypeError(`Unmarshalling the type 'Function' failed as data isn't a dictionary.`);
79
79
  }
80
80
  return {
81
+ buildMessage: data.build_message,
81
82
  cpuLimit: data.cpu_limit,
82
83
  description: data.description,
83
84
  domainName: data.domain_name,
@@ -95,7 +95,7 @@ class API extends API$1 {
95
95
  return _this.client.fetch({
96
96
  method: 'GET',
97
97
  path: `/iam/v1alpha1/users`,
98
- urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['user_ids', request.userIds])
98
+ urlParams: urlParams(['mfa', request.mfa], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['user_ids', request.userIds])
99
99
  }, unmarshalListUsersResponse);
100
100
  };
101
101
  /**
@@ -117,8 +117,7 @@ class API extends API$1 {
117
117
  /**
118
118
  * Get a given user. Retrieve information about a user, specified by the
119
119
  * `user_id` parameter. The user's full details, including `id`, `email`,
120
- * `organization_id`, `status` and `two_factor_enabled` are returned in the
121
- * response.
120
+ * `organization_id`, `status` and `mfa` are returned in the response.
122
121
  *
123
122
  * @param request - The request {@link GetUserRequest}
124
123
  * @returns A Promise of User
@@ -148,6 +148,7 @@ const unmarshalUser = data => {
148
148
  email: data.email,
149
149
  id: data.id,
150
150
  lastLoginAt: unmarshalDate(data.last_login_at),
151
+ mfa: data.mfa,
151
152
  organizationId: data.organization_id,
152
153
  status: data.status,
153
154
  twoFactorEnabled: data.two_factor_enabled,
@@ -48,7 +48,7 @@ class API extends API$1 {
48
48
  }, unmarshalListServersTypesResponse);
49
49
  };
50
50
  /**
51
- * List volumes types. List all volume types and their technical details.
51
+ * List volume types. List all volume types and their technical details.
52
52
  *
53
53
  * @param request - The request {@link ListVolumesTypesRequest}
54
54
  * @returns A Promise of ListVolumesTypesResponse
@@ -147,7 +147,7 @@ class API extends API$1 {
147
147
  * preserve your local volumes, you should use the `archive` action instead of
148
148
  * `terminate`. Similarly, if you want to keep your block storage volumes, you
149
149
  * must first detach them before issuing the `terminate` command. For more
150
- * information, read the [Volumes](#volumes-7e8a39) documentation.
150
+ * information, read the [Volumes](#path-volumes-list-volumes) documentation.
151
151
  *
152
152
  * @param request - The request {@link ServerActionRequest}
153
153
  * @returns A Promise of ServerActionResponse
@@ -25,7 +25,7 @@ class InstanceV1UtilsAPI extends API {
25
25
  done: !IMAGE_TRANSIENT_STATUSES.includes(value.state),
26
26
  value
27
27
  };
28
- }, createExponentialBackoffStrategy((options == null ? void 0 : options.minDelay) ?? 1, (options == null ? void 0 : options.maxDelay) ?? 30), options == null ? void 0 : options.timeout);
28
+ }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout);
29
29
  /**
30
30
  * Waits for {@link PrivateNIC} to be in a final state.
31
31
  *
@@ -39,7 +39,7 @@ class InstanceV1UtilsAPI extends API {
39
39
  done: !PRIVATE_NIC_TRANSIENT_STATUSES.includes(value.state),
40
40
  value
41
41
  };
42
- }, createExponentialBackoffStrategy((options == null ? void 0 : options.minDelay) ?? 1, (options == null ? void 0 : options.maxDelay) ?? 30), options == null ? void 0 : options.timeout);
42
+ }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout);
43
43
  /**
44
44
  * Waits for {@link Server} to be in a final state.
45
45
  *
@@ -53,7 +53,7 @@ class InstanceV1UtilsAPI extends API {
53
53
  done: !SERVER_TRANSIENT_STATUSES.includes(value.state),
54
54
  value
55
55
  };
56
- }, createExponentialBackoffStrategy((options == null ? void 0 : options.minDelay) ?? 1, (options == null ? void 0 : options.maxDelay) ?? 30), options == null ? void 0 : options.timeout);
56
+ }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout);
57
57
  /**
58
58
  * Waits for {@link Server} to be in a final state.
59
59
  *
@@ -67,7 +67,7 @@ class InstanceV1UtilsAPI extends API {
67
67
  done: !SNAPSHOT_TRANSIENT_STATUSES.includes(value.state),
68
68
  value
69
69
  };
70
- }, createExponentialBackoffStrategy((options == null ? void 0 : options.minDelay) ?? 1, (options == null ? void 0 : options.maxDelay) ?? 30), options == null ? void 0 : options.timeout);
70
+ }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout);
71
71
  /**
72
72
  * Waits for {@link Volume} to be in a final state.
73
73
  *
@@ -81,7 +81,7 @@ class InstanceV1UtilsAPI extends API {
81
81
  done: !VOLUME_TRANSIENT_STATUSES.includes(value.state),
82
82
  value
83
83
  };
84
- }, createExponentialBackoffStrategy((options == null ? void 0 : options.minDelay) ?? 1, (options == null ? void 0 : options.maxDelay) ?? 30), options == null ? void 0 : options.timeout);
84
+ }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout);
85
85
  /**
86
86
  * Updates a snapshot.
87
87
  *
@@ -233,10 +233,7 @@ class InstanceV1UtilsAPI extends API {
233
233
  const volumes = await this.getServer({
234
234
  serverId: request.serverId,
235
235
  zone: request.zone
236
- }).then(res => {
237
- var _res$server;
238
- return validateNotUndefined((_res$server = res.server) == null ? void 0 : _res$server.volumes);
239
- });
236
+ }).then(res => validateNotUndefined(res.server?.volumes));
240
237
  const newVolumes = {};
241
238
  for (const [key, server] of Object.entries(volumes)) {
242
239
  newVolumes[key] = {
@@ -284,10 +281,7 @@ class InstanceV1UtilsAPI extends API {
284
281
  const server = await this.getVolume({
285
282
  volumeId: request.volumeId,
286
283
  zone: request.zone
287
- }).then(res => {
288
- var _res$volume, _res$volume$server;
289
- return validateNotUndefined((_res$volume = res.volume) == null ? void 0 : (_res$volume$server = _res$volume.server) == null ? void 0 : _res$volume$server.id);
290
- }).then(serverId => this.getServer({
284
+ }).then(res => validateNotUndefined(res.volume?.server?.id)).then(serverId => this.getServer({
291
285
  serverId,
292
286
  zone: request.zone
293
287
  })).then(res => validateNotUndefined(res.server));