@wix/domains 1.0.0 → 1.0.2

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,3 +1,668 @@
1
+ /** A `connectedDomain` object holds information about an external domain and its connection to a Wix site. */
2
+ interface ConnectedDomain {
3
+ /**
4
+ * ID of the connected domain. Identical to the domain name including TLD.
5
+ * @readonly
6
+ */
7
+ _id?: string;
8
+ /**
9
+ * Domain name including TLD.
10
+ * Both root domains and subdomains are supported.
11
+ */
12
+ domain?: string;
13
+ /**
14
+ * How the domain is connected to the Wix site.
15
+ *
16
+ * + `"UNKNOWN_CONNECTION_TYPE"`: There is no information about the connection type.
17
+ * + `"POINTING"`: The domain is connected by pointing. Wix doesn't manage DNS information.
18
+ * + `"NAMESERVERS"`: The domain is connected by nameservers. Wix manages DNS information.
19
+ * + `"HIDDEN"`: The domain isn't visible to site visitors.
20
+ */
21
+ connectionType?: ConnectionType;
22
+ /**
23
+ * Information about the site to which the domain is assigned to and whether
24
+ * it's the primary domain or a redirect.
25
+ */
26
+ siteInfo?: SiteInfo$1;
27
+ /**
28
+ * Whether the site owner receives standard email notifications from Wix about
29
+ * the connected domain.
30
+ *
31
+ * Default: `false`
32
+ */
33
+ suppressNotifications?: boolean;
34
+ /**
35
+ * DNS propagation status.
36
+ *
37
+ * + `"UNKNOWN_DNS_PROPAGATION_STATUS"`: There's no information about the domain's DNS propagation status.
38
+ * + `"IN_PROGRESS"`: The domain's DNS propagation process has started but hasn't successfully completed yet.
39
+ * + `"COMPLETED"`: The domain's DNS propagation process has successfully finished.
40
+ * + `"FAILED"`: The domain's DNS propagation process has failed.
41
+ * @readonly
42
+ */
43
+ dnsPropagationStatus?: DnsPropagationStatus$1;
44
+ }
45
+ declare enum ConnectionType {
46
+ /** Used by sub domain */
47
+ UNKNOWN_CONNECTION_TYPE = "UNKNOWN_CONNECTION_TYPE",
48
+ POINTING = "POINTING",
49
+ NAMESERVERS = "NAMESERVERS",
50
+ /**
51
+ * internal used by photography company.
52
+ * when a customer creates a photo album, each album has its sub domain and this sub domain
53
+ * is not visible in my domains page.
54
+ */
55
+ HIDDEN = "HIDDEN"
56
+ }
57
+ interface SiteInfo$1 extends SiteInfoAssignmentInfoOneOf$1 {
58
+ /**
59
+ * Extra details in case assignment type is redirect.
60
+ * @readonly
61
+ */
62
+ redirectInfo?: RedirectAssignmentInfo$1;
63
+ /**
64
+ * ID of the site the domain is assigned to, will be taken from context.
65
+ * @readonly
66
+ */
67
+ _id?: string | null;
68
+ /**
69
+ * The assignment type the relationship will be based on:
70
+ * + `"UNKNOWN_ASSIGNMENT_TYPE"`: There is no information about the domain assignment type
71
+ * + `"PRIMARY"`: There can only be one primary domain per site, the result of this assignment type is that the domain will lead directly to a site.
72
+ * + `"REDIRECT"`: There can be multiple redirect domains. the result of this assignment type is that the redirects will lead to the primary domain
73
+ * Read more about [primary and redirected domains](https://support.wix.com/en/article/switching-your-primary-and-redirected-domains).
74
+ */
75
+ assignmentType?: AssignmentType$1;
76
+ }
77
+ /** @oneof */
78
+ interface SiteInfoAssignmentInfoOneOf$1 {
79
+ /**
80
+ * Extra details in case assignment type is redirect.
81
+ * @readonly
82
+ */
83
+ redirectInfo?: RedirectAssignmentInfo$1;
84
+ }
85
+ declare enum AssignmentType$1 {
86
+ UNKNOWN_ASSIGNMENT_TYPE = "UNKNOWN_ASSIGNMENT_TYPE",
87
+ PRIMARY = "PRIMARY",
88
+ REDIRECT = "REDIRECT"
89
+ }
90
+ interface RedirectAssignmentInfo$1 {
91
+ /**
92
+ * Primary domain the redirect points to.
93
+ * @readonly
94
+ */
95
+ primaryDomain?: string;
96
+ }
97
+ declare enum DnsPropagationStatus$1 {
98
+ UNKNOWN_DNS_PROPAGATION_STATUS = "UNKNOWN_DNS_PROPAGATION_STATUS",
99
+ COMPLETED = "COMPLETED",
100
+ FAILED = "FAILED",
101
+ IN_PROGRESS = "IN_PROGRESS"
102
+ }
103
+ interface DomainRemovedEvent {
104
+ /**
105
+ * Domain name including TLD.
106
+ * Both root domains and subdomains are supported.
107
+ */
108
+ domain?: string;
109
+ }
110
+ interface CursorPaging$1 {
111
+ /**
112
+ * Number of domains to load.
113
+ *
114
+ * Min: `0`
115
+ * Max: `100`
116
+ */
117
+ limit?: number | null;
118
+ /**
119
+ * Pointer to the next or previous page in the list of results.
120
+ *
121
+ * You can get the relevant cursor token
122
+ * from the `pagingMetadata` object in the previous call's response.
123
+ * Not relevant for the first request.
124
+ */
125
+ cursor?: string | null;
126
+ }
127
+ interface ListConnectedDomainsResponse {
128
+ /** Metadata about the returned list of connected domains. */
129
+ pagingMetadata?: CursorPagingMetadata$1;
130
+ /** Retrieved connected domains. */
131
+ connectedDomains?: ConnectedDomain[];
132
+ }
133
+ interface CursorPagingMetadata$1 {
134
+ /** Number of domains returned in the response. */
135
+ count?: number | null;
136
+ /** Offset that was requested. */
137
+ cursors?: Cursors$1;
138
+ /**
139
+ * Indicates if there are more results after the current page.
140
+ * If `true`, another page of results can be retrieved.
141
+ * If `false`, this is the last page.
142
+ */
143
+ hasNext?: boolean | null;
144
+ }
145
+ interface Cursors$1 {
146
+ /** Cursor pointing to next page in the list of results. */
147
+ next?: string | null;
148
+ /** Cursor pointing to previous page in the list of results. */
149
+ prev?: string | null;
150
+ }
151
+ interface IdentificationData extends IdentificationDataIdOneOf {
152
+ /** ID of a site visitor that has not logged in to the site. */
153
+ anonymousVisitorId?: string;
154
+ /** ID of a site visitor that has logged in to the site. */
155
+ memberId?: string;
156
+ /** ID of a Wix user (site owner, contributor, etc.). */
157
+ wixUserId?: string;
158
+ /** ID of an app. */
159
+ appId?: string;
160
+ /** @readonly */
161
+ identityType?: WebhookIdentityType;
162
+ }
163
+ /** @oneof */
164
+ interface IdentificationDataIdOneOf {
165
+ /** ID of a site visitor that has not logged in to the site. */
166
+ anonymousVisitorId?: string;
167
+ /** ID of a site visitor that has logged in to the site. */
168
+ memberId?: string;
169
+ /** ID of a Wix user (site owner, contributor, etc.). */
170
+ wixUserId?: string;
171
+ /** ID of an app. */
172
+ appId?: string;
173
+ }
174
+ declare enum WebhookIdentityType {
175
+ UNKNOWN = "UNKNOWN",
176
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
177
+ MEMBER = "MEMBER",
178
+ WIX_USER = "WIX_USER",
179
+ APP = "APP"
180
+ }
181
+ interface ListConnectedDomainsResponseNonNullableFields {
182
+ connectedDomains: {
183
+ _id: string;
184
+ domain: string;
185
+ connectionType: ConnectionType;
186
+ siteInfo?: {
187
+ redirectInfo?: {
188
+ primaryDomain: string;
189
+ };
190
+ assignmentType: AssignmentType$1;
191
+ };
192
+ suppressNotifications: boolean;
193
+ dnsPropagationStatus: DnsPropagationStatus$1;
194
+ }[];
195
+ }
196
+ interface BaseEventMetadata {
197
+ /** App instance ID. */
198
+ instanceId?: string | null;
199
+ /** Event type. */
200
+ eventType?: string;
201
+ /** The identification type and identity data. */
202
+ identity?: IdentificationData;
203
+ }
204
+ interface EventMetadata extends BaseEventMetadata {
205
+ /**
206
+ * Unique event ID.
207
+ * Allows clients to ignore duplicate webhooks.
208
+ */
209
+ _id?: string;
210
+ /**
211
+ * Assumes actions are also always typed to an entity_type
212
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
213
+ */
214
+ entityFqdn?: string;
215
+ /**
216
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
217
+ * This is although the created/updated/deleted notion is duplication of the oneof types
218
+ * Example: created/updated/deleted/started/completed/email_opened
219
+ */
220
+ slug?: string;
221
+ /** ID of the entity associated with the event. */
222
+ entityId?: string;
223
+ /** Event timestamp. */
224
+ eventTime?: Date;
225
+ /**
226
+ * Whether the event was triggered as a result of a privacy regulation application
227
+ * (for example, GDPR).
228
+ */
229
+ triggeredByAnonymizeRequest?: boolean | null;
230
+ /** If present, indicates the action that triggered the event. */
231
+ originatedFrom?: string | null;
232
+ /**
233
+ * A sequence number defining the order of updates to the underlying entity.
234
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
235
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
236
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
237
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
238
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
239
+ */
240
+ entityEventSequence?: string | null;
241
+ }
242
+ interface ConnectedDomainRemovedEnvelope {
243
+ data: DomainRemovedEvent;
244
+ metadata: EventMetadata;
245
+ }
246
+ interface ListConnectedDomainsOptions {
247
+ /** Cursor paging options. */
248
+ paging?: CursorPaging$1;
249
+ }
250
+
251
+ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
252
+ interface HttpClient {
253
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
254
+ }
255
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
256
+ type HttpResponse<T = any> = {
257
+ data: T;
258
+ status: number;
259
+ statusText: string;
260
+ headers: any;
261
+ request?: any;
262
+ };
263
+ type RequestOptions<_TResponse = any, Data = any> = {
264
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
265
+ url: string;
266
+ data?: Data;
267
+ params?: URLSearchParams;
268
+ } & APIMetadata;
269
+ type APIMetadata = {
270
+ methodFqn?: string;
271
+ entityFqdn?: string;
272
+ packageName?: string;
273
+ };
274
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
275
+ type EventDefinition<Payload = unknown, Type extends string = string> = {
276
+ __type: 'event-definition';
277
+ type: Type;
278
+ isDomainEvent?: boolean;
279
+ transformations?: unknown;
280
+ __payload: Payload;
281
+ };
282
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
283
+ type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
284
+ type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
285
+
286
+ declare function createConnectedDomain$1(httpClient: HttpClient): (connectedDomain: ConnectedDomain) => Promise<ConnectedDomain & {
287
+ _id: string;
288
+ domain: string;
289
+ connectionType: ConnectionType;
290
+ siteInfo?: {
291
+ redirectInfo?: {
292
+ primaryDomain: string;
293
+ } | undefined;
294
+ assignmentType: AssignmentType$1;
295
+ } | undefined;
296
+ suppressNotifications: boolean;
297
+ dnsPropagationStatus: DnsPropagationStatus$1;
298
+ }>;
299
+ declare function getConnectedDomain$1(httpClient: HttpClient): (connectedDomainId: string) => Promise<ConnectedDomain & {
300
+ _id: string;
301
+ domain: string;
302
+ connectionType: ConnectionType;
303
+ siteInfo?: {
304
+ redirectInfo?: {
305
+ primaryDomain: string;
306
+ } | undefined;
307
+ assignmentType: AssignmentType$1;
308
+ } | undefined;
309
+ suppressNotifications: boolean;
310
+ dnsPropagationStatus: DnsPropagationStatus$1;
311
+ }>;
312
+ declare function listConnectedDomains$1(httpClient: HttpClient): (options?: ListConnectedDomainsOptions) => Promise<ListConnectedDomainsResponse & ListConnectedDomainsResponseNonNullableFields>;
313
+ declare const onConnectedDomainRemoved$1: EventDefinition<ConnectedDomainRemovedEnvelope, "wix.premium.domains.v1.connected_domain_removed">;
314
+
315
+ declare const createConnectedDomain: BuildRESTFunction<typeof createConnectedDomain$1>;
316
+ declare const getConnectedDomain: BuildRESTFunction<typeof getConnectedDomain$1>;
317
+ declare const listConnectedDomains: BuildRESTFunction<typeof listConnectedDomains$1>;
318
+ declare const onConnectedDomainRemoved: BuildEventDefinition<typeof onConnectedDomainRemoved$1>;
319
+
320
+ declare const context$4_createConnectedDomain: typeof createConnectedDomain;
321
+ declare const context$4_getConnectedDomain: typeof getConnectedDomain;
322
+ declare const context$4_listConnectedDomains: typeof listConnectedDomains;
323
+ declare const context$4_onConnectedDomainRemoved: typeof onConnectedDomainRemoved;
324
+ declare namespace context$4 {
325
+ export { context$4_createConnectedDomain as createConnectedDomain, context$4_getConnectedDomain as getConnectedDomain, context$4_listConnectedDomains as listConnectedDomains, context$4_onConnectedDomainRemoved as onConnectedDomainRemoved };
326
+ }
327
+
328
+ /**
329
+ * A `connectedDomainSetupInfo` object holds information the connected domain's
330
+ * external registrar and some DNS records. You can use this information to guide
331
+ * the site owner through the domain's setup process.
332
+ */
333
+ interface ConnectedDomainSetupInfo extends ConnectedDomainSetupInfoDnsRecordsOneOf {
334
+ /**
335
+ * Information about domains connected using nameservers. Available only for
336
+ * `{"connectionType": "NAMESERVERS"}`.
337
+ */
338
+ nameserverRecord?: NameserverRecord;
339
+ /**
340
+ * Information about domains connected by pointing. Available only for
341
+ * `{"connectionType": "POINTING"}`.
342
+ * @readonly
343
+ */
344
+ pointingRecords?: PointingRecords;
345
+ /**
346
+ * Information about subdomains. Available only for subdomains.
347
+ * @readonly
348
+ */
349
+ subdomainRecords?: SubdomainRecords;
350
+ /** ID of the connected domain. Identical to the domain name including TLD. */
351
+ connectedDomainId?: string;
352
+ /**
353
+ * Information about the external domain registrar including current name
354
+ * servers.
355
+ */
356
+ registrar?: Registrar;
357
+ }
358
+ /** @oneof */
359
+ interface ConnectedDomainSetupInfoDnsRecordsOneOf {
360
+ /**
361
+ * Information about domains connected using nameservers. Available only for
362
+ * `{"connectionType": "NAMESERVERS"}`.
363
+ */
364
+ nameserverRecord?: NameserverRecord;
365
+ /**
366
+ * Information about domains connected by pointing. Available only for
367
+ * `{"connectionType": "POINTING"}`.
368
+ * @readonly
369
+ */
370
+ pointingRecords?: PointingRecords;
371
+ /**
372
+ * Information about subdomains. Available only for subdomains.
373
+ * @readonly
374
+ */
375
+ subdomainRecords?: SubdomainRecords;
376
+ }
377
+ interface Registrar {
378
+ /**
379
+ * Name of the external domain registrar. For subdomains it's the registrar of the root domain.
380
+ * @readonly
381
+ */
382
+ name?: string | null;
383
+ /**
384
+ * Values of the current name server records. In case you connect an external
385
+ * domain using name servers, site owners must replace these current name servers
386
+ * with the new name servers found in `connectedDomainSetupInfo.nameserverRecord.nsRecord.values`
387
+ * during the initial domain setup.
388
+ * The replacement can't be performed through Wix APIs, you must use the
389
+ * infrastructure of the external domain registrar. Read more about
390
+ * [connecting domains using nameservers](https://dev.wix.com/api/rest/account-level-apis/connected-domains/sample-flows#account-level-apis_connected-domains_sample-flows_connect-an-external-domain-using-nameservers).
391
+ * @readonly
392
+ */
393
+ nameServers?: string[];
394
+ }
395
+ /** Information about domains connected by nameservers. */
396
+ interface NameserverRecord {
397
+ /**
398
+ * Default [nameserver record](https://en.wikipedia.org/wiki/List_of_DNS_record_types#NS).
399
+ * @readonly
400
+ */
401
+ nsRecord?: NsRecord;
402
+ }
403
+ interface NsRecord {
404
+ /** Domain host name. For example `domain.com` or `mail.domain.com`. Can be a subdomain. */
405
+ hostName?: string;
406
+ /** [Time to live](https://en.wikipedia.org/wiki/Time_to_live) in seconds. */
407
+ ttl?: number;
408
+ /** DNS record values. */
409
+ values?: string[];
410
+ }
411
+ /** Information about domains connected by pointing. */
412
+ interface PointingRecords {
413
+ /**
414
+ * [Address record](https://en.wikipedia.org/wiki/List_of_DNS_record_types#A).
415
+ * @readonly
416
+ */
417
+ aRecord?: ARecord;
418
+ /**
419
+ * [Canonical Name record](https://en.wikipedia.org/wiki/CNAME_record).
420
+ * @readonly
421
+ */
422
+ cnameRecord?: CnameRecord;
423
+ }
424
+ interface ARecord {
425
+ /** Domain host name. For example `domain.com` or `mail.domain.com`. Can be a subdomain. */
426
+ hostName?: string;
427
+ /** [Time to live](https://en.wikipedia.org/wiki/Time_to_live) in seconds. */
428
+ ttl?: number;
429
+ /** DNS record values. */
430
+ values?: string[];
431
+ }
432
+ interface CnameRecord {
433
+ /** Domain host name. For example `domain.com` or `mail.domain.com`. Can be a subdomain. */
434
+ hostName?: string;
435
+ /** [Time to live](https://en.wikipedia.org/wiki/Time_to_live) in seconds. */
436
+ ttl?: number;
437
+ /** DNS record value. */
438
+ value?: string;
439
+ }
440
+ /** Information about subdomains. */
441
+ interface SubdomainRecords {
442
+ /**
443
+ * [Canonical Name records](https://en.wikipedia.org/wiki/CNAME_record).
444
+ * @readonly
445
+ */
446
+ cnameRecords?: CnameRecord[];
447
+ }
448
+ interface GetConnectedDomainSetupInfoResponse {
449
+ /** Retrieved setup information. */
450
+ connectedDomainSetupInfo?: ConnectedDomainSetupInfo;
451
+ }
452
+ interface GetConnectedDomainSetupInfoResponseNonNullableFields {
453
+ connectedDomainSetupInfo?: {
454
+ nameserverRecord?: {
455
+ nsRecord?: {
456
+ hostName: string;
457
+ ttl: number;
458
+ values: string[];
459
+ };
460
+ };
461
+ pointingRecords?: {
462
+ aRecord?: {
463
+ hostName: string;
464
+ ttl: number;
465
+ values: string[];
466
+ };
467
+ cnameRecord?: {
468
+ hostName: string;
469
+ ttl: number;
470
+ value: string;
471
+ };
472
+ };
473
+ subdomainRecords?: {
474
+ cnameRecords: {
475
+ hostName: string;
476
+ ttl: number;
477
+ value: string;
478
+ }[];
479
+ };
480
+ connectedDomainId: string;
481
+ registrar?: {
482
+ nameServers: string[];
483
+ };
484
+ };
485
+ }
486
+
487
+ declare function getConnectedDomainSetupInfo$1(httpClient: HttpClient): (connectedDomainId: string) => Promise<GetConnectedDomainSetupInfoResponse & GetConnectedDomainSetupInfoResponseNonNullableFields>;
488
+
489
+ declare const getConnectedDomainSetupInfo: BuildRESTFunction<typeof getConnectedDomainSetupInfo$1>;
490
+
491
+ declare const context$3_getConnectedDomainSetupInfo: typeof getConnectedDomainSetupInfo;
492
+ declare namespace context$3 {
493
+ export { context$3_getConnectedDomainSetupInfo as getConnectedDomainSetupInfo };
494
+ }
495
+
496
+ /** DNS zones hold information about the records that map a domain's URL to an IP address. */
497
+ interface DnsZone {
498
+ /** Domain name including the TLD. Both root domains and subdomains are supported. */
499
+ domainName?: string;
500
+ /**
501
+ * DNS records. You can only set up a single `record` object per DNS record
502
+ * type. If you want to specify multiple values for the same record type, you
503
+ * must save them in the `values` for the relevant type.
504
+ *
505
+ * Min: 2 DNS record - a DNS zone file has to have at least two required DNS records: NS and SOA records
506
+ * Max: 5000 DNS records
507
+ */
508
+ records?: DnsRecord[];
509
+ /**
510
+ * ID of the Dns Zone. Identical to the domain name including TLD.
511
+ * @readonly
512
+ */
513
+ _id?: string;
514
+ /**
515
+ * Whether [DNS Security Extensions (DNSSEC)](https://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions) are enabled.
516
+ *
517
+ * Default: `false`
518
+ */
519
+ dnssecEnabled?: boolean;
520
+ }
521
+ interface DnsRecord {
522
+ /**
523
+ * [DNS record type](https://en.wikipedia.org/wiki/List_of_DNS_record_types).
524
+ *
525
+ * + `UNKNOWN`: Default value. Used in case the record type isn't known. You can't set a record type to `UNKNOWN`.
526
+ * + `A`: Address record. Most fundamental type of DNS record that indicates the IP address of a given domain.
527
+ * + `AAAA`: Address record in [IPv6 format](https://en.wikipedia.org/wiki/IPv6).
528
+ * + `NS`: Name server record. Describes which server contains the actual DNS record.
529
+ * + `SOA`: [Start of authority record](https://en.wikipedia.org/wiki/SOA_record). Holds adminstrative information about the zone.
530
+ * + `CNAME`: [CNAME record](https://en.wikipedia.org/wiki/CNAME_record). Maps an alias name to the canonical domain name.
531
+ * + `MX`: MX record. Directs emails to mail servers.
532
+ * + `TXT`: [TXT record](https://en.wikipedia.org/wiki/TXT_record). Used by domain admins to add human readable descriptions.
533
+ * + `SPF`: SPF record. Used for email authentication.
534
+ * + `SRV`: [Service record](https://en.wikipedia.org/wiki/SRV_record). Defines the server location.
535
+ * + `PTR`: Pointer record. Specifies which host is supported for a given IP address.
536
+ * + `NAPTR`: [Name Authority Pointer record](https://en.wikipedia.org/wiki/NAPTR_record). Used by Internet telephony applications.
537
+ */
538
+ type?: RecordType;
539
+ /**
540
+ * Host name. Can be a subdomain. For example, `domain.com` or
541
+ * `mail.domain.com`. Equal to the domain name, except for `CNAME` records.
542
+ */
543
+ hostName?: string;
544
+ /** [Time to live](https://en.wikipedia.org/wiki/Time_to_live) in seconds. */
545
+ ttl?: number;
546
+ /**
547
+ * DNS record values. Wix limits DNS records to 50 values per type. External
548
+ * providers may support a different maximum number of DNS records for a
549
+ * specific type, Wix doesn't validate that you don't exceed these external
550
+ * limits.
551
+ *
552
+ * Max: 50 records
553
+ */
554
+ values?: string[];
555
+ }
556
+ declare enum RecordType {
557
+ UNKNOWN = "UNKNOWN",
558
+ A = "A",
559
+ AAAA = "AAAA",
560
+ NS = "NS",
561
+ SOA = "SOA",
562
+ CNAME = "CNAME",
563
+ MX = "MX",
564
+ TXT = "TXT",
565
+ SPF = "SPF",
566
+ SRV = "SRV",
567
+ PTR = "PTR",
568
+ NAPTR = "NAPTR"
569
+ }
570
+ interface UpdateDnsZoneResponse {
571
+ /** Updated DNS zone. */
572
+ dnsZone?: DnsZone;
573
+ }
574
+ interface PreviewDnsZoneResponse {
575
+ /**
576
+ * DNS zone preview.
577
+ *
578
+ * Includes calculated `A`, `CNAME`, `NS` and `SOA` records.
579
+ */
580
+ dnsZone?: DnsZone;
581
+ }
582
+ interface UpdateDnsZoneResponseNonNullableFields {
583
+ dnsZone?: {
584
+ domainName: string;
585
+ records: {
586
+ type: RecordType;
587
+ hostName: string;
588
+ ttl: number;
589
+ values: string[];
590
+ }[];
591
+ _id: string;
592
+ dnssecEnabled: boolean;
593
+ };
594
+ }
595
+ interface PreviewDnsZoneResponseNonNullableFields {
596
+ dnsZone?: {
597
+ domainName: string;
598
+ records: {
599
+ type: RecordType;
600
+ hostName: string;
601
+ ttl: number;
602
+ values: string[];
603
+ }[];
604
+ _id: string;
605
+ dnssecEnabled: boolean;
606
+ };
607
+ }
608
+ interface UpdateDnsZoneOptions {
609
+ /**
610
+ * DNS records to add to the DNS zone.
611
+ *
612
+ * Max: 10 additions
613
+ */
614
+ additions?: DnsRecord[];
615
+ /**
616
+ * DNS records to remove from the DNS zone.
617
+ *
618
+ * Max: 10 deletions
619
+ */
620
+ deletions?: DnsRecord[];
621
+ /** Whether you want to enable or disable [DNS Security Extensions (DNSSEC)](https://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions). */
622
+ dnssecEnabled?: boolean | null;
623
+ }
624
+
625
+ declare function createDnsZone$1(httpClient: HttpClient): (dnsZone: DnsZone) => Promise<DnsZone & {
626
+ domainName: string;
627
+ records: {
628
+ type: RecordType;
629
+ hostName: string;
630
+ ttl: number;
631
+ values: string[];
632
+ }[];
633
+ _id: string;
634
+ dnssecEnabled: boolean;
635
+ }>;
636
+ declare function getDnsZone$1(httpClient: HttpClient): (domainName: string) => Promise<DnsZone & {
637
+ domainName: string;
638
+ records: {
639
+ type: RecordType;
640
+ hostName: string;
641
+ ttl: number;
642
+ values: string[];
643
+ }[];
644
+ _id: string;
645
+ dnssecEnabled: boolean;
646
+ }>;
647
+ declare function updateDnsZone$1(httpClient: HttpClient): (domainName: string, options?: UpdateDnsZoneOptions) => Promise<UpdateDnsZoneResponse & UpdateDnsZoneResponseNonNullableFields>;
648
+ declare function deleteDnsZone$1(httpClient: HttpClient): (domainName: string) => Promise<void>;
649
+ declare function previewDnsZone$1(httpClient: HttpClient): (domainName: string) => Promise<PreviewDnsZoneResponse & PreviewDnsZoneResponseNonNullableFields>;
650
+
651
+ declare const createDnsZone: BuildRESTFunction<typeof createDnsZone$1>;
652
+ declare const getDnsZone: BuildRESTFunction<typeof getDnsZone$1>;
653
+ declare const updateDnsZone: BuildRESTFunction<typeof updateDnsZone$1>;
654
+ declare const deleteDnsZone: BuildRESTFunction<typeof deleteDnsZone$1>;
655
+ declare const previewDnsZone: BuildRESTFunction<typeof previewDnsZone$1>;
656
+
657
+ declare const context$2_createDnsZone: typeof createDnsZone;
658
+ declare const context$2_deleteDnsZone: typeof deleteDnsZone;
659
+ declare const context$2_getDnsZone: typeof getDnsZone;
660
+ declare const context$2_previewDnsZone: typeof previewDnsZone;
661
+ declare const context$2_updateDnsZone: typeof updateDnsZone;
662
+ declare namespace context$2 {
663
+ export { context$2_createDnsZone as createDnsZone, context$2_deleteDnsZone as deleteDnsZone, context$2_getDnsZone as getDnsZone, context$2_previewDnsZone as previewDnsZone, context$2_updateDnsZone as updateDnsZone };
664
+ }
665
+
1
666
  /**
2
667
  * A registered domain is a domain that Wix has registered on behalf of a customer
3
668
  * with an external registar.
@@ -563,31 +1228,6 @@ interface ListRegisteredDomainsOptions {
563
1228
  paging?: CursorPaging;
564
1229
  }
565
1230
 
566
- type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
567
- interface HttpClient {
568
- request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
569
- }
570
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
571
- type HttpResponse<T = any> = {
572
- data: T;
573
- status: number;
574
- statusText: string;
575
- headers: any;
576
- request?: any;
577
- };
578
- type RequestOptions<_TResponse = any, Data = any> = {
579
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
580
- url: string;
581
- data?: Data;
582
- params?: URLSearchParams;
583
- } & APIMetadata;
584
- type APIMetadata = {
585
- methodFqn?: string;
586
- entityFqdn?: string;
587
- packageName?: string;
588
- };
589
- type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
590
-
591
1231
  declare function createRegisteredDomain$1(httpClient: HttpClient): (registeredDomain: RegisteredDomain) => Promise<RegisteredDomain & {
592
1232
  pendingRegistrationInfo?: {
593
1233
  latestAttempt?: {
@@ -716,12 +1356,55 @@ declare const getRegisteredDomain: BuildRESTFunction<typeof getRegisteredDomain$
716
1356
  declare const listRegisteredDomains: BuildRESTFunction<typeof listRegisteredDomains$1>;
717
1357
  declare const redeemRegisteredDomain: BuildRESTFunction<typeof redeemRegisteredDomain$1>;
718
1358
 
719
- declare const context_createRegisteredDomain: typeof createRegisteredDomain;
720
- declare const context_getRegisteredDomain: typeof getRegisteredDomain;
721
- declare const context_listRegisteredDomains: typeof listRegisteredDomains;
722
- declare const context_redeemRegisteredDomain: typeof redeemRegisteredDomain;
1359
+ declare const context$1_createRegisteredDomain: typeof createRegisteredDomain;
1360
+ declare const context$1_getRegisteredDomain: typeof getRegisteredDomain;
1361
+ declare const context$1_listRegisteredDomains: typeof listRegisteredDomains;
1362
+ declare const context$1_redeemRegisteredDomain: typeof redeemRegisteredDomain;
1363
+ declare namespace context$1 {
1364
+ export { context$1_createRegisteredDomain as createRegisteredDomain, context$1_getRegisteredDomain as getRegisteredDomain, context$1_listRegisteredDomains as listRegisteredDomains, context$1_redeemRegisteredDomain as redeemRegisteredDomain };
1365
+ }
1366
+
1367
+ interface DomainSuggestion {
1368
+ /** Suggested domain name including TLD. */
1369
+ domain?: string;
1370
+ }
1371
+ interface SuggestDomainsResponse {
1372
+ /** List of suggested available domains. */
1373
+ suggestions?: DomainSuggestion[];
1374
+ }
1375
+ interface SuggestDomainsResponseNonNullableFields {
1376
+ suggestions: {
1377
+ domain: string;
1378
+ }[];
1379
+ }
1380
+ interface SuggestDomainsOptions {
1381
+ /**
1382
+ * [Top-level domains](https://en.wikipedia.org/wiki/Top-level_domain). Must
1383
+ * not include the dot. For example, `com`, not `.com`. Not all TLDs can be
1384
+ * connected to Wix sites. Supported TLDS include `com`, `net`, and `org`.
1385
+ * Contact the [Wix B2B sales team](mailto:bizdev@wix.com) for more
1386
+ * information.
1387
+ *
1388
+ * Max: 10 TLDs
1389
+ */
1390
+ tlds?: string[];
1391
+ /**
1392
+ * Number of domain suggestions to return.
1393
+ *
1394
+ * Min: `1`
1395
+ * Max: `20`
1396
+ * Default: `10`
1397
+ */
1398
+ limit?: number | null;
1399
+ }
1400
+
1401
+ declare function suggestDomains$1(httpClient: HttpClient): (query: string, options?: SuggestDomainsOptions) => Promise<SuggestDomainsResponse & SuggestDomainsResponseNonNullableFields>;
1402
+
1403
+ declare const suggestDomains: BuildRESTFunction<typeof suggestDomains$1>;
1404
+
1405
+ declare const context_suggestDomains: typeof suggestDomains;
723
1406
  declare namespace context {
724
- export { context_createRegisteredDomain as createRegisteredDomain, context_getRegisteredDomain as getRegisteredDomain, context_listRegisteredDomains as listRegisteredDomains, context_redeemRegisteredDomain as redeemRegisteredDomain };
1407
+ export { context_suggestDomains as suggestDomains };
725
1408
  }
726
1409
 
727
- export { context as registeredDomains };
1410
+ export { context$3 as connectedDomainSetupInfo, context$4 as connectedDomains, context$2 as domainDns, context as domainSuggestions, context$1 as registeredDomains };