@wix/domains 1.0.36 → 1.0.38
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/build/cjs/context.d.ts +0 -1
- package/build/cjs/context.js +1 -2
- package/build/cjs/context.js.map +1 -1
- package/build/cjs/index.d.ts +1 -2
- package/build/cjs/index.js +1 -3
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/meta.d.ts +0 -1
- package/build/cjs/meta.js +1 -2
- package/build/cjs/meta.js.map +1 -1
- package/build/es/context.d.ts +0 -1
- package/build/es/context.js +0 -1
- package/build/es/context.js.map +1 -1
- package/build/es/index.d.ts +1 -2
- package/build/es/index.js +1 -2
- package/build/es/index.js.map +1 -1
- package/build/es/meta.d.ts +0 -1
- package/build/es/meta.js +0 -1
- package/build/es/meta.js.map +1 -1
- package/package.json +3 -4
- package/type-bundles/context.bundle.d.ts +1986 -1117
- package/type-bundles/index.bundle.d.ts +1986 -1117
- package/type-bundles/meta.bundle.d.ts +73 -1160
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
type HostModule<T, H extends Host> = {
|
|
1
|
+
type HostModule$4<T, H extends Host$4> = {
|
|
2
2
|
__type: 'host';
|
|
3
3
|
create(host: H): T;
|
|
4
4
|
};
|
|
5
|
-
type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
|
|
6
|
-
type Host<Environment = unknown> = {
|
|
5
|
+
type HostModuleAPI$4<T extends HostModule$4<any, any>> = T extends HostModule$4<infer U, any> ? U : never;
|
|
6
|
+
type Host$4<Environment = unknown> = {
|
|
7
7
|
channel: {
|
|
8
8
|
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
9
9
|
disconnect: () => void;
|
|
@@ -36,92 +36,92 @@ type Host<Environment = unknown> = {
|
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
40
|
-
interface HttpClient {
|
|
41
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
39
|
+
type RESTFunctionDescriptor$4<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$4) => T;
|
|
40
|
+
interface HttpClient$4 {
|
|
41
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$4<TResponse, TData>): Promise<HttpResponse$4<TResponse>>;
|
|
42
42
|
fetchWithAuth: typeof fetch;
|
|
43
43
|
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
44
44
|
getActiveToken?: () => string | undefined;
|
|
45
45
|
}
|
|
46
|
-
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
47
|
-
type HttpResponse<T = any> = {
|
|
46
|
+
type RequestOptionsFactory$4<TResponse = any, TData = any> = (context: any) => RequestOptions$4<TResponse, TData>;
|
|
47
|
+
type HttpResponse$4<T = any> = {
|
|
48
48
|
data: T;
|
|
49
49
|
status: number;
|
|
50
50
|
statusText: string;
|
|
51
51
|
headers: any;
|
|
52
52
|
request?: any;
|
|
53
53
|
};
|
|
54
|
-
type RequestOptions<_TResponse = any, Data = any> = {
|
|
54
|
+
type RequestOptions$4<_TResponse = any, Data = any> = {
|
|
55
55
|
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
56
56
|
url: string;
|
|
57
57
|
data?: Data;
|
|
58
58
|
params?: URLSearchParams;
|
|
59
|
-
} & APIMetadata;
|
|
60
|
-
type APIMetadata = {
|
|
59
|
+
} & APIMetadata$4;
|
|
60
|
+
type APIMetadata$4 = {
|
|
61
61
|
methodFqn?: string;
|
|
62
62
|
entityFqdn?: string;
|
|
63
63
|
packageName?: string;
|
|
64
64
|
};
|
|
65
|
-
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
66
|
-
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
65
|
+
type BuildRESTFunction$4<T extends RESTFunctionDescriptor$4> = T extends RESTFunctionDescriptor$4<infer U> ? U : never;
|
|
66
|
+
type EventDefinition$4<Payload = unknown, Type extends string = string> = {
|
|
67
67
|
__type: 'event-definition';
|
|
68
68
|
type: Type;
|
|
69
69
|
isDomainEvent?: boolean;
|
|
70
70
|
transformations?: (envelope: unknown) => Payload;
|
|
71
71
|
__payload: Payload;
|
|
72
72
|
};
|
|
73
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
74
|
-
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
75
|
-
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
73
|
+
declare function EventDefinition$4<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$4<Payload, Type>;
|
|
74
|
+
type EventHandler$4<T extends EventDefinition$4> = (payload: T['__payload']) => void | Promise<void>;
|
|
75
|
+
type BuildEventDefinition$4<T extends EventDefinition$4<any, string>> = (handler: EventHandler$4<T>) => void;
|
|
76
76
|
|
|
77
|
-
type ServicePluginMethodInput = {
|
|
77
|
+
type ServicePluginMethodInput$4 = {
|
|
78
78
|
request: any;
|
|
79
79
|
metadata: any;
|
|
80
80
|
};
|
|
81
|
-
type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
|
|
82
|
-
type ServicePluginMethodMetadata = {
|
|
81
|
+
type ServicePluginContract$4 = Record<string, (payload: ServicePluginMethodInput$4) => unknown | Promise<unknown>>;
|
|
82
|
+
type ServicePluginMethodMetadata$4 = {
|
|
83
83
|
name: string;
|
|
84
84
|
primaryHttpMappingPath: string;
|
|
85
85
|
transformations: {
|
|
86
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput;
|
|
86
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput$4;
|
|
87
87
|
toREST: (...args: unknown[]) => unknown;
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
|
-
type ServicePluginDefinition<Contract extends ServicePluginContract> = {
|
|
90
|
+
type ServicePluginDefinition$4<Contract extends ServicePluginContract$4> = {
|
|
91
91
|
__type: 'service-plugin-definition';
|
|
92
92
|
componentType: string;
|
|
93
|
-
methods: ServicePluginMethodMetadata[];
|
|
93
|
+
methods: ServicePluginMethodMetadata$4[];
|
|
94
94
|
__contract: Contract;
|
|
95
95
|
};
|
|
96
|
-
declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
|
|
97
|
-
type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
|
|
98
|
-
declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
|
|
96
|
+
declare function ServicePluginDefinition$4<Contract extends ServicePluginContract$4>(componentType: string, methods: ServicePluginMethodMetadata$4[]): ServicePluginDefinition$4<Contract>;
|
|
97
|
+
type BuildServicePluginDefinition$4<T extends ServicePluginDefinition$4<any>> = (implementation: T['__contract']) => void;
|
|
98
|
+
declare const SERVICE_PLUGIN_ERROR_TYPE$4 = "wix_spi_error";
|
|
99
99
|
|
|
100
|
-
type RequestContext = {
|
|
100
|
+
type RequestContext$4 = {
|
|
101
101
|
isSSR: boolean;
|
|
102
102
|
host: string;
|
|
103
103
|
protocol?: string;
|
|
104
104
|
};
|
|
105
|
-
type ResponseTransformer = (data: any, headers?: any) => any;
|
|
105
|
+
type ResponseTransformer$4 = (data: any, headers?: any) => any;
|
|
106
106
|
/**
|
|
107
107
|
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
108
108
|
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
109
109
|
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
110
110
|
*/
|
|
111
|
-
type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
112
|
-
type AmbassadorRequestOptions<T = any> = {
|
|
111
|
+
type Method$4 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
112
|
+
type AmbassadorRequestOptions$4<T = any> = {
|
|
113
113
|
_?: T;
|
|
114
114
|
url?: string;
|
|
115
|
-
method?: Method;
|
|
115
|
+
method?: Method$4;
|
|
116
116
|
params?: any;
|
|
117
117
|
data?: any;
|
|
118
|
-
transformResponse?: ResponseTransformer | ResponseTransformer[];
|
|
118
|
+
transformResponse?: ResponseTransformer$4 | ResponseTransformer$4[];
|
|
119
119
|
};
|
|
120
|
-
type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
|
|
120
|
+
type AmbassadorFactory$4<Request, Response> = (payload: Request) => ((context: RequestContext$4) => AmbassadorRequestOptions$4<Response>) & {
|
|
121
121
|
__isAmbassador: boolean;
|
|
122
122
|
};
|
|
123
|
-
type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
|
|
124
|
-
type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
123
|
+
type AmbassadorFunctionDescriptor$4<Request = any, Response = any> = AmbassadorFactory$4<Request, Response>;
|
|
124
|
+
type BuildAmbassadorFunction$4<T extends AmbassadorFunctionDescriptor$4> = T extends AmbassadorFunctionDescriptor$4<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
125
125
|
|
|
126
126
|
declare global {
|
|
127
127
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
@@ -130,7 +130,7 @@ declare global {
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
declare const emptyObjectSymbol: unique symbol;
|
|
133
|
+
declare const emptyObjectSymbol$4: unique symbol;
|
|
134
134
|
|
|
135
135
|
/**
|
|
136
136
|
Represents a strictly empty plain object, the `{}` value.
|
|
@@ -158,7 +158,7 @@ Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<n
|
|
|
158
158
|
|
|
159
159
|
@category Object
|
|
160
160
|
*/
|
|
161
|
-
type EmptyObject = {[emptyObjectSymbol]?: never};
|
|
161
|
+
type EmptyObject$4 = {[emptyObjectSymbol$4]?: never};
|
|
162
162
|
|
|
163
163
|
/**
|
|
164
164
|
Returns a boolean for whether the two given types are equal.
|
|
@@ -186,7 +186,7 @@ type Includes<Value extends readonly any[], Item> =
|
|
|
186
186
|
@category Type Guard
|
|
187
187
|
@category Utilities
|
|
188
188
|
*/
|
|
189
|
-
type IsEqual<A, B> =
|
|
189
|
+
type IsEqual$4<A, B> =
|
|
190
190
|
(<G>() => G extends A ? 1 : 2) extends
|
|
191
191
|
(<G>() => G extends B ? 1 : 2)
|
|
192
192
|
? true
|
|
@@ -219,9 +219,9 @@ type Filtered = Filter<'bar', 'foo'>;
|
|
|
219
219
|
|
|
220
220
|
@see {Except}
|
|
221
221
|
*/
|
|
222
|
-
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
222
|
+
type Filter$4<KeyType, ExcludeType> = IsEqual$4<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
223
223
|
|
|
224
|
-
type ExceptOptions = {
|
|
224
|
+
type ExceptOptions$4 = {
|
|
225
225
|
/**
|
|
226
226
|
Disallow assigning non-specified properties.
|
|
227
227
|
|
|
@@ -265,8 +265,8 @@ const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
|
265
265
|
|
|
266
266
|
@category Object
|
|
267
267
|
*/
|
|
268
|
-
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
|
|
269
|
-
[KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
|
|
268
|
+
type Except$4<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$4 = {requireExactProps: false}> = {
|
|
269
|
+
[KeyType in keyof ObjectType as Filter$4<KeyType, KeysType>]: ObjectType[KeyType];
|
|
270
270
|
} & (Options['requireExactProps'] extends true
|
|
271
271
|
? Partial<Record<KeysType, never>>
|
|
272
272
|
: {});
|
|
@@ -303,7 +303,7 @@ type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
|
303
303
|
|
|
304
304
|
@category Object
|
|
305
305
|
*/
|
|
306
|
-
type ConditionalKeys<Base, Condition> = NonNullable<
|
|
306
|
+
type ConditionalKeys$4<Base, Condition> = NonNullable<
|
|
307
307
|
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
|
308
308
|
{
|
|
309
309
|
// Map through all the keys of the given base type.
|
|
@@ -357,9 +357,9 @@ type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
|
357
357
|
|
|
358
358
|
@category Object
|
|
359
359
|
*/
|
|
360
|
-
type ConditionalExcept<Base, Condition> = Except<
|
|
360
|
+
type ConditionalExcept$4<Base, Condition> = Except$4<
|
|
361
361
|
Base,
|
|
362
|
-
ConditionalKeys<Base, Condition>
|
|
362
|
+
ConditionalKeys$4<Base, Condition>
|
|
363
363
|
>;
|
|
364
364
|
|
|
365
365
|
/**
|
|
@@ -367,8 +367,8 @@ ConditionalKeys<Base, Condition>
|
|
|
367
367
|
* can either be a REST module or a host module.
|
|
368
368
|
* This type is recursive, so it can describe nested modules.
|
|
369
369
|
*/
|
|
370
|
-
type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
|
|
371
|
-
[key: string]: Descriptors | PublicMetadata | any;
|
|
370
|
+
type Descriptors$4 = RESTFunctionDescriptor$4 | AmbassadorFunctionDescriptor$4 | HostModule$4<any, any> | EventDefinition$4<any> | ServicePluginDefinition$4<any> | {
|
|
371
|
+
[key: string]: Descriptors$4 | PublicMetadata$4 | any;
|
|
372
372
|
};
|
|
373
373
|
/**
|
|
374
374
|
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
@@ -376,12 +376,12 @@ type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostM
|
|
|
376
376
|
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
377
377
|
* do not match the given host (as they will not work with the given host).
|
|
378
378
|
*/
|
|
379
|
-
type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
|
|
379
|
+
type BuildDescriptors$4<T extends Descriptors$4, H extends Host$4<any> | undefined, Depth extends number = 5> = {
|
|
380
380
|
done: T;
|
|
381
381
|
recurse: T extends {
|
|
382
|
-
__type: typeof SERVICE_PLUGIN_ERROR_TYPE;
|
|
383
|
-
} ? 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<{
|
|
384
|
-
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
|
|
382
|
+
__type: typeof SERVICE_PLUGIN_ERROR_TYPE$4;
|
|
383
|
+
} ? never : T extends AmbassadorFunctionDescriptor$4 ? BuildAmbassadorFunction$4<T> : T extends RESTFunctionDescriptor$4 ? BuildRESTFunction$4<T> : T extends EventDefinition$4<any> ? BuildEventDefinition$4<T> : T extends ServicePluginDefinition$4<any> ? BuildServicePluginDefinition$4<T> : T extends HostModule$4<any, any> ? HostModuleAPI$4<T> : ConditionalExcept$4<{
|
|
384
|
+
[Key in keyof T]: T[Key] extends Descriptors$4 ? BuildDescriptors$4<T[Key], H, [
|
|
385
385
|
-1,
|
|
386
386
|
0,
|
|
387
387
|
1,
|
|
@@ -390,9 +390,9 @@ type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, De
|
|
|
390
390
|
4,
|
|
391
391
|
5
|
|
392
392
|
][Depth]> : never;
|
|
393
|
-
}, EmptyObject>;
|
|
393
|
+
}, EmptyObject$4>;
|
|
394
394
|
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
395
|
-
type PublicMetadata = {
|
|
395
|
+
type PublicMetadata$4 = {
|
|
396
396
|
PACKAGE_NAME?: string;
|
|
397
397
|
};
|
|
398
398
|
|
|
@@ -404,9 +404,9 @@ declare global {
|
|
|
404
404
|
* A type used to create concerete types from SDK descriptors in
|
|
405
405
|
* case a contextual client is available.
|
|
406
406
|
*/
|
|
407
|
-
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
408
|
-
host: Host;
|
|
409
|
-
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
407
|
+
type MaybeContext$4<T extends Descriptors$4> = globalThis.ContextualClient extends {
|
|
408
|
+
host: Host$4;
|
|
409
|
+
} ? BuildDescriptors$4<T, globalThis.ContextualClient['host']> : T;
|
|
410
410
|
|
|
411
411
|
/** A `connectedDomain` object holds information about an external domain and its connection to a Wix site. */
|
|
412
412
|
interface ConnectedDomain {
|
|
@@ -433,7 +433,7 @@ interface ConnectedDomain {
|
|
|
433
433
|
* Information about the site to which the domain is assigned, and whether
|
|
434
434
|
* it's the primary domain or a redirect.
|
|
435
435
|
*/
|
|
436
|
-
siteInfo?: SiteInfo
|
|
436
|
+
siteInfo?: SiteInfo;
|
|
437
437
|
/**
|
|
438
438
|
* Whether the site owner receives standard email notifications from Wix about
|
|
439
439
|
* the connected domain.
|
|
@@ -450,7 +450,7 @@ interface ConnectedDomain {
|
|
|
450
450
|
* + `"FAILED"`: The domain's DNS propagation process has failed.
|
|
451
451
|
* @readonly
|
|
452
452
|
*/
|
|
453
|
-
dnsPropagationStatus?: DnsPropagationStatus
|
|
453
|
+
dnsPropagationStatus?: DnsPropagationStatus;
|
|
454
454
|
}
|
|
455
455
|
declare enum ConnectionType$1 {
|
|
456
456
|
/** Used by sub domain */
|
|
@@ -464,12 +464,12 @@ declare enum ConnectionType$1 {
|
|
|
464
464
|
*/
|
|
465
465
|
HIDDEN = "HIDDEN"
|
|
466
466
|
}
|
|
467
|
-
interface SiteInfo
|
|
467
|
+
interface SiteInfo extends SiteInfoAssignmentInfoOneOf {
|
|
468
468
|
/**
|
|
469
469
|
* Redirect information, relevant when `assignmentType` = `REDIRECT`.
|
|
470
470
|
* @readonly
|
|
471
471
|
*/
|
|
472
|
-
redirectInfo?: RedirectAssignmentInfo
|
|
472
|
+
redirectInfo?: RedirectAssignmentInfo;
|
|
473
473
|
/**
|
|
474
474
|
* ID of the site to which the domain is assigned.
|
|
475
475
|
* @readonly
|
|
@@ -482,29 +482,29 @@ interface SiteInfo$1 extends SiteInfoAssignmentInfoOneOf$1 {
|
|
|
482
482
|
* + `"REDIRECT"`: A redirect domain for a site. Each site can have multiple redirect domains. When this type is assigned, this domain will redirect to the primary domain.
|
|
483
483
|
* Read more about [primary and redirected domains](https://support.wix.com/en/article/switching-your-primary-and-redirected-domains).
|
|
484
484
|
*/
|
|
485
|
-
assignmentType?: AssignmentType
|
|
485
|
+
assignmentType?: AssignmentType;
|
|
486
486
|
}
|
|
487
487
|
/** @oneof */
|
|
488
|
-
interface SiteInfoAssignmentInfoOneOf
|
|
488
|
+
interface SiteInfoAssignmentInfoOneOf {
|
|
489
489
|
/**
|
|
490
490
|
* Redirect information, relevant when `assignmentType` = `REDIRECT`.
|
|
491
491
|
* @readonly
|
|
492
492
|
*/
|
|
493
|
-
redirectInfo?: RedirectAssignmentInfo
|
|
493
|
+
redirectInfo?: RedirectAssignmentInfo;
|
|
494
494
|
}
|
|
495
|
-
declare enum AssignmentType
|
|
495
|
+
declare enum AssignmentType {
|
|
496
496
|
UNKNOWN_ASSIGNMENT_TYPE = "UNKNOWN_ASSIGNMENT_TYPE",
|
|
497
497
|
PRIMARY = "PRIMARY",
|
|
498
498
|
REDIRECT = "REDIRECT"
|
|
499
499
|
}
|
|
500
|
-
interface RedirectAssignmentInfo
|
|
500
|
+
interface RedirectAssignmentInfo {
|
|
501
501
|
/**
|
|
502
502
|
* Primary domain to which this domain will redirect.
|
|
503
503
|
* @readonly
|
|
504
504
|
*/
|
|
505
505
|
primaryDomain?: string;
|
|
506
506
|
}
|
|
507
|
-
declare enum DnsPropagationStatus
|
|
507
|
+
declare enum DnsPropagationStatus {
|
|
508
508
|
UNKNOWN_DNS_PROPAGATION_STATUS = "UNKNOWN_DNS_PROPAGATION_STATUS",
|
|
509
509
|
COMPLETED = "COMPLETED",
|
|
510
510
|
FAILED = "FAILED",
|
|
@@ -541,9 +541,9 @@ interface DeleteConnectedDomainResponse {
|
|
|
541
541
|
}
|
|
542
542
|
interface ListConnectedDomainsRequest {
|
|
543
543
|
/** Cursor paging options. */
|
|
544
|
-
paging?: CursorPaging$
|
|
544
|
+
paging?: CursorPaging$1;
|
|
545
545
|
}
|
|
546
|
-
interface CursorPaging$
|
|
546
|
+
interface CursorPaging$1 {
|
|
547
547
|
/**
|
|
548
548
|
* Number of domains to load.
|
|
549
549
|
*
|
|
@@ -562,15 +562,15 @@ interface CursorPaging$2 {
|
|
|
562
562
|
}
|
|
563
563
|
interface ListConnectedDomainsResponse {
|
|
564
564
|
/** Metadata about the returned list of connected domains. */
|
|
565
|
-
pagingMetadata?: CursorPagingMetadata$
|
|
565
|
+
pagingMetadata?: CursorPagingMetadata$1;
|
|
566
566
|
/** Retrieved connected domains. */
|
|
567
567
|
connectedDomains?: ConnectedDomain[];
|
|
568
568
|
}
|
|
569
|
-
interface CursorPagingMetadata$
|
|
569
|
+
interface CursorPagingMetadata$1 {
|
|
570
570
|
/** Number of domains returned in the response. */
|
|
571
571
|
count?: number | null;
|
|
572
572
|
/** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
|
|
573
|
-
cursors?: Cursors$
|
|
573
|
+
cursors?: Cursors$1;
|
|
574
574
|
/**
|
|
575
575
|
* Indicates if there are more results after the current page.
|
|
576
576
|
* If `true`, another page of results can be retrieved.
|
|
@@ -578,17 +578,17 @@ interface CursorPagingMetadata$2 {
|
|
|
578
578
|
*/
|
|
579
579
|
hasNext?: boolean | null;
|
|
580
580
|
}
|
|
581
|
-
interface Cursors$
|
|
581
|
+
interface Cursors$1 {
|
|
582
582
|
/** Cursor pointing to next page in the list of results. */
|
|
583
583
|
next?: string | null;
|
|
584
584
|
/** Cursor pointing to previous page in the list of results. */
|
|
585
585
|
prev?: string | null;
|
|
586
586
|
}
|
|
587
|
-
interface DomainEvent$
|
|
588
|
-
createdEvent?: EntityCreatedEvent$
|
|
589
|
-
updatedEvent?: EntityUpdatedEvent$
|
|
590
|
-
deletedEvent?: EntityDeletedEvent$
|
|
591
|
-
actionEvent?: ActionEvent$
|
|
587
|
+
interface DomainEvent$1 extends DomainEventBodyOneOf$1 {
|
|
588
|
+
createdEvent?: EntityCreatedEvent$1;
|
|
589
|
+
updatedEvent?: EntityUpdatedEvent$1;
|
|
590
|
+
deletedEvent?: EntityDeletedEvent$1;
|
|
591
|
+
actionEvent?: ActionEvent$1;
|
|
592
592
|
/**
|
|
593
593
|
* Unique event ID.
|
|
594
594
|
* Allows clients to ignore duplicate webhooks.
|
|
@@ -627,19 +627,19 @@ interface DomainEvent$2 extends DomainEventBodyOneOf$2 {
|
|
|
627
627
|
entityEventSequence?: string | null;
|
|
628
628
|
}
|
|
629
629
|
/** @oneof */
|
|
630
|
-
interface DomainEventBodyOneOf$
|
|
631
|
-
createdEvent?: EntityCreatedEvent$
|
|
632
|
-
updatedEvent?: EntityUpdatedEvent$
|
|
633
|
-
deletedEvent?: EntityDeletedEvent$
|
|
634
|
-
actionEvent?: ActionEvent$
|
|
630
|
+
interface DomainEventBodyOneOf$1 {
|
|
631
|
+
createdEvent?: EntityCreatedEvent$1;
|
|
632
|
+
updatedEvent?: EntityUpdatedEvent$1;
|
|
633
|
+
deletedEvent?: EntityDeletedEvent$1;
|
|
634
|
+
actionEvent?: ActionEvent$1;
|
|
635
635
|
}
|
|
636
|
-
interface EntityCreatedEvent$
|
|
636
|
+
interface EntityCreatedEvent$1 {
|
|
637
637
|
entity?: string;
|
|
638
638
|
}
|
|
639
|
-
interface RestoreInfo$
|
|
639
|
+
interface RestoreInfo$1 {
|
|
640
640
|
deletedDate?: Date;
|
|
641
641
|
}
|
|
642
|
-
interface EntityUpdatedEvent$
|
|
642
|
+
interface EntityUpdatedEvent$1 {
|
|
643
643
|
/**
|
|
644
644
|
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
645
645
|
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
@@ -647,24 +647,24 @@ interface EntityUpdatedEvent$2 {
|
|
|
647
647
|
*/
|
|
648
648
|
currentEntity?: string;
|
|
649
649
|
}
|
|
650
|
-
interface EntityDeletedEvent$
|
|
650
|
+
interface EntityDeletedEvent$1 {
|
|
651
651
|
/** Entity that was deleted */
|
|
652
652
|
deletedEntity?: string | null;
|
|
653
653
|
}
|
|
654
|
-
interface ActionEvent$
|
|
654
|
+
interface ActionEvent$1 {
|
|
655
655
|
body?: string;
|
|
656
656
|
}
|
|
657
|
-
interface MessageEnvelope$
|
|
657
|
+
interface MessageEnvelope$1 {
|
|
658
658
|
/** App instance ID. */
|
|
659
659
|
instanceId?: string | null;
|
|
660
660
|
/** Event type. */
|
|
661
661
|
eventType?: string;
|
|
662
662
|
/** The identification type and identity data. */
|
|
663
|
-
identity?: IdentificationData$
|
|
663
|
+
identity?: IdentificationData$1;
|
|
664
664
|
/** Stringify payload. */
|
|
665
665
|
data?: string;
|
|
666
666
|
}
|
|
667
|
-
interface IdentificationData$
|
|
667
|
+
interface IdentificationData$1 extends IdentificationDataIdOneOf$1 {
|
|
668
668
|
/** ID of a site visitor that has not logged in to the site. */
|
|
669
669
|
anonymousVisitorId?: string;
|
|
670
670
|
/** ID of a site visitor that has logged in to the site. */
|
|
@@ -674,10 +674,10 @@ interface IdentificationData$2 extends IdentificationDataIdOneOf$2 {
|
|
|
674
674
|
/** ID of an app. */
|
|
675
675
|
appId?: string;
|
|
676
676
|
/** @readonly */
|
|
677
|
-
identityType?: WebhookIdentityType$
|
|
677
|
+
identityType?: WebhookIdentityType$1;
|
|
678
678
|
}
|
|
679
679
|
/** @oneof */
|
|
680
|
-
interface IdentificationDataIdOneOf$
|
|
680
|
+
interface IdentificationDataIdOneOf$1 {
|
|
681
681
|
/** ID of a site visitor that has not logged in to the site. */
|
|
682
682
|
anonymousVisitorId?: string;
|
|
683
683
|
/** ID of a site visitor that has logged in to the site. */
|
|
@@ -687,27 +687,27 @@ interface IdentificationDataIdOneOf$2 {
|
|
|
687
687
|
/** ID of an app. */
|
|
688
688
|
appId?: string;
|
|
689
689
|
}
|
|
690
|
-
declare enum WebhookIdentityType$
|
|
690
|
+
declare enum WebhookIdentityType$1 {
|
|
691
691
|
UNKNOWN = "UNKNOWN",
|
|
692
692
|
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
693
693
|
MEMBER = "MEMBER",
|
|
694
694
|
WIX_USER = "WIX_USER",
|
|
695
695
|
APP = "APP"
|
|
696
696
|
}
|
|
697
|
-
interface RedirectAssignmentInfoNonNullableFields
|
|
697
|
+
interface RedirectAssignmentInfoNonNullableFields {
|
|
698
698
|
primaryDomain: string;
|
|
699
699
|
}
|
|
700
|
-
interface SiteInfoNonNullableFields
|
|
701
|
-
redirectInfo?: RedirectAssignmentInfoNonNullableFields
|
|
702
|
-
assignmentType: AssignmentType
|
|
700
|
+
interface SiteInfoNonNullableFields {
|
|
701
|
+
redirectInfo?: RedirectAssignmentInfoNonNullableFields;
|
|
702
|
+
assignmentType: AssignmentType;
|
|
703
703
|
}
|
|
704
704
|
interface ConnectedDomainNonNullableFields {
|
|
705
705
|
_id: string;
|
|
706
706
|
domain: string;
|
|
707
707
|
connectionType: ConnectionType$1;
|
|
708
|
-
siteInfo?: SiteInfoNonNullableFields
|
|
708
|
+
siteInfo?: SiteInfoNonNullableFields;
|
|
709
709
|
suppressNotifications: boolean;
|
|
710
|
-
dnsPropagationStatus: DnsPropagationStatus
|
|
710
|
+
dnsPropagationStatus: DnsPropagationStatus;
|
|
711
711
|
}
|
|
712
712
|
interface CreateConnectedDomainResponseNonNullableFields {
|
|
713
713
|
connectedDomain?: ConnectedDomainNonNullableFields;
|
|
@@ -720,10 +720,10 @@ interface ListConnectedDomainsResponseNonNullableFields {
|
|
|
720
720
|
}
|
|
721
721
|
interface ListConnectedDomainsOptions {
|
|
722
722
|
/** Cursor paging options. */
|
|
723
|
-
paging?: CursorPaging$
|
|
723
|
+
paging?: CursorPaging$1;
|
|
724
724
|
}
|
|
725
725
|
|
|
726
|
-
declare function createConnectedDomain$1(httpClient: HttpClient): CreateConnectedDomainSignature;
|
|
726
|
+
declare function createConnectedDomain$1(httpClient: HttpClient$4): CreateConnectedDomainSignature;
|
|
727
727
|
interface CreateConnectedDomainSignature {
|
|
728
728
|
/**
|
|
729
729
|
* 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 +742,7 @@ interface CreateConnectedDomainSignature {
|
|
|
742
742
|
*/
|
|
743
743
|
(connectedDomain: ConnectedDomain): Promise<ConnectedDomain & ConnectedDomainNonNullableFields>;
|
|
744
744
|
}
|
|
745
|
-
declare function getConnectedDomain$1(httpClient: HttpClient): GetConnectedDomainSignature;
|
|
745
|
+
declare function getConnectedDomain$1(httpClient: HttpClient$4): GetConnectedDomainSignature;
|
|
746
746
|
interface GetConnectedDomainSignature {
|
|
747
747
|
/**
|
|
748
748
|
* Retrieves a connected domain.
|
|
@@ -756,7 +756,7 @@ interface GetConnectedDomainSignature {
|
|
|
756
756
|
*/
|
|
757
757
|
(connectedDomainId: string): Promise<ConnectedDomain & ConnectedDomainNonNullableFields>;
|
|
758
758
|
}
|
|
759
|
-
declare function deleteConnectedDomain$1(httpClient: HttpClient): DeleteConnectedDomainSignature;
|
|
759
|
+
declare function deleteConnectedDomain$1(httpClient: HttpClient$4): DeleteConnectedDomainSignature;
|
|
760
760
|
interface DeleteConnectedDomainSignature {
|
|
761
761
|
/**
|
|
762
762
|
* Deletes a `connectedDomain` object and removes related DNS records from
|
|
@@ -776,7 +776,7 @@ interface DeleteConnectedDomainSignature {
|
|
|
776
776
|
*/
|
|
777
777
|
(connectedDomainId: string): Promise<void>;
|
|
778
778
|
}
|
|
779
|
-
declare function listConnectedDomains$1(httpClient: HttpClient): ListConnectedDomainsSignature;
|
|
779
|
+
declare function listConnectedDomains$1(httpClient: HttpClient$4): ListConnectedDomainsSignature;
|
|
780
780
|
interface ListConnectedDomainsSignature {
|
|
781
781
|
/**
|
|
782
782
|
* Retrieves a list of up to 100 connected domains.
|
|
@@ -791,104 +791,521 @@ interface ListConnectedDomainsSignature {
|
|
|
791
791
|
(options?: ListConnectedDomainsOptions | undefined): Promise<ListConnectedDomainsResponse & ListConnectedDomainsResponseNonNullableFields>;
|
|
792
792
|
}
|
|
793
793
|
|
|
794
|
-
declare const createConnectedDomain: MaybeContext<BuildRESTFunction<typeof createConnectedDomain$1> & typeof createConnectedDomain$1>;
|
|
795
|
-
declare const getConnectedDomain: MaybeContext<BuildRESTFunction<typeof getConnectedDomain$1> & typeof getConnectedDomain$1>;
|
|
796
|
-
declare const deleteConnectedDomain: MaybeContext<BuildRESTFunction<typeof deleteConnectedDomain$1> & typeof deleteConnectedDomain$1>;
|
|
797
|
-
declare const listConnectedDomains: MaybeContext<BuildRESTFunction<typeof listConnectedDomains$1> & typeof listConnectedDomains$1>;
|
|
798
|
-
|
|
799
|
-
type context$
|
|
800
|
-
|
|
801
|
-
type context$
|
|
802
|
-
type context$
|
|
803
|
-
type context$
|
|
804
|
-
type context$
|
|
805
|
-
type context$
|
|
806
|
-
type context$
|
|
807
|
-
type context$
|
|
808
|
-
type context$
|
|
809
|
-
|
|
810
|
-
type context$
|
|
811
|
-
type context$
|
|
812
|
-
type context$
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
794
|
+
declare const createConnectedDomain: MaybeContext$4<BuildRESTFunction$4<typeof createConnectedDomain$1> & typeof createConnectedDomain$1>;
|
|
795
|
+
declare const getConnectedDomain: MaybeContext$4<BuildRESTFunction$4<typeof getConnectedDomain$1> & typeof getConnectedDomain$1>;
|
|
796
|
+
declare const deleteConnectedDomain: MaybeContext$4<BuildRESTFunction$4<typeof deleteConnectedDomain$1> & typeof deleteConnectedDomain$1>;
|
|
797
|
+
declare const listConnectedDomains: MaybeContext$4<BuildRESTFunction$4<typeof listConnectedDomains$1> & typeof listConnectedDomains$1>;
|
|
798
|
+
|
|
799
|
+
type context$4_AssignmentType = AssignmentType;
|
|
800
|
+
declare const context$4_AssignmentType: typeof AssignmentType;
|
|
801
|
+
type context$4_ConnectedDomain = ConnectedDomain;
|
|
802
|
+
type context$4_ConnectedDomainNonNullableFields = ConnectedDomainNonNullableFields;
|
|
803
|
+
type context$4_CreateConnectedDomainRequest = CreateConnectedDomainRequest;
|
|
804
|
+
type context$4_CreateConnectedDomainResponse = CreateConnectedDomainResponse;
|
|
805
|
+
type context$4_CreateConnectedDomainResponseNonNullableFields = CreateConnectedDomainResponseNonNullableFields;
|
|
806
|
+
type context$4_DeleteConnectedDomainRequest = DeleteConnectedDomainRequest;
|
|
807
|
+
type context$4_DeleteConnectedDomainResponse = DeleteConnectedDomainResponse;
|
|
808
|
+
type context$4_DnsPropagationStatus = DnsPropagationStatus;
|
|
809
|
+
declare const context$4_DnsPropagationStatus: typeof DnsPropagationStatus;
|
|
810
|
+
type context$4_GetConnectedDomainRequest = GetConnectedDomainRequest;
|
|
811
|
+
type context$4_GetConnectedDomainResponse = GetConnectedDomainResponse;
|
|
812
|
+
type context$4_GetConnectedDomainResponseNonNullableFields = GetConnectedDomainResponseNonNullableFields;
|
|
813
|
+
type context$4_ListConnectedDomainsOptions = ListConnectedDomainsOptions;
|
|
814
|
+
type context$4_ListConnectedDomainsRequest = ListConnectedDomainsRequest;
|
|
815
|
+
type context$4_ListConnectedDomainsResponse = ListConnectedDomainsResponse;
|
|
816
|
+
type context$4_ListConnectedDomainsResponseNonNullableFields = ListConnectedDomainsResponseNonNullableFields;
|
|
817
|
+
type context$4_RedirectAssignmentInfo = RedirectAssignmentInfo;
|
|
818
|
+
type context$4_SiteInfo = SiteInfo;
|
|
819
|
+
type context$4_SiteInfoAssignmentInfoOneOf = SiteInfoAssignmentInfoOneOf;
|
|
820
|
+
declare const context$4_createConnectedDomain: typeof createConnectedDomain;
|
|
821
|
+
declare const context$4_deleteConnectedDomain: typeof deleteConnectedDomain;
|
|
822
|
+
declare const context$4_getConnectedDomain: typeof getConnectedDomain;
|
|
823
|
+
declare const context$4_listConnectedDomains: typeof listConnectedDomains;
|
|
824
|
+
declare namespace context$4 {
|
|
825
|
+
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 };
|
|
819
826
|
}
|
|
820
827
|
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
* @readonly
|
|
836
|
-
*/
|
|
837
|
-
pointingRecords?: PointingRecords;
|
|
838
|
-
/**
|
|
839
|
-
* Information about subdomains. Available only for subdomains.
|
|
840
|
-
* @readonly
|
|
841
|
-
*/
|
|
842
|
-
subdomainRecords?: SubdomainRecords;
|
|
843
|
-
/** ID of the connected domain. Identical to the domain name including TLD. */
|
|
844
|
-
connectedDomainId?: string;
|
|
845
|
-
/**
|
|
846
|
-
* Information about the external domain registrar including current name
|
|
847
|
-
* servers.
|
|
848
|
-
*/
|
|
849
|
-
registrar?: Registrar;
|
|
850
|
-
}
|
|
851
|
-
/** @oneof */
|
|
852
|
-
interface ConnectedDomainSetupInfoDnsRecordsOneOf {
|
|
853
|
-
/**
|
|
854
|
-
* Information about domains connected using nameservers. Available only for
|
|
855
|
-
* `{"connectionType": "NAMESERVERS"}`.
|
|
856
|
-
*/
|
|
857
|
-
nameserverRecord?: NameserverRecord;
|
|
828
|
+
type HostModule$3<T, H extends Host$3> = {
|
|
829
|
+
__type: 'host';
|
|
830
|
+
create(host: H): T;
|
|
831
|
+
};
|
|
832
|
+
type HostModuleAPI$3<T extends HostModule$3<any, any>> = T extends HostModule$3<infer U, any> ? U : never;
|
|
833
|
+
type Host$3<Environment = unknown> = {
|
|
834
|
+
channel: {
|
|
835
|
+
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
836
|
+
disconnect: () => void;
|
|
837
|
+
} | Promise<{
|
|
838
|
+
disconnect: () => void;
|
|
839
|
+
}>;
|
|
840
|
+
};
|
|
841
|
+
environment?: Environment;
|
|
858
842
|
/**
|
|
859
|
-
*
|
|
860
|
-
* `{"connectionType": "POINTING"}`.
|
|
861
|
-
* @readonly
|
|
843
|
+
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
|
862
844
|
*/
|
|
863
|
-
|
|
845
|
+
apiBaseUrl?: string;
|
|
864
846
|
/**
|
|
865
|
-
*
|
|
866
|
-
*
|
|
847
|
+
* Possible data to be provided by every host, for cross cutting concerns
|
|
848
|
+
* like internationalization, billing, etc.
|
|
867
849
|
*/
|
|
868
|
-
|
|
850
|
+
essentials?: {
|
|
851
|
+
/**
|
|
852
|
+
* The language of the currently viewed session
|
|
853
|
+
*/
|
|
854
|
+
language?: string;
|
|
855
|
+
/**
|
|
856
|
+
* The locale of the currently viewed session
|
|
857
|
+
*/
|
|
858
|
+
locale?: string;
|
|
859
|
+
/**
|
|
860
|
+
* Any headers that should be passed through to the API requests
|
|
861
|
+
*/
|
|
862
|
+
passThroughHeaders?: Record<string, string>;
|
|
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;
|
|
869
872
|
}
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
873
|
+
type RequestOptionsFactory$3<TResponse = any, TData = any> = (context: any) => RequestOptions$3<TResponse, TData>;
|
|
874
|
+
type HttpResponse$3<T = any> = {
|
|
875
|
+
data: T;
|
|
876
|
+
status: number;
|
|
877
|
+
statusText: string;
|
|
878
|
+
headers: any;
|
|
879
|
+
request?: any;
|
|
880
|
+
};
|
|
881
|
+
type RequestOptions$3<_TResponse = any, Data = any> = {
|
|
882
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
883
|
+
url: string;
|
|
884
|
+
data?: Data;
|
|
885
|
+
params?: URLSearchParams;
|
|
886
|
+
} & APIMetadata$3;
|
|
887
|
+
type APIMetadata$3 = {
|
|
888
|
+
methodFqn?: string;
|
|
889
|
+
entityFqdn?: string;
|
|
890
|
+
packageName?: string;
|
|
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
|
+
}
|
|
887
958
|
}
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
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 {
|
|
1244
|
+
/**
|
|
1245
|
+
* Information about domains connected using nameservers. Available only for
|
|
1246
|
+
* `{"connectionType": "NAMESERVERS"}`.
|
|
1247
|
+
*/
|
|
1248
|
+
nameserverRecord?: NameserverRecord;
|
|
1249
|
+
/**
|
|
1250
|
+
* Information about domains connected by pointing. Available only for
|
|
1251
|
+
* `{"connectionType": "POINTING"}`.
|
|
1252
|
+
* @readonly
|
|
1253
|
+
*/
|
|
1254
|
+
pointingRecords?: PointingRecords;
|
|
1255
|
+
/**
|
|
1256
|
+
* Information about subdomains. Available only for subdomains.
|
|
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).
|
|
892
1309
|
* @readonly
|
|
893
1310
|
*/
|
|
894
1311
|
nsRecord?: NsRecord;
|
|
@@ -1021,49 +1438,459 @@ interface ConnectedDomainSetupInfoNonNullableFields {
|
|
|
1021
1438
|
connectedDomainId: string;
|
|
1022
1439
|
registrar?: RegistrarNonNullableFields;
|
|
1023
1440
|
}
|
|
1024
|
-
interface GetConnectedDomainSetupInfoResponseNonNullableFields {
|
|
1025
|
-
connectedDomainSetupInfo?: ConnectedDomainSetupInfoNonNullableFields;
|
|
1441
|
+
interface GetConnectedDomainSetupInfoResponseNonNullableFields {
|
|
1442
|
+
connectedDomainSetupInfo?: ConnectedDomainSetupInfoNonNullableFields;
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
declare function getConnectedDomainSetupInfo$1(httpClient: HttpClient$3): GetConnectedDomainSetupInfoSignature;
|
|
1446
|
+
interface GetConnectedDomainSetupInfoSignature {
|
|
1447
|
+
/**
|
|
1448
|
+
* Retrieves information for the initial setup of a connected domain.
|
|
1449
|
+
*
|
|
1450
|
+
*
|
|
1451
|
+
* You must pass the relevant Wix account ID in the header of the call.
|
|
1452
|
+
*
|
|
1453
|
+
* > __Important:__ This call requires an account level API key and cannot be authenticated with the standard authorization header.
|
|
1454
|
+
* @param - ID of the connected domain to retrieve setup information for.
|
|
1455
|
+
* Identical to the domain name including TLD.
|
|
1456
|
+
*/
|
|
1457
|
+
(connectedDomainId: string): Promise<GetConnectedDomainSetupInfoResponse & GetConnectedDomainSetupInfoResponseNonNullableFields>;
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
declare const getConnectedDomainSetupInfo: MaybeContext$3<BuildRESTFunction$3<typeof getConnectedDomainSetupInfo$1> & typeof getConnectedDomainSetupInfo$1>;
|
|
1461
|
+
|
|
1462
|
+
type context$3_ARecord = ARecord;
|
|
1463
|
+
type context$3_CnameRecord = CnameRecord;
|
|
1464
|
+
type context$3_ConnectedDomainSetupInfo = ConnectedDomainSetupInfo;
|
|
1465
|
+
type context$3_ConnectedDomainSetupInfoDnsRecordsOneOf = ConnectedDomainSetupInfoDnsRecordsOneOf;
|
|
1466
|
+
type context$3_ConnectionType = ConnectionType;
|
|
1467
|
+
declare const context$3_ConnectionType: typeof ConnectionType;
|
|
1468
|
+
type context$3_GetConnectedDomainSetupInfoRequest = GetConnectedDomainSetupInfoRequest;
|
|
1469
|
+
type context$3_GetConnectedDomainSetupInfoResponse = GetConnectedDomainSetupInfoResponse;
|
|
1470
|
+
type context$3_GetConnectedDomainSetupInfoResponseNonNullableFields = GetConnectedDomainSetupInfoResponseNonNullableFields;
|
|
1471
|
+
type context$3_GetSetupInfoRequest = GetSetupInfoRequest;
|
|
1472
|
+
type context$3_GetSetupInfoResponse = GetSetupInfoResponse;
|
|
1473
|
+
type context$3_NameserverRecord = NameserverRecord;
|
|
1474
|
+
type context$3_NsRecord = NsRecord;
|
|
1475
|
+
type context$3_PointingRecords = PointingRecords;
|
|
1476
|
+
type context$3_PreCreateConnectedDomainRequest = PreCreateConnectedDomainRequest;
|
|
1477
|
+
type context$3_PreCreateConnectedDomainResponse = PreCreateConnectedDomainResponse;
|
|
1478
|
+
type context$3_Registrar = Registrar;
|
|
1479
|
+
type context$3_SubdomainRecords = SubdomainRecords;
|
|
1480
|
+
declare const context$3_getConnectedDomainSetupInfo: typeof getConnectedDomainSetupInfo;
|
|
1481
|
+
declare namespace context$3 {
|
|
1482
|
+
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
|
+
}
|
|
1484
|
+
|
|
1485
|
+
type HostModule$2<T, H extends Host$2> = {
|
|
1486
|
+
__type: 'host';
|
|
1487
|
+
create(host: H): T;
|
|
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;
|
|
1499
|
+
/**
|
|
1500
|
+
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
|
1501
|
+
*/
|
|
1502
|
+
apiBaseUrl?: string;
|
|
1503
|
+
/**
|
|
1504
|
+
* Possible data to be provided by every host, for cross cutting concerns
|
|
1505
|
+
* like internationalization, billing, etc.
|
|
1506
|
+
*/
|
|
1507
|
+
essentials?: {
|
|
1508
|
+
/**
|
|
1509
|
+
* The language of the currently viewed session
|
|
1510
|
+
*/
|
|
1511
|
+
language?: string;
|
|
1512
|
+
/**
|
|
1513
|
+
* The locale of the currently viewed session
|
|
1514
|
+
*/
|
|
1515
|
+
locale?: string;
|
|
1516
|
+
/**
|
|
1517
|
+
* Any headers that should be passed through to the API requests
|
|
1518
|
+
*/
|
|
1519
|
+
passThroughHeaders?: Record<string, string>;
|
|
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;
|
|
1529
|
+
}
|
|
1530
|
+
type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
|
|
1531
|
+
type HttpResponse$2<T = any> = {
|
|
1532
|
+
data: T;
|
|
1533
|
+
status: number;
|
|
1534
|
+
statusText: string;
|
|
1535
|
+
headers: any;
|
|
1536
|
+
request?: any;
|
|
1537
|
+
};
|
|
1538
|
+
type RequestOptions$2<_TResponse = any, Data = any> = {
|
|
1539
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
1540
|
+
url: string;
|
|
1541
|
+
data?: Data;
|
|
1542
|
+
params?: URLSearchParams;
|
|
1543
|
+
} & APIMetadata$2;
|
|
1544
|
+
type APIMetadata$2 = {
|
|
1545
|
+
methodFqn?: string;
|
|
1546
|
+
entityFqdn?: string;
|
|
1547
|
+
packageName?: string;
|
|
1548
|
+
};
|
|
1549
|
+
type BuildRESTFunction$2<T extends RESTFunctionDescriptor$2> = T extends RESTFunctionDescriptor$2<infer U> ? U : never;
|
|
1550
|
+
type EventDefinition$2<Payload = unknown, Type extends string = string> = {
|
|
1551
|
+
__type: 'event-definition';
|
|
1552
|
+
type: Type;
|
|
1553
|
+
isDomainEvent?: boolean;
|
|
1554
|
+
transformations?: (envelope: unknown) => Payload;
|
|
1555
|
+
__payload: Payload;
|
|
1556
|
+
};
|
|
1557
|
+
declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
|
|
1558
|
+
type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
|
|
1559
|
+
type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
|
|
1560
|
+
|
|
1561
|
+
type ServicePluginMethodInput$2 = {
|
|
1562
|
+
request: any;
|
|
1563
|
+
metadata: any;
|
|
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
|
+
}
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
declare const emptyObjectSymbol$2: unique symbol;
|
|
1618
|
+
|
|
1619
|
+
/**
|
|
1620
|
+
Represents a strictly empty plain object, the `{}` value.
|
|
1621
|
+
|
|
1622
|
+
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)).
|
|
1623
|
+
|
|
1624
|
+
@example
|
|
1625
|
+
```
|
|
1626
|
+
import type {EmptyObject} from 'type-fest';
|
|
1627
|
+
|
|
1628
|
+
// The following illustrates the problem with `{}`.
|
|
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() {}
|
|
1026
1821
|
}
|
|
1027
1822
|
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
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: {};
|
|
1041
1836
|
}
|
|
1042
1837
|
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
type
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
type
|
|
1058
|
-
|
|
1059
|
-
type
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
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
|
+
}
|
|
1066
1886
|
}
|
|
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;
|
|
1067
1894
|
|
|
1068
1895
|
/** DNS zones hold information about the records that map a domain's URL to an IP address. */
|
|
1069
1896
|
interface DnsZone {
|
|
@@ -1226,11 +2053,11 @@ interface PreviewDnsZoneResponse {
|
|
|
1226
2053
|
*/
|
|
1227
2054
|
dnsZone?: DnsZone;
|
|
1228
2055
|
}
|
|
1229
|
-
interface DomainEvent
|
|
1230
|
-
createdEvent?: EntityCreatedEvent
|
|
1231
|
-
updatedEvent?: EntityUpdatedEvent
|
|
1232
|
-
deletedEvent?: EntityDeletedEvent
|
|
1233
|
-
actionEvent?: ActionEvent
|
|
2056
|
+
interface DomainEvent extends DomainEventBodyOneOf {
|
|
2057
|
+
createdEvent?: EntityCreatedEvent;
|
|
2058
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
2059
|
+
deletedEvent?: EntityDeletedEvent;
|
|
2060
|
+
actionEvent?: ActionEvent;
|
|
1234
2061
|
/**
|
|
1235
2062
|
* Unique event ID.
|
|
1236
2063
|
* Allows clients to ignore duplicate webhooks.
|
|
@@ -1269,19 +2096,19 @@ interface DomainEvent$1 extends DomainEventBodyOneOf$1 {
|
|
|
1269
2096
|
entityEventSequence?: string | null;
|
|
1270
2097
|
}
|
|
1271
2098
|
/** @oneof */
|
|
1272
|
-
interface DomainEventBodyOneOf
|
|
1273
|
-
createdEvent?: EntityCreatedEvent
|
|
1274
|
-
updatedEvent?: EntityUpdatedEvent
|
|
1275
|
-
deletedEvent?: EntityDeletedEvent
|
|
1276
|
-
actionEvent?: ActionEvent
|
|
2099
|
+
interface DomainEventBodyOneOf {
|
|
2100
|
+
createdEvent?: EntityCreatedEvent;
|
|
2101
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
2102
|
+
deletedEvent?: EntityDeletedEvent;
|
|
2103
|
+
actionEvent?: ActionEvent;
|
|
1277
2104
|
}
|
|
1278
|
-
interface EntityCreatedEvent
|
|
2105
|
+
interface EntityCreatedEvent {
|
|
1279
2106
|
entity?: string;
|
|
1280
2107
|
}
|
|
1281
|
-
interface RestoreInfo
|
|
2108
|
+
interface RestoreInfo {
|
|
1282
2109
|
deletedDate?: Date;
|
|
1283
2110
|
}
|
|
1284
|
-
interface EntityUpdatedEvent
|
|
2111
|
+
interface EntityUpdatedEvent {
|
|
1285
2112
|
/**
|
|
1286
2113
|
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
1287
2114
|
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
@@ -1289,24 +2116,24 @@ interface EntityUpdatedEvent$1 {
|
|
|
1289
2116
|
*/
|
|
1290
2117
|
currentEntity?: string;
|
|
1291
2118
|
}
|
|
1292
|
-
interface EntityDeletedEvent
|
|
2119
|
+
interface EntityDeletedEvent {
|
|
1293
2120
|
/** Entity that was deleted */
|
|
1294
2121
|
deletedEntity?: string | null;
|
|
1295
2122
|
}
|
|
1296
|
-
interface ActionEvent
|
|
2123
|
+
interface ActionEvent {
|
|
1297
2124
|
body?: string;
|
|
1298
2125
|
}
|
|
1299
|
-
interface MessageEnvelope
|
|
2126
|
+
interface MessageEnvelope {
|
|
1300
2127
|
/** App instance ID. */
|
|
1301
2128
|
instanceId?: string | null;
|
|
1302
2129
|
/** Event type. */
|
|
1303
2130
|
eventType?: string;
|
|
1304
2131
|
/** The identification type and identity data. */
|
|
1305
|
-
identity?: IdentificationData
|
|
2132
|
+
identity?: IdentificationData;
|
|
1306
2133
|
/** Stringify payload. */
|
|
1307
2134
|
data?: string;
|
|
1308
2135
|
}
|
|
1309
|
-
interface IdentificationData
|
|
2136
|
+
interface IdentificationData extends IdentificationDataIdOneOf {
|
|
1310
2137
|
/** ID of a site visitor that has not logged in to the site. */
|
|
1311
2138
|
anonymousVisitorId?: string;
|
|
1312
2139
|
/** ID of a site visitor that has logged in to the site. */
|
|
@@ -1316,10 +2143,10 @@ interface IdentificationData$1 extends IdentificationDataIdOneOf$1 {
|
|
|
1316
2143
|
/** ID of an app. */
|
|
1317
2144
|
appId?: string;
|
|
1318
2145
|
/** @readonly */
|
|
1319
|
-
identityType?: WebhookIdentityType
|
|
2146
|
+
identityType?: WebhookIdentityType;
|
|
1320
2147
|
}
|
|
1321
2148
|
/** @oneof */
|
|
1322
|
-
interface IdentificationDataIdOneOf
|
|
2149
|
+
interface IdentificationDataIdOneOf {
|
|
1323
2150
|
/** ID of a site visitor that has not logged in to the site. */
|
|
1324
2151
|
anonymousVisitorId?: string;
|
|
1325
2152
|
/** ID of a site visitor that has logged in to the site. */
|
|
@@ -1329,7 +2156,7 @@ interface IdentificationDataIdOneOf$1 {
|
|
|
1329
2156
|
/** ID of an app. */
|
|
1330
2157
|
appId?: string;
|
|
1331
2158
|
}
|
|
1332
|
-
declare enum WebhookIdentityType
|
|
2159
|
+
declare enum WebhookIdentityType {
|
|
1333
2160
|
UNKNOWN = "UNKNOWN",
|
|
1334
2161
|
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
1335
2162
|
MEMBER = "MEMBER",
|
|
@@ -1382,7 +2209,7 @@ interface UpdateDnsZoneOptions {
|
|
|
1382
2209
|
dnssecEnabled?: boolean | null;
|
|
1383
2210
|
}
|
|
1384
2211
|
|
|
1385
|
-
declare function createDnsZone$1(httpClient: HttpClient): CreateDnsZoneSignature;
|
|
2212
|
+
declare function createDnsZone$1(httpClient: HttpClient$2): CreateDnsZoneSignature;
|
|
1386
2213
|
interface CreateDnsZoneSignature {
|
|
1387
2214
|
/**
|
|
1388
2215
|
* Creates a DNS zone in [Google's Cloud DNS](https://cloud.google.com/dns).
|
|
@@ -1404,7 +2231,7 @@ interface CreateDnsZoneSignature {
|
|
|
1404
2231
|
*/
|
|
1405
2232
|
(dnsZone: DnsZone): Promise<DnsZone & DnsZoneNonNullableFields>;
|
|
1406
2233
|
}
|
|
1407
|
-
declare function getDnsZone$1(httpClient: HttpClient): GetDnsZoneSignature;
|
|
2234
|
+
declare function getDnsZone$1(httpClient: HttpClient$2): GetDnsZoneSignature;
|
|
1408
2235
|
interface GetDnsZoneSignature {
|
|
1409
2236
|
/**
|
|
1410
2237
|
* Retrieves the DNS zone belonging to the domain from
|
|
@@ -1417,7 +2244,7 @@ interface GetDnsZoneSignature {
|
|
|
1417
2244
|
*/
|
|
1418
2245
|
(domainName: string): Promise<DnsZone & DnsZoneNonNullableFields>;
|
|
1419
2246
|
}
|
|
1420
|
-
declare function updateDnsZone$1(httpClient: HttpClient): UpdateDnsZoneSignature;
|
|
2247
|
+
declare function updateDnsZone$1(httpClient: HttpClient$2): UpdateDnsZoneSignature;
|
|
1421
2248
|
interface UpdateDnsZoneSignature {
|
|
1422
2249
|
/**
|
|
1423
2250
|
* Adds DNS records to and removes DNS records from a DNS zone in
|
|
@@ -1438,7 +2265,7 @@ interface UpdateDnsZoneSignature {
|
|
|
1438
2265
|
*/
|
|
1439
2266
|
(domainName: string, options?: UpdateDnsZoneOptions | undefined): Promise<UpdateDnsZoneResponse & UpdateDnsZoneResponseNonNullableFields>;
|
|
1440
2267
|
}
|
|
1441
|
-
declare function deleteDnsZone$1(httpClient: HttpClient): DeleteDnsZoneSignature;
|
|
2268
|
+
declare function deleteDnsZone$1(httpClient: HttpClient$2): DeleteDnsZoneSignature;
|
|
1442
2269
|
interface DeleteDnsZoneSignature {
|
|
1443
2270
|
/**
|
|
1444
2271
|
* Deletes a DNS zone in [Google's Cloud DNS](https://cloud.google.com/dns).
|
|
@@ -1452,7 +2279,7 @@ interface DeleteDnsZoneSignature {
|
|
|
1452
2279
|
*/
|
|
1453
2280
|
(domainName: string): Promise<void>;
|
|
1454
2281
|
}
|
|
1455
|
-
declare function previewDnsZone$1(httpClient: HttpClient): PreviewDnsZoneSignature;
|
|
2282
|
+
declare function previewDnsZone$1(httpClient: HttpClient$2): PreviewDnsZoneSignature;
|
|
1456
2283
|
interface PreviewDnsZoneSignature {
|
|
1457
2284
|
/**
|
|
1458
2285
|
* Generates a preview for a DNS zone based on
|
|
@@ -1469,901 +2296,943 @@ interface PreviewDnsZoneSignature {
|
|
|
1469
2296
|
(domainName: string): Promise<PreviewDnsZoneResponse & PreviewDnsZoneResponseNonNullableFields>;
|
|
1470
2297
|
}
|
|
1471
2298
|
|
|
1472
|
-
declare const createDnsZone: MaybeContext<BuildRESTFunction<typeof createDnsZone$1> & typeof createDnsZone$1>;
|
|
1473
|
-
declare const getDnsZone: MaybeContext<BuildRESTFunction<typeof getDnsZone$1> & typeof getDnsZone$1>;
|
|
1474
|
-
declare const updateDnsZone: MaybeContext<BuildRESTFunction<typeof updateDnsZone$1> & typeof updateDnsZone$1>;
|
|
1475
|
-
declare const deleteDnsZone: MaybeContext<BuildRESTFunction<typeof deleteDnsZone$1> & typeof deleteDnsZone$1>;
|
|
1476
|
-
declare const previewDnsZone: MaybeContext<BuildRESTFunction<typeof previewDnsZone$1> & typeof previewDnsZone$1>;
|
|
1477
|
-
|
|
1478
|
-
type context$
|
|
1479
|
-
type context$
|
|
1480
|
-
type context$
|
|
1481
|
-
type context$
|
|
1482
|
-
type context$
|
|
1483
|
-
type context$
|
|
1484
|
-
type context$
|
|
1485
|
-
type context$
|
|
1486
|
-
type context$
|
|
1487
|
-
type context$
|
|
1488
|
-
type context$
|
|
1489
|
-
type context$
|
|
1490
|
-
type context$
|
|
1491
|
-
type context$
|
|
1492
|
-
type context$
|
|
1493
|
-
type context$
|
|
1494
|
-
type context$
|
|
1495
|
-
type context$
|
|
1496
|
-
|
|
1497
|
-
type context$
|
|
1498
|
-
type context$
|
|
1499
|
-
type context$
|
|
1500
|
-
type context$
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
declare const context$
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
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
|
+
: {});
|
|
1509
2621
|
|
|
1510
2622
|
/**
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
* @readonly
|
|
1525
|
-
*/
|
|
1526
|
-
failedRegistrationInfo?: FailedRegistrationInfo;
|
|
1527
|
-
/**
|
|
1528
|
-
* Domain ID. Identical to `domain`.
|
|
1529
|
-
* @readonly
|
|
1530
|
-
*/
|
|
1531
|
-
_id?: string;
|
|
1532
|
-
/**
|
|
1533
|
-
* Name of the domain including TLD.
|
|
1534
|
-
* Subdomains aren't supported. You can only register a root domain.
|
|
1535
|
-
* Domain name and TLD must be separated by a dot. For example,
|
|
1536
|
-
* `my-new-domain.com`. Only alphanumeric characters, hyphens, and dots are
|
|
1537
|
-
* supported.
|
|
1538
|
-
*
|
|
1539
|
-
* Min: 3 characters
|
|
1540
|
-
* Max: 63 characters
|
|
1541
|
-
*/
|
|
1542
|
-
domain?: string;
|
|
1543
|
-
/**
|
|
1544
|
-
* ID of the product instance from the
|
|
1545
|
-
* [Resellers API](https://dev.wix.com/docs/rest/api-reference/account-level-apis/resellers/packages-and-product-instances/packages-object)
|
|
1546
|
-
* that belongs to the `registeredDomain` object.
|
|
1547
|
-
* Your account must own a product that supports the chosen TLD, regardless of
|
|
1548
|
-
* whether you want to assign the domain to a site or keep it floating. If
|
|
1549
|
-
* you want to assign the domain to a site, the relevant site must also
|
|
1550
|
-
* own a Premium plan. Contact the [Wix B2B team](mailto:bizdev@wix.com)
|
|
1551
|
-
* for more information about how to become a reseller and a list of available
|
|
1552
|
-
* product IDs.
|
|
1553
|
-
*/
|
|
1554
|
-
productInstanceId?: string;
|
|
1555
|
-
/**
|
|
1556
|
-
* Date and time the `registeredDomain` object was created in
|
|
1557
|
-
* `YYYY-MM-DDThh:mm:ss.sssZ` format.
|
|
1558
|
-
* @readonly
|
|
1559
|
-
*/
|
|
1560
|
-
_createdDate?: Date;
|
|
1561
|
-
/**
|
|
1562
|
-
* Date and time the `registeredDomain` object was last updated in
|
|
1563
|
-
* `YYYY-MM-DDThh:mm:ss.sssZ` format.
|
|
1564
|
-
* @readonly
|
|
1565
|
-
*/
|
|
1566
|
-
_updatedDate?: Date;
|
|
1567
|
-
/**
|
|
1568
|
-
* Revision number, which increments by 1 each time the registered domain
|
|
1569
|
-
* is updated. To prevent conflicting changes, the current revision must be
|
|
1570
|
-
* passed when updating the registered domain.
|
|
1571
|
-
*
|
|
1572
|
-
* Ignored when creating a registered domain.
|
|
1573
|
-
*/
|
|
1574
|
-
revision?: string | null;
|
|
1575
|
-
/**
|
|
1576
|
-
* Information about the Wix site the domain is connected to and whether the
|
|
1577
|
-
* domain is assigned as the primary domain or a redirect.
|
|
1578
|
-
*/
|
|
1579
|
-
siteInfo?: SiteInfo;
|
|
1580
|
-
/**
|
|
1581
|
-
* Contact details for the registrant, admin, and tech support of the registered domain.
|
|
1582
|
-
* You can read more about which
|
|
1583
|
-
* [Contact Field Validations](https://https://dev.wix.com/api/rest/account-level-apis/registered-domains/contact-field-validations)
|
|
1584
|
-
* are implemented.
|
|
1585
|
-
*/
|
|
1586
|
-
contacts?: Contacts;
|
|
1587
|
-
/**
|
|
1588
|
-
* Status of the registered domain.
|
|
1589
|
-
*
|
|
1590
|
-
* + `"UNKNOWN_STATUS"`: There's no information about the status of the registered domain.
|
|
1591
|
-
* + `"PENDING_REGISTRATION"`: Wix has started the domain registration process, but the domain hasn't been successfully registered yet.
|
|
1592
|
-
* + `"ACTIVE"`: The domain has been registered successfully and is active.
|
|
1593
|
-
* + `"FAILED_REGISTRATION"`: Wix has tried to register the domain, but has stopped the process due to too many failed attempts. Contact the [Wix B2B team](mailto:bizdev@wix.com) for more information.
|
|
1594
|
-
* + `"CANCELED"`: The domain has been canceled and isn't active any longer.
|
|
1595
|
-
* @readonly
|
|
1596
|
-
*/
|
|
1597
|
-
status?: Status;
|
|
1598
|
-
/**
|
|
1599
|
-
* ICANN confirmation status.
|
|
1600
|
-
*
|
|
1601
|
-
* + `"UNKNOWN_ICANN_CONFIRMATION_STATUS"`: There's no information about the status of the ICANN confirmation process.
|
|
1602
|
-
* + `"PENDING"`: Wix has started the ICANN confirmation process, but not all contacts have confirmed the domain yet.
|
|
1603
|
-
* + `"CONFIRMED_BY_ALL"`: The domain has been successfully confirmed by all contacts.
|
|
1604
|
-
* + `"EXPIRED"`: The domain hasn't been confirmed by all contacts before the ICANN confirmation process expired. The domain isn't active and a new confirmation process must be started. Contact the [Wix B2B team](mailto:bizdev@wix.com) for more information.
|
|
1605
|
-
* @readonly
|
|
1606
|
-
*/
|
|
1607
|
-
icannConfirmationStatus?: ICANNConfirmationStatus;
|
|
1608
|
-
/**
|
|
1609
|
-
* Details about the ICANN confirmation status.
|
|
1610
|
-
* @readonly
|
|
1611
|
-
*/
|
|
1612
|
-
icannConfirmationStatusInfo?: ICANNConfirmationStatusInfo;
|
|
1613
|
-
/**
|
|
1614
|
-
* DNS propagation status.
|
|
1615
|
-
*
|
|
1616
|
-
* + `"UNKNOWN_DNS_PROPAGATION_STATUS"`: There's no information about the domain's DNS propagation status.
|
|
1617
|
-
* + `"IN_PROGRESS"`: The domain's DNS propagation process has started but hasn't successfully completed yet.
|
|
1618
|
-
* + `"COMPLETED"`: The domain's DNS propagation process has successfully finished.
|
|
1619
|
-
* + `"FAILED"`: The domain's DNS propagation process has failed.
|
|
1620
|
-
* @readonly
|
|
1621
|
-
*/
|
|
1622
|
-
dnsPropagationStatus?: DnsPropagationStatus;
|
|
1623
|
-
/**
|
|
1624
|
-
* Expiration date of the registered domain in `YYYY-MM-DDThh:mm:ss.sssZ`
|
|
1625
|
-
* format.
|
|
1626
|
-
* @readonly
|
|
1627
|
-
*/
|
|
1628
|
-
expirationDate?: Date;
|
|
1629
|
-
}
|
|
1630
|
-
/** @oneof */
|
|
1631
|
-
interface RegisteredDomainStatusInfoOneOf {
|
|
1632
|
-
/**
|
|
1633
|
-
* Information about a domain that hasn't been successfully registered
|
|
1634
|
-
* yet. Includes the timestamp of the latest registration attempt.
|
|
1635
|
-
* @readonly
|
|
1636
|
-
*/
|
|
1637
|
-
pendingRegistrationInfo?: PendingRegistrationInfo;
|
|
1638
|
-
/**
|
|
1639
|
-
* Information about a domain that couldn't be registered. Includes
|
|
1640
|
-
* failure code and message.
|
|
1641
|
-
* @readonly
|
|
1642
|
-
*/
|
|
1643
|
-
failedRegistrationInfo?: FailedRegistrationInfo;
|
|
1644
|
-
}
|
|
1645
|
-
interface SiteInfo extends SiteInfoAssignmentInfoOneOf {
|
|
1646
|
-
/**
|
|
1647
|
-
* Extra details if `{"assignmentType": `"REDIRECT"}`.
|
|
1648
|
-
* @readonly
|
|
1649
|
-
*/
|
|
1650
|
-
redirectInfo?: RedirectAssignmentInfo;
|
|
1651
|
-
/**
|
|
1652
|
-
* ID of the site to which the domain is assigned.
|
|
1653
|
-
* @readonly
|
|
1654
|
-
*/
|
|
1655
|
-
_id?: string | null;
|
|
1656
|
-
/**
|
|
1657
|
-
* Whether the domain is assigned as the primary domain or a redirect.
|
|
1658
|
-
* Read more about [primary and redirected domains](https://support.wix.com/en/article/switching-your-primary-and-redirected-domains).
|
|
1659
|
-
* __Note:__ When you connect a domain or subdomain, you can't pass `"UNKNOWN_ASSIGNMENT_TYPE"`
|
|
1660
|
-
* in the request of the Create Registered Domain call.
|
|
1661
|
-
*
|
|
1662
|
-
* + `"UNKNOWN_ASSIGNMENT_TYPE"`: There's no information about the assignment type.
|
|
1663
|
-
* + `"PRIMARY"`: The domain is assigned as the primary domain to the Wix site.
|
|
1664
|
-
* + `"REDIRECT"`: The domain is assigned as a redirect to the Wix site.
|
|
1665
|
-
*/
|
|
1666
|
-
assignmentType?: AssignmentType;
|
|
1667
|
-
}
|
|
1668
|
-
/** @oneof */
|
|
1669
|
-
interface SiteInfoAssignmentInfoOneOf {
|
|
1670
|
-
/**
|
|
1671
|
-
* Extra details if `{"assignmentType": `"REDIRECT"}`.
|
|
1672
|
-
* @readonly
|
|
1673
|
-
*/
|
|
1674
|
-
redirectInfo?: RedirectAssignmentInfo;
|
|
1675
|
-
}
|
|
1676
|
-
declare enum AssignmentType {
|
|
1677
|
-
UNKNOWN_ASSIGNMENT_TYPE = "UNKNOWN_ASSIGNMENT_TYPE",
|
|
1678
|
-
PRIMARY = "PRIMARY",
|
|
1679
|
-
REDIRECT = "REDIRECT"
|
|
1680
|
-
}
|
|
1681
|
-
interface RedirectAssignmentInfo {
|
|
1682
|
-
/**
|
|
1683
|
-
* Primary domain the redirect points to.
|
|
1684
|
-
* @readonly
|
|
1685
|
-
*/
|
|
1686
|
-
primaryDomain?: string;
|
|
1687
|
-
}
|
|
1688
|
-
interface Contacts {
|
|
1689
|
-
/** Contact information for the domain registrant. */
|
|
1690
|
-
registrant?: ContactData;
|
|
1691
|
-
/** Contact information for the domain admin. */
|
|
1692
|
-
admin?: ContactData;
|
|
1693
|
-
/** Contact information for the tech support of the domain. */
|
|
1694
|
-
tech?: ContactData;
|
|
1695
|
-
}
|
|
1696
|
-
interface ContactData {
|
|
1697
|
-
/**
|
|
1698
|
-
* First name. Only
|
|
1699
|
-
* [alphanumerical characters](https://en.wikipedia.org/wiki/Alphanumericals)
|
|
1700
|
-
* are supported.
|
|
1701
|
-
*
|
|
1702
|
-
* Min: 2 characters
|
|
1703
|
-
* Max: 64 characters
|
|
1704
|
-
*/
|
|
1705
|
-
firstName?: string;
|
|
1706
|
-
/**
|
|
1707
|
-
* Last name. Only
|
|
1708
|
-
* [alphanumerical characters](https://en.wikipedia.org/wiki/Alphanumericals)
|
|
1709
|
-
* are supported.
|
|
1710
|
-
*
|
|
1711
|
-
* Min: 2 characters
|
|
1712
|
-
* Max: 64 characters
|
|
1713
|
-
*/
|
|
1714
|
-
lastName?: string;
|
|
1715
|
-
/**
|
|
1716
|
-
* Email address. Only
|
|
1717
|
-
* [alphanumerical characters](https://en.wikipedia.org/wiki/Alphanumericals)
|
|
1718
|
-
* and a single `@` are supported. Wix doesn't validate that the email address
|
|
1719
|
-
* exists.
|
|
1720
|
-
*
|
|
1721
|
-
* Min: 3 characters
|
|
1722
|
-
* Max: 64 characters before the `@` and 63 after
|
|
1723
|
-
*/
|
|
1724
|
-
email?: string;
|
|
1725
|
-
/**
|
|
1726
|
-
* Address details, including street name and house number. Only
|
|
1727
|
-
* [alphanumerical characters](https://en.wikipedia.org/wiki/Alphanumericals)
|
|
1728
|
-
* are supported.
|
|
1729
|
-
*
|
|
1730
|
-
* Min: 2 characters
|
|
1731
|
-
* Max: 64 characters
|
|
1732
|
-
*/
|
|
1733
|
-
address?: string;
|
|
1734
|
-
/**
|
|
1735
|
-
* City. Only
|
|
1736
|
-
* [alphanumerical characters](https://en.wikipedia.org/wiki/Alphanumericals)
|
|
1737
|
-
* are supported.
|
|
1738
|
-
*
|
|
1739
|
-
* Min: 2 characters
|
|
1740
|
-
* Max: 64 characters
|
|
1741
|
-
*/
|
|
1742
|
-
city?: string;
|
|
1743
|
-
/**
|
|
1744
|
-
* Subdivision code in
|
|
1745
|
-
* [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
|
|
1746
|
-
* format. Only
|
|
1747
|
-
* [alphanumerical characters](https://en.wikipedia.org/wiki/Alphanumericals)
|
|
1748
|
-
* are supported.
|
|
1749
|
-
* __Required__ for these countries:
|
|
1750
|
-
* `”AE"`, `"AR"`, `"AT"`, `"AU"`, `"BE"`, `"BR"`, `"CA"`, `"CH"`, `"CL"`,
|
|
1751
|
-
* `"CO"`, `"CR"`, `"CZ"`, `"DE"`, `"DK"`, `"ES"`, `"FI"`, `"FR"`, `"GR"`,
|
|
1752
|
-
* `"IE"`, `"IN"`, `"IT"`, `"JP"`, `"KR"`, `"MX"`, `"MY"`, `"NL"`, `"NO"`,
|
|
1753
|
-
* `"NZ"`, `"PE"`, `"PL"`, `"PT"`, `"RU"`, `"SE"`, `"SG"`, `"TH"`, `"TR"`,
|
|
1754
|
-
* `"TW"`, `"UA"`, `"US"`, `”ZA”`.
|
|
1755
|
-
*
|
|
1756
|
-
* Min: 2 characters
|
|
1757
|
-
* Max: 2 characters
|
|
1758
|
-
*/
|
|
1759
|
-
subdivisionCode?: string | null;
|
|
1760
|
-
/**
|
|
1761
|
-
* Postal code. Only
|
|
1762
|
-
* [alphanumerical characters](https://en.wikipedia.org/wiki/Alphanumericals)
|
|
1763
|
-
* are supported.
|
|
1764
|
-
*
|
|
1765
|
-
* Min: 2 characters
|
|
1766
|
-
* Max: 16 characters
|
|
1767
|
-
*/
|
|
1768
|
-
postalCode?: string | null;
|
|
1769
|
-
/**
|
|
1770
|
-
* Country code in
|
|
1771
|
-
* [ISO-3166 alpha-1](https://en.wikipedia.org/wiki/ISO_3166-2#Subdivisions_included_in_ISO_3166-1)
|
|
1772
|
-
* format. Only
|
|
1773
|
-
* [alphanumerical characters](https://en.wikipedia.org/wiki/Alphanumericals)
|
|
1774
|
-
* are supported. Wix doesn't validate that the postal code is valid for the
|
|
1775
|
-
* given country.
|
|
1776
|
-
*
|
|
1777
|
-
* Min: 2 characters
|
|
1778
|
-
* Max: 2 characters
|
|
1779
|
-
*/
|
|
1780
|
-
countryCode?: string;
|
|
1781
|
-
/**
|
|
1782
|
-
* Phone number. Only
|
|
1783
|
-
* [alphanumerical characters](https://en.wikipedia.org/wiki/Alphanumericals)
|
|
1784
|
-
* are supported. For example, `+15551234567`. Wix doesn't validate that the
|
|
1785
|
-
* phone number belongs to the specified country.
|
|
1786
|
-
*
|
|
1787
|
-
* Min: 2 characters
|
|
1788
|
-
* Max: 20 characters
|
|
1789
|
-
*/
|
|
1790
|
-
phone?: string;
|
|
1791
|
-
/**
|
|
1792
|
-
* Company name. Only
|
|
1793
|
-
* [alphanumerical characters](https://en.wikipedia.org/wiki/Alphanumericals)
|
|
1794
|
-
* are supported.
|
|
1795
|
-
*
|
|
1796
|
-
* Max: 2 characters
|
|
1797
|
-
* Max: 64 characters
|
|
1798
|
-
*/
|
|
1799
|
-
company?: string | null;
|
|
1800
|
-
}
|
|
1801
|
-
declare enum Status {
|
|
1802
|
-
UNKNOWN_STATUS = "UNKNOWN_STATUS",
|
|
1803
|
-
PENDING_REGISTRATION = "PENDING_REGISTRATION",
|
|
1804
|
-
ACTIVE = "ACTIVE",
|
|
1805
|
-
FAILED_REGISTRATION = "FAILED_REGISTRATION",
|
|
1806
|
-
CANCELED = "CANCELED"
|
|
1807
|
-
}
|
|
1808
|
-
interface PendingRegistrationInfo {
|
|
1809
|
-
/**
|
|
1810
|
-
* Information about the latest attempt to register
|
|
1811
|
-
* the domain. Wix tries to register the domain several times if the
|
|
1812
|
-
* first attempt is unsuccessful. You can contact the
|
|
1813
|
-
* [Wix B2B team](mailto:bizdev@wix.com)
|
|
1814
|
-
* for more information about the number of attempts and their timing.
|
|
1815
|
-
* @readonly
|
|
1816
|
-
*/
|
|
1817
|
-
latestAttempt?: LatestAttempt;
|
|
1818
|
-
}
|
|
1819
|
-
interface LatestAttempt {
|
|
1820
|
-
/**
|
|
1821
|
-
* Number of the latest attempt to register the domain.
|
|
1822
|
-
* @readonly
|
|
1823
|
-
*/
|
|
1824
|
-
number?: number;
|
|
1825
|
-
/**
|
|
1826
|
-
* Date and time of the latest domain registration attempt in
|
|
1827
|
-
* `YYYY-MM-DDThh:mm:ss.sssZ` format.
|
|
1828
|
-
* @readonly
|
|
1829
|
-
*/
|
|
1830
|
-
timestamp?: Date;
|
|
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: {};
|
|
1831
2636
|
}
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
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() {}
|
|
1846
2685
|
}
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
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: {};
|
|
1850
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
|
+
};
|
|
1851
2721
|
/**
|
|
1852
|
-
*
|
|
1853
|
-
*
|
|
1854
|
-
*
|
|
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).
|
|
1855
2726
|
*/
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
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
|
+
}
|
|
1874
2750
|
}
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
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;
|
|
1882
2762
|
/**
|
|
1883
|
-
*
|
|
1884
|
-
*
|
|
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.
|
|
1885
2766
|
*/
|
|
1886
|
-
|
|
2767
|
+
available?: boolean;
|
|
2768
|
+
/** Whether the domain has a higher price due to its perceived value or demand. */
|
|
2769
|
+
premium?: boolean;
|
|
1887
2770
|
}
|
|
1888
|
-
interface
|
|
2771
|
+
interface CheckDomainAvailabilityRequest {
|
|
1889
2772
|
/**
|
|
1890
|
-
*
|
|
1891
|
-
*
|
|
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
|
|
1892
2778
|
*/
|
|
1893
|
-
|
|
1894
|
-
}
|
|
1895
|
-
declare enum DnsPropagationStatus {
|
|
1896
|
-
UNKNOWN_DNS_PROPAGATION_STATUS = "UNKNOWN_DNS_PROPAGATION_STATUS",
|
|
1897
|
-
COMPLETED = "COMPLETED",
|
|
1898
|
-
FAILED = "FAILED",
|
|
1899
|
-
IN_PROGRESS = "IN_PROGRESS"
|
|
1900
|
-
}
|
|
1901
|
-
interface CreateRegisteredDomainRequest {
|
|
1902
|
-
/** Information about the domain to register including contact details. */
|
|
1903
|
-
registeredDomain: RegisteredDomain;
|
|
1904
|
-
}
|
|
1905
|
-
interface CreateRegisteredDomainResponse {
|
|
1906
|
-
/** Created registered domain. */
|
|
1907
|
-
registeredDomain?: RegisteredDomain;
|
|
2779
|
+
domain: string;
|
|
1908
2780
|
}
|
|
1909
|
-
interface
|
|
1910
|
-
/**
|
|
1911
|
-
|
|
2781
|
+
interface CheckDomainAvailabilityResponse {
|
|
2782
|
+
/** Information about the domain's availability. */
|
|
2783
|
+
availability?: DomainAvailability;
|
|
1912
2784
|
}
|
|
1913
|
-
interface
|
|
1914
|
-
|
|
1915
|
-
|
|
2785
|
+
interface DomainAvailabilityNonNullableFields {
|
|
2786
|
+
domain: string;
|
|
2787
|
+
available: boolean;
|
|
2788
|
+
premium: boolean;
|
|
1916
2789
|
}
|
|
1917
|
-
interface
|
|
1918
|
-
|
|
1919
|
-
paging?: CursorPaging$1;
|
|
2790
|
+
interface CheckDomainAvailabilityResponseNonNullableFields {
|
|
2791
|
+
availability?: DomainAvailabilityNonNullableFields;
|
|
1920
2792
|
}
|
|
1921
|
-
|
|
2793
|
+
|
|
2794
|
+
declare function checkDomainAvailability$1(httpClient: HttpClient$1): CheckDomainAvailabilitySignature;
|
|
2795
|
+
interface CheckDomainAvailabilitySignature {
|
|
1922
2796
|
/**
|
|
1923
|
-
*
|
|
2797
|
+
* Checks whether the given domain is available for purchase.
|
|
1924
2798
|
*
|
|
1925
|
-
* Min: `0`
|
|
1926
|
-
* Max: `100`
|
|
1927
|
-
*/
|
|
1928
|
-
limit?: number | null;
|
|
1929
|
-
/**
|
|
1930
|
-
* Pointer to the next or previous page in the list of results.
|
|
1931
2799
|
*
|
|
1932
|
-
* You can
|
|
1933
|
-
*
|
|
1934
|
-
*
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
interface CursorPagingMetadata$1 {
|
|
1945
|
-
/** Number of domains returned in the response. */
|
|
1946
|
-
count?: number | null;
|
|
1947
|
-
/** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
|
|
1948
|
-
cursors?: Cursors$1;
|
|
1949
|
-
/**
|
|
1950
|
-
* Indicates if there are more results after the current page.
|
|
1951
|
-
* If `true`, another page of results can be retrieved.
|
|
1952
|
-
* If `false`, this is the last page.
|
|
1953
|
-
*/
|
|
1954
|
-
hasNext?: boolean | null;
|
|
1955
|
-
}
|
|
1956
|
-
interface Cursors$1 {
|
|
1957
|
-
/** Cursor pointing to next page in the list of results. */
|
|
1958
|
-
next?: string | null;
|
|
1959
|
-
/** Cursor pointing to previous page in the list of results. */
|
|
1960
|
-
prev?: string | null;
|
|
1961
|
-
}
|
|
1962
|
-
interface DeleteRegisteredDomainByIdRequest {
|
|
1963
|
-
/** ID of the registered domain to delete. */
|
|
1964
|
-
registeredDomainId?: string;
|
|
1965
|
-
}
|
|
1966
|
-
interface DeleteRegisteredDomainByIdResponse {
|
|
1967
|
-
}
|
|
1968
|
-
interface RedeemRegisteredDomainRequest {
|
|
1969
|
-
/**
|
|
1970
|
-
* ID of the registered domain to redeem. Identical to the domain name
|
|
1971
|
-
* including TLD.
|
|
1972
|
-
*/
|
|
1973
|
-
registeredDomainId: string;
|
|
1974
|
-
}
|
|
1975
|
-
interface RedeemRegisteredDomainResponse {
|
|
1976
|
-
/** Registered domain to redeem. */
|
|
1977
|
-
registeredDomain?: RegisteredDomain;
|
|
1978
|
-
}
|
|
1979
|
-
interface DomainEvent extends DomainEventBodyOneOf {
|
|
1980
|
-
createdEvent?: EntityCreatedEvent;
|
|
1981
|
-
updatedEvent?: EntityUpdatedEvent;
|
|
1982
|
-
deletedEvent?: EntityDeletedEvent;
|
|
1983
|
-
actionEvent?: ActionEvent;
|
|
1984
|
-
/**
|
|
1985
|
-
* Unique event ID.
|
|
1986
|
-
* Allows clients to ignore duplicate webhooks.
|
|
1987
|
-
*/
|
|
1988
|
-
_id?: string;
|
|
1989
|
-
/**
|
|
1990
|
-
* Assumes actions are also always typed to an entity_type
|
|
1991
|
-
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
1992
|
-
*/
|
|
1993
|
-
entityFqdn?: string;
|
|
1994
|
-
/**
|
|
1995
|
-
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
1996
|
-
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
1997
|
-
* Example: created/updated/deleted/started/completed/email_opened
|
|
1998
|
-
*/
|
|
1999
|
-
slug?: string;
|
|
2000
|
-
/** ID of the entity associated with the event. */
|
|
2001
|
-
entityId?: string;
|
|
2002
|
-
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
2003
|
-
eventTime?: Date;
|
|
2004
|
-
/**
|
|
2005
|
-
* Whether the event was triggered as a result of a privacy regulation application
|
|
2006
|
-
* (for example, GDPR).
|
|
2007
|
-
*/
|
|
2008
|
-
triggeredByAnonymizeRequest?: boolean | null;
|
|
2009
|
-
/** If present, indicates the action that triggered the event. */
|
|
2010
|
-
originatedFrom?: string | null;
|
|
2011
|
-
/**
|
|
2012
|
-
* A sequence number defining the order of updates to the underlying entity.
|
|
2013
|
-
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
2014
|
-
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
2015
|
-
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
2016
|
-
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
2017
|
-
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
2018
|
-
*/
|
|
2019
|
-
entityEventSequence?: string | null;
|
|
2020
|
-
}
|
|
2021
|
-
/** @oneof */
|
|
2022
|
-
interface DomainEventBodyOneOf {
|
|
2023
|
-
createdEvent?: EntityCreatedEvent;
|
|
2024
|
-
updatedEvent?: EntityUpdatedEvent;
|
|
2025
|
-
deletedEvent?: EntityDeletedEvent;
|
|
2026
|
-
actionEvent?: ActionEvent;
|
|
2027
|
-
}
|
|
2028
|
-
interface EntityCreatedEvent {
|
|
2029
|
-
entity?: string;
|
|
2030
|
-
}
|
|
2031
|
-
interface RestoreInfo {
|
|
2032
|
-
deletedDate?: Date;
|
|
2033
|
-
}
|
|
2034
|
-
interface EntityUpdatedEvent {
|
|
2035
|
-
/**
|
|
2036
|
-
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
2037
|
-
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
2038
|
-
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
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
|
|
2039
2812
|
*/
|
|
2040
|
-
|
|
2041
|
-
}
|
|
2042
|
-
interface EntityDeletedEvent {
|
|
2043
|
-
/** Entity that was deleted */
|
|
2044
|
-
deletedEntity?: string | null;
|
|
2045
|
-
}
|
|
2046
|
-
interface ActionEvent {
|
|
2047
|
-
body?: string;
|
|
2048
|
-
}
|
|
2049
|
-
interface MessageEnvelope {
|
|
2050
|
-
/** App instance ID. */
|
|
2051
|
-
instanceId?: string | null;
|
|
2052
|
-
/** Event type. */
|
|
2053
|
-
eventType?: string;
|
|
2054
|
-
/** The identification type and identity data. */
|
|
2055
|
-
identity?: IdentificationData;
|
|
2056
|
-
/** Stringify payload. */
|
|
2057
|
-
data?: string;
|
|
2058
|
-
}
|
|
2059
|
-
interface IdentificationData extends IdentificationDataIdOneOf {
|
|
2060
|
-
/** ID of a site visitor that has not logged in to the site. */
|
|
2061
|
-
anonymousVisitorId?: string;
|
|
2062
|
-
/** ID of a site visitor that has logged in to the site. */
|
|
2063
|
-
memberId?: string;
|
|
2064
|
-
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
2065
|
-
wixUserId?: string;
|
|
2066
|
-
/** ID of an app. */
|
|
2067
|
-
appId?: string;
|
|
2068
|
-
/** @readonly */
|
|
2069
|
-
identityType?: WebhookIdentityType;
|
|
2070
|
-
}
|
|
2071
|
-
/** @oneof */
|
|
2072
|
-
interface IdentificationDataIdOneOf {
|
|
2073
|
-
/** ID of a site visitor that has not logged in to the site. */
|
|
2074
|
-
anonymousVisitorId?: string;
|
|
2075
|
-
/** ID of a site visitor that has logged in to the site. */
|
|
2076
|
-
memberId?: string;
|
|
2077
|
-
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
2078
|
-
wixUserId?: string;
|
|
2079
|
-
/** ID of an app. */
|
|
2080
|
-
appId?: string;
|
|
2081
|
-
}
|
|
2082
|
-
declare enum WebhookIdentityType {
|
|
2083
|
-
UNKNOWN = "UNKNOWN",
|
|
2084
|
-
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
2085
|
-
MEMBER = "MEMBER",
|
|
2086
|
-
WIX_USER = "WIX_USER",
|
|
2087
|
-
APP = "APP"
|
|
2088
|
-
}
|
|
2089
|
-
interface LatestAttemptNonNullableFields {
|
|
2090
|
-
number: number;
|
|
2091
|
-
}
|
|
2092
|
-
interface PendingRegistrationInfoNonNullableFields {
|
|
2093
|
-
latestAttempt?: LatestAttemptNonNullableFields;
|
|
2094
|
-
}
|
|
2095
|
-
interface FailedRegistrationInfoNonNullableFields {
|
|
2096
|
-
code: FailureCode;
|
|
2097
|
-
message: string;
|
|
2098
|
-
}
|
|
2099
|
-
interface RedirectAssignmentInfoNonNullableFields {
|
|
2100
|
-
primaryDomain: string;
|
|
2101
|
-
}
|
|
2102
|
-
interface SiteInfoNonNullableFields {
|
|
2103
|
-
redirectInfo?: RedirectAssignmentInfoNonNullableFields;
|
|
2104
|
-
assignmentType: AssignmentType;
|
|
2105
|
-
}
|
|
2106
|
-
interface ContactDataNonNullableFields {
|
|
2107
|
-
firstName: string;
|
|
2108
|
-
lastName: string;
|
|
2109
|
-
email: string;
|
|
2110
|
-
address: string;
|
|
2111
|
-
city: string;
|
|
2112
|
-
countryCode: string;
|
|
2113
|
-
phone: string;
|
|
2114
|
-
}
|
|
2115
|
-
interface ContactsNonNullableFields {
|
|
2116
|
-
registrant?: ContactDataNonNullableFields;
|
|
2117
|
-
admin?: ContactDataNonNullableFields;
|
|
2118
|
-
tech?: ContactDataNonNullableFields;
|
|
2119
|
-
}
|
|
2120
|
-
interface PendingNonNullableFields {
|
|
2121
|
-
notConfirmedBy: string[];
|
|
2122
|
-
}
|
|
2123
|
-
interface ExpiredNonNullableFields {
|
|
2124
|
-
notConfirmedBy: string[];
|
|
2125
|
-
}
|
|
2126
|
-
interface ICANNConfirmationStatusInfoNonNullableFields {
|
|
2127
|
-
pending?: PendingNonNullableFields;
|
|
2128
|
-
expired?: ExpiredNonNullableFields;
|
|
2129
|
-
}
|
|
2130
|
-
interface RegisteredDomainNonNullableFields {
|
|
2131
|
-
pendingRegistrationInfo?: PendingRegistrationInfoNonNullableFields;
|
|
2132
|
-
failedRegistrationInfo?: FailedRegistrationInfoNonNullableFields;
|
|
2133
|
-
_id: string;
|
|
2134
|
-
domain: string;
|
|
2135
|
-
productInstanceId: string;
|
|
2136
|
-
siteInfo?: SiteInfoNonNullableFields;
|
|
2137
|
-
contacts?: ContactsNonNullableFields;
|
|
2138
|
-
status: Status;
|
|
2139
|
-
icannConfirmationStatus: ICANNConfirmationStatus;
|
|
2140
|
-
icannConfirmationStatusInfo?: ICANNConfirmationStatusInfoNonNullableFields;
|
|
2141
|
-
dnsPropagationStatus: DnsPropagationStatus;
|
|
2142
|
-
}
|
|
2143
|
-
interface CreateRegisteredDomainResponseNonNullableFields {
|
|
2144
|
-
registeredDomain?: RegisteredDomainNonNullableFields;
|
|
2145
|
-
}
|
|
2146
|
-
interface GetRegisteredDomainResponseNonNullableFields {
|
|
2147
|
-
registeredDomain?: RegisteredDomainNonNullableFields;
|
|
2813
|
+
(domain: string): Promise<CheckDomainAvailabilityResponse & CheckDomainAvailabilityResponseNonNullableFields>;
|
|
2148
2814
|
}
|
|
2149
|
-
|
|
2150
|
-
|
|
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 };
|
|
2151
2825
|
}
|
|
2152
|
-
|
|
2153
|
-
|
|
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;
|
|
2154
2871
|
}
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
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
|
+
}
|
|
2158
2957
|
}
|
|
2159
2958
|
|
|
2160
|
-
declare
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
}
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
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; }'
|
|
2234
3084
|
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
declare const listRegisteredDomains: MaybeContext<BuildRESTFunction<typeof listRegisteredDomains$1> & typeof listRegisteredDomains$1>;
|
|
2238
|
-
declare const redeemRegisteredDomain: MaybeContext<BuildRESTFunction<typeof redeemRegisteredDomain$1> & typeof redeemRegisteredDomain$1>;
|
|
3085
|
+
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
3086
|
+
//=> {a: number} & Partial<Record<"b", never>>
|
|
2239
3087
|
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
type context$2_ContactData = ContactData;
|
|
2244
|
-
type context$2_Contacts = Contacts;
|
|
2245
|
-
type context$2_CreateRegisteredDomainRequest = CreateRegisteredDomainRequest;
|
|
2246
|
-
type context$2_CreateRegisteredDomainResponse = CreateRegisteredDomainResponse;
|
|
2247
|
-
type context$2_CreateRegisteredDomainResponseNonNullableFields = CreateRegisteredDomainResponseNonNullableFields;
|
|
2248
|
-
type context$2_DeleteRegisteredDomainByIdRequest = DeleteRegisteredDomainByIdRequest;
|
|
2249
|
-
type context$2_DeleteRegisteredDomainByIdResponse = DeleteRegisteredDomainByIdResponse;
|
|
2250
|
-
type context$2_DnsPropagationStatus = DnsPropagationStatus;
|
|
2251
|
-
declare const context$2_DnsPropagationStatus: typeof DnsPropagationStatus;
|
|
2252
|
-
type context$2_DomainEvent = DomainEvent;
|
|
2253
|
-
type context$2_DomainEventBodyOneOf = DomainEventBodyOneOf;
|
|
2254
|
-
type context$2_EntityCreatedEvent = EntityCreatedEvent;
|
|
2255
|
-
type context$2_EntityDeletedEvent = EntityDeletedEvent;
|
|
2256
|
-
type context$2_EntityUpdatedEvent = EntityUpdatedEvent;
|
|
2257
|
-
type context$2_Expired = Expired;
|
|
2258
|
-
type context$2_FailedRegistrationInfo = FailedRegistrationInfo;
|
|
2259
|
-
type context$2_FailureCode = FailureCode;
|
|
2260
|
-
declare const context$2_FailureCode: typeof FailureCode;
|
|
2261
|
-
type context$2_GetRegisteredDomainRequest = GetRegisteredDomainRequest;
|
|
2262
|
-
type context$2_GetRegisteredDomainResponse = GetRegisteredDomainResponse;
|
|
2263
|
-
type context$2_GetRegisteredDomainResponseNonNullableFields = GetRegisteredDomainResponseNonNullableFields;
|
|
2264
|
-
type context$2_ICANNConfirmationStatus = ICANNConfirmationStatus;
|
|
2265
|
-
declare const context$2_ICANNConfirmationStatus: typeof ICANNConfirmationStatus;
|
|
2266
|
-
type context$2_ICANNConfirmationStatusInfo = ICANNConfirmationStatusInfo;
|
|
2267
|
-
type context$2_ICANNConfirmationStatusInfoStatusOneOf = ICANNConfirmationStatusInfoStatusOneOf;
|
|
2268
|
-
type context$2_IdentificationData = IdentificationData;
|
|
2269
|
-
type context$2_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
|
|
2270
|
-
type context$2_LatestAttempt = LatestAttempt;
|
|
2271
|
-
type context$2_ListRegisteredDomainsOptions = ListRegisteredDomainsOptions;
|
|
2272
|
-
type context$2_ListRegisteredDomainsRequest = ListRegisteredDomainsRequest;
|
|
2273
|
-
type context$2_ListRegisteredDomainsResponse = ListRegisteredDomainsResponse;
|
|
2274
|
-
type context$2_ListRegisteredDomainsResponseNonNullableFields = ListRegisteredDomainsResponseNonNullableFields;
|
|
2275
|
-
type context$2_MessageEnvelope = MessageEnvelope;
|
|
2276
|
-
type context$2_Pending = Pending;
|
|
2277
|
-
type context$2_PendingRegistrationInfo = PendingRegistrationInfo;
|
|
2278
|
-
type context$2_RedeemRegisteredDomainRequest = RedeemRegisteredDomainRequest;
|
|
2279
|
-
type context$2_RedeemRegisteredDomainResponse = RedeemRegisteredDomainResponse;
|
|
2280
|
-
type context$2_RedeemRegisteredDomainResponseNonNullableFields = RedeemRegisteredDomainResponseNonNullableFields;
|
|
2281
|
-
type context$2_RedirectAssignmentInfo = RedirectAssignmentInfo;
|
|
2282
|
-
type context$2_RegisteredDomain = RegisteredDomain;
|
|
2283
|
-
type context$2_RegisteredDomainNonNullableFields = RegisteredDomainNonNullableFields;
|
|
2284
|
-
type context$2_RegisteredDomainStatusInfoOneOf = RegisteredDomainStatusInfoOneOf;
|
|
2285
|
-
type context$2_RestoreInfo = RestoreInfo;
|
|
2286
|
-
type context$2_SiteInfo = SiteInfo;
|
|
2287
|
-
type context$2_SiteInfoAssignmentInfoOneOf = SiteInfoAssignmentInfoOneOf;
|
|
2288
|
-
type context$2_Status = Status;
|
|
2289
|
-
declare const context$2_Status: typeof Status;
|
|
2290
|
-
type context$2_WebhookIdentityType = WebhookIdentityType;
|
|
2291
|
-
declare const context$2_WebhookIdentityType: typeof WebhookIdentityType;
|
|
2292
|
-
declare const context$2_createRegisteredDomain: typeof createRegisteredDomain;
|
|
2293
|
-
declare const context$2_getRegisteredDomain: typeof getRegisteredDomain;
|
|
2294
|
-
declare const context$2_listRegisteredDomains: typeof listRegisteredDomains;
|
|
2295
|
-
declare const context$2_redeemRegisteredDomain: typeof redeemRegisteredDomain;
|
|
2296
|
-
declare namespace context$2 {
|
|
2297
|
-
export { type context$2_ActionEvent as ActionEvent, context$2_AssignmentType as AssignmentType, type context$2_ContactData as ContactData, type context$2_Contacts as Contacts, type context$2_CreateRegisteredDomainRequest as CreateRegisteredDomainRequest, type context$2_CreateRegisteredDomainResponse as CreateRegisteredDomainResponse, type context$2_CreateRegisteredDomainResponseNonNullableFields as CreateRegisteredDomainResponseNonNullableFields, type CursorPaging$1 as CursorPaging, type CursorPagingMetadata$1 as CursorPagingMetadata, type Cursors$1 as Cursors, type context$2_DeleteRegisteredDomainByIdRequest as DeleteRegisteredDomainByIdRequest, type context$2_DeleteRegisteredDomainByIdResponse as DeleteRegisteredDomainByIdResponse, context$2_DnsPropagationStatus as DnsPropagationStatus, type context$2_DomainEvent as DomainEvent, type context$2_DomainEventBodyOneOf as DomainEventBodyOneOf, type context$2_EntityCreatedEvent as EntityCreatedEvent, type context$2_EntityDeletedEvent as EntityDeletedEvent, type context$2_EntityUpdatedEvent as EntityUpdatedEvent, type context$2_Expired as Expired, type context$2_FailedRegistrationInfo as FailedRegistrationInfo, context$2_FailureCode as FailureCode, type context$2_GetRegisteredDomainRequest as GetRegisteredDomainRequest, type context$2_GetRegisteredDomainResponse as GetRegisteredDomainResponse, type context$2_GetRegisteredDomainResponseNonNullableFields as GetRegisteredDomainResponseNonNullableFields, context$2_ICANNConfirmationStatus as ICANNConfirmationStatus, type context$2_ICANNConfirmationStatusInfo as ICANNConfirmationStatusInfo, type context$2_ICANNConfirmationStatusInfoStatusOneOf as ICANNConfirmationStatusInfoStatusOneOf, type context$2_IdentificationData as IdentificationData, type context$2_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type context$2_LatestAttempt as LatestAttempt, type context$2_ListRegisteredDomainsOptions as ListRegisteredDomainsOptions, type context$2_ListRegisteredDomainsRequest as ListRegisteredDomainsRequest, type context$2_ListRegisteredDomainsResponse as ListRegisteredDomainsResponse, type context$2_ListRegisteredDomainsResponseNonNullableFields as ListRegisteredDomainsResponseNonNullableFields, type context$2_MessageEnvelope as MessageEnvelope, type context$2_Pending as Pending, type context$2_PendingRegistrationInfo as PendingRegistrationInfo, type context$2_RedeemRegisteredDomainRequest as RedeemRegisteredDomainRequest, type context$2_RedeemRegisteredDomainResponse as RedeemRegisteredDomainResponse, type context$2_RedeemRegisteredDomainResponseNonNullableFields as RedeemRegisteredDomainResponseNonNullableFields, type context$2_RedirectAssignmentInfo as RedirectAssignmentInfo, type context$2_RegisteredDomain as RegisteredDomain, type context$2_RegisteredDomainNonNullableFields as RegisteredDomainNonNullableFields, type context$2_RegisteredDomainStatusInfoOneOf as RegisteredDomainStatusInfoOneOf, type context$2_RestoreInfo as RestoreInfo, type context$2_SiteInfo as SiteInfo, type context$2_SiteInfoAssignmentInfoOneOf as SiteInfoAssignmentInfoOneOf, context$2_Status as Status, context$2_WebhookIdentityType as WebhookIdentityType, context$2_createRegisteredDomain as createRegisteredDomain, context$2_getRegisteredDomain as getRegisteredDomain, context$2_listRegisteredDomains as listRegisteredDomains, context$2_redeemRegisteredDomain as redeemRegisteredDomain };
|
|
2298
|
-
}
|
|
3088
|
+
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
3089
|
+
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
3090
|
+
```
|
|
2299
3091
|
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
}
|
|
2322
|
-
interface CheckDomainAvailabilityResponse {
|
|
2323
|
-
/** Information about the domain's availability. */
|
|
2324
|
-
availability?: DomainAvailability;
|
|
2325
|
-
}
|
|
2326
|
-
interface DomainAvailabilityNonNullableFields {
|
|
2327
|
-
domain: string;
|
|
2328
|
-
available: boolean;
|
|
2329
|
-
premium: boolean;
|
|
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: {};
|
|
2330
3114
|
}
|
|
2331
|
-
|
|
2332
|
-
|
|
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() {}
|
|
2333
3163
|
}
|
|
2334
3164
|
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
* @param - Domain name. Must include the TLD. For example, `my-new-domain.com`. Only
|
|
2349
|
-
* alphanumeric characters, hyphens, and dots are supported.
|
|
2350
|
-
*
|
|
2351
|
-
* Min: 3 characters
|
|
2352
|
-
* Max: 63 characters
|
|
2353
|
-
*/
|
|
2354
|
-
(domain: string): Promise<CheckDomainAvailabilityResponse & CheckDomainAvailabilityResponseNonNullableFields>;
|
|
3165
|
+
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
3166
|
+
//=> {run: () => void}
|
|
3167
|
+
```
|
|
3168
|
+
|
|
3169
|
+
@example
|
|
3170
|
+
```
|
|
3171
|
+
import type {ConditionalExcept} from 'type-fest';
|
|
3172
|
+
|
|
3173
|
+
interface Example {
|
|
3174
|
+
a: string;
|
|
3175
|
+
b: string | number;
|
|
3176
|
+
c: () => void;
|
|
3177
|
+
d: {};
|
|
2355
3178
|
}
|
|
2356
3179
|
|
|
2357
|
-
|
|
3180
|
+
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
3181
|
+
//=> {b: string | number; c: () => void; d: {}}
|
|
3182
|
+
```
|
|
2358
3183
|
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
type
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
3184
|
+
@category Object
|
|
3185
|
+
*/
|
|
3186
|
+
type ConditionalExcept<Base, Condition> = Except<
|
|
3187
|
+
Base,
|
|
3188
|
+
ConditionalKeys<Base, Condition>
|
|
3189
|
+
>;
|
|
3190
|
+
|
|
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
|
+
};
|
|
3224
|
+
|
|
3225
|
+
declare global {
|
|
3226
|
+
interface ContextualClient {
|
|
3227
|
+
}
|
|
2366
3228
|
}
|
|
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;
|
|
2367
3236
|
|
|
2368
3237
|
interface DomainSuggestion {
|
|
2369
3238
|
/** Suggested domain name including TLD. */
|
|
@@ -2540,4 +3409,4 @@ declare namespace context {
|
|
|
2540
3409
|
export { type context_CursorPaging as CursorPaging, type context_CursorPagingMetadata as CursorPagingMetadata, type context_Cursors as Cursors, type context_DomainSuggestion as DomainSuggestion, type context_SuggestDomainsOptions as SuggestDomainsOptions, type context_SuggestDomainsRequest as SuggestDomainsRequest, type context_SuggestDomainsResponse as SuggestDomainsResponse, type context_SuggestDomainsResponseNonNullableFields as SuggestDomainsResponseNonNullableFields, context_suggestDomains as suggestDomains };
|
|
2541
3410
|
}
|
|
2542
3411
|
|
|
2543
|
-
export { context$
|
|
3412
|
+
export { context$3 as connectedDomainSetupInfo, context$4 as connectedDomains, context$1 as domainAvailability, context$2 as domainDns, context as domainSuggestions };
|