@scaleway/sdk 1.0.0 → 1.1.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 (43) hide show
  1. package/dist/api/account/v2/api.gen.js +29 -0
  2. package/dist/api/account/v2alpha1/api.gen.js +29 -0
  3. package/dist/api/applesilicon/v1alpha1/api.gen.js +74 -1
  4. package/dist/api/baremetal/v1/api.gen.js +202 -2
  5. package/dist/api/baremetal/v1/api.utils.js +7 -0
  6. package/dist/api/baremetal/v1/marshalling.gen.js +4 -1
  7. package/dist/api/cockpit/index.js +2 -0
  8. package/dist/api/cockpit/v1beta1/api.gen.js +307 -0
  9. package/dist/api/cockpit/v1beta1/content.gen.js +7 -0
  10. package/dist/api/cockpit/v1beta1/index.gen.js +4 -0
  11. package/dist/api/cockpit/v1beta1/marshalling.gen.js +174 -0
  12. package/dist/api/container/v1beta1/api.gen.js +189 -2
  13. package/dist/api/domain/v2beta1/api.gen.js +395 -8
  14. package/dist/api/domain/v2beta1/marshalling.gen.js +2 -2
  15. package/dist/api/flexibleip/v1alpha1/api.gen.js +68 -1
  16. package/dist/api/function/v1beta1/api.gen.js +214 -2
  17. package/dist/api/function/v1beta1/marshalling.gen.js +12 -0
  18. package/dist/api/iam/v1alpha1/api.gen.js +200 -2
  19. package/dist/api/instance/v1/api.gen.js +351 -11
  20. package/dist/api/instance/v1/api.utils.js +101 -0
  21. package/dist/api/instance/v1/marshalling.gen.js +12 -5
  22. package/dist/api/iot/v1/api.gen.js +230 -1
  23. package/dist/api/k8s/v1/api.gen.js +189 -1
  24. package/dist/api/lb/v1/api.gen.js +652 -6
  25. package/dist/api/lb/v1/api.utils.js +29 -0
  26. package/dist/api/marketplace/v1/api.gen.js +12 -0
  27. package/dist/api/marketplace/v2/api.gen.js +18 -0
  28. package/dist/api/mnq/v1alpha1/api.gen.js +60 -1
  29. package/dist/api/rdb/v1/api.gen.js +370 -3
  30. package/dist/api/rdb/v1/marshalling.gen.js +1 -0
  31. package/dist/api/redis/v1/api.gen.js +144 -1
  32. package/dist/api/registry/v1/api.gen.js +96 -2
  33. package/dist/api/secret/v1alpha1/api.gen.js +134 -44
  34. package/dist/api/tem/v1alpha1/api.gen.js +79 -3
  35. package/dist/api/test/v1/api.gen.js +61 -1
  36. package/dist/api/vpc/v1/api.gen.js +31 -1
  37. package/dist/api/vpcgw/v1/api.gen.js +227 -3
  38. package/dist/index.cjs +646 -156
  39. package/dist/index.d.ts +830 -298
  40. package/dist/index.js +40 -38
  41. package/dist/scw/constants.js +1 -1
  42. package/dist/scw/fetch/build-fetcher.js +1 -1
  43. package/package.json +2 -2
@@ -21,27 +21,58 @@ class API extends API$1 {
21
21
  this.pageOfListDNSZones = request => this.client.fetch({
22
22
  method: 'GET',
23
23
  path: `/domain/v2beta1/dns-zones`,
24
- urlParams: urlParams(['dns_zone', request.dnsZone], ['domain', request.domain], ['order_by', request.orderBy ?? 'domain_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId])
24
+ urlParams: urlParams(['dns_zone', request.dnsZone], ['domain', request.domain], ['order_by', request.orderBy ?? 'domain_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
25
25
  }, unmarshalListDNSZonesResponse);
26
+ /**
27
+ * Returns a list of manageable DNS zones. You can filter the DNS zones by
28
+ * domain name.
29
+ *
30
+ * @param request - The request {@link ListDNSZonesRequest}
31
+ * @returns A Promise of ListDNSZonesResponse
32
+ */
26
33
  this.listDNSZones = request => enrichForPagination('dnsZones', this.pageOfListDNSZones, request);
34
+ /**
35
+ * Create a new DNS zone.
36
+ *
37
+ * @param request - The request {@link CreateDNSZoneRequest}
38
+ * @returns A Promise of DNSZone
39
+ */
27
40
  this.createDNSZone = request => this.client.fetch({
28
41
  body: JSON.stringify(marshalCreateDNSZoneRequest(request, this.client.settings)),
29
42
  headers: jsonContentHeaders,
30
43
  method: 'POST',
31
44
  path: `/domain/v2beta1/dns-zones`
32
45
  }, unmarshalDNSZone);
46
+ /**
47
+ * Update the name and/or the organizations for a DNS zone.
48
+ *
49
+ * @param request - The request {@link UpdateDNSZoneRequest}
50
+ * @returns A Promise of DNSZone
51
+ */
33
52
  this.updateDNSZone = request => this.client.fetch({
34
53
  body: JSON.stringify(marshalUpdateDNSZoneRequest(request, this.client.settings)),
35
54
  headers: jsonContentHeaders,
36
55
  method: 'PATCH',
37
56
  path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}`
38
57
  }, unmarshalDNSZone);
58
+ /**
59
+ * Clone an existed DNS zone with all its records into a new one.
60
+ *
61
+ * @param request - The request {@link CloneDNSZoneRequest}
62
+ * @returns A Promise of DNSZone
63
+ */
39
64
  this.cloneDNSZone = request => this.client.fetch({
40
65
  body: JSON.stringify(marshalCloneDNSZoneRequest(request, this.client.settings)),
41
66
  headers: jsonContentHeaders,
42
67
  method: 'POST',
43
68
  path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/clone`
44
69
  }, unmarshalDNSZone);
70
+ /**
71
+ * Delete a DNS zone and all it's records.
72
+ *
73
+ * @param request - The request {@link DeleteDNSZoneRequest}
74
+ * @returns A Promise of DeleteDNSZoneResponse
75
+ */
45
76
  this.deleteDNSZone = request => this.client.fetch({
46
77
  method: 'DELETE',
47
78
  path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}`,
@@ -50,48 +81,122 @@ class API extends API$1 {
50
81
  this.pageOfListDNSZoneRecords = request => this.client.fetch({
51
82
  method: 'GET',
52
83
  path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/records`,
53
- urlParams: urlParams(['id', request.id], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId], ['type', request.type ?? 'unknown'])
84
+ urlParams: urlParams(['id', request.id], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['type', request.type ?? 'unknown'])
54
85
  }, unmarshalListDNSZoneRecordsResponse);
86
+ /**
87
+ * Returns a list of DNS records of a DNS zone with default NS. You can filter
88
+ * the records by type and name.
89
+ *
90
+ * @param request - The request {@link ListDNSZoneRecordsRequest}
91
+ * @returns A Promise of ListDNSZoneRecordsResponse
92
+ */
55
93
  this.listDNSZoneRecords = request => enrichForPagination('records', this.pageOfListDNSZoneRecords, request);
94
+ /**
95
+ * Only available with default NS.<br/> Send a list of actions and records.
96
+ *
97
+ * Action can be:
98
+ *
99
+ * - Add:
100
+ * - Add new record
101
+ * - Can be more specific and add a new IP to an existing A record for example
102
+ * - Set:
103
+ * - Edit a record
104
+ * - Can be more specific and edit an IP from an existing A record for example
105
+ * - Delete:
106
+ * - Delete a record
107
+ * - Can be more specific and delete an IP from an existing A record for example
108
+ * - Clear:
109
+ * - Delete all records from a DNS zone
110
+ *
111
+ * All edits will be versioned.
112
+ *
113
+ * @param request - The request {@link UpdateDNSZoneRecordsRequest}
114
+ * @returns A Promise of UpdateDNSZoneRecordsResponse
115
+ */
56
116
  this.updateDNSZoneRecords = request => this.client.fetch({
57
117
  body: JSON.stringify(marshalUpdateDNSZoneRecordsRequest(request, this.client.settings)),
58
118
  headers: jsonContentHeaders,
59
119
  method: 'PATCH',
60
120
  path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/records`
61
121
  }, unmarshalUpdateDNSZoneRecordsResponse);
122
+ /**
123
+ * Returns a list of Nameservers and their optional glue records for a DNS
124
+ * zone.
125
+ *
126
+ * @param request - The request {@link ListDNSZoneNameserversRequest}
127
+ * @returns A Promise of ListDNSZoneNameserversResponse
128
+ */
62
129
  this.listDNSZoneNameservers = request => this.client.fetch({
63
130
  method: 'GET',
64
131
  path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/nameservers`,
65
- urlParams: urlParams(['project_id', request.projectId ?? this.client.settings.defaultProjectId])
132
+ urlParams: urlParams(['project_id', request.projectId])
66
133
  }, unmarshalListDNSZoneNameserversResponse);
134
+ /**
135
+ * Update DNS zone nameservers and set optional glue records.
136
+ *
137
+ * @param request - The request {@link UpdateDNSZoneNameserversRequest}
138
+ * @returns A Promise of UpdateDNSZoneNameserversResponse
139
+ */
67
140
  this.updateDNSZoneNameservers = request => this.client.fetch({
68
141
  body: JSON.stringify(marshalUpdateDNSZoneNameserversRequest(request, this.client.settings)),
69
142
  headers: jsonContentHeaders,
70
143
  method: 'PUT',
71
144
  path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/nameservers`
72
145
  }, unmarshalUpdateDNSZoneNameserversResponse);
146
+ /**
147
+ * Only available with default NS.<br/> Delete all the records from a DNS
148
+ * zone. All edits will be versioned.
149
+ *
150
+ * @param request - The request {@link ClearDNSZoneRecordsRequest}
151
+ * @returns A Promise of ClearDNSZoneRecordsResponse
152
+ */
73
153
  this.clearDNSZoneRecords = request => this.client.fetch({
74
154
  method: 'DELETE',
75
155
  path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/records`
76
156
  }, unmarshalClearDNSZoneRecordsResponse);
157
+ /**
158
+ * Get a DNS zone in a given format with default NS.
159
+ *
160
+ * @param request - The request {@link ExportRawDNSZoneRequest}
161
+ * @returns A Promise of Blob
162
+ */
77
163
  this.exportRawDNSZone = request => this.client.fetch({
78
164
  method: 'GET',
79
165
  path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/raw`,
80
166
  urlParams: urlParams(['dl', 1], ['format', request.format ?? 'unknown_raw_format']),
81
167
  responseType: 'blob'
82
168
  });
169
+ /**
170
+ * Import and replace records from a given provider format with default NS.
171
+ *
172
+ * @param request - The request {@link ImportRawDNSZoneRequest}
173
+ * @returns A Promise of ImportRawDNSZoneResponse
174
+ */
83
175
  this.importRawDNSZone = request => this.client.fetch({
84
176
  body: JSON.stringify(marshalImportRawDNSZoneRequest(request, this.client.settings)),
85
177
  headers: jsonContentHeaders,
86
178
  method: 'POST',
87
179
  path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/raw`
88
180
  }, unmarshalImportRawDNSZoneResponse);
181
+ /**
182
+ * Import and replace records from a given provider format with default NS.
183
+ *
184
+ * @param request - The request {@link ImportProviderDNSZoneRequest}
185
+ * @returns A Promise of ImportProviderDNSZoneResponse
186
+ */
89
187
  this.importProviderDNSZone = request => this.client.fetch({
90
188
  body: JSON.stringify(marshalImportProviderDNSZoneRequest(request, this.client.settings)),
91
189
  headers: jsonContentHeaders,
92
190
  method: 'POST',
93
191
  path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/import-provider`
94
192
  }, unmarshalImportProviderDNSZoneResponse);
193
+ /**
194
+ * Refresh SOA DNS zone. You can recreate the given DNS zone and its sub DNS
195
+ * zone if needed.
196
+ *
197
+ * @param request - The request {@link RefreshDNSZoneRequest}
198
+ * @returns A Promise of RefreshDNSZoneResponse
199
+ */
95
200
  this.refreshDNSZone = request => this.client.fetch({
96
201
  body: JSON.stringify(marshalRefreshDNSZoneRequest(request, this.client.settings)),
97
202
  headers: jsonContentHeaders,
@@ -103,28 +208,73 @@ class API extends API$1 {
103
208
  path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/versions`,
104
209
  urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
105
210
  }, unmarshalListDNSZoneVersionsResponse);
211
+ /**
212
+ * Get a list of DNS zone versions.<br/> The maximum version count is
213
+ * 100.<br/> If the count reaches this limit, the oldest version will be
214
+ * deleted after each new modification.
215
+ *
216
+ * @param request - The request {@link ListDNSZoneVersionsRequest}
217
+ * @returns A Promise of ListDNSZoneVersionsResponse
218
+ */
106
219
  this.listDNSZoneVersions = request => enrichForPagination('versions', this.pageOfListDNSZoneVersions, request);
107
220
  this.pageOfListDNSZoneVersionRecords = request => this.client.fetch({
108
221
  method: 'GET',
109
222
  path: `/domain/v2beta1/dns-zones/version/${validatePathParam('dnsZoneVersionId', request.dnsZoneVersionId)}`,
110
223
  urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
111
224
  }, unmarshalListDNSZoneVersionRecordsResponse);
225
+ /**
226
+ * Get a list of records from a previous DNS zone version.
227
+ *
228
+ * @param request - The request {@link ListDNSZoneVersionRecordsRequest}
229
+ * @returns A Promise of ListDNSZoneVersionRecordsResponse
230
+ */
112
231
  this.listDNSZoneVersionRecords = request => enrichForPagination('records', this.pageOfListDNSZoneVersionRecords, request);
232
+ /**
233
+ * Get all differences from a previous DNS zone version.
234
+ *
235
+ * @param request - The request {@link GetDNSZoneVersionDiffRequest}
236
+ * @returns A Promise of GetDNSZoneVersionDiffResponse
237
+ */
113
238
  this.getDNSZoneVersionDiff = request => this.client.fetch({
114
239
  method: 'GET',
115
240
  path: `/domain/v2beta1/dns-zones/version/${validatePathParam('dnsZoneVersionId', request.dnsZoneVersionId)}/diff`
116
241
  }, unmarshalGetDNSZoneVersionDiffResponse);
242
+ /**
243
+ * Restore and activate a previous DNS zone version.
244
+ *
245
+ * @param request - The request {@link RestoreDNSZoneVersionRequest}
246
+ * @returns A Promise of RestoreDNSZoneVersionResponse
247
+ */
117
248
  this.restoreDNSZoneVersion = request => this.client.fetch({
118
249
  body: '{}',
119
250
  headers: jsonContentHeaders,
120
251
  method: 'POST',
121
252
  path: `/domain/v2beta1/dns-zones/version/${validatePathParam('dnsZoneVersionId', request.dnsZoneVersionId)}/restore`
122
253
  }, unmarshalRestoreDNSZoneVersionResponse);
254
+ /**
255
+ * Get the zone TLS certificate if it exists
256
+ *
257
+ * @param request - The request {@link GetSSLCertificateRequest}
258
+ * @returns A Promise of SSLCertificate
259
+ */
123
260
  this.getSSLCertificate = request => this.client.fetch({
124
261
  method: 'GET',
125
262
  path: `/domain/v2beta1/ssl-certificates/${validatePathParam('dnsZone', request.dnsZone)}`
126
263
  }, unmarshalSSLCertificate);
264
+ /**
265
+ * Waits for {@link SSLCertificate} to be in a final state.
266
+ *
267
+ * @param request - The request {@link GetSSLCertificateRequest}
268
+ * @param options - The waiting options
269
+ * @returns A Promise of SSLCertificate
270
+ */
127
271
  this.waitForSSLCertificate = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!SSL_CERTIFICATE_TRANSIENT_STATUSES.includes(res.status))), this.getSSLCertificate, request, options);
272
+ /**
273
+ * Create or return the zone TLS certificate
274
+ *
275
+ * @param request - The request {@link CreateSSLCertificateRequest}
276
+ * @returns A Promise of SSLCertificate
277
+ */
128
278
  this.createSSLCertificate = request => this.client.fetch({
129
279
  body: JSON.stringify(marshalCreateSSLCertificateRequest(request, this.client.settings)),
130
280
  headers: jsonContentHeaders,
@@ -134,17 +284,40 @@ class API extends API$1 {
134
284
  this.pageOfListSSLCertificates = request => this.client.fetch({
135
285
  method: 'GET',
136
286
  path: `/domain/v2beta1/ssl-certificates`,
137
- urlParams: urlParams(['dns_zone', request.dnsZone], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId])
287
+ urlParams: urlParams(['dns_zone', request.dnsZone], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
138
288
  }, unmarshalListSSLCertificatesResponse);
289
+ /**
290
+ * List all user TLS certificates
291
+ *
292
+ * @param request - The request {@link ListSSLCertificatesRequest}
293
+ * @returns A Promise of ListSSLCertificatesResponse
294
+ */
139
295
  this.listSSLCertificates = request => enrichForPagination('certificates', this.pageOfListSSLCertificates, request);
296
+ /**
297
+ * Delete an TLS certificate
298
+ *
299
+ * @param request - The request {@link DeleteSSLCertificateRequest}
300
+ * @returns A Promise of DeleteSSLCertificateResponse
301
+ */
140
302
  this.deleteSSLCertificate = request => this.client.fetch({
141
303
  method: 'DELETE',
142
304
  path: `/domain/v2beta1/ssl-certificates/${validatePathParam('dnsZone', request.dnsZone)}`
143
305
  }, unmarshalDeleteSSLCertificateResponse);
306
+ /**
307
+ * Get the DNS zone TSIG Key to allow AXFR request.
308
+ *
309
+ * @param request - The request {@link GetDNSZoneTsigKeyRequest}
310
+ * @returns A Promise of GetDNSZoneTsigKeyResponse
311
+ */
144
312
  this.getDNSZoneTsigKey = request => this.client.fetch({
145
313
  method: 'GET',
146
314
  path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/tsig-key`
147
315
  }, unmarshalGetDNSZoneTsigKeyResponse);
316
+ /**
317
+ * Delete the DNS zone TSIG Key
318
+ *
319
+ * @param request - The request {@link DeleteDNSZoneTsigKeyRequest}
320
+ */
148
321
  this.deleteDNSZoneTsigKey = request => this.client.fetch({
149
322
  method: 'DELETE',
150
323
  path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/tsig-key`
@@ -169,49 +342,105 @@ class RegistrarAPI extends API$1 {
169
342
  return _this.client.fetch({
170
343
  method: 'GET',
171
344
  path: `/domain/v2beta1/tasks`,
172
- urlParams: urlParams(['domain', request.domain], ['order_by', request.orderBy ?? 'domain_desc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId], ['statuses', request.statuses], ['types', request.types])
345
+ urlParams: urlParams(['domain', request.domain], ['order_by', request.orderBy ?? 'domain_desc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['statuses', request.statuses], ['types', request.types])
173
346
  }, unmarshalListTasksResponse);
174
347
  };
348
+ /**
349
+ * List all account tasks. You can filter the list by domain name.
350
+ *
351
+ * @param request - The request {@link RegistrarApiListTasksRequest}
352
+ * @returns A Promise of ListTasksResponse
353
+ */
175
354
  this.listTasks = function (request) {
176
355
  if (request === void 0) {
177
356
  request = {};
178
357
  }
179
358
  return enrichForPagination('tasks', _this.pageOfListTasks, request);
180
359
  };
360
+ /**
361
+ * Request the registration of domain names. You can provide an already
362
+ * existing domain's contact or a new contact.
363
+ *
364
+ * @param request - The request {@link RegistrarApiBuyDomainsRequest}
365
+ * @returns A Promise of OrderResponse
366
+ */
181
367
  this.buyDomains = request => this.client.fetch({
182
368
  body: JSON.stringify(marshalRegistrarApiBuyDomainsRequest(request, this.client.settings)),
183
369
  headers: jsonContentHeaders,
184
370
  method: 'POST',
185
371
  path: `/domain/v2beta1/buy-domains`
186
372
  }, unmarshalOrderResponse);
373
+ /**
374
+ * Request the renewal of domain names.
375
+ *
376
+ * @param request - The request {@link RegistrarApiRenewDomainsRequest}
377
+ * @returns A Promise of OrderResponse
378
+ */
187
379
  this.renewDomains = request => this.client.fetch({
188
380
  body: JSON.stringify(marshalRegistrarApiRenewDomainsRequest(request, this.client.settings)),
189
381
  headers: jsonContentHeaders,
190
382
  method: 'POST',
191
383
  path: `/domain/v2beta1/renew-domains`
192
384
  }, unmarshalOrderResponse);
385
+ /**
386
+ * Request the transfer from another registrar domain to Scaleway.
387
+ *
388
+ * @param request - The request {@link RegistrarApiTransferInDomainRequest}
389
+ * @returns A Promise of OrderResponse
390
+ */
193
391
  this.transferInDomain = request => this.client.fetch({
194
392
  body: JSON.stringify(marshalRegistrarApiTransferInDomainRequest(request, this.client.settings)),
195
393
  headers: jsonContentHeaders,
196
394
  method: 'POST',
197
395
  path: `/domain/v2beta1/domains/transfer-domains`
198
396
  }, unmarshalOrderResponse);
397
+ /**
398
+ * Request a trade for the contact owner.<br/> If an `organization_id` is
399
+ * given, the change is from the current Scaleway account to another Scaleway
400
+ * account.<br/> If no contact is given, the first contact of the other
401
+ * Scaleway account is taken.<br/> If the other Scaleway account has no
402
+ * contact. An error occurs.
403
+ *
404
+ * @param request - The request {@link RegistrarApiTradeDomainRequest}
405
+ * @returns A Promise of OrderResponse
406
+ */
199
407
  this.tradeDomain = request => this.client.fetch({
200
408
  body: JSON.stringify(marshalRegistrarApiTradeDomainRequest(request, this.client.settings)),
201
409
  headers: jsonContentHeaders,
202
410
  method: 'POST',
203
411
  path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/trade`
204
412
  }, unmarshalOrderResponse);
413
+ /**
414
+ * Request the registration of an external domain name.
415
+ *
416
+ * @param request - The request
417
+ * {@link RegistrarApiRegisterExternalDomainRequest}
418
+ * @returns A Promise of RegisterExternalDomainResponse
419
+ */
205
420
  this.registerExternalDomain = request => this.client.fetch({
206
421
  body: JSON.stringify(marshalRegistrarApiRegisterExternalDomainRequest(request, this.client.settings)),
207
422
  headers: jsonContentHeaders,
208
423
  method: 'POST',
209
424
  path: `/domain/v2beta1/external-domains`
210
425
  }, unmarshalRegisterExternalDomainResponse);
426
+ /**
427
+ * Delete an external domain name.
428
+ *
429
+ * @param request - The request {@link RegistrarApiDeleteExternalDomainRequest}
430
+ * @returns A Promise of DeleteExternalDomainResponse
431
+ */
211
432
  this.deleteExternalDomain = request => this.client.fetch({
212
433
  method: 'DELETE',
213
434
  path: `/domain/v2beta1/external-domains/${validatePathParam('domain', request.domain)}`
214
435
  }, unmarshalDeleteExternalDomainResponse);
436
+ /**
437
+ * Check if contacts are compatible against a domain or a tld. If not, it will
438
+ * return the information requiring a correction.
439
+ *
440
+ * @param request - The request
441
+ * {@link RegistrarApiCheckContactsCompatibilityRequest}
442
+ * @returns A Promise of CheckContactsCompatibilityResponse
443
+ */
215
444
  this.checkContactsCompatibility = function (request) {
216
445
  if (request === void 0) {
217
446
  request = {};
@@ -230,19 +459,39 @@ class RegistrarAPI extends API$1 {
230
459
  return _this.client.fetch({
231
460
  method: 'GET',
232
461
  path: `/domain/v2beta1/contacts`,
233
- urlParams: urlParams(['domain', request.domain], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId])
462
+ urlParams: urlParams(['domain', request.domain], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId])
234
463
  }, unmarshalListContactsResponse);
235
464
  };
465
+ /**
466
+ * Return a list of contacts with their domains and roles. You can filter the
467
+ * list by domain name.
468
+ *
469
+ * @param request - The request {@link RegistrarApiListContactsRequest}
470
+ * @returns A Promise of ListContactsResponse
471
+ */
236
472
  this.listContacts = function (request) {
237
473
  if (request === void 0) {
238
474
  request = {};
239
475
  }
240
476
  return enrichForPagination('contacts', _this.pageOfListContacts, request);
241
477
  };
478
+ /**
479
+ * Return a contact details retrieved from the registrar using a given contact
480
+ * ID.
481
+ *
482
+ * @param request - The request {@link RegistrarApiGetContactRequest}
483
+ * @returns A Promise of Contact
484
+ */
242
485
  this.getContact = request => this.client.fetch({
243
486
  method: 'GET',
244
487
  path: `/domain/v2beta1/contacts/${validatePathParam('contactId', request.contactId)}`
245
488
  }, unmarshalContact);
489
+ /**
490
+ * You can edit the contact coordinates.
491
+ *
492
+ * @param request - The request {@link RegistrarApiUpdateContactRequest}
493
+ * @returns A Promise of Contact
494
+ */
246
495
  this.updateContact = request => this.client.fetch({
247
496
  body: JSON.stringify(marshalRegistrarApiUpdateContactRequest(request, this.client.settings)),
248
497
  headers: jsonContentHeaders,
@@ -256,9 +505,15 @@ class RegistrarAPI extends API$1 {
256
505
  return _this.client.fetch({
257
506
  method: 'GET',
258
507
  path: `/domain/v2beta1/domains`,
259
- urlParams: urlParams(['domain', request.domain], ['is_external', request.isExternal], ['order_by', request.orderBy ?? 'domain_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId], ['registrar', request.registrar], ['status', request.status ?? 'status_unknown'])
508
+ urlParams: urlParams(['domain', request.domain], ['is_external', request.isExternal], ['order_by', request.orderBy ?? 'domain_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['registrar', request.registrar], ['status', request.status ?? 'status_unknown'])
260
509
  }, unmarshalListDomainsResponse);
261
510
  };
511
+ /**
512
+ * Returns a list of domains owned by the user.
513
+ *
514
+ * @param request - The request {@link RegistrarApiListDomainsRequest}
515
+ * @returns A Promise of ListDomainsResponse
516
+ */
262
517
  this.listDomains = function (request) {
263
518
  if (request === void 0) {
264
519
  request = {};
@@ -272,71 +527,185 @@ class RegistrarAPI extends API$1 {
272
527
  return _this.client.fetch({
273
528
  method: 'GET',
274
529
  path: `/domain/v2beta1/renewable-domains`,
275
- urlParams: urlParams(['order_by', request.orderBy ?? 'domain_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId])
530
+ urlParams: urlParams(['order_by', request.orderBy ?? 'domain_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId])
276
531
  }, unmarshalListRenewableDomainsResponse);
277
532
  };
533
+ /**
534
+ * Returns a list of domains owned by the user with a renew status and if
535
+ * renewable, the maximum renew duration in years.
536
+ *
537
+ * @param request - The request {@link RegistrarApiListRenewableDomainsRequest}
538
+ * @returns A Promise of ListRenewableDomainsResponse
539
+ */
278
540
  this.listRenewableDomains = function (request) {
279
541
  if (request === void 0) {
280
542
  request = {};
281
543
  }
282
544
  return enrichForPagination('domains', _this.pageOfListRenewableDomains, request);
283
545
  };
546
+ /**
547
+ * Returns a the domain with more informations.
548
+ *
549
+ * @param request - The request {@link RegistrarApiGetDomainRequest}
550
+ * @returns A Promise of Domain
551
+ */
284
552
  this.getDomain = request => this.client.fetch({
285
553
  method: 'GET',
286
554
  path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}`
287
555
  }, unmarshalDomain);
556
+ /**
557
+ * Waits for {@link Domain} to be in a final state.
558
+ *
559
+ * @param request - The request {@link GetDomainRequest}
560
+ * @param options - The waiting options
561
+ * @returns A Promise of Domain
562
+ */
288
563
  this.waitForDomain = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
564
+ /**
565
+ * Update the domain contacts or create a new one.<br/> If you add the same
566
+ * contact for multiple roles. Only one ID will be created and used for all of
567
+ * them.
568
+ *
569
+ * @param request - The request {@link RegistrarApiUpdateDomainRequest}
570
+ * @returns A Promise of Domain
571
+ */
289
572
  this.updateDomain = request => this.client.fetch({
290
573
  body: JSON.stringify(marshalRegistrarApiUpdateDomainRequest(request, this.client.settings)),
291
574
  headers: jsonContentHeaders,
292
575
  method: 'PATCH',
293
576
  path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}`
294
577
  }, unmarshalDomain);
578
+ /**
579
+ * Lock domain transfer. A locked domain transfer can't be transferred and the
580
+ * auth code can't be requested.
581
+ *
582
+ * @param request - The request {@link RegistrarApiLockDomainTransferRequest}
583
+ * @returns A Promise of Domain
584
+ */
295
585
  this.lockDomainTransfer = request => this.client.fetch({
296
586
  body: '{}',
297
587
  headers: jsonContentHeaders,
298
588
  method: 'POST',
299
589
  path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/lock-transfer`
300
590
  }, unmarshalDomain);
591
+ /**
592
+ * Unlock domain transfer. An unlocked domain can be transferred and the auth
593
+ * code can be requested for this.
594
+ *
595
+ * @param request - The request {@link RegistrarApiUnlockDomainTransferRequest}
596
+ * @returns A Promise of Domain
597
+ */
301
598
  this.unlockDomainTransfer = request => this.client.fetch({
302
599
  body: '{}',
303
600
  headers: jsonContentHeaders,
304
601
  method: 'POST',
305
602
  path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/unlock-transfer`
306
603
  }, unmarshalDomain);
604
+ /**
605
+ * Enable domain auto renew
606
+ *
607
+ * @param request - The request
608
+ * {@link RegistrarApiEnableDomainAutoRenewRequest}
609
+ * @returns A Promise of Domain
610
+ */
307
611
  this.enableDomainAutoRenew = request => this.client.fetch({
308
612
  body: '{}',
309
613
  headers: jsonContentHeaders,
310
614
  method: 'POST',
311
615
  path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/enable-auto-renew`
312
616
  }, unmarshalDomain);
617
+ /**
618
+ * Disable domain auto renew
619
+ *
620
+ * @param request - The request
621
+ * {@link RegistrarApiDisableDomainAutoRenewRequest}
622
+ * @returns A Promise of Domain
623
+ */
313
624
  this.disableDomainAutoRenew = request => this.client.fetch({
314
625
  body: '{}',
315
626
  headers: jsonContentHeaders,
316
627
  method: 'POST',
317
628
  path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/disable-auto-renew`
318
629
  }, unmarshalDomain);
630
+ /**
631
+ * If possible, return the auth code for an unlocked domain transfer, or an
632
+ * error if the domain is locked. Some TLD may have a different procedure to
633
+ * retrieve the auth code, in that case, the information is given in the
634
+ * message field.
635
+ *
636
+ * @param request - The request {@link RegistrarApiGetDomainAuthCodeRequest}
637
+ * @returns A Promise of GetDomainAuthCodeResponse
638
+ */
319
639
  this.getDomainAuthCode = request => this.client.fetch({
320
640
  method: 'GET',
321
641
  path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/auth-code`
322
642
  }, unmarshalGetDomainAuthCodeResponse);
643
+ /**
644
+ * If your domain has the default Scaleway NS and uses another registrar, you
645
+ * have to update the DS record manually. For the algorithm, here are the code
646
+ * numbers for each type:
647
+ *
648
+ * - 1: RSAMD5
649
+ * - 2: DIFFIE_HELLMAN
650
+ * - 3: DSA_SHA1
651
+ * - 5: RSA_SHA1
652
+ * - 6: DSA_NSEC3_SHA1
653
+ * - 7: RSASHA1_NSEC3_SHA1
654
+ * - 8: RSASHA256
655
+ * - 10: RSASHA512
656
+ * - 12: ECC_GOST
657
+ * - 13: ECDSAP256SHA256
658
+ * - 14: ECDSAP384SHA384
659
+ *
660
+ * And for the digest type:
661
+ *
662
+ * - 1: SHA_1
663
+ * - 2: SHA_256
664
+ * - 3: GOST_R_34_11_94
665
+ * - 4: SHA_384
666
+ *
667
+ * @param request - The request {@link RegistrarApiEnableDomainDNSSECRequest}
668
+ * @returns A Promise of Domain
669
+ */
323
670
  this.enableDomainDNSSEC = request => this.client.fetch({
324
671
  body: JSON.stringify(marshalRegistrarApiEnableDomainDNSSECRequest(request, this.client.settings)),
325
672
  headers: jsonContentHeaders,
326
673
  method: 'POST',
327
674
  path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/enable-dnssec`
328
675
  }, unmarshalDomain);
676
+ /**
677
+ * Disable domain DNSSEC
678
+ *
679
+ * @param request - The request {@link RegistrarApiDisableDomainDNSSECRequest}
680
+ * @returns A Promise of Domain
681
+ */
329
682
  this.disableDomainDNSSEC = request => this.client.fetch({
330
683
  body: '{}',
331
684
  headers: jsonContentHeaders,
332
685
  method: 'POST',
333
686
  path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/disable-dnssec`
334
687
  }, unmarshalDomain);
688
+ /**
689
+ * Search a domain (or at maximum, 10 domains).
690
+ *
691
+ * If the TLD list is empty or not set the search returns the results from the
692
+ * most popular TLDs.
693
+ *
694
+ * @param request - The request
695
+ * {@link RegistrarApiSearchAvailableDomainsRequest}
696
+ * @returns A Promise of SearchAvailableDomainsResponse
697
+ */
335
698
  this.searchAvailableDomains = request => this.client.fetch({
336
699
  method: 'GET',
337
700
  path: `/domain/v2beta1/search-domains`,
338
701
  urlParams: urlParams(['domains', request.domains], ['strict_search', request.strictSearch], ['tlds', request.tlds])
339
702
  }, unmarshalSearchAvailableDomainsResponse);
703
+ /**
704
+ * Create domain hostname with glue IPs
705
+ *
706
+ * @param request - The request {@link RegistrarApiCreateDomainHostRequest}
707
+ * @returns A Promise of Host
708
+ */
340
709
  this.createDomainHost = request => this.client.fetch({
341
710
  body: JSON.stringify(marshalRegistrarApiCreateDomainHostRequest(request, this.client.settings)),
342
711
  headers: jsonContentHeaders,
@@ -348,13 +717,31 @@ class RegistrarAPI extends API$1 {
348
717
  path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts`,
349
718
  urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
350
719
  }, unmarshalListDomainHostsResponse);
720
+ /**
721
+ * List domain hostnames with they glue IPs
722
+ *
723
+ * @param request - The request {@link RegistrarApiListDomainHostsRequest}
724
+ * @returns A Promise of ListDomainHostsResponse
725
+ */
351
726
  this.listDomainHosts = request => enrichForPagination('hosts', this.pageOfListDomainHosts, request);
727
+ /**
728
+ * Update domain hostname with glue IPs
729
+ *
730
+ * @param request - The request {@link RegistrarApiUpdateDomainHostRequest}
731
+ * @returns A Promise of Host
732
+ */
352
733
  this.updateDomainHost = request => this.client.fetch({
353
734
  body: JSON.stringify(marshalRegistrarApiUpdateDomainHostRequest(request, this.client.settings)),
354
735
  headers: jsonContentHeaders,
355
736
  method: 'PATCH',
356
737
  path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts/${validatePathParam('name', request.name)}`
357
738
  }, unmarshalHost);
739
+ /**
740
+ * Delete domain hostname
741
+ *
742
+ * @param request - The request {@link RegistrarApiDeleteDomainHostRequest}
743
+ * @returns A Promise of Host
744
+ */
358
745
  this.deleteDomainHost = request => this.client.fetch({
359
746
  method: 'DELETE',
360
747
  path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts/${validatePathParam('name', request.name)}`