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