@wix/forms 1.0.153 → 1.0.154
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/type-bundles/context.bundle.d.ts +1143 -323
- package/type-bundles/index.bundle.d.ts +1143 -323
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
type HostModule<T, H extends Host> = {
|
|
1
|
+
type HostModule$2<T, H extends Host$2> = {
|
|
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$2<T extends HostModule$2<any, any>> = T extends HostModule$2<infer U, any> ? U : never;
|
|
6
|
+
type Host$2<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$2<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$2) => T;
|
|
40
|
+
interface HttpClient$2 {
|
|
41
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<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$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
|
|
47
|
+
type HttpResponse$2<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$2<_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$2;
|
|
60
|
+
type APIMetadata$2 = {
|
|
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$2<T extends RESTFunctionDescriptor$2> = T extends RESTFunctionDescriptor$2<infer U> ? U : never;
|
|
66
|
+
type EventDefinition$2<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$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
|
|
74
|
+
type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
|
|
75
|
+
type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
|
|
76
76
|
|
|
77
|
-
type ServicePluginMethodInput = {
|
|
77
|
+
type ServicePluginMethodInput$2 = {
|
|
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$2 = Record<string, (payload: ServicePluginMethodInput$2) => unknown | Promise<unknown>>;
|
|
82
|
+
type ServicePluginMethodMetadata$2 = {
|
|
83
83
|
name: string;
|
|
84
84
|
primaryHttpMappingPath: string;
|
|
85
85
|
transformations: {
|
|
86
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput;
|
|
86
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput$2;
|
|
87
87
|
toREST: (...args: unknown[]) => unknown;
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
|
-
type ServicePluginDefinition<Contract extends ServicePluginContract> = {
|
|
90
|
+
type ServicePluginDefinition$2<Contract extends ServicePluginContract$2> = {
|
|
91
91
|
__type: 'service-plugin-definition';
|
|
92
92
|
componentType: string;
|
|
93
|
-
methods: ServicePluginMethodMetadata[];
|
|
93
|
+
methods: ServicePluginMethodMetadata$2[];
|
|
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$2<Contract extends ServicePluginContract$2>(componentType: string, methods: ServicePluginMethodMetadata$2[]): ServicePluginDefinition$2<Contract>;
|
|
97
|
+
type BuildServicePluginDefinition$2<T extends ServicePluginDefinition$2<any>> = (implementation: T['__contract']) => void;
|
|
98
|
+
declare const SERVICE_PLUGIN_ERROR_TYPE$2 = "wix_spi_error";
|
|
99
99
|
|
|
100
|
-
type RequestContext = {
|
|
100
|
+
type RequestContext$2 = {
|
|
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$2 = (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$2 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
112
|
+
type AmbassadorRequestOptions$2<T = any> = {
|
|
113
113
|
_?: T;
|
|
114
114
|
url?: string;
|
|
115
|
-
method?: Method;
|
|
115
|
+
method?: Method$2;
|
|
116
116
|
params?: any;
|
|
117
117
|
data?: any;
|
|
118
|
-
transformResponse?: ResponseTransformer | ResponseTransformer[];
|
|
118
|
+
transformResponse?: ResponseTransformer$2 | ResponseTransformer$2[];
|
|
119
119
|
};
|
|
120
|
-
type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
|
|
120
|
+
type AmbassadorFactory$2<Request, Response> = (payload: Request) => ((context: RequestContext$2) => AmbassadorRequestOptions$2<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$2<Request = any, Response = any> = AmbassadorFactory$2<Request, Response>;
|
|
124
|
+
type BuildAmbassadorFunction$2<T extends AmbassadorFunctionDescriptor$2> = T extends AmbassadorFunctionDescriptor$2<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$2: 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$2 = {[emptyObjectSymbol$2]?: 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$2<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$2<KeyType, ExcludeType> = IsEqual$2<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
223
223
|
|
|
224
|
-
type ExceptOptions = {
|
|
224
|
+
type ExceptOptions$2 = {
|
|
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$2<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$2 = {requireExactProps: false}> = {
|
|
269
|
+
[KeyType in keyof ObjectType as Filter$2<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$2<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$2<Base, Condition> = Except$2<
|
|
361
361
|
Base,
|
|
362
|
-
ConditionalKeys<Base, Condition>
|
|
362
|
+
ConditionalKeys$2<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$2 = RESTFunctionDescriptor$2 | AmbassadorFunctionDescriptor$2 | HostModule$2<any, any> | EventDefinition$2<any> | ServicePluginDefinition$2<any> | {
|
|
371
|
+
[key: string]: Descriptors$2 | PublicMetadata$2 | 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$2<T extends Descriptors$2, H extends Host$2<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$2;
|
|
383
|
+
} ? 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<{
|
|
384
|
+
[Key in keyof T]: T[Key] extends Descriptors$2 ? BuildDescriptors$2<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$2>;
|
|
394
394
|
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
395
|
-
type PublicMetadata = {
|
|
395
|
+
type PublicMetadata$2 = {
|
|
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$2<T extends Descriptors$2> = globalThis.ContextualClient extends {
|
|
408
|
+
host: Host$2;
|
|
409
|
+
} ? BuildDescriptors$2<T, globalThis.ContextualClient['host']> : T;
|
|
410
410
|
|
|
411
411
|
interface Form$1 {
|
|
412
412
|
/**
|
|
@@ -5004,7 +5004,7 @@ interface UpdateExtendedFieldsOptions {
|
|
|
5004
5004
|
namespaceData: Record<string, any> | null;
|
|
5005
5005
|
}
|
|
5006
5006
|
|
|
5007
|
-
declare function createForm$1(httpClient: HttpClient): CreateFormSignature;
|
|
5007
|
+
declare function createForm$1(httpClient: HttpClient$2): CreateFormSignature;
|
|
5008
5008
|
interface CreateFormSignature {
|
|
5009
5009
|
/**
|
|
5010
5010
|
* Creates a new form.
|
|
@@ -5013,14 +5013,14 @@ interface CreateFormSignature {
|
|
|
5013
5013
|
*/
|
|
5014
5014
|
(form: Form$1): Promise<Form$1 & FormNonNullableFields>;
|
|
5015
5015
|
}
|
|
5016
|
-
declare function bulkCreateForm$1(httpClient: HttpClient): BulkCreateFormSignature;
|
|
5016
|
+
declare function bulkCreateForm$1(httpClient: HttpClient$2): BulkCreateFormSignature;
|
|
5017
5017
|
interface BulkCreateFormSignature {
|
|
5018
5018
|
/**
|
|
5019
5019
|
* Creates multiple new forms.
|
|
5020
5020
|
*/
|
|
5021
5021
|
(options?: BulkCreateFormOptions | undefined): Promise<BulkCreateFormResponse & BulkCreateFormResponseNonNullableFields>;
|
|
5022
5022
|
}
|
|
5023
|
-
declare function cloneForm$1(httpClient: HttpClient): CloneFormSignature;
|
|
5023
|
+
declare function cloneForm$1(httpClient: HttpClient$2): CloneFormSignature;
|
|
5024
5024
|
interface CloneFormSignature {
|
|
5025
5025
|
/**
|
|
5026
5026
|
* Clones an existing form.
|
|
@@ -5028,7 +5028,7 @@ interface CloneFormSignature {
|
|
|
5028
5028
|
*/
|
|
5029
5029
|
(formId: string): Promise<CloneFormResponse & CloneFormResponseNonNullableFields>;
|
|
5030
5030
|
}
|
|
5031
|
-
declare function getForm$1(httpClient: HttpClient): GetFormSignature;
|
|
5031
|
+
declare function getForm$1(httpClient: HttpClient$2): GetFormSignature;
|
|
5032
5032
|
interface GetFormSignature {
|
|
5033
5033
|
/**
|
|
5034
5034
|
* Gets a form by id.
|
|
@@ -5037,7 +5037,7 @@ interface GetFormSignature {
|
|
|
5037
5037
|
*/
|
|
5038
5038
|
(formId: string, options?: GetFormOptions | undefined): Promise<Form$1 & FormNonNullableFields>;
|
|
5039
5039
|
}
|
|
5040
|
-
declare function updateForm$1(httpClient: HttpClient): UpdateFormSignature;
|
|
5040
|
+
declare function updateForm$1(httpClient: HttpClient$2): UpdateFormSignature;
|
|
5041
5041
|
interface UpdateFormSignature {
|
|
5042
5042
|
/**
|
|
5043
5043
|
* Updates a form, supports partial update.
|
|
@@ -5047,7 +5047,7 @@ interface UpdateFormSignature {
|
|
|
5047
5047
|
*/
|
|
5048
5048
|
(_id: string | null, form: UpdateForm): Promise<Form$1 & FormNonNullableFields>;
|
|
5049
5049
|
}
|
|
5050
|
-
declare function removeFormFromTrashBin$1(httpClient: HttpClient): RemoveFormFromTrashBinSignature;
|
|
5050
|
+
declare function removeFormFromTrashBin$1(httpClient: HttpClient$2): RemoveFormFromTrashBinSignature;
|
|
5051
5051
|
interface RemoveFormFromTrashBinSignature {
|
|
5052
5052
|
/**
|
|
5053
5053
|
* Deletes a form. It is stored in trash for 90 days.
|
|
@@ -5056,7 +5056,7 @@ interface RemoveFormFromTrashBinSignature {
|
|
|
5056
5056
|
*/
|
|
5057
5057
|
(formId: string): Promise<void>;
|
|
5058
5058
|
}
|
|
5059
|
-
declare function deleteForm$1(httpClient: HttpClient): DeleteFormSignature;
|
|
5059
|
+
declare function deleteForm$1(httpClient: HttpClient$2): DeleteFormSignature;
|
|
5060
5060
|
interface DeleteFormSignature {
|
|
5061
5061
|
/**
|
|
5062
5062
|
* Deletes a form. It is stored in trash for 90 days.
|
|
@@ -5065,7 +5065,7 @@ interface DeleteFormSignature {
|
|
|
5065
5065
|
*/
|
|
5066
5066
|
(formId: string, options?: DeleteFormOptions | undefined): Promise<void>;
|
|
5067
5067
|
}
|
|
5068
|
-
declare function restoreFromTrashBin$1(httpClient: HttpClient): RestoreFromTrashBinSignature;
|
|
5068
|
+
declare function restoreFromTrashBin$1(httpClient: HttpClient$2): RestoreFromTrashBinSignature;
|
|
5069
5069
|
interface RestoreFromTrashBinSignature {
|
|
5070
5070
|
/**
|
|
5071
5071
|
* Restores a form from trash.
|
|
@@ -5073,14 +5073,14 @@ interface RestoreFromTrashBinSignature {
|
|
|
5073
5073
|
*/
|
|
5074
5074
|
(formId: string): Promise<RestoreFromTrashBinResponse & RestoreFromTrashBinResponseNonNullableFields>;
|
|
5075
5075
|
}
|
|
5076
|
-
declare function queryForms$1(httpClient: HttpClient): QueryFormsSignature;
|
|
5076
|
+
declare function queryForms$1(httpClient: HttpClient$2): QueryFormsSignature;
|
|
5077
5077
|
interface QueryFormsSignature {
|
|
5078
5078
|
/**
|
|
5079
5079
|
* Query forms using [WQL - Wix Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
|
|
5080
5080
|
*/
|
|
5081
5081
|
(options?: QueryFormsOptions | undefined): FormsQueryBuilder;
|
|
5082
5082
|
}
|
|
5083
|
-
declare function countForms$1(httpClient: HttpClient): CountFormsSignature;
|
|
5083
|
+
declare function countForms$1(httpClient: HttpClient$2): CountFormsSignature;
|
|
5084
5084
|
interface CountFormsSignature {
|
|
5085
5085
|
/**
|
|
5086
5086
|
* Counts forms.
|
|
@@ -5088,7 +5088,7 @@ interface CountFormsSignature {
|
|
|
5088
5088
|
*/
|
|
5089
5089
|
(namespace: string, options?: CountFormsOptions | undefined): Promise<CountFormsResponse & CountFormsResponseNonNullableFields>;
|
|
5090
5090
|
}
|
|
5091
|
-
declare function listForms$1(httpClient: HttpClient): ListFormsSignature;
|
|
5091
|
+
declare function listForms$1(httpClient: HttpClient$2): ListFormsSignature;
|
|
5092
5092
|
interface ListFormsSignature {
|
|
5093
5093
|
/**
|
|
5094
5094
|
* Lists forms, filtered by namespace and its disabled status. If specified, sorts forms in the desired order.
|
|
@@ -5097,7 +5097,7 @@ interface ListFormsSignature {
|
|
|
5097
5097
|
*/
|
|
5098
5098
|
(namespace: string, options?: ListFormsOptions | undefined): Promise<ListFormsResponse & ListFormsResponseNonNullableFields>;
|
|
5099
5099
|
}
|
|
5100
|
-
declare function getDeletedForm$1(httpClient: HttpClient): GetDeletedFormSignature;
|
|
5100
|
+
declare function getDeletedForm$1(httpClient: HttpClient$2): GetDeletedFormSignature;
|
|
5101
5101
|
interface GetDeletedFormSignature {
|
|
5102
5102
|
/**
|
|
5103
5103
|
* Get a deleted Form by id
|
|
@@ -5105,7 +5105,7 @@ interface GetDeletedFormSignature {
|
|
|
5105
5105
|
*/
|
|
5106
5106
|
(formId: string): Promise<GetDeletedFormResponse & GetDeletedFormResponseNonNullableFields>;
|
|
5107
5107
|
}
|
|
5108
|
-
declare function queryDeletedForms$1(httpClient: HttpClient): QueryDeletedFormsSignature;
|
|
5108
|
+
declare function queryDeletedForms$1(httpClient: HttpClient$2): QueryDeletedFormsSignature;
|
|
5109
5109
|
interface QueryDeletedFormsSignature {
|
|
5110
5110
|
/**
|
|
5111
5111
|
* Query deleted Forms using [WQL - Wix Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language)
|
|
@@ -5113,7 +5113,7 @@ interface QueryDeletedFormsSignature {
|
|
|
5113
5113
|
*/
|
|
5114
5114
|
(query: CursorQuery$2): Promise<QueryDeletedFormsResponse & QueryDeletedFormsResponseNonNullableFields>;
|
|
5115
5115
|
}
|
|
5116
|
-
declare function listDeletedForms$1(httpClient: HttpClient): ListDeletedFormsSignature;
|
|
5116
|
+
declare function listDeletedForms$1(httpClient: HttpClient$2): ListDeletedFormsSignature;
|
|
5117
5117
|
interface ListDeletedFormsSignature {
|
|
5118
5118
|
/**
|
|
5119
5119
|
* List deleted Forms
|
|
@@ -5121,7 +5121,7 @@ interface ListDeletedFormsSignature {
|
|
|
5121
5121
|
*/
|
|
5122
5122
|
(namespace: string, options?: ListDeletedFormsOptions | undefined): Promise<ListDeletedFormsResponse & ListDeletedFormsResponseNonNullableFields>;
|
|
5123
5123
|
}
|
|
5124
|
-
declare function bulkRemoveDeletedField$1(httpClient: HttpClient): BulkRemoveDeletedFieldSignature;
|
|
5124
|
+
declare function bulkRemoveDeletedField$1(httpClient: HttpClient$2): BulkRemoveDeletedFieldSignature;
|
|
5125
5125
|
interface BulkRemoveDeletedFieldSignature {
|
|
5126
5126
|
/**
|
|
5127
5127
|
* Remove delete field by its target
|
|
@@ -5129,7 +5129,7 @@ interface BulkRemoveDeletedFieldSignature {
|
|
|
5129
5129
|
*/
|
|
5130
5130
|
(formId: string, options?: BulkRemoveDeletedFieldOptions | undefined): Promise<BulkRemoveDeletedFieldResponse & BulkRemoveDeletedFieldResponseNonNullableFields>;
|
|
5131
5131
|
}
|
|
5132
|
-
declare function updateExtendedFields$1(httpClient: HttpClient): UpdateExtendedFieldsSignature;
|
|
5132
|
+
declare function updateExtendedFields$1(httpClient: HttpClient$2): UpdateExtendedFieldsSignature;
|
|
5133
5133
|
interface UpdateExtendedFieldsSignature {
|
|
5134
5134
|
/**
|
|
5135
5135
|
* Update Extended Fields of the Form
|
|
@@ -5138,7 +5138,7 @@ interface UpdateExtendedFieldsSignature {
|
|
|
5138
5138
|
*/
|
|
5139
5139
|
(_id: string, namespace: string, options: UpdateExtendedFieldsOptions): Promise<UpdateExtendedFieldsResponse & UpdateExtendedFieldsResponseNonNullableFields>;
|
|
5140
5140
|
}
|
|
5141
|
-
declare function listFormsProvidersConfigs$1(httpClient: HttpClient): ListFormsProvidersConfigsSignature;
|
|
5141
|
+
declare function listFormsProvidersConfigs$1(httpClient: HttpClient$2): ListFormsProvidersConfigsSignature;
|
|
5142
5142
|
interface ListFormsProvidersConfigsSignature {
|
|
5143
5143
|
/**
|
|
5144
5144
|
* List configurations set by apps providing ability to create forms under their domain.
|
|
@@ -5146,23 +5146,23 @@ interface ListFormsProvidersConfigsSignature {
|
|
|
5146
5146
|
(): Promise<ListFormsProvidersConfigsResponse & ListFormsProvidersConfigsResponseNonNullableFields>;
|
|
5147
5147
|
}
|
|
5148
5148
|
|
|
5149
|
-
declare const createForm: MaybeContext<BuildRESTFunction<typeof createForm$1> & typeof createForm$1>;
|
|
5150
|
-
declare const bulkCreateForm: MaybeContext<BuildRESTFunction<typeof bulkCreateForm$1> & typeof bulkCreateForm$1>;
|
|
5151
|
-
declare const cloneForm: MaybeContext<BuildRESTFunction<typeof cloneForm$1> & typeof cloneForm$1>;
|
|
5152
|
-
declare const getForm: MaybeContext<BuildRESTFunction<typeof getForm$1> & typeof getForm$1>;
|
|
5153
|
-
declare const updateForm: MaybeContext<BuildRESTFunction<typeof updateForm$1> & typeof updateForm$1>;
|
|
5154
|
-
declare const removeFormFromTrashBin: MaybeContext<BuildRESTFunction<typeof removeFormFromTrashBin$1> & typeof removeFormFromTrashBin$1>;
|
|
5155
|
-
declare const deleteForm: MaybeContext<BuildRESTFunction<typeof deleteForm$1> & typeof deleteForm$1>;
|
|
5156
|
-
declare const restoreFromTrashBin: MaybeContext<BuildRESTFunction<typeof restoreFromTrashBin$1> & typeof restoreFromTrashBin$1>;
|
|
5157
|
-
declare const queryForms: MaybeContext<BuildRESTFunction<typeof queryForms$1> & typeof queryForms$1>;
|
|
5158
|
-
declare const countForms: MaybeContext<BuildRESTFunction<typeof countForms$1> & typeof countForms$1>;
|
|
5159
|
-
declare const listForms: MaybeContext<BuildRESTFunction<typeof listForms$1> & typeof listForms$1>;
|
|
5160
|
-
declare const getDeletedForm: MaybeContext<BuildRESTFunction<typeof getDeletedForm$1> & typeof getDeletedForm$1>;
|
|
5161
|
-
declare const queryDeletedForms: MaybeContext<BuildRESTFunction<typeof queryDeletedForms$1> & typeof queryDeletedForms$1>;
|
|
5162
|
-
declare const listDeletedForms: MaybeContext<BuildRESTFunction<typeof listDeletedForms$1> & typeof listDeletedForms$1>;
|
|
5163
|
-
declare const bulkRemoveDeletedField: MaybeContext<BuildRESTFunction<typeof bulkRemoveDeletedField$1> & typeof bulkRemoveDeletedField$1>;
|
|
5164
|
-
declare const updateExtendedFields: MaybeContext<BuildRESTFunction<typeof updateExtendedFields$1> & typeof updateExtendedFields$1>;
|
|
5165
|
-
declare const listFormsProvidersConfigs: MaybeContext<BuildRESTFunction<typeof listFormsProvidersConfigs$1> & typeof listFormsProvidersConfigs$1>;
|
|
5149
|
+
declare const createForm: MaybeContext$2<BuildRESTFunction$2<typeof createForm$1> & typeof createForm$1>;
|
|
5150
|
+
declare const bulkCreateForm: MaybeContext$2<BuildRESTFunction$2<typeof bulkCreateForm$1> & typeof bulkCreateForm$1>;
|
|
5151
|
+
declare const cloneForm: MaybeContext$2<BuildRESTFunction$2<typeof cloneForm$1> & typeof cloneForm$1>;
|
|
5152
|
+
declare const getForm: MaybeContext$2<BuildRESTFunction$2<typeof getForm$1> & typeof getForm$1>;
|
|
5153
|
+
declare const updateForm: MaybeContext$2<BuildRESTFunction$2<typeof updateForm$1> & typeof updateForm$1>;
|
|
5154
|
+
declare const removeFormFromTrashBin: MaybeContext$2<BuildRESTFunction$2<typeof removeFormFromTrashBin$1> & typeof removeFormFromTrashBin$1>;
|
|
5155
|
+
declare const deleteForm: MaybeContext$2<BuildRESTFunction$2<typeof deleteForm$1> & typeof deleteForm$1>;
|
|
5156
|
+
declare const restoreFromTrashBin: MaybeContext$2<BuildRESTFunction$2<typeof restoreFromTrashBin$1> & typeof restoreFromTrashBin$1>;
|
|
5157
|
+
declare const queryForms: MaybeContext$2<BuildRESTFunction$2<typeof queryForms$1> & typeof queryForms$1>;
|
|
5158
|
+
declare const countForms: MaybeContext$2<BuildRESTFunction$2<typeof countForms$1> & typeof countForms$1>;
|
|
5159
|
+
declare const listForms: MaybeContext$2<BuildRESTFunction$2<typeof listForms$1> & typeof listForms$1>;
|
|
5160
|
+
declare const getDeletedForm: MaybeContext$2<BuildRESTFunction$2<typeof getDeletedForm$1> & typeof getDeletedForm$1>;
|
|
5161
|
+
declare const queryDeletedForms: MaybeContext$2<BuildRESTFunction$2<typeof queryDeletedForms$1> & typeof queryDeletedForms$1>;
|
|
5162
|
+
declare const listDeletedForms: MaybeContext$2<BuildRESTFunction$2<typeof listDeletedForms$1> & typeof listDeletedForms$1>;
|
|
5163
|
+
declare const bulkRemoveDeletedField: MaybeContext$2<BuildRESTFunction$2<typeof bulkRemoveDeletedField$1> & typeof bulkRemoveDeletedField$1>;
|
|
5164
|
+
declare const updateExtendedFields: MaybeContext$2<BuildRESTFunction$2<typeof updateExtendedFields$1> & typeof updateExtendedFields$1>;
|
|
5165
|
+
declare const listFormsProvidersConfigs: MaybeContext$2<BuildRESTFunction$2<typeof listFormsProvidersConfigs$1> & typeof listFormsProvidersConfigs$1>;
|
|
5166
5166
|
|
|
5167
5167
|
type index_d$2_BulkCreateFormOptions = BulkCreateFormOptions;
|
|
5168
5168
|
type index_d$2_BulkCreateFormRequest = BulkCreateFormRequest;
|
|
@@ -5262,122 +5262,532 @@ declare namespace index_d$2 {
|
|
|
5262
5262
|
export { type ActionEvent$2 as ActionEvent, type AddressInfo$1 as AddressInfo, type AddressLine2$1 as AddressLine2, Alignment$1 as Alignment, type AnchorData$1 as AnchorData, type AppEmbedData$1 as AppEmbedData, type AppEmbedDataAppDataOneOf$1 as AppEmbedDataAppDataOneOf, AppType$1 as AppType, type ApplicationError$2 as ApplicationError, type ArrayErrorMessages$1 as ArrayErrorMessages, type ArrayItems$1 as ArrayItems, type ArrayItemsItemsOneOf$1 as ArrayItemsItemsOneOf, type ArrayType$1 as ArrayType, type ArrayTypeArrayItems$1 as ArrayTypeArrayItems, type ArrayTypeArrayItemsItemTypeOptionsOneOf$1 as ArrayTypeArrayItemsItemTypeOptionsOneOf, type AudioData$1 as AudioData, type Background$1 as Background, type BackgroundBackgroundOneOf$1 as BackgroundBackgroundOneOf, BackgroundType$1 as BackgroundType, type BlockquoteData$1 as BlockquoteData, type BookingData$1 as BookingData, BooleanComponentType$1 as BooleanComponentType, type BooleanErrorMessages$1 as BooleanErrorMessages, type BooleanType$1 as BooleanType, type Border$1 as Border, type BorderColors$1 as BorderColors, type BreakPoint$1 as BreakPoint, type BulkActionMetadata$2 as BulkActionMetadata, type index_d$2_BulkCreateFormOptions as BulkCreateFormOptions, type index_d$2_BulkCreateFormRequest as BulkCreateFormRequest, type index_d$2_BulkCreateFormResponse as BulkCreateFormResponse, type index_d$2_BulkCreateFormResponseNonNullableFields as BulkCreateFormResponseNonNullableFields, type index_d$2_BulkFormResult as BulkFormResult, type index_d$2_BulkRemoveDeletedFieldOptions as BulkRemoveDeletedFieldOptions, type index_d$2_BulkRemoveDeletedFieldRequest as BulkRemoveDeletedFieldRequest, type index_d$2_BulkRemoveDeletedFieldResponse as BulkRemoveDeletedFieldResponse, type index_d$2_BulkRemoveDeletedFieldResponseNonNullableFields as BulkRemoveDeletedFieldResponseNonNullableFields, type BulletedListData$1 as BulletedListData, type ButtonData$1 as ButtonData, ButtonDataType$1 as ButtonDataType, type CellStyle$1 as CellStyle, type Checkbox$1 as Checkbox, type CheckboxGroup$1 as CheckboxGroup, type index_d$2_CloneFormRequest as CloneFormRequest, type index_d$2_CloneFormResponse as CloneFormResponse, type index_d$2_CloneFormResponseNonNullableFields as CloneFormResponseNonNullableFields, type CodeBlockData$1 as CodeBlockData, type CollapsibleListData$1 as CollapsibleListData, type ColorData$1 as ColorData, type Colors$1 as Colors, type CommonCustomOption$1 as CommonCustomOption, ComponentType$1 as ComponentType, ContactField$1 as ContactField, index_d$2_CountFormsFieldset as CountFormsFieldset, type index_d$2_CountFormsOptions as CountFormsOptions, type index_d$2_CountFormsRequest as CountFormsRequest, type index_d$2_CountFormsResponse as CountFormsResponse, type index_d$2_CountFormsResponseNonNullableFields as CountFormsResponseNonNullableFields, type index_d$2_CreateFormRequest as CreateFormRequest, type index_d$2_CreateFormResponse as CreateFormResponse, type index_d$2_CreateFormResponseNonNullableFields as CreateFormResponseNonNullableFields, Crop$1 as Crop, type CursorPaging$2 as CursorPaging, type CursorPagingMetadata$2 as CursorPagingMetadata, type CursorQuery$2 as CursorQuery, type CursorQueryPagingMethodOneOf$2 as CursorQueryPagingMethodOneOf, type Cursors$2 as Cursors, type CustomFieldInfo$1 as CustomFieldInfo, type CustomOption$1 as CustomOption, type DataExtensionsDetails$1 as DataExtensionsDetails, type DateInput$1 as DateInput, type DateOptions$1 as DateOptions, type DatePicker$1 as DatePicker, type DatePickerOptions$1 as DatePickerOptions, type DateTimeConstraints$1 as DateTimeConstraints, type DateTimeInput$1 as DateTimeInput, type DateTimeInputDateTimeInputTypeOptionsOneOf$1 as DateTimeInputDateTimeInputTypeOptionsOneOf, DateTimeInputType$1 as DateTimeInputType, type DateTimeOptions$1 as DateTimeOptions, type Decoration$1 as Decoration, type DecorationDataOneOf$1 as DecorationDataOneOf, DecorationType$1 as DecorationType, type DefaultCountryConfig$1 as DefaultCountryConfig, type DefaultCountryConfigOptionsOneOf$1 as DefaultCountryConfigOptionsOneOf, type index_d$2_DeleteFormOptions as DeleteFormOptions, type index_d$2_DeleteFormRequest as DeleteFormRequest, type index_d$2_DeleteFormResponse as DeleteFormResponse, type Design$1 as Design, type Dimensions$1 as Dimensions, Direction$1 as Direction, type DisplayField$1 as DisplayField, type DisplayFieldComponentTypeOneOf$1 as DisplayFieldComponentTypeOneOf, type DividerData$1 as DividerData, type DocumentStyle$1 as DocumentStyle, type DomainEvent$2 as DomainEvent, type DomainEventBodyOneOf$2 as DomainEventBodyOneOf, type DonationInput$1 as DonationInput, type DonationInputOption$1 as DonationInputOption, type Dropdown$1 as Dropdown, type DropdownCustomOption$1 as DropdownCustomOption, type DropdownOption$1 as DropdownOption, type DynamicPriceOptions$1 as DynamicPriceOptions, type EmailInfo$1 as EmailInfo, EmailInfoTag$1 as EmailInfoTag, type EmbedData$1 as EmbedData, type Empty$2 as Empty, type EntityCreatedEvent$2 as EntityCreatedEvent, type EntityDeletedEvent$2 as EntityDeletedEvent, type EntityUpdatedEvent$2 as EntityUpdatedEvent, type EventData$1 as EventData, type ExtendedFields$2 as ExtendedFields, type FieldGroup$1 as FieldGroup, type FieldOverrides$1 as FieldOverrides, FieldType$1 as FieldType, type FieldsOverrides$1 as FieldsOverrides, type FieldsSettings$1 as FieldsSettings, index_d$2_Fieldset as Fieldset, type FileData$1 as FileData, type FileSource$1 as FileSource, type FileSourceDataOneOf$1 as FileSourceDataOneOf, type FileUpload$1 as FileUpload, FirstDayOfWeek$1 as FirstDayOfWeek, FirstDayOfWeekEnumFirstDayOfWeek$1 as FirstDayOfWeekEnumFirstDayOfWeek, type FixedPriceOptions$1 as FixedPriceOptions, type FontSizeData$1 as FontSizeData, FontType$1 as FontType, type Form$1 as Form, type index_d$2_FormChanged as FormChanged, type index_d$2_FormDeleted as FormDeleted, type FormField$1 as FormField, type FormFieldContactInfo$1 as FormFieldContactInfo, type FormFieldContactInfoAdditionalInfoOneOf$1 as FormFieldContactInfoAdditionalInfoOneOf, type FormFieldV2$1 as FormFieldV2, type FormFieldV2FieldTypeOptionsOneOf$1 as FormFieldV2FieldTypeOptionsOneOf, type FormLayout$1 as FormLayout, type index_d$2_FormNonNullableFields as FormNonNullableFields, type FormOverride$1 as FormOverride, type FormProperties$1 as FormProperties, type index_d$2_FormProviderRestrictions as FormProviderRestrictions, type FormRule$1 as FormRule, Format$1 as Format, FormatEnumFormat$1 as FormatEnumFormat, type index_d$2_FormsQueryBuilder as FormsQueryBuilder, type index_d$2_FormsQueryResult as FormsQueryResult, type index_d$2_FormsSchemaProvidersConfig as FormsSchemaProvidersConfig, type GIF$1 as GIF, type GIFData$1 as GIFData, type GalleryData$1 as GalleryData, type GalleryOptions$1 as GalleryOptions, type index_d$2_GetDeletedFormRequest as GetDeletedFormRequest, type index_d$2_GetDeletedFormResponse as GetDeletedFormResponse, type index_d$2_GetDeletedFormResponseNonNullableFields as GetDeletedFormResponseNonNullableFields, type index_d$2_GetFormOptions as GetFormOptions, type index_d$2_GetFormRequest as GetFormRequest, type index_d$2_GetFormResponse as GetFormResponse, type index_d$2_GetFormResponseNonNullableFields as GetFormResponseNonNullableFields, type Gradient$1 as Gradient, type Group$1 as Group, type HTMLData$1 as HTMLData, type HTMLDataDataOneOf$1 as HTMLDataDataOneOf, type Header$1 as Header, type HeadingData$1 as HeadingData, type Height$1 as Height, type IdentificationData$2 as IdentificationData, type IdentificationDataIdOneOf$2 as IdentificationDataIdOneOf, type Image$1 as Image, type ImageData$1 as ImageData, ImageFit$1 as ImageFit, InitialExpandedItems$1 as InitialExpandedItems, type InputField$1 as InputField, type InputFieldArrayErrorMessages$1 as InputFieldArrayErrorMessages, type InputFieldArrayType$1 as InputFieldArrayType, type InputFieldBooleanErrorMessages$1 as InputFieldBooleanErrorMessages, type InputFieldBooleanType$1 as InputFieldBooleanType, type InputFieldInputTypeOptionsOneOf$1 as InputFieldInputTypeOptionsOneOf, type InputFieldIntegerType$1 as InputFieldIntegerType, type InputFieldMultilineAddress$1 as InputFieldMultilineAddress, type InputFieldMultilineAddressComponentTypeOptionsOneOf$1 as InputFieldMultilineAddressComponentTypeOptionsOneOf, type InputFieldNumberErrorMessages$1 as InputFieldNumberErrorMessages, type InputFieldNumberType$1 as InputFieldNumberType, type InputFieldObjectErrorMessages$1 as InputFieldObjectErrorMessages, type InputFieldObjectType$1 as InputFieldObjectType, type InputFieldStringErrorMessages$1 as InputFieldStringErrorMessages, type InputFieldStringType$1 as InputFieldStringType, type InputFieldStringTypeFormatOptionsOneOf$1 as InputFieldStringTypeFormatOptionsOneOf, InputType$1 as InputType, type IntegerType$1 as IntegerType, type Item$1 as Item, type ItemDataOneOf$1 as ItemDataOneOf, type ItemLayout$1 as ItemLayout, type ItemLayoutItemOneOf$1 as ItemLayoutItemOneOf, type ItemMetadata$2 as ItemMetadata, type ItemStyle$1 as ItemStyle, ItemType$1 as ItemType, Kind$1 as Kind, type Layout$1 as Layout, LayoutType$1 as LayoutType, type LimitationRule$1 as LimitationRule, LineStyle$1 as LineStyle, type Link$1 as Link, type LinkData$1 as LinkData, type LinkDataOneOf$1 as LinkDataOneOf, type LinkPreviewData$1 as LinkPreviewData, LinkTarget$1 as LinkTarget, type index_d$2_ListDeletedFormsOptions as ListDeletedFormsOptions, index_d$2_ListDeletedFormsOrder as ListDeletedFormsOrder, type index_d$2_ListDeletedFormsRequest as ListDeletedFormsRequest, type index_d$2_ListDeletedFormsResponse as ListDeletedFormsResponse, type index_d$2_ListDeletedFormsResponseNonNullableFields as ListDeletedFormsResponseNonNullableFields, type index_d$2_ListFormsOptions as ListFormsOptions, index_d$2_ListFormsOrder as ListFormsOrder, type index_d$2_ListFormsProvidersConfigsRequest as ListFormsProvidersConfigsRequest, type index_d$2_ListFormsProvidersConfigsResponse as ListFormsProvidersConfigsResponse, type index_d$2_ListFormsProvidersConfigsResponseNonNullableFields as ListFormsProvidersConfigsResponseNonNullableFields, type index_d$2_ListFormsRequest as ListFormsRequest, type index_d$2_ListFormsResponse as ListFormsResponse, type index_d$2_ListFormsResponseNonNullableFields as ListFormsResponseNonNullableFields, type ListValue$1 as ListValue, type MapData$1 as MapData, type MapSettings$1 as MapSettings, MapType$1 as MapType, type Margin$1 as Margin, type Media$1 as Media, type MediaItem$1 as MediaItem, type MediaItemMediaOneOf$1 as MediaItemMediaOneOf, type MentionData$1 as MentionData, type MessageEnvelope$2 as MessageEnvelope, type Metadata$1 as Metadata, type MultilineAddress$1 as MultilineAddress, MultilineAddressComponentType$1 as MultilineAddressComponentType, type MultilineAddressValidation$1 as MultilineAddressValidation, type NestedForm$1 as NestedForm, type NestedFormFieldOverrides$1 as NestedFormFieldOverrides, type NestedFormOverrides$1 as NestedFormOverrides, type Node$1 as Node, type NodeDataOneOf$1 as NodeDataOneOf, type NodeStyle$1 as NodeStyle, NodeType$1 as NodeType, NullValue$1 as NullValue, NumberComponentType$1 as NumberComponentType, type NumberErrorMessages$1 as NumberErrorMessages, type NumberInput$1 as NumberInput, NumberOfColumns$1 as NumberOfColumns, type NumberType$1 as NumberType, type ObjectErrorMessages$1 as ObjectErrorMessages, type ObjectType$1 as ObjectType, type ObjectTypePropertiesType$1 as ObjectTypePropertiesType, type ObjectTypePropertiesTypePropertiesTypeOptionsOneOf$1 as ObjectTypePropertiesTypePropertiesTypeOptionsOneOf, type Oembed$1 as Oembed, OptInLevel$1 as OptInLevel, type Option$1 as Option, type OptionDesign$1 as OptionDesign, type OptionLayout$1 as OptionLayout, type OrderedListData$1 as OrderedListData, Orientation$1 as Orientation, OverrideEntityType$1 as OverrideEntityType, type PDFSettings$1 as PDFSettings, type ParagraphData$1 as ParagraphData, type Payment$1 as Payment, PaymentComponentType$1 as PaymentComponentType, type PaymentComponentTypeOptionsOneOf$1 as PaymentComponentTypeOptionsOneOf, type PaymentInput$1 as PaymentInput, type PaymentType$1 as PaymentType, type Permissions$1 as Permissions, type PhoneConstraints$1 as PhoneConstraints, type PhoneInfo$1 as PhoneInfo, PhoneInfoTag$1 as PhoneInfoTag, type PhoneInput$1 as PhoneInput, type index_d$2_PiiFieldsUpdated as PiiFieldsUpdated, type PlaybackOptions$1 as PlaybackOptions, type PluginContainerData$1 as PluginContainerData, PluginContainerDataAlignment$1 as PluginContainerDataAlignment, type PluginContainerDataWidth$1 as PluginContainerDataWidth, type PluginContainerDataWidthDataOneOf$1 as PluginContainerDataWidthDataOneOf, type Poll$1 as Poll, type PollData$1 as PollData, type PollDataLayout$1 as PollDataLayout, type PollDesign$1 as PollDesign, type PollLayout$1 as PollLayout, PollLayoutDirection$1 as PollLayoutDirection, PollLayoutType$1 as PollLayoutType, type PollOption$1 as PollOption, type PostSubmissionTriggers$1 as PostSubmissionTriggers, type PredefinedValidation$1 as PredefinedValidation, type PredefinedValidationFormatOptionsOneOf$1 as PredefinedValidationFormatOptionsOneOf, PriceType$1 as PriceType, type Product$1 as Product, type ProductCheckboxGroup$1 as ProductCheckboxGroup, type ProductCheckboxGroupOption$1 as ProductCheckboxGroupOption, type ProductPriceOptionsOneOf$1 as ProductPriceOptionsOneOf, ProductType$1 as ProductType, type PropertiesType$1 as PropertiesType, PropertiesTypeEnum$1 as PropertiesTypeEnum, type PropertiesTypePropertiesTypeOneOf$1 as PropertiesTypePropertiesTypeOneOf, type QuantityLimit$1 as QuantityLimit, type index_d$2_QueryDeletedFormsRequest as QueryDeletedFormsRequest, type index_d$2_QueryDeletedFormsResponse as QueryDeletedFormsResponse, type index_d$2_QueryDeletedFormsResponseNonNullableFields as QueryDeletedFormsResponseNonNullableFields, type index_d$2_QueryFormsOptions as QueryFormsOptions, type index_d$2_QueryFormsRequest as QueryFormsRequest, type index_d$2_QueryFormsResponse as QueryFormsResponse, type index_d$2_QueryFormsResponseNonNullableFields as QueryFormsResponseNonNullableFields, type RadioGroup$1 as RadioGroup, type RadioGroupCustomOption$1 as RadioGroupCustomOption, type RadioGroupOption$1 as RadioGroupOption, type RatingInput$1 as RatingInput, type Redirect$1 as Redirect, type RedirectOptions$1 as RedirectOptions, type Rel$1 as Rel, type index_d$2_RemoveFormFromTrashBinRequest as RemoveFormFromTrashBinRequest, type index_d$2_RemoveFormFromTrashBinResponse as RemoveFormFromTrashBinResponse, RequiredIndicator$1 as RequiredIndicator, RequiredIndicatorPlacement$1 as RequiredIndicatorPlacement, type RequiredIndicatorProperties$1 as RequiredIndicatorProperties, type index_d$2_RestoreFromTrashBinRequest as RestoreFromTrashBinRequest, type index_d$2_RestoreFromTrashBinResponse as RestoreFromTrashBinResponse, type index_d$2_RestoreFromTrashBinResponseNonNullableFields as RestoreFromTrashBinResponseNonNullableFields, type RestoreInfo$2 as RestoreInfo, type RichContent$1 as RichContent, type RichText$1 as RichText, type Section$1 as Section, type Settings$1 as Settings, type Signature$1 as Signature, SortOrder$2 as SortOrder, type Sorting$2 as Sorting, Source$1 as Source, SpamFilterProtectionLevel$1 as SpamFilterProtectionLevel, type Spoiler$1 as Spoiler, type SpoilerData$1 as SpoilerData, type Step$1 as Step, StringComponentType$1 as StringComponentType, type StringErrorMessages$1 as StringErrorMessages, type StringType$1 as StringType, type StringTypeDateTimeConstraints$1 as StringTypeDateTimeConstraints, type StringTypeFormatOptionsOneOf$1 as StringTypeFormatOptionsOneOf, type StringTypePhoneConstraints$1 as StringTypePhoneConstraints, type Styles$1 as Styles, type index_d$2_SubmissionKeysPermanentlyDeleted as SubmissionKeysPermanentlyDeleted, type SubmitButton$1 as SubmitButton, type SubmitButtonSubmitActionOneOf$1 as SubmitButtonSubmitActionOneOf, type SubmitSettings$1 as SubmitSettings, type SubmitSettingsSubmitSuccessActionOptionsOneOf$1 as SubmitSettingsSubmitSuccessActionOptionsOneOf, SubmitSuccessAction$1 as SubmitSuccessAction, type SubscriptionInfo$1 as SubscriptionInfo, type TableCellData$1 as TableCellData, type TableData$1 as TableData, Tag$1 as Tag, type Tags$1 as Tags, type TagsOption$1 as TagsOption, Target$1 as Target, TextAlignment$1 as TextAlignment, type TextData$1 as TextData, type TextInput$1 as TextInput, type TextNodeStyle$1 as TextNodeStyle, type TextStyle$1 as TextStyle, type ThankYouMessage$1 as ThankYouMessage, type ThankYouMessageOptions$1 as ThankYouMessageOptions, type Thumbnails$1 as Thumbnails, ThumbnailsAlignment$1 as ThumbnailsAlignment, type TimeInput$1 as TimeInput, type TimeOptions$1 as TimeOptions, Type$1 as Type, type index_d$2_UpdateExtendedFieldsOptions as UpdateExtendedFieldsOptions, type index_d$2_UpdateExtendedFieldsRequest as UpdateExtendedFieldsRequest, type index_d$2_UpdateExtendedFieldsResponse as UpdateExtendedFieldsResponse, type index_d$2_UpdateExtendedFieldsResponseNonNullableFields as UpdateExtendedFieldsResponseNonNullableFields, type index_d$2_UpdateForm as UpdateForm, type index_d$2_UpdateFormRequest as UpdateFormRequest, type index_d$2_UpdateFormResponse as UpdateFormResponse, type index_d$2_UpdateFormResponseNonNullableFields as UpdateFormResponseNonNullableFields, UploadFileFormat$1 as UploadFileFormat, type UpsertContact$1 as UpsertContact, UrlTargetEnumTarget$1 as UrlTargetEnumTarget, type Validation$1 as Validation, ValidationFormat$1 as ValidationFormat, type ValidationValidationOneOf$1 as ValidationValidationOneOf, VerticalAlignment$1 as VerticalAlignment, type Video$1 as Video, type VideoData$1 as VideoData, ViewMode$1 as ViewMode, ViewRole$1 as ViewRole, VoteRole$1 as VoteRole, WebhookIdentityType$2 as WebhookIdentityType, Width$1 as Width, WidthType$1 as WidthType, type WixFile$1 as WixFile, WixFileComponentType$1 as WixFileComponentType, type WixFileComponentTypeOptionsOneOf$1 as WixFileComponentTypeOptionsOneOf, type _Array$1 as _Array, type _ArrayComponentTypeOptionsOneOf$1 as _ArrayComponentTypeOptionsOneOf, type _Boolean$1 as _Boolean, type _BooleanComponentTypeOptionsOneOf$1 as _BooleanComponentTypeOptionsOneOf, type _Number$1 as _Number, type _NumberComponentTypeOptionsOneOf$1 as _NumberComponentTypeOptionsOneOf, type _Object$1 as _Object, type _ObjectValidationOneOf$1 as _ObjectValidationOneOf, type _String$1 as _String, type _StringComponentTypeOptionsOneOf$1 as _StringComponentTypeOptionsOneOf, index_d$2_bulkCreateForm as bulkCreateForm, index_d$2_bulkRemoveDeletedField as bulkRemoveDeletedField, index_d$2_cloneForm as cloneForm, index_d$2_countForms as countForms, index_d$2_createForm as createForm, index_d$2_deleteForm as deleteForm, index_d$2_getDeletedForm as getDeletedForm, index_d$2_getForm as getForm, index_d$2_listDeletedForms as listDeletedForms, index_d$2_listForms as listForms, index_d$2_listFormsProvidersConfigs as listFormsProvidersConfigs, index_d$2_queryDeletedForms as queryDeletedForms, index_d$2_queryForms as queryForms, index_d$2_removeFormFromTrashBin as removeFormFromTrashBin, index_d$2_restoreFromTrashBin as restoreFromTrashBin, index_d$2_updateExtendedFields as updateExtendedFields, index_d$2_updateForm as updateForm };
|
|
5263
5263
|
}
|
|
5264
5264
|
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
* @readonly
|
|
5280
|
-
*/
|
|
5281
|
-
namespace?: string;
|
|
5282
|
-
/** Form submission submitter id. */
|
|
5283
|
-
submitter?: Submitter$1;
|
|
5284
|
-
/** Submission values where key is a target of a form field and value is a submissions for the given field. */
|
|
5285
|
-
submissions?: Record<string, any>;
|
|
5286
|
-
/** Identifies the reason why the submission was reported as spam. */
|
|
5287
|
-
reportReason?: ReportReason;
|
|
5288
|
-
/** Date of submission creation. If a submission was created in the past, pass the original submission creation date. */
|
|
5289
|
-
_createdDate?: Date;
|
|
5290
|
-
/**
|
|
5291
|
-
* Date of form spam submission report creation.
|
|
5292
|
-
* @readonly
|
|
5293
|
-
*/
|
|
5294
|
-
reportedDate?: Date;
|
|
5295
|
-
/**
|
|
5296
|
-
* Date of last update.
|
|
5297
|
-
* @readonly
|
|
5298
|
-
*/
|
|
5299
|
-
_updatedDate?: Date;
|
|
5300
|
-
/**
|
|
5301
|
-
* Represents the current state of an item. Each time the item is modified, its `revision` changes. for an update operation to succeed, you MUST pass the latest revision.
|
|
5302
|
-
* @readonly
|
|
5303
|
-
*/
|
|
5304
|
-
revision?: string | null;
|
|
5305
|
-
/** Data extensions ExtendedFields. */
|
|
5306
|
-
extendedFields?: ExtendedFields$1;
|
|
5307
|
-
/** Last status of the submission at the time of the report */
|
|
5308
|
-
submissionStatusAtReport?: SubmissionStatus$1;
|
|
5309
|
-
/** Order details. */
|
|
5310
|
-
orderDetails?: OrderDetails$1;
|
|
5311
|
-
/**
|
|
5312
|
-
* Contact ID. Member who created the submission, or a mapped contact.
|
|
5313
|
-
* @readonly
|
|
5314
|
-
*/
|
|
5315
|
-
contactId?: string | null;
|
|
5316
|
-
}
|
|
5317
|
-
interface Submitter$1 extends SubmitterSubmitterOneOf$1 {
|
|
5318
|
-
/** Member ID. */
|
|
5319
|
-
memberId?: string | null;
|
|
5320
|
-
/** Visitor ID. */
|
|
5321
|
-
visitorId?: string | null;
|
|
5322
|
-
/** Application ID. */
|
|
5323
|
-
applicationId?: string | null;
|
|
5324
|
-
/** User ID. */
|
|
5325
|
-
userId?: string | null;
|
|
5326
|
-
}
|
|
5327
|
-
/** @oneof */
|
|
5328
|
-
interface SubmitterSubmitterOneOf$1 {
|
|
5329
|
-
/** Member ID. */
|
|
5330
|
-
memberId?: string | null;
|
|
5331
|
-
/** Visitor ID. */
|
|
5332
|
-
visitorId?: string | null;
|
|
5333
|
-
/** Application ID. */
|
|
5334
|
-
applicationId?: string | null;
|
|
5335
|
-
/** User ID. */
|
|
5336
|
-
userId?: string | null;
|
|
5337
|
-
}
|
|
5338
|
-
declare enum ReportReason {
|
|
5339
|
-
UNKNOWN_REASON = "UNKNOWN_REASON",
|
|
5340
|
-
/** An email quota is reached. There were too many submissions in a short time period with the same email. */
|
|
5341
|
-
EMAIL_QUOTA_REACHED = "EMAIL_QUOTA_REACHED",
|
|
5342
|
-
/** An IP address is is blocklisted. */
|
|
5343
|
-
IP_BLOCKLISTED = "IP_BLOCKLISTED",
|
|
5344
|
-
/** An email is is blocklisted. */
|
|
5345
|
-
EMAIL_BLOCKLISTED = "EMAIL_BLOCKLISTED",
|
|
5346
|
-
/** Reported spam by the AI spam detection model. It uses submission text as an input. */
|
|
5347
|
-
AI_REPORTED = "AI_REPORTED",
|
|
5348
|
-
/** Reported as spam by a submission manager. */
|
|
5349
|
-
MANUALLY_REPORTED = "MANUALLY_REPORTED"
|
|
5350
|
-
}
|
|
5351
|
-
interface ExtendedFields$1 {
|
|
5265
|
+
type HostModule$1<T, H extends Host$1> = {
|
|
5266
|
+
__type: 'host';
|
|
5267
|
+
create(host: H): T;
|
|
5268
|
+
};
|
|
5269
|
+
type HostModuleAPI$1<T extends HostModule$1<any, any>> = T extends HostModule$1<infer U, any> ? U : never;
|
|
5270
|
+
type Host$1<Environment = unknown> = {
|
|
5271
|
+
channel: {
|
|
5272
|
+
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
5273
|
+
disconnect: () => void;
|
|
5274
|
+
} | Promise<{
|
|
5275
|
+
disconnect: () => void;
|
|
5276
|
+
}>;
|
|
5277
|
+
};
|
|
5278
|
+
environment?: Environment;
|
|
5352
5279
|
/**
|
|
5353
|
-
*
|
|
5354
|
-
* The value of each key is structured according to the schema defined when the extended fields were configured.
|
|
5355
|
-
*
|
|
5356
|
-
* You can only access fields for which you have the appropriate permissions.
|
|
5357
|
-
*
|
|
5358
|
-
* Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
|
|
5280
|
+
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
|
5359
5281
|
*/
|
|
5360
|
-
|
|
5361
|
-
}
|
|
5362
|
-
declare enum SubmissionStatus$1 {
|
|
5363
|
-
UNKNOWN_SUBMISSION_STATUS = "UNKNOWN_SUBMISSION_STATUS",
|
|
5364
|
-
PENDING = "PENDING",
|
|
5365
|
-
CONFIRMED = "CONFIRMED",
|
|
5366
|
-
PAYMENT_WAITING = "PAYMENT_WAITING",
|
|
5367
|
-
PAYMENT_CANCELED = "PAYMENT_CANCELED"
|
|
5368
|
-
}
|
|
5369
|
-
interface OrderDetails$1 {
|
|
5282
|
+
apiBaseUrl?: string;
|
|
5370
5283
|
/**
|
|
5371
|
-
*
|
|
5372
|
-
*
|
|
5284
|
+
* Possible data to be provided by every host, for cross cutting concerns
|
|
5285
|
+
* like internationalization, billing, etc.
|
|
5373
5286
|
*/
|
|
5374
|
-
|
|
5287
|
+
essentials?: {
|
|
5288
|
+
/**
|
|
5289
|
+
* The language of the currently viewed session
|
|
5290
|
+
*/
|
|
5291
|
+
language?: string;
|
|
5292
|
+
/**
|
|
5293
|
+
* The locale of the currently viewed session
|
|
5294
|
+
*/
|
|
5295
|
+
locale?: string;
|
|
5296
|
+
/**
|
|
5297
|
+
* Any headers that should be passed through to the API requests
|
|
5298
|
+
*/
|
|
5299
|
+
passThroughHeaders?: Record<string, string>;
|
|
5300
|
+
};
|
|
5301
|
+
};
|
|
5302
|
+
|
|
5303
|
+
type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
|
|
5304
|
+
interface HttpClient$1 {
|
|
5305
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
|
|
5306
|
+
fetchWithAuth: typeof fetch;
|
|
5307
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
5308
|
+
getActiveToken?: () => string | undefined;
|
|
5375
5309
|
}
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5310
|
+
type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
|
|
5311
|
+
type HttpResponse$1<T = any> = {
|
|
5312
|
+
data: T;
|
|
5313
|
+
status: number;
|
|
5314
|
+
statusText: string;
|
|
5315
|
+
headers: any;
|
|
5316
|
+
request?: any;
|
|
5317
|
+
};
|
|
5318
|
+
type RequestOptions$1<_TResponse = any, Data = any> = {
|
|
5319
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
5320
|
+
url: string;
|
|
5321
|
+
data?: Data;
|
|
5322
|
+
params?: URLSearchParams;
|
|
5323
|
+
} & APIMetadata$1;
|
|
5324
|
+
type APIMetadata$1 = {
|
|
5325
|
+
methodFqn?: string;
|
|
5326
|
+
entityFqdn?: string;
|
|
5327
|
+
packageName?: string;
|
|
5328
|
+
};
|
|
5329
|
+
type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
|
|
5330
|
+
type EventDefinition$1<Payload = unknown, Type extends string = string> = {
|
|
5331
|
+
__type: 'event-definition';
|
|
5332
|
+
type: Type;
|
|
5333
|
+
isDomainEvent?: boolean;
|
|
5334
|
+
transformations?: (envelope: unknown) => Payload;
|
|
5335
|
+
__payload: Payload;
|
|
5336
|
+
};
|
|
5337
|
+
declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
|
|
5338
|
+
type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
|
|
5339
|
+
type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
|
|
5340
|
+
|
|
5341
|
+
type ServicePluginMethodInput$1 = {
|
|
5342
|
+
request: any;
|
|
5343
|
+
metadata: any;
|
|
5344
|
+
};
|
|
5345
|
+
type ServicePluginContract$1 = Record<string, (payload: ServicePluginMethodInput$1) => unknown | Promise<unknown>>;
|
|
5346
|
+
type ServicePluginMethodMetadata$1 = {
|
|
5347
|
+
name: string;
|
|
5348
|
+
primaryHttpMappingPath: string;
|
|
5349
|
+
transformations: {
|
|
5350
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput$1;
|
|
5351
|
+
toREST: (...args: unknown[]) => unknown;
|
|
5352
|
+
};
|
|
5353
|
+
};
|
|
5354
|
+
type ServicePluginDefinition$1<Contract extends ServicePluginContract$1> = {
|
|
5355
|
+
__type: 'service-plugin-definition';
|
|
5356
|
+
componentType: string;
|
|
5357
|
+
methods: ServicePluginMethodMetadata$1[];
|
|
5358
|
+
__contract: Contract;
|
|
5359
|
+
};
|
|
5360
|
+
declare function ServicePluginDefinition$1<Contract extends ServicePluginContract$1>(componentType: string, methods: ServicePluginMethodMetadata$1[]): ServicePluginDefinition$1<Contract>;
|
|
5361
|
+
type BuildServicePluginDefinition$1<T extends ServicePluginDefinition$1<any>> = (implementation: T['__contract']) => void;
|
|
5362
|
+
declare const SERVICE_PLUGIN_ERROR_TYPE$1 = "wix_spi_error";
|
|
5363
|
+
|
|
5364
|
+
type RequestContext$1 = {
|
|
5365
|
+
isSSR: boolean;
|
|
5366
|
+
host: string;
|
|
5367
|
+
protocol?: string;
|
|
5368
|
+
};
|
|
5369
|
+
type ResponseTransformer$1 = (data: any, headers?: any) => any;
|
|
5370
|
+
/**
|
|
5371
|
+
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
5372
|
+
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
5373
|
+
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
5374
|
+
*/
|
|
5375
|
+
type Method$1 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
5376
|
+
type AmbassadorRequestOptions$1<T = any> = {
|
|
5377
|
+
_?: T;
|
|
5378
|
+
url?: string;
|
|
5379
|
+
method?: Method$1;
|
|
5380
|
+
params?: any;
|
|
5381
|
+
data?: any;
|
|
5382
|
+
transformResponse?: ResponseTransformer$1 | ResponseTransformer$1[];
|
|
5383
|
+
};
|
|
5384
|
+
type AmbassadorFactory$1<Request, Response> = (payload: Request) => ((context: RequestContext$1) => AmbassadorRequestOptions$1<Response>) & {
|
|
5385
|
+
__isAmbassador: boolean;
|
|
5386
|
+
};
|
|
5387
|
+
type AmbassadorFunctionDescriptor$1<Request = any, Response = any> = AmbassadorFactory$1<Request, Response>;
|
|
5388
|
+
type BuildAmbassadorFunction$1<T extends AmbassadorFunctionDescriptor$1> = T extends AmbassadorFunctionDescriptor$1<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
5389
|
+
|
|
5390
|
+
declare global {
|
|
5391
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
5392
|
+
interface SymbolConstructor {
|
|
5393
|
+
readonly observable: symbol;
|
|
5394
|
+
}
|
|
5379
5395
|
}
|
|
5380
|
-
|
|
5396
|
+
|
|
5397
|
+
declare const emptyObjectSymbol$1: unique symbol;
|
|
5398
|
+
|
|
5399
|
+
/**
|
|
5400
|
+
Represents a strictly empty plain object, the `{}` value.
|
|
5401
|
+
|
|
5402
|
+
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)).
|
|
5403
|
+
|
|
5404
|
+
@example
|
|
5405
|
+
```
|
|
5406
|
+
import type {EmptyObject} from 'type-fest';
|
|
5407
|
+
|
|
5408
|
+
// The following illustrates the problem with `{}`.
|
|
5409
|
+
const foo1: {} = {}; // Pass
|
|
5410
|
+
const foo2: {} = []; // Pass
|
|
5411
|
+
const foo3: {} = 42; // Pass
|
|
5412
|
+
const foo4: {} = {a: 1}; // Pass
|
|
5413
|
+
|
|
5414
|
+
// With `EmptyObject` only the first case is valid.
|
|
5415
|
+
const bar1: EmptyObject = {}; // Pass
|
|
5416
|
+
const bar2: EmptyObject = 42; // Fail
|
|
5417
|
+
const bar3: EmptyObject = []; // Fail
|
|
5418
|
+
const bar4: EmptyObject = {a: 1}; // Fail
|
|
5419
|
+
```
|
|
5420
|
+
|
|
5421
|
+
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}.
|
|
5422
|
+
|
|
5423
|
+
@category Object
|
|
5424
|
+
*/
|
|
5425
|
+
type EmptyObject$1 = {[emptyObjectSymbol$1]?: never};
|
|
5426
|
+
|
|
5427
|
+
/**
|
|
5428
|
+
Returns a boolean for whether the two given types are equal.
|
|
5429
|
+
|
|
5430
|
+
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
5431
|
+
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
5432
|
+
|
|
5433
|
+
Use-cases:
|
|
5434
|
+
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
5435
|
+
|
|
5436
|
+
@example
|
|
5437
|
+
```
|
|
5438
|
+
import type {IsEqual} from 'type-fest';
|
|
5439
|
+
|
|
5440
|
+
// This type returns a boolean for whether the given array includes the given item.
|
|
5441
|
+
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
5442
|
+
type Includes<Value extends readonly any[], Item> =
|
|
5443
|
+
Value extends readonly [Value[0], ...infer rest]
|
|
5444
|
+
? IsEqual<Value[0], Item> extends true
|
|
5445
|
+
? true
|
|
5446
|
+
: Includes<rest, Item>
|
|
5447
|
+
: false;
|
|
5448
|
+
```
|
|
5449
|
+
|
|
5450
|
+
@category Type Guard
|
|
5451
|
+
@category Utilities
|
|
5452
|
+
*/
|
|
5453
|
+
type IsEqual$1<A, B> =
|
|
5454
|
+
(<G>() => G extends A ? 1 : 2) extends
|
|
5455
|
+
(<G>() => G extends B ? 1 : 2)
|
|
5456
|
+
? true
|
|
5457
|
+
: false;
|
|
5458
|
+
|
|
5459
|
+
/**
|
|
5460
|
+
Filter out keys from an object.
|
|
5461
|
+
|
|
5462
|
+
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
5463
|
+
Returns `never` if `Key` extends `Exclude`.
|
|
5464
|
+
Returns `Key` otherwise.
|
|
5465
|
+
|
|
5466
|
+
@example
|
|
5467
|
+
```
|
|
5468
|
+
type Filtered = Filter<'foo', 'foo'>;
|
|
5469
|
+
//=> never
|
|
5470
|
+
```
|
|
5471
|
+
|
|
5472
|
+
@example
|
|
5473
|
+
```
|
|
5474
|
+
type Filtered = Filter<'bar', string>;
|
|
5475
|
+
//=> never
|
|
5476
|
+
```
|
|
5477
|
+
|
|
5478
|
+
@example
|
|
5479
|
+
```
|
|
5480
|
+
type Filtered = Filter<'bar', 'foo'>;
|
|
5481
|
+
//=> 'bar'
|
|
5482
|
+
```
|
|
5483
|
+
|
|
5484
|
+
@see {Except}
|
|
5485
|
+
*/
|
|
5486
|
+
type Filter$1<KeyType, ExcludeType> = IsEqual$1<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
5487
|
+
|
|
5488
|
+
type ExceptOptions$1 = {
|
|
5489
|
+
/**
|
|
5490
|
+
Disallow assigning non-specified properties.
|
|
5491
|
+
|
|
5492
|
+
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
5493
|
+
|
|
5494
|
+
@default false
|
|
5495
|
+
*/
|
|
5496
|
+
requireExactProps?: boolean;
|
|
5497
|
+
};
|
|
5498
|
+
|
|
5499
|
+
/**
|
|
5500
|
+
Create a type from an object type without certain keys.
|
|
5501
|
+
|
|
5502
|
+
We recommend setting the `requireExactProps` option to `true`.
|
|
5503
|
+
|
|
5504
|
+
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.
|
|
5505
|
+
|
|
5506
|
+
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)).
|
|
5507
|
+
|
|
5508
|
+
@example
|
|
5509
|
+
```
|
|
5510
|
+
import type {Except} from 'type-fest';
|
|
5511
|
+
|
|
5512
|
+
type Foo = {
|
|
5513
|
+
a: number;
|
|
5514
|
+
b: string;
|
|
5515
|
+
};
|
|
5516
|
+
|
|
5517
|
+
type FooWithoutA = Except<Foo, 'a'>;
|
|
5518
|
+
//=> {b: string}
|
|
5519
|
+
|
|
5520
|
+
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
5521
|
+
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
5522
|
+
|
|
5523
|
+
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
5524
|
+
//=> {a: number} & Partial<Record<"b", never>>
|
|
5525
|
+
|
|
5526
|
+
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
5527
|
+
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
5528
|
+
```
|
|
5529
|
+
|
|
5530
|
+
@category Object
|
|
5531
|
+
*/
|
|
5532
|
+
type Except$1<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$1 = {requireExactProps: false}> = {
|
|
5533
|
+
[KeyType in keyof ObjectType as Filter$1<KeyType, KeysType>]: ObjectType[KeyType];
|
|
5534
|
+
} & (Options['requireExactProps'] extends true
|
|
5535
|
+
? Partial<Record<KeysType, never>>
|
|
5536
|
+
: {});
|
|
5537
|
+
|
|
5538
|
+
/**
|
|
5539
|
+
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
5540
|
+
|
|
5541
|
+
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
5542
|
+
|
|
5543
|
+
@example
|
|
5544
|
+
```
|
|
5545
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
5546
|
+
|
|
5547
|
+
interface Example {
|
|
5548
|
+
a: string;
|
|
5549
|
+
b: string | number;
|
|
5550
|
+
c?: string;
|
|
5551
|
+
d: {};
|
|
5552
|
+
}
|
|
5553
|
+
|
|
5554
|
+
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
5555
|
+
//=> 'a'
|
|
5556
|
+
```
|
|
5557
|
+
|
|
5558
|
+
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
5559
|
+
|
|
5560
|
+
@example
|
|
5561
|
+
```
|
|
5562
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
5563
|
+
|
|
5564
|
+
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
5565
|
+
//=> 'a' | 'c'
|
|
5566
|
+
```
|
|
5567
|
+
|
|
5568
|
+
@category Object
|
|
5569
|
+
*/
|
|
5570
|
+
type ConditionalKeys$1<Base, Condition> = NonNullable<
|
|
5571
|
+
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
|
5572
|
+
{
|
|
5573
|
+
// Map through all the keys of the given base type.
|
|
5574
|
+
[Key in keyof Base]:
|
|
5575
|
+
// Pick only keys with types extending the given `Condition` type.
|
|
5576
|
+
Base[Key] extends Condition
|
|
5577
|
+
// Retain this key since the condition passes.
|
|
5578
|
+
? Key
|
|
5579
|
+
// Discard this key since the condition fails.
|
|
5580
|
+
: never;
|
|
5581
|
+
|
|
5582
|
+
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
5583
|
+
}[keyof Base]
|
|
5584
|
+
>;
|
|
5585
|
+
|
|
5586
|
+
/**
|
|
5587
|
+
Exclude keys from a shape that matches the given `Condition`.
|
|
5588
|
+
|
|
5589
|
+
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.
|
|
5590
|
+
|
|
5591
|
+
@example
|
|
5592
|
+
```
|
|
5593
|
+
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
5594
|
+
|
|
5595
|
+
class Awesome {
|
|
5596
|
+
name: string;
|
|
5597
|
+
successes: number;
|
|
5598
|
+
failures: bigint;
|
|
5599
|
+
|
|
5600
|
+
run() {}
|
|
5601
|
+
}
|
|
5602
|
+
|
|
5603
|
+
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
5604
|
+
//=> {run: () => void}
|
|
5605
|
+
```
|
|
5606
|
+
|
|
5607
|
+
@example
|
|
5608
|
+
```
|
|
5609
|
+
import type {ConditionalExcept} from 'type-fest';
|
|
5610
|
+
|
|
5611
|
+
interface Example {
|
|
5612
|
+
a: string;
|
|
5613
|
+
b: string | number;
|
|
5614
|
+
c: () => void;
|
|
5615
|
+
d: {};
|
|
5616
|
+
}
|
|
5617
|
+
|
|
5618
|
+
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
5619
|
+
//=> {b: string | number; c: () => void; d: {}}
|
|
5620
|
+
```
|
|
5621
|
+
|
|
5622
|
+
@category Object
|
|
5623
|
+
*/
|
|
5624
|
+
type ConditionalExcept$1<Base, Condition> = Except$1<
|
|
5625
|
+
Base,
|
|
5626
|
+
ConditionalKeys$1<Base, Condition>
|
|
5627
|
+
>;
|
|
5628
|
+
|
|
5629
|
+
/**
|
|
5630
|
+
* Descriptors are objects that describe the API of a module, and the module
|
|
5631
|
+
* can either be a REST module or a host module.
|
|
5632
|
+
* This type is recursive, so it can describe nested modules.
|
|
5633
|
+
*/
|
|
5634
|
+
type Descriptors$1 = RESTFunctionDescriptor$1 | AmbassadorFunctionDescriptor$1 | HostModule$1<any, any> | EventDefinition$1<any> | ServicePluginDefinition$1<any> | {
|
|
5635
|
+
[key: string]: Descriptors$1 | PublicMetadata$1 | any;
|
|
5636
|
+
};
|
|
5637
|
+
/**
|
|
5638
|
+
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
5639
|
+
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
5640
|
+
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
5641
|
+
* do not match the given host (as they will not work with the given host).
|
|
5642
|
+
*/
|
|
5643
|
+
type BuildDescriptors$1<T extends Descriptors$1, H extends Host$1<any> | undefined, Depth extends number = 5> = {
|
|
5644
|
+
done: T;
|
|
5645
|
+
recurse: T extends {
|
|
5646
|
+
__type: typeof SERVICE_PLUGIN_ERROR_TYPE$1;
|
|
5647
|
+
} ? 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<{
|
|
5648
|
+
[Key in keyof T]: T[Key] extends Descriptors$1 ? BuildDescriptors$1<T[Key], H, [
|
|
5649
|
+
-1,
|
|
5650
|
+
0,
|
|
5651
|
+
1,
|
|
5652
|
+
2,
|
|
5653
|
+
3,
|
|
5654
|
+
4,
|
|
5655
|
+
5
|
|
5656
|
+
][Depth]> : never;
|
|
5657
|
+
}, EmptyObject$1>;
|
|
5658
|
+
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
5659
|
+
type PublicMetadata$1 = {
|
|
5660
|
+
PACKAGE_NAME?: string;
|
|
5661
|
+
};
|
|
5662
|
+
|
|
5663
|
+
declare global {
|
|
5664
|
+
interface ContextualClient {
|
|
5665
|
+
}
|
|
5666
|
+
}
|
|
5667
|
+
/**
|
|
5668
|
+
* A type used to create concerete types from SDK descriptors in
|
|
5669
|
+
* case a contextual client is available.
|
|
5670
|
+
*/
|
|
5671
|
+
type MaybeContext$1<T extends Descriptors$1> = globalThis.ContextualClient extends {
|
|
5672
|
+
host: Host$1;
|
|
5673
|
+
} ? BuildDescriptors$1<T, globalThis.ContextualClient['host']> : T;
|
|
5674
|
+
|
|
5675
|
+
/**
|
|
5676
|
+
* FormSpamSubmissionReportReport stores a form submission spam report.
|
|
5677
|
+
* It contains submission details as well as report reason.
|
|
5678
|
+
*/
|
|
5679
|
+
interface FormSpamSubmissionReport {
|
|
5680
|
+
/**
|
|
5681
|
+
* Form spam submission report id.
|
|
5682
|
+
* @readonly
|
|
5683
|
+
*/
|
|
5684
|
+
_id?: string | null;
|
|
5685
|
+
/** Id of a form to which the form spam submission report belongs. */
|
|
5686
|
+
formId?: string;
|
|
5687
|
+
/**
|
|
5688
|
+
* Form namespace to which the form spam submission report belongs.
|
|
5689
|
+
* @readonly
|
|
5690
|
+
*/
|
|
5691
|
+
namespace?: string;
|
|
5692
|
+
/** Form submission submitter id. */
|
|
5693
|
+
submitter?: Submitter$1;
|
|
5694
|
+
/** Submission values where key is a target of a form field and value is a submissions for the given field. */
|
|
5695
|
+
submissions?: Record<string, any>;
|
|
5696
|
+
/** Identifies the reason why the submission was reported as spam. */
|
|
5697
|
+
reportReason?: ReportReason;
|
|
5698
|
+
/** Date of submission creation. If a submission was created in the past, pass the original submission creation date. */
|
|
5699
|
+
_createdDate?: Date;
|
|
5700
|
+
/**
|
|
5701
|
+
* Date of form spam submission report creation.
|
|
5702
|
+
* @readonly
|
|
5703
|
+
*/
|
|
5704
|
+
reportedDate?: Date;
|
|
5705
|
+
/**
|
|
5706
|
+
* Date of last update.
|
|
5707
|
+
* @readonly
|
|
5708
|
+
*/
|
|
5709
|
+
_updatedDate?: Date;
|
|
5710
|
+
/**
|
|
5711
|
+
* Represents the current state of an item. Each time the item is modified, its `revision` changes. for an update operation to succeed, you MUST pass the latest revision.
|
|
5712
|
+
* @readonly
|
|
5713
|
+
*/
|
|
5714
|
+
revision?: string | null;
|
|
5715
|
+
/** Data extensions ExtendedFields. */
|
|
5716
|
+
extendedFields?: ExtendedFields$1;
|
|
5717
|
+
/** Last status of the submission at the time of the report */
|
|
5718
|
+
submissionStatusAtReport?: SubmissionStatus$1;
|
|
5719
|
+
/** Order details. */
|
|
5720
|
+
orderDetails?: OrderDetails$1;
|
|
5721
|
+
/**
|
|
5722
|
+
* Contact ID. Member who created the submission, or a mapped contact.
|
|
5723
|
+
* @readonly
|
|
5724
|
+
*/
|
|
5725
|
+
contactId?: string | null;
|
|
5726
|
+
}
|
|
5727
|
+
interface Submitter$1 extends SubmitterSubmitterOneOf$1 {
|
|
5728
|
+
/** Member ID. */
|
|
5729
|
+
memberId?: string | null;
|
|
5730
|
+
/** Visitor ID. */
|
|
5731
|
+
visitorId?: string | null;
|
|
5732
|
+
/** Application ID. */
|
|
5733
|
+
applicationId?: string | null;
|
|
5734
|
+
/** User ID. */
|
|
5735
|
+
userId?: string | null;
|
|
5736
|
+
}
|
|
5737
|
+
/** @oneof */
|
|
5738
|
+
interface SubmitterSubmitterOneOf$1 {
|
|
5739
|
+
/** Member ID. */
|
|
5740
|
+
memberId?: string | null;
|
|
5741
|
+
/** Visitor ID. */
|
|
5742
|
+
visitorId?: string | null;
|
|
5743
|
+
/** Application ID. */
|
|
5744
|
+
applicationId?: string | null;
|
|
5745
|
+
/** User ID. */
|
|
5746
|
+
userId?: string | null;
|
|
5747
|
+
}
|
|
5748
|
+
declare enum ReportReason {
|
|
5749
|
+
UNKNOWN_REASON = "UNKNOWN_REASON",
|
|
5750
|
+
/** An email quota is reached. There were too many submissions in a short time period with the same email. */
|
|
5751
|
+
EMAIL_QUOTA_REACHED = "EMAIL_QUOTA_REACHED",
|
|
5752
|
+
/** An IP address is is blocklisted. */
|
|
5753
|
+
IP_BLOCKLISTED = "IP_BLOCKLISTED",
|
|
5754
|
+
/** An email is is blocklisted. */
|
|
5755
|
+
EMAIL_BLOCKLISTED = "EMAIL_BLOCKLISTED",
|
|
5756
|
+
/** Reported spam by the AI spam detection model. It uses submission text as an input. */
|
|
5757
|
+
AI_REPORTED = "AI_REPORTED",
|
|
5758
|
+
/** Reported as spam by a submission manager. */
|
|
5759
|
+
MANUALLY_REPORTED = "MANUALLY_REPORTED"
|
|
5760
|
+
}
|
|
5761
|
+
interface ExtendedFields$1 {
|
|
5762
|
+
/**
|
|
5763
|
+
* Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
|
|
5764
|
+
* The value of each key is structured according to the schema defined when the extended fields were configured.
|
|
5765
|
+
*
|
|
5766
|
+
* You can only access fields for which you have the appropriate permissions.
|
|
5767
|
+
*
|
|
5768
|
+
* Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
|
|
5769
|
+
*/
|
|
5770
|
+
namespaces?: Record<string, Record<string, any>>;
|
|
5771
|
+
}
|
|
5772
|
+
declare enum SubmissionStatus$1 {
|
|
5773
|
+
UNKNOWN_SUBMISSION_STATUS = "UNKNOWN_SUBMISSION_STATUS",
|
|
5774
|
+
PENDING = "PENDING",
|
|
5775
|
+
CONFIRMED = "CONFIRMED",
|
|
5776
|
+
PAYMENT_WAITING = "PAYMENT_WAITING",
|
|
5777
|
+
PAYMENT_CANCELED = "PAYMENT_CANCELED"
|
|
5778
|
+
}
|
|
5779
|
+
interface OrderDetails$1 {
|
|
5780
|
+
/**
|
|
5781
|
+
* ID of the checkout related to submission (applicable if form has payments added).
|
|
5782
|
+
* @readonly
|
|
5783
|
+
*/
|
|
5784
|
+
checkoutId?: string;
|
|
5785
|
+
}
|
|
5786
|
+
interface CheckForSpamRequest {
|
|
5787
|
+
/** Form submission. */
|
|
5788
|
+
submission: FormSubmission$1;
|
|
5789
|
+
}
|
|
5790
|
+
/** Form submission that was created or retrieved. */
|
|
5381
5791
|
interface FormSubmission$1 {
|
|
5382
5792
|
/**
|
|
5383
5793
|
* Submission ID.
|
|
@@ -5974,7 +6384,7 @@ interface FormSpamSubmissionReportsQueryBuilder {
|
|
|
5974
6384
|
find: () => Promise<FormSpamSubmissionReportsQueryResult>;
|
|
5975
6385
|
}
|
|
5976
6386
|
|
|
5977
|
-
declare function checkForSpam$1(httpClient: HttpClient): CheckForSpamSignature;
|
|
6387
|
+
declare function checkForSpam$1(httpClient: HttpClient$1): CheckForSpamSignature;
|
|
5978
6388
|
interface CheckForSpamSignature {
|
|
5979
6389
|
/**
|
|
5980
6390
|
* Checks if submission is a spam.
|
|
@@ -5982,7 +6392,7 @@ interface CheckForSpamSignature {
|
|
|
5982
6392
|
*/
|
|
5983
6393
|
(submission: FormSubmission$1): Promise<CheckForSpamResponse & CheckForSpamResponseNonNullableFields>;
|
|
5984
6394
|
}
|
|
5985
|
-
declare function createFormSpamSubmissionReport$1(httpClient: HttpClient): CreateFormSpamSubmissionReportSignature;
|
|
6395
|
+
declare function createFormSpamSubmissionReport$1(httpClient: HttpClient$1): CreateFormSpamSubmissionReportSignature;
|
|
5986
6396
|
interface CreateFormSpamSubmissionReportSignature {
|
|
5987
6397
|
/**
|
|
5988
6398
|
* Creates a new spam submission.
|
|
@@ -5992,7 +6402,7 @@ interface CreateFormSpamSubmissionReportSignature {
|
|
|
5992
6402
|
*/
|
|
5993
6403
|
(formSpamSubmissionReport: FormSpamSubmissionReport): Promise<FormSpamSubmissionReport & FormSpamSubmissionReportNonNullableFields>;
|
|
5994
6404
|
}
|
|
5995
|
-
declare function getFormSpamSubmissionReport$1(httpClient: HttpClient): GetFormSpamSubmissionReportSignature;
|
|
6405
|
+
declare function getFormSpamSubmissionReport$1(httpClient: HttpClient$1): GetFormSpamSubmissionReportSignature;
|
|
5996
6406
|
interface GetFormSpamSubmissionReportSignature {
|
|
5997
6407
|
/**
|
|
5998
6408
|
* Get a spam submission by id.
|
|
@@ -6001,7 +6411,7 @@ interface GetFormSpamSubmissionReportSignature {
|
|
|
6001
6411
|
*/
|
|
6002
6412
|
(formSpamSubmissionReportId: string): Promise<FormSpamSubmissionReport & FormSpamSubmissionReportNonNullableFields>;
|
|
6003
6413
|
}
|
|
6004
|
-
declare function deleteFormSpamSubmissionReport$1(httpClient: HttpClient): DeleteFormSpamSubmissionReportSignature;
|
|
6414
|
+
declare function deleteFormSpamSubmissionReport$1(httpClient: HttpClient$1): DeleteFormSpamSubmissionReportSignature;
|
|
6005
6415
|
interface DeleteFormSpamSubmissionReportSignature {
|
|
6006
6416
|
/**
|
|
6007
6417
|
* Delete a spam submission report.
|
|
@@ -6009,7 +6419,7 @@ interface DeleteFormSpamSubmissionReportSignature {
|
|
|
6009
6419
|
*/
|
|
6010
6420
|
(formSpamSubmissionReportId: string): Promise<void>;
|
|
6011
6421
|
}
|
|
6012
|
-
declare function bulkDeleteFormSpamSubmissionReport$1(httpClient: HttpClient): BulkDeleteFormSpamSubmissionReportSignature;
|
|
6422
|
+
declare function bulkDeleteFormSpamSubmissionReport$1(httpClient: HttpClient$1): BulkDeleteFormSpamSubmissionReportSignature;
|
|
6013
6423
|
interface BulkDeleteFormSpamSubmissionReportSignature {
|
|
6014
6424
|
/**
|
|
6015
6425
|
* Deletes report by IDS or all for specific form.
|
|
@@ -6017,7 +6427,7 @@ interface BulkDeleteFormSpamSubmissionReportSignature {
|
|
|
6017
6427
|
*/
|
|
6018
6428
|
(formId: string, options?: BulkDeleteFormSpamSubmissionReportOptions | undefined): Promise<BulkDeleteFormSpamSubmissionReportResponse & BulkDeleteFormSpamSubmissionReportResponseNonNullableFields>;
|
|
6019
6429
|
}
|
|
6020
|
-
declare function bulkDeleteFormSpamSubmissionReportByFilter$1(httpClient: HttpClient): BulkDeleteFormSpamSubmissionReportByFilterSignature;
|
|
6430
|
+
declare function bulkDeleteFormSpamSubmissionReportByFilter$1(httpClient: HttpClient$1): BulkDeleteFormSpamSubmissionReportByFilterSignature;
|
|
6021
6431
|
interface BulkDeleteFormSpamSubmissionReportByFilterSignature {
|
|
6022
6432
|
/**
|
|
6023
6433
|
* Deletes reports by filter for specific form.
|
|
@@ -6027,136 +6437,546 @@ interface BulkDeleteFormSpamSubmissionReportByFilterSignature {
|
|
|
6027
6437
|
*/
|
|
6028
6438
|
(filter: Record<string, any> | null): Promise<BulkDeleteFormSpamSubmissionReportByFilterResponse & BulkDeleteFormSpamSubmissionReportByFilterResponseNonNullableFields>;
|
|
6029
6439
|
}
|
|
6030
|
-
declare function reportNotSpamSubmission$1(httpClient: HttpClient): ReportNotSpamSubmissionSignature;
|
|
6031
|
-
interface ReportNotSpamSubmissionSignature {
|
|
6440
|
+
declare function reportNotSpamSubmission$1(httpClient: HttpClient$1): ReportNotSpamSubmissionSignature;
|
|
6441
|
+
interface ReportNotSpamSubmissionSignature {
|
|
6442
|
+
/**
|
|
6443
|
+
* Report a spam submission as not spam. The submission is created, and the spam report is deleted.
|
|
6444
|
+
* Submission automations are triggered the same way as in standard submission creation flow.
|
|
6445
|
+
* @param - Id of the form spam submission report to report as not spam.
|
|
6446
|
+
*/
|
|
6447
|
+
(formSpamSubmissionReportId: string): Promise<ReportNotSpamSubmissionResponse & ReportNotSpamSubmissionResponseNonNullableFields>;
|
|
6448
|
+
}
|
|
6449
|
+
declare function bulkReportNotSpamSubmission$1(httpClient: HttpClient$1): BulkReportNotSpamSubmissionSignature;
|
|
6450
|
+
interface BulkReportNotSpamSubmissionSignature {
|
|
6451
|
+
/**
|
|
6452
|
+
* Report a spam submissions as not spam. The submissions is created, and the spam reports is deleted.
|
|
6453
|
+
* Submissions automations are triggered the same way as in standard submission creation flow.
|
|
6454
|
+
* @param - Id of the form to which belong reports
|
|
6455
|
+
*/
|
|
6456
|
+
(formId: string, options?: BulkReportNotSpamSubmissionOptions | undefined): Promise<BulkReportNotSpamSubmissionResponse & BulkReportNotSpamSubmissionResponseNonNullableFields>;
|
|
6457
|
+
}
|
|
6458
|
+
declare function reportSpamSubmission$1(httpClient: HttpClient$1): ReportSpamSubmissionSignature;
|
|
6459
|
+
interface ReportSpamSubmissionSignature {
|
|
6460
|
+
/**
|
|
6461
|
+
* Report a submission as spam. The spam submission report is created, and the submission is deleted.
|
|
6462
|
+
* @param - Id of the submission to report as spam.
|
|
6463
|
+
* @param - Identifies the reason why the submission was reported as spam.
|
|
6464
|
+
*/
|
|
6465
|
+
(submissionId: string, reportReason: ReportReason): Promise<ReportSpamSubmissionResponse & ReportSpamSubmissionResponseNonNullableFields>;
|
|
6466
|
+
}
|
|
6467
|
+
declare function bulkReportSpamSubmission$1(httpClient: HttpClient$1): BulkReportSpamSubmissionSignature;
|
|
6468
|
+
interface BulkReportSpamSubmissionSignature {
|
|
6469
|
+
/**
|
|
6470
|
+
* Report multiple submissions as spam. The spam submission reports is created, and the submissions is deleted.
|
|
6471
|
+
* @param - Id of the form to which belong submissions to report as spam.
|
|
6472
|
+
*/
|
|
6473
|
+
(formId: string, options?: BulkReportSpamSubmissionOptions | undefined): Promise<BulkReportSpamSubmissionResponse & BulkReportSpamSubmissionResponseNonNullableFields>;
|
|
6474
|
+
}
|
|
6475
|
+
declare function queryFormSpamSubmissionReportsByNamespace$1(httpClient: HttpClient$1): QueryFormSpamSubmissionReportsByNamespaceSignature;
|
|
6476
|
+
interface QueryFormSpamSubmissionReportsByNamespaceSignature {
|
|
6477
|
+
/**
|
|
6478
|
+
* Query form spam submission reports using [WQL - Wix Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
|
|
6479
|
+
*/
|
|
6480
|
+
(): FormSpamSubmissionReportsQueryBuilder;
|
|
6481
|
+
}
|
|
6482
|
+
declare function countFormSpamSubmissionReports$1(httpClient: HttpClient$1): CountFormSpamSubmissionReportsSignature;
|
|
6483
|
+
interface CountFormSpamSubmissionReportsSignature {
|
|
6484
|
+
/**
|
|
6485
|
+
* Counts the number of spam submission reports belonging to the specified forms.
|
|
6486
|
+
* @param - Form IDs.
|
|
6487
|
+
* @param - Identifies the app which the form submissions belong to. For example, the namespace for the Wix Forms App is `"wix.form_app.form"`. The namespace of a submission can be retrieved using the Get Submission endpoint.
|
|
6488
|
+
*/
|
|
6489
|
+
(formIds: string[], namespace: string): Promise<CountFormSpamSubmissionReportsResponse & CountFormSpamSubmissionReportsResponseNonNullableFields>;
|
|
6490
|
+
}
|
|
6491
|
+
|
|
6492
|
+
declare const checkForSpam: MaybeContext$1<BuildRESTFunction$1<typeof checkForSpam$1> & typeof checkForSpam$1>;
|
|
6493
|
+
declare const createFormSpamSubmissionReport: MaybeContext$1<BuildRESTFunction$1<typeof createFormSpamSubmissionReport$1> & typeof createFormSpamSubmissionReport$1>;
|
|
6494
|
+
declare const getFormSpamSubmissionReport: MaybeContext$1<BuildRESTFunction$1<typeof getFormSpamSubmissionReport$1> & typeof getFormSpamSubmissionReport$1>;
|
|
6495
|
+
declare const deleteFormSpamSubmissionReport: MaybeContext$1<BuildRESTFunction$1<typeof deleteFormSpamSubmissionReport$1> & typeof deleteFormSpamSubmissionReport$1>;
|
|
6496
|
+
declare const bulkDeleteFormSpamSubmissionReport: MaybeContext$1<BuildRESTFunction$1<typeof bulkDeleteFormSpamSubmissionReport$1> & typeof bulkDeleteFormSpamSubmissionReport$1>;
|
|
6497
|
+
declare const bulkDeleteFormSpamSubmissionReportByFilter: MaybeContext$1<BuildRESTFunction$1<typeof bulkDeleteFormSpamSubmissionReportByFilter$1> & typeof bulkDeleteFormSpamSubmissionReportByFilter$1>;
|
|
6498
|
+
declare const reportNotSpamSubmission: MaybeContext$1<BuildRESTFunction$1<typeof reportNotSpamSubmission$1> & typeof reportNotSpamSubmission$1>;
|
|
6499
|
+
declare const bulkReportNotSpamSubmission: MaybeContext$1<BuildRESTFunction$1<typeof bulkReportNotSpamSubmission$1> & typeof bulkReportNotSpamSubmission$1>;
|
|
6500
|
+
declare const reportSpamSubmission: MaybeContext$1<BuildRESTFunction$1<typeof reportSpamSubmission$1> & typeof reportSpamSubmission$1>;
|
|
6501
|
+
declare const bulkReportSpamSubmission: MaybeContext$1<BuildRESTFunction$1<typeof bulkReportSpamSubmission$1> & typeof bulkReportSpamSubmission$1>;
|
|
6502
|
+
declare const queryFormSpamSubmissionReportsByNamespace: MaybeContext$1<BuildRESTFunction$1<typeof queryFormSpamSubmissionReportsByNamespace$1> & typeof queryFormSpamSubmissionReportsByNamespace$1>;
|
|
6503
|
+
declare const countFormSpamSubmissionReports: MaybeContext$1<BuildRESTFunction$1<typeof countFormSpamSubmissionReports$1> & typeof countFormSpamSubmissionReports$1>;
|
|
6504
|
+
|
|
6505
|
+
type index_d$1_BulkDeleteFormSpamSubmissionReportByFilterRequest = BulkDeleteFormSpamSubmissionReportByFilterRequest;
|
|
6506
|
+
type index_d$1_BulkDeleteFormSpamSubmissionReportByFilterResponse = BulkDeleteFormSpamSubmissionReportByFilterResponse;
|
|
6507
|
+
type index_d$1_BulkDeleteFormSpamSubmissionReportByFilterResponseNonNullableFields = BulkDeleteFormSpamSubmissionReportByFilterResponseNonNullableFields;
|
|
6508
|
+
type index_d$1_BulkDeleteFormSpamSubmissionReportOptions = BulkDeleteFormSpamSubmissionReportOptions;
|
|
6509
|
+
type index_d$1_BulkDeleteFormSpamSubmissionReportRequest = BulkDeleteFormSpamSubmissionReportRequest;
|
|
6510
|
+
type index_d$1_BulkDeleteFormSpamSubmissionReportResponse = BulkDeleteFormSpamSubmissionReportResponse;
|
|
6511
|
+
type index_d$1_BulkDeleteFormSpamSubmissionReportResponseNonNullableFields = BulkDeleteFormSpamSubmissionReportResponseNonNullableFields;
|
|
6512
|
+
type index_d$1_BulkDeleteFormSpamSubmissionReportResult = BulkDeleteFormSpamSubmissionReportResult;
|
|
6513
|
+
type index_d$1_BulkReportNotSpamSubmissionOptions = BulkReportNotSpamSubmissionOptions;
|
|
6514
|
+
type index_d$1_BulkReportNotSpamSubmissionRequest = BulkReportNotSpamSubmissionRequest;
|
|
6515
|
+
type index_d$1_BulkReportNotSpamSubmissionResponse = BulkReportNotSpamSubmissionResponse;
|
|
6516
|
+
type index_d$1_BulkReportNotSpamSubmissionResponseNonNullableFields = BulkReportNotSpamSubmissionResponseNonNullableFields;
|
|
6517
|
+
type index_d$1_BulkReportNotSpamSubmissionResult = BulkReportNotSpamSubmissionResult;
|
|
6518
|
+
type index_d$1_BulkReportSpamSubmissionOptions = BulkReportSpamSubmissionOptions;
|
|
6519
|
+
type index_d$1_BulkReportSpamSubmissionRequest = BulkReportSpamSubmissionRequest;
|
|
6520
|
+
type index_d$1_BulkReportSpamSubmissionResponse = BulkReportSpamSubmissionResponse;
|
|
6521
|
+
type index_d$1_BulkReportSpamSubmissionResponseNonNullableFields = BulkReportSpamSubmissionResponseNonNullableFields;
|
|
6522
|
+
type index_d$1_BulkReportSpamSubmissionResult = BulkReportSpamSubmissionResult;
|
|
6523
|
+
type index_d$1_CheckForSpamRequest = CheckForSpamRequest;
|
|
6524
|
+
type index_d$1_CheckForSpamResponse = CheckForSpamResponse;
|
|
6525
|
+
type index_d$1_CheckForSpamResponseNonNullableFields = CheckForSpamResponseNonNullableFields;
|
|
6526
|
+
type index_d$1_CountFormSpamSubmissionReportsRequest = CountFormSpamSubmissionReportsRequest;
|
|
6527
|
+
type index_d$1_CountFormSpamSubmissionReportsResponse = CountFormSpamSubmissionReportsResponse;
|
|
6528
|
+
type index_d$1_CountFormSpamSubmissionReportsResponseNonNullableFields = CountFormSpamSubmissionReportsResponseNonNullableFields;
|
|
6529
|
+
type index_d$1_CreateFormSpamSubmissionReportRequest = CreateFormSpamSubmissionReportRequest;
|
|
6530
|
+
type index_d$1_CreateFormSpamSubmissionReportResponse = CreateFormSpamSubmissionReportResponse;
|
|
6531
|
+
type index_d$1_CreateFormSpamSubmissionReportResponseNonNullableFields = CreateFormSpamSubmissionReportResponseNonNullableFields;
|
|
6532
|
+
type index_d$1_DeleteFormSpamSubmissionReportRequest = DeleteFormSpamSubmissionReportRequest;
|
|
6533
|
+
type index_d$1_DeleteFormSpamSubmissionReportResponse = DeleteFormSpamSubmissionReportResponse;
|
|
6534
|
+
type index_d$1_FormSpamSubmissionReport = FormSpamSubmissionReport;
|
|
6535
|
+
type index_d$1_FormSpamSubmissionReportNonNullableFields = FormSpamSubmissionReportNonNullableFields;
|
|
6536
|
+
type index_d$1_FormSpamSubmissionReportsCount = FormSpamSubmissionReportsCount;
|
|
6537
|
+
type index_d$1_FormSpamSubmissionReportsQueryBuilder = FormSpamSubmissionReportsQueryBuilder;
|
|
6538
|
+
type index_d$1_FormSpamSubmissionReportsQueryResult = FormSpamSubmissionReportsQueryResult;
|
|
6539
|
+
type index_d$1_FormSubmissionOrderDetails = FormSubmissionOrderDetails;
|
|
6540
|
+
type index_d$1_GetFormSpamSubmissionReportRequest = GetFormSpamSubmissionReportRequest;
|
|
6541
|
+
type index_d$1_GetFormSpamSubmissionReportResponse = GetFormSpamSubmissionReportResponse;
|
|
6542
|
+
type index_d$1_GetFormSpamSubmissionReportResponseNonNullableFields = GetFormSpamSubmissionReportResponseNonNullableFields;
|
|
6543
|
+
type index_d$1_QueryFormSpamSubmissionReportsByNamespaceRequest = QueryFormSpamSubmissionReportsByNamespaceRequest;
|
|
6544
|
+
type index_d$1_QueryFormSpamSubmissionReportsByNamespaceResponse = QueryFormSpamSubmissionReportsByNamespaceResponse;
|
|
6545
|
+
type index_d$1_QueryFormSpamSubmissionReportsByNamespaceResponseNonNullableFields = QueryFormSpamSubmissionReportsByNamespaceResponseNonNullableFields;
|
|
6546
|
+
type index_d$1_ReportNotSpamSubmissionRequest = ReportNotSpamSubmissionRequest;
|
|
6547
|
+
type index_d$1_ReportNotSpamSubmissionResponse = ReportNotSpamSubmissionResponse;
|
|
6548
|
+
type index_d$1_ReportNotSpamSubmissionResponseNonNullableFields = ReportNotSpamSubmissionResponseNonNullableFields;
|
|
6549
|
+
type index_d$1_ReportReason = ReportReason;
|
|
6550
|
+
declare const index_d$1_ReportReason: typeof ReportReason;
|
|
6551
|
+
type index_d$1_ReportSpamSubmissionRequest = ReportSpamSubmissionRequest;
|
|
6552
|
+
type index_d$1_ReportSpamSubmissionResponse = ReportSpamSubmissionResponse;
|
|
6553
|
+
type index_d$1_ReportSpamSubmissionResponseNonNullableFields = ReportSpamSubmissionResponseNonNullableFields;
|
|
6554
|
+
type index_d$1_SpamReport = SpamReport;
|
|
6555
|
+
declare const index_d$1_bulkDeleteFormSpamSubmissionReport: typeof bulkDeleteFormSpamSubmissionReport;
|
|
6556
|
+
declare const index_d$1_bulkDeleteFormSpamSubmissionReportByFilter: typeof bulkDeleteFormSpamSubmissionReportByFilter;
|
|
6557
|
+
declare const index_d$1_bulkReportNotSpamSubmission: typeof bulkReportNotSpamSubmission;
|
|
6558
|
+
declare const index_d$1_bulkReportSpamSubmission: typeof bulkReportSpamSubmission;
|
|
6559
|
+
declare const index_d$1_checkForSpam: typeof checkForSpam;
|
|
6560
|
+
declare const index_d$1_countFormSpamSubmissionReports: typeof countFormSpamSubmissionReports;
|
|
6561
|
+
declare const index_d$1_createFormSpamSubmissionReport: typeof createFormSpamSubmissionReport;
|
|
6562
|
+
declare const index_d$1_deleteFormSpamSubmissionReport: typeof deleteFormSpamSubmissionReport;
|
|
6563
|
+
declare const index_d$1_getFormSpamSubmissionReport: typeof getFormSpamSubmissionReport;
|
|
6564
|
+
declare const index_d$1_queryFormSpamSubmissionReportsByNamespace: typeof queryFormSpamSubmissionReportsByNamespace;
|
|
6565
|
+
declare const index_d$1_reportNotSpamSubmission: typeof reportNotSpamSubmission;
|
|
6566
|
+
declare const index_d$1_reportSpamSubmission: typeof reportSpamSubmission;
|
|
6567
|
+
declare namespace index_d$1 {
|
|
6568
|
+
export { type ActionEvent$1 as ActionEvent, type ApplicationError$1 as ApplicationError, type BulkActionMetadata$1 as BulkActionMetadata, type index_d$1_BulkDeleteFormSpamSubmissionReportByFilterRequest as BulkDeleteFormSpamSubmissionReportByFilterRequest, type index_d$1_BulkDeleteFormSpamSubmissionReportByFilterResponse as BulkDeleteFormSpamSubmissionReportByFilterResponse, type index_d$1_BulkDeleteFormSpamSubmissionReportByFilterResponseNonNullableFields as BulkDeleteFormSpamSubmissionReportByFilterResponseNonNullableFields, type index_d$1_BulkDeleteFormSpamSubmissionReportOptions as BulkDeleteFormSpamSubmissionReportOptions, type index_d$1_BulkDeleteFormSpamSubmissionReportRequest as BulkDeleteFormSpamSubmissionReportRequest, type index_d$1_BulkDeleteFormSpamSubmissionReportResponse as BulkDeleteFormSpamSubmissionReportResponse, type index_d$1_BulkDeleteFormSpamSubmissionReportResponseNonNullableFields as BulkDeleteFormSpamSubmissionReportResponseNonNullableFields, type index_d$1_BulkDeleteFormSpamSubmissionReportResult as BulkDeleteFormSpamSubmissionReportResult, type index_d$1_BulkReportNotSpamSubmissionOptions as BulkReportNotSpamSubmissionOptions, type index_d$1_BulkReportNotSpamSubmissionRequest as BulkReportNotSpamSubmissionRequest, type index_d$1_BulkReportNotSpamSubmissionResponse as BulkReportNotSpamSubmissionResponse, type index_d$1_BulkReportNotSpamSubmissionResponseNonNullableFields as BulkReportNotSpamSubmissionResponseNonNullableFields, type index_d$1_BulkReportNotSpamSubmissionResult as BulkReportNotSpamSubmissionResult, type index_d$1_BulkReportSpamSubmissionOptions as BulkReportSpamSubmissionOptions, type index_d$1_BulkReportSpamSubmissionRequest as BulkReportSpamSubmissionRequest, type index_d$1_BulkReportSpamSubmissionResponse as BulkReportSpamSubmissionResponse, type index_d$1_BulkReportSpamSubmissionResponseNonNullableFields as BulkReportSpamSubmissionResponseNonNullableFields, type index_d$1_BulkReportSpamSubmissionResult as BulkReportSpamSubmissionResult, type index_d$1_CheckForSpamRequest as CheckForSpamRequest, type index_d$1_CheckForSpamResponse as CheckForSpamResponse, type index_d$1_CheckForSpamResponseNonNullableFields as CheckForSpamResponseNonNullableFields, type index_d$1_CountFormSpamSubmissionReportsRequest as CountFormSpamSubmissionReportsRequest, type index_d$1_CountFormSpamSubmissionReportsResponse as CountFormSpamSubmissionReportsResponse, type index_d$1_CountFormSpamSubmissionReportsResponseNonNullableFields as CountFormSpamSubmissionReportsResponseNonNullableFields, type index_d$1_CreateFormSpamSubmissionReportRequest as CreateFormSpamSubmissionReportRequest, type index_d$1_CreateFormSpamSubmissionReportResponse as CreateFormSpamSubmissionReportResponse, type index_d$1_CreateFormSpamSubmissionReportResponseNonNullableFields as CreateFormSpamSubmissionReportResponseNonNullableFields, type CursorPaging$1 as CursorPaging, type CursorPagingMetadata$1 as CursorPagingMetadata, type CursorQuery$1 as CursorQuery, type CursorQueryPagingMethodOneOf$1 as CursorQueryPagingMethodOneOf, type Cursors$1 as Cursors, type index_d$1_DeleteFormSpamSubmissionReportRequest as DeleteFormSpamSubmissionReportRequest, type index_d$1_DeleteFormSpamSubmissionReportResponse as DeleteFormSpamSubmissionReportResponse, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type Empty$1 as Empty, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type ExtendedFields$1 as ExtendedFields, type index_d$1_FormSpamSubmissionReport as FormSpamSubmissionReport, type index_d$1_FormSpamSubmissionReportNonNullableFields as FormSpamSubmissionReportNonNullableFields, type index_d$1_FormSpamSubmissionReportsCount as FormSpamSubmissionReportsCount, type index_d$1_FormSpamSubmissionReportsQueryBuilder as FormSpamSubmissionReportsQueryBuilder, type index_d$1_FormSpamSubmissionReportsQueryResult as FormSpamSubmissionReportsQueryResult, type FormSubmission$1 as FormSubmission, type index_d$1_FormSubmissionOrderDetails as FormSubmissionOrderDetails, type index_d$1_GetFormSpamSubmissionReportRequest as GetFormSpamSubmissionReportRequest, type index_d$1_GetFormSpamSubmissionReportResponse as GetFormSpamSubmissionReportResponse, type index_d$1_GetFormSpamSubmissionReportResponseNonNullableFields as GetFormSpamSubmissionReportResponseNonNullableFields, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type ItemMetadata$1 as ItemMetadata, type MessageEnvelope$1 as MessageEnvelope, type OrderDetails$1 as OrderDetails, type index_d$1_QueryFormSpamSubmissionReportsByNamespaceRequest as QueryFormSpamSubmissionReportsByNamespaceRequest, type index_d$1_QueryFormSpamSubmissionReportsByNamespaceResponse as QueryFormSpamSubmissionReportsByNamespaceResponse, type index_d$1_QueryFormSpamSubmissionReportsByNamespaceResponseNonNullableFields as QueryFormSpamSubmissionReportsByNamespaceResponseNonNullableFields, type index_d$1_ReportNotSpamSubmissionRequest as ReportNotSpamSubmissionRequest, type index_d$1_ReportNotSpamSubmissionResponse as ReportNotSpamSubmissionResponse, type index_d$1_ReportNotSpamSubmissionResponseNonNullableFields as ReportNotSpamSubmissionResponseNonNullableFields, index_d$1_ReportReason as ReportReason, type index_d$1_ReportSpamSubmissionRequest as ReportSpamSubmissionRequest, type index_d$1_ReportSpamSubmissionResponse as ReportSpamSubmissionResponse, type index_d$1_ReportSpamSubmissionResponseNonNullableFields as ReportSpamSubmissionResponseNonNullableFields, type RestoreInfo$1 as RestoreInfo, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, type index_d$1_SpamReport as SpamReport, SubmissionStatus$1 as SubmissionStatus, type Submitter$1 as Submitter, type SubmitterSubmitterOneOf$1 as SubmitterSubmitterOneOf, WebhookIdentityType$1 as WebhookIdentityType, index_d$1_bulkDeleteFormSpamSubmissionReport as bulkDeleteFormSpamSubmissionReport, index_d$1_bulkDeleteFormSpamSubmissionReportByFilter as bulkDeleteFormSpamSubmissionReportByFilter, index_d$1_bulkReportNotSpamSubmission as bulkReportNotSpamSubmission, index_d$1_bulkReportSpamSubmission as bulkReportSpamSubmission, index_d$1_checkForSpam as checkForSpam, index_d$1_countFormSpamSubmissionReports as countFormSpamSubmissionReports, index_d$1_createFormSpamSubmissionReport as createFormSpamSubmissionReport, index_d$1_deleteFormSpamSubmissionReport as deleteFormSpamSubmissionReport, index_d$1_getFormSpamSubmissionReport as getFormSpamSubmissionReport, index_d$1_queryFormSpamSubmissionReportsByNamespace as queryFormSpamSubmissionReportsByNamespace, index_d$1_reportNotSpamSubmission as reportNotSpamSubmission, index_d$1_reportSpamSubmission as reportSpamSubmission };
|
|
6569
|
+
}
|
|
6570
|
+
|
|
6571
|
+
type HostModule<T, H extends Host> = {
|
|
6572
|
+
__type: 'host';
|
|
6573
|
+
create(host: H): T;
|
|
6574
|
+
};
|
|
6575
|
+
type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
|
|
6576
|
+
type Host<Environment = unknown> = {
|
|
6577
|
+
channel: {
|
|
6578
|
+
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
6579
|
+
disconnect: () => void;
|
|
6580
|
+
} | Promise<{
|
|
6581
|
+
disconnect: () => void;
|
|
6582
|
+
}>;
|
|
6583
|
+
};
|
|
6584
|
+
environment?: Environment;
|
|
6032
6585
|
/**
|
|
6033
|
-
*
|
|
6034
|
-
* Submission automations are triggered the same way as in standard submission creation flow.
|
|
6035
|
-
* @param - Id of the form spam submission report to report as not spam.
|
|
6586
|
+
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
|
6036
6587
|
*/
|
|
6037
|
-
|
|
6038
|
-
}
|
|
6039
|
-
declare function bulkReportNotSpamSubmission$1(httpClient: HttpClient): BulkReportNotSpamSubmissionSignature;
|
|
6040
|
-
interface BulkReportNotSpamSubmissionSignature {
|
|
6588
|
+
apiBaseUrl?: string;
|
|
6041
6589
|
/**
|
|
6042
|
-
*
|
|
6043
|
-
*
|
|
6044
|
-
* @param - Id of the form to which belong reports
|
|
6590
|
+
* Possible data to be provided by every host, for cross cutting concerns
|
|
6591
|
+
* like internationalization, billing, etc.
|
|
6045
6592
|
*/
|
|
6046
|
-
|
|
6593
|
+
essentials?: {
|
|
6594
|
+
/**
|
|
6595
|
+
* The language of the currently viewed session
|
|
6596
|
+
*/
|
|
6597
|
+
language?: string;
|
|
6598
|
+
/**
|
|
6599
|
+
* The locale of the currently viewed session
|
|
6600
|
+
*/
|
|
6601
|
+
locale?: string;
|
|
6602
|
+
/**
|
|
6603
|
+
* Any headers that should be passed through to the API requests
|
|
6604
|
+
*/
|
|
6605
|
+
passThroughHeaders?: Record<string, string>;
|
|
6606
|
+
};
|
|
6607
|
+
};
|
|
6608
|
+
|
|
6609
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
6610
|
+
interface HttpClient {
|
|
6611
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
6612
|
+
fetchWithAuth: typeof fetch;
|
|
6613
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
6614
|
+
getActiveToken?: () => string | undefined;
|
|
6047
6615
|
}
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6616
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
6617
|
+
type HttpResponse<T = any> = {
|
|
6618
|
+
data: T;
|
|
6619
|
+
status: number;
|
|
6620
|
+
statusText: string;
|
|
6621
|
+
headers: any;
|
|
6622
|
+
request?: any;
|
|
6623
|
+
};
|
|
6624
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
6625
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
6626
|
+
url: string;
|
|
6627
|
+
data?: Data;
|
|
6628
|
+
params?: URLSearchParams;
|
|
6629
|
+
} & APIMetadata;
|
|
6630
|
+
type APIMetadata = {
|
|
6631
|
+
methodFqn?: string;
|
|
6632
|
+
entityFqdn?: string;
|
|
6633
|
+
packageName?: string;
|
|
6634
|
+
};
|
|
6635
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
6636
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
6637
|
+
__type: 'event-definition';
|
|
6638
|
+
type: Type;
|
|
6639
|
+
isDomainEvent?: boolean;
|
|
6640
|
+
transformations?: (envelope: unknown) => Payload;
|
|
6641
|
+
__payload: Payload;
|
|
6642
|
+
};
|
|
6643
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
6644
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
6645
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
6646
|
+
|
|
6647
|
+
type ServicePluginMethodInput = {
|
|
6648
|
+
request: any;
|
|
6649
|
+
metadata: any;
|
|
6650
|
+
};
|
|
6651
|
+
type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
|
|
6652
|
+
type ServicePluginMethodMetadata = {
|
|
6653
|
+
name: string;
|
|
6654
|
+
primaryHttpMappingPath: string;
|
|
6655
|
+
transformations: {
|
|
6656
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput;
|
|
6657
|
+
toREST: (...args: unknown[]) => unknown;
|
|
6658
|
+
};
|
|
6659
|
+
};
|
|
6660
|
+
type ServicePluginDefinition<Contract extends ServicePluginContract> = {
|
|
6661
|
+
__type: 'service-plugin-definition';
|
|
6662
|
+
componentType: string;
|
|
6663
|
+
methods: ServicePluginMethodMetadata[];
|
|
6664
|
+
__contract: Contract;
|
|
6665
|
+
};
|
|
6666
|
+
declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
|
|
6667
|
+
type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
|
|
6668
|
+
declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
|
|
6669
|
+
|
|
6670
|
+
type RequestContext = {
|
|
6671
|
+
isSSR: boolean;
|
|
6672
|
+
host: string;
|
|
6673
|
+
protocol?: string;
|
|
6674
|
+
};
|
|
6675
|
+
type ResponseTransformer = (data: any, headers?: any) => any;
|
|
6676
|
+
/**
|
|
6677
|
+
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
6678
|
+
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
6679
|
+
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
6680
|
+
*/
|
|
6681
|
+
type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
6682
|
+
type AmbassadorRequestOptions<T = any> = {
|
|
6683
|
+
_?: T;
|
|
6684
|
+
url?: string;
|
|
6685
|
+
method?: Method;
|
|
6686
|
+
params?: any;
|
|
6687
|
+
data?: any;
|
|
6688
|
+
transformResponse?: ResponseTransformer | ResponseTransformer[];
|
|
6689
|
+
};
|
|
6690
|
+
type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
|
|
6691
|
+
__isAmbassador: boolean;
|
|
6692
|
+
};
|
|
6693
|
+
type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
|
|
6694
|
+
type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
6695
|
+
|
|
6696
|
+
declare global {
|
|
6697
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
6698
|
+
interface SymbolConstructor {
|
|
6699
|
+
readonly observable: symbol;
|
|
6700
|
+
}
|
|
6056
6701
|
}
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6702
|
+
|
|
6703
|
+
declare const emptyObjectSymbol: unique symbol;
|
|
6704
|
+
|
|
6705
|
+
/**
|
|
6706
|
+
Represents a strictly empty plain object, the `{}` value.
|
|
6707
|
+
|
|
6708
|
+
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)).
|
|
6709
|
+
|
|
6710
|
+
@example
|
|
6711
|
+
```
|
|
6712
|
+
import type {EmptyObject} from 'type-fest';
|
|
6713
|
+
|
|
6714
|
+
// The following illustrates the problem with `{}`.
|
|
6715
|
+
const foo1: {} = {}; // Pass
|
|
6716
|
+
const foo2: {} = []; // Pass
|
|
6717
|
+
const foo3: {} = 42; // Pass
|
|
6718
|
+
const foo4: {} = {a: 1}; // Pass
|
|
6719
|
+
|
|
6720
|
+
// With `EmptyObject` only the first case is valid.
|
|
6721
|
+
const bar1: EmptyObject = {}; // Pass
|
|
6722
|
+
const bar2: EmptyObject = 42; // Fail
|
|
6723
|
+
const bar3: EmptyObject = []; // Fail
|
|
6724
|
+
const bar4: EmptyObject = {a: 1}; // Fail
|
|
6725
|
+
```
|
|
6726
|
+
|
|
6727
|
+
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}.
|
|
6728
|
+
|
|
6729
|
+
@category Object
|
|
6730
|
+
*/
|
|
6731
|
+
type EmptyObject = {[emptyObjectSymbol]?: never};
|
|
6732
|
+
|
|
6733
|
+
/**
|
|
6734
|
+
Returns a boolean for whether the two given types are equal.
|
|
6735
|
+
|
|
6736
|
+
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
6737
|
+
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
6738
|
+
|
|
6739
|
+
Use-cases:
|
|
6740
|
+
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
6741
|
+
|
|
6742
|
+
@example
|
|
6743
|
+
```
|
|
6744
|
+
import type {IsEqual} from 'type-fest';
|
|
6745
|
+
|
|
6746
|
+
// This type returns a boolean for whether the given array includes the given item.
|
|
6747
|
+
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
6748
|
+
type Includes<Value extends readonly any[], Item> =
|
|
6749
|
+
Value extends readonly [Value[0], ...infer rest]
|
|
6750
|
+
? IsEqual<Value[0], Item> extends true
|
|
6751
|
+
? true
|
|
6752
|
+
: Includes<rest, Item>
|
|
6753
|
+
: false;
|
|
6754
|
+
```
|
|
6755
|
+
|
|
6756
|
+
@category Type Guard
|
|
6757
|
+
@category Utilities
|
|
6758
|
+
*/
|
|
6759
|
+
type IsEqual<A, B> =
|
|
6760
|
+
(<G>() => G extends A ? 1 : 2) extends
|
|
6761
|
+
(<G>() => G extends B ? 1 : 2)
|
|
6762
|
+
? true
|
|
6763
|
+
: false;
|
|
6764
|
+
|
|
6765
|
+
/**
|
|
6766
|
+
Filter out keys from an object.
|
|
6767
|
+
|
|
6768
|
+
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
6769
|
+
Returns `never` if `Key` extends `Exclude`.
|
|
6770
|
+
Returns `Key` otherwise.
|
|
6771
|
+
|
|
6772
|
+
@example
|
|
6773
|
+
```
|
|
6774
|
+
type Filtered = Filter<'foo', 'foo'>;
|
|
6775
|
+
//=> never
|
|
6776
|
+
```
|
|
6777
|
+
|
|
6778
|
+
@example
|
|
6779
|
+
```
|
|
6780
|
+
type Filtered = Filter<'bar', string>;
|
|
6781
|
+
//=> never
|
|
6782
|
+
```
|
|
6783
|
+
|
|
6784
|
+
@example
|
|
6785
|
+
```
|
|
6786
|
+
type Filtered = Filter<'bar', 'foo'>;
|
|
6787
|
+
//=> 'bar'
|
|
6788
|
+
```
|
|
6789
|
+
|
|
6790
|
+
@see {Except}
|
|
6791
|
+
*/
|
|
6792
|
+
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
6793
|
+
|
|
6794
|
+
type ExceptOptions = {
|
|
6795
|
+
/**
|
|
6796
|
+
Disallow assigning non-specified properties.
|
|
6797
|
+
|
|
6798
|
+
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
6799
|
+
|
|
6800
|
+
@default false
|
|
6801
|
+
*/
|
|
6802
|
+
requireExactProps?: boolean;
|
|
6803
|
+
};
|
|
6804
|
+
|
|
6805
|
+
/**
|
|
6806
|
+
Create a type from an object type without certain keys.
|
|
6807
|
+
|
|
6808
|
+
We recommend setting the `requireExactProps` option to `true`.
|
|
6809
|
+
|
|
6810
|
+
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.
|
|
6811
|
+
|
|
6812
|
+
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)).
|
|
6813
|
+
|
|
6814
|
+
@example
|
|
6815
|
+
```
|
|
6816
|
+
import type {Except} from 'type-fest';
|
|
6817
|
+
|
|
6818
|
+
type Foo = {
|
|
6819
|
+
a: number;
|
|
6820
|
+
b: string;
|
|
6821
|
+
};
|
|
6822
|
+
|
|
6823
|
+
type FooWithoutA = Except<Foo, 'a'>;
|
|
6824
|
+
//=> {b: string}
|
|
6825
|
+
|
|
6826
|
+
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
6827
|
+
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
6828
|
+
|
|
6829
|
+
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
6830
|
+
//=> {a: number} & Partial<Record<"b", never>>
|
|
6831
|
+
|
|
6832
|
+
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
6833
|
+
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
6834
|
+
```
|
|
6835
|
+
|
|
6836
|
+
@category Object
|
|
6837
|
+
*/
|
|
6838
|
+
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
|
|
6839
|
+
[KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
|
|
6840
|
+
} & (Options['requireExactProps'] extends true
|
|
6841
|
+
? Partial<Record<KeysType, never>>
|
|
6842
|
+
: {});
|
|
6843
|
+
|
|
6844
|
+
/**
|
|
6845
|
+
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
6846
|
+
|
|
6847
|
+
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
6848
|
+
|
|
6849
|
+
@example
|
|
6850
|
+
```
|
|
6851
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
6852
|
+
|
|
6853
|
+
interface Example {
|
|
6854
|
+
a: string;
|
|
6855
|
+
b: string | number;
|
|
6856
|
+
c?: string;
|
|
6857
|
+
d: {};
|
|
6064
6858
|
}
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6859
|
+
|
|
6860
|
+
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
6861
|
+
//=> 'a'
|
|
6862
|
+
```
|
|
6863
|
+
|
|
6864
|
+
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
6865
|
+
|
|
6866
|
+
@example
|
|
6867
|
+
```
|
|
6868
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
6869
|
+
|
|
6870
|
+
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
6871
|
+
//=> 'a' | 'c'
|
|
6872
|
+
```
|
|
6873
|
+
|
|
6874
|
+
@category Object
|
|
6875
|
+
*/
|
|
6876
|
+
type ConditionalKeys<Base, Condition> = NonNullable<
|
|
6877
|
+
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
|
6878
|
+
{
|
|
6879
|
+
// Map through all the keys of the given base type.
|
|
6880
|
+
[Key in keyof Base]:
|
|
6881
|
+
// Pick only keys with types extending the given `Condition` type.
|
|
6882
|
+
Base[Key] extends Condition
|
|
6883
|
+
// Retain this key since the condition passes.
|
|
6884
|
+
? Key
|
|
6885
|
+
// Discard this key since the condition fails.
|
|
6886
|
+
: never;
|
|
6887
|
+
|
|
6888
|
+
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
6889
|
+
}[keyof Base]
|
|
6890
|
+
>;
|
|
6891
|
+
|
|
6892
|
+
/**
|
|
6893
|
+
Exclude keys from a shape that matches the given `Condition`.
|
|
6894
|
+
|
|
6895
|
+
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.
|
|
6896
|
+
|
|
6897
|
+
@example
|
|
6898
|
+
```
|
|
6899
|
+
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
6900
|
+
|
|
6901
|
+
class Awesome {
|
|
6902
|
+
name: string;
|
|
6903
|
+
successes: number;
|
|
6904
|
+
failures: bigint;
|
|
6905
|
+
|
|
6906
|
+
run() {}
|
|
6071
6907
|
}
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6908
|
+
|
|
6909
|
+
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
6910
|
+
//=> {run: () => void}
|
|
6911
|
+
```
|
|
6912
|
+
|
|
6913
|
+
@example
|
|
6914
|
+
```
|
|
6915
|
+
import type {ConditionalExcept} from 'type-fest';
|
|
6916
|
+
|
|
6917
|
+
interface Example {
|
|
6918
|
+
a: string;
|
|
6919
|
+
b: string | number;
|
|
6920
|
+
c: () => void;
|
|
6921
|
+
d: {};
|
|
6080
6922
|
}
|
|
6081
6923
|
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
declare const deleteFormSpamSubmissionReport: MaybeContext<BuildRESTFunction<typeof deleteFormSpamSubmissionReport$1> & typeof deleteFormSpamSubmissionReport$1>;
|
|
6086
|
-
declare const bulkDeleteFormSpamSubmissionReport: MaybeContext<BuildRESTFunction<typeof bulkDeleteFormSpamSubmissionReport$1> & typeof bulkDeleteFormSpamSubmissionReport$1>;
|
|
6087
|
-
declare const bulkDeleteFormSpamSubmissionReportByFilter: MaybeContext<BuildRESTFunction<typeof bulkDeleteFormSpamSubmissionReportByFilter$1> & typeof bulkDeleteFormSpamSubmissionReportByFilter$1>;
|
|
6088
|
-
declare const reportNotSpamSubmission: MaybeContext<BuildRESTFunction<typeof reportNotSpamSubmission$1> & typeof reportNotSpamSubmission$1>;
|
|
6089
|
-
declare const bulkReportNotSpamSubmission: MaybeContext<BuildRESTFunction<typeof bulkReportNotSpamSubmission$1> & typeof bulkReportNotSpamSubmission$1>;
|
|
6090
|
-
declare const reportSpamSubmission: MaybeContext<BuildRESTFunction<typeof reportSpamSubmission$1> & typeof reportSpamSubmission$1>;
|
|
6091
|
-
declare const bulkReportSpamSubmission: MaybeContext<BuildRESTFunction<typeof bulkReportSpamSubmission$1> & typeof bulkReportSpamSubmission$1>;
|
|
6092
|
-
declare const queryFormSpamSubmissionReportsByNamespace: MaybeContext<BuildRESTFunction<typeof queryFormSpamSubmissionReportsByNamespace$1> & typeof queryFormSpamSubmissionReportsByNamespace$1>;
|
|
6093
|
-
declare const countFormSpamSubmissionReports: MaybeContext<BuildRESTFunction<typeof countFormSpamSubmissionReports$1> & typeof countFormSpamSubmissionReports$1>;
|
|
6924
|
+
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
6925
|
+
//=> {b: string | number; c: () => void; d: {}}
|
|
6926
|
+
```
|
|
6094
6927
|
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
type
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
type
|
|
6106
|
-
|
|
6107
|
-
type
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
type
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
type
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
type
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
type index_d$1_ReportReason = ReportReason;
|
|
6140
|
-
declare const index_d$1_ReportReason: typeof ReportReason;
|
|
6141
|
-
type index_d$1_ReportSpamSubmissionRequest = ReportSpamSubmissionRequest;
|
|
6142
|
-
type index_d$1_ReportSpamSubmissionResponse = ReportSpamSubmissionResponse;
|
|
6143
|
-
type index_d$1_ReportSpamSubmissionResponseNonNullableFields = ReportSpamSubmissionResponseNonNullableFields;
|
|
6144
|
-
type index_d$1_SpamReport = SpamReport;
|
|
6145
|
-
declare const index_d$1_bulkDeleteFormSpamSubmissionReport: typeof bulkDeleteFormSpamSubmissionReport;
|
|
6146
|
-
declare const index_d$1_bulkDeleteFormSpamSubmissionReportByFilter: typeof bulkDeleteFormSpamSubmissionReportByFilter;
|
|
6147
|
-
declare const index_d$1_bulkReportNotSpamSubmission: typeof bulkReportNotSpamSubmission;
|
|
6148
|
-
declare const index_d$1_bulkReportSpamSubmission: typeof bulkReportSpamSubmission;
|
|
6149
|
-
declare const index_d$1_checkForSpam: typeof checkForSpam;
|
|
6150
|
-
declare const index_d$1_countFormSpamSubmissionReports: typeof countFormSpamSubmissionReports;
|
|
6151
|
-
declare const index_d$1_createFormSpamSubmissionReport: typeof createFormSpamSubmissionReport;
|
|
6152
|
-
declare const index_d$1_deleteFormSpamSubmissionReport: typeof deleteFormSpamSubmissionReport;
|
|
6153
|
-
declare const index_d$1_getFormSpamSubmissionReport: typeof getFormSpamSubmissionReport;
|
|
6154
|
-
declare const index_d$1_queryFormSpamSubmissionReportsByNamespace: typeof queryFormSpamSubmissionReportsByNamespace;
|
|
6155
|
-
declare const index_d$1_reportNotSpamSubmission: typeof reportNotSpamSubmission;
|
|
6156
|
-
declare const index_d$1_reportSpamSubmission: typeof reportSpamSubmission;
|
|
6157
|
-
declare namespace index_d$1 {
|
|
6158
|
-
export { type ActionEvent$1 as ActionEvent, type ApplicationError$1 as ApplicationError, type BulkActionMetadata$1 as BulkActionMetadata, type index_d$1_BulkDeleteFormSpamSubmissionReportByFilterRequest as BulkDeleteFormSpamSubmissionReportByFilterRequest, type index_d$1_BulkDeleteFormSpamSubmissionReportByFilterResponse as BulkDeleteFormSpamSubmissionReportByFilterResponse, type index_d$1_BulkDeleteFormSpamSubmissionReportByFilterResponseNonNullableFields as BulkDeleteFormSpamSubmissionReportByFilterResponseNonNullableFields, type index_d$1_BulkDeleteFormSpamSubmissionReportOptions as BulkDeleteFormSpamSubmissionReportOptions, type index_d$1_BulkDeleteFormSpamSubmissionReportRequest as BulkDeleteFormSpamSubmissionReportRequest, type index_d$1_BulkDeleteFormSpamSubmissionReportResponse as BulkDeleteFormSpamSubmissionReportResponse, type index_d$1_BulkDeleteFormSpamSubmissionReportResponseNonNullableFields as BulkDeleteFormSpamSubmissionReportResponseNonNullableFields, type index_d$1_BulkDeleteFormSpamSubmissionReportResult as BulkDeleteFormSpamSubmissionReportResult, type index_d$1_BulkReportNotSpamSubmissionOptions as BulkReportNotSpamSubmissionOptions, type index_d$1_BulkReportNotSpamSubmissionRequest as BulkReportNotSpamSubmissionRequest, type index_d$1_BulkReportNotSpamSubmissionResponse as BulkReportNotSpamSubmissionResponse, type index_d$1_BulkReportNotSpamSubmissionResponseNonNullableFields as BulkReportNotSpamSubmissionResponseNonNullableFields, type index_d$1_BulkReportNotSpamSubmissionResult as BulkReportNotSpamSubmissionResult, type index_d$1_BulkReportSpamSubmissionOptions as BulkReportSpamSubmissionOptions, type index_d$1_BulkReportSpamSubmissionRequest as BulkReportSpamSubmissionRequest, type index_d$1_BulkReportSpamSubmissionResponse as BulkReportSpamSubmissionResponse, type index_d$1_BulkReportSpamSubmissionResponseNonNullableFields as BulkReportSpamSubmissionResponseNonNullableFields, type index_d$1_BulkReportSpamSubmissionResult as BulkReportSpamSubmissionResult, type index_d$1_CheckForSpamRequest as CheckForSpamRequest, type index_d$1_CheckForSpamResponse as CheckForSpamResponse, type index_d$1_CheckForSpamResponseNonNullableFields as CheckForSpamResponseNonNullableFields, type index_d$1_CountFormSpamSubmissionReportsRequest as CountFormSpamSubmissionReportsRequest, type index_d$1_CountFormSpamSubmissionReportsResponse as CountFormSpamSubmissionReportsResponse, type index_d$1_CountFormSpamSubmissionReportsResponseNonNullableFields as CountFormSpamSubmissionReportsResponseNonNullableFields, type index_d$1_CreateFormSpamSubmissionReportRequest as CreateFormSpamSubmissionReportRequest, type index_d$1_CreateFormSpamSubmissionReportResponse as CreateFormSpamSubmissionReportResponse, type index_d$1_CreateFormSpamSubmissionReportResponseNonNullableFields as CreateFormSpamSubmissionReportResponseNonNullableFields, type CursorPaging$1 as CursorPaging, type CursorPagingMetadata$1 as CursorPagingMetadata, type CursorQuery$1 as CursorQuery, type CursorQueryPagingMethodOneOf$1 as CursorQueryPagingMethodOneOf, type Cursors$1 as Cursors, type index_d$1_DeleteFormSpamSubmissionReportRequest as DeleteFormSpamSubmissionReportRequest, type index_d$1_DeleteFormSpamSubmissionReportResponse as DeleteFormSpamSubmissionReportResponse, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type Empty$1 as Empty, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type ExtendedFields$1 as ExtendedFields, type index_d$1_FormSpamSubmissionReport as FormSpamSubmissionReport, type index_d$1_FormSpamSubmissionReportNonNullableFields as FormSpamSubmissionReportNonNullableFields, type index_d$1_FormSpamSubmissionReportsCount as FormSpamSubmissionReportsCount, type index_d$1_FormSpamSubmissionReportsQueryBuilder as FormSpamSubmissionReportsQueryBuilder, type index_d$1_FormSpamSubmissionReportsQueryResult as FormSpamSubmissionReportsQueryResult, type FormSubmission$1 as FormSubmission, type index_d$1_FormSubmissionOrderDetails as FormSubmissionOrderDetails, type index_d$1_GetFormSpamSubmissionReportRequest as GetFormSpamSubmissionReportRequest, type index_d$1_GetFormSpamSubmissionReportResponse as GetFormSpamSubmissionReportResponse, type index_d$1_GetFormSpamSubmissionReportResponseNonNullableFields as GetFormSpamSubmissionReportResponseNonNullableFields, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type ItemMetadata$1 as ItemMetadata, type MessageEnvelope$1 as MessageEnvelope, type OrderDetails$1 as OrderDetails, type index_d$1_QueryFormSpamSubmissionReportsByNamespaceRequest as QueryFormSpamSubmissionReportsByNamespaceRequest, type index_d$1_QueryFormSpamSubmissionReportsByNamespaceResponse as QueryFormSpamSubmissionReportsByNamespaceResponse, type index_d$1_QueryFormSpamSubmissionReportsByNamespaceResponseNonNullableFields as QueryFormSpamSubmissionReportsByNamespaceResponseNonNullableFields, type index_d$1_ReportNotSpamSubmissionRequest as ReportNotSpamSubmissionRequest, type index_d$1_ReportNotSpamSubmissionResponse as ReportNotSpamSubmissionResponse, type index_d$1_ReportNotSpamSubmissionResponseNonNullableFields as ReportNotSpamSubmissionResponseNonNullableFields, index_d$1_ReportReason as ReportReason, type index_d$1_ReportSpamSubmissionRequest as ReportSpamSubmissionRequest, type index_d$1_ReportSpamSubmissionResponse as ReportSpamSubmissionResponse, type index_d$1_ReportSpamSubmissionResponseNonNullableFields as ReportSpamSubmissionResponseNonNullableFields, type RestoreInfo$1 as RestoreInfo, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, type index_d$1_SpamReport as SpamReport, SubmissionStatus$1 as SubmissionStatus, type Submitter$1 as Submitter, type SubmitterSubmitterOneOf$1 as SubmitterSubmitterOneOf, WebhookIdentityType$1 as WebhookIdentityType, index_d$1_bulkDeleteFormSpamSubmissionReport as bulkDeleteFormSpamSubmissionReport, index_d$1_bulkDeleteFormSpamSubmissionReportByFilter as bulkDeleteFormSpamSubmissionReportByFilter, index_d$1_bulkReportNotSpamSubmission as bulkReportNotSpamSubmission, index_d$1_bulkReportSpamSubmission as bulkReportSpamSubmission, index_d$1_checkForSpam as checkForSpam, index_d$1_countFormSpamSubmissionReports as countFormSpamSubmissionReports, index_d$1_createFormSpamSubmissionReport as createFormSpamSubmissionReport, index_d$1_deleteFormSpamSubmissionReport as deleteFormSpamSubmissionReport, index_d$1_getFormSpamSubmissionReport as getFormSpamSubmissionReport, index_d$1_queryFormSpamSubmissionReportsByNamespace as queryFormSpamSubmissionReportsByNamespace, index_d$1_reportNotSpamSubmission as reportNotSpamSubmission, index_d$1_reportSpamSubmission as reportSpamSubmission };
|
|
6928
|
+
@category Object
|
|
6929
|
+
*/
|
|
6930
|
+
type ConditionalExcept<Base, Condition> = Except<
|
|
6931
|
+
Base,
|
|
6932
|
+
ConditionalKeys<Base, Condition>
|
|
6933
|
+
>;
|
|
6934
|
+
|
|
6935
|
+
/**
|
|
6936
|
+
* Descriptors are objects that describe the API of a module, and the module
|
|
6937
|
+
* can either be a REST module or a host module.
|
|
6938
|
+
* This type is recursive, so it can describe nested modules.
|
|
6939
|
+
*/
|
|
6940
|
+
type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
|
|
6941
|
+
[key: string]: Descriptors | PublicMetadata | any;
|
|
6942
|
+
};
|
|
6943
|
+
/**
|
|
6944
|
+
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
6945
|
+
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
6946
|
+
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
6947
|
+
* do not match the given host (as they will not work with the given host).
|
|
6948
|
+
*/
|
|
6949
|
+
type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
|
|
6950
|
+
done: T;
|
|
6951
|
+
recurse: T extends {
|
|
6952
|
+
__type: typeof SERVICE_PLUGIN_ERROR_TYPE;
|
|
6953
|
+
} ? 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<{
|
|
6954
|
+
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
|
|
6955
|
+
-1,
|
|
6956
|
+
0,
|
|
6957
|
+
1,
|
|
6958
|
+
2,
|
|
6959
|
+
3,
|
|
6960
|
+
4,
|
|
6961
|
+
5
|
|
6962
|
+
][Depth]> : never;
|
|
6963
|
+
}, EmptyObject>;
|
|
6964
|
+
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
6965
|
+
type PublicMetadata = {
|
|
6966
|
+
PACKAGE_NAME?: string;
|
|
6967
|
+
};
|
|
6968
|
+
|
|
6969
|
+
declare global {
|
|
6970
|
+
interface ContextualClient {
|
|
6971
|
+
}
|
|
6159
6972
|
}
|
|
6973
|
+
/**
|
|
6974
|
+
* A type used to create concerete types from SDK descriptors in
|
|
6975
|
+
* case a contextual client is available.
|
|
6976
|
+
*/
|
|
6977
|
+
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
6978
|
+
host: Host;
|
|
6979
|
+
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
6160
6980
|
|
|
6161
6981
|
/** Form submission that was created or retrieved. */
|
|
6162
6982
|
interface FormSubmission {
|