@wix/domains 1.0.5 → 1.0.7

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,278 +1,29 @@
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
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
255
- }
256
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
257
- type HttpResponse<T = any> = {
1
+ type RESTFunctionDescriptor$5<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$5) => T;
2
+ interface HttpClient$5 {
3
+ request<TResponse, TData = any>(req: RequestOptionsFactory$5<TResponse, TData>): Promise<HttpResponse$5<TResponse>>;
4
+ fetchWithAuth: typeof fetch;
5
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
6
+ }
7
+ type RequestOptionsFactory$5<TResponse = any, TData = any> = (context: any) => RequestOptions$5<TResponse, TData>;
8
+ type HttpResponse$5<T = any> = {
258
9
  data: T;
259
10
  status: number;
260
11
  statusText: string;
261
12
  headers: any;
262
13
  request?: any;
263
14
  };
264
- type RequestOptions<_TResponse = any, Data = any> = {
15
+ type RequestOptions$5<_TResponse = any, Data = any> = {
265
16
  method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
266
17
  url: string;
267
18
  data?: Data;
268
19
  params?: URLSearchParams;
269
- } & APIMetadata;
270
- type APIMetadata = {
20
+ } & APIMetadata$5;
21
+ type APIMetadata$5 = {
271
22
  methodFqn?: string;
272
23
  entityFqdn?: string;
273
24
  packageName?: string;
274
25
  };
275
- type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
26
+ type BuildRESTFunction$5<T extends RESTFunctionDescriptor$5> = T extends RESTFunctionDescriptor$5<infer U> ? U : never;
276
27
  type EventDefinition<Payload = unknown, Type extends string = string> = {
277
28
  __type: 'event-definition';
278
29
  type: Type;
@@ -291,39 +42,14 @@ declare global {
291
42
  }
292
43
  }
293
44
 
294
- declare function createConnectedDomain$1(httpClient: HttpClient): (connectedDomain: ConnectedDomain) => Promise<ConnectedDomain & {
295
- _id: string;
296
- domain: string;
297
- connectionType: ConnectionType;
298
- siteInfo?: {
299
- redirectInfo?: {
300
- primaryDomain: string;
301
- } | undefined;
302
- assignmentType: AssignmentType$1;
303
- } | undefined;
304
- suppressNotifications: boolean;
305
- dnsPropagationStatus: DnsPropagationStatus$1;
306
- }>;
307
- declare function getConnectedDomain$1(httpClient: HttpClient): (connectedDomainId: string) => Promise<ConnectedDomain & {
308
- _id: string;
309
- domain: string;
310
- connectionType: ConnectionType;
311
- siteInfo?: {
312
- redirectInfo?: {
313
- primaryDomain: string;
314
- } | undefined;
315
- assignmentType: AssignmentType$1;
316
- } | undefined;
317
- suppressNotifications: boolean;
318
- dnsPropagationStatus: DnsPropagationStatus$1;
319
- }>;
320
- declare function listConnectedDomains$1(httpClient: HttpClient): (options?: ListConnectedDomainsOptions) => Promise<ListConnectedDomainsResponse & ListConnectedDomainsResponseNonNullableFields>;
321
- declare const onConnectedDomainRemoved$1: EventDefinition<ConnectedDomainRemovedEnvelope, "wix.premium.domains.v1.connected_domain_removed">;
45
+ declare function createRESTModule$5<T extends RESTFunctionDescriptor$5>(descriptor: T, elevated?: boolean): BuildRESTFunction$5<T> & T;
46
+
47
+ declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
322
48
 
323
- declare const createConnectedDomain: BuildRESTFunction<typeof createConnectedDomain$1>;
324
- declare const getConnectedDomain: BuildRESTFunction<typeof getConnectedDomain$1>;
325
- declare const listConnectedDomains: BuildRESTFunction<typeof listConnectedDomains$1>;
326
- declare const onConnectedDomainRemoved: BuildEventDefinition<typeof onConnectedDomainRemoved$1>;
49
+ declare const createConnectedDomain: ReturnType<typeof createRESTModule$5<typeof publicCreateConnectedDomain>>;
50
+ declare const getConnectedDomain: ReturnType<typeof createRESTModule$5<typeof publicGetConnectedDomain>>;
51
+ declare const listConnectedDomains: ReturnType<typeof createRESTModule$5<typeof publicListConnectedDomains>>;
52
+ declare const onConnectedDomainRemoved: ReturnType<typeof createEventModule<typeof publicOnConnectedDomainRemoved>>;
327
53
 
328
54
  declare const context$5_createConnectedDomain: typeof createConnectedDomain;
329
55
  declare const context$5_getConnectedDomain: typeof getConnectedDomain;
@@ -333,334 +59,90 @@ declare namespace context$5 {
333
59
  export { context$5_createConnectedDomain as createConnectedDomain, context$5_getConnectedDomain as getConnectedDomain, context$5_listConnectedDomains as listConnectedDomains, context$5_onConnectedDomainRemoved as onConnectedDomainRemoved };
334
60
  }
335
61
 
336
- /**
337
- * A `connectedDomainSetupInfo` object holds information the connected domain's
338
- * external registrar and some DNS records. You can use this information to guide
339
- * the site owner through the domain's setup process.
340
- */
341
- interface ConnectedDomainSetupInfo extends ConnectedDomainSetupInfoDnsRecordsOneOf {
342
- /**
343
- * Information about domains connected using nameservers. Available only for
344
- * `{"connectionType": "NAMESERVERS"}`.
345
- */
346
- nameserverRecord?: NameserverRecord;
347
- /**
348
- * Information about domains connected by pointing. Available only for
349
- * `{"connectionType": "POINTING"}`.
350
- * @readonly
351
- */
352
- pointingRecords?: PointingRecords;
353
- /**
354
- * Information about subdomains. Available only for subdomains.
355
- * @readonly
356
- */
357
- subdomainRecords?: SubdomainRecords;
358
- /** ID of the connected domain. Identical to the domain name including TLD. */
359
- connectedDomainId?: string;
360
- /**
361
- * Information about the external domain registrar including current name
362
- * servers.
363
- */
364
- registrar?: Registrar;
365
- }
366
- /** @oneof */
367
- interface ConnectedDomainSetupInfoDnsRecordsOneOf {
368
- /**
369
- * Information about domains connected using nameservers. Available only for
370
- * `{"connectionType": "NAMESERVERS"}`.
371
- */
372
- nameserverRecord?: NameserverRecord;
373
- /**
374
- * Information about domains connected by pointing. Available only for
375
- * `{"connectionType": "POINTING"}`.
376
- * @readonly
377
- */
378
- pointingRecords?: PointingRecords;
379
- /**
380
- * Information about subdomains. Available only for subdomains.
381
- * @readonly
382
- */
383
- subdomainRecords?: SubdomainRecords;
384
- }
385
- interface Registrar {
386
- /**
387
- * Name of the external domain registrar. For subdomains it's the registrar of the root domain.
388
- * @readonly
389
- */
390
- name?: string | null;
391
- /**
392
- * Values of the current name server records. In case you connect an external
393
- * domain using name servers, site owners must replace these current name servers
394
- * with the new name servers found in `connectedDomainSetupInfo.nameserverRecord.nsRecord.values`
395
- * during the initial domain setup.
396
- * The replacement can't be performed through Wix APIs, you must use the
397
- * infrastructure of the external domain registrar. Read more about
398
- * [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).
399
- * @readonly
400
- */
401
- nameServers?: string[];
402
- }
403
- /** Information about domains connected by nameservers. */
404
- interface NameserverRecord {
405
- /**
406
- * Default [nameserver record](https://en.wikipedia.org/wiki/List_of_DNS_record_types#NS).
407
- * @readonly
408
- */
409
- nsRecord?: NsRecord;
410
- }
411
- interface NsRecord {
412
- /** Domain host name. For example `domain.com` or `mail.domain.com`. Can be a subdomain. */
413
- hostName?: string;
414
- /** [Time to live](https://en.wikipedia.org/wiki/Time_to_live) in seconds. */
415
- ttl?: number;
416
- /** DNS record values. */
417
- values?: string[];
418
- }
419
- /** Information about domains connected by pointing. */
420
- interface PointingRecords {
421
- /**
422
- * [Address record](https://en.wikipedia.org/wiki/List_of_DNS_record_types#A).
423
- * @readonly
424
- */
425
- aRecord?: ARecord;
426
- /**
427
- * [Canonical Name record](https://en.wikipedia.org/wiki/CNAME_record).
428
- * @readonly
429
- */
430
- cnameRecord?: CnameRecord;
431
- }
432
- interface ARecord {
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 values. */
438
- values?: string[];
439
- }
440
- interface CnameRecord {
441
- /** Domain host name. For example `domain.com` or `mail.domain.com`. Can be a subdomain. */
442
- hostName?: string;
443
- /** [Time to live](https://en.wikipedia.org/wiki/Time_to_live) in seconds. */
444
- ttl?: number;
445
- /** DNS record value. */
446
- value?: string;
447
- }
448
- /** Information about subdomains. */
449
- interface SubdomainRecords {
450
- /**
451
- * [Canonical Name records](https://en.wikipedia.org/wiki/CNAME_record).
452
- * @readonly
453
- */
454
- cnameRecords?: CnameRecord[];
455
- }
456
- interface GetConnectedDomainSetupInfoResponse {
457
- /** Retrieved setup information. */
458
- connectedDomainSetupInfo?: ConnectedDomainSetupInfo;
459
- }
460
- interface GetConnectedDomainSetupInfoResponseNonNullableFields {
461
- connectedDomainSetupInfo?: {
462
- nameserverRecord?: {
463
- nsRecord?: {
464
- hostName: string;
465
- ttl: number;
466
- values: string[];
467
- };
468
- };
469
- pointingRecords?: {
470
- aRecord?: {
471
- hostName: string;
472
- ttl: number;
473
- values: string[];
474
- };
475
- cnameRecord?: {
476
- hostName: string;
477
- ttl: number;
478
- value: string;
479
- };
480
- };
481
- subdomainRecords?: {
482
- cnameRecords: {
483
- hostName: string;
484
- ttl: number;
485
- value: string;
486
- }[];
487
- };
488
- connectedDomainId: string;
489
- registrar?: {
490
- nameServers: string[];
491
- };
492
- };
62
+ type RESTFunctionDescriptor$4<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$4) => T;
63
+ interface HttpClient$4 {
64
+ request<TResponse, TData = any>(req: RequestOptionsFactory$4<TResponse, TData>): Promise<HttpResponse$4<TResponse>>;
65
+ fetchWithAuth: typeof fetch;
66
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
67
+ }
68
+ type RequestOptionsFactory$4<TResponse = any, TData = any> = (context: any) => RequestOptions$4<TResponse, TData>;
69
+ type HttpResponse$4<T = any> = {
70
+ data: T;
71
+ status: number;
72
+ statusText: string;
73
+ headers: any;
74
+ request?: any;
75
+ };
76
+ type RequestOptions$4<_TResponse = any, Data = any> = {
77
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
78
+ url: string;
79
+ data?: Data;
80
+ params?: URLSearchParams;
81
+ } & APIMetadata$4;
82
+ type APIMetadata$4 = {
83
+ methodFqn?: string;
84
+ entityFqdn?: string;
85
+ packageName?: string;
86
+ };
87
+ type BuildRESTFunction$4<T extends RESTFunctionDescriptor$4> = T extends RESTFunctionDescriptor$4<infer U> ? U : never;
88
+
89
+ declare global {
90
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
91
+ interface SymbolConstructor {
92
+ readonly observable: symbol;
93
+ }
493
94
  }
494
95
 
495
- declare function getConnectedDomainSetupInfo$1(httpClient: HttpClient): (connectedDomainId: string) => Promise<GetConnectedDomainSetupInfoResponse & GetConnectedDomainSetupInfoResponseNonNullableFields>;
96
+ declare function createRESTModule$4<T extends RESTFunctionDescriptor$4>(descriptor: T, elevated?: boolean): BuildRESTFunction$4<T> & T;
496
97
 
497
- declare const getConnectedDomainSetupInfo: BuildRESTFunction<typeof getConnectedDomainSetupInfo$1>;
98
+ declare const getConnectedDomainSetupInfo: ReturnType<typeof createRESTModule$4<typeof publicGetConnectedDomainSetupInfo>>;
498
99
 
499
100
  declare const context$4_getConnectedDomainSetupInfo: typeof getConnectedDomainSetupInfo;
500
101
  declare namespace context$4 {
501
102
  export { context$4_getConnectedDomainSetupInfo as getConnectedDomainSetupInfo };
502
103
  }
503
104
 
504
- /** DNS zones hold information about the records that map a domain's URL to an IP address. */
505
- interface DnsZone {
506
- /** Domain name including the TLD. Both root domains and subdomains are supported. */
507
- domainName?: string;
508
- /**
509
- * DNS records. You can only set up a single `record` object per DNS record
510
- * type. If you want to specify multiple values for the same record type, you
511
- * must save them in the `values` for the relevant type.
512
- *
513
- * Min: 2 DNS record - a DNS zone file has to have at least two required DNS records: NS and SOA records
514
- * Max: 5000 DNS records
515
- */
516
- records?: DnsRecord[];
517
- /**
518
- * ID of the Dns Zone. Identical to the domain name including TLD.
519
- * @readonly
520
- */
521
- _id?: string;
522
- /**
523
- * Whether [DNS Security Extensions (DNSSEC)](https://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions) are enabled.
524
- *
525
- * Default: `false`
526
- */
527
- dnssecEnabled?: boolean;
528
- }
529
- interface DnsRecord {
530
- /**
531
- * [DNS record type](https://en.wikipedia.org/wiki/List_of_DNS_record_types).
532
- *
533
- * + `UNKNOWN`: Default value. Used in case the record type isn't known. You can't set a record type to `UNKNOWN`.
534
- * + `A`: Address record. Most fundamental type of DNS record that indicates the IP address of a given domain.
535
- * + `AAAA`: Address record in [IPv6 format](https://en.wikipedia.org/wiki/IPv6).
536
- * + `NS`: Name server record. Describes which server contains the actual DNS record.
537
- * + `SOA`: [Start of authority record](https://en.wikipedia.org/wiki/SOA_record). Holds adminstrative information about the zone.
538
- * + `CNAME`: [CNAME record](https://en.wikipedia.org/wiki/CNAME_record). Maps an alias name to the canonical domain name.
539
- * + `MX`: MX record. Directs emails to mail servers.
540
- * + `TXT`: [TXT record](https://en.wikipedia.org/wiki/TXT_record). Used by domain admins to add human readable descriptions.
541
- * + `SPF`: SPF record. Used for email authentication.
542
- * + `SRV`: [Service record](https://en.wikipedia.org/wiki/SRV_record). Defines the server location.
543
- * + `PTR`: Pointer record. Specifies which host is supported for a given IP address.
544
- * + `NAPTR`: [Name Authority Pointer record](https://en.wikipedia.org/wiki/NAPTR_record). Used by Internet telephony applications.
545
- */
546
- type?: RecordType;
547
- /**
548
- * Host name. Can be a subdomain. For example, `domain.com` or
549
- * `mail.domain.com`. Equal to the domain name, except for `CNAME` records.
550
- */
551
- hostName?: string;
552
- /** [Time to live](https://en.wikipedia.org/wiki/Time_to_live) in seconds. */
553
- ttl?: number;
554
- /**
555
- * DNS record values. Wix limits DNS records to 50 values per type. External
556
- * providers may support a different maximum number of DNS records for a
557
- * specific type, Wix doesn't validate that you don't exceed these external
558
- * limits.
559
- *
560
- * Max: 50 records
561
- */
562
- values?: string[];
563
- }
564
- declare enum RecordType {
565
- UNKNOWN = "UNKNOWN",
566
- A = "A",
567
- AAAA = "AAAA",
568
- NS = "NS",
569
- SOA = "SOA",
570
- CNAME = "CNAME",
571
- MX = "MX",
572
- TXT = "TXT",
573
- SPF = "SPF",
574
- SRV = "SRV",
575
- PTR = "PTR",
576
- NAPTR = "NAPTR"
577
- }
578
- interface UpdateDnsZoneResponse {
579
- /** Updated DNS zone. */
580
- dnsZone?: DnsZone;
581
- }
582
- interface PreviewDnsZoneResponse {
583
- /**
584
- * DNS zone preview.
585
- *
586
- * Includes calculated `A`, `CNAME`, `NS` and `SOA` records.
587
- */
588
- dnsZone?: DnsZone;
589
- }
590
- interface UpdateDnsZoneResponseNonNullableFields {
591
- dnsZone?: {
592
- domainName: string;
593
- records: {
594
- type: RecordType;
595
- hostName: string;
596
- ttl: number;
597
- values: string[];
598
- }[];
599
- _id: string;
600
- dnssecEnabled: boolean;
601
- };
602
- }
603
- interface PreviewDnsZoneResponseNonNullableFields {
604
- dnsZone?: {
605
- domainName: string;
606
- records: {
607
- type: RecordType;
608
- hostName: string;
609
- ttl: number;
610
- values: string[];
611
- }[];
612
- _id: string;
613
- dnssecEnabled: boolean;
614
- };
615
- }
616
- interface UpdateDnsZoneOptions {
617
- /**
618
- * DNS records to add to the DNS zone.
619
- *
620
- * Max: 10 additions
621
- */
622
- additions?: DnsRecord[];
623
- /**
624
- * DNS records to remove from the DNS zone.
625
- *
626
- * Max: 10 deletions
627
- */
628
- deletions?: DnsRecord[];
629
- /** Whether you want to enable or disable [DNS Security Extensions (DNSSEC)](https://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions). */
630
- dnssecEnabled?: boolean | null;
105
+ type RESTFunctionDescriptor$3<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$3) => T;
106
+ interface HttpClient$3 {
107
+ request<TResponse, TData = any>(req: RequestOptionsFactory$3<TResponse, TData>): Promise<HttpResponse$3<TResponse>>;
108
+ fetchWithAuth: typeof fetch;
109
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
110
+ }
111
+ type RequestOptionsFactory$3<TResponse = any, TData = any> = (context: any) => RequestOptions$3<TResponse, TData>;
112
+ type HttpResponse$3<T = any> = {
113
+ data: T;
114
+ status: number;
115
+ statusText: string;
116
+ headers: any;
117
+ request?: any;
118
+ };
119
+ type RequestOptions$3<_TResponse = any, Data = any> = {
120
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
121
+ url: string;
122
+ data?: Data;
123
+ params?: URLSearchParams;
124
+ } & APIMetadata$3;
125
+ type APIMetadata$3 = {
126
+ methodFqn?: string;
127
+ entityFqdn?: string;
128
+ packageName?: string;
129
+ };
130
+ type BuildRESTFunction$3<T extends RESTFunctionDescriptor$3> = T extends RESTFunctionDescriptor$3<infer U> ? U : never;
131
+
132
+ declare global {
133
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
134
+ interface SymbolConstructor {
135
+ readonly observable: symbol;
136
+ }
631
137
  }
632
138
 
633
- declare function createDnsZone$1(httpClient: HttpClient): (dnsZone: DnsZone) => Promise<DnsZone & {
634
- domainName: string;
635
- records: {
636
- type: RecordType;
637
- hostName: string;
638
- ttl: number;
639
- values: string[];
640
- }[];
641
- _id: string;
642
- dnssecEnabled: boolean;
643
- }>;
644
- declare function getDnsZone$1(httpClient: HttpClient): (domainName: string) => Promise<DnsZone & {
645
- domainName: string;
646
- records: {
647
- type: RecordType;
648
- hostName: string;
649
- ttl: number;
650
- values: string[];
651
- }[];
652
- _id: string;
653
- dnssecEnabled: boolean;
654
- }>;
655
- declare function updateDnsZone$1(httpClient: HttpClient): (domainName: string, options?: UpdateDnsZoneOptions) => Promise<UpdateDnsZoneResponse & UpdateDnsZoneResponseNonNullableFields>;
656
- declare function deleteDnsZone$1(httpClient: HttpClient): (domainName: string) => Promise<void>;
657
- declare function previewDnsZone$1(httpClient: HttpClient): (domainName: string) => Promise<PreviewDnsZoneResponse & PreviewDnsZoneResponseNonNullableFields>;
139
+ declare function createRESTModule$3<T extends RESTFunctionDescriptor$3>(descriptor: T, elevated?: boolean): BuildRESTFunction$3<T> & T;
658
140
 
659
- declare const createDnsZone: BuildRESTFunction<typeof createDnsZone$1>;
660
- declare const getDnsZone: BuildRESTFunction<typeof getDnsZone$1>;
661
- declare const updateDnsZone: BuildRESTFunction<typeof updateDnsZone$1>;
662
- declare const deleteDnsZone: BuildRESTFunction<typeof deleteDnsZone$1>;
663
- declare const previewDnsZone: BuildRESTFunction<typeof previewDnsZone$1>;
141
+ declare const createDnsZone: ReturnType<typeof createRESTModule$3<typeof publicCreateDnsZone>>;
142
+ declare const getDnsZone: ReturnType<typeof createRESTModule$3<typeof publicGetDnsZone>>;
143
+ declare const updateDnsZone: ReturnType<typeof createRESTModule$3<typeof publicUpdateDnsZone>>;
144
+ declare const deleteDnsZone: ReturnType<typeof createRESTModule$3<typeof publicDeleteDnsZone>>;
145
+ declare const previewDnsZone: ReturnType<typeof createRESTModule$3<typeof publicPreviewDnsZone>>;
664
146
 
665
147
  declare const context$3_createDnsZone: typeof createDnsZone;
666
148
  declare const context$3_deleteDnsZone: typeof deleteDnsZone;
@@ -671,698 +153,46 @@ declare namespace context$3 {
671
153
  export { context$3_createDnsZone as createDnsZone, context$3_deleteDnsZone as deleteDnsZone, context$3_getDnsZone as getDnsZone, context$3_previewDnsZone as previewDnsZone, context$3_updateDnsZone as updateDnsZone };
672
154
  }
673
155
 
674
- /**
675
- * A registered domain is a domain that Wix has registered on behalf of a customer
676
- * with an external registar.
677
- */
678
- interface RegisteredDomain extends RegisteredDomainStatusInfoOneOf {
679
- /**
680
- * Information about a domain that hasn't been successfully registered
681
- * yet. Includes the timestamp of the latest registration attempt.
682
- * @readonly
683
- */
684
- pendingRegistrationInfo?: PendingRegistrationInfo;
685
- /**
686
- * Information about a domain that couldn't be registered. Includes
687
- * failure code and message.
688
- * @readonly
689
- */
690
- failedRegistrationInfo?: FailedRegistrationInfo;
691
- /**
692
- * Domain ID. Identical to `domain`.
693
- * @readonly
694
- */
695
- _id?: string;
696
- /**
697
- * Name of the domain including TLD.
698
- * Subdomains aren't supported. You can only register a root domain.
699
- * Domain name and TLD must be separated by a dot. For example,
700
- * `my-new-domain.com`. Only alphanumeric characters, hyphens, and dots are
701
- * supported.
702
- *
703
- * Min: 3 characters
704
- * Max: 63 characters
705
- */
706
- domain?: string;
707
- /**
708
- * ID of the product instance from the
709
- * [Resellers API](https://dev.wix.com/docs/rest/api-reference/account-level-apis/resellers/packages-and-product-instances/packages-object)
710
- * that belongs to the `registeredDomain` object.
711
- * Your account must own a product that supports the chosen TLD, regardless of
712
- * whether you want to assign the domain to a site or keep it floating. If
713
- * you want to assign the domain to a site, the relevant site must also
714
- * own a Premium plan. Contact the [Wix B2B team](mailto:bizdev@wix.com)
715
- * for more information about how to become a reseller and a list of available
716
- * product IDs.
717
- */
718
- productInstanceId?: string;
719
- /**
720
- * Date and time the `registeredDomain` object was created in
721
- * `YYYY-MM-DDThh:mm:ss.sssZ` format.
722
- * @readonly
723
- */
724
- _createdDate?: Date;
725
- /**
726
- * Date and time the `registeredDomain` object was last updated in
727
- * `YYYY-MM-DDThh:mm:ss.sssZ` format.
728
- * @readonly
729
- */
730
- _updatedDate?: Date;
731
- /**
732
- * Revision number, which increments by 1 each time the registered domain
733
- * is updated. To prevent conflicting changes, the current revision must be
734
- * passed when updating the registered domain.
735
- *
736
- * Ignored when creating a registered domain.
737
- */
738
- revision?: string | null;
739
- /**
740
- * Information about the Wix site the domain is connected to and whether the
741
- * domain is assigned as the primary domain or a redirect.
742
- */
743
- siteInfo?: SiteInfo;
744
- /**
745
- * Contact details for the registrant, admin, and tech support of the registered domain.
746
- * You can read more about which
747
- * [Contact Field Validations](https://https://dev.wix.com/api/rest/account-level-apis/registered-domains/contact-field-validations)
748
- * are implemented.
749
- */
750
- contacts?: Contacts;
751
- /**
752
- * Status of the registered domain.
753
- *
754
- * + `"UNKNOWN_STATUS"`: There's no information about the status of the registered domain.
755
- * + `"PENDING_REGISTRATION"`: Wix has started the domain registration process, but the domain hasn't been successfully registered yet.
756
- * + `"ACTIVE"`: The domain has been registered successfully and is active.
757
- * + `"FAILED_REGISTRATION"`: Wix has tried to register the domain, but has stopped the process due to too many failed attempts. Contact the [Wix B2B team](mailto:bizdev@wix.com) for more information.
758
- * + `"CANCELED"`: The domain has been canceled and isn't active any longer.
759
- * @readonly
760
- */
761
- status?: Status;
762
- /**
763
- * ICANN confirmation status.
764
- *
765
- * + `"UNKNOWN_ICANN_CONFIRMATION_STATUS"`: There's no information about the status of the ICANN confirmation process.
766
- * + `"PENDING"`: Wix has started the ICANN confirmation process, but not all contacts have confirmed the domain yet.
767
- * + `"CONFIRMED_BY_ALL"`: The domain has been successfully confirmed by all contacts.
768
- * + `"EXPIRED"`: The domain hasn't been confirmed by all contacts before the ICANN confirmation process expired. The domain isn't active and a new confirmation process must be started. Contact the [Wix B2B team](mailto:bizdev@wix.com) for more information.
769
- * @readonly
770
- */
771
- icannConfirmationStatus?: ICANNConfirmationStatus;
772
- /**
773
- * Details about the ICANN confirmation status.
774
- * @readonly
775
- */
776
- icannConfirmationStatusInfo?: ICANNConfirmationStatusInfo;
777
- /**
778
- * DNS propagation status.
779
- *
780
- * + `"UNKNOWN_DNS_PROPAGATION_STATUS"`: There's no information about the domain's DNS propagation status.
781
- * + `"IN_PROGRESS"`: The domain's DNS propagation process has started but hasn't successfully completed yet.
782
- * + `"COMPLETED"`: The domain's DNS propagation process has successfully finished.
783
- * + `"FAILED"`: The domain's DNS propagation process has failed.
784
- * @readonly
785
- */
786
- dnsPropagationStatus?: DnsPropagationStatus;
787
- /**
788
- * Expiration date of the registered domain in `YYYY-MM-DDThh:mm:ss.sssZ`
789
- * format.
790
- * @readonly
791
- */
792
- expirationDate?: Date;
793
- }
794
- /** @oneof */
795
- interface RegisteredDomainStatusInfoOneOf {
796
- /**
797
- * Information about a domain that hasn't been successfully registered
798
- * yet. Includes the timestamp of the latest registration attempt.
799
- * @readonly
800
- */
801
- pendingRegistrationInfo?: PendingRegistrationInfo;
802
- /**
803
- * Information about a domain that couldn't be registered. Includes
804
- * failure code and message.
805
- * @readonly
806
- */
807
- failedRegistrationInfo?: FailedRegistrationInfo;
808
- }
809
- interface SiteInfo extends SiteInfoAssignmentInfoOneOf {
810
- /**
811
- * Extra details if `{"assignmentType": `"REDIRECT"}`.
812
- * @readonly
813
- */
814
- redirectInfo?: RedirectAssignmentInfo;
815
- /**
816
- * ID of the site to which the domain is assigned.
817
- * @readonly
818
- */
819
- _id?: string | null;
820
- /**
821
- * Whether the domain is assigned as the primary domain or a redirect.
822
- * Read more about [primary and redirected domains](https://support.wix.com/en/article/switching-your-primary-and-redirected-domains).
823
- * __Note:__ When you connect a domain or subdomain, you can't pass `"UNKNOWN_ASSIGNMENT_TYPE"`
824
- * in the request of the Create Registered Domain call.
825
- *
826
- * + `"UNKNOWN_ASSIGNMENT_TYPE"`: There's no information about the assignment type.
827
- * + `"PRIMARY"`: The domain is assigned as the primary domain to the Wix site.
828
- * + `"REDIRECT"`: The domain is assigned as a redirect to the Wix site.
829
- */
830
- assignmentType?: AssignmentType;
831
- }
832
- /** @oneof */
833
- interface SiteInfoAssignmentInfoOneOf {
834
- /**
835
- * Extra details if `{"assignmentType": `"REDIRECT"}`.
836
- * @readonly
837
- */
838
- redirectInfo?: RedirectAssignmentInfo;
839
- }
840
- declare enum AssignmentType {
841
- UNKNOWN_ASSIGNMENT_TYPE = "UNKNOWN_ASSIGNMENT_TYPE",
842
- PRIMARY = "PRIMARY",
843
- REDIRECT = "REDIRECT"
844
- }
845
- interface RedirectAssignmentInfo {
846
- /**
847
- * Primary domain the redirect points to.
848
- * @readonly
849
- */
850
- primaryDomain?: string;
851
- }
852
- interface Contacts {
853
- /** Contact information for the domain registrant. */
854
- registrant?: ContactData;
855
- /** Contact information for the domain admin. */
856
- admin?: ContactData;
857
- /** Contact information for the tech support of the domain. */
858
- tech?: ContactData;
859
- }
860
- interface ContactData {
861
- /**
862
- * First name. Only
863
- * [alphanumerical characters](https://en.wikipedia.org/wiki/Alphanumericals)
864
- * are supported.
865
- *
866
- * Min: 2 characters
867
- * Max: 64 characters
868
- */
869
- firstName?: string;
870
- /**
871
- * Last name. Only
872
- * [alphanumerical characters](https://en.wikipedia.org/wiki/Alphanumericals)
873
- * are supported.
874
- *
875
- * Min: 2 characters
876
- * Max: 64 characters
877
- */
878
- lastName?: string;
879
- /**
880
- * Email address. Only
881
- * [alphanumerical characters](https://en.wikipedia.org/wiki/Alphanumericals)
882
- * and a single `@` are supported. Wix doesn't validate that the email address
883
- * exists.
884
- *
885
- * Min: 3 characters
886
- * Max: 64 characters before the `@` and 63 after
887
- */
888
- email?: string;
889
- /**
890
- * Address details, including street name and house number. Only
891
- * [alphanumerical characters](https://en.wikipedia.org/wiki/Alphanumericals)
892
- * are supported.
893
- *
894
- * Min: 2 characters
895
- * Max: 64 characters
896
- */
897
- address?: string;
898
- /**
899
- * City. Only
900
- * [alphanumerical characters](https://en.wikipedia.org/wiki/Alphanumericals)
901
- * are supported.
902
- *
903
- * Min: 2 characters
904
- * Max: 64 characters
905
- */
906
- city?: string;
907
- /**
908
- * Subdivision code in
909
- * [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
910
- * format. Only
911
- * [alphanumerical characters](https://en.wikipedia.org/wiki/Alphanumericals)
912
- * are supported.
913
- * __Required__ for these countries:
914
- * `”AE"`, `"AR"`, `"AT"`, `"AU"`, `"BE"`, `"BR"`, `"CA"`, `"CH"`, `"CL"`,
915
- * `"CO"`, `"CR"`, `"CZ"`, `"DE"`, `"DK"`, `"ES"`, `"FI"`, `"FR"`, `"GR"`,
916
- * `"IE"`, `"IN"`, `"IT"`, `"JP"`, `"KR"`, `"MX"`, `"MY"`, `"NL"`, `"NO"`,
917
- * `"NZ"`, `"PE"`, `"PL"`, `"PT"`, `"RU"`, `"SE"`, `"SG"`, `"TH"`, `"TR"`,
918
- * `"TW"`, `"UA"`, `"US"`, `”ZA”`.
919
- *
920
- * Min: 2 characters
921
- * Max: 2 characters
922
- */
923
- subdivisionCode?: string | null;
924
- /**
925
- * Postal code. Only
926
- * [alphanumerical characters](https://en.wikipedia.org/wiki/Alphanumericals)
927
- * are supported.
928
- *
929
- * Min: 2 characters
930
- * Max: 16 characters
931
- */
932
- postalCode?: string | null;
933
- /**
934
- * Country code in
935
- * [ISO-3166 alpha-1](https://en.wikipedia.org/wiki/ISO_3166-2#Subdivisions_included_in_ISO_3166-1)
936
- * format. Only
937
- * [alphanumerical characters](https://en.wikipedia.org/wiki/Alphanumericals)
938
- * are supported. Wix doesn't validate that the postal code is valid for the
939
- * given country.
940
- *
941
- * Min: 2 characters
942
- * Max: 2 characters
943
- */
944
- countryCode?: string;
945
- /**
946
- * Phone number. Only
947
- * [alphanumerical characters](https://en.wikipedia.org/wiki/Alphanumericals)
948
- * are supported. For example, `+15551234567`. Wix doesn't validate that the
949
- * phone number belongs to the specified country.
950
- *
951
- * Min: 2 characters
952
- * Max: 20 characters
953
- */
954
- phone?: string;
955
- /**
956
- * Company name. Only
957
- * [alphanumerical characters](https://en.wikipedia.org/wiki/Alphanumericals)
958
- * are supported.
959
- *
960
- * Max: 2 characters
961
- * Max: 64 characters
962
- */
963
- company?: string | null;
964
- }
965
- declare enum Status {
966
- UNKNOWN_STATUS = "UNKNOWN_STATUS",
967
- PENDING_REGISTRATION = "PENDING_REGISTRATION",
968
- ACTIVE = "ACTIVE",
969
- FAILED_REGISTRATION = "FAILED_REGISTRATION",
970
- CANCELED = "CANCELED"
971
- }
972
- interface PendingRegistrationInfo {
973
- /**
974
- * Information about the latest attempt to register
975
- * the domain. Wix tries to register the domain several times if the
976
- * first attempt is unsuccessful. You can contact the
977
- * [Wix B2B team](mailto:bizdev@wix.com)
978
- * for more information about the number of attempts and their timing.
979
- * @readonly
980
- */
981
- latestAttempt?: LatestAttempt;
982
- }
983
- interface LatestAttempt {
984
- /**
985
- * Number of the latest attempt to register the domain.
986
- * @readonly
987
- */
988
- number?: number;
989
- /**
990
- * Date and time of the latest domain registration attempt in
991
- * `YYYY-MM-DDThh:mm:ss.sssZ` format.
992
- * @readonly
993
- */
994
- timestamp?: Date;
995
- }
996
- interface FailedRegistrationInfo {
997
- /**
998
- * Failure code.
999
- *
1000
- * + `"UNKNOWN_FAILURE_CODE"`: There's no information about the failure code.
1001
- * + `"OTHER"`: There was a failure, but none of the listed failure codes applies.
1002
- * @readonly
1003
- */
1004
- code?: FailureCode;
1005
- /**
1006
- * Failure message.
1007
- * @readonly
1008
- */
1009
- message?: string;
1010
- }
1011
- declare enum FailureCode {
1012
- UNKNOWN_FAILURE_CODE = "UNKNOWN_FAILURE_CODE",
1013
- OTHER = "OTHER"
1014
- }
1015
- /**
1016
- * he confirmation status types, a record:
1017
- * starts at pending
1018
- * ends either at confirmed_by_all or expired
1019
- */
1020
- declare enum ICANNConfirmationStatus {
1021
- UNKNOWN_ICANN_CONFIRMATION_STATUS = "UNKNOWN_ICANN_CONFIRMATION_STATUS",
1022
- PENDING = "PENDING",
1023
- CONFIRMED_BY_ALL = "CONFIRMED_BY_ALL",
1024
- EXPIRED = "EXPIRED"
1025
- }
1026
- interface ICANNConfirmationStatusInfo extends ICANNConfirmationStatusInfoStatusOneOf {
1027
- /** Details about domains with `"PENDING"` ICANN confirmation status. */
1028
- pending?: Pending;
1029
- /** Details about domains with `"EXPIRED"` ICANN confirmation status. */
1030
- expired?: Expired;
1031
- }
1032
- /** @oneof */
1033
- interface ICANNConfirmationStatusInfoStatusOneOf {
1034
- /** Details about domains with `"PENDING"` ICANN confirmation status. */
1035
- pending?: Pending;
1036
- /** Details about domains with `"EXPIRED"` ICANN confirmation status. */
1037
- expired?: Expired;
1038
- }
1039
- interface Pending {
1040
- /**
1041
- * Expiration date of the ICANN confirmation process in
1042
- * `YYYY-MM-DDThh:mm:ss.sssZ` format. All contacts must confirm the domain
1043
- * before this date or the domain won't be active.
1044
- */
1045
- expirationDate?: Date;
1046
- /**
1047
- * Email addresses of the contacts who haven't confirmed the domain with ICANN
1048
- * yet.
1049
- */
1050
- notConfirmedBy?: string[];
1051
- }
1052
- interface Expired {
1053
- /**
1054
- * Email addresses of the contacts who haven't confirmed the domain with ICANN
1055
- * in time.
1056
- */
1057
- notConfirmedBy?: string[];
1058
- }
1059
- declare enum DnsPropagationStatus {
1060
- UNKNOWN_DNS_PROPAGATION_STATUS = "UNKNOWN_DNS_PROPAGATION_STATUS",
1061
- COMPLETED = "COMPLETED",
1062
- FAILED = "FAILED",
1063
- IN_PROGRESS = "IN_PROGRESS"
1064
- }
1065
- interface CursorPaging {
1066
- /**
1067
- * Number of domains to load.
1068
- *
1069
- * Min: `0`
1070
- * Max: `100`
1071
- */
1072
- limit?: number | null;
1073
- /**
1074
- * Pointer to the next or previous page in the list of results.
1075
- *
1076
- * You can get the relevant cursor token
1077
- * from the `pagingMetadata` object in the previous call's response.
1078
- * Not relevant for the first request.
1079
- */
1080
- cursor?: string | null;
1081
- }
1082
- interface ListRegisteredDomainsResponse {
1083
- /** Metadata about the returned list of registered domains. */
1084
- pagingMetadata?: CursorPagingMetadata;
1085
- /** Retrieved registered domains. */
1086
- registeredDomains?: RegisteredDomain[];
1087
- }
1088
- interface CursorPagingMetadata {
1089
- /** Number of domains returned in the response. */
1090
- count?: number | null;
1091
- /** Offset that was requested. */
1092
- cursors?: Cursors;
1093
- /**
1094
- * Indicates if there are more results after the current page.
1095
- * If `true`, another page of results can be retrieved.
1096
- * If `false`, this is the last page.
1097
- */
1098
- hasNext?: boolean | null;
1099
- }
1100
- interface Cursors {
1101
- /** Cursor pointing to next page in the list of results. */
1102
- next?: string | null;
1103
- /** Cursor pointing to previous page in the list of results. */
1104
- prev?: string | null;
1105
- }
1106
- interface RedeemRegisteredDomainResponse {
1107
- /** Registered domain to redeem. */
1108
- registeredDomain?: RegisteredDomain;
1109
- }
1110
- interface ListRegisteredDomainsResponseNonNullableFields {
1111
- registeredDomains: {
1112
- pendingRegistrationInfo?: {
1113
- latestAttempt?: {
1114
- number: number;
1115
- };
1116
- };
1117
- failedRegistrationInfo?: {
1118
- code: FailureCode;
1119
- message: string;
1120
- };
1121
- _id: string;
1122
- domain: string;
1123
- productInstanceId: string;
1124
- siteInfo?: {
1125
- redirectInfo?: {
1126
- primaryDomain: string;
1127
- };
1128
- assignmentType: AssignmentType;
1129
- };
1130
- contacts?: {
1131
- registrant?: {
1132
- firstName: string;
1133
- lastName: string;
1134
- email: string;
1135
- address: string;
1136
- city: string;
1137
- countryCode: string;
1138
- phone: string;
1139
- };
1140
- admin?: {
1141
- firstName: string;
1142
- lastName: string;
1143
- email: string;
1144
- address: string;
1145
- city: string;
1146
- countryCode: string;
1147
- phone: string;
1148
- };
1149
- tech?: {
1150
- firstName: string;
1151
- lastName: string;
1152
- email: string;
1153
- address: string;
1154
- city: string;
1155
- countryCode: string;
1156
- phone: string;
1157
- };
1158
- };
1159
- status: Status;
1160
- icannConfirmationStatus: ICANNConfirmationStatus;
1161
- icannConfirmationStatusInfo?: {
1162
- pending?: {
1163
- notConfirmedBy: string[];
1164
- };
1165
- expired?: {
1166
- notConfirmedBy: string[];
1167
- };
1168
- };
1169
- dnsPropagationStatus: DnsPropagationStatus;
1170
- }[];
1171
- }
1172
- interface RedeemRegisteredDomainResponseNonNullableFields {
1173
- registeredDomain?: {
1174
- pendingRegistrationInfo?: {
1175
- latestAttempt?: {
1176
- number: number;
1177
- };
1178
- };
1179
- failedRegistrationInfo?: {
1180
- code: FailureCode;
1181
- message: string;
1182
- };
1183
- _id: string;
1184
- domain: string;
1185
- productInstanceId: string;
1186
- siteInfo?: {
1187
- redirectInfo?: {
1188
- primaryDomain: string;
1189
- };
1190
- assignmentType: AssignmentType;
1191
- };
1192
- contacts?: {
1193
- registrant?: {
1194
- firstName: string;
1195
- lastName: string;
1196
- email: string;
1197
- address: string;
1198
- city: string;
1199
- countryCode: string;
1200
- phone: string;
1201
- };
1202
- admin?: {
1203
- firstName: string;
1204
- lastName: string;
1205
- email: string;
1206
- address: string;
1207
- city: string;
1208
- countryCode: string;
1209
- phone: string;
1210
- };
1211
- tech?: {
1212
- firstName: string;
1213
- lastName: string;
1214
- email: string;
1215
- address: string;
1216
- city: string;
1217
- countryCode: string;
1218
- phone: string;
1219
- };
1220
- };
1221
- status: Status;
1222
- icannConfirmationStatus: ICANNConfirmationStatus;
1223
- icannConfirmationStatusInfo?: {
1224
- pending?: {
1225
- notConfirmedBy: string[];
1226
- };
1227
- expired?: {
1228
- notConfirmedBy: string[];
1229
- };
1230
- };
1231
- dnsPropagationStatus: DnsPropagationStatus;
1232
- };
1233
- }
1234
- interface ListRegisteredDomainsOptions {
1235
- /** Cursor paging options. */
1236
- paging?: CursorPaging;
156
+ type RESTFunctionDescriptor$2<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$2) => T;
157
+ interface HttpClient$2 {
158
+ request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
159
+ fetchWithAuth: typeof fetch;
160
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
161
+ }
162
+ type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
163
+ type HttpResponse$2<T = any> = {
164
+ data: T;
165
+ status: number;
166
+ statusText: string;
167
+ headers: any;
168
+ request?: any;
169
+ };
170
+ type RequestOptions$2<_TResponse = any, Data = any> = {
171
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
172
+ url: string;
173
+ data?: Data;
174
+ params?: URLSearchParams;
175
+ } & APIMetadata$2;
176
+ type APIMetadata$2 = {
177
+ methodFqn?: string;
178
+ entityFqdn?: string;
179
+ packageName?: string;
180
+ };
181
+ type BuildRESTFunction$2<T extends RESTFunctionDescriptor$2> = T extends RESTFunctionDescriptor$2<infer U> ? U : never;
182
+
183
+ declare global {
184
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
185
+ interface SymbolConstructor {
186
+ readonly observable: symbol;
187
+ }
1237
188
  }
1238
189
 
1239
- declare function createRegisteredDomain$1(httpClient: HttpClient): (registeredDomain: RegisteredDomain) => Promise<RegisteredDomain & {
1240
- pendingRegistrationInfo?: {
1241
- latestAttempt?: {
1242
- number: number;
1243
- } | undefined;
1244
- } | undefined;
1245
- failedRegistrationInfo?: {
1246
- code: FailureCode;
1247
- message: string;
1248
- } | undefined;
1249
- _id: string;
1250
- domain: string;
1251
- productInstanceId: string;
1252
- siteInfo?: {
1253
- redirectInfo?: {
1254
- primaryDomain: string;
1255
- } | undefined;
1256
- assignmentType: AssignmentType;
1257
- } | undefined;
1258
- contacts?: {
1259
- registrant?: {
1260
- firstName: string;
1261
- lastName: string;
1262
- email: string;
1263
- address: string;
1264
- city: string;
1265
- countryCode: string;
1266
- phone: string;
1267
- } | undefined;
1268
- admin?: {
1269
- firstName: string;
1270
- lastName: string;
1271
- email: string;
1272
- address: string;
1273
- city: string;
1274
- countryCode: string;
1275
- phone: string;
1276
- } | undefined;
1277
- tech?: {
1278
- firstName: string;
1279
- lastName: string;
1280
- email: string;
1281
- address: string;
1282
- city: string;
1283
- countryCode: string;
1284
- phone: string;
1285
- } | undefined;
1286
- } | undefined;
1287
- status: Status;
1288
- icannConfirmationStatus: ICANNConfirmationStatus;
1289
- icannConfirmationStatusInfo?: {
1290
- pending?: {
1291
- notConfirmedBy: string[];
1292
- } | undefined;
1293
- expired?: {
1294
- notConfirmedBy: string[];
1295
- } | undefined;
1296
- } | undefined;
1297
- dnsPropagationStatus: DnsPropagationStatus;
1298
- }>;
1299
- declare function getRegisteredDomain$1(httpClient: HttpClient): (registeredDomainId: string) => Promise<RegisteredDomain & {
1300
- pendingRegistrationInfo?: {
1301
- latestAttempt?: {
1302
- number: number;
1303
- } | undefined;
1304
- } | undefined;
1305
- failedRegistrationInfo?: {
1306
- code: FailureCode;
1307
- message: string;
1308
- } | undefined;
1309
- _id: string;
1310
- domain: string;
1311
- productInstanceId: string;
1312
- siteInfo?: {
1313
- redirectInfo?: {
1314
- primaryDomain: string;
1315
- } | undefined;
1316
- assignmentType: AssignmentType;
1317
- } | undefined;
1318
- contacts?: {
1319
- registrant?: {
1320
- firstName: string;
1321
- lastName: string;
1322
- email: string;
1323
- address: string;
1324
- city: string;
1325
- countryCode: string;
1326
- phone: string;
1327
- } | undefined;
1328
- admin?: {
1329
- firstName: string;
1330
- lastName: string;
1331
- email: string;
1332
- address: string;
1333
- city: string;
1334
- countryCode: string;
1335
- phone: string;
1336
- } | undefined;
1337
- tech?: {
1338
- firstName: string;
1339
- lastName: string;
1340
- email: string;
1341
- address: string;
1342
- city: string;
1343
- countryCode: string;
1344
- phone: string;
1345
- } | undefined;
1346
- } | undefined;
1347
- status: Status;
1348
- icannConfirmationStatus: ICANNConfirmationStatus;
1349
- icannConfirmationStatusInfo?: {
1350
- pending?: {
1351
- notConfirmedBy: string[];
1352
- } | undefined;
1353
- expired?: {
1354
- notConfirmedBy: string[];
1355
- } | undefined;
1356
- } | undefined;
1357
- dnsPropagationStatus: DnsPropagationStatus;
1358
- }>;
1359
- declare function listRegisteredDomains$1(httpClient: HttpClient): (options?: ListRegisteredDomainsOptions) => Promise<ListRegisteredDomainsResponse & ListRegisteredDomainsResponseNonNullableFields>;
1360
- declare function redeemRegisteredDomain$1(httpClient: HttpClient): (registeredDomainId: string) => Promise<RedeemRegisteredDomainResponse & RedeemRegisteredDomainResponseNonNullableFields>;
190
+ declare function createRESTModule$2<T extends RESTFunctionDescriptor$2>(descriptor: T, elevated?: boolean): BuildRESTFunction$2<T> & T;
1361
191
 
1362
- declare const createRegisteredDomain: BuildRESTFunction<typeof createRegisteredDomain$1>;
1363
- declare const getRegisteredDomain: BuildRESTFunction<typeof getRegisteredDomain$1>;
1364
- declare const listRegisteredDomains: BuildRESTFunction<typeof listRegisteredDomains$1>;
1365
- declare const redeemRegisteredDomain: BuildRESTFunction<typeof redeemRegisteredDomain$1>;
192
+ declare const createRegisteredDomain: ReturnType<typeof createRESTModule$2<typeof publicCreateRegisteredDomain>>;
193
+ declare const getRegisteredDomain: ReturnType<typeof createRESTModule$2<typeof publicGetRegisteredDomain>>;
194
+ declare const listRegisteredDomains: ReturnType<typeof createRESTModule$2<typeof publicListRegisteredDomains>>;
195
+ declare const redeemRegisteredDomain: ReturnType<typeof createRESTModule$2<typeof publicRedeemRegisteredDomain>>;
1366
196
 
1367
197
  declare const context$2_createRegisteredDomain: typeof createRegisteredDomain;
1368
198
  declare const context$2_getRegisteredDomain: typeof getRegisteredDomain;
@@ -1372,73 +202,86 @@ declare namespace context$2 {
1372
202
  export { context$2_createRegisteredDomain as createRegisteredDomain, context$2_getRegisteredDomain as getRegisteredDomain, context$2_listRegisteredDomains as listRegisteredDomains, context$2_redeemRegisteredDomain as redeemRegisteredDomain };
1373
203
  }
1374
204
 
1375
- interface DomainAvailability {
1376
- /** Domain name including TLD. For example, `my-new-domain.com`. */
1377
- domain?: string;
1378
- /**
1379
- * Whether the domain is available for purchase. You can purchase the
1380
- * domain in case the boolean is `true`. The domain is already taken
1381
- * when `false` is returned.
1382
- */
1383
- available?: boolean;
1384
- }
1385
- interface CheckDomainAvailabilityResponse {
1386
- /** Information about the domain's availability. */
1387
- availability?: DomainAvailability;
1388
- }
1389
- interface CheckDomainAvailabilityResponseNonNullableFields {
1390
- availability?: {
1391
- domain: string;
1392
- available: boolean;
1393
- };
205
+ type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
206
+ interface HttpClient$1 {
207
+ request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
208
+ fetchWithAuth: typeof fetch;
209
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
210
+ }
211
+ type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
212
+ type HttpResponse$1<T = any> = {
213
+ data: T;
214
+ status: number;
215
+ statusText: string;
216
+ headers: any;
217
+ request?: any;
218
+ };
219
+ type RequestOptions$1<_TResponse = any, Data = any> = {
220
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
221
+ url: string;
222
+ data?: Data;
223
+ params?: URLSearchParams;
224
+ } & APIMetadata$1;
225
+ type APIMetadata$1 = {
226
+ methodFqn?: string;
227
+ entityFqdn?: string;
228
+ packageName?: string;
229
+ };
230
+ type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
231
+
232
+ declare global {
233
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
234
+ interface SymbolConstructor {
235
+ readonly observable: symbol;
236
+ }
1394
237
  }
1395
238
 
1396
- declare function checkDomainAvailability$1(httpClient: HttpClient): (domain: string) => Promise<CheckDomainAvailabilityResponse & CheckDomainAvailabilityResponseNonNullableFields>;
239
+ declare function createRESTModule$1<T extends RESTFunctionDescriptor$1>(descriptor: T, elevated?: boolean): BuildRESTFunction$1<T> & T;
1397
240
 
1398
- declare const checkDomainAvailability: BuildRESTFunction<typeof checkDomainAvailability$1>;
241
+ declare const checkDomainAvailability: ReturnType<typeof createRESTModule$1<typeof publicCheckDomainAvailability>>;
1399
242
 
1400
243
  declare const context$1_checkDomainAvailability: typeof checkDomainAvailability;
1401
244
  declare namespace context$1 {
1402
245
  export { context$1_checkDomainAvailability as checkDomainAvailability };
1403
246
  }
1404
247
 
1405
- interface DomainSuggestion {
1406
- /** Suggested domain name including TLD. */
1407
- domain?: string;
1408
- }
1409
- interface SuggestDomainsResponse {
1410
- /** List of suggested available domains. */
1411
- suggestions?: DomainSuggestion[];
1412
- }
1413
- interface SuggestDomainsResponseNonNullableFields {
1414
- suggestions: {
1415
- domain: string;
1416
- }[];
248
+ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
249
+ interface HttpClient {
250
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
251
+ fetchWithAuth: typeof fetch;
252
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
1417
253
  }
1418
- interface SuggestDomainsOptions {
1419
- /**
1420
- * [Top-level domains](https://en.wikipedia.org/wiki/Top-level_domain). Must
1421
- * not include the dot. For example, `com`, not `.com`. Not all TLDs can be
1422
- * connected to Wix sites. Supported TLDS include `com`, `net`, and `org`.
1423
- * Contact the [Wix B2B sales team](mailto:bizdev@wix.com) for more
1424
- * information.
1425
- *
1426
- * Max: 10 TLDs
1427
- */
1428
- tlds?: string[];
1429
- /**
1430
- * Number of domain suggestions to return.
1431
- *
1432
- * Min: `1`
1433
- * Max: `20`
1434
- * Default: `10`
1435
- */
1436
- limit?: number | null;
254
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
255
+ type HttpResponse<T = any> = {
256
+ data: T;
257
+ status: number;
258
+ statusText: string;
259
+ headers: any;
260
+ request?: any;
261
+ };
262
+ type RequestOptions<_TResponse = any, Data = any> = {
263
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
264
+ url: string;
265
+ data?: Data;
266
+ params?: URLSearchParams;
267
+ } & APIMetadata;
268
+ type APIMetadata = {
269
+ methodFqn?: string;
270
+ entityFqdn?: string;
271
+ packageName?: string;
272
+ };
273
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
274
+
275
+ declare global {
276
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
277
+ interface SymbolConstructor {
278
+ readonly observable: symbol;
279
+ }
1437
280
  }
1438
281
 
1439
- declare function suggestDomains$1(httpClient: HttpClient): (query: string, options?: SuggestDomainsOptions) => Promise<SuggestDomainsResponse & SuggestDomainsResponseNonNullableFields>;
282
+ declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
1440
283
 
1441
- declare const suggestDomains: BuildRESTFunction<typeof suggestDomains$1>;
284
+ declare const suggestDomains: ReturnType<typeof createRESTModule<typeof publicSuggestDomains>>;
1442
285
 
1443
286
  declare const context_suggestDomains: typeof suggestDomains;
1444
287
  declare namespace context {