@scaleway/sdk-domain 1.3.0 → 2.1.1

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.
@@ -1,1041 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const sdkClient = require("@scaleway/sdk-client");
4
- const content_gen = require("./content.gen.cjs");
5
- const marshalling_gen = require("./marshalling.gen.cjs");
6
- const jsonContentHeaders = {
7
- "Content-Type": "application/json; charset=utf-8"
8
- };
9
- class API extends sdkClient.API {
10
- pageOfListDNSZones = (request) => this.client.fetch(
11
- {
12
- method: "GET",
13
- path: `/domain/v2beta1/dns-zones`,
14
- urlParams: sdkClient.urlParams(
15
- ["created_after", request.createdAfter],
16
- ["created_before", request.createdBefore],
17
- ["dns_zone", request.dnsZone],
18
- ["dns_zones", request.dnsZones],
19
- ["domain", request.domain],
20
- ["order_by", request.orderBy],
21
- ["organization_id", request.organizationId],
22
- ["page", request.page],
23
- [
24
- "page_size",
25
- request.pageSize ?? this.client.settings.defaultPageSize
26
- ],
27
- ["project_id", request.projectId],
28
- ["updated_after", request.updatedAfter],
29
- ["updated_before", request.updatedBefore]
30
- )
31
- },
32
- marshalling_gen.unmarshalListDNSZonesResponse
33
- );
34
- /**
35
- * List DNS zones. Retrieve the list of DNS zones you can manage and filter DNS zones associated with specific domain names.
36
- *
37
- * @param request - The request {@link ListDNSZonesRequest}
38
- * @returns A Promise of ListDNSZonesResponse
39
- */
40
- listDNSZones = (request) => sdkClient.enrichForPagination("dnsZones", this.pageOfListDNSZones, request);
41
- /**
42
- * Create a DNS zone. Create a new DNS zone specified by the domain name, the subdomain and the Project ID.
43
- *
44
- * @param request - The request {@link CreateDNSZoneRequest}
45
- * @returns A Promise of DNSZone
46
- */
47
- createDNSZone = (request) => this.client.fetch(
48
- {
49
- body: JSON.stringify(
50
- marshalling_gen.marshalCreateDNSZoneRequest(request, this.client.settings)
51
- ),
52
- headers: jsonContentHeaders,
53
- method: "POST",
54
- path: `/domain/v2beta1/dns-zones`
55
- },
56
- marshalling_gen.unmarshalDNSZone
57
- );
58
- /**
59
- * Update a DNS zone. Update the name and/or the Organizations for a DNS zone.
60
- *
61
- * @param request - The request {@link UpdateDNSZoneRequest}
62
- * @returns A Promise of DNSZone
63
- */
64
- updateDNSZone = (request) => this.client.fetch(
65
- {
66
- body: JSON.stringify(
67
- marshalling_gen.marshalUpdateDNSZoneRequest(request, this.client.settings)
68
- ),
69
- headers: jsonContentHeaders,
70
- method: "PATCH",
71
- path: `/domain/v2beta1/dns-zones/${sdkClient.validatePathParam("dnsZone", request.dnsZone)}`
72
- },
73
- marshalling_gen.unmarshalDNSZone
74
- );
75
- /**
76
- * Clone a DNS zone. Clone an existing DNS zone with all its records into a new DNS zone.
77
- *
78
- * @param request - The request {@link CloneDNSZoneRequest}
79
- * @returns A Promise of DNSZone
80
- */
81
- cloneDNSZone = (request) => this.client.fetch(
82
- {
83
- body: JSON.stringify(
84
- marshalling_gen.marshalCloneDNSZoneRequest(request, this.client.settings)
85
- ),
86
- headers: jsonContentHeaders,
87
- method: "POST",
88
- path: `/domain/v2beta1/dns-zones/${sdkClient.validatePathParam("dnsZone", request.dnsZone)}/clone`
89
- },
90
- marshalling_gen.unmarshalDNSZone
91
- );
92
- /**
93
- * Delete a DNS zone. Delete a DNS zone and all its records.
94
- *
95
- * @param request - The request {@link DeleteDNSZoneRequest}
96
- * @returns A Promise of DeleteDNSZoneResponse
97
- */
98
- deleteDNSZone = (request) => this.client.fetch(
99
- {
100
- method: "DELETE",
101
- path: `/domain/v2beta1/dns-zones/${sdkClient.validatePathParam("dnsZone", request.dnsZone)}`,
102
- urlParams: sdkClient.urlParams([
103
- "project_id",
104
- request.projectId ?? this.client.settings.defaultProjectId
105
- ])
106
- },
107
- marshalling_gen.unmarshalDeleteDNSZoneResponse
108
- );
109
- pageOfListDNSZoneRecords = (request) => this.client.fetch(
110
- {
111
- method: "GET",
112
- path: `/domain/v2beta1/dns-zones/${sdkClient.validatePathParam("dnsZone", request.dnsZone)}/records`,
113
- urlParams: sdkClient.urlParams(
114
- ["id", request.id],
115
- ["name", request.name],
116
- ["order_by", request.orderBy],
117
- ["page", request.page],
118
- [
119
- "page_size",
120
- request.pageSize ?? this.client.settings.defaultPageSize
121
- ],
122
- ["project_id", request.projectId],
123
- ["type", request.type]
124
- )
125
- },
126
- marshalling_gen.unmarshalListDNSZoneRecordsResponse
127
- );
128
- /**
129
- * List records within a DNS zone. Retrieve a list of DNS records within a DNS zone that has default name servers.
130
- You can filter records by type and name.
131
- *
132
- * @param request - The request {@link ListDNSZoneRecordsRequest}
133
- * @returns A Promise of ListDNSZoneRecordsResponse
134
- */
135
- listDNSZoneRecords = (request) => sdkClient.enrichForPagination("records", this.pageOfListDNSZoneRecords, request);
136
- /**
137
- * Update records within a DNS zone. Update records within a DNS zone that has default name servers and perform several actions on your records.
138
-
139
- Actions include:
140
- - add: allows you to add a new record or add a new IP to an existing A record, for example
141
- - set: allows you to edit a record or edit an IP from an existing A record, for example
142
- - delete: allows you to delete a record or delete an IP from an existing A record, for example
143
- - clear: allows you to delete all records from a DNS zone
144
-
145
- All edits will be versioned.
146
- *
147
- * @param request - The request {@link UpdateDNSZoneRecordsRequest}
148
- * @returns A Promise of UpdateDNSZoneRecordsResponse
149
- */
150
- updateDNSZoneRecords = (request) => this.client.fetch(
151
- {
152
- body: JSON.stringify(
153
- marshalling_gen.marshalUpdateDNSZoneRecordsRequest(request, this.client.settings)
154
- ),
155
- headers: jsonContentHeaders,
156
- method: "PATCH",
157
- path: `/domain/v2beta1/dns-zones/${sdkClient.validatePathParam("dnsZone", request.dnsZone)}/records`
158
- },
159
- marshalling_gen.unmarshalUpdateDNSZoneRecordsResponse
160
- );
161
- /**
162
- * List name servers within a DNS zone. Retrieve a list of name servers within a DNS zone and their optional glue records.
163
- *
164
- * @param request - The request {@link ListDNSZoneNameserversRequest}
165
- * @returns A Promise of ListDNSZoneNameserversResponse
166
- */
167
- listDNSZoneNameservers = (request) => this.client.fetch(
168
- {
169
- method: "GET",
170
- path: `/domain/v2beta1/dns-zones/${sdkClient.validatePathParam("dnsZone", request.dnsZone)}/nameservers`,
171
- urlParams: sdkClient.urlParams(["project_id", request.projectId])
172
- },
173
- marshalling_gen.unmarshalListDNSZoneNameserversResponse
174
- );
175
- /**
176
- * Update name servers within a DNS zone. Update name servers within a DNS zone and set optional glue records.
177
- *
178
- * @param request - The request {@link UpdateDNSZoneNameserversRequest}
179
- * @returns A Promise of UpdateDNSZoneNameserversResponse
180
- */
181
- updateDNSZoneNameservers = (request) => this.client.fetch(
182
- {
183
- body: JSON.stringify(
184
- marshalling_gen.marshalUpdateDNSZoneNameserversRequest(request, this.client.settings)
185
- ),
186
- headers: jsonContentHeaders,
187
- method: "PUT",
188
- path: `/domain/v2beta1/dns-zones/${sdkClient.validatePathParam("dnsZone", request.dnsZone)}/nameservers`
189
- },
190
- marshalling_gen.unmarshalUpdateDNSZoneNameserversResponse
191
- );
192
- /**
193
- * Clear records within a DNS zone. Delete all records within a DNS zone that has default name servers.<br/>
194
- All edits will be versioned.
195
- *
196
- * @param request - The request {@link ClearDNSZoneRecordsRequest}
197
- * @returns A Promise of ClearDNSZoneRecordsResponse
198
- */
199
- clearDNSZoneRecords = (request) => this.client.fetch(
200
- {
201
- method: "DELETE",
202
- path: `/domain/v2beta1/dns-zones/${sdkClient.validatePathParam("dnsZone", request.dnsZone)}/records`
203
- },
204
- marshalling_gen.unmarshalClearDNSZoneRecordsResponse
205
- );
206
- /**
207
- * Export a raw DNS zone. Export a DNS zone with default name servers, in a specific format.
208
- *
209
- * @param request - The request {@link ExportRawDNSZoneRequest}
210
- * @returns A Promise of Blob
211
- */
212
- exportRawDNSZone = (request) => this.client.fetch({
213
- method: "GET",
214
- path: `/domain/v2beta1/dns-zones/${sdkClient.validatePathParam("dnsZone", request.dnsZone)}/raw`,
215
- urlParams: sdkClient.urlParams(["dl", 1], ["format", request.format]),
216
- responseType: "blob"
217
- });
218
- /**
219
- * Import a raw DNS zone. Import and replace the format of records from a given provider, with default name servers.
220
- *
221
- * @param request - The request {@link ImportRawDNSZoneRequest}
222
- * @returns A Promise of ImportRawDNSZoneResponse
223
- */
224
- importRawDNSZone = (request) => this.client.fetch(
225
- {
226
- body: JSON.stringify(
227
- marshalling_gen.marshalImportRawDNSZoneRequest(request, this.client.settings)
228
- ),
229
- headers: jsonContentHeaders,
230
- method: "POST",
231
- path: `/domain/v2beta1/dns-zones/${sdkClient.validatePathParam("dnsZone", request.dnsZone)}/raw`
232
- },
233
- marshalling_gen.unmarshalImportRawDNSZoneResponse
234
- );
235
- /**
236
- * Import a DNS zone from another provider. Import and replace the format of records from a given provider, with default name servers.
237
- *
238
- * @param request - The request {@link ImportProviderDNSZoneRequest}
239
- * @returns A Promise of ImportProviderDNSZoneResponse
240
- */
241
- importProviderDNSZone = (request) => this.client.fetch(
242
- {
243
- body: JSON.stringify(
244
- marshalling_gen.marshalImportProviderDNSZoneRequest(request, this.client.settings)
245
- ),
246
- headers: jsonContentHeaders,
247
- method: "POST",
248
- path: `/domain/v2beta1/dns-zones/${sdkClient.validatePathParam("dnsZone", request.dnsZone)}/import-provider`
249
- },
250
- marshalling_gen.unmarshalImportProviderDNSZoneResponse
251
- );
252
- /**
253
- * Refresh a DNS zone. Refresh an SOA DNS zone to reload the records in the DNS zone and update the SOA serial.
254
- You can recreate the given DNS zone and its sub DNS zone if needed.
255
- *
256
- * @param request - The request {@link RefreshDNSZoneRequest}
257
- * @returns A Promise of RefreshDNSZoneResponse
258
- */
259
- refreshDNSZone = (request) => this.client.fetch(
260
- {
261
- body: JSON.stringify(
262
- marshalling_gen.marshalRefreshDNSZoneRequest(request, this.client.settings)
263
- ),
264
- headers: jsonContentHeaders,
265
- method: "POST",
266
- path: `/domain/v2beta1/dns-zones/${sdkClient.validatePathParam("dnsZone", request.dnsZone)}/refresh`
267
- },
268
- marshalling_gen.unmarshalRefreshDNSZoneResponse
269
- );
270
- pageOfListDNSZoneVersions = (request) => this.client.fetch(
271
- {
272
- method: "GET",
273
- path: `/domain/v2beta1/dns-zones/${sdkClient.validatePathParam("dnsZone", request.dnsZone)}/versions`,
274
- urlParams: sdkClient.urlParams(
275
- ["page", request.page],
276
- [
277
- "page_size",
278
- request.pageSize ?? this.client.settings.defaultPageSize
279
- ]
280
- )
281
- },
282
- marshalling_gen.unmarshalListDNSZoneVersionsResponse
283
- );
284
- /**
285
- * List versions of a DNS zone. Retrieve a list of a DNS zone's versions.<br/>
286
- The maximum version count is 100. If the count reaches this limit, the oldest version will be deleted after each new modification.
287
- *
288
- * @param request - The request {@link ListDNSZoneVersionsRequest}
289
- * @returns A Promise of ListDNSZoneVersionsResponse
290
- */
291
- listDNSZoneVersions = (request) => sdkClient.enrichForPagination("versions", this.pageOfListDNSZoneVersions, request);
292
- pageOfListDNSZoneVersionRecords = (request) => this.client.fetch(
293
- {
294
- method: "GET",
295
- path: `/domain/v2beta1/dns-zones/version/${sdkClient.validatePathParam("dnsZoneVersionId", request.dnsZoneVersionId)}`,
296
- urlParams: sdkClient.urlParams(
297
- ["page", request.page],
298
- [
299
- "page_size",
300
- request.pageSize ?? this.client.settings.defaultPageSize
301
- ]
302
- )
303
- },
304
- marshalling_gen.unmarshalListDNSZoneVersionRecordsResponse
305
- );
306
- /**
307
- * List records from a given version of a specific DNS zone. Retrieve a list of records from a specific DNS zone version.
308
- *
309
- * @param request - The request {@link ListDNSZoneVersionRecordsRequest}
310
- * @returns A Promise of ListDNSZoneVersionRecordsResponse
311
- */
312
- listDNSZoneVersionRecords = (request) => sdkClient.enrichForPagination(
313
- "records",
314
- this.pageOfListDNSZoneVersionRecords,
315
- request
316
- );
317
- /**
318
- * Access differences from a specific DNS zone version. Access a previous DNS zone version to see the differences from another specific version.
319
- *
320
- * @param request - The request {@link GetDNSZoneVersionDiffRequest}
321
- * @returns A Promise of GetDNSZoneVersionDiffResponse
322
- */
323
- getDNSZoneVersionDiff = (request) => this.client.fetch(
324
- {
325
- method: "GET",
326
- path: `/domain/v2beta1/dns-zones/version/${sdkClient.validatePathParam("dnsZoneVersionId", request.dnsZoneVersionId)}/diff`
327
- },
328
- marshalling_gen.unmarshalGetDNSZoneVersionDiffResponse
329
- );
330
- /**
331
- * Restore a DNS zone version. Restore and activate a version of a specific DNS zone.
332
- *
333
- * @param request - The request {@link RestoreDNSZoneVersionRequest}
334
- * @returns A Promise of RestoreDNSZoneVersionResponse
335
- */
336
- restoreDNSZoneVersion = (request) => this.client.fetch(
337
- {
338
- body: "{}",
339
- headers: jsonContentHeaders,
340
- method: "POST",
341
- path: `/domain/v2beta1/dns-zones/version/${sdkClient.validatePathParam("dnsZoneVersionId", request.dnsZoneVersionId)}/restore`
342
- },
343
- marshalling_gen.unmarshalRestoreDNSZoneVersionResponse
344
- );
345
- /**
346
- * Get a DNS zone's TLS certificate. Get the DNS zone's TLS certificate. If you do not have a certificate, the ouptut returns `no certificate found`.
347
- *
348
- * @param request - The request {@link GetSSLCertificateRequest}
349
- * @returns A Promise of SSLCertificate
350
- */
351
- getSSLCertificate = (request) => this.client.fetch(
352
- {
353
- method: "GET",
354
- path: `/domain/v2beta1/ssl-certificates/${sdkClient.validatePathParam("dnsZone", request.dnsZone)}`
355
- },
356
- marshalling_gen.unmarshalSSLCertificate
357
- );
358
- /**
359
- * Waits for {@link SSLCertificate} to be in a final state.
360
- *
361
- * @param request - The request {@link GetSSLCertificateRequest}
362
- * @param options - The waiting options
363
- * @returns A Promise of SSLCertificate
364
- */
365
- waitForSSLCertificate = (request, options) => sdkClient.waitForResource(
366
- options?.stop ?? ((res) => Promise.resolve(
367
- !content_gen.SSL_CERTIFICATE_TRANSIENT_STATUSES.includes(res.status)
368
- )),
369
- this.getSSLCertificate,
370
- request,
371
- options
372
- );
373
- /**
374
- * Create or get the DNS zone's TLS certificate. Create a new TLS certificate or retrieve information about an existing TLS certificate.
375
- *
376
- * @param request - The request {@link CreateSSLCertificateRequest}
377
- * @returns A Promise of SSLCertificate
378
- */
379
- createSSLCertificate = (request) => this.client.fetch(
380
- {
381
- body: JSON.stringify(
382
- marshalling_gen.marshalCreateSSLCertificateRequest(request, this.client.settings)
383
- ),
384
- headers: jsonContentHeaders,
385
- method: "POST",
386
- path: `/domain/v2beta1/ssl-certificates`
387
- },
388
- marshalling_gen.unmarshalSSLCertificate
389
- );
390
- pageOfListSSLCertificates = (request) => this.client.fetch(
391
- {
392
- method: "GET",
393
- path: `/domain/v2beta1/ssl-certificates`,
394
- urlParams: sdkClient.urlParams(
395
- ["dns_zone", request.dnsZone],
396
- ["page", request.page],
397
- [
398
- "page_size",
399
- request.pageSize ?? this.client.settings.defaultPageSize
400
- ],
401
- ["project_id", request.projectId]
402
- )
403
- },
404
- marshalling_gen.unmarshalListSSLCertificatesResponse
405
- );
406
- /**
407
- * List a user's TLS certificates. List all the TLS certificates a user has created, specified by the user's Project ID and the DNS zone.
408
- *
409
- * @param request - The request {@link ListSSLCertificatesRequest}
410
- * @returns A Promise of ListSSLCertificatesResponse
411
- */
412
- listSSLCertificates = (request) => sdkClient.enrichForPagination("certificates", this.pageOfListSSLCertificates, request);
413
- /**
414
- * Delete a TLS certificate. Delete an existing TLS certificate specified by its DNS zone. Deleting a TLS certificate is permanent and cannot be undone.
415
- *
416
- * @param request - The request {@link DeleteSSLCertificateRequest}
417
- * @returns A Promise of DeleteSSLCertificateResponse
418
- */
419
- deleteSSLCertificate = (request) => this.client.fetch(
420
- {
421
- method: "DELETE",
422
- path: `/domain/v2beta1/ssl-certificates/${sdkClient.validatePathParam("dnsZone", request.dnsZone)}`
423
- },
424
- marshalling_gen.unmarshalDeleteSSLCertificateResponse
425
- );
426
- /**
427
- * Get the DNS zone's TSIG key. Retrieve information about the TSIG key of a given DNS zone to allow AXFR requests.
428
- *
429
- * @param request - The request {@link GetDNSZoneTsigKeyRequest}
430
- * @returns A Promise of GetDNSZoneTsigKeyResponse
431
- */
432
- getDNSZoneTsigKey = (request) => this.client.fetch(
433
- {
434
- method: "GET",
435
- path: `/domain/v2beta1/dns-zones/${sdkClient.validatePathParam("dnsZone", request.dnsZone)}/tsig-key`
436
- },
437
- marshalling_gen.unmarshalGetDNSZoneTsigKeyResponse
438
- );
439
- /**
440
- * Delete the DNS zone's TSIG key. Delete an existing TSIG key specified by its DNS zone. Deleting a TSIG key is permanent and cannot be undone.
441
- *
442
- * @param request - The request {@link DeleteDNSZoneTsigKeyRequest}
443
- */
444
- deleteDNSZoneTsigKey = (request) => this.client.fetch({
445
- method: "DELETE",
446
- path: `/domain/v2beta1/dns-zones/${sdkClient.validatePathParam("dnsZone", request.dnsZone)}/tsig-key`
447
- });
448
- }
449
- class RegistrarAPI extends sdkClient.API {
450
- pageOfListTasks = (request = {}) => this.client.fetch(
451
- {
452
- method: "GET",
453
- path: `/domain/v2beta1/tasks`,
454
- urlParams: sdkClient.urlParams(
455
- ["domain", request.domain],
456
- ["order_by", request.orderBy],
457
- ["organization_id", request.organizationId],
458
- ["page", request.page],
459
- [
460
- "page_size",
461
- request.pageSize ?? this.client.settings.defaultPageSize
462
- ],
463
- ["project_id", request.projectId],
464
- ["statuses", request.statuses],
465
- ["types", request.types]
466
- )
467
- },
468
- marshalling_gen.unmarshalListTasksResponse
469
- );
470
- /**
471
- * List tasks. List all operations performed on the account.
472
- You can filter the list of tasks by domain name.
473
- *
474
- * @param request - The request {@link RegistrarApiListTasksRequest}
475
- * @returns A Promise of ListTasksResponse
476
- */
477
- listTasks = (request = {}) => sdkClient.enrichForPagination("tasks", this.pageOfListTasks, request);
478
- pageOfListInboundTransfers = (request) => this.client.fetch(
479
- {
480
- method: "GET",
481
- path: `/domain/v2beta1/inbound-transfers`,
482
- urlParams: sdkClient.urlParams(
483
- ["domain", request.domain],
484
- [
485
- "organization_id",
486
- request.organizationId ?? this.client.settings.defaultOrganizationId
487
- ],
488
- ["page", request.page],
489
- [
490
- "page_size",
491
- request.pageSize ?? this.client.settings.defaultPageSize
492
- ],
493
- [
494
- "project_id",
495
- request.projectId ?? this.client.settings.defaultProjectId
496
- ]
497
- )
498
- },
499
- marshalling_gen.unmarshalListInboundTransfersResponse
500
- );
501
- listInboundTransfers = (request) => sdkClient.enrichForPagination(
502
- "inboundTransfers",
503
- this.pageOfListInboundTransfers,
504
- request
505
- );
506
- /**
507
- * Retry the inbound transfer of a domain. Request a retry for the transfer of a domain from another registrar to Scaleway Domains and DNS.
508
- *
509
- * @param request - The request {@link RegistrarApiRetryInboundTransferRequest}
510
- * @returns A Promise of RetryInboundTransferResponse
511
- */
512
- retryInboundTransfer = (request) => this.client.fetch(
513
- {
514
- body: JSON.stringify(
515
- marshalling_gen.marshalRegistrarApiRetryInboundTransferRequest(
516
- request,
517
- this.client.settings
518
- )
519
- ),
520
- headers: jsonContentHeaders,
521
- method: "POST",
522
- path: `/domain/v2beta1/retry-inbound-transfer`
523
- },
524
- marshalling_gen.unmarshalRetryInboundTransferResponse
525
- );
526
- /**
527
- * Purchase domains. Request the registration of domain names.
528
- You can provide a domain's already existing contact or a new contact.
529
- *
530
- * @param request - The request {@link RegistrarApiBuyDomainsRequest}
531
- * @returns A Promise of OrderResponse
532
- */
533
- buyDomains = (request) => this.client.fetch(
534
- {
535
- body: JSON.stringify(
536
- marshalling_gen.marshalRegistrarApiBuyDomainsRequest(request, this.client.settings)
537
- ),
538
- headers: jsonContentHeaders,
539
- method: "POST",
540
- path: `/domain/v2beta1/buy-domains`
541
- },
542
- marshalling_gen.unmarshalOrderResponse
543
- );
544
- /**
545
- * Renew domains. Request the renewal of one or more domain names.
546
- *
547
- * @param request - The request {@link RegistrarApiRenewDomainsRequest}
548
- * @returns A Promise of OrderResponse
549
- */
550
- renewDomains = (request) => this.client.fetch(
551
- {
552
- body: JSON.stringify(
553
- marshalling_gen.marshalRegistrarApiRenewDomainsRequest(request, this.client.settings)
554
- ),
555
- headers: jsonContentHeaders,
556
- method: "POST",
557
- path: `/domain/v2beta1/renew-domains`
558
- },
559
- marshalling_gen.unmarshalOrderResponse
560
- );
561
- /**
562
- * Transfer a domain. Request the transfer of a domain from another registrar to Scaleway Domains and DNS.
563
- *
564
- * @param request - The request {@link RegistrarApiTransferInDomainRequest}
565
- * @returns A Promise of OrderResponse
566
- */
567
- transferInDomain = (request) => this.client.fetch(
568
- {
569
- body: JSON.stringify(
570
- marshalling_gen.marshalRegistrarApiTransferInDomainRequest(
571
- request,
572
- this.client.settings
573
- )
574
- ),
575
- headers: jsonContentHeaders,
576
- method: "POST",
577
- path: `/domain/v2beta1/domains/transfer-domains`
578
- },
579
- marshalling_gen.unmarshalOrderResponse
580
- );
581
- /**
582
- * Trade a domain's contact. Request to change a domain's contact owner.<br/>
583
- If you specify the `organization_id` of the domain's new owner, the contact will change from the current owner's Scaleway account to the new owner's Scaleway account.<br/>
584
- If the new owner's current contact information is not available, the first ever contact they have created for previous domains is taken into account to operate the change.<br/>
585
- If the new owner has never created a contact to register domains before, an error message displays.
586
- *
587
- * @param request - The request {@link RegistrarApiTradeDomainRequest}
588
- * @returns A Promise of OrderResponse
589
- */
590
- tradeDomain = (request) => this.client.fetch(
591
- {
592
- body: JSON.stringify(
593
- marshalling_gen.marshalRegistrarApiTradeDomainRequest(request, this.client.settings)
594
- ),
595
- headers: jsonContentHeaders,
596
- method: "POST",
597
- path: `/domain/v2beta1/domains/${sdkClient.validatePathParam("domain", request.domain)}/trade`
598
- },
599
- marshalling_gen.unmarshalOrderResponse
600
- );
601
- /**
602
- * Register an external domain. Request the registration of an external domain name.
603
- *
604
- * @param request - The request {@link RegistrarApiRegisterExternalDomainRequest}
605
- * @returns A Promise of RegisterExternalDomainResponse
606
- */
607
- registerExternalDomain = (request) => this.client.fetch(
608
- {
609
- body: JSON.stringify(
610
- marshalling_gen.marshalRegistrarApiRegisterExternalDomainRequest(
611
- request,
612
- this.client.settings
613
- )
614
- ),
615
- headers: jsonContentHeaders,
616
- method: "POST",
617
- path: `/domain/v2beta1/external-domains`
618
- },
619
- marshalling_gen.unmarshalRegisterExternalDomainResponse
620
- );
621
- /**
622
- * Delete an external domain. Delete an external domain name.
623
- *
624
- * @param request - The request {@link RegistrarApiDeleteExternalDomainRequest}
625
- * @returns A Promise of DeleteExternalDomainResponse
626
- */
627
- deleteExternalDomain = (request) => this.client.fetch(
628
- {
629
- method: "DELETE",
630
- path: `/domain/v2beta1/external-domains/${sdkClient.validatePathParam("domain", request.domain)}`
631
- },
632
- marshalling_gen.unmarshalDeleteExternalDomainResponse
633
- );
634
- /**
635
- * Check if contacts are compatible with a domain or a TLD. Check whether contacts are compatible with a domain or a TLD.
636
- If contacts are not compatible with either the domain or the TLD, the information that needs to be corrected is returned.
637
- *
638
- * @param request - The request {@link RegistrarApiCheckContactsCompatibilityRequest}
639
- * @returns A Promise of CheckContactsCompatibilityResponse
640
- */
641
- checkContactsCompatibility = (request = {}) => this.client.fetch(
642
- {
643
- body: JSON.stringify(
644
- marshalling_gen.marshalRegistrarApiCheckContactsCompatibilityRequest(
645
- request,
646
- this.client.settings
647
- )
648
- ),
649
- headers: jsonContentHeaders,
650
- method: "POST",
651
- path: `/domain/v2beta1/check-contacts-compatibility`
652
- },
653
- marshalling_gen.unmarshalCheckContactsCompatibilityResponse
654
- );
655
- pageOfListContacts = (request = {}) => this.client.fetch(
656
- {
657
- method: "GET",
658
- path: `/domain/v2beta1/contacts`,
659
- urlParams: sdkClient.urlParams(
660
- ["domain", request.domain],
661
- ["email_status", request.emailStatus],
662
- ["organization_id", request.organizationId],
663
- ["page", request.page],
664
- [
665
- "page_size",
666
- request.pageSize ?? this.client.settings.defaultPageSize
667
- ],
668
- ["project_id", request.projectId],
669
- ["role", request.role]
670
- )
671
- },
672
- marshalling_gen.unmarshalListContactsResponse
673
- );
674
- /**
675
- * List contacts. Retrieve the list of contacts and their associated domains and roles.
676
- You can filter the list by domain name.
677
- *
678
- * @param request - The request {@link RegistrarApiListContactsRequest}
679
- * @returns A Promise of ListContactsResponse
680
- */
681
- listContacts = (request = {}) => sdkClient.enrichForPagination("contacts", this.pageOfListContacts, request);
682
- /**
683
- * Get a contact. Retrieve a contact's details from the registrar using the given contact's ID.
684
- *
685
- * @param request - The request {@link RegistrarApiGetContactRequest}
686
- * @returns A Promise of Contact
687
- */
688
- getContact = (request) => this.client.fetch(
689
- {
690
- method: "GET",
691
- path: `/domain/v2beta1/contacts/${sdkClient.validatePathParam("contactId", request.contactId)}`
692
- },
693
- marshalling_gen.unmarshalContact
694
- );
695
- /**
696
- * Update contact. Edit the contact's information.
697
- *
698
- * @param request - The request {@link RegistrarApiUpdateContactRequest}
699
- * @returns A Promise of Contact
700
- */
701
- updateContact = (request) => this.client.fetch(
702
- {
703
- body: JSON.stringify(
704
- marshalling_gen.marshalRegistrarApiUpdateContactRequest(
705
- request,
706
- this.client.settings
707
- )
708
- ),
709
- headers: jsonContentHeaders,
710
- method: "PATCH",
711
- path: `/domain/v2beta1/contacts/${sdkClient.validatePathParam("contactId", request.contactId)}`
712
- },
713
- marshalling_gen.unmarshalContact
714
- );
715
- pageOfListDomains = (request = {}) => this.client.fetch(
716
- {
717
- method: "GET",
718
- path: `/domain/v2beta1/domains`,
719
- urlParams: sdkClient.urlParams(
720
- ["domain", request.domain],
721
- ["is_external", request.isExternal],
722
- ["order_by", request.orderBy],
723
- ["organization_id", request.organizationId],
724
- ["page", request.page],
725
- [
726
- "page_size",
727
- request.pageSize ?? this.client.settings.defaultPageSize
728
- ],
729
- ["project_id", request.projectId],
730
- ["registrar", request.registrar],
731
- ["status", request.status]
732
- )
733
- },
734
- marshalling_gen.unmarshalListDomainsResponse
735
- );
736
- /**
737
- * List domains. Retrieve the list of domains you own.
738
- *
739
- * @param request - The request {@link RegistrarApiListDomainsRequest}
740
- * @returns A Promise of ListDomainsResponse
741
- */
742
- listDomains = (request = {}) => sdkClient.enrichForPagination("domains", this.pageOfListDomains, request);
743
- pageOfListRenewableDomains = (request = {}) => this.client.fetch(
744
- {
745
- method: "GET",
746
- path: `/domain/v2beta1/renewable-domains`,
747
- urlParams: sdkClient.urlParams(
748
- ["order_by", request.orderBy],
749
- ["organization_id", request.organizationId],
750
- ["page", request.page],
751
- [
752
- "page_size",
753
- request.pageSize ?? this.client.settings.defaultPageSize
754
- ],
755
- ["project_id", request.projectId]
756
- )
757
- },
758
- marshalling_gen.unmarshalListRenewableDomainsResponse
759
- );
760
- /**
761
- * List domains that can be renewed. Retrieve the list of domains you own that can be renewed. You can also see the maximum renewal duration in years for your domains that are renewable.
762
- *
763
- * @param request - The request {@link RegistrarApiListRenewableDomainsRequest}
764
- * @returns A Promise of ListRenewableDomainsResponse
765
- */
766
- listRenewableDomains = (request = {}) => sdkClient.enrichForPagination("domains", this.pageOfListRenewableDomains, request);
767
- /**
768
- * Get domain. Retrieve a specific domain and display the domain's information.
769
- *
770
- * @param request - The request {@link RegistrarApiGetDomainRequest}
771
- * @returns A Promise of Domain
772
- */
773
- getDomain = (request) => this.client.fetch(
774
- {
775
- method: "GET",
776
- path: `/domain/v2beta1/domains/${sdkClient.validatePathParam("domain", request.domain)}`
777
- },
778
- marshalling_gen.unmarshalDomain
779
- );
780
- /**
781
- * Waits for {@link Domain} to be in a final state.
782
- *
783
- * @param request - The request {@link RegistrarApiGetDomainRequest}
784
- * @param options - The waiting options
785
- * @returns A Promise of Domain
786
- */
787
- waitForDomain = (request, options) => sdkClient.waitForResource(
788
- options?.stop ?? ((res) => Promise.resolve(
789
- !content_gen.DOMAIN_TRANSIENT_STATUSES.includes(res.status)
790
- )),
791
- this.getDomain,
792
- request,
793
- options
794
- );
795
- /**
796
- * Update a domain's contacts. Update contacts for a specific domain or create a new contact.<br/>
797
- If you add the same contact for multiple roles (owner, administrative, technical), only one ID will be created and used for all of the roles.
798
- *
799
- * @param request - The request {@link RegistrarApiUpdateDomainRequest}
800
- * @returns A Promise of Domain
801
- */
802
- updateDomain = (request) => this.client.fetch(
803
- {
804
- body: JSON.stringify(
805
- marshalling_gen.marshalRegistrarApiUpdateDomainRequest(request, this.client.settings)
806
- ),
807
- headers: jsonContentHeaders,
808
- method: "PATCH",
809
- path: `/domain/v2beta1/domains/${sdkClient.validatePathParam("domain", request.domain)}`
810
- },
811
- marshalling_gen.unmarshalDomain
812
- );
813
- /**
814
- * Lock the transfer of a domain. Lock the transfer of a domain. This means that the domain cannot be transferred and the authorization code cannot be requested to your current registrar.
815
- *
816
- * @param request - The request {@link RegistrarApiLockDomainTransferRequest}
817
- * @returns A Promise of Domain
818
- */
819
- lockDomainTransfer = (request) => this.client.fetch(
820
- {
821
- body: "{}",
822
- headers: jsonContentHeaders,
823
- method: "POST",
824
- path: `/domain/v2beta1/domains/${sdkClient.validatePathParam("domain", request.domain)}/lock-transfer`
825
- },
826
- marshalling_gen.unmarshalDomain
827
- );
828
- /**
829
- * Unlock the transfer of a domain. Unlock the transfer of a domain. This means that the domain can be transferred and the authorization code can be requested to your current registrar.
830
- *
831
- * @param request - The request {@link RegistrarApiUnlockDomainTransferRequest}
832
- * @returns A Promise of Domain
833
- */
834
- unlockDomainTransfer = (request) => this.client.fetch(
835
- {
836
- body: "{}",
837
- headers: jsonContentHeaders,
838
- method: "POST",
839
- path: `/domain/v2beta1/domains/${sdkClient.validatePathParam("domain", request.domain)}/unlock-transfer`
840
- },
841
- marshalling_gen.unmarshalDomain
842
- );
843
- /**
844
- * Enable auto renew. Enable the `auto renew` feature for a domain. This means the domain will be automatically renewed before its expiry date.
845
- *
846
- * @param request - The request {@link RegistrarApiEnableDomainAutoRenewRequest}
847
- * @returns A Promise of Domain
848
- */
849
- enableDomainAutoRenew = (request) => this.client.fetch(
850
- {
851
- body: "{}",
852
- headers: jsonContentHeaders,
853
- method: "POST",
854
- path: `/domain/v2beta1/domains/${sdkClient.validatePathParam("domain", request.domain)}/enable-auto-renew`
855
- },
856
- marshalling_gen.unmarshalDomain
857
- );
858
- /**
859
- * Disable auto renew. Disable the `auto renew` feature for a domain. This means the domain will not be renewed before its expiry date.
860
- *
861
- * @param request - The request {@link RegistrarApiDisableDomainAutoRenewRequest}
862
- * @returns A Promise of Domain
863
- */
864
- disableDomainAutoRenew = (request) => this.client.fetch(
865
- {
866
- body: "{}",
867
- headers: jsonContentHeaders,
868
- method: "POST",
869
- path: `/domain/v2beta1/domains/${sdkClient.validatePathParam("domain", request.domain)}/disable-auto-renew`
870
- },
871
- marshalling_gen.unmarshalDomain
872
- );
873
- /**
874
- * Get a domain's authorization code. Retrieve the authorization code to tranfer an unlocked domain. The output returns an error if the domain is locked.
875
- Some TLDs may have a different procedure to retrieve the authorization code. In that case, the information displays in the message field.
876
- *
877
- * @param request - The request {@link RegistrarApiGetDomainAuthCodeRequest}
878
- * @returns A Promise of GetDomainAuthCodeResponse
879
- */
880
- getDomainAuthCode = (request) => this.client.fetch(
881
- {
882
- method: "GET",
883
- path: `/domain/v2beta1/domains/${sdkClient.validatePathParam("domain", request.domain)}/auth-code`
884
- },
885
- marshalling_gen.unmarshalGetDomainAuthCodeResponse
886
- );
887
- /**
888
- * Update domain DNSSEC. If your domain uses another registrar and has the default Scaleway NS, you have to **update the DS record at your registrar**.
889
- *
890
- * @param request - The request {@link RegistrarApiEnableDomainDNSSECRequest}
891
- * @returns A Promise of Domain
892
- */
893
- enableDomainDNSSEC = (request) => this.client.fetch(
894
- {
895
- body: JSON.stringify(
896
- marshalling_gen.marshalRegistrarApiEnableDomainDNSSECRequest(
897
- request,
898
- this.client.settings
899
- )
900
- ),
901
- headers: jsonContentHeaders,
902
- method: "POST",
903
- path: `/domain/v2beta1/domains/${sdkClient.validatePathParam("domain", request.domain)}/enable-dnssec`
904
- },
905
- marshalling_gen.unmarshalDomain
906
- );
907
- /**
908
- * Disable a domain's DNSSEC. Disable DNSSEC for a domain.
909
- *
910
- * @param request - The request {@link RegistrarApiDisableDomainDNSSECRequest}
911
- * @returns A Promise of Domain
912
- */
913
- disableDomainDNSSEC = (request) => this.client.fetch(
914
- {
915
- body: "{}",
916
- headers: jsonContentHeaders,
917
- method: "POST",
918
- path: `/domain/v2beta1/domains/${sdkClient.validatePathParam("domain", request.domain)}/disable-dnssec`
919
- },
920
- marshalling_gen.unmarshalDomain
921
- );
922
- /**
923
- * Search available domains. Search a domain or a maximum of 10 domains that are available.
924
-
925
- If the TLD list is empty or not set, the search returns the results from the most popular TLDs.
926
- *
927
- * @param request - The request {@link RegistrarApiSearchAvailableDomainsRequest}
928
- * @returns A Promise of SearchAvailableDomainsResponse
929
- */
930
- searchAvailableDomains = (request) => this.client.fetch(
931
- {
932
- method: "GET",
933
- path: `/domain/v2beta1/search-domains`,
934
- urlParams: sdkClient.urlParams(
935
- ["domains", request.domains],
936
- ["strict_search", request.strictSearch],
937
- ["tlds", request.tlds]
938
- )
939
- },
940
- marshalling_gen.unmarshalSearchAvailableDomainsResponse
941
- );
942
- pageOfListTlds = (request = {}) => this.client.fetch(
943
- {
944
- method: "GET",
945
- path: `/domain/v2beta1/tlds`,
946
- urlParams: sdkClient.urlParams(
947
- ["order_by", request.orderBy],
948
- ["page", request.page],
949
- [
950
- "page_size",
951
- request.pageSize ?? this.client.settings.defaultPageSize
952
- ],
953
- ["tlds", request.tlds]
954
- )
955
- },
956
- marshalling_gen.unmarshalListTldsResponse
957
- );
958
- /**
959
- * List TLD offers. Retrieve the list of TLDs and offers associated with them.
960
- *
961
- * @param request - The request {@link RegistrarApiListTldsRequest}
962
- * @returns A Promise of ListTldsResponse
963
- */
964
- listTlds = (request = {}) => sdkClient.enrichForPagination("tlds", this.pageOfListTlds, request);
965
- /**
966
- * Create a hostname for a domain. Create a hostname for a domain with glue IPs.
967
- *
968
- * @param request - The request {@link RegistrarApiCreateDomainHostRequest}
969
- * @returns A Promise of Host
970
- */
971
- createDomainHost = (request) => this.client.fetch(
972
- {
973
- body: JSON.stringify(
974
- marshalling_gen.marshalRegistrarApiCreateDomainHostRequest(
975
- request,
976
- this.client.settings
977
- )
978
- ),
979
- headers: jsonContentHeaders,
980
- method: "POST",
981
- path: `/domain/v2beta1/domains/${sdkClient.validatePathParam("domain", request.domain)}/hosts`
982
- },
983
- marshalling_gen.unmarshalHost
984
- );
985
- pageOfListDomainHosts = (request) => this.client.fetch(
986
- {
987
- method: "GET",
988
- path: `/domain/v2beta1/domains/${sdkClient.validatePathParam("domain", request.domain)}/hosts`,
989
- urlParams: sdkClient.urlParams(
990
- ["page", request.page],
991
- [
992
- "page_size",
993
- request.pageSize ?? this.client.settings.defaultPageSize
994
- ]
995
- )
996
- },
997
- marshalling_gen.unmarshalListDomainHostsResponse
998
- );
999
- /**
1000
- * List a domain's hostnames. List a domain's hostnames using their glue IPs.
1001
- *
1002
- * @param request - The request {@link RegistrarApiListDomainHostsRequest}
1003
- * @returns A Promise of ListDomainHostsResponse
1004
- */
1005
- listDomainHosts = (request) => sdkClient.enrichForPagination("hosts", this.pageOfListDomainHosts, request);
1006
- /**
1007
- * Update a domain's hostname. Update a domain's hostname with glue IPs.
1008
- *
1009
- * @param request - The request {@link RegistrarApiUpdateDomainHostRequest}
1010
- * @returns A Promise of Host
1011
- */
1012
- updateDomainHost = (request) => this.client.fetch(
1013
- {
1014
- body: JSON.stringify(
1015
- marshalling_gen.marshalRegistrarApiUpdateDomainHostRequest(
1016
- request,
1017
- this.client.settings
1018
- )
1019
- ),
1020
- headers: jsonContentHeaders,
1021
- method: "PATCH",
1022
- path: `/domain/v2beta1/domains/${sdkClient.validatePathParam("domain", request.domain)}/hosts/${sdkClient.validatePathParam("name", request.name)}`
1023
- },
1024
- marshalling_gen.unmarshalHost
1025
- );
1026
- /**
1027
- * Delete a domain's hostname.
1028
- *
1029
- * @param request - The request {@link RegistrarApiDeleteDomainHostRequest}
1030
- * @returns A Promise of Host
1031
- */
1032
- deleteDomainHost = (request) => this.client.fetch(
1033
- {
1034
- method: "DELETE",
1035
- path: `/domain/v2beta1/domains/${sdkClient.validatePathParam("domain", request.domain)}/hosts/${sdkClient.validatePathParam("name", request.name)}`
1036
- },
1037
- marshalling_gen.unmarshalHost
1038
- );
1039
- }
1040
- exports.API = API;
1041
- exports.RegistrarAPI = RegistrarAPI;