@wix/domains 1.0.38 → 1.0.39
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.
- package/package.json +7 -7
- package/type-bundles/context.bundle.d.ts +499 -2071
- package/type-bundles/index.bundle.d.ts +499 -2071
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
type HostModule
|
|
1
|
+
type HostModule<T, H extends Host> = {
|
|
2
2
|
__type: 'host';
|
|
3
3
|
create(host: H): T;
|
|
4
4
|
};
|
|
5
|
-
type HostModuleAPI
|
|
6
|
-
type Host
|
|
5
|
+
type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
|
|
6
|
+
type Host<Environment = unknown> = {
|
|
7
7
|
channel: {
|
|
8
8
|
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
9
9
|
disconnect: () => void;
|
|
@@ -12,6 +12,10 @@ type Host$4<Environment = unknown> = {
|
|
|
12
12
|
}>;
|
|
13
13
|
};
|
|
14
14
|
environment?: Environment;
|
|
15
|
+
/**
|
|
16
|
+
* Optional name of the environment, use for logging
|
|
17
|
+
*/
|
|
18
|
+
name?: string;
|
|
15
19
|
/**
|
|
16
20
|
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
|
17
21
|
*/
|
|
@@ -36,92 +40,92 @@ type Host$4<Environment = unknown> = {
|
|
|
36
40
|
};
|
|
37
41
|
};
|
|
38
42
|
|
|
39
|
-
type RESTFunctionDescriptor
|
|
40
|
-
interface HttpClient
|
|
41
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory
|
|
43
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
44
|
+
interface HttpClient {
|
|
45
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
42
46
|
fetchWithAuth: typeof fetch;
|
|
43
47
|
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
44
48
|
getActiveToken?: () => string | undefined;
|
|
45
49
|
}
|
|
46
|
-
type RequestOptionsFactory
|
|
47
|
-
type HttpResponse
|
|
50
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
51
|
+
type HttpResponse<T = any> = {
|
|
48
52
|
data: T;
|
|
49
53
|
status: number;
|
|
50
54
|
statusText: string;
|
|
51
55
|
headers: any;
|
|
52
56
|
request?: any;
|
|
53
57
|
};
|
|
54
|
-
type RequestOptions
|
|
58
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
55
59
|
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
56
60
|
url: string;
|
|
57
61
|
data?: Data;
|
|
58
62
|
params?: URLSearchParams;
|
|
59
|
-
} & APIMetadata
|
|
60
|
-
type APIMetadata
|
|
63
|
+
} & APIMetadata;
|
|
64
|
+
type APIMetadata = {
|
|
61
65
|
methodFqn?: string;
|
|
62
66
|
entityFqdn?: string;
|
|
63
67
|
packageName?: string;
|
|
64
68
|
};
|
|
65
|
-
type BuildRESTFunction
|
|
66
|
-
type EventDefinition
|
|
69
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
70
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
67
71
|
__type: 'event-definition';
|
|
68
72
|
type: Type;
|
|
69
73
|
isDomainEvent?: boolean;
|
|
70
74
|
transformations?: (envelope: unknown) => Payload;
|
|
71
75
|
__payload: Payload;
|
|
72
76
|
};
|
|
73
|
-
declare function EventDefinition
|
|
74
|
-
type EventHandler
|
|
75
|
-
type BuildEventDefinition
|
|
77
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
78
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
79
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
76
80
|
|
|
77
|
-
type ServicePluginMethodInput
|
|
81
|
+
type ServicePluginMethodInput = {
|
|
78
82
|
request: any;
|
|
79
83
|
metadata: any;
|
|
80
84
|
};
|
|
81
|
-
type ServicePluginContract
|
|
82
|
-
type ServicePluginMethodMetadata
|
|
85
|
+
type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
|
|
86
|
+
type ServicePluginMethodMetadata = {
|
|
83
87
|
name: string;
|
|
84
88
|
primaryHttpMappingPath: string;
|
|
85
89
|
transformations: {
|
|
86
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput
|
|
90
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput;
|
|
87
91
|
toREST: (...args: unknown[]) => unknown;
|
|
88
92
|
};
|
|
89
93
|
};
|
|
90
|
-
type ServicePluginDefinition
|
|
94
|
+
type ServicePluginDefinition<Contract extends ServicePluginContract> = {
|
|
91
95
|
__type: 'service-plugin-definition';
|
|
92
96
|
componentType: string;
|
|
93
|
-
methods: ServicePluginMethodMetadata
|
|
97
|
+
methods: ServicePluginMethodMetadata[];
|
|
94
98
|
__contract: Contract;
|
|
95
99
|
};
|
|
96
|
-
declare function ServicePluginDefinition
|
|
97
|
-
type BuildServicePluginDefinition
|
|
98
|
-
declare const SERVICE_PLUGIN_ERROR_TYPE
|
|
100
|
+
declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
|
|
101
|
+
type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
|
|
102
|
+
declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
|
|
99
103
|
|
|
100
|
-
type RequestContext
|
|
104
|
+
type RequestContext = {
|
|
101
105
|
isSSR: boolean;
|
|
102
106
|
host: string;
|
|
103
107
|
protocol?: string;
|
|
104
108
|
};
|
|
105
|
-
type ResponseTransformer
|
|
109
|
+
type ResponseTransformer = (data: any, headers?: any) => any;
|
|
106
110
|
/**
|
|
107
111
|
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
108
112
|
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
109
113
|
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
110
114
|
*/
|
|
111
|
-
type Method
|
|
112
|
-
type AmbassadorRequestOptions
|
|
115
|
+
type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
116
|
+
type AmbassadorRequestOptions<T = any> = {
|
|
113
117
|
_?: T;
|
|
114
118
|
url?: string;
|
|
115
|
-
method?: Method
|
|
119
|
+
method?: Method;
|
|
116
120
|
params?: any;
|
|
117
121
|
data?: any;
|
|
118
|
-
transformResponse?: ResponseTransformer
|
|
122
|
+
transformResponse?: ResponseTransformer | ResponseTransformer[];
|
|
119
123
|
};
|
|
120
|
-
type AmbassadorFactory
|
|
124
|
+
type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
|
|
121
125
|
__isAmbassador: boolean;
|
|
122
126
|
};
|
|
123
|
-
type AmbassadorFunctionDescriptor
|
|
124
|
-
type BuildAmbassadorFunction
|
|
127
|
+
type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
|
|
128
|
+
type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
125
129
|
|
|
126
130
|
declare global {
|
|
127
131
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
@@ -130,7 +134,7 @@ declare global {
|
|
|
130
134
|
}
|
|
131
135
|
}
|
|
132
136
|
|
|
133
|
-
declare const emptyObjectSymbol
|
|
137
|
+
declare const emptyObjectSymbol: unique symbol;
|
|
134
138
|
|
|
135
139
|
/**
|
|
136
140
|
Represents a strictly empty plain object, the `{}` value.
|
|
@@ -158,7 +162,7 @@ Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<n
|
|
|
158
162
|
|
|
159
163
|
@category Object
|
|
160
164
|
*/
|
|
161
|
-
type EmptyObject
|
|
165
|
+
type EmptyObject = {[emptyObjectSymbol]?: never};
|
|
162
166
|
|
|
163
167
|
/**
|
|
164
168
|
Returns a boolean for whether the two given types are equal.
|
|
@@ -186,7 +190,7 @@ type Includes<Value extends readonly any[], Item> =
|
|
|
186
190
|
@category Type Guard
|
|
187
191
|
@category Utilities
|
|
188
192
|
*/
|
|
189
|
-
type IsEqual
|
|
193
|
+
type IsEqual<A, B> =
|
|
190
194
|
(<G>() => G extends A ? 1 : 2) extends
|
|
191
195
|
(<G>() => G extends B ? 1 : 2)
|
|
192
196
|
? true
|
|
@@ -219,9 +223,9 @@ type Filtered = Filter<'bar', 'foo'>;
|
|
|
219
223
|
|
|
220
224
|
@see {Except}
|
|
221
225
|
*/
|
|
222
|
-
type Filter
|
|
226
|
+
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
223
227
|
|
|
224
|
-
type ExceptOptions
|
|
228
|
+
type ExceptOptions = {
|
|
225
229
|
/**
|
|
226
230
|
Disallow assigning non-specified properties.
|
|
227
231
|
|
|
@@ -265,12 +269,78 @@ const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
|
265
269
|
|
|
266
270
|
@category Object
|
|
267
271
|
*/
|
|
268
|
-
type Except
|
|
269
|
-
[KeyType in keyof ObjectType as Filter
|
|
272
|
+
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
|
|
273
|
+
[KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
|
|
270
274
|
} & (Options['requireExactProps'] extends true
|
|
271
275
|
? Partial<Record<KeysType, never>>
|
|
272
276
|
: {});
|
|
273
277
|
|
|
278
|
+
/**
|
|
279
|
+
Returns a boolean for whether the given type is `never`.
|
|
280
|
+
|
|
281
|
+
@link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
|
|
282
|
+
@link https://stackoverflow.com/a/53984913/10292952
|
|
283
|
+
@link https://www.zhenghao.io/posts/ts-never
|
|
284
|
+
|
|
285
|
+
Useful in type utilities, such as checking if something does not occur.
|
|
286
|
+
|
|
287
|
+
@example
|
|
288
|
+
```
|
|
289
|
+
import type {IsNever, And} from 'type-fest';
|
|
290
|
+
|
|
291
|
+
// https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
|
|
292
|
+
type AreStringsEqual<A extends string, B extends string> =
|
|
293
|
+
And<
|
|
294
|
+
IsNever<Exclude<A, B>> extends true ? true : false,
|
|
295
|
+
IsNever<Exclude<B, A>> extends true ? true : false
|
|
296
|
+
>;
|
|
297
|
+
|
|
298
|
+
type EndIfEqual<I extends string, O extends string> =
|
|
299
|
+
AreStringsEqual<I, O> extends true
|
|
300
|
+
? never
|
|
301
|
+
: void;
|
|
302
|
+
|
|
303
|
+
function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
|
|
304
|
+
if (input === output) {
|
|
305
|
+
process.exit(0);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
endIfEqual('abc', 'abc');
|
|
310
|
+
//=> never
|
|
311
|
+
|
|
312
|
+
endIfEqual('abc', '123');
|
|
313
|
+
//=> void
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
@category Type Guard
|
|
317
|
+
@category Utilities
|
|
318
|
+
*/
|
|
319
|
+
type IsNever<T> = [T] extends [never] ? true : false;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
An if-else-like type that resolves depending on whether the given type is `never`.
|
|
323
|
+
|
|
324
|
+
@see {@link IsNever}
|
|
325
|
+
|
|
326
|
+
@example
|
|
327
|
+
```
|
|
328
|
+
import type {IfNever} from 'type-fest';
|
|
329
|
+
|
|
330
|
+
type ShouldBeTrue = IfNever<never>;
|
|
331
|
+
//=> true
|
|
332
|
+
|
|
333
|
+
type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
|
|
334
|
+
//=> 'bar'
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
@category Type Guard
|
|
338
|
+
@category Utilities
|
|
339
|
+
*/
|
|
340
|
+
type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (
|
|
341
|
+
IsNever<T> extends true ? TypeIfNever : TypeIfNotNever
|
|
342
|
+
);
|
|
343
|
+
|
|
274
344
|
/**
|
|
275
345
|
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
276
346
|
|
|
@@ -303,21 +373,19 @@ type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
|
303
373
|
|
|
304
374
|
@category Object
|
|
305
375
|
*/
|
|
306
|
-
type ConditionalKeys
|
|
307
|
-
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
|
376
|
+
type ConditionalKeys<Base, Condition> =
|
|
308
377
|
{
|
|
309
378
|
// Map through all the keys of the given base type.
|
|
310
|
-
[Key in keyof Base]
|
|
379
|
+
[Key in keyof Base]-?:
|
|
311
380
|
// Pick only keys with types extending the given `Condition` type.
|
|
312
381
|
Base[Key] extends Condition
|
|
313
|
-
// Retain this key
|
|
314
|
-
|
|
382
|
+
// Retain this key
|
|
383
|
+
// If the value for the key extends never, only include it if `Condition` also extends never
|
|
384
|
+
? IfNever<Base[Key], IfNever<Condition, Key, never>, Key>
|
|
315
385
|
// Discard this key since the condition fails.
|
|
316
386
|
: never;
|
|
317
|
-
|
|
318
387
|
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
319
|
-
}[keyof Base]
|
|
320
|
-
>;
|
|
388
|
+
}[keyof Base];
|
|
321
389
|
|
|
322
390
|
/**
|
|
323
391
|
Exclude keys from a shape that matches the given `Condition`.
|
|
@@ -357,9 +425,9 @@ type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
|
357
425
|
|
|
358
426
|
@category Object
|
|
359
427
|
*/
|
|
360
|
-
type ConditionalExcept
|
|
428
|
+
type ConditionalExcept<Base, Condition> = Except<
|
|
361
429
|
Base,
|
|
362
|
-
ConditionalKeys
|
|
430
|
+
ConditionalKeys<Base, Condition>
|
|
363
431
|
>;
|
|
364
432
|
|
|
365
433
|
/**
|
|
@@ -367,8 +435,8 @@ ConditionalKeys$4<Base, Condition>
|
|
|
367
435
|
* can either be a REST module or a host module.
|
|
368
436
|
* This type is recursive, so it can describe nested modules.
|
|
369
437
|
*/
|
|
370
|
-
type Descriptors
|
|
371
|
-
[key: string]: Descriptors
|
|
438
|
+
type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
|
|
439
|
+
[key: string]: Descriptors | PublicMetadata | any;
|
|
372
440
|
};
|
|
373
441
|
/**
|
|
374
442
|
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
@@ -376,12 +444,12 @@ type Descriptors$4 = RESTFunctionDescriptor$4 | AmbassadorFunctionDescriptor$4 |
|
|
|
376
444
|
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
377
445
|
* do not match the given host (as they will not work with the given host).
|
|
378
446
|
*/
|
|
379
|
-
type BuildDescriptors
|
|
447
|
+
type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
|
|
380
448
|
done: T;
|
|
381
449
|
recurse: T extends {
|
|
382
|
-
__type: typeof SERVICE_PLUGIN_ERROR_TYPE
|
|
383
|
-
} ? never : T extends AmbassadorFunctionDescriptor
|
|
384
|
-
[Key in keyof T]: T[Key] extends Descriptors
|
|
450
|
+
__type: typeof SERVICE_PLUGIN_ERROR_TYPE;
|
|
451
|
+
} ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition<any> ? BuildEventDefinition<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
|
|
452
|
+
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
|
|
385
453
|
-1,
|
|
386
454
|
0,
|
|
387
455
|
1,
|
|
@@ -390,9 +458,9 @@ type BuildDescriptors$4<T extends Descriptors$4, H extends Host$4<any> | undefin
|
|
|
390
458
|
4,
|
|
391
459
|
5
|
|
392
460
|
][Depth]> : never;
|
|
393
|
-
}, EmptyObject
|
|
461
|
+
}, EmptyObject>;
|
|
394
462
|
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
395
|
-
type PublicMetadata
|
|
463
|
+
type PublicMetadata = {
|
|
396
464
|
PACKAGE_NAME?: string;
|
|
397
465
|
};
|
|
398
466
|
|
|
@@ -404,9 +472,9 @@ declare global {
|
|
|
404
472
|
* A type used to create concerete types from SDK descriptors in
|
|
405
473
|
* case a contextual client is available.
|
|
406
474
|
*/
|
|
407
|
-
type MaybeContext
|
|
408
|
-
host: Host
|
|
409
|
-
} ? BuildDescriptors
|
|
475
|
+
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
476
|
+
host: Host;
|
|
477
|
+
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
410
478
|
|
|
411
479
|
/** A `connectedDomain` object holds information about an external domain and its connection to a Wix site. */
|
|
412
480
|
interface ConnectedDomain {
|
|
@@ -608,7 +676,7 @@ interface DomainEvent$1 extends DomainEventBodyOneOf$1 {
|
|
|
608
676
|
/** ID of the entity associated with the event. */
|
|
609
677
|
entityId?: string;
|
|
610
678
|
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
611
|
-
eventTime?: Date;
|
|
679
|
+
eventTime?: Date | null;
|
|
612
680
|
/**
|
|
613
681
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
614
682
|
* (for example, GDPR).
|
|
@@ -637,7 +705,7 @@ interface EntityCreatedEvent$1 {
|
|
|
637
705
|
entity?: string;
|
|
638
706
|
}
|
|
639
707
|
interface RestoreInfo$1 {
|
|
640
|
-
deletedDate?: Date;
|
|
708
|
+
deletedDate?: Date | null;
|
|
641
709
|
}
|
|
642
710
|
interface EntityUpdatedEvent$1 {
|
|
643
711
|
/**
|
|
@@ -723,7 +791,7 @@ interface ListConnectedDomainsOptions {
|
|
|
723
791
|
paging?: CursorPaging$1;
|
|
724
792
|
}
|
|
725
793
|
|
|
726
|
-
declare function createConnectedDomain$1(httpClient: HttpClient
|
|
794
|
+
declare function createConnectedDomain$1(httpClient: HttpClient): CreateConnectedDomainSignature;
|
|
727
795
|
interface CreateConnectedDomainSignature {
|
|
728
796
|
/**
|
|
729
797
|
* Creates a `connectedDomain` object and starts the domain connection process. It may take up to 48 hours for the DNS changes to take effect.
|
|
@@ -742,7 +810,7 @@ interface CreateConnectedDomainSignature {
|
|
|
742
810
|
*/
|
|
743
811
|
(connectedDomain: ConnectedDomain): Promise<ConnectedDomain & ConnectedDomainNonNullableFields>;
|
|
744
812
|
}
|
|
745
|
-
declare function getConnectedDomain$1(httpClient: HttpClient
|
|
813
|
+
declare function getConnectedDomain$1(httpClient: HttpClient): GetConnectedDomainSignature;
|
|
746
814
|
interface GetConnectedDomainSignature {
|
|
747
815
|
/**
|
|
748
816
|
* Retrieves a connected domain.
|
|
@@ -756,7 +824,7 @@ interface GetConnectedDomainSignature {
|
|
|
756
824
|
*/
|
|
757
825
|
(connectedDomainId: string): Promise<ConnectedDomain & ConnectedDomainNonNullableFields>;
|
|
758
826
|
}
|
|
759
|
-
declare function deleteConnectedDomain$1(httpClient: HttpClient
|
|
827
|
+
declare function deleteConnectedDomain$1(httpClient: HttpClient): DeleteConnectedDomainSignature;
|
|
760
828
|
interface DeleteConnectedDomainSignature {
|
|
761
829
|
/**
|
|
762
830
|
* Deletes a `connectedDomain` object and removes related DNS records from
|
|
@@ -776,7 +844,7 @@ interface DeleteConnectedDomainSignature {
|
|
|
776
844
|
*/
|
|
777
845
|
(connectedDomainId: string): Promise<void>;
|
|
778
846
|
}
|
|
779
|
-
declare function listConnectedDomains$1(httpClient: HttpClient
|
|
847
|
+
declare function listConnectedDomains$1(httpClient: HttpClient): ListConnectedDomainsSignature;
|
|
780
848
|
interface ListConnectedDomainsSignature {
|
|
781
849
|
/**
|
|
782
850
|
* Retrieves a list of up to 100 connected domains.
|
|
@@ -791,10 +859,10 @@ interface ListConnectedDomainsSignature {
|
|
|
791
859
|
(options?: ListConnectedDomainsOptions | undefined): Promise<ListConnectedDomainsResponse & ListConnectedDomainsResponseNonNullableFields>;
|
|
792
860
|
}
|
|
793
861
|
|
|
794
|
-
declare const createConnectedDomain: MaybeContext
|
|
795
|
-
declare const getConnectedDomain: MaybeContext
|
|
796
|
-
declare const deleteConnectedDomain: MaybeContext
|
|
797
|
-
declare const listConnectedDomains: MaybeContext
|
|
862
|
+
declare const createConnectedDomain: MaybeContext<BuildRESTFunction<typeof createConnectedDomain$1> & typeof createConnectedDomain$1>;
|
|
863
|
+
declare const getConnectedDomain: MaybeContext<BuildRESTFunction<typeof getConnectedDomain$1> & typeof getConnectedDomain$1>;
|
|
864
|
+
declare const deleteConnectedDomain: MaybeContext<BuildRESTFunction<typeof deleteConnectedDomain$1> & typeof deleteConnectedDomain$1>;
|
|
865
|
+
declare const listConnectedDomains: MaybeContext<BuildRESTFunction<typeof listConnectedDomains$1> & typeof listConnectedDomains$1>;
|
|
798
866
|
|
|
799
867
|
type context$4_AssignmentType = AssignmentType;
|
|
800
868
|
declare const context$4_AssignmentType: typeof AssignmentType;
|
|
@@ -825,487 +893,77 @@ declare namespace context$4 {
|
|
|
825
893
|
export { type ActionEvent$1 as ActionEvent, context$4_AssignmentType as AssignmentType, type context$4_ConnectedDomain as ConnectedDomain, type context$4_ConnectedDomainNonNullableFields as ConnectedDomainNonNullableFields, ConnectionType$1 as ConnectionType, type context$4_CreateConnectedDomainRequest as CreateConnectedDomainRequest, type context$4_CreateConnectedDomainResponse as CreateConnectedDomainResponse, type context$4_CreateConnectedDomainResponseNonNullableFields as CreateConnectedDomainResponseNonNullableFields, type CursorPaging$1 as CursorPaging, type CursorPagingMetadata$1 as CursorPagingMetadata, type Cursors$1 as Cursors, type context$4_DeleteConnectedDomainRequest as DeleteConnectedDomainRequest, type context$4_DeleteConnectedDomainResponse as DeleteConnectedDomainResponse, context$4_DnsPropagationStatus as DnsPropagationStatus, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type DomainRemovedEvent$1 as DomainRemovedEvent, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type context$4_GetConnectedDomainRequest as GetConnectedDomainRequest, type context$4_GetConnectedDomainResponse as GetConnectedDomainResponse, type context$4_GetConnectedDomainResponseNonNullableFields as GetConnectedDomainResponseNonNullableFields, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type context$4_ListConnectedDomainsOptions as ListConnectedDomainsOptions, type context$4_ListConnectedDomainsRequest as ListConnectedDomainsRequest, type context$4_ListConnectedDomainsResponse as ListConnectedDomainsResponse, type context$4_ListConnectedDomainsResponseNonNullableFields as ListConnectedDomainsResponseNonNullableFields, type MessageEnvelope$1 as MessageEnvelope, type context$4_RedirectAssignmentInfo as RedirectAssignmentInfo, type RestoreInfo$1 as RestoreInfo, type context$4_SiteInfo as SiteInfo, type context$4_SiteInfoAssignmentInfoOneOf as SiteInfoAssignmentInfoOneOf, WebhookIdentityType$1 as WebhookIdentityType, context$4_createConnectedDomain as createConnectedDomain, context$4_deleteConnectedDomain as deleteConnectedDomain, context$4_getConnectedDomain as getConnectedDomain, context$4_listConnectedDomains as listConnectedDomains };
|
|
826
894
|
}
|
|
827
895
|
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
channel: {
|
|
835
|
-
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
836
|
-
disconnect: () => void;
|
|
837
|
-
} | Promise<{
|
|
838
|
-
disconnect: () => void;
|
|
839
|
-
}>;
|
|
840
|
-
};
|
|
841
|
-
environment?: Environment;
|
|
896
|
+
/**
|
|
897
|
+
* A `connectedDomainSetupInfo` object holds information the connected domain's
|
|
898
|
+
* external registrar and some DNS records. You can use this information to guide
|
|
899
|
+
* the site owner through the domain's setup process.
|
|
900
|
+
*/
|
|
901
|
+
interface ConnectedDomainSetupInfo extends ConnectedDomainSetupInfoDnsRecordsOneOf {
|
|
842
902
|
/**
|
|
843
|
-
*
|
|
903
|
+
* Information about domains connected using nameservers. Available only for
|
|
904
|
+
* `{"connectionType": "NAMESERVERS"}`.
|
|
844
905
|
*/
|
|
845
|
-
|
|
906
|
+
nameserverRecord?: NameserverRecord;
|
|
846
907
|
/**
|
|
847
|
-
*
|
|
848
|
-
*
|
|
908
|
+
* Information about domains connected by pointing. Available only for
|
|
909
|
+
* `{"connectionType": "POINTING"}`.
|
|
910
|
+
* @readonly
|
|
849
911
|
*/
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
};
|
|
864
|
-
};
|
|
865
|
-
|
|
866
|
-
type RESTFunctionDescriptor$3<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$3) => T;
|
|
867
|
-
interface HttpClient$3 {
|
|
868
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory$3<TResponse, TData>): Promise<HttpResponse$3<TResponse>>;
|
|
869
|
-
fetchWithAuth: typeof fetch;
|
|
870
|
-
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
871
|
-
getActiveToken?: () => string | undefined;
|
|
912
|
+
pointingRecords?: PointingRecords;
|
|
913
|
+
/**
|
|
914
|
+
* Information about subdomains. Available only for subdomains.
|
|
915
|
+
* @readonly
|
|
916
|
+
*/
|
|
917
|
+
subdomainRecords?: SubdomainRecords;
|
|
918
|
+
/** ID of the connected domain. Identical to the domain name including TLD. */
|
|
919
|
+
connectedDomainId?: string;
|
|
920
|
+
/**
|
|
921
|
+
* Information about the external domain registrar including current name
|
|
922
|
+
* servers.
|
|
923
|
+
*/
|
|
924
|
+
registrar?: Registrar;
|
|
872
925
|
}
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
};
|
|
892
|
-
type BuildRESTFunction$3<T extends RESTFunctionDescriptor$3> = T extends RESTFunctionDescriptor$3<infer U> ? U : never;
|
|
893
|
-
type EventDefinition$3<Payload = unknown, Type extends string = string> = {
|
|
894
|
-
__type: 'event-definition';
|
|
895
|
-
type: Type;
|
|
896
|
-
isDomainEvent?: boolean;
|
|
897
|
-
transformations?: (envelope: unknown) => Payload;
|
|
898
|
-
__payload: Payload;
|
|
899
|
-
};
|
|
900
|
-
declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
|
|
901
|
-
type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
|
|
902
|
-
type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
|
|
903
|
-
|
|
904
|
-
type ServicePluginMethodInput$3 = {
|
|
905
|
-
request: any;
|
|
906
|
-
metadata: any;
|
|
907
|
-
};
|
|
908
|
-
type ServicePluginContract$3 = Record<string, (payload: ServicePluginMethodInput$3) => unknown | Promise<unknown>>;
|
|
909
|
-
type ServicePluginMethodMetadata$3 = {
|
|
910
|
-
name: string;
|
|
911
|
-
primaryHttpMappingPath: string;
|
|
912
|
-
transformations: {
|
|
913
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput$3;
|
|
914
|
-
toREST: (...args: unknown[]) => unknown;
|
|
915
|
-
};
|
|
916
|
-
};
|
|
917
|
-
type ServicePluginDefinition$3<Contract extends ServicePluginContract$3> = {
|
|
918
|
-
__type: 'service-plugin-definition';
|
|
919
|
-
componentType: string;
|
|
920
|
-
methods: ServicePluginMethodMetadata$3[];
|
|
921
|
-
__contract: Contract;
|
|
922
|
-
};
|
|
923
|
-
declare function ServicePluginDefinition$3<Contract extends ServicePluginContract$3>(componentType: string, methods: ServicePluginMethodMetadata$3[]): ServicePluginDefinition$3<Contract>;
|
|
924
|
-
type BuildServicePluginDefinition$3<T extends ServicePluginDefinition$3<any>> = (implementation: T['__contract']) => void;
|
|
925
|
-
declare const SERVICE_PLUGIN_ERROR_TYPE$3 = "wix_spi_error";
|
|
926
|
-
|
|
927
|
-
type RequestContext$3 = {
|
|
928
|
-
isSSR: boolean;
|
|
929
|
-
host: string;
|
|
930
|
-
protocol?: string;
|
|
931
|
-
};
|
|
932
|
-
type ResponseTransformer$3 = (data: any, headers?: any) => any;
|
|
933
|
-
/**
|
|
934
|
-
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
935
|
-
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
936
|
-
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
937
|
-
*/
|
|
938
|
-
type Method$3 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
939
|
-
type AmbassadorRequestOptions$3<T = any> = {
|
|
940
|
-
_?: T;
|
|
941
|
-
url?: string;
|
|
942
|
-
method?: Method$3;
|
|
943
|
-
params?: any;
|
|
944
|
-
data?: any;
|
|
945
|
-
transformResponse?: ResponseTransformer$3 | ResponseTransformer$3[];
|
|
946
|
-
};
|
|
947
|
-
type AmbassadorFactory$3<Request, Response> = (payload: Request) => ((context: RequestContext$3) => AmbassadorRequestOptions$3<Response>) & {
|
|
948
|
-
__isAmbassador: boolean;
|
|
949
|
-
};
|
|
950
|
-
type AmbassadorFunctionDescriptor$3<Request = any, Response = any> = AmbassadorFactory$3<Request, Response>;
|
|
951
|
-
type BuildAmbassadorFunction$3<T extends AmbassadorFunctionDescriptor$3> = T extends AmbassadorFunctionDescriptor$3<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
952
|
-
|
|
953
|
-
declare global {
|
|
954
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
955
|
-
interface SymbolConstructor {
|
|
956
|
-
readonly observable: symbol;
|
|
957
|
-
}
|
|
926
|
+
/** @oneof */
|
|
927
|
+
interface ConnectedDomainSetupInfoDnsRecordsOneOf {
|
|
928
|
+
/**
|
|
929
|
+
* Information about domains connected using nameservers. Available only for
|
|
930
|
+
* `{"connectionType": "NAMESERVERS"}`.
|
|
931
|
+
*/
|
|
932
|
+
nameserverRecord?: NameserverRecord;
|
|
933
|
+
/**
|
|
934
|
+
* Information about domains connected by pointing. Available only for
|
|
935
|
+
* `{"connectionType": "POINTING"}`.
|
|
936
|
+
* @readonly
|
|
937
|
+
*/
|
|
938
|
+
pointingRecords?: PointingRecords;
|
|
939
|
+
/**
|
|
940
|
+
* Information about subdomains. Available only for subdomains.
|
|
941
|
+
* @readonly
|
|
942
|
+
*/
|
|
943
|
+
subdomainRecords?: SubdomainRecords;
|
|
958
944
|
}
|
|
959
|
-
|
|
960
|
-
declare const emptyObjectSymbol$3: unique symbol;
|
|
961
|
-
|
|
962
|
-
/**
|
|
963
|
-
Represents a strictly empty plain object, the `{}` value.
|
|
964
|
-
|
|
965
|
-
When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)).
|
|
966
|
-
|
|
967
|
-
@example
|
|
968
|
-
```
|
|
969
|
-
import type {EmptyObject} from 'type-fest';
|
|
970
|
-
|
|
971
|
-
// The following illustrates the problem with `{}`.
|
|
972
|
-
const foo1: {} = {}; // Pass
|
|
973
|
-
const foo2: {} = []; // Pass
|
|
974
|
-
const foo3: {} = 42; // Pass
|
|
975
|
-
const foo4: {} = {a: 1}; // Pass
|
|
976
|
-
|
|
977
|
-
// With `EmptyObject` only the first case is valid.
|
|
978
|
-
const bar1: EmptyObject = {}; // Pass
|
|
979
|
-
const bar2: EmptyObject = 42; // Fail
|
|
980
|
-
const bar3: EmptyObject = []; // Fail
|
|
981
|
-
const bar4: EmptyObject = {a: 1}; // Fail
|
|
982
|
-
```
|
|
983
|
-
|
|
984
|
-
Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
|
|
985
|
-
|
|
986
|
-
@category Object
|
|
987
|
-
*/
|
|
988
|
-
type EmptyObject$3 = {[emptyObjectSymbol$3]?: never};
|
|
989
|
-
|
|
990
|
-
/**
|
|
991
|
-
Returns a boolean for whether the two given types are equal.
|
|
992
|
-
|
|
993
|
-
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
994
|
-
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
995
|
-
|
|
996
|
-
Use-cases:
|
|
997
|
-
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
998
|
-
|
|
999
|
-
@example
|
|
1000
|
-
```
|
|
1001
|
-
import type {IsEqual} from 'type-fest';
|
|
1002
|
-
|
|
1003
|
-
// This type returns a boolean for whether the given array includes the given item.
|
|
1004
|
-
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
1005
|
-
type Includes<Value extends readonly any[], Item> =
|
|
1006
|
-
Value extends readonly [Value[0], ...infer rest]
|
|
1007
|
-
? IsEqual<Value[0], Item> extends true
|
|
1008
|
-
? true
|
|
1009
|
-
: Includes<rest, Item>
|
|
1010
|
-
: false;
|
|
1011
|
-
```
|
|
1012
|
-
|
|
1013
|
-
@category Type Guard
|
|
1014
|
-
@category Utilities
|
|
1015
|
-
*/
|
|
1016
|
-
type IsEqual$3<A, B> =
|
|
1017
|
-
(<G>() => G extends A ? 1 : 2) extends
|
|
1018
|
-
(<G>() => G extends B ? 1 : 2)
|
|
1019
|
-
? true
|
|
1020
|
-
: false;
|
|
1021
|
-
|
|
1022
|
-
/**
|
|
1023
|
-
Filter out keys from an object.
|
|
1024
|
-
|
|
1025
|
-
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
1026
|
-
Returns `never` if `Key` extends `Exclude`.
|
|
1027
|
-
Returns `Key` otherwise.
|
|
1028
|
-
|
|
1029
|
-
@example
|
|
1030
|
-
```
|
|
1031
|
-
type Filtered = Filter<'foo', 'foo'>;
|
|
1032
|
-
//=> never
|
|
1033
|
-
```
|
|
1034
|
-
|
|
1035
|
-
@example
|
|
1036
|
-
```
|
|
1037
|
-
type Filtered = Filter<'bar', string>;
|
|
1038
|
-
//=> never
|
|
1039
|
-
```
|
|
1040
|
-
|
|
1041
|
-
@example
|
|
1042
|
-
```
|
|
1043
|
-
type Filtered = Filter<'bar', 'foo'>;
|
|
1044
|
-
//=> 'bar'
|
|
1045
|
-
```
|
|
1046
|
-
|
|
1047
|
-
@see {Except}
|
|
1048
|
-
*/
|
|
1049
|
-
type Filter$3<KeyType, ExcludeType> = IsEqual$3<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
1050
|
-
|
|
1051
|
-
type ExceptOptions$3 = {
|
|
1052
|
-
/**
|
|
1053
|
-
Disallow assigning non-specified properties.
|
|
1054
|
-
|
|
1055
|
-
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
1056
|
-
|
|
1057
|
-
@default false
|
|
1058
|
-
*/
|
|
1059
|
-
requireExactProps?: boolean;
|
|
1060
|
-
};
|
|
1061
|
-
|
|
1062
|
-
/**
|
|
1063
|
-
Create a type from an object type without certain keys.
|
|
1064
|
-
|
|
1065
|
-
We recommend setting the `requireExactProps` option to `true`.
|
|
1066
|
-
|
|
1067
|
-
This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
|
|
1068
|
-
|
|
1069
|
-
This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
|
|
1070
|
-
|
|
1071
|
-
@example
|
|
1072
|
-
```
|
|
1073
|
-
import type {Except} from 'type-fest';
|
|
1074
|
-
|
|
1075
|
-
type Foo = {
|
|
1076
|
-
a: number;
|
|
1077
|
-
b: string;
|
|
1078
|
-
};
|
|
1079
|
-
|
|
1080
|
-
type FooWithoutA = Except<Foo, 'a'>;
|
|
1081
|
-
//=> {b: string}
|
|
1082
|
-
|
|
1083
|
-
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
1084
|
-
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
1085
|
-
|
|
1086
|
-
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
1087
|
-
//=> {a: number} & Partial<Record<"b", never>>
|
|
1088
|
-
|
|
1089
|
-
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
1090
|
-
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
1091
|
-
```
|
|
1092
|
-
|
|
1093
|
-
@category Object
|
|
1094
|
-
*/
|
|
1095
|
-
type Except$3<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$3 = {requireExactProps: false}> = {
|
|
1096
|
-
[KeyType in keyof ObjectType as Filter$3<KeyType, KeysType>]: ObjectType[KeyType];
|
|
1097
|
-
} & (Options['requireExactProps'] extends true
|
|
1098
|
-
? Partial<Record<KeysType, never>>
|
|
1099
|
-
: {});
|
|
1100
|
-
|
|
1101
|
-
/**
|
|
1102
|
-
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
1103
|
-
|
|
1104
|
-
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
1105
|
-
|
|
1106
|
-
@example
|
|
1107
|
-
```
|
|
1108
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
1109
|
-
|
|
1110
|
-
interface Example {
|
|
1111
|
-
a: string;
|
|
1112
|
-
b: string | number;
|
|
1113
|
-
c?: string;
|
|
1114
|
-
d: {};
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1117
|
-
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
1118
|
-
//=> 'a'
|
|
1119
|
-
```
|
|
1120
|
-
|
|
1121
|
-
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
1122
|
-
|
|
1123
|
-
@example
|
|
1124
|
-
```
|
|
1125
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
1126
|
-
|
|
1127
|
-
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
1128
|
-
//=> 'a' | 'c'
|
|
1129
|
-
```
|
|
1130
|
-
|
|
1131
|
-
@category Object
|
|
1132
|
-
*/
|
|
1133
|
-
type ConditionalKeys$3<Base, Condition> = NonNullable<
|
|
1134
|
-
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
|
1135
|
-
{
|
|
1136
|
-
// Map through all the keys of the given base type.
|
|
1137
|
-
[Key in keyof Base]:
|
|
1138
|
-
// Pick only keys with types extending the given `Condition` type.
|
|
1139
|
-
Base[Key] extends Condition
|
|
1140
|
-
// Retain this key since the condition passes.
|
|
1141
|
-
? Key
|
|
1142
|
-
// Discard this key since the condition fails.
|
|
1143
|
-
: never;
|
|
1144
|
-
|
|
1145
|
-
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
1146
|
-
}[keyof Base]
|
|
1147
|
-
>;
|
|
1148
|
-
|
|
1149
|
-
/**
|
|
1150
|
-
Exclude keys from a shape that matches the given `Condition`.
|
|
1151
|
-
|
|
1152
|
-
This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
|
|
1153
|
-
|
|
1154
|
-
@example
|
|
1155
|
-
```
|
|
1156
|
-
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
1157
|
-
|
|
1158
|
-
class Awesome {
|
|
1159
|
-
name: string;
|
|
1160
|
-
successes: number;
|
|
1161
|
-
failures: bigint;
|
|
1162
|
-
|
|
1163
|
-
run() {}
|
|
1164
|
-
}
|
|
1165
|
-
|
|
1166
|
-
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
1167
|
-
//=> {run: () => void}
|
|
1168
|
-
```
|
|
1169
|
-
|
|
1170
|
-
@example
|
|
1171
|
-
```
|
|
1172
|
-
import type {ConditionalExcept} from 'type-fest';
|
|
1173
|
-
|
|
1174
|
-
interface Example {
|
|
1175
|
-
a: string;
|
|
1176
|
-
b: string | number;
|
|
1177
|
-
c: () => void;
|
|
1178
|
-
d: {};
|
|
1179
|
-
}
|
|
1180
|
-
|
|
1181
|
-
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
1182
|
-
//=> {b: string | number; c: () => void; d: {}}
|
|
1183
|
-
```
|
|
1184
|
-
|
|
1185
|
-
@category Object
|
|
1186
|
-
*/
|
|
1187
|
-
type ConditionalExcept$3<Base, Condition> = Except$3<
|
|
1188
|
-
Base,
|
|
1189
|
-
ConditionalKeys$3<Base, Condition>
|
|
1190
|
-
>;
|
|
1191
|
-
|
|
1192
|
-
/**
|
|
1193
|
-
* Descriptors are objects that describe the API of a module, and the module
|
|
1194
|
-
* can either be a REST module or a host module.
|
|
1195
|
-
* This type is recursive, so it can describe nested modules.
|
|
1196
|
-
*/
|
|
1197
|
-
type Descriptors$3 = RESTFunctionDescriptor$3 | AmbassadorFunctionDescriptor$3 | HostModule$3<any, any> | EventDefinition$3<any> | ServicePluginDefinition$3<any> | {
|
|
1198
|
-
[key: string]: Descriptors$3 | PublicMetadata$3 | any;
|
|
1199
|
-
};
|
|
1200
|
-
/**
|
|
1201
|
-
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
1202
|
-
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
1203
|
-
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
1204
|
-
* do not match the given host (as they will not work with the given host).
|
|
1205
|
-
*/
|
|
1206
|
-
type BuildDescriptors$3<T extends Descriptors$3, H extends Host$3<any> | undefined, Depth extends number = 5> = {
|
|
1207
|
-
done: T;
|
|
1208
|
-
recurse: T extends {
|
|
1209
|
-
__type: typeof SERVICE_PLUGIN_ERROR_TYPE$3;
|
|
1210
|
-
} ? never : T extends AmbassadorFunctionDescriptor$3 ? BuildAmbassadorFunction$3<T> : T extends RESTFunctionDescriptor$3 ? BuildRESTFunction$3<T> : T extends EventDefinition$3<any> ? BuildEventDefinition$3<T> : T extends ServicePluginDefinition$3<any> ? BuildServicePluginDefinition$3<T> : T extends HostModule$3<any, any> ? HostModuleAPI$3<T> : ConditionalExcept$3<{
|
|
1211
|
-
[Key in keyof T]: T[Key] extends Descriptors$3 ? BuildDescriptors$3<T[Key], H, [
|
|
1212
|
-
-1,
|
|
1213
|
-
0,
|
|
1214
|
-
1,
|
|
1215
|
-
2,
|
|
1216
|
-
3,
|
|
1217
|
-
4,
|
|
1218
|
-
5
|
|
1219
|
-
][Depth]> : never;
|
|
1220
|
-
}, EmptyObject$3>;
|
|
1221
|
-
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
1222
|
-
type PublicMetadata$3 = {
|
|
1223
|
-
PACKAGE_NAME?: string;
|
|
1224
|
-
};
|
|
1225
|
-
|
|
1226
|
-
declare global {
|
|
1227
|
-
interface ContextualClient {
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
/**
|
|
1231
|
-
* A type used to create concerete types from SDK descriptors in
|
|
1232
|
-
* case a contextual client is available.
|
|
1233
|
-
*/
|
|
1234
|
-
type MaybeContext$3<T extends Descriptors$3> = globalThis.ContextualClient extends {
|
|
1235
|
-
host: Host$3;
|
|
1236
|
-
} ? BuildDescriptors$3<T, globalThis.ContextualClient['host']> : T;
|
|
1237
|
-
|
|
1238
|
-
/**
|
|
1239
|
-
* A `connectedDomainSetupInfo` object holds information the connected domain's
|
|
1240
|
-
* external registrar and some DNS records. You can use this information to guide
|
|
1241
|
-
* the site owner through the domain's setup process.
|
|
1242
|
-
*/
|
|
1243
|
-
interface ConnectedDomainSetupInfo extends ConnectedDomainSetupInfoDnsRecordsOneOf {
|
|
945
|
+
interface Registrar {
|
|
1244
946
|
/**
|
|
1245
|
-
*
|
|
1246
|
-
*
|
|
947
|
+
* Name of the external domain registrar. For subdomains it's the registrar of the root domain.
|
|
948
|
+
* @readonly
|
|
1247
949
|
*/
|
|
1248
|
-
|
|
950
|
+
name?: string | null;
|
|
1249
951
|
/**
|
|
1250
|
-
*
|
|
1251
|
-
*
|
|
952
|
+
* Values of the current name server records. In case you connect an external
|
|
953
|
+
* domain using name servers, site owners must replace these current name servers
|
|
954
|
+
* with the new name servers found in `connectedDomainSetupInfo.nameserverRecord.nsRecord.values`
|
|
955
|
+
* during the initial domain setup.
|
|
956
|
+
* The replacement can't be performed through Wix APIs, you must use the
|
|
957
|
+
* infrastructure of the external domain registrar. Read more about
|
|
958
|
+
* [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).
|
|
1252
959
|
* @readonly
|
|
1253
960
|
*/
|
|
1254
|
-
|
|
961
|
+
nameServers?: string[];
|
|
962
|
+
}
|
|
963
|
+
/** Information about domains connected by nameservers. */
|
|
964
|
+
interface NameserverRecord {
|
|
1255
965
|
/**
|
|
1256
|
-
*
|
|
1257
|
-
* @readonly
|
|
1258
|
-
*/
|
|
1259
|
-
subdomainRecords?: SubdomainRecords;
|
|
1260
|
-
/** ID of the connected domain. Identical to the domain name including TLD. */
|
|
1261
|
-
connectedDomainId?: string;
|
|
1262
|
-
/**
|
|
1263
|
-
* Information about the external domain registrar including current name
|
|
1264
|
-
* servers.
|
|
1265
|
-
*/
|
|
1266
|
-
registrar?: Registrar;
|
|
1267
|
-
}
|
|
1268
|
-
/** @oneof */
|
|
1269
|
-
interface ConnectedDomainSetupInfoDnsRecordsOneOf {
|
|
1270
|
-
/**
|
|
1271
|
-
* Information about domains connected using nameservers. Available only for
|
|
1272
|
-
* `{"connectionType": "NAMESERVERS"}`.
|
|
1273
|
-
*/
|
|
1274
|
-
nameserverRecord?: NameserverRecord;
|
|
1275
|
-
/**
|
|
1276
|
-
* Information about domains connected by pointing. Available only for
|
|
1277
|
-
* `{"connectionType": "POINTING"}`.
|
|
1278
|
-
* @readonly
|
|
1279
|
-
*/
|
|
1280
|
-
pointingRecords?: PointingRecords;
|
|
1281
|
-
/**
|
|
1282
|
-
* Information about subdomains. Available only for subdomains.
|
|
1283
|
-
* @readonly
|
|
1284
|
-
*/
|
|
1285
|
-
subdomainRecords?: SubdomainRecords;
|
|
1286
|
-
}
|
|
1287
|
-
interface Registrar {
|
|
1288
|
-
/**
|
|
1289
|
-
* Name of the external domain registrar. For subdomains it's the registrar of the root domain.
|
|
1290
|
-
* @readonly
|
|
1291
|
-
*/
|
|
1292
|
-
name?: string | null;
|
|
1293
|
-
/**
|
|
1294
|
-
* Values of the current name server records. In case you connect an external
|
|
1295
|
-
* domain using name servers, site owners must replace these current name servers
|
|
1296
|
-
* with the new name servers found in `connectedDomainSetupInfo.nameserverRecord.nsRecord.values`
|
|
1297
|
-
* during the initial domain setup.
|
|
1298
|
-
* The replacement can't be performed through Wix APIs, you must use the
|
|
1299
|
-
* infrastructure of the external domain registrar. Read more about
|
|
1300
|
-
* [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).
|
|
1301
|
-
* @readonly
|
|
1302
|
-
*/
|
|
1303
|
-
nameServers?: string[];
|
|
1304
|
-
}
|
|
1305
|
-
/** Information about domains connected by nameservers. */
|
|
1306
|
-
interface NameserverRecord {
|
|
1307
|
-
/**
|
|
1308
|
-
* Default [nameserver record](https://en.wikipedia.org/wiki/List_of_DNS_record_types#NS).
|
|
966
|
+
* Default [nameserver record](https://en.wikipedia.org/wiki/List_of_DNS_record_types#NS).
|
|
1309
967
|
* @readonly
|
|
1310
968
|
*/
|
|
1311
969
|
nsRecord?: NsRecord;
|
|
@@ -1442,7 +1100,7 @@ interface GetConnectedDomainSetupInfoResponseNonNullableFields {
|
|
|
1442
1100
|
connectedDomainSetupInfo?: ConnectedDomainSetupInfoNonNullableFields;
|
|
1443
1101
|
}
|
|
1444
1102
|
|
|
1445
|
-
declare function getConnectedDomainSetupInfo$1(httpClient: HttpClient
|
|
1103
|
+
declare function getConnectedDomainSetupInfo$1(httpClient: HttpClient): GetConnectedDomainSetupInfoSignature;
|
|
1446
1104
|
interface GetConnectedDomainSetupInfoSignature {
|
|
1447
1105
|
/**
|
|
1448
1106
|
* Retrieves information for the initial setup of a connected domain.
|
|
@@ -1457,7 +1115,7 @@ interface GetConnectedDomainSetupInfoSignature {
|
|
|
1457
1115
|
(connectedDomainId: string): Promise<GetConnectedDomainSetupInfoResponse & GetConnectedDomainSetupInfoResponseNonNullableFields>;
|
|
1458
1116
|
}
|
|
1459
1117
|
|
|
1460
|
-
declare const getConnectedDomainSetupInfo: MaybeContext
|
|
1118
|
+
declare const getConnectedDomainSetupInfo: MaybeContext<BuildRESTFunction<typeof getConnectedDomainSetupInfo$1> & typeof getConnectedDomainSetupInfo$1>;
|
|
1461
1119
|
|
|
1462
1120
|
type context$3_ARecord = ARecord;
|
|
1463
1121
|
type context$3_CnameRecord = CnameRecord;
|
|
@@ -1482,520 +1140,110 @@ declare namespace context$3 {
|
|
|
1482
1140
|
export { type context$3_ARecord as ARecord, type context$3_CnameRecord as CnameRecord, type context$3_ConnectedDomainSetupInfo as ConnectedDomainSetupInfo, type context$3_ConnectedDomainSetupInfoDnsRecordsOneOf as ConnectedDomainSetupInfoDnsRecordsOneOf, context$3_ConnectionType as ConnectionType, type context$3_GetConnectedDomainSetupInfoRequest as GetConnectedDomainSetupInfoRequest, type context$3_GetConnectedDomainSetupInfoResponse as GetConnectedDomainSetupInfoResponse, type context$3_GetConnectedDomainSetupInfoResponseNonNullableFields as GetConnectedDomainSetupInfoResponseNonNullableFields, type context$3_GetSetupInfoRequest as GetSetupInfoRequest, type context$3_GetSetupInfoResponse as GetSetupInfoResponse, type context$3_NameserverRecord as NameserverRecord, type context$3_NsRecord as NsRecord, type context$3_PointingRecords as PointingRecords, type context$3_PreCreateConnectedDomainRequest as PreCreateConnectedDomainRequest, type context$3_PreCreateConnectedDomainResponse as PreCreateConnectedDomainResponse, type context$3_Registrar as Registrar, type context$3_SubdomainRecords as SubdomainRecords, context$3_getConnectedDomainSetupInfo as getConnectedDomainSetupInfo };
|
|
1483
1141
|
}
|
|
1484
1142
|
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
type HostModuleAPI$2<T extends HostModule$2<any, any>> = T extends HostModule$2<infer U, any> ? U : never;
|
|
1490
|
-
type Host$2<Environment = unknown> = {
|
|
1491
|
-
channel: {
|
|
1492
|
-
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
1493
|
-
disconnect: () => void;
|
|
1494
|
-
} | Promise<{
|
|
1495
|
-
disconnect: () => void;
|
|
1496
|
-
}>;
|
|
1497
|
-
};
|
|
1498
|
-
environment?: Environment;
|
|
1143
|
+
/** DNS zones hold information about the records that map a domain's URL to an IP address. */
|
|
1144
|
+
interface DnsZone {
|
|
1145
|
+
/** Domain name including the TLD. Both root domains and subdomains are supported. */
|
|
1146
|
+
domainName?: string;
|
|
1499
1147
|
/**
|
|
1500
|
-
*
|
|
1148
|
+
* DNS records. You can only set up a single `record` object per DNS record
|
|
1149
|
+
* type. If you want to specify multiple values for the same record type, you
|
|
1150
|
+
* must save them in the `values` for the relevant type.
|
|
1151
|
+
*
|
|
1152
|
+
* Min: 2 DNS record - a DNS zone file has to have at least two required DNS records: NS and SOA records
|
|
1153
|
+
* Max: 5000 DNS records
|
|
1501
1154
|
*/
|
|
1502
|
-
|
|
1155
|
+
records?: DnsRecord[];
|
|
1503
1156
|
/**
|
|
1504
|
-
*
|
|
1505
|
-
*
|
|
1157
|
+
* ID of the Dns Zone. Identical to the domain name including TLD.
|
|
1158
|
+
* @readonly
|
|
1506
1159
|
*/
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
};
|
|
1522
|
-
|
|
1523
|
-
type RESTFunctionDescriptor$2<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$2) => T;
|
|
1524
|
-
interface HttpClient$2 {
|
|
1525
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
|
|
1526
|
-
fetchWithAuth: typeof fetch;
|
|
1527
|
-
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
1528
|
-
getActiveToken?: () => string | undefined;
|
|
1160
|
+
_id?: string;
|
|
1161
|
+
/**
|
|
1162
|
+
* Whether [DNS Security Extensions (DNSSEC)](https://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions)
|
|
1163
|
+
* are enabled.
|
|
1164
|
+
*
|
|
1165
|
+
* Default: `false`
|
|
1166
|
+
*/
|
|
1167
|
+
dnssecEnabled?: boolean;
|
|
1168
|
+
/**
|
|
1169
|
+
* Information about [DNSSEC](https://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions).
|
|
1170
|
+
* Available only if `{"dnssecEnabled": true}`.
|
|
1171
|
+
* @readonly
|
|
1172
|
+
*/
|
|
1173
|
+
dnssecInfo?: DnssecInfo;
|
|
1529
1174
|
}
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
type
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
};
|
|
1565
|
-
type ServicePluginContract$2 = Record<string, (payload: ServicePluginMethodInput$2) => unknown | Promise<unknown>>;
|
|
1566
|
-
type ServicePluginMethodMetadata$2 = {
|
|
1567
|
-
name: string;
|
|
1568
|
-
primaryHttpMappingPath: string;
|
|
1569
|
-
transformations: {
|
|
1570
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput$2;
|
|
1571
|
-
toREST: (...args: unknown[]) => unknown;
|
|
1572
|
-
};
|
|
1573
|
-
};
|
|
1574
|
-
type ServicePluginDefinition$2<Contract extends ServicePluginContract$2> = {
|
|
1575
|
-
__type: 'service-plugin-definition';
|
|
1576
|
-
componentType: string;
|
|
1577
|
-
methods: ServicePluginMethodMetadata$2[];
|
|
1578
|
-
__contract: Contract;
|
|
1579
|
-
};
|
|
1580
|
-
declare function ServicePluginDefinition$2<Contract extends ServicePluginContract$2>(componentType: string, methods: ServicePluginMethodMetadata$2[]): ServicePluginDefinition$2<Contract>;
|
|
1581
|
-
type BuildServicePluginDefinition$2<T extends ServicePluginDefinition$2<any>> = (implementation: T['__contract']) => void;
|
|
1582
|
-
declare const SERVICE_PLUGIN_ERROR_TYPE$2 = "wix_spi_error";
|
|
1583
|
-
|
|
1584
|
-
type RequestContext$2 = {
|
|
1585
|
-
isSSR: boolean;
|
|
1586
|
-
host: string;
|
|
1587
|
-
protocol?: string;
|
|
1588
|
-
};
|
|
1589
|
-
type ResponseTransformer$2 = (data: any, headers?: any) => any;
|
|
1590
|
-
/**
|
|
1591
|
-
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
1592
|
-
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
1593
|
-
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
1594
|
-
*/
|
|
1595
|
-
type Method$2 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
1596
|
-
type AmbassadorRequestOptions$2<T = any> = {
|
|
1597
|
-
_?: T;
|
|
1598
|
-
url?: string;
|
|
1599
|
-
method?: Method$2;
|
|
1600
|
-
params?: any;
|
|
1601
|
-
data?: any;
|
|
1602
|
-
transformResponse?: ResponseTransformer$2 | ResponseTransformer$2[];
|
|
1603
|
-
};
|
|
1604
|
-
type AmbassadorFactory$2<Request, Response> = (payload: Request) => ((context: RequestContext$2) => AmbassadorRequestOptions$2<Response>) & {
|
|
1605
|
-
__isAmbassador: boolean;
|
|
1606
|
-
};
|
|
1607
|
-
type AmbassadorFunctionDescriptor$2<Request = any, Response = any> = AmbassadorFactory$2<Request, Response>;
|
|
1608
|
-
type BuildAmbassadorFunction$2<T extends AmbassadorFunctionDescriptor$2> = T extends AmbassadorFunctionDescriptor$2<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
1609
|
-
|
|
1610
|
-
declare global {
|
|
1611
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
1612
|
-
interface SymbolConstructor {
|
|
1613
|
-
readonly observable: symbol;
|
|
1614
|
-
}
|
|
1175
|
+
interface DnsRecord {
|
|
1176
|
+
/**
|
|
1177
|
+
* [DNS record type](https://en.wikipedia.org/wiki/List_of_DNS_record_types).
|
|
1178
|
+
*
|
|
1179
|
+
* + `UNKNOWN`: Default value. Used in case the record type isn't known. You can't set a record type to `UNKNOWN`.
|
|
1180
|
+
* + `A`: Address record. Most fundamental type of DNS record that indicates the IP address of a given domain.
|
|
1181
|
+
* + `AAAA`: Address record in [IPv6 format](https://en.wikipedia.org/wiki/IPv6).
|
|
1182
|
+
* + `NS`: Name server record. Describes which server contains the actual DNS record.
|
|
1183
|
+
* + `SOA`: [Start of authority record](https://en.wikipedia.org/wiki/SOA_record). Holds adminstrative information about the zone.
|
|
1184
|
+
* + `CNAME`: [CNAME record](https://en.wikipedia.org/wiki/CNAME_record). Maps an alias name to the canonical domain name.
|
|
1185
|
+
* + `MX`: MX record. Directs emails to mail servers.
|
|
1186
|
+
* + `TXT`: [TXT record](https://en.wikipedia.org/wiki/TXT_record). Used by domain admins to add human readable descriptions.
|
|
1187
|
+
* + `SPF`: SPF record. Used for email authentication.
|
|
1188
|
+
* + `SRV`: [Service record](https://en.wikipedia.org/wiki/SRV_record). Defines the server location.
|
|
1189
|
+
* + `PTR`: Pointer record. Specifies which host is supported for a given IP address.
|
|
1190
|
+
* + `NAPTR`: [Name Authority Pointer record](https://en.wikipedia.org/wiki/NAPTR_record). Used by Internet telephony applications.
|
|
1191
|
+
*/
|
|
1192
|
+
type?: RecordType;
|
|
1193
|
+
/**
|
|
1194
|
+
* Host name. Can be a subdomain. For example, `domain.com` or
|
|
1195
|
+
* `mail.domain.com`. Equal to the domain name, except for `CNAME` records.
|
|
1196
|
+
*/
|
|
1197
|
+
hostName?: string;
|
|
1198
|
+
/** [Time to live](https://en.wikipedia.org/wiki/Time_to_live) in seconds. */
|
|
1199
|
+
ttl?: number;
|
|
1200
|
+
/**
|
|
1201
|
+
* DNS record values. Wix limits DNS records to 50 values per type. External
|
|
1202
|
+
* providers may support a different maximum number of DNS records for a
|
|
1203
|
+
* specific type, Wix doesn't validate that you don't exceed these external
|
|
1204
|
+
* limits.
|
|
1205
|
+
*
|
|
1206
|
+
* Max: 50 records
|
|
1207
|
+
*/
|
|
1208
|
+
values?: string[];
|
|
1615
1209
|
}
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
const foo1: {} = {}; // Pass
|
|
1630
|
-
const foo2: {} = []; // Pass
|
|
1631
|
-
const foo3: {} = 42; // Pass
|
|
1632
|
-
const foo4: {} = {a: 1}; // Pass
|
|
1633
|
-
|
|
1634
|
-
// With `EmptyObject` only the first case is valid.
|
|
1635
|
-
const bar1: EmptyObject = {}; // Pass
|
|
1636
|
-
const bar2: EmptyObject = 42; // Fail
|
|
1637
|
-
const bar3: EmptyObject = []; // Fail
|
|
1638
|
-
const bar4: EmptyObject = {a: 1}; // Fail
|
|
1639
|
-
```
|
|
1640
|
-
|
|
1641
|
-
Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
|
|
1642
|
-
|
|
1643
|
-
@category Object
|
|
1644
|
-
*/
|
|
1645
|
-
type EmptyObject$2 = {[emptyObjectSymbol$2]?: never};
|
|
1646
|
-
|
|
1647
|
-
/**
|
|
1648
|
-
Returns a boolean for whether the two given types are equal.
|
|
1649
|
-
|
|
1650
|
-
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
1651
|
-
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
1652
|
-
|
|
1653
|
-
Use-cases:
|
|
1654
|
-
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
1655
|
-
|
|
1656
|
-
@example
|
|
1657
|
-
```
|
|
1658
|
-
import type {IsEqual} from 'type-fest';
|
|
1659
|
-
|
|
1660
|
-
// This type returns a boolean for whether the given array includes the given item.
|
|
1661
|
-
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
1662
|
-
type Includes<Value extends readonly any[], Item> =
|
|
1663
|
-
Value extends readonly [Value[0], ...infer rest]
|
|
1664
|
-
? IsEqual<Value[0], Item> extends true
|
|
1665
|
-
? true
|
|
1666
|
-
: Includes<rest, Item>
|
|
1667
|
-
: false;
|
|
1668
|
-
```
|
|
1669
|
-
|
|
1670
|
-
@category Type Guard
|
|
1671
|
-
@category Utilities
|
|
1672
|
-
*/
|
|
1673
|
-
type IsEqual$2<A, B> =
|
|
1674
|
-
(<G>() => G extends A ? 1 : 2) extends
|
|
1675
|
-
(<G>() => G extends B ? 1 : 2)
|
|
1676
|
-
? true
|
|
1677
|
-
: false;
|
|
1678
|
-
|
|
1679
|
-
/**
|
|
1680
|
-
Filter out keys from an object.
|
|
1681
|
-
|
|
1682
|
-
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
1683
|
-
Returns `never` if `Key` extends `Exclude`.
|
|
1684
|
-
Returns `Key` otherwise.
|
|
1685
|
-
|
|
1686
|
-
@example
|
|
1687
|
-
```
|
|
1688
|
-
type Filtered = Filter<'foo', 'foo'>;
|
|
1689
|
-
//=> never
|
|
1690
|
-
```
|
|
1691
|
-
|
|
1692
|
-
@example
|
|
1693
|
-
```
|
|
1694
|
-
type Filtered = Filter<'bar', string>;
|
|
1695
|
-
//=> never
|
|
1696
|
-
```
|
|
1697
|
-
|
|
1698
|
-
@example
|
|
1699
|
-
```
|
|
1700
|
-
type Filtered = Filter<'bar', 'foo'>;
|
|
1701
|
-
//=> 'bar'
|
|
1702
|
-
```
|
|
1703
|
-
|
|
1704
|
-
@see {Except}
|
|
1705
|
-
*/
|
|
1706
|
-
type Filter$2<KeyType, ExcludeType> = IsEqual$2<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
1707
|
-
|
|
1708
|
-
type ExceptOptions$2 = {
|
|
1709
|
-
/**
|
|
1710
|
-
Disallow assigning non-specified properties.
|
|
1711
|
-
|
|
1712
|
-
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
1713
|
-
|
|
1714
|
-
@default false
|
|
1715
|
-
*/
|
|
1716
|
-
requireExactProps?: boolean;
|
|
1717
|
-
};
|
|
1718
|
-
|
|
1719
|
-
/**
|
|
1720
|
-
Create a type from an object type without certain keys.
|
|
1721
|
-
|
|
1722
|
-
We recommend setting the `requireExactProps` option to `true`.
|
|
1723
|
-
|
|
1724
|
-
This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
|
|
1725
|
-
|
|
1726
|
-
This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
|
|
1727
|
-
|
|
1728
|
-
@example
|
|
1729
|
-
```
|
|
1730
|
-
import type {Except} from 'type-fest';
|
|
1731
|
-
|
|
1732
|
-
type Foo = {
|
|
1733
|
-
a: number;
|
|
1734
|
-
b: string;
|
|
1735
|
-
};
|
|
1736
|
-
|
|
1737
|
-
type FooWithoutA = Except<Foo, 'a'>;
|
|
1738
|
-
//=> {b: string}
|
|
1739
|
-
|
|
1740
|
-
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
1741
|
-
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
1742
|
-
|
|
1743
|
-
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
1744
|
-
//=> {a: number} & Partial<Record<"b", never>>
|
|
1745
|
-
|
|
1746
|
-
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
1747
|
-
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
1748
|
-
```
|
|
1749
|
-
|
|
1750
|
-
@category Object
|
|
1751
|
-
*/
|
|
1752
|
-
type Except$2<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$2 = {requireExactProps: false}> = {
|
|
1753
|
-
[KeyType in keyof ObjectType as Filter$2<KeyType, KeysType>]: ObjectType[KeyType];
|
|
1754
|
-
} & (Options['requireExactProps'] extends true
|
|
1755
|
-
? Partial<Record<KeysType, never>>
|
|
1756
|
-
: {});
|
|
1757
|
-
|
|
1758
|
-
/**
|
|
1759
|
-
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
1760
|
-
|
|
1761
|
-
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
1762
|
-
|
|
1763
|
-
@example
|
|
1764
|
-
```
|
|
1765
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
1766
|
-
|
|
1767
|
-
interface Example {
|
|
1768
|
-
a: string;
|
|
1769
|
-
b: string | number;
|
|
1770
|
-
c?: string;
|
|
1771
|
-
d: {};
|
|
1772
|
-
}
|
|
1773
|
-
|
|
1774
|
-
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
1775
|
-
//=> 'a'
|
|
1776
|
-
```
|
|
1777
|
-
|
|
1778
|
-
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
1779
|
-
|
|
1780
|
-
@example
|
|
1781
|
-
```
|
|
1782
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
1783
|
-
|
|
1784
|
-
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
1785
|
-
//=> 'a' | 'c'
|
|
1786
|
-
```
|
|
1787
|
-
|
|
1788
|
-
@category Object
|
|
1789
|
-
*/
|
|
1790
|
-
type ConditionalKeys$2<Base, Condition> = NonNullable<
|
|
1791
|
-
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
|
1792
|
-
{
|
|
1793
|
-
// Map through all the keys of the given base type.
|
|
1794
|
-
[Key in keyof Base]:
|
|
1795
|
-
// Pick only keys with types extending the given `Condition` type.
|
|
1796
|
-
Base[Key] extends Condition
|
|
1797
|
-
// Retain this key since the condition passes.
|
|
1798
|
-
? Key
|
|
1799
|
-
// Discard this key since the condition fails.
|
|
1800
|
-
: never;
|
|
1801
|
-
|
|
1802
|
-
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
1803
|
-
}[keyof Base]
|
|
1804
|
-
>;
|
|
1805
|
-
|
|
1806
|
-
/**
|
|
1807
|
-
Exclude keys from a shape that matches the given `Condition`.
|
|
1808
|
-
|
|
1809
|
-
This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
|
|
1810
|
-
|
|
1811
|
-
@example
|
|
1812
|
-
```
|
|
1813
|
-
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
1814
|
-
|
|
1815
|
-
class Awesome {
|
|
1816
|
-
name: string;
|
|
1817
|
-
successes: number;
|
|
1818
|
-
failures: bigint;
|
|
1819
|
-
|
|
1820
|
-
run() {}
|
|
1821
|
-
}
|
|
1822
|
-
|
|
1823
|
-
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
1824
|
-
//=> {run: () => void}
|
|
1825
|
-
```
|
|
1826
|
-
|
|
1827
|
-
@example
|
|
1828
|
-
```
|
|
1829
|
-
import type {ConditionalExcept} from 'type-fest';
|
|
1830
|
-
|
|
1831
|
-
interface Example {
|
|
1832
|
-
a: string;
|
|
1833
|
-
b: string | number;
|
|
1834
|
-
c: () => void;
|
|
1835
|
-
d: {};
|
|
1836
|
-
}
|
|
1837
|
-
|
|
1838
|
-
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
1839
|
-
//=> {b: string | number; c: () => void; d: {}}
|
|
1840
|
-
```
|
|
1841
|
-
|
|
1842
|
-
@category Object
|
|
1843
|
-
*/
|
|
1844
|
-
type ConditionalExcept$2<Base, Condition> = Except$2<
|
|
1845
|
-
Base,
|
|
1846
|
-
ConditionalKeys$2<Base, Condition>
|
|
1847
|
-
>;
|
|
1848
|
-
|
|
1849
|
-
/**
|
|
1850
|
-
* Descriptors are objects that describe the API of a module, and the module
|
|
1851
|
-
* can either be a REST module or a host module.
|
|
1852
|
-
* This type is recursive, so it can describe nested modules.
|
|
1853
|
-
*/
|
|
1854
|
-
type Descriptors$2 = RESTFunctionDescriptor$2 | AmbassadorFunctionDescriptor$2 | HostModule$2<any, any> | EventDefinition$2<any> | ServicePluginDefinition$2<any> | {
|
|
1855
|
-
[key: string]: Descriptors$2 | PublicMetadata$2 | any;
|
|
1856
|
-
};
|
|
1857
|
-
/**
|
|
1858
|
-
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
1859
|
-
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
1860
|
-
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
1861
|
-
* do not match the given host (as they will not work with the given host).
|
|
1862
|
-
*/
|
|
1863
|
-
type BuildDescriptors$2<T extends Descriptors$2, H extends Host$2<any> | undefined, Depth extends number = 5> = {
|
|
1864
|
-
done: T;
|
|
1865
|
-
recurse: T extends {
|
|
1866
|
-
__type: typeof SERVICE_PLUGIN_ERROR_TYPE$2;
|
|
1867
|
-
} ? never : T extends AmbassadorFunctionDescriptor$2 ? BuildAmbassadorFunction$2<T> : T extends RESTFunctionDescriptor$2 ? BuildRESTFunction$2<T> : T extends EventDefinition$2<any> ? BuildEventDefinition$2<T> : T extends ServicePluginDefinition$2<any> ? BuildServicePluginDefinition$2<T> : T extends HostModule$2<any, any> ? HostModuleAPI$2<T> : ConditionalExcept$2<{
|
|
1868
|
-
[Key in keyof T]: T[Key] extends Descriptors$2 ? BuildDescriptors$2<T[Key], H, [
|
|
1869
|
-
-1,
|
|
1870
|
-
0,
|
|
1871
|
-
1,
|
|
1872
|
-
2,
|
|
1873
|
-
3,
|
|
1874
|
-
4,
|
|
1875
|
-
5
|
|
1876
|
-
][Depth]> : never;
|
|
1877
|
-
}, EmptyObject$2>;
|
|
1878
|
-
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
1879
|
-
type PublicMetadata$2 = {
|
|
1880
|
-
PACKAGE_NAME?: string;
|
|
1881
|
-
};
|
|
1882
|
-
|
|
1883
|
-
declare global {
|
|
1884
|
-
interface ContextualClient {
|
|
1885
|
-
}
|
|
1210
|
+
declare enum RecordType {
|
|
1211
|
+
UNKNOWN = "UNKNOWN",
|
|
1212
|
+
A = "A",
|
|
1213
|
+
AAAA = "AAAA",
|
|
1214
|
+
NS = "NS",
|
|
1215
|
+
SOA = "SOA",
|
|
1216
|
+
CNAME = "CNAME",
|
|
1217
|
+
MX = "MX",
|
|
1218
|
+
TXT = "TXT",
|
|
1219
|
+
SPF = "SPF",
|
|
1220
|
+
SRV = "SRV",
|
|
1221
|
+
PTR = "PTR",
|
|
1222
|
+
NAPTR = "NAPTR"
|
|
1886
1223
|
}
|
|
1887
|
-
|
|
1888
|
-
* A type used to create concerete types from SDK descriptors in
|
|
1889
|
-
* case a contextual client is available.
|
|
1890
|
-
*/
|
|
1891
|
-
type MaybeContext$2<T extends Descriptors$2> = globalThis.ContextualClient extends {
|
|
1892
|
-
host: Host$2;
|
|
1893
|
-
} ? BuildDescriptors$2<T, globalThis.ContextualClient['host']> : T;
|
|
1894
|
-
|
|
1895
|
-
/** DNS zones hold information about the records that map a domain's URL to an IP address. */
|
|
1896
|
-
interface DnsZone {
|
|
1897
|
-
/** Domain name including the TLD. Both root domains and subdomains are supported. */
|
|
1898
|
-
domainName?: string;
|
|
1899
|
-
/**
|
|
1900
|
-
* DNS records. You can only set up a single `record` object per DNS record
|
|
1901
|
-
* type. If you want to specify multiple values for the same record type, you
|
|
1902
|
-
* must save them in the `values` for the relevant type.
|
|
1903
|
-
*
|
|
1904
|
-
* Min: 2 DNS record - a DNS zone file has to have at least two required DNS records: NS and SOA records
|
|
1905
|
-
* Max: 5000 DNS records
|
|
1906
|
-
*/
|
|
1907
|
-
records?: DnsRecord[];
|
|
1224
|
+
interface DnssecInfo {
|
|
1908
1225
|
/**
|
|
1909
|
-
*
|
|
1910
|
-
*
|
|
1226
|
+
* Unique 16-bit identifier for a [DNSKEY](https://cloud.google.com/dns/docs/reference/rest/v1/dnsKeys)
|
|
1227
|
+
* record that allows efficient DNSSEC validation in zones with multiple keys.
|
|
1911
1228
|
*/
|
|
1912
|
-
|
|
1229
|
+
keyTag?: number;
|
|
1913
1230
|
/**
|
|
1914
|
-
*
|
|
1915
|
-
*
|
|
1916
|
-
*
|
|
1917
|
-
* Default: `false`
|
|
1231
|
+
* Cryptographic hash of the [DNSKEY](https://cloud.google.com/dns/docs/reference/rest/v1/dnsKeys)
|
|
1232
|
+
* record that's included in the delegation signer (DS) record and ensures secure
|
|
1233
|
+
* DNSSEC validation.
|
|
1918
1234
|
*/
|
|
1919
|
-
|
|
1235
|
+
digest?: string;
|
|
1236
|
+
}
|
|
1237
|
+
interface DnsRecordsChangedEvent {
|
|
1238
|
+
domainName?: string;
|
|
1239
|
+
changeTime?: Date | null;
|
|
1240
|
+
}
|
|
1241
|
+
interface DomainRemovedEvent {
|
|
1920
1242
|
/**
|
|
1921
|
-
*
|
|
1922
|
-
*
|
|
1923
|
-
* @readonly
|
|
1243
|
+
* Domain name including TLD.
|
|
1244
|
+
* Both root domains and subdomains are supported.
|
|
1924
1245
|
*/
|
|
1925
|
-
|
|
1926
|
-
}
|
|
1927
|
-
interface DnsRecord {
|
|
1928
|
-
/**
|
|
1929
|
-
* [DNS record type](https://en.wikipedia.org/wiki/List_of_DNS_record_types).
|
|
1930
|
-
*
|
|
1931
|
-
* + `UNKNOWN`: Default value. Used in case the record type isn't known. You can't set a record type to `UNKNOWN`.
|
|
1932
|
-
* + `A`: Address record. Most fundamental type of DNS record that indicates the IP address of a given domain.
|
|
1933
|
-
* + `AAAA`: Address record in [IPv6 format](https://en.wikipedia.org/wiki/IPv6).
|
|
1934
|
-
* + `NS`: Name server record. Describes which server contains the actual DNS record.
|
|
1935
|
-
* + `SOA`: [Start of authority record](https://en.wikipedia.org/wiki/SOA_record). Holds adminstrative information about the zone.
|
|
1936
|
-
* + `CNAME`: [CNAME record](https://en.wikipedia.org/wiki/CNAME_record). Maps an alias name to the canonical domain name.
|
|
1937
|
-
* + `MX`: MX record. Directs emails to mail servers.
|
|
1938
|
-
* + `TXT`: [TXT record](https://en.wikipedia.org/wiki/TXT_record). Used by domain admins to add human readable descriptions.
|
|
1939
|
-
* + `SPF`: SPF record. Used for email authentication.
|
|
1940
|
-
* + `SRV`: [Service record](https://en.wikipedia.org/wiki/SRV_record). Defines the server location.
|
|
1941
|
-
* + `PTR`: Pointer record. Specifies which host is supported for a given IP address.
|
|
1942
|
-
* + `NAPTR`: [Name Authority Pointer record](https://en.wikipedia.org/wiki/NAPTR_record). Used by Internet telephony applications.
|
|
1943
|
-
*/
|
|
1944
|
-
type?: RecordType;
|
|
1945
|
-
/**
|
|
1946
|
-
* Host name. Can be a subdomain. For example, `domain.com` or
|
|
1947
|
-
* `mail.domain.com`. Equal to the domain name, except for `CNAME` records.
|
|
1948
|
-
*/
|
|
1949
|
-
hostName?: string;
|
|
1950
|
-
/** [Time to live](https://en.wikipedia.org/wiki/Time_to_live) in seconds. */
|
|
1951
|
-
ttl?: number;
|
|
1952
|
-
/**
|
|
1953
|
-
* DNS record values. Wix limits DNS records to 50 values per type. External
|
|
1954
|
-
* providers may support a different maximum number of DNS records for a
|
|
1955
|
-
* specific type, Wix doesn't validate that you don't exceed these external
|
|
1956
|
-
* limits.
|
|
1957
|
-
*
|
|
1958
|
-
* Max: 50 records
|
|
1959
|
-
*/
|
|
1960
|
-
values?: string[];
|
|
1961
|
-
}
|
|
1962
|
-
declare enum RecordType {
|
|
1963
|
-
UNKNOWN = "UNKNOWN",
|
|
1964
|
-
A = "A",
|
|
1965
|
-
AAAA = "AAAA",
|
|
1966
|
-
NS = "NS",
|
|
1967
|
-
SOA = "SOA",
|
|
1968
|
-
CNAME = "CNAME",
|
|
1969
|
-
MX = "MX",
|
|
1970
|
-
TXT = "TXT",
|
|
1971
|
-
SPF = "SPF",
|
|
1972
|
-
SRV = "SRV",
|
|
1973
|
-
PTR = "PTR",
|
|
1974
|
-
NAPTR = "NAPTR"
|
|
1975
|
-
}
|
|
1976
|
-
interface DnssecInfo {
|
|
1977
|
-
/**
|
|
1978
|
-
* Unique 16-bit identifier for a [DNSKEY](https://cloud.google.com/dns/docs/reference/rest/v1/dnsKeys)
|
|
1979
|
-
* record that allows efficient DNSSEC validation in zones with multiple keys.
|
|
1980
|
-
*/
|
|
1981
|
-
keyTag?: number;
|
|
1982
|
-
/**
|
|
1983
|
-
* Cryptographic hash of the [DNSKEY](https://cloud.google.com/dns/docs/reference/rest/v1/dnsKeys)
|
|
1984
|
-
* record that's included in the delegation signer (DS) record and ensures secure
|
|
1985
|
-
* DNSSEC validation.
|
|
1986
|
-
*/
|
|
1987
|
-
digest?: string;
|
|
1988
|
-
}
|
|
1989
|
-
interface DnsRecordsChangedEvent {
|
|
1990
|
-
domainName?: string;
|
|
1991
|
-
changeTime?: Date;
|
|
1992
|
-
}
|
|
1993
|
-
interface DomainRemovedEvent {
|
|
1994
|
-
/**
|
|
1995
|
-
* Domain name including TLD.
|
|
1996
|
-
* Both root domains and subdomains are supported.
|
|
1997
|
-
*/
|
|
1998
|
-
domain?: string;
|
|
1246
|
+
domain?: string;
|
|
1999
1247
|
}
|
|
2000
1248
|
interface CreateDnsZoneRequest {
|
|
2001
1249
|
/** DNS zone to create. */
|
|
@@ -2077,7 +1325,7 @@ interface DomainEvent extends DomainEventBodyOneOf {
|
|
|
2077
1325
|
/** ID of the entity associated with the event. */
|
|
2078
1326
|
entityId?: string;
|
|
2079
1327
|
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
2080
|
-
eventTime?: Date;
|
|
1328
|
+
eventTime?: Date | null;
|
|
2081
1329
|
/**
|
|
2082
1330
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
2083
1331
|
* (for example, GDPR).
|
|
@@ -2106,7 +1354,7 @@ interface EntityCreatedEvent {
|
|
|
2106
1354
|
entity?: string;
|
|
2107
1355
|
}
|
|
2108
1356
|
interface RestoreInfo {
|
|
2109
|
-
deletedDate?: Date;
|
|
1357
|
+
deletedDate?: Date | null;
|
|
2110
1358
|
}
|
|
2111
1359
|
interface EntityUpdatedEvent {
|
|
2112
1360
|
/**
|
|
@@ -2198,1041 +1446,221 @@ interface UpdateDnsZoneOptions {
|
|
|
2198
1446
|
*
|
|
2199
1447
|
* Max: 10 additions
|
|
2200
1448
|
*/
|
|
2201
|
-
additions?: DnsRecord[];
|
|
2202
|
-
/**
|
|
2203
|
-
* DNS records to remove from the DNS zone.
|
|
2204
|
-
*
|
|
2205
|
-
* Max: 10 deletions
|
|
2206
|
-
*/
|
|
2207
|
-
deletions?: DnsRecord[];
|
|
2208
|
-
/** Whether you want to enable or disable [DNS Security Extensions (DNSSEC)](https://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions). */
|
|
2209
|
-
dnssecEnabled?: boolean | null;
|
|
2210
|
-
}
|
|
2211
|
-
|
|
2212
|
-
declare function createDnsZone$1(httpClient: HttpClient$2): CreateDnsZoneSignature;
|
|
2213
|
-
interface CreateDnsZoneSignature {
|
|
2214
|
-
/**
|
|
2215
|
-
* Creates a DNS zone in [Google's Cloud DNS](https://cloud.google.com/dns).
|
|
2216
|
-
*
|
|
2217
|
-
*
|
|
2218
|
-
* If there is an existing DNS zone for the domain, it's deleted before
|
|
2219
|
-
* the new zone is created.
|
|
2220
|
-
*
|
|
2221
|
-
* The call is synchronous, that means it fails in case of an error on
|
|
2222
|
-
* Google's side.
|
|
2223
|
-
*
|
|
2224
|
-
* You can only set up a single `record` object per DNS record
|
|
2225
|
-
* type. If you want to specify multiple values for the same record type, you
|
|
2226
|
-
* must save them in the `values` for the relevant type.
|
|
2227
|
-
*
|
|
2228
|
-
* > __Important:__ This call requires an account level API key and cannot be authenticated with the standard authorization header.
|
|
2229
|
-
* @param - DNS zone to create.
|
|
2230
|
-
* @returns Created DNS zone.
|
|
2231
|
-
*/
|
|
2232
|
-
(dnsZone: DnsZone): Promise<DnsZone & DnsZoneNonNullableFields>;
|
|
2233
|
-
}
|
|
2234
|
-
declare function getDnsZone$1(httpClient: HttpClient$2): GetDnsZoneSignature;
|
|
2235
|
-
interface GetDnsZoneSignature {
|
|
2236
|
-
/**
|
|
2237
|
-
* Retrieves the DNS zone belonging to the domain from
|
|
2238
|
-
* [Google's Cloud DNS](https://cloud.google.com/dns).
|
|
2239
|
-
*
|
|
2240
|
-
*
|
|
2241
|
-
* > __Important:__ This call requires an account level API key and cannot be authenticated with the standard authorization header.
|
|
2242
|
-
* @param - Domain to retrieve the DNS zone for.
|
|
2243
|
-
* @returns Retrieved DNS zone.
|
|
2244
|
-
*/
|
|
2245
|
-
(domainName: string): Promise<DnsZone & DnsZoneNonNullableFields>;
|
|
2246
|
-
}
|
|
2247
|
-
declare function updateDnsZone$1(httpClient: HttpClient$2): UpdateDnsZoneSignature;
|
|
2248
|
-
interface UpdateDnsZoneSignature {
|
|
2249
|
-
/**
|
|
2250
|
-
* Adds DNS records to and removes DNS records from a DNS zone in
|
|
2251
|
-
* [Google's Cloud DNS](https://cloud.google.com/dns).
|
|
2252
|
-
*
|
|
2253
|
-
* The call is synchronous, that means it fails in case of an error on
|
|
2254
|
-
* Google's side.
|
|
2255
|
-
*
|
|
2256
|
-
* You can only set up a single `record` object per DNS record
|
|
2257
|
-
* type. If you want to specify multiple values for the same record type, you
|
|
2258
|
-
* must save them in the `values` for the relevant type. This means, you must
|
|
2259
|
-
* delete the relevant record and add a new `addition` object for this type
|
|
2260
|
-
* to the request, in case you want to add values for an existing DNS record
|
|
2261
|
-
* type.
|
|
2262
|
-
*
|
|
2263
|
-
* > __Important:__ This call requires an account level API key and cannot be authenticated with the standard authorization header.
|
|
2264
|
-
* @param - Domain to update the DNS zone for. Must include the TLD.
|
|
2265
|
-
*/
|
|
2266
|
-
(domainName: string, options?: UpdateDnsZoneOptions | undefined): Promise<UpdateDnsZoneResponse & UpdateDnsZoneResponseNonNullableFields>;
|
|
2267
|
-
}
|
|
2268
|
-
declare function deleteDnsZone$1(httpClient: HttpClient$2): DeleteDnsZoneSignature;
|
|
2269
|
-
interface DeleteDnsZoneSignature {
|
|
2270
|
-
/**
|
|
2271
|
-
* Deletes a DNS zone in [Google's Cloud DNS](https://cloud.google.com/dns).
|
|
2272
|
-
*
|
|
2273
|
-
*
|
|
2274
|
-
* The call is synchronous, that means it fails in case of an error on
|
|
2275
|
-
* Google's side.
|
|
2276
|
-
*
|
|
2277
|
-
* > __Important:__ This call requires an account level API key and cannot be authenticated with the standard authorization header.
|
|
2278
|
-
* @param - Domain name to delete the DNS zone for.
|
|
2279
|
-
*/
|
|
2280
|
-
(domainName: string): Promise<void>;
|
|
2281
|
-
}
|
|
2282
|
-
declare function previewDnsZone$1(httpClient: HttpClient$2): PreviewDnsZoneSignature;
|
|
2283
|
-
interface PreviewDnsZoneSignature {
|
|
2284
|
-
/**
|
|
2285
|
-
* Generates a preview for a DNS zone based on
|
|
2286
|
-
* [Google's Cloud DNS](https://cloud.google.com/dns).
|
|
2287
|
-
*
|
|
2288
|
-
*
|
|
2289
|
-
* This includes calculating the `A`, `CNAME`, `NS` and `SOA` records.
|
|
2290
|
-
* You can use this information to configure a domain from an external
|
|
2291
|
-
* provider, before connecting it to a Wix site.
|
|
2292
|
-
*
|
|
2293
|
-
* > __Important:__ This call requires an account level API key and cannot be authenticated with the standard authorization header.
|
|
2294
|
-
* @param - Domain name to generate a DNS zone preview for.
|
|
2295
|
-
*/
|
|
2296
|
-
(domainName: string): Promise<PreviewDnsZoneResponse & PreviewDnsZoneResponseNonNullableFields>;
|
|
2297
|
-
}
|
|
2298
|
-
|
|
2299
|
-
declare const createDnsZone: MaybeContext$2<BuildRESTFunction$2<typeof createDnsZone$1> & typeof createDnsZone$1>;
|
|
2300
|
-
declare const getDnsZone: MaybeContext$2<BuildRESTFunction$2<typeof getDnsZone$1> & typeof getDnsZone$1>;
|
|
2301
|
-
declare const updateDnsZone: MaybeContext$2<BuildRESTFunction$2<typeof updateDnsZone$1> & typeof updateDnsZone$1>;
|
|
2302
|
-
declare const deleteDnsZone: MaybeContext$2<BuildRESTFunction$2<typeof deleteDnsZone$1> & typeof deleteDnsZone$1>;
|
|
2303
|
-
declare const previewDnsZone: MaybeContext$2<BuildRESTFunction$2<typeof previewDnsZone$1> & typeof previewDnsZone$1>;
|
|
2304
|
-
|
|
2305
|
-
type context$2_ActionEvent = ActionEvent;
|
|
2306
|
-
type context$2_CreateDnsZoneRequest = CreateDnsZoneRequest;
|
|
2307
|
-
type context$2_CreateDnsZoneResponse = CreateDnsZoneResponse;
|
|
2308
|
-
type context$2_CreateDnsZoneResponseNonNullableFields = CreateDnsZoneResponseNonNullableFields;
|
|
2309
|
-
type context$2_DeleteDnsZoneRequest = DeleteDnsZoneRequest;
|
|
2310
|
-
type context$2_DeleteDnsZoneResponse = DeleteDnsZoneResponse;
|
|
2311
|
-
type context$2_DnsRecord = DnsRecord;
|
|
2312
|
-
type context$2_DnsRecordsChangedEvent = DnsRecordsChangedEvent;
|
|
2313
|
-
type context$2_DnsZone = DnsZone;
|
|
2314
|
-
type context$2_DnsZoneNonNullableFields = DnsZoneNonNullableFields;
|
|
2315
|
-
type context$2_DnssecInfo = DnssecInfo;
|
|
2316
|
-
type context$2_DomainEvent = DomainEvent;
|
|
2317
|
-
type context$2_DomainEventBodyOneOf = DomainEventBodyOneOf;
|
|
2318
|
-
type context$2_DomainRemovedEvent = DomainRemovedEvent;
|
|
2319
|
-
type context$2_EntityCreatedEvent = EntityCreatedEvent;
|
|
2320
|
-
type context$2_EntityDeletedEvent = EntityDeletedEvent;
|
|
2321
|
-
type context$2_EntityUpdatedEvent = EntityUpdatedEvent;
|
|
2322
|
-
type context$2_GetDnsZoneRequest = GetDnsZoneRequest;
|
|
2323
|
-
type context$2_GetDnsZoneResponse = GetDnsZoneResponse;
|
|
2324
|
-
type context$2_GetDnsZoneResponseNonNullableFields = GetDnsZoneResponseNonNullableFields;
|
|
2325
|
-
type context$2_IdentificationData = IdentificationData;
|
|
2326
|
-
type context$2_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
|
|
2327
|
-
type context$2_MessageEnvelope = MessageEnvelope;
|
|
2328
|
-
type context$2_PreviewDnsZoneRequest = PreviewDnsZoneRequest;
|
|
2329
|
-
type context$2_PreviewDnsZoneResponse = PreviewDnsZoneResponse;
|
|
2330
|
-
type context$2_PreviewDnsZoneResponseNonNullableFields = PreviewDnsZoneResponseNonNullableFields;
|
|
2331
|
-
type context$2_RecordType = RecordType;
|
|
2332
|
-
declare const context$2_RecordType: typeof RecordType;
|
|
2333
|
-
type context$2_RestoreInfo = RestoreInfo;
|
|
2334
|
-
type context$2_UpdateDnsZoneOptions = UpdateDnsZoneOptions;
|
|
2335
|
-
type context$2_UpdateDnsZoneRequest = UpdateDnsZoneRequest;
|
|
2336
|
-
type context$2_UpdateDnsZoneResponse = UpdateDnsZoneResponse;
|
|
2337
|
-
type context$2_UpdateDnsZoneResponseNonNullableFields = UpdateDnsZoneResponseNonNullableFields;
|
|
2338
|
-
type context$2_WebhookIdentityType = WebhookIdentityType;
|
|
2339
|
-
declare const context$2_WebhookIdentityType: typeof WebhookIdentityType;
|
|
2340
|
-
declare const context$2_createDnsZone: typeof createDnsZone;
|
|
2341
|
-
declare const context$2_deleteDnsZone: typeof deleteDnsZone;
|
|
2342
|
-
declare const context$2_getDnsZone: typeof getDnsZone;
|
|
2343
|
-
declare const context$2_previewDnsZone: typeof previewDnsZone;
|
|
2344
|
-
declare const context$2_updateDnsZone: typeof updateDnsZone;
|
|
2345
|
-
declare namespace context$2 {
|
|
2346
|
-
export { type context$2_ActionEvent as ActionEvent, type context$2_CreateDnsZoneRequest as CreateDnsZoneRequest, type context$2_CreateDnsZoneResponse as CreateDnsZoneResponse, type context$2_CreateDnsZoneResponseNonNullableFields as CreateDnsZoneResponseNonNullableFields, type context$2_DeleteDnsZoneRequest as DeleteDnsZoneRequest, type context$2_DeleteDnsZoneResponse as DeleteDnsZoneResponse, type context$2_DnsRecord as DnsRecord, type context$2_DnsRecordsChangedEvent as DnsRecordsChangedEvent, type context$2_DnsZone as DnsZone, type context$2_DnsZoneNonNullableFields as DnsZoneNonNullableFields, type context$2_DnssecInfo as DnssecInfo, type context$2_DomainEvent as DomainEvent, type context$2_DomainEventBodyOneOf as DomainEventBodyOneOf, type context$2_DomainRemovedEvent as DomainRemovedEvent, type context$2_EntityCreatedEvent as EntityCreatedEvent, type context$2_EntityDeletedEvent as EntityDeletedEvent, type context$2_EntityUpdatedEvent as EntityUpdatedEvent, type context$2_GetDnsZoneRequest as GetDnsZoneRequest, type context$2_GetDnsZoneResponse as GetDnsZoneResponse, type context$2_GetDnsZoneResponseNonNullableFields as GetDnsZoneResponseNonNullableFields, type context$2_IdentificationData as IdentificationData, type context$2_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type context$2_MessageEnvelope as MessageEnvelope, type context$2_PreviewDnsZoneRequest as PreviewDnsZoneRequest, type context$2_PreviewDnsZoneResponse as PreviewDnsZoneResponse, type context$2_PreviewDnsZoneResponseNonNullableFields as PreviewDnsZoneResponseNonNullableFields, context$2_RecordType as RecordType, type context$2_RestoreInfo as RestoreInfo, type context$2_UpdateDnsZoneOptions as UpdateDnsZoneOptions, type context$2_UpdateDnsZoneRequest as UpdateDnsZoneRequest, type context$2_UpdateDnsZoneResponse as UpdateDnsZoneResponse, type context$2_UpdateDnsZoneResponseNonNullableFields as UpdateDnsZoneResponseNonNullableFields, context$2_WebhookIdentityType as WebhookIdentityType, 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 };
|
|
2347
|
-
}
|
|
2348
|
-
|
|
2349
|
-
type HostModule$1<T, H extends Host$1> = {
|
|
2350
|
-
__type: 'host';
|
|
2351
|
-
create(host: H): T;
|
|
2352
|
-
};
|
|
2353
|
-
type HostModuleAPI$1<T extends HostModule$1<any, any>> = T extends HostModule$1<infer U, any> ? U : never;
|
|
2354
|
-
type Host$1<Environment = unknown> = {
|
|
2355
|
-
channel: {
|
|
2356
|
-
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
2357
|
-
disconnect: () => void;
|
|
2358
|
-
} | Promise<{
|
|
2359
|
-
disconnect: () => void;
|
|
2360
|
-
}>;
|
|
2361
|
-
};
|
|
2362
|
-
environment?: Environment;
|
|
2363
|
-
/**
|
|
2364
|
-
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
|
2365
|
-
*/
|
|
2366
|
-
apiBaseUrl?: string;
|
|
2367
|
-
/**
|
|
2368
|
-
* Possible data to be provided by every host, for cross cutting concerns
|
|
2369
|
-
* like internationalization, billing, etc.
|
|
2370
|
-
*/
|
|
2371
|
-
essentials?: {
|
|
2372
|
-
/**
|
|
2373
|
-
* The language of the currently viewed session
|
|
2374
|
-
*/
|
|
2375
|
-
language?: string;
|
|
2376
|
-
/**
|
|
2377
|
-
* The locale of the currently viewed session
|
|
2378
|
-
*/
|
|
2379
|
-
locale?: string;
|
|
2380
|
-
/**
|
|
2381
|
-
* Any headers that should be passed through to the API requests
|
|
2382
|
-
*/
|
|
2383
|
-
passThroughHeaders?: Record<string, string>;
|
|
2384
|
-
};
|
|
2385
|
-
};
|
|
2386
|
-
|
|
2387
|
-
type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
|
|
2388
|
-
interface HttpClient$1 {
|
|
2389
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
|
|
2390
|
-
fetchWithAuth: typeof fetch;
|
|
2391
|
-
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
2392
|
-
getActiveToken?: () => string | undefined;
|
|
2393
|
-
}
|
|
2394
|
-
type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
|
|
2395
|
-
type HttpResponse$1<T = any> = {
|
|
2396
|
-
data: T;
|
|
2397
|
-
status: number;
|
|
2398
|
-
statusText: string;
|
|
2399
|
-
headers: any;
|
|
2400
|
-
request?: any;
|
|
2401
|
-
};
|
|
2402
|
-
type RequestOptions$1<_TResponse = any, Data = any> = {
|
|
2403
|
-
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
2404
|
-
url: string;
|
|
2405
|
-
data?: Data;
|
|
2406
|
-
params?: URLSearchParams;
|
|
2407
|
-
} & APIMetadata$1;
|
|
2408
|
-
type APIMetadata$1 = {
|
|
2409
|
-
methodFqn?: string;
|
|
2410
|
-
entityFqdn?: string;
|
|
2411
|
-
packageName?: string;
|
|
2412
|
-
};
|
|
2413
|
-
type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
|
|
2414
|
-
type EventDefinition$1<Payload = unknown, Type extends string = string> = {
|
|
2415
|
-
__type: 'event-definition';
|
|
2416
|
-
type: Type;
|
|
2417
|
-
isDomainEvent?: boolean;
|
|
2418
|
-
transformations?: (envelope: unknown) => Payload;
|
|
2419
|
-
__payload: Payload;
|
|
2420
|
-
};
|
|
2421
|
-
declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
|
|
2422
|
-
type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
|
|
2423
|
-
type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
|
|
2424
|
-
|
|
2425
|
-
type ServicePluginMethodInput$1 = {
|
|
2426
|
-
request: any;
|
|
2427
|
-
metadata: any;
|
|
2428
|
-
};
|
|
2429
|
-
type ServicePluginContract$1 = Record<string, (payload: ServicePluginMethodInput$1) => unknown | Promise<unknown>>;
|
|
2430
|
-
type ServicePluginMethodMetadata$1 = {
|
|
2431
|
-
name: string;
|
|
2432
|
-
primaryHttpMappingPath: string;
|
|
2433
|
-
transformations: {
|
|
2434
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput$1;
|
|
2435
|
-
toREST: (...args: unknown[]) => unknown;
|
|
2436
|
-
};
|
|
2437
|
-
};
|
|
2438
|
-
type ServicePluginDefinition$1<Contract extends ServicePluginContract$1> = {
|
|
2439
|
-
__type: 'service-plugin-definition';
|
|
2440
|
-
componentType: string;
|
|
2441
|
-
methods: ServicePluginMethodMetadata$1[];
|
|
2442
|
-
__contract: Contract;
|
|
2443
|
-
};
|
|
2444
|
-
declare function ServicePluginDefinition$1<Contract extends ServicePluginContract$1>(componentType: string, methods: ServicePluginMethodMetadata$1[]): ServicePluginDefinition$1<Contract>;
|
|
2445
|
-
type BuildServicePluginDefinition$1<T extends ServicePluginDefinition$1<any>> = (implementation: T['__contract']) => void;
|
|
2446
|
-
declare const SERVICE_PLUGIN_ERROR_TYPE$1 = "wix_spi_error";
|
|
2447
|
-
|
|
2448
|
-
type RequestContext$1 = {
|
|
2449
|
-
isSSR: boolean;
|
|
2450
|
-
host: string;
|
|
2451
|
-
protocol?: string;
|
|
2452
|
-
};
|
|
2453
|
-
type ResponseTransformer$1 = (data: any, headers?: any) => any;
|
|
2454
|
-
/**
|
|
2455
|
-
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
2456
|
-
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
2457
|
-
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
2458
|
-
*/
|
|
2459
|
-
type Method$1 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
2460
|
-
type AmbassadorRequestOptions$1<T = any> = {
|
|
2461
|
-
_?: T;
|
|
2462
|
-
url?: string;
|
|
2463
|
-
method?: Method$1;
|
|
2464
|
-
params?: any;
|
|
2465
|
-
data?: any;
|
|
2466
|
-
transformResponse?: ResponseTransformer$1 | ResponseTransformer$1[];
|
|
2467
|
-
};
|
|
2468
|
-
type AmbassadorFactory$1<Request, Response> = (payload: Request) => ((context: RequestContext$1) => AmbassadorRequestOptions$1<Response>) & {
|
|
2469
|
-
__isAmbassador: boolean;
|
|
2470
|
-
};
|
|
2471
|
-
type AmbassadorFunctionDescriptor$1<Request = any, Response = any> = AmbassadorFactory$1<Request, Response>;
|
|
2472
|
-
type BuildAmbassadorFunction$1<T extends AmbassadorFunctionDescriptor$1> = T extends AmbassadorFunctionDescriptor$1<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
2473
|
-
|
|
2474
|
-
declare global {
|
|
2475
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
2476
|
-
interface SymbolConstructor {
|
|
2477
|
-
readonly observable: symbol;
|
|
2478
|
-
}
|
|
2479
|
-
}
|
|
2480
|
-
|
|
2481
|
-
declare const emptyObjectSymbol$1: unique symbol;
|
|
2482
|
-
|
|
2483
|
-
/**
|
|
2484
|
-
Represents a strictly empty plain object, the `{}` value.
|
|
2485
|
-
|
|
2486
|
-
When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)).
|
|
2487
|
-
|
|
2488
|
-
@example
|
|
2489
|
-
```
|
|
2490
|
-
import type {EmptyObject} from 'type-fest';
|
|
2491
|
-
|
|
2492
|
-
// The following illustrates the problem with `{}`.
|
|
2493
|
-
const foo1: {} = {}; // Pass
|
|
2494
|
-
const foo2: {} = []; // Pass
|
|
2495
|
-
const foo3: {} = 42; // Pass
|
|
2496
|
-
const foo4: {} = {a: 1}; // Pass
|
|
2497
|
-
|
|
2498
|
-
// With `EmptyObject` only the first case is valid.
|
|
2499
|
-
const bar1: EmptyObject = {}; // Pass
|
|
2500
|
-
const bar2: EmptyObject = 42; // Fail
|
|
2501
|
-
const bar3: EmptyObject = []; // Fail
|
|
2502
|
-
const bar4: EmptyObject = {a: 1}; // Fail
|
|
2503
|
-
```
|
|
2504
|
-
|
|
2505
|
-
Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
|
|
2506
|
-
|
|
2507
|
-
@category Object
|
|
2508
|
-
*/
|
|
2509
|
-
type EmptyObject$1 = {[emptyObjectSymbol$1]?: never};
|
|
2510
|
-
|
|
2511
|
-
/**
|
|
2512
|
-
Returns a boolean for whether the two given types are equal.
|
|
2513
|
-
|
|
2514
|
-
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
2515
|
-
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
2516
|
-
|
|
2517
|
-
Use-cases:
|
|
2518
|
-
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
2519
|
-
|
|
2520
|
-
@example
|
|
2521
|
-
```
|
|
2522
|
-
import type {IsEqual} from 'type-fest';
|
|
2523
|
-
|
|
2524
|
-
// This type returns a boolean for whether the given array includes the given item.
|
|
2525
|
-
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
2526
|
-
type Includes<Value extends readonly any[], Item> =
|
|
2527
|
-
Value extends readonly [Value[0], ...infer rest]
|
|
2528
|
-
? IsEqual<Value[0], Item> extends true
|
|
2529
|
-
? true
|
|
2530
|
-
: Includes<rest, Item>
|
|
2531
|
-
: false;
|
|
2532
|
-
```
|
|
2533
|
-
|
|
2534
|
-
@category Type Guard
|
|
2535
|
-
@category Utilities
|
|
2536
|
-
*/
|
|
2537
|
-
type IsEqual$1<A, B> =
|
|
2538
|
-
(<G>() => G extends A ? 1 : 2) extends
|
|
2539
|
-
(<G>() => G extends B ? 1 : 2)
|
|
2540
|
-
? true
|
|
2541
|
-
: false;
|
|
2542
|
-
|
|
2543
|
-
/**
|
|
2544
|
-
Filter out keys from an object.
|
|
2545
|
-
|
|
2546
|
-
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
2547
|
-
Returns `never` if `Key` extends `Exclude`.
|
|
2548
|
-
Returns `Key` otherwise.
|
|
2549
|
-
|
|
2550
|
-
@example
|
|
2551
|
-
```
|
|
2552
|
-
type Filtered = Filter<'foo', 'foo'>;
|
|
2553
|
-
//=> never
|
|
2554
|
-
```
|
|
2555
|
-
|
|
2556
|
-
@example
|
|
2557
|
-
```
|
|
2558
|
-
type Filtered = Filter<'bar', string>;
|
|
2559
|
-
//=> never
|
|
2560
|
-
```
|
|
2561
|
-
|
|
2562
|
-
@example
|
|
2563
|
-
```
|
|
2564
|
-
type Filtered = Filter<'bar', 'foo'>;
|
|
2565
|
-
//=> 'bar'
|
|
2566
|
-
```
|
|
2567
|
-
|
|
2568
|
-
@see {Except}
|
|
2569
|
-
*/
|
|
2570
|
-
type Filter$1<KeyType, ExcludeType> = IsEqual$1<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
2571
|
-
|
|
2572
|
-
type ExceptOptions$1 = {
|
|
2573
|
-
/**
|
|
2574
|
-
Disallow assigning non-specified properties.
|
|
2575
|
-
|
|
2576
|
-
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
2577
|
-
|
|
2578
|
-
@default false
|
|
2579
|
-
*/
|
|
2580
|
-
requireExactProps?: boolean;
|
|
2581
|
-
};
|
|
2582
|
-
|
|
2583
|
-
/**
|
|
2584
|
-
Create a type from an object type without certain keys.
|
|
2585
|
-
|
|
2586
|
-
We recommend setting the `requireExactProps` option to `true`.
|
|
2587
|
-
|
|
2588
|
-
This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
|
|
2589
|
-
|
|
2590
|
-
This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
|
|
2591
|
-
|
|
2592
|
-
@example
|
|
2593
|
-
```
|
|
2594
|
-
import type {Except} from 'type-fest';
|
|
2595
|
-
|
|
2596
|
-
type Foo = {
|
|
2597
|
-
a: number;
|
|
2598
|
-
b: string;
|
|
2599
|
-
};
|
|
2600
|
-
|
|
2601
|
-
type FooWithoutA = Except<Foo, 'a'>;
|
|
2602
|
-
//=> {b: string}
|
|
2603
|
-
|
|
2604
|
-
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
2605
|
-
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
2606
|
-
|
|
2607
|
-
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
2608
|
-
//=> {a: number} & Partial<Record<"b", never>>
|
|
2609
|
-
|
|
2610
|
-
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
2611
|
-
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
2612
|
-
```
|
|
2613
|
-
|
|
2614
|
-
@category Object
|
|
2615
|
-
*/
|
|
2616
|
-
type Except$1<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$1 = {requireExactProps: false}> = {
|
|
2617
|
-
[KeyType in keyof ObjectType as Filter$1<KeyType, KeysType>]: ObjectType[KeyType];
|
|
2618
|
-
} & (Options['requireExactProps'] extends true
|
|
2619
|
-
? Partial<Record<KeysType, never>>
|
|
2620
|
-
: {});
|
|
2621
|
-
|
|
2622
|
-
/**
|
|
2623
|
-
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
2624
|
-
|
|
2625
|
-
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
2626
|
-
|
|
2627
|
-
@example
|
|
2628
|
-
```
|
|
2629
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
2630
|
-
|
|
2631
|
-
interface Example {
|
|
2632
|
-
a: string;
|
|
2633
|
-
b: string | number;
|
|
2634
|
-
c?: string;
|
|
2635
|
-
d: {};
|
|
2636
|
-
}
|
|
2637
|
-
|
|
2638
|
-
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
2639
|
-
//=> 'a'
|
|
2640
|
-
```
|
|
2641
|
-
|
|
2642
|
-
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
2643
|
-
|
|
2644
|
-
@example
|
|
2645
|
-
```
|
|
2646
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
2647
|
-
|
|
2648
|
-
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
2649
|
-
//=> 'a' | 'c'
|
|
2650
|
-
```
|
|
2651
|
-
|
|
2652
|
-
@category Object
|
|
2653
|
-
*/
|
|
2654
|
-
type ConditionalKeys$1<Base, Condition> = NonNullable<
|
|
2655
|
-
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
|
2656
|
-
{
|
|
2657
|
-
// Map through all the keys of the given base type.
|
|
2658
|
-
[Key in keyof Base]:
|
|
2659
|
-
// Pick only keys with types extending the given `Condition` type.
|
|
2660
|
-
Base[Key] extends Condition
|
|
2661
|
-
// Retain this key since the condition passes.
|
|
2662
|
-
? Key
|
|
2663
|
-
// Discard this key since the condition fails.
|
|
2664
|
-
: never;
|
|
2665
|
-
|
|
2666
|
-
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
2667
|
-
}[keyof Base]
|
|
2668
|
-
>;
|
|
2669
|
-
|
|
2670
|
-
/**
|
|
2671
|
-
Exclude keys from a shape that matches the given `Condition`.
|
|
2672
|
-
|
|
2673
|
-
This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
|
|
2674
|
-
|
|
2675
|
-
@example
|
|
2676
|
-
```
|
|
2677
|
-
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
2678
|
-
|
|
2679
|
-
class Awesome {
|
|
2680
|
-
name: string;
|
|
2681
|
-
successes: number;
|
|
2682
|
-
failures: bigint;
|
|
2683
|
-
|
|
2684
|
-
run() {}
|
|
2685
|
-
}
|
|
2686
|
-
|
|
2687
|
-
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
2688
|
-
//=> {run: () => void}
|
|
2689
|
-
```
|
|
2690
|
-
|
|
2691
|
-
@example
|
|
2692
|
-
```
|
|
2693
|
-
import type {ConditionalExcept} from 'type-fest';
|
|
2694
|
-
|
|
2695
|
-
interface Example {
|
|
2696
|
-
a: string;
|
|
2697
|
-
b: string | number;
|
|
2698
|
-
c: () => void;
|
|
2699
|
-
d: {};
|
|
2700
|
-
}
|
|
2701
|
-
|
|
2702
|
-
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
2703
|
-
//=> {b: string | number; c: () => void; d: {}}
|
|
2704
|
-
```
|
|
2705
|
-
|
|
2706
|
-
@category Object
|
|
2707
|
-
*/
|
|
2708
|
-
type ConditionalExcept$1<Base, Condition> = Except$1<
|
|
2709
|
-
Base,
|
|
2710
|
-
ConditionalKeys$1<Base, Condition>
|
|
2711
|
-
>;
|
|
2712
|
-
|
|
2713
|
-
/**
|
|
2714
|
-
* Descriptors are objects that describe the API of a module, and the module
|
|
2715
|
-
* can either be a REST module or a host module.
|
|
2716
|
-
* This type is recursive, so it can describe nested modules.
|
|
2717
|
-
*/
|
|
2718
|
-
type Descriptors$1 = RESTFunctionDescriptor$1 | AmbassadorFunctionDescriptor$1 | HostModule$1<any, any> | EventDefinition$1<any> | ServicePluginDefinition$1<any> | {
|
|
2719
|
-
[key: string]: Descriptors$1 | PublicMetadata$1 | any;
|
|
2720
|
-
};
|
|
2721
|
-
/**
|
|
2722
|
-
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
2723
|
-
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
2724
|
-
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
2725
|
-
* do not match the given host (as they will not work with the given host).
|
|
2726
|
-
*/
|
|
2727
|
-
type BuildDescriptors$1<T extends Descriptors$1, H extends Host$1<any> | undefined, Depth extends number = 5> = {
|
|
2728
|
-
done: T;
|
|
2729
|
-
recurse: T extends {
|
|
2730
|
-
__type: typeof SERVICE_PLUGIN_ERROR_TYPE$1;
|
|
2731
|
-
} ? never : T extends AmbassadorFunctionDescriptor$1 ? BuildAmbassadorFunction$1<T> : T extends RESTFunctionDescriptor$1 ? BuildRESTFunction$1<T> : T extends EventDefinition$1<any> ? BuildEventDefinition$1<T> : T extends ServicePluginDefinition$1<any> ? BuildServicePluginDefinition$1<T> : T extends HostModule$1<any, any> ? HostModuleAPI$1<T> : ConditionalExcept$1<{
|
|
2732
|
-
[Key in keyof T]: T[Key] extends Descriptors$1 ? BuildDescriptors$1<T[Key], H, [
|
|
2733
|
-
-1,
|
|
2734
|
-
0,
|
|
2735
|
-
1,
|
|
2736
|
-
2,
|
|
2737
|
-
3,
|
|
2738
|
-
4,
|
|
2739
|
-
5
|
|
2740
|
-
][Depth]> : never;
|
|
2741
|
-
}, EmptyObject$1>;
|
|
2742
|
-
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
2743
|
-
type PublicMetadata$1 = {
|
|
2744
|
-
PACKAGE_NAME?: string;
|
|
2745
|
-
};
|
|
2746
|
-
|
|
2747
|
-
declare global {
|
|
2748
|
-
interface ContextualClient {
|
|
2749
|
-
}
|
|
2750
|
-
}
|
|
2751
|
-
/**
|
|
2752
|
-
* A type used to create concerete types from SDK descriptors in
|
|
2753
|
-
* case a contextual client is available.
|
|
2754
|
-
*/
|
|
2755
|
-
type MaybeContext$1<T extends Descriptors$1> = globalThis.ContextualClient extends {
|
|
2756
|
-
host: Host$1;
|
|
2757
|
-
} ? BuildDescriptors$1<T, globalThis.ContextualClient['host']> : T;
|
|
2758
|
-
|
|
2759
|
-
interface DomainAvailability {
|
|
2760
|
-
/** Domain name including TLD. For example, `my-new-domain.com`. */
|
|
2761
|
-
domain?: string;
|
|
2762
|
-
/**
|
|
2763
|
-
* Whether the domain is available for purchase. You can purchase the
|
|
2764
|
-
* domain in case the boolean is `true`. The domain is already taken
|
|
2765
|
-
* when `false` is returned.
|
|
2766
|
-
*/
|
|
2767
|
-
available?: boolean;
|
|
2768
|
-
/** Whether the domain has a higher price due to its perceived value or demand. */
|
|
2769
|
-
premium?: boolean;
|
|
2770
|
-
}
|
|
2771
|
-
interface CheckDomainAvailabilityRequest {
|
|
2772
|
-
/**
|
|
2773
|
-
* Domain name. Must include the TLD. For example, `my-new-domain.com`. Only
|
|
2774
|
-
* alphanumeric characters, hyphens, and dots are supported.
|
|
2775
|
-
*
|
|
2776
|
-
* Min: 3 characters
|
|
2777
|
-
* Max: 63 characters
|
|
2778
|
-
*/
|
|
2779
|
-
domain: string;
|
|
2780
|
-
}
|
|
2781
|
-
interface CheckDomainAvailabilityResponse {
|
|
2782
|
-
/** Information about the domain's availability. */
|
|
2783
|
-
availability?: DomainAvailability;
|
|
2784
|
-
}
|
|
2785
|
-
interface DomainAvailabilityNonNullableFields {
|
|
2786
|
-
domain: string;
|
|
2787
|
-
available: boolean;
|
|
2788
|
-
premium: boolean;
|
|
2789
|
-
}
|
|
2790
|
-
interface CheckDomainAvailabilityResponseNonNullableFields {
|
|
2791
|
-
availability?: DomainAvailabilityNonNullableFields;
|
|
2792
|
-
}
|
|
2793
|
-
|
|
2794
|
-
declare function checkDomainAvailability$1(httpClient: HttpClient$1): CheckDomainAvailabilitySignature;
|
|
2795
|
-
interface CheckDomainAvailabilitySignature {
|
|
2796
|
-
/**
|
|
2797
|
-
* Checks whether the given domain is available for purchase.
|
|
2798
|
-
*
|
|
2799
|
-
*
|
|
2800
|
-
* You can purchase the specified domain in case the returned
|
|
2801
|
-
* `availability.available` boolean is `true`. The domain is already taken
|
|
2802
|
-
* when `false` is returned.
|
|
2803
|
-
*
|
|
2804
|
-
* The `domain` field must include the TLD. For example, `my-new-domain.com`.
|
|
2805
|
-
*
|
|
2806
|
-
* > __Important:__ This call requires an account level API key and cannot be authenticated with the standard authorization header.
|
|
2807
|
-
* @param - Domain name. Must include the TLD. For example, `my-new-domain.com`. Only
|
|
2808
|
-
* alphanumeric characters, hyphens, and dots are supported.
|
|
2809
|
-
*
|
|
2810
|
-
* Min: 3 characters
|
|
2811
|
-
* Max: 63 characters
|
|
2812
|
-
*/
|
|
2813
|
-
(domain: string): Promise<CheckDomainAvailabilityResponse & CheckDomainAvailabilityResponseNonNullableFields>;
|
|
2814
|
-
}
|
|
2815
|
-
|
|
2816
|
-
declare const checkDomainAvailability: MaybeContext$1<BuildRESTFunction$1<typeof checkDomainAvailability$1> & typeof checkDomainAvailability$1>;
|
|
2817
|
-
|
|
2818
|
-
type context$1_CheckDomainAvailabilityRequest = CheckDomainAvailabilityRequest;
|
|
2819
|
-
type context$1_CheckDomainAvailabilityResponse = CheckDomainAvailabilityResponse;
|
|
2820
|
-
type context$1_CheckDomainAvailabilityResponseNonNullableFields = CheckDomainAvailabilityResponseNonNullableFields;
|
|
2821
|
-
type context$1_DomainAvailability = DomainAvailability;
|
|
2822
|
-
declare const context$1_checkDomainAvailability: typeof checkDomainAvailability;
|
|
2823
|
-
declare namespace context$1 {
|
|
2824
|
-
export { type context$1_CheckDomainAvailabilityRequest as CheckDomainAvailabilityRequest, type context$1_CheckDomainAvailabilityResponse as CheckDomainAvailabilityResponse, type context$1_CheckDomainAvailabilityResponseNonNullableFields as CheckDomainAvailabilityResponseNonNullableFields, type context$1_DomainAvailability as DomainAvailability, context$1_checkDomainAvailability as checkDomainAvailability };
|
|
2825
|
-
}
|
|
2826
|
-
|
|
2827
|
-
type HostModule<T, H extends Host> = {
|
|
2828
|
-
__type: 'host';
|
|
2829
|
-
create(host: H): T;
|
|
2830
|
-
};
|
|
2831
|
-
type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
|
|
2832
|
-
type Host<Environment = unknown> = {
|
|
2833
|
-
channel: {
|
|
2834
|
-
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
2835
|
-
disconnect: () => void;
|
|
2836
|
-
} | Promise<{
|
|
2837
|
-
disconnect: () => void;
|
|
2838
|
-
}>;
|
|
2839
|
-
};
|
|
2840
|
-
environment?: Environment;
|
|
2841
|
-
/**
|
|
2842
|
-
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
|
2843
|
-
*/
|
|
2844
|
-
apiBaseUrl?: string;
|
|
2845
|
-
/**
|
|
2846
|
-
* Possible data to be provided by every host, for cross cutting concerns
|
|
2847
|
-
* like internationalization, billing, etc.
|
|
2848
|
-
*/
|
|
2849
|
-
essentials?: {
|
|
2850
|
-
/**
|
|
2851
|
-
* The language of the currently viewed session
|
|
2852
|
-
*/
|
|
2853
|
-
language?: string;
|
|
2854
|
-
/**
|
|
2855
|
-
* The locale of the currently viewed session
|
|
2856
|
-
*/
|
|
2857
|
-
locale?: string;
|
|
2858
|
-
/**
|
|
2859
|
-
* Any headers that should be passed through to the API requests
|
|
2860
|
-
*/
|
|
2861
|
-
passThroughHeaders?: Record<string, string>;
|
|
2862
|
-
};
|
|
2863
|
-
};
|
|
2864
|
-
|
|
2865
|
-
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
2866
|
-
interface HttpClient {
|
|
2867
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
2868
|
-
fetchWithAuth: typeof fetch;
|
|
2869
|
-
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
2870
|
-
getActiveToken?: () => string | undefined;
|
|
2871
|
-
}
|
|
2872
|
-
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
2873
|
-
type HttpResponse<T = any> = {
|
|
2874
|
-
data: T;
|
|
2875
|
-
status: number;
|
|
2876
|
-
statusText: string;
|
|
2877
|
-
headers: any;
|
|
2878
|
-
request?: any;
|
|
2879
|
-
};
|
|
2880
|
-
type RequestOptions<_TResponse = any, Data = any> = {
|
|
2881
|
-
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
2882
|
-
url: string;
|
|
2883
|
-
data?: Data;
|
|
2884
|
-
params?: URLSearchParams;
|
|
2885
|
-
} & APIMetadata;
|
|
2886
|
-
type APIMetadata = {
|
|
2887
|
-
methodFqn?: string;
|
|
2888
|
-
entityFqdn?: string;
|
|
2889
|
-
packageName?: string;
|
|
2890
|
-
};
|
|
2891
|
-
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
2892
|
-
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
2893
|
-
__type: 'event-definition';
|
|
2894
|
-
type: Type;
|
|
2895
|
-
isDomainEvent?: boolean;
|
|
2896
|
-
transformations?: (envelope: unknown) => Payload;
|
|
2897
|
-
__payload: Payload;
|
|
2898
|
-
};
|
|
2899
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
2900
|
-
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
2901
|
-
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
2902
|
-
|
|
2903
|
-
type ServicePluginMethodInput = {
|
|
2904
|
-
request: any;
|
|
2905
|
-
metadata: any;
|
|
2906
|
-
};
|
|
2907
|
-
type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
|
|
2908
|
-
type ServicePluginMethodMetadata = {
|
|
2909
|
-
name: string;
|
|
2910
|
-
primaryHttpMappingPath: string;
|
|
2911
|
-
transformations: {
|
|
2912
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput;
|
|
2913
|
-
toREST: (...args: unknown[]) => unknown;
|
|
2914
|
-
};
|
|
2915
|
-
};
|
|
2916
|
-
type ServicePluginDefinition<Contract extends ServicePluginContract> = {
|
|
2917
|
-
__type: 'service-plugin-definition';
|
|
2918
|
-
componentType: string;
|
|
2919
|
-
methods: ServicePluginMethodMetadata[];
|
|
2920
|
-
__contract: Contract;
|
|
2921
|
-
};
|
|
2922
|
-
declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
|
|
2923
|
-
type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
|
|
2924
|
-
declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
|
|
2925
|
-
|
|
2926
|
-
type RequestContext = {
|
|
2927
|
-
isSSR: boolean;
|
|
2928
|
-
host: string;
|
|
2929
|
-
protocol?: string;
|
|
2930
|
-
};
|
|
2931
|
-
type ResponseTransformer = (data: any, headers?: any) => any;
|
|
2932
|
-
/**
|
|
2933
|
-
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
2934
|
-
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
2935
|
-
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
2936
|
-
*/
|
|
2937
|
-
type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
2938
|
-
type AmbassadorRequestOptions<T = any> = {
|
|
2939
|
-
_?: T;
|
|
2940
|
-
url?: string;
|
|
2941
|
-
method?: Method;
|
|
2942
|
-
params?: any;
|
|
2943
|
-
data?: any;
|
|
2944
|
-
transformResponse?: ResponseTransformer | ResponseTransformer[];
|
|
2945
|
-
};
|
|
2946
|
-
type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
|
|
2947
|
-
__isAmbassador: boolean;
|
|
2948
|
-
};
|
|
2949
|
-
type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
|
|
2950
|
-
type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
2951
|
-
|
|
2952
|
-
declare global {
|
|
2953
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
2954
|
-
interface SymbolConstructor {
|
|
2955
|
-
readonly observable: symbol;
|
|
2956
|
-
}
|
|
2957
|
-
}
|
|
2958
|
-
|
|
2959
|
-
declare const emptyObjectSymbol: unique symbol;
|
|
2960
|
-
|
|
2961
|
-
/**
|
|
2962
|
-
Represents a strictly empty plain object, the `{}` value.
|
|
2963
|
-
|
|
2964
|
-
When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)).
|
|
2965
|
-
|
|
2966
|
-
@example
|
|
2967
|
-
```
|
|
2968
|
-
import type {EmptyObject} from 'type-fest';
|
|
2969
|
-
|
|
2970
|
-
// The following illustrates the problem with `{}`.
|
|
2971
|
-
const foo1: {} = {}; // Pass
|
|
2972
|
-
const foo2: {} = []; // Pass
|
|
2973
|
-
const foo3: {} = 42; // Pass
|
|
2974
|
-
const foo4: {} = {a: 1}; // Pass
|
|
2975
|
-
|
|
2976
|
-
// With `EmptyObject` only the first case is valid.
|
|
2977
|
-
const bar1: EmptyObject = {}; // Pass
|
|
2978
|
-
const bar2: EmptyObject = 42; // Fail
|
|
2979
|
-
const bar3: EmptyObject = []; // Fail
|
|
2980
|
-
const bar4: EmptyObject = {a: 1}; // Fail
|
|
2981
|
-
```
|
|
2982
|
-
|
|
2983
|
-
Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
|
|
2984
|
-
|
|
2985
|
-
@category Object
|
|
2986
|
-
*/
|
|
2987
|
-
type EmptyObject = {[emptyObjectSymbol]?: never};
|
|
2988
|
-
|
|
2989
|
-
/**
|
|
2990
|
-
Returns a boolean for whether the two given types are equal.
|
|
2991
|
-
|
|
2992
|
-
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
2993
|
-
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
2994
|
-
|
|
2995
|
-
Use-cases:
|
|
2996
|
-
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
2997
|
-
|
|
2998
|
-
@example
|
|
2999
|
-
```
|
|
3000
|
-
import type {IsEqual} from 'type-fest';
|
|
3001
|
-
|
|
3002
|
-
// This type returns a boolean for whether the given array includes the given item.
|
|
3003
|
-
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
3004
|
-
type Includes<Value extends readonly any[], Item> =
|
|
3005
|
-
Value extends readonly [Value[0], ...infer rest]
|
|
3006
|
-
? IsEqual<Value[0], Item> extends true
|
|
3007
|
-
? true
|
|
3008
|
-
: Includes<rest, Item>
|
|
3009
|
-
: false;
|
|
3010
|
-
```
|
|
3011
|
-
|
|
3012
|
-
@category Type Guard
|
|
3013
|
-
@category Utilities
|
|
3014
|
-
*/
|
|
3015
|
-
type IsEqual<A, B> =
|
|
3016
|
-
(<G>() => G extends A ? 1 : 2) extends
|
|
3017
|
-
(<G>() => G extends B ? 1 : 2)
|
|
3018
|
-
? true
|
|
3019
|
-
: false;
|
|
3020
|
-
|
|
3021
|
-
/**
|
|
3022
|
-
Filter out keys from an object.
|
|
3023
|
-
|
|
3024
|
-
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
3025
|
-
Returns `never` if `Key` extends `Exclude`.
|
|
3026
|
-
Returns `Key` otherwise.
|
|
3027
|
-
|
|
3028
|
-
@example
|
|
3029
|
-
```
|
|
3030
|
-
type Filtered = Filter<'foo', 'foo'>;
|
|
3031
|
-
//=> never
|
|
3032
|
-
```
|
|
3033
|
-
|
|
3034
|
-
@example
|
|
3035
|
-
```
|
|
3036
|
-
type Filtered = Filter<'bar', string>;
|
|
3037
|
-
//=> never
|
|
3038
|
-
```
|
|
3039
|
-
|
|
3040
|
-
@example
|
|
3041
|
-
```
|
|
3042
|
-
type Filtered = Filter<'bar', 'foo'>;
|
|
3043
|
-
//=> 'bar'
|
|
3044
|
-
```
|
|
3045
|
-
|
|
3046
|
-
@see {Except}
|
|
3047
|
-
*/
|
|
3048
|
-
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
3049
|
-
|
|
3050
|
-
type ExceptOptions = {
|
|
3051
|
-
/**
|
|
3052
|
-
Disallow assigning non-specified properties.
|
|
3053
|
-
|
|
3054
|
-
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
3055
|
-
|
|
3056
|
-
@default false
|
|
3057
|
-
*/
|
|
3058
|
-
requireExactProps?: boolean;
|
|
3059
|
-
};
|
|
3060
|
-
|
|
3061
|
-
/**
|
|
3062
|
-
Create a type from an object type without certain keys.
|
|
3063
|
-
|
|
3064
|
-
We recommend setting the `requireExactProps` option to `true`.
|
|
3065
|
-
|
|
3066
|
-
This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
|
|
3067
|
-
|
|
3068
|
-
This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
|
|
3069
|
-
|
|
3070
|
-
@example
|
|
3071
|
-
```
|
|
3072
|
-
import type {Except} from 'type-fest';
|
|
3073
|
-
|
|
3074
|
-
type Foo = {
|
|
3075
|
-
a: number;
|
|
3076
|
-
b: string;
|
|
3077
|
-
};
|
|
3078
|
-
|
|
3079
|
-
type FooWithoutA = Except<Foo, 'a'>;
|
|
3080
|
-
//=> {b: string}
|
|
3081
|
-
|
|
3082
|
-
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
3083
|
-
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
3084
|
-
|
|
3085
|
-
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
3086
|
-
//=> {a: number} & Partial<Record<"b", never>>
|
|
3087
|
-
|
|
3088
|
-
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
3089
|
-
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
3090
|
-
```
|
|
3091
|
-
|
|
3092
|
-
@category Object
|
|
3093
|
-
*/
|
|
3094
|
-
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
|
|
3095
|
-
[KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
|
|
3096
|
-
} & (Options['requireExactProps'] extends true
|
|
3097
|
-
? Partial<Record<KeysType, never>>
|
|
3098
|
-
: {});
|
|
3099
|
-
|
|
3100
|
-
/**
|
|
3101
|
-
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
3102
|
-
|
|
3103
|
-
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
3104
|
-
|
|
3105
|
-
@example
|
|
3106
|
-
```
|
|
3107
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
3108
|
-
|
|
3109
|
-
interface Example {
|
|
3110
|
-
a: string;
|
|
3111
|
-
b: string | number;
|
|
3112
|
-
c?: string;
|
|
3113
|
-
d: {};
|
|
3114
|
-
}
|
|
3115
|
-
|
|
3116
|
-
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
3117
|
-
//=> 'a'
|
|
3118
|
-
```
|
|
3119
|
-
|
|
3120
|
-
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
3121
|
-
|
|
3122
|
-
@example
|
|
3123
|
-
```
|
|
3124
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
3125
|
-
|
|
3126
|
-
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
3127
|
-
//=> 'a' | 'c'
|
|
3128
|
-
```
|
|
3129
|
-
|
|
3130
|
-
@category Object
|
|
3131
|
-
*/
|
|
3132
|
-
type ConditionalKeys<Base, Condition> = NonNullable<
|
|
3133
|
-
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
|
3134
|
-
{
|
|
3135
|
-
// Map through all the keys of the given base type.
|
|
3136
|
-
[Key in keyof Base]:
|
|
3137
|
-
// Pick only keys with types extending the given `Condition` type.
|
|
3138
|
-
Base[Key] extends Condition
|
|
3139
|
-
// Retain this key since the condition passes.
|
|
3140
|
-
? Key
|
|
3141
|
-
// Discard this key since the condition fails.
|
|
3142
|
-
: never;
|
|
3143
|
-
|
|
3144
|
-
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
3145
|
-
}[keyof Base]
|
|
3146
|
-
>;
|
|
3147
|
-
|
|
3148
|
-
/**
|
|
3149
|
-
Exclude keys from a shape that matches the given `Condition`.
|
|
3150
|
-
|
|
3151
|
-
This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
|
|
3152
|
-
|
|
3153
|
-
@example
|
|
3154
|
-
```
|
|
3155
|
-
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
3156
|
-
|
|
3157
|
-
class Awesome {
|
|
3158
|
-
name: string;
|
|
3159
|
-
successes: number;
|
|
3160
|
-
failures: bigint;
|
|
3161
|
-
|
|
3162
|
-
run() {}
|
|
1449
|
+
additions?: DnsRecord[];
|
|
1450
|
+
/**
|
|
1451
|
+
* DNS records to remove from the DNS zone.
|
|
1452
|
+
*
|
|
1453
|
+
* Max: 10 deletions
|
|
1454
|
+
*/
|
|
1455
|
+
deletions?: DnsRecord[];
|
|
1456
|
+
/** Whether you want to enable or disable [DNS Security Extensions (DNSSEC)](https://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions). */
|
|
1457
|
+
dnssecEnabled?: boolean | null;
|
|
3163
1458
|
}
|
|
3164
1459
|
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
1460
|
+
declare function createDnsZone$1(httpClient: HttpClient): CreateDnsZoneSignature;
|
|
1461
|
+
interface CreateDnsZoneSignature {
|
|
1462
|
+
/**
|
|
1463
|
+
* Creates a DNS zone in [Google's Cloud DNS](https://cloud.google.com/dns).
|
|
1464
|
+
*
|
|
1465
|
+
*
|
|
1466
|
+
* If there is an existing DNS zone for the domain, it's deleted before
|
|
1467
|
+
* the new zone is created.
|
|
1468
|
+
*
|
|
1469
|
+
* The call is synchronous, that means it fails in case of an error on
|
|
1470
|
+
* Google's side.
|
|
1471
|
+
*
|
|
1472
|
+
* You can only set up a single `record` object per DNS record
|
|
1473
|
+
* type. If you want to specify multiple values for the same record type, you
|
|
1474
|
+
* must save them in the `values` for the relevant type.
|
|
1475
|
+
*
|
|
1476
|
+
* > __Important:__ This call requires an account level API key and cannot be authenticated with the standard authorization header.
|
|
1477
|
+
* @param - DNS zone to create.
|
|
1478
|
+
* @returns Created DNS zone.
|
|
1479
|
+
*/
|
|
1480
|
+
(dnsZone: DnsZone): Promise<DnsZone & DnsZoneNonNullableFields>;
|
|
1481
|
+
}
|
|
1482
|
+
declare function getDnsZone$1(httpClient: HttpClient): GetDnsZoneSignature;
|
|
1483
|
+
interface GetDnsZoneSignature {
|
|
1484
|
+
/**
|
|
1485
|
+
* Retrieves the DNS zone belonging to the domain from
|
|
1486
|
+
* [Google's Cloud DNS](https://cloud.google.com/dns).
|
|
1487
|
+
*
|
|
1488
|
+
*
|
|
1489
|
+
* > __Important:__ This call requires an account level API key and cannot be authenticated with the standard authorization header.
|
|
1490
|
+
* @param - Domain to retrieve the DNS zone for.
|
|
1491
|
+
* @returns Retrieved DNS zone.
|
|
1492
|
+
*/
|
|
1493
|
+
(domainName: string): Promise<DnsZone & DnsZoneNonNullableFields>;
|
|
1494
|
+
}
|
|
1495
|
+
declare function updateDnsZone$1(httpClient: HttpClient): UpdateDnsZoneSignature;
|
|
1496
|
+
interface UpdateDnsZoneSignature {
|
|
1497
|
+
/**
|
|
1498
|
+
* Adds DNS records to and removes DNS records from a DNS zone in
|
|
1499
|
+
* [Google's Cloud DNS](https://cloud.google.com/dns).
|
|
1500
|
+
*
|
|
1501
|
+
* The call is synchronous, that means it fails in case of an error on
|
|
1502
|
+
* Google's side.
|
|
1503
|
+
*
|
|
1504
|
+
* You can only set up a single `record` object per DNS record
|
|
1505
|
+
* type. If you want to specify multiple values for the same record type, you
|
|
1506
|
+
* must save them in the `values` for the relevant type. This means, you must
|
|
1507
|
+
* delete the relevant record and add a new `addition` object for this type
|
|
1508
|
+
* to the request, in case you want to add values for an existing DNS record
|
|
1509
|
+
* type.
|
|
1510
|
+
*
|
|
1511
|
+
* > __Important:__ This call requires an account level API key and cannot be authenticated with the standard authorization header.
|
|
1512
|
+
* @param - Domain to update the DNS zone for. Must include the TLD.
|
|
1513
|
+
*/
|
|
1514
|
+
(domainName: string, options?: UpdateDnsZoneOptions | undefined): Promise<UpdateDnsZoneResponse & UpdateDnsZoneResponseNonNullableFields>;
|
|
1515
|
+
}
|
|
1516
|
+
declare function deleteDnsZone$1(httpClient: HttpClient): DeleteDnsZoneSignature;
|
|
1517
|
+
interface DeleteDnsZoneSignature {
|
|
1518
|
+
/**
|
|
1519
|
+
* Deletes a DNS zone in [Google's Cloud DNS](https://cloud.google.com/dns).
|
|
1520
|
+
*
|
|
1521
|
+
*
|
|
1522
|
+
* The call is synchronous, that means it fails in case of an error on
|
|
1523
|
+
* Google's side.
|
|
1524
|
+
*
|
|
1525
|
+
* > __Important:__ This call requires an account level API key and cannot be authenticated with the standard authorization header.
|
|
1526
|
+
* @param - Domain name to delete the DNS zone for.
|
|
1527
|
+
*/
|
|
1528
|
+
(domainName: string): Promise<void>;
|
|
1529
|
+
}
|
|
1530
|
+
declare function previewDnsZone$1(httpClient: HttpClient): PreviewDnsZoneSignature;
|
|
1531
|
+
interface PreviewDnsZoneSignature {
|
|
1532
|
+
/**
|
|
1533
|
+
* Generates a preview for a DNS zone based on
|
|
1534
|
+
* [Google's Cloud DNS](https://cloud.google.com/dns).
|
|
1535
|
+
*
|
|
1536
|
+
*
|
|
1537
|
+
* This includes calculating the `A`, `CNAME`, `NS` and `SOA` records.
|
|
1538
|
+
* You can use this information to configure a domain from an external
|
|
1539
|
+
* provider, before connecting it to a Wix site.
|
|
1540
|
+
*
|
|
1541
|
+
* > __Important:__ This call requires an account level API key and cannot be authenticated with the standard authorization header.
|
|
1542
|
+
* @param - Domain name to generate a DNS zone preview for.
|
|
1543
|
+
*/
|
|
1544
|
+
(domainName: string): Promise<PreviewDnsZoneResponse & PreviewDnsZoneResponseNonNullableFields>;
|
|
1545
|
+
}
|
|
3168
1546
|
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
1547
|
+
declare const createDnsZone: MaybeContext<BuildRESTFunction<typeof createDnsZone$1> & typeof createDnsZone$1>;
|
|
1548
|
+
declare const getDnsZone: MaybeContext<BuildRESTFunction<typeof getDnsZone$1> & typeof getDnsZone$1>;
|
|
1549
|
+
declare const updateDnsZone: MaybeContext<BuildRESTFunction<typeof updateDnsZone$1> & typeof updateDnsZone$1>;
|
|
1550
|
+
declare const deleteDnsZone: MaybeContext<BuildRESTFunction<typeof deleteDnsZone$1> & typeof deleteDnsZone$1>;
|
|
1551
|
+
declare const previewDnsZone: MaybeContext<BuildRESTFunction<typeof previewDnsZone$1> & typeof previewDnsZone$1>;
|
|
3172
1552
|
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
1553
|
+
type context$2_ActionEvent = ActionEvent;
|
|
1554
|
+
type context$2_CreateDnsZoneRequest = CreateDnsZoneRequest;
|
|
1555
|
+
type context$2_CreateDnsZoneResponse = CreateDnsZoneResponse;
|
|
1556
|
+
type context$2_CreateDnsZoneResponseNonNullableFields = CreateDnsZoneResponseNonNullableFields;
|
|
1557
|
+
type context$2_DeleteDnsZoneRequest = DeleteDnsZoneRequest;
|
|
1558
|
+
type context$2_DeleteDnsZoneResponse = DeleteDnsZoneResponse;
|
|
1559
|
+
type context$2_DnsRecord = DnsRecord;
|
|
1560
|
+
type context$2_DnsRecordsChangedEvent = DnsRecordsChangedEvent;
|
|
1561
|
+
type context$2_DnsZone = DnsZone;
|
|
1562
|
+
type context$2_DnsZoneNonNullableFields = DnsZoneNonNullableFields;
|
|
1563
|
+
type context$2_DnssecInfo = DnssecInfo;
|
|
1564
|
+
type context$2_DomainEvent = DomainEvent;
|
|
1565
|
+
type context$2_DomainEventBodyOneOf = DomainEventBodyOneOf;
|
|
1566
|
+
type context$2_DomainRemovedEvent = DomainRemovedEvent;
|
|
1567
|
+
type context$2_EntityCreatedEvent = EntityCreatedEvent;
|
|
1568
|
+
type context$2_EntityDeletedEvent = EntityDeletedEvent;
|
|
1569
|
+
type context$2_EntityUpdatedEvent = EntityUpdatedEvent;
|
|
1570
|
+
type context$2_GetDnsZoneRequest = GetDnsZoneRequest;
|
|
1571
|
+
type context$2_GetDnsZoneResponse = GetDnsZoneResponse;
|
|
1572
|
+
type context$2_GetDnsZoneResponseNonNullableFields = GetDnsZoneResponseNonNullableFields;
|
|
1573
|
+
type context$2_IdentificationData = IdentificationData;
|
|
1574
|
+
type context$2_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
|
|
1575
|
+
type context$2_MessageEnvelope = MessageEnvelope;
|
|
1576
|
+
type context$2_PreviewDnsZoneRequest = PreviewDnsZoneRequest;
|
|
1577
|
+
type context$2_PreviewDnsZoneResponse = PreviewDnsZoneResponse;
|
|
1578
|
+
type context$2_PreviewDnsZoneResponseNonNullableFields = PreviewDnsZoneResponseNonNullableFields;
|
|
1579
|
+
type context$2_RecordType = RecordType;
|
|
1580
|
+
declare const context$2_RecordType: typeof RecordType;
|
|
1581
|
+
type context$2_RestoreInfo = RestoreInfo;
|
|
1582
|
+
type context$2_UpdateDnsZoneOptions = UpdateDnsZoneOptions;
|
|
1583
|
+
type context$2_UpdateDnsZoneRequest = UpdateDnsZoneRequest;
|
|
1584
|
+
type context$2_UpdateDnsZoneResponse = UpdateDnsZoneResponse;
|
|
1585
|
+
type context$2_UpdateDnsZoneResponseNonNullableFields = UpdateDnsZoneResponseNonNullableFields;
|
|
1586
|
+
type context$2_WebhookIdentityType = WebhookIdentityType;
|
|
1587
|
+
declare const context$2_WebhookIdentityType: typeof WebhookIdentityType;
|
|
1588
|
+
declare const context$2_createDnsZone: typeof createDnsZone;
|
|
1589
|
+
declare const context$2_deleteDnsZone: typeof deleteDnsZone;
|
|
1590
|
+
declare const context$2_getDnsZone: typeof getDnsZone;
|
|
1591
|
+
declare const context$2_previewDnsZone: typeof previewDnsZone;
|
|
1592
|
+
declare const context$2_updateDnsZone: typeof updateDnsZone;
|
|
1593
|
+
declare namespace context$2 {
|
|
1594
|
+
export { type context$2_ActionEvent as ActionEvent, type context$2_CreateDnsZoneRequest as CreateDnsZoneRequest, type context$2_CreateDnsZoneResponse as CreateDnsZoneResponse, type context$2_CreateDnsZoneResponseNonNullableFields as CreateDnsZoneResponseNonNullableFields, type context$2_DeleteDnsZoneRequest as DeleteDnsZoneRequest, type context$2_DeleteDnsZoneResponse as DeleteDnsZoneResponse, type context$2_DnsRecord as DnsRecord, type context$2_DnsRecordsChangedEvent as DnsRecordsChangedEvent, type context$2_DnsZone as DnsZone, type context$2_DnsZoneNonNullableFields as DnsZoneNonNullableFields, type context$2_DnssecInfo as DnssecInfo, type context$2_DomainEvent as DomainEvent, type context$2_DomainEventBodyOneOf as DomainEventBodyOneOf, type context$2_DomainRemovedEvent as DomainRemovedEvent, type context$2_EntityCreatedEvent as EntityCreatedEvent, type context$2_EntityDeletedEvent as EntityDeletedEvent, type context$2_EntityUpdatedEvent as EntityUpdatedEvent, type context$2_GetDnsZoneRequest as GetDnsZoneRequest, type context$2_GetDnsZoneResponse as GetDnsZoneResponse, type context$2_GetDnsZoneResponseNonNullableFields as GetDnsZoneResponseNonNullableFields, type context$2_IdentificationData as IdentificationData, type context$2_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type context$2_MessageEnvelope as MessageEnvelope, type context$2_PreviewDnsZoneRequest as PreviewDnsZoneRequest, type context$2_PreviewDnsZoneResponse as PreviewDnsZoneResponse, type context$2_PreviewDnsZoneResponseNonNullableFields as PreviewDnsZoneResponseNonNullableFields, context$2_RecordType as RecordType, type context$2_RestoreInfo as RestoreInfo, type context$2_UpdateDnsZoneOptions as UpdateDnsZoneOptions, type context$2_UpdateDnsZoneRequest as UpdateDnsZoneRequest, type context$2_UpdateDnsZoneResponse as UpdateDnsZoneResponse, type context$2_UpdateDnsZoneResponseNonNullableFields as UpdateDnsZoneResponseNonNullableFields, context$2_WebhookIdentityType as WebhookIdentityType, 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 };
|
|
3178
1595
|
}
|
|
3179
1596
|
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
1597
|
+
interface DomainAvailability {
|
|
1598
|
+
/** Domain name including TLD. For example, `my-new-domain.com`. */
|
|
1599
|
+
domain?: string;
|
|
1600
|
+
/**
|
|
1601
|
+
* Whether the domain is available for purchase. You can purchase the
|
|
1602
|
+
* domain in case the boolean is `true`. The domain is already taken
|
|
1603
|
+
* when `false` is returned.
|
|
1604
|
+
*/
|
|
1605
|
+
available?: boolean;
|
|
1606
|
+
/** Whether the domain has a higher price due to its perceived value or demand. */
|
|
1607
|
+
premium?: boolean;
|
|
1608
|
+
}
|
|
1609
|
+
interface CheckDomainAvailabilityRequest {
|
|
1610
|
+
/**
|
|
1611
|
+
* Domain name. Must include the TLD. For example, `my-new-domain.com`. Only
|
|
1612
|
+
* alphanumeric characters, hyphens, and dots are supported.
|
|
1613
|
+
*
|
|
1614
|
+
* Min: 3 characters
|
|
1615
|
+
* Max: 63 characters
|
|
1616
|
+
*/
|
|
1617
|
+
domain: string;
|
|
1618
|
+
}
|
|
1619
|
+
interface CheckDomainAvailabilityResponse {
|
|
1620
|
+
/** Information about the domain's availability. */
|
|
1621
|
+
availability?: DomainAvailability;
|
|
1622
|
+
}
|
|
1623
|
+
interface DomainAvailabilityNonNullableFields {
|
|
1624
|
+
domain: string;
|
|
1625
|
+
available: boolean;
|
|
1626
|
+
premium: boolean;
|
|
1627
|
+
}
|
|
1628
|
+
interface CheckDomainAvailabilityResponseNonNullableFields {
|
|
1629
|
+
availability?: DomainAvailabilityNonNullableFields;
|
|
1630
|
+
}
|
|
3183
1631
|
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
1632
|
+
declare function checkDomainAvailability$1(httpClient: HttpClient): CheckDomainAvailabilitySignature;
|
|
1633
|
+
interface CheckDomainAvailabilitySignature {
|
|
1634
|
+
/**
|
|
1635
|
+
* Checks whether the given domain is available for purchase.
|
|
1636
|
+
*
|
|
1637
|
+
*
|
|
1638
|
+
* You can purchase the specified domain in case the returned
|
|
1639
|
+
* `availability.available` boolean is `true`. The domain is already taken
|
|
1640
|
+
* when `false` is returned.
|
|
1641
|
+
*
|
|
1642
|
+
* The `domain` field must include the TLD. For example, `my-new-domain.com`.
|
|
1643
|
+
*
|
|
1644
|
+
* > __Important:__ This call requires an account level API key and cannot be authenticated with the standard authorization header.
|
|
1645
|
+
* @param - Domain name. Must include the TLD. For example, `my-new-domain.com`. Only
|
|
1646
|
+
* alphanumeric characters, hyphens, and dots are supported.
|
|
1647
|
+
*
|
|
1648
|
+
* Min: 3 characters
|
|
1649
|
+
* Max: 63 characters
|
|
1650
|
+
*/
|
|
1651
|
+
(domain: string): Promise<CheckDomainAvailabilityResponse & CheckDomainAvailabilityResponseNonNullableFields>;
|
|
1652
|
+
}
|
|
3190
1653
|
|
|
3191
|
-
|
|
3192
|
-
* Descriptors are objects that describe the API of a module, and the module
|
|
3193
|
-
* can either be a REST module or a host module.
|
|
3194
|
-
* This type is recursive, so it can describe nested modules.
|
|
3195
|
-
*/
|
|
3196
|
-
type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
|
|
3197
|
-
[key: string]: Descriptors | PublicMetadata | any;
|
|
3198
|
-
};
|
|
3199
|
-
/**
|
|
3200
|
-
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
3201
|
-
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
3202
|
-
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
3203
|
-
* do not match the given host (as they will not work with the given host).
|
|
3204
|
-
*/
|
|
3205
|
-
type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
|
|
3206
|
-
done: T;
|
|
3207
|
-
recurse: T extends {
|
|
3208
|
-
__type: typeof SERVICE_PLUGIN_ERROR_TYPE;
|
|
3209
|
-
} ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition<any> ? BuildEventDefinition<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
|
|
3210
|
-
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
|
|
3211
|
-
-1,
|
|
3212
|
-
0,
|
|
3213
|
-
1,
|
|
3214
|
-
2,
|
|
3215
|
-
3,
|
|
3216
|
-
4,
|
|
3217
|
-
5
|
|
3218
|
-
][Depth]> : never;
|
|
3219
|
-
}, EmptyObject>;
|
|
3220
|
-
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
3221
|
-
type PublicMetadata = {
|
|
3222
|
-
PACKAGE_NAME?: string;
|
|
3223
|
-
};
|
|
1654
|
+
declare const checkDomainAvailability: MaybeContext<BuildRESTFunction<typeof checkDomainAvailability$1> & typeof checkDomainAvailability$1>;
|
|
3224
1655
|
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
1656
|
+
type context$1_CheckDomainAvailabilityRequest = CheckDomainAvailabilityRequest;
|
|
1657
|
+
type context$1_CheckDomainAvailabilityResponse = CheckDomainAvailabilityResponse;
|
|
1658
|
+
type context$1_CheckDomainAvailabilityResponseNonNullableFields = CheckDomainAvailabilityResponseNonNullableFields;
|
|
1659
|
+
type context$1_DomainAvailability = DomainAvailability;
|
|
1660
|
+
declare const context$1_checkDomainAvailability: typeof checkDomainAvailability;
|
|
1661
|
+
declare namespace context$1 {
|
|
1662
|
+
export { type context$1_CheckDomainAvailabilityRequest as CheckDomainAvailabilityRequest, type context$1_CheckDomainAvailabilityResponse as CheckDomainAvailabilityResponse, type context$1_CheckDomainAvailabilityResponseNonNullableFields as CheckDomainAvailabilityResponseNonNullableFields, type context$1_DomainAvailability as DomainAvailability, context$1_checkDomainAvailability as checkDomainAvailability };
|
|
3228
1663
|
}
|
|
3229
|
-
/**
|
|
3230
|
-
* A type used to create concerete types from SDK descriptors in
|
|
3231
|
-
* case a contextual client is available.
|
|
3232
|
-
*/
|
|
3233
|
-
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
3234
|
-
host: Host;
|
|
3235
|
-
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
3236
1664
|
|
|
3237
1665
|
interface DomainSuggestion {
|
|
3238
1666
|
/** Suggested domain name including TLD. */
|