@wix/data 1.0.161 → 1.0.162

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
- type HostModule<T, H extends Host> = {
1
+ type HostModule$3<T, H extends Host$3> = {
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$3<T extends HostModule$3<any, any>> = T extends HostModule$3<infer U, any> ? U : never;
6
+ type Host$3<Environment = unknown> = {
7
7
  channel: {
8
8
  observeState(callback: (props: unknown, environment: Environment) => unknown): {
9
9
  disconnect: () => void;
@@ -12,6 +12,10 @@ type Host<Environment = unknown> = {
12
12
  }>;
13
13
  };
14
14
  environment?: Environment;
15
+ /**
16
+ * Optional name of the environment, use for logging
17
+ */
18
+ name?: string;
15
19
  /**
16
20
  * Optional bast url to use for API requests, for example `www.wixapis.com`
17
21
  */
@@ -36,33 +40,33 @@ type Host<Environment = unknown> = {
36
40
  };
37
41
  };
38
42
 
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>>;
43
+ type RESTFunctionDescriptor$3<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$3) => T;
44
+ interface HttpClient$3 {
45
+ request<TResponse, TData = any>(req: RequestOptionsFactory$3<TResponse, TData>): Promise<HttpResponse$3<TResponse>>;
42
46
  fetchWithAuth: typeof fetch;
43
47
  wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
44
48
  getActiveToken?: () => string | undefined;
45
49
  }
46
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
47
- type HttpResponse<T = any> = {
50
+ type RequestOptionsFactory$3<TResponse = any, TData = any> = (context: any) => RequestOptions$3<TResponse, TData>;
51
+ type HttpResponse$3<T = any> = {
48
52
  data: T;
49
53
  status: number;
50
54
  statusText: string;
51
55
  headers: any;
52
56
  request?: any;
53
57
  };
54
- type RequestOptions<_TResponse = any, Data = any> = {
58
+ type RequestOptions$3<_TResponse = any, Data = any> = {
55
59
  method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
56
60
  url: string;
57
61
  data?: Data;
58
62
  params?: URLSearchParams;
59
- } & APIMetadata;
60
- type APIMetadata = {
63
+ } & APIMetadata$3;
64
+ type APIMetadata$3 = {
61
65
  methodFqn?: string;
62
66
  entityFqdn?: string;
63
67
  packageName?: string;
64
68
  };
65
- type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
69
+ type BuildRESTFunction$3<T extends RESTFunctionDescriptor$3> = T extends RESTFunctionDescriptor$3<infer U> ? U : never;
66
70
  type EventDefinition$3<Payload = unknown, Type extends string = string> = {
67
71
  __type: 'event-definition';
68
72
  type: Type;
@@ -74,54 +78,54 @@ declare function EventDefinition$3<Type extends string>(type: Type, isDomainEven
74
78
  type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
75
79
  type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
76
80
 
77
- type ServicePluginMethodInput = {
81
+ type ServicePluginMethodInput$3 = {
78
82
  request: any;
79
83
  metadata: any;
80
84
  };
81
- type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
82
- type ServicePluginMethodMetadata = {
85
+ type ServicePluginContract$3 = Record<string, (payload: ServicePluginMethodInput$3) => unknown | Promise<unknown>>;
86
+ type ServicePluginMethodMetadata$3 = {
83
87
  name: string;
84
88
  primaryHttpMappingPath: string;
85
89
  transformations: {
86
- fromREST: (...args: unknown[]) => ServicePluginMethodInput;
90
+ fromREST: (...args: unknown[]) => ServicePluginMethodInput$3;
87
91
  toREST: (...args: unknown[]) => unknown;
88
92
  };
89
93
  };
90
- type ServicePluginDefinition<Contract extends ServicePluginContract> = {
94
+ type ServicePluginDefinition$3<Contract extends ServicePluginContract$3> = {
91
95
  __type: 'service-plugin-definition';
92
96
  componentType: string;
93
- methods: ServicePluginMethodMetadata[];
97
+ methods: ServicePluginMethodMetadata$3[];
94
98
  __contract: Contract;
95
99
  };
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";
100
+ declare function ServicePluginDefinition$3<Contract extends ServicePluginContract$3>(componentType: string, methods: ServicePluginMethodMetadata$3[]): ServicePluginDefinition$3<Contract>;
101
+ type BuildServicePluginDefinition$3<T extends ServicePluginDefinition$3<any>> = (implementation: T['__contract']) => void;
102
+ declare const SERVICE_PLUGIN_ERROR_TYPE$3 = "wix_spi_error";
99
103
 
100
- type RequestContext = {
104
+ type RequestContext$3 = {
101
105
  isSSR: boolean;
102
106
  host: string;
103
107
  protocol?: string;
104
108
  };
105
- type ResponseTransformer = (data: any, headers?: any) => any;
109
+ type ResponseTransformer$3 = (data: any, headers?: any) => any;
106
110
  /**
107
111
  * Ambassador request options types are copied mostly from AxiosRequestConfig.
108
112
  * They are copied and not imported to reduce the amount of dependencies (to reduce install time).
109
113
  * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
110
114
  */
111
- type Method = '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> = {
115
+ type Method$3 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
116
+ type AmbassadorRequestOptions$3<T = any> = {
113
117
  _?: T;
114
118
  url?: string;
115
- method?: Method;
119
+ method?: Method$3;
116
120
  params?: any;
117
121
  data?: any;
118
- transformResponse?: ResponseTransformer | ResponseTransformer[];
122
+ transformResponse?: ResponseTransformer$3 | ResponseTransformer$3[];
119
123
  };
120
- type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
124
+ type AmbassadorFactory$3<Request, Response> = (payload: Request) => ((context: RequestContext$3) => AmbassadorRequestOptions$3<Response>) & {
121
125
  __isAmbassador: boolean;
122
126
  };
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;
127
+ type AmbassadorFunctionDescriptor$3<Request = any, Response = any> = AmbassadorFactory$3<Request, Response>;
128
+ type BuildAmbassadorFunction$3<T extends AmbassadorFunctionDescriptor$3> = T extends AmbassadorFunctionDescriptor$3<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
125
129
 
126
130
  declare global {
127
131
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
@@ -130,7 +134,7 @@ declare global {
130
134
  }
131
135
  }
132
136
 
133
- declare const emptyObjectSymbol: unique symbol;
137
+ declare const emptyObjectSymbol$3: unique symbol;
134
138
 
135
139
  /**
136
140
  Represents a strictly empty plain object, the `{}` value.
@@ -158,7 +162,7 @@ Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<n
158
162
 
159
163
  @category Object
160
164
  */
161
- type EmptyObject = {[emptyObjectSymbol]?: never};
165
+ type EmptyObject$3 = {[emptyObjectSymbol$3]?: never};
162
166
 
163
167
  /**
164
168
  Returns a boolean for whether the two given types are equal.
@@ -186,7 +190,7 @@ type Includes<Value extends readonly any[], Item> =
186
190
  @category Type Guard
187
191
  @category Utilities
188
192
  */
189
- type IsEqual<A, B> =
193
+ type IsEqual$3<A, B> =
190
194
  (<G>() => G extends A ? 1 : 2) extends
191
195
  (<G>() => G extends B ? 1 : 2)
192
196
  ? true
@@ -219,9 +223,9 @@ type Filtered = Filter<'bar', 'foo'>;
219
223
 
220
224
  @see {Except}
221
225
  */
222
- type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
226
+ type Filter$3<KeyType, ExcludeType> = IsEqual$3<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
223
227
 
224
- type ExceptOptions = {
228
+ type ExceptOptions$3 = {
225
229
  /**
226
230
  Disallow assigning non-specified properties.
227
231
 
@@ -265,12 +269,78 @@ const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
265
269
 
266
270
  @category Object
267
271
  */
268
- type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
269
- [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
272
+ type Except$3<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$3 = {requireExactProps: false}> = {
273
+ [KeyType in keyof ObjectType as Filter$3<KeyType, KeysType>]: ObjectType[KeyType];
270
274
  } & (Options['requireExactProps'] extends true
271
275
  ? Partial<Record<KeysType, never>>
272
276
  : {});
273
277
 
278
+ /**
279
+ Returns a boolean for whether the given type is `never`.
280
+
281
+ @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
282
+ @link https://stackoverflow.com/a/53984913/10292952
283
+ @link https://www.zhenghao.io/posts/ts-never
284
+
285
+ Useful in type utilities, such as checking if something does not occur.
286
+
287
+ @example
288
+ ```
289
+ import type {IsNever, And} from 'type-fest';
290
+
291
+ // https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
292
+ type AreStringsEqual<A extends string, B extends string> =
293
+ And<
294
+ IsNever<Exclude<A, B>> extends true ? true : false,
295
+ IsNever<Exclude<B, A>> extends true ? true : false
296
+ >;
297
+
298
+ type EndIfEqual<I extends string, O extends string> =
299
+ AreStringsEqual<I, O> extends true
300
+ ? never
301
+ : void;
302
+
303
+ function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
304
+ if (input === output) {
305
+ process.exit(0);
306
+ }
307
+ }
308
+
309
+ endIfEqual('abc', 'abc');
310
+ //=> never
311
+
312
+ endIfEqual('abc', '123');
313
+ //=> void
314
+ ```
315
+
316
+ @category Type Guard
317
+ @category Utilities
318
+ */
319
+ type IsNever$3<T> = [T] extends [never] ? true : false;
320
+
321
+ /**
322
+ An if-else-like type that resolves depending on whether the given type is `never`.
323
+
324
+ @see {@link IsNever}
325
+
326
+ @example
327
+ ```
328
+ import type {IfNever} from 'type-fest';
329
+
330
+ type ShouldBeTrue = IfNever<never>;
331
+ //=> true
332
+
333
+ type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
334
+ //=> 'bar'
335
+ ```
336
+
337
+ @category Type Guard
338
+ @category Utilities
339
+ */
340
+ type IfNever$3<T, TypeIfNever = true, TypeIfNotNever = false> = (
341
+ IsNever$3<T> extends true ? TypeIfNever : TypeIfNotNever
342
+ );
343
+
274
344
  /**
275
345
  Extract the keys from a type where the value type of the key extends the given `Condition`.
276
346
 
@@ -303,21 +373,19 @@ type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
303
373
 
304
374
  @category Object
305
375
  */
306
- type ConditionalKeys<Base, Condition> = NonNullable<
307
- // Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
376
+ type ConditionalKeys$3<Base, Condition> =
308
377
  {
309
378
  // Map through all the keys of the given base type.
310
- [Key in keyof Base]:
379
+ [Key in keyof Base]-?:
311
380
  // Pick only keys with types extending the given `Condition` type.
312
381
  Base[Key] extends Condition
313
- // Retain this key since the condition passes.
314
- ? Key
382
+ // Retain this key
383
+ // If the value for the key extends never, only include it if `Condition` also extends never
384
+ ? IfNever$3<Base[Key], IfNever$3<Condition, Key, never>, Key>
315
385
  // Discard this key since the condition fails.
316
386
  : never;
317
-
318
387
  // Convert the produced object into a union type of the keys which passed the conditional test.
319
- }[keyof Base]
320
- >;
388
+ }[keyof Base];
321
389
 
322
390
  /**
323
391
  Exclude keys from a shape that matches the given `Condition`.
@@ -357,9 +425,9 @@ type NonStringKeysOnly = ConditionalExcept<Example, string>;
357
425
 
358
426
  @category Object
359
427
  */
360
- type ConditionalExcept<Base, Condition> = Except<
428
+ type ConditionalExcept$3<Base, Condition> = Except$3<
361
429
  Base,
362
- ConditionalKeys<Base, Condition>
430
+ ConditionalKeys$3<Base, Condition>
363
431
  >;
364
432
 
365
433
  /**
@@ -367,8 +435,8 @@ ConditionalKeys<Base, Condition>
367
435
  * can either be a REST module or a host module.
368
436
  * This type is recursive, so it can describe nested modules.
369
437
  */
370
- type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition$3<any> | ServicePluginDefinition<any> | {
371
- [key: string]: Descriptors | PublicMetadata | any;
438
+ type Descriptors$3 = RESTFunctionDescriptor$3 | AmbassadorFunctionDescriptor$3 | HostModule$3<any, any> | EventDefinition$3<any> | ServicePluginDefinition$3<any> | {
439
+ [key: string]: Descriptors$3 | PublicMetadata$3 | any;
372
440
  };
373
441
  /**
374
442
  * This type takes in a descriptors object of a certain Host (including an `unknown` host)
@@ -376,12 +444,12 @@ type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostM
376
444
  * Any non-descriptor properties are removed from the returned object, including descriptors that
377
445
  * do not match the given host (as they will not work with the given host).
378
446
  */
379
- type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
447
+ type BuildDescriptors$3<T extends Descriptors$3, H extends Host$3<any> | undefined, Depth extends number = 5> = {
380
448
  done: T;
381
449
  recurse: T extends {
382
- __type: typeof SERVICE_PLUGIN_ERROR_TYPE;
383
- } ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition$3<any> ? BuildEventDefinition$3<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, [
450
+ __type: typeof SERVICE_PLUGIN_ERROR_TYPE$3;
451
+ } ? never : T extends AmbassadorFunctionDescriptor$3 ? BuildAmbassadorFunction$3<T> : T extends RESTFunctionDescriptor$3 ? BuildRESTFunction$3<T> : T extends EventDefinition$3<any> ? BuildEventDefinition$3<T> : T extends ServicePluginDefinition$3<any> ? BuildServicePluginDefinition$3<T> : T extends HostModule$3<any, any> ? HostModuleAPI$3<T> : ConditionalExcept$3<{
452
+ [Key in keyof T]: T[Key] extends Descriptors$3 ? BuildDescriptors$3<T[Key], H, [
385
453
  -1,
386
454
  0,
387
455
  1,
@@ -390,9 +458,9 @@ type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, De
390
458
  4,
391
459
  5
392
460
  ][Depth]> : never;
393
- }, EmptyObject>;
461
+ }, EmptyObject$3>;
394
462
  }[Depth extends -1 ? 'done' : 'recurse'];
395
- type PublicMetadata = {
463
+ type PublicMetadata$3 = {
396
464
  PACKAGE_NAME?: string;
397
465
  };
398
466
 
@@ -404,9 +472,9 @@ declare global {
404
472
  * A type used to create concerete types from SDK descriptors in
405
473
  * case a contextual client is available.
406
474
  */
407
- type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
408
- host: Host;
409
- } ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
475
+ type MaybeContext$3<T extends Descriptors$3> = globalThis.ContextualClient extends {
476
+ host: Host$3;
477
+ } ? BuildDescriptors$3<T, globalThis.ContextualClient['host']> : T;
410
478
 
411
479
  /** An external database connection defines a connection between an external database and a Wix site or project. */
412
480
  interface ExternalDatabaseConnection {
@@ -825,7 +893,7 @@ interface UpdateExternalDatabaseConnection {
825
893
  capabilities?: Capabilities;
826
894
  }
827
895
 
828
- declare function getExternalDatabaseConnection$1(httpClient: HttpClient): GetExternalDatabaseConnectionSignature;
896
+ declare function getExternalDatabaseConnection$1(httpClient: HttpClient$3): GetExternalDatabaseConnectionSignature;
829
897
  interface GetExternalDatabaseConnectionSignature {
830
898
  /**
831
899
  * Retrieves an external database connection by name.
@@ -834,14 +902,14 @@ interface GetExternalDatabaseConnectionSignature {
834
902
  */
835
903
  (name: string): Promise<ExternalDatabaseConnection & ExternalDatabaseConnectionNonNullableFields>;
836
904
  }
837
- declare function listExternalDatabaseConnections$1(httpClient: HttpClient): ListExternalDatabaseConnectionsSignature;
905
+ declare function listExternalDatabaseConnections$1(httpClient: HttpClient$3): ListExternalDatabaseConnectionsSignature;
838
906
  interface ListExternalDatabaseConnectionsSignature {
839
907
  /**
840
908
  * Retrieves a list of all external database collections associated with the site or project.
841
909
  */
842
910
  (options?: ListExternalDatabaseConnectionsOptions | undefined): Promise<ListExternalDatabaseConnectionsResponse & ListExternalDatabaseConnectionsResponseNonNullableFields>;
843
911
  }
844
- declare function createExternalDatabaseConnection$1(httpClient: HttpClient): CreateExternalDatabaseConnectionSignature;
912
+ declare function createExternalDatabaseConnection$1(httpClient: HttpClient$3): CreateExternalDatabaseConnectionSignature;
845
913
  interface CreateExternalDatabaseConnectionSignature {
846
914
  /**
847
915
  * Creates a new external database connection.
@@ -854,7 +922,7 @@ interface CreateExternalDatabaseConnectionSignature {
854
922
  */
855
923
  (externalDatabaseConnection: ExternalDatabaseConnection, options: CreateExternalDatabaseConnectionOptions): Promise<ExternalDatabaseConnection & ExternalDatabaseConnectionNonNullableFields>;
856
924
  }
857
- declare function updateExternalDatabaseConnection$1(httpClient: HttpClient): UpdateExternalDatabaseConnectionSignature;
925
+ declare function updateExternalDatabaseConnection$1(httpClient: HttpClient$3): UpdateExternalDatabaseConnectionSignature;
858
926
  interface UpdateExternalDatabaseConnectionSignature {
859
927
  /**
860
928
  * Updates an external database connection.
@@ -873,7 +941,7 @@ interface UpdateExternalDatabaseConnectionSignature {
873
941
  */
874
942
  (name: string, externalDatabaseConnection: UpdateExternalDatabaseConnection): Promise<ExternalDatabaseConnection & ExternalDatabaseConnectionNonNullableFields>;
875
943
  }
876
- declare function deleteExternalDatabaseConnection$1(httpClient: HttpClient): DeleteExternalDatabaseConnectionSignature;
944
+ declare function deleteExternalDatabaseConnection$1(httpClient: HttpClient$3): DeleteExternalDatabaseConnectionSignature;
877
945
  interface DeleteExternalDatabaseConnectionSignature {
878
946
  /**
879
947
  * Deletes an external database connection.
@@ -887,31 +955,13 @@ declare const onExternalDatabaseConnectionCreated$1: EventDefinition$3<ExternalD
887
955
  declare const onExternalDatabaseConnectionUpdated$1: EventDefinition$3<ExternalDatabaseConnectionUpdatedEnvelope, "wix.data.v1.external_database_connection_updated">;
888
956
  declare const onExternalDatabaseConnectionDeleted$1: EventDefinition$3<ExternalDatabaseConnectionDeletedEnvelope, "wix.data.v1.external_database_connection_deleted">;
889
957
 
890
- type EventDefinition$2<Payload = unknown, Type extends string = string> = {
891
- __type: 'event-definition';
892
- type: Type;
893
- isDomainEvent?: boolean;
894
- transformations?: (envelope: unknown) => Payload;
895
- __payload: Payload;
896
- };
897
- declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
898
- type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
899
- type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
900
-
901
- declare global {
902
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
903
- interface SymbolConstructor {
904
- readonly observable: symbol;
905
- }
906
- }
907
-
908
- declare function createEventModule$2<T extends EventDefinition$2<any, string>>(eventDefinition: T): BuildEventDefinition$2<T> & T;
958
+ declare function createEventModule$2<T extends EventDefinition$3<any, string>>(eventDefinition: T): BuildEventDefinition$3<T> & T;
909
959
 
910
- declare const getExternalDatabaseConnection: MaybeContext<BuildRESTFunction<typeof getExternalDatabaseConnection$1> & typeof getExternalDatabaseConnection$1>;
911
- declare const listExternalDatabaseConnections: MaybeContext<BuildRESTFunction<typeof listExternalDatabaseConnections$1> & typeof listExternalDatabaseConnections$1>;
912
- declare const createExternalDatabaseConnection: MaybeContext<BuildRESTFunction<typeof createExternalDatabaseConnection$1> & typeof createExternalDatabaseConnection$1>;
913
- declare const updateExternalDatabaseConnection: MaybeContext<BuildRESTFunction<typeof updateExternalDatabaseConnection$1> & typeof updateExternalDatabaseConnection$1>;
914
- declare const deleteExternalDatabaseConnection: MaybeContext<BuildRESTFunction<typeof deleteExternalDatabaseConnection$1> & typeof deleteExternalDatabaseConnection$1>;
960
+ declare const getExternalDatabaseConnection: MaybeContext$3<BuildRESTFunction$3<typeof getExternalDatabaseConnection$1> & typeof getExternalDatabaseConnection$1>;
961
+ declare const listExternalDatabaseConnections: MaybeContext$3<BuildRESTFunction$3<typeof listExternalDatabaseConnections$1> & typeof listExternalDatabaseConnections$1>;
962
+ declare const createExternalDatabaseConnection: MaybeContext$3<BuildRESTFunction$3<typeof createExternalDatabaseConnection$1> & typeof createExternalDatabaseConnection$1>;
963
+ declare const updateExternalDatabaseConnection: MaybeContext$3<BuildRESTFunction$3<typeof updateExternalDatabaseConnection$1> & typeof updateExternalDatabaseConnection$1>;
964
+ declare const deleteExternalDatabaseConnection: MaybeContext$3<BuildRESTFunction$3<typeof deleteExternalDatabaseConnection$1> & typeof deleteExternalDatabaseConnection$1>;
915
965
 
916
966
  type _publicOnExternalDatabaseConnectionCreatedType = typeof onExternalDatabaseConnectionCreated$1;
917
967
  /**
@@ -980,129 +1030,607 @@ declare namespace index_d$3 {
980
1030
  export { type ActionEvent$2 as ActionEvent, type BaseEventMetadata$2 as BaseEventMetadata, type index_d$3_Capabilities as Capabilities, index_d$3_CauseOfFailure as CauseOfFailure, index_d$3_CollectionsFound as CollectionsFound, type index_d$3_ConnectionStatus as ConnectionStatus, index_d$3_ConnectionType as ConnectionType, type index_d$3_CreateExternalDatabaseConnectionOptions as CreateExternalDatabaseConnectionOptions, type index_d$3_CreateExternalDatabaseConnectionRequest as CreateExternalDatabaseConnectionRequest, type index_d$3_CreateExternalDatabaseConnectionResponse as CreateExternalDatabaseConnectionResponse, type index_d$3_CreateExternalDatabaseConnectionResponseNonNullableFields as CreateExternalDatabaseConnectionResponseNonNullableFields, type index_d$3_DeleteExternalDatabaseConnectionRequest as DeleteExternalDatabaseConnectionRequest, type index_d$3_DeleteExternalDatabaseConnectionResponse as DeleteExternalDatabaseConnectionResponse, type DomainEvent$2 as DomainEvent, type DomainEventBodyOneOf$2 as DomainEventBodyOneOf, type EntityCreatedEvent$2 as EntityCreatedEvent, type EntityDeletedEvent$2 as EntityDeletedEvent, type EntityUpdatedEvent$2 as EntityUpdatedEvent, type EventMetadata$2 as EventMetadata, type index_d$3_ExternalDatabaseConnection as ExternalDatabaseConnection, type index_d$3_ExternalDatabaseConnectionCreatedEnvelope as ExternalDatabaseConnectionCreatedEnvelope, type index_d$3_ExternalDatabaseConnectionDeletedEnvelope as ExternalDatabaseConnectionDeletedEnvelope, type index_d$3_ExternalDatabaseConnectionNonNullableFields as ExternalDatabaseConnectionNonNullableFields, type index_d$3_ExternalDatabaseConnectionUpdatedEnvelope as ExternalDatabaseConnectionUpdatedEnvelope, index_d$3_FieldType as FieldType, type index_d$3_GetExternalDatabaseConnectionRequest as GetExternalDatabaseConnectionRequest, type index_d$3_GetExternalDatabaseConnectionResponse as GetExternalDatabaseConnectionResponse, type index_d$3_GetExternalDatabaseConnectionResponseNonNullableFields as GetExternalDatabaseConnectionResponseNonNullableFields, type IdentificationData$2 as IdentificationData, type IdentificationDataIdOneOf$2 as IdentificationDataIdOneOf, type index_d$3_ListExternalDatabaseConnectionsOptions as ListExternalDatabaseConnectionsOptions, type index_d$3_ListExternalDatabaseConnectionsRequest as ListExternalDatabaseConnectionsRequest, type index_d$3_ListExternalDatabaseConnectionsResponse as ListExternalDatabaseConnectionsResponse, type index_d$3_ListExternalDatabaseConnectionsResponseNonNullableFields as ListExternalDatabaseConnectionsResponseNonNullableFields, type MessageEnvelope$2 as MessageEnvelope, type Paging$3 as Paging, type PagingMetadata$1 as PagingMetadata, index_d$3_ProtocolVersion as ProtocolVersion, type RestoreInfo$2 as RestoreInfo, type index_d$3_UpdateExternalDatabaseConnection as UpdateExternalDatabaseConnection, type index_d$3_UpdateExternalDatabaseConnectionRequest as UpdateExternalDatabaseConnectionRequest, type index_d$3_UpdateExternalDatabaseConnectionResponse as UpdateExternalDatabaseConnectionResponse, type index_d$3_UpdateExternalDatabaseConnectionResponseNonNullableFields as UpdateExternalDatabaseConnectionResponseNonNullableFields, WebhookIdentityType$2 as WebhookIdentityType, type index_d$3__publicOnExternalDatabaseConnectionCreatedType as _publicOnExternalDatabaseConnectionCreatedType, type index_d$3__publicOnExternalDatabaseConnectionDeletedType as _publicOnExternalDatabaseConnectionDeletedType, type index_d$3__publicOnExternalDatabaseConnectionUpdatedType as _publicOnExternalDatabaseConnectionUpdatedType, index_d$3_createExternalDatabaseConnection as createExternalDatabaseConnection, index_d$3_deleteExternalDatabaseConnection as deleteExternalDatabaseConnection, index_d$3_getExternalDatabaseConnection as getExternalDatabaseConnection, index_d$3_listExternalDatabaseConnections as listExternalDatabaseConnections, index_d$3_onExternalDatabaseConnectionCreated as onExternalDatabaseConnectionCreated, index_d$3_onExternalDatabaseConnectionDeleted as onExternalDatabaseConnectionDeleted, index_d$3_onExternalDatabaseConnectionUpdated as onExternalDatabaseConnectionUpdated, onExternalDatabaseConnectionCreated$1 as publicOnExternalDatabaseConnectionCreated, onExternalDatabaseConnectionDeleted$1 as publicOnExternalDatabaseConnectionDeleted, onExternalDatabaseConnectionUpdated$1 as publicOnExternalDatabaseConnectionUpdated, index_d$3_updateExternalDatabaseConnection as updateExternalDatabaseConnection };
981
1031
  }
982
1032
 
983
- /** A data collection determines the structure of data to be stored in a database. */
984
- interface DataCollection {
985
- /** Collection ID. For example, `my-first-collection`. May include a namespace. */
986
- _id?: string;
987
- /**
988
- * Collection type. Indicates how the collection was created and is stored.
989
- *
990
- * * `NATIVE`: User-created collection.
991
- * * `WIX_APP`: [Collection](https://support.wix.com/en/article/velo-working-with-wix-app-collections-and-code#what-are-wix-app-collections) created by a Wix app, including [starter collections](https://support.wix.com/en/article/velo-working-with-wix-app-collections-and-code#what-are-wix-app-starter-collections) created when a Wix app is installed.
992
- * * `BLOCKS_APP`: Collection created by a Wix Blocks app.
993
- * * `EXTERNAL`: Collection located in externally connected storage.
994
- * @readonly
995
- */
996
- collectionType?: CollectionType;
997
- /**
998
- * ID of the app that defined this collection. For user-defined collections, this value is null.
999
- * @readonly
1000
- */
1001
- ownerAppId?: string | null;
1002
- /**
1003
- * Maximum number of items returned in a single query, based on the underlying storage.
1004
- * Native collections have a maximum page size of 1000 for offset-based queries or 100 for cursor-based queries.
1005
- * External collections' maximum page size defaults to 50, but an external provider can set any maximum value up to 1000.
1006
- * @readonly
1007
- */
1008
- maxPageSize?: number | null;
1009
- /** Collection's display name as shown in the CMS. For example, `My First Collection`. */
1010
- displayName?: string | null;
1011
- /**
1012
- * Indicates how the collection's items are sorted by default when a query doesn't specify an order.
1013
- * @readonly
1014
- */
1015
- defaultDisplayOrder?: Sort;
1016
- /**
1017
- * UI-friendly namespace of the Wix app with which the data collection is associated, such as Stores or Bookings.
1018
- * Empty for all data collections not owned by internal Wix apps.
1019
- * @readonly
1020
- */
1021
- displayNamespace?: string | null;
1022
- /** The field whose value the CMS displays to represent the collection item when referenced in a different collection. */
1023
- displayField?: string | null;
1024
- /**
1025
- * Capabilities the collection supports.
1026
- * @readonly
1027
- */
1028
- capabilities?: CollectionCapabilities;
1029
- /** Collection's field structure. */
1030
- fields?: Field$1[];
1031
- /** Levels of permission for accessing and modifying data, defined by lowest role needed to perform each action. */
1032
- permissions?: Permissions;
1033
- /**
1034
- * Collection's current revision number, which increments each time the collection is updated. For an update operation to succeed, you must pass the latest revision number.
1035
- * @readonly
1036
- */
1037
- revision?: string | null;
1038
- /** All plugins the collection uses. Plugins apply additional capabilities to the collection or extend its functionality. */
1039
- plugins?: Plugin[];
1040
- /**
1041
- * All paging modes the collection supports. In native collections, offset-based paging is supported by default.
1042
- * @readonly
1043
- */
1044
- pagingModes?: PagingMode[];
1045
- /**
1046
- * Date the collection was created.
1047
- * @readonly
1048
- */
1049
- _createdDate?: Date;
1033
+ type HostModule$2<T, H extends Host$2> = {
1034
+ __type: 'host';
1035
+ create(host: H): T;
1036
+ };
1037
+ type HostModuleAPI$2<T extends HostModule$2<any, any>> = T extends HostModule$2<infer U, any> ? U : never;
1038
+ type Host$2<Environment = unknown> = {
1039
+ channel: {
1040
+ observeState(callback: (props: unknown, environment: Environment) => unknown): {
1041
+ disconnect: () => void;
1042
+ } | Promise<{
1043
+ disconnect: () => void;
1044
+ }>;
1045
+ };
1046
+ environment?: Environment;
1050
1047
  /**
1051
- * Date the collection was last updated.
1052
- * @readonly
1048
+ * Optional name of the environment, use for logging
1053
1049
  */
1054
- _updatedDate?: Date;
1055
- }
1056
- declare enum CollectionType {
1057
- /** User-created collection. */
1058
- NATIVE = "NATIVE",
1059
- /** [Collection](https://support.wix.com/en/article/velo-working-with-wix-app-collections-and-code#what-are-wix-app-collections) created by a Wix app when it is installed. This type of collection can be modified dynamically by that app (for example, Wix Forms). */
1060
- WIX_APP = "WIX_APP",
1061
- /** Collection created by a Wix Blocks app. */
1062
- BLOCKS_APP = "BLOCKS_APP",
1063
- /** Collection located in externally connected storage. */
1064
- EXTERNAL = "EXTERNAL"
1065
- }
1066
- interface Sort {
1067
- /** Field to sort by. */
1068
- fieldKey?: string;
1050
+ name?: string;
1069
1051
  /**
1070
- * Sort order. Use `ASC` for ascending order or `DESC` for descending order.
1071
- *
1072
- * Default: `ASC`
1052
+ * Optional bast url to use for API requests, for example `www.wixapis.com`
1073
1053
  */
1074
- direction?: Direction;
1075
- }
1076
- declare enum Direction {
1077
- ASC = "ASC",
1078
- DESC = "DESC"
1079
- }
1080
- interface CollectionCapabilities {
1081
- /** Data operations the collection supports. The listed operations can be performed on data the collection contains. */
1082
- dataOperations?: DataOperation[];
1054
+ apiBaseUrl?: string;
1083
1055
  /**
1084
- * Collection operations supported. The listed operations can be performed on the collection itself.
1085
- * + `UPDATE`: Allows updating the collection's structure, for example adding, updating, or deleting fields. If not included, the collection's structure can't be changed.
1086
- * + `REMOVE`: Allows deleting the entire collection. If not included, the collection can't be deleted.
1056
+ * Possible data to be provided by every host, for cross cutting concerns
1057
+ * like internationalization, billing, etc.
1087
1058
  */
1088
- collectionOperations?: CollectionOperation[];
1089
- /** Maximum number of indexes for the collection. */
1090
- indexLimits?: IndexLimits;
1059
+ essentials?: {
1060
+ /**
1061
+ * The language of the currently viewed session
1062
+ */
1063
+ language?: string;
1064
+ /**
1065
+ * The locale of the currently viewed session
1066
+ */
1067
+ locale?: string;
1068
+ /**
1069
+ * Any headers that should be passed through to the API requests
1070
+ */
1071
+ passThroughHeaders?: Record<string, string>;
1072
+ };
1073
+ };
1074
+
1075
+ type RESTFunctionDescriptor$2<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$2) => T;
1076
+ interface HttpClient$2 {
1077
+ request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
1078
+ fetchWithAuth: typeof fetch;
1079
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
1080
+ getActiveToken?: () => string | undefined;
1091
1081
  }
1092
- declare enum DataOperation {
1093
- AGGREGATE = "AGGREGATE",
1094
- BULK_INSERT = "BULK_INSERT",
1095
- BULK_REMOVE = "BULK_REMOVE",
1096
- BULK_SAVE = "BULK_SAVE",
1097
- BULK_UPDATE = "BULK_UPDATE",
1098
- COUNT = "COUNT",
1099
- DISTINCT = "DISTINCT",
1100
- FIND = "FIND",
1101
- GET = "GET",
1102
- INSERT = "INSERT",
1103
- INSERT_REFERENCE = "INSERT_REFERENCE",
1104
- IS_REFERENCED = "IS_REFERENCED",
1105
- QUERY_REFERENCED = "QUERY_REFERENCED",
1082
+ type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
1083
+ type HttpResponse$2<T = any> = {
1084
+ data: T;
1085
+ status: number;
1086
+ statusText: string;
1087
+ headers: any;
1088
+ request?: any;
1089
+ };
1090
+ type RequestOptions$2<_TResponse = any, Data = any> = {
1091
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
1092
+ url: string;
1093
+ data?: Data;
1094
+ params?: URLSearchParams;
1095
+ } & APIMetadata$2;
1096
+ type APIMetadata$2 = {
1097
+ methodFqn?: string;
1098
+ entityFqdn?: string;
1099
+ packageName?: string;
1100
+ };
1101
+ type BuildRESTFunction$2<T extends RESTFunctionDescriptor$2> = T extends RESTFunctionDescriptor$2<infer U> ? U : never;
1102
+ type EventDefinition$2<Payload = unknown, Type extends string = string> = {
1103
+ __type: 'event-definition';
1104
+ type: Type;
1105
+ isDomainEvent?: boolean;
1106
+ transformations?: (envelope: unknown) => Payload;
1107
+ __payload: Payload;
1108
+ };
1109
+ declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
1110
+ type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
1111
+ type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
1112
+
1113
+ type ServicePluginMethodInput$2 = {
1114
+ request: any;
1115
+ metadata: any;
1116
+ };
1117
+ type ServicePluginContract$2 = Record<string, (payload: ServicePluginMethodInput$2) => unknown | Promise<unknown>>;
1118
+ type ServicePluginMethodMetadata$2 = {
1119
+ name: string;
1120
+ primaryHttpMappingPath: string;
1121
+ transformations: {
1122
+ fromREST: (...args: unknown[]) => ServicePluginMethodInput$2;
1123
+ toREST: (...args: unknown[]) => unknown;
1124
+ };
1125
+ };
1126
+ type ServicePluginDefinition$2<Contract extends ServicePluginContract$2> = {
1127
+ __type: 'service-plugin-definition';
1128
+ componentType: string;
1129
+ methods: ServicePluginMethodMetadata$2[];
1130
+ __contract: Contract;
1131
+ };
1132
+ declare function ServicePluginDefinition$2<Contract extends ServicePluginContract$2>(componentType: string, methods: ServicePluginMethodMetadata$2[]): ServicePluginDefinition$2<Contract>;
1133
+ type BuildServicePluginDefinition$2<T extends ServicePluginDefinition$2<any>> = (implementation: T['__contract']) => void;
1134
+ declare const SERVICE_PLUGIN_ERROR_TYPE$2 = "wix_spi_error";
1135
+
1136
+ type RequestContext$2 = {
1137
+ isSSR: boolean;
1138
+ host: string;
1139
+ protocol?: string;
1140
+ };
1141
+ type ResponseTransformer$2 = (data: any, headers?: any) => any;
1142
+ /**
1143
+ * Ambassador request options types are copied mostly from AxiosRequestConfig.
1144
+ * They are copied and not imported to reduce the amount of dependencies (to reduce install time).
1145
+ * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
1146
+ */
1147
+ type Method$2 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
1148
+ type AmbassadorRequestOptions$2<T = any> = {
1149
+ _?: T;
1150
+ url?: string;
1151
+ method?: Method$2;
1152
+ params?: any;
1153
+ data?: any;
1154
+ transformResponse?: ResponseTransformer$2 | ResponseTransformer$2[];
1155
+ };
1156
+ type AmbassadorFactory$2<Request, Response> = (payload: Request) => ((context: RequestContext$2) => AmbassadorRequestOptions$2<Response>) & {
1157
+ __isAmbassador: boolean;
1158
+ };
1159
+ type AmbassadorFunctionDescriptor$2<Request = any, Response = any> = AmbassadorFactory$2<Request, Response>;
1160
+ type BuildAmbassadorFunction$2<T extends AmbassadorFunctionDescriptor$2> = T extends AmbassadorFunctionDescriptor$2<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
1161
+
1162
+ declare global {
1163
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
1164
+ interface SymbolConstructor {
1165
+ readonly observable: symbol;
1166
+ }
1167
+ }
1168
+
1169
+ declare const emptyObjectSymbol$2: unique symbol;
1170
+
1171
+ /**
1172
+ Represents a strictly empty plain object, the `{}` value.
1173
+
1174
+ 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)).
1175
+
1176
+ @example
1177
+ ```
1178
+ import type {EmptyObject} from 'type-fest';
1179
+
1180
+ // The following illustrates the problem with `{}`.
1181
+ const foo1: {} = {}; // Pass
1182
+ const foo2: {} = []; // Pass
1183
+ const foo3: {} = 42; // Pass
1184
+ const foo4: {} = {a: 1}; // Pass
1185
+
1186
+ // With `EmptyObject` only the first case is valid.
1187
+ const bar1: EmptyObject = {}; // Pass
1188
+ const bar2: EmptyObject = 42; // Fail
1189
+ const bar3: EmptyObject = []; // Fail
1190
+ const bar4: EmptyObject = {a: 1}; // Fail
1191
+ ```
1192
+
1193
+ 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}.
1194
+
1195
+ @category Object
1196
+ */
1197
+ type EmptyObject$2 = {[emptyObjectSymbol$2]?: never};
1198
+
1199
+ /**
1200
+ Returns a boolean for whether the two given types are equal.
1201
+
1202
+ @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
1203
+ @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
1204
+
1205
+ Use-cases:
1206
+ - If you want to make a conditional branch based on the result of a comparison of two types.
1207
+
1208
+ @example
1209
+ ```
1210
+ import type {IsEqual} from 'type-fest';
1211
+
1212
+ // This type returns a boolean for whether the given array includes the given item.
1213
+ // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
1214
+ type Includes<Value extends readonly any[], Item> =
1215
+ Value extends readonly [Value[0], ...infer rest]
1216
+ ? IsEqual<Value[0], Item> extends true
1217
+ ? true
1218
+ : Includes<rest, Item>
1219
+ : false;
1220
+ ```
1221
+
1222
+ @category Type Guard
1223
+ @category Utilities
1224
+ */
1225
+ type IsEqual$2<A, B> =
1226
+ (<G>() => G extends A ? 1 : 2) extends
1227
+ (<G>() => G extends B ? 1 : 2)
1228
+ ? true
1229
+ : false;
1230
+
1231
+ /**
1232
+ Filter out keys from an object.
1233
+
1234
+ Returns `never` if `Exclude` is strictly equal to `Key`.
1235
+ Returns `never` if `Key` extends `Exclude`.
1236
+ Returns `Key` otherwise.
1237
+
1238
+ @example
1239
+ ```
1240
+ type Filtered = Filter<'foo', 'foo'>;
1241
+ //=> never
1242
+ ```
1243
+
1244
+ @example
1245
+ ```
1246
+ type Filtered = Filter<'bar', string>;
1247
+ //=> never
1248
+ ```
1249
+
1250
+ @example
1251
+ ```
1252
+ type Filtered = Filter<'bar', 'foo'>;
1253
+ //=> 'bar'
1254
+ ```
1255
+
1256
+ @see {Except}
1257
+ */
1258
+ type Filter$2<KeyType, ExcludeType> = IsEqual$2<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
1259
+
1260
+ type ExceptOptions$2 = {
1261
+ /**
1262
+ Disallow assigning non-specified properties.
1263
+
1264
+ Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
1265
+
1266
+ @default false
1267
+ */
1268
+ requireExactProps?: boolean;
1269
+ };
1270
+
1271
+ /**
1272
+ Create a type from an object type without certain keys.
1273
+
1274
+ We recommend setting the `requireExactProps` option to `true`.
1275
+
1276
+ 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.
1277
+
1278
+ 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)).
1279
+
1280
+ @example
1281
+ ```
1282
+ import type {Except} from 'type-fest';
1283
+
1284
+ type Foo = {
1285
+ a: number;
1286
+ b: string;
1287
+ };
1288
+
1289
+ type FooWithoutA = Except<Foo, 'a'>;
1290
+ //=> {b: string}
1291
+
1292
+ const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
1293
+ //=> errors: 'a' does not exist in type '{ b: string; }'
1294
+
1295
+ type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
1296
+ //=> {a: number} & Partial<Record<"b", never>>
1297
+
1298
+ const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
1299
+ //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
1300
+ ```
1301
+
1302
+ @category Object
1303
+ */
1304
+ type Except$2<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$2 = {requireExactProps: false}> = {
1305
+ [KeyType in keyof ObjectType as Filter$2<KeyType, KeysType>]: ObjectType[KeyType];
1306
+ } & (Options['requireExactProps'] extends true
1307
+ ? Partial<Record<KeysType, never>>
1308
+ : {});
1309
+
1310
+ /**
1311
+ Returns a boolean for whether the given type is `never`.
1312
+
1313
+ @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
1314
+ @link https://stackoverflow.com/a/53984913/10292952
1315
+ @link https://www.zhenghao.io/posts/ts-never
1316
+
1317
+ Useful in type utilities, such as checking if something does not occur.
1318
+
1319
+ @example
1320
+ ```
1321
+ import type {IsNever, And} from 'type-fest';
1322
+
1323
+ // https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
1324
+ type AreStringsEqual<A extends string, B extends string> =
1325
+ And<
1326
+ IsNever<Exclude<A, B>> extends true ? true : false,
1327
+ IsNever<Exclude<B, A>> extends true ? true : false
1328
+ >;
1329
+
1330
+ type EndIfEqual<I extends string, O extends string> =
1331
+ AreStringsEqual<I, O> extends true
1332
+ ? never
1333
+ : void;
1334
+
1335
+ function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
1336
+ if (input === output) {
1337
+ process.exit(0);
1338
+ }
1339
+ }
1340
+
1341
+ endIfEqual('abc', 'abc');
1342
+ //=> never
1343
+
1344
+ endIfEqual('abc', '123');
1345
+ //=> void
1346
+ ```
1347
+
1348
+ @category Type Guard
1349
+ @category Utilities
1350
+ */
1351
+ type IsNever$2<T> = [T] extends [never] ? true : false;
1352
+
1353
+ /**
1354
+ An if-else-like type that resolves depending on whether the given type is `never`.
1355
+
1356
+ @see {@link IsNever}
1357
+
1358
+ @example
1359
+ ```
1360
+ import type {IfNever} from 'type-fest';
1361
+
1362
+ type ShouldBeTrue = IfNever<never>;
1363
+ //=> true
1364
+
1365
+ type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
1366
+ //=> 'bar'
1367
+ ```
1368
+
1369
+ @category Type Guard
1370
+ @category Utilities
1371
+ */
1372
+ type IfNever$2<T, TypeIfNever = true, TypeIfNotNever = false> = (
1373
+ IsNever$2<T> extends true ? TypeIfNever : TypeIfNotNever
1374
+ );
1375
+
1376
+ /**
1377
+ Extract the keys from a type where the value type of the key extends the given `Condition`.
1378
+
1379
+ Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
1380
+
1381
+ @example
1382
+ ```
1383
+ import type {ConditionalKeys} from 'type-fest';
1384
+
1385
+ interface Example {
1386
+ a: string;
1387
+ b: string | number;
1388
+ c?: string;
1389
+ d: {};
1390
+ }
1391
+
1392
+ type StringKeysOnly = ConditionalKeys<Example, string>;
1393
+ //=> 'a'
1394
+ ```
1395
+
1396
+ To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
1397
+
1398
+ @example
1399
+ ```
1400
+ import type {ConditionalKeys} from 'type-fest';
1401
+
1402
+ type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
1403
+ //=> 'a' | 'c'
1404
+ ```
1405
+
1406
+ @category Object
1407
+ */
1408
+ type ConditionalKeys$2<Base, Condition> =
1409
+ {
1410
+ // Map through all the keys of the given base type.
1411
+ [Key in keyof Base]-?:
1412
+ // Pick only keys with types extending the given `Condition` type.
1413
+ Base[Key] extends Condition
1414
+ // Retain this key
1415
+ // If the value for the key extends never, only include it if `Condition` also extends never
1416
+ ? IfNever$2<Base[Key], IfNever$2<Condition, Key, never>, Key>
1417
+ // Discard this key since the condition fails.
1418
+ : never;
1419
+ // Convert the produced object into a union type of the keys which passed the conditional test.
1420
+ }[keyof Base];
1421
+
1422
+ /**
1423
+ Exclude keys from a shape that matches the given `Condition`.
1424
+
1425
+ 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.
1426
+
1427
+ @example
1428
+ ```
1429
+ import type {Primitive, ConditionalExcept} from 'type-fest';
1430
+
1431
+ class Awesome {
1432
+ name: string;
1433
+ successes: number;
1434
+ failures: bigint;
1435
+
1436
+ run() {}
1437
+ }
1438
+
1439
+ type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
1440
+ //=> {run: () => void}
1441
+ ```
1442
+
1443
+ @example
1444
+ ```
1445
+ import type {ConditionalExcept} from 'type-fest';
1446
+
1447
+ interface Example {
1448
+ a: string;
1449
+ b: string | number;
1450
+ c: () => void;
1451
+ d: {};
1452
+ }
1453
+
1454
+ type NonStringKeysOnly = ConditionalExcept<Example, string>;
1455
+ //=> {b: string | number; c: () => void; d: {}}
1456
+ ```
1457
+
1458
+ @category Object
1459
+ */
1460
+ type ConditionalExcept$2<Base, Condition> = Except$2<
1461
+ Base,
1462
+ ConditionalKeys$2<Base, Condition>
1463
+ >;
1464
+
1465
+ /**
1466
+ * Descriptors are objects that describe the API of a module, and the module
1467
+ * can either be a REST module or a host module.
1468
+ * This type is recursive, so it can describe nested modules.
1469
+ */
1470
+ type Descriptors$2 = RESTFunctionDescriptor$2 | AmbassadorFunctionDescriptor$2 | HostModule$2<any, any> | EventDefinition$2<any> | ServicePluginDefinition$2<any> | {
1471
+ [key: string]: Descriptors$2 | PublicMetadata$2 | any;
1472
+ };
1473
+ /**
1474
+ * This type takes in a descriptors object of a certain Host (including an `unknown` host)
1475
+ * and returns an object with the same structure, but with all descriptors replaced with their API.
1476
+ * Any non-descriptor properties are removed from the returned object, including descriptors that
1477
+ * do not match the given host (as they will not work with the given host).
1478
+ */
1479
+ type BuildDescriptors$2<T extends Descriptors$2, H extends Host$2<any> | undefined, Depth extends number = 5> = {
1480
+ done: T;
1481
+ recurse: T extends {
1482
+ __type: typeof SERVICE_PLUGIN_ERROR_TYPE$2;
1483
+ } ? 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<{
1484
+ [Key in keyof T]: T[Key] extends Descriptors$2 ? BuildDescriptors$2<T[Key], H, [
1485
+ -1,
1486
+ 0,
1487
+ 1,
1488
+ 2,
1489
+ 3,
1490
+ 4,
1491
+ 5
1492
+ ][Depth]> : never;
1493
+ }, EmptyObject$2>;
1494
+ }[Depth extends -1 ? 'done' : 'recurse'];
1495
+ type PublicMetadata$2 = {
1496
+ PACKAGE_NAME?: string;
1497
+ };
1498
+
1499
+ declare global {
1500
+ interface ContextualClient {
1501
+ }
1502
+ }
1503
+ /**
1504
+ * A type used to create concerete types from SDK descriptors in
1505
+ * case a contextual client is available.
1506
+ */
1507
+ type MaybeContext$2<T extends Descriptors$2> = globalThis.ContextualClient extends {
1508
+ host: Host$2;
1509
+ } ? BuildDescriptors$2<T, globalThis.ContextualClient['host']> : T;
1510
+
1511
+ /** A data collection determines the structure of data to be stored in a database. */
1512
+ interface DataCollection {
1513
+ /** Collection ID. For example, `my-first-collection`. May include a namespace. */
1514
+ _id?: string;
1515
+ /**
1516
+ * Collection type. Indicates how the collection was created and is stored.
1517
+ *
1518
+ * * `NATIVE`: User-created collection.
1519
+ * * `WIX_APP`: [Collection](https://support.wix.com/en/article/velo-working-with-wix-app-collections-and-code#what-are-wix-app-collections) created by a Wix app, including [starter collections](https://support.wix.com/en/article/velo-working-with-wix-app-collections-and-code#what-are-wix-app-starter-collections) created when a Wix app is installed.
1520
+ * * `BLOCKS_APP`: Collection created by a Wix Blocks app.
1521
+ * * `EXTERNAL`: Collection located in externally connected storage.
1522
+ * @readonly
1523
+ */
1524
+ collectionType?: CollectionType;
1525
+ /**
1526
+ * ID of the app that defined this collection. For user-defined collections, this value is null.
1527
+ * @readonly
1528
+ */
1529
+ ownerAppId?: string | null;
1530
+ /**
1531
+ * Maximum number of items returned in a single query, based on the underlying storage.
1532
+ * Native collections have a maximum page size of 1000 for offset-based queries or 100 for cursor-based queries.
1533
+ * External collections' maximum page size defaults to 50, but an external provider can set any maximum value up to 1000.
1534
+ * @readonly
1535
+ */
1536
+ maxPageSize?: number | null;
1537
+ /** Collection's display name as shown in the CMS. For example, `My First Collection`. */
1538
+ displayName?: string | null;
1539
+ /**
1540
+ * Indicates how the collection's items are sorted by default when a query doesn't specify an order.
1541
+ * @readonly
1542
+ */
1543
+ defaultDisplayOrder?: Sort;
1544
+ /**
1545
+ * UI-friendly namespace of the Wix app with which the data collection is associated, such as Stores or Bookings.
1546
+ * Empty for all data collections not owned by internal Wix apps.
1547
+ * @readonly
1548
+ */
1549
+ displayNamespace?: string | null;
1550
+ /** The field whose value the CMS displays to represent the collection item when referenced in a different collection. */
1551
+ displayField?: string | null;
1552
+ /**
1553
+ * Capabilities the collection supports.
1554
+ * @readonly
1555
+ */
1556
+ capabilities?: CollectionCapabilities;
1557
+ /** Collection's field structure. */
1558
+ fields?: Field$1[];
1559
+ /** Levels of permission for accessing and modifying data, defined by lowest role needed to perform each action. */
1560
+ permissions?: Permissions;
1561
+ /**
1562
+ * Collection's current revision number, which increments each time the collection is updated. For an update operation to succeed, you must pass the latest revision number.
1563
+ * @readonly
1564
+ */
1565
+ revision?: string | null;
1566
+ /** All plugins the collection uses. Plugins apply additional capabilities to the collection or extend its functionality. */
1567
+ plugins?: Plugin[];
1568
+ /**
1569
+ * All paging modes the collection supports. In native collections, offset-based paging is supported by default.
1570
+ * @readonly
1571
+ */
1572
+ pagingModes?: PagingMode[];
1573
+ /**
1574
+ * Date the collection was created.
1575
+ * @readonly
1576
+ */
1577
+ _createdDate?: Date;
1578
+ /**
1579
+ * Date the collection was last updated.
1580
+ * @readonly
1581
+ */
1582
+ _updatedDate?: Date;
1583
+ }
1584
+ declare enum CollectionType {
1585
+ /** User-created collection. */
1586
+ NATIVE = "NATIVE",
1587
+ /** [Collection](https://support.wix.com/en/article/velo-working-with-wix-app-collections-and-code#what-are-wix-app-collections) created by a Wix app when it is installed. This type of collection can be modified dynamically by that app (for example, Wix Forms). */
1588
+ WIX_APP = "WIX_APP",
1589
+ /** Collection created by a Wix Blocks app. */
1590
+ BLOCKS_APP = "BLOCKS_APP",
1591
+ /** Collection located in externally connected storage. */
1592
+ EXTERNAL = "EXTERNAL"
1593
+ }
1594
+ interface Sort {
1595
+ /** Field to sort by. */
1596
+ fieldKey?: string;
1597
+ /**
1598
+ * Sort order. Use `ASC` for ascending order or `DESC` for descending order.
1599
+ *
1600
+ * Default: `ASC`
1601
+ */
1602
+ direction?: Direction;
1603
+ }
1604
+ declare enum Direction {
1605
+ ASC = "ASC",
1606
+ DESC = "DESC"
1607
+ }
1608
+ interface CollectionCapabilities {
1609
+ /** Data operations the collection supports. The listed operations can be performed on data the collection contains. */
1610
+ dataOperations?: DataOperation[];
1611
+ /**
1612
+ * Collection operations supported. The listed operations can be performed on the collection itself.
1613
+ * + `UPDATE`: Allows updating the collection's structure, for example adding, updating, or deleting fields. If not included, the collection's structure can't be changed.
1614
+ * + `REMOVE`: Allows deleting the entire collection. If not included, the collection can't be deleted.
1615
+ */
1616
+ collectionOperations?: CollectionOperation[];
1617
+ /** Maximum number of indexes for the collection. */
1618
+ indexLimits?: IndexLimits;
1619
+ }
1620
+ declare enum DataOperation {
1621
+ AGGREGATE = "AGGREGATE",
1622
+ BULK_INSERT = "BULK_INSERT",
1623
+ BULK_REMOVE = "BULK_REMOVE",
1624
+ BULK_SAVE = "BULK_SAVE",
1625
+ BULK_UPDATE = "BULK_UPDATE",
1626
+ COUNT = "COUNT",
1627
+ DISTINCT = "DISTINCT",
1628
+ FIND = "FIND",
1629
+ GET = "GET",
1630
+ INSERT = "INSERT",
1631
+ INSERT_REFERENCE = "INSERT_REFERENCE",
1632
+ IS_REFERENCED = "IS_REFERENCED",
1633
+ QUERY_REFERENCED = "QUERY_REFERENCED",
1106
1634
  REMOVE = "REMOVE",
1107
1635
  REMOVE_REFERENCE = "REMOVE_REFERENCE",
1108
1636
  REPLACE_REFERENCES = "REPLACE_REFERENCES",
@@ -2169,374 +2697,834 @@ interface AllowedDataPermissionsNonNullableFields {
2169
2697
  itemUpdate: boolean;
2170
2698
  itemRemove: boolean;
2171
2699
  }
2172
- interface DataCollectionNonNullableFields {
2173
- _id: string;
2174
- collectionType: CollectionType;
2175
- defaultDisplayOrder?: SortNonNullableFields;
2176
- capabilities?: CollectionCapabilitiesNonNullableFields;
2177
- fields: FieldNonNullableFields$1[];
2178
- permissions?: PermissionsNonNullableFields;
2179
- plugins: PluginNonNullableFields[];
2180
- pagingModes: PagingMode[];
2181
- dataPermissions?: DataPermissionsNonNullableFields;
2182
- allowedDataPermissions?: AllowedDataPermissionsNonNullableFields;
2700
+ interface DataCollectionNonNullableFields {
2701
+ _id: string;
2702
+ collectionType: CollectionType;
2703
+ defaultDisplayOrder?: SortNonNullableFields;
2704
+ capabilities?: CollectionCapabilitiesNonNullableFields;
2705
+ fields: FieldNonNullableFields$1[];
2706
+ permissions?: PermissionsNonNullableFields;
2707
+ plugins: PluginNonNullableFields[];
2708
+ pagingModes: PagingMode[];
2709
+ dataPermissions?: DataPermissionsNonNullableFields;
2710
+ allowedDataPermissions?: AllowedDataPermissionsNonNullableFields;
2711
+ }
2712
+ interface CreateDataCollectionResponseNonNullableFields {
2713
+ collection?: DataCollectionNonNullableFields;
2714
+ }
2715
+ interface GetDataCollectionResponseNonNullableFields {
2716
+ collection?: DataCollectionNonNullableFields;
2717
+ referencedCollections: DataCollectionNonNullableFields[];
2718
+ }
2719
+ interface ListDataCollectionsResponseNonNullableFields {
2720
+ collections: DataCollectionNonNullableFields[];
2721
+ }
2722
+ interface UpdateDataCollectionResponseNonNullableFields {
2723
+ collection?: DataCollectionNonNullableFields;
2724
+ }
2725
+ interface BaseEventMetadata$1 {
2726
+ /** App instance ID. */
2727
+ instanceId?: string | null;
2728
+ /** Event type. */
2729
+ eventType?: string;
2730
+ /** The identification type and identity data. */
2731
+ identity?: IdentificationData$1;
2732
+ }
2733
+ interface EventMetadata$1 extends BaseEventMetadata$1 {
2734
+ /**
2735
+ * Unique event ID.
2736
+ * Allows clients to ignore duplicate webhooks.
2737
+ */
2738
+ _id?: string;
2739
+ /**
2740
+ * Assumes actions are also always typed to an entity_type
2741
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
2742
+ */
2743
+ entityFqdn?: string;
2744
+ /**
2745
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
2746
+ * This is although the created/updated/deleted notion is duplication of the oneof types
2747
+ * Example: created/updated/deleted/started/completed/email_opened
2748
+ */
2749
+ slug?: string;
2750
+ /** ID of the entity associated with the event. */
2751
+ entityId?: string;
2752
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
2753
+ eventTime?: Date;
2754
+ /**
2755
+ * Whether the event was triggered as a result of a privacy regulation application
2756
+ * (for example, GDPR).
2757
+ */
2758
+ triggeredByAnonymizeRequest?: boolean | null;
2759
+ /** If present, indicates the action that triggered the event. */
2760
+ originatedFrom?: string | null;
2761
+ /**
2762
+ * A sequence number defining the order of updates to the underlying entity.
2763
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
2764
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
2765
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
2766
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
2767
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
2768
+ */
2769
+ entityEventSequence?: string | null;
2770
+ }
2771
+ interface DataCollectionClonedEnvelope {
2772
+ data: DataCollectionClonedEvent;
2773
+ metadata: EventMetadata$1;
2774
+ }
2775
+ interface DataCollectionChangedEnvelope {
2776
+ data: DataCollectionChangedEvent;
2777
+ metadata: EventMetadata$1;
2778
+ }
2779
+ interface DataCollectionCreatedEnvelope {
2780
+ entity: DataCollection;
2781
+ metadata: EventMetadata$1;
2782
+ }
2783
+ interface DataCollectionUpdatedEnvelope {
2784
+ entity: DataCollection;
2785
+ metadata: EventMetadata$1;
2786
+ }
2787
+ interface DataCollectionDeletedEnvelope {
2788
+ metadata: EventMetadata$1;
2789
+ }
2790
+ interface GetDataCollectionOptions {
2791
+ /**
2792
+ * Whether to retrieve data from the primary database instance.
2793
+ * This decreases performance but ensures data retrieved is up to date even immediately after an update.
2794
+ * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
2795
+ *
2796
+ * Default: `false`
2797
+ */
2798
+ consistentRead?: boolean;
2799
+ }
2800
+ interface ListDataCollectionsOptions {
2801
+ /**
2802
+ * Defines how collections in the response are sorted.
2803
+ *
2804
+ * Default: Ordered by ID in ascending order.
2805
+ */
2806
+ sort?: Sorting$1;
2807
+ /** Pagination information. */
2808
+ paging?: Paging$2;
2809
+ /**
2810
+ * Whether to retrieve data from the primary database instance.
2811
+ * This decreases performance but ensures data retrieved is up to date even immediately after an update.
2812
+ * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
2813
+ *
2814
+ * Default: `false`
2815
+ */
2816
+ consistentRead?: boolean;
2183
2817
  }
2184
- interface CreateDataCollectionResponseNonNullableFields {
2185
- collection?: DataCollectionNonNullableFields;
2818
+
2819
+ declare function createDataCollection$1(httpClient: HttpClient$2): CreateDataCollectionSignature;
2820
+ interface CreateDataCollectionSignature {
2821
+ /**
2822
+ * Creates a new data collection.
2823
+ *
2824
+ * The request body must include an ID, details for at least 1 field, and a permissions object. If any of these are missing, the collection isn't created.
2825
+ * @param - Collection details.
2826
+ * @param - Options for creating a data collection.
2827
+ * @returns Details of collection created.
2828
+ */
2829
+ (collection: DataCollection): Promise<DataCollection & DataCollectionNonNullableFields>;
2186
2830
  }
2187
- interface GetDataCollectionResponseNonNullableFields {
2188
- collection?: DataCollectionNonNullableFields;
2189
- referencedCollections: DataCollectionNonNullableFields[];
2831
+ declare function getDataCollection$1(httpClient: HttpClient$2): GetDataCollectionSignature;
2832
+ interface GetDataCollectionSignature {
2833
+ /**
2834
+ * Retrieves a data collection by ID.
2835
+ * @param - ID of the collection to retrieve.
2836
+ * @param - Options for retrieving a data collection.
2837
+ * @returns Details of the collection requested.
2838
+ */
2839
+ (dataCollectionId: string, options?: GetDataCollectionOptions | undefined): Promise<DataCollection & DataCollectionNonNullableFields>;
2190
2840
  }
2191
- interface ListDataCollectionsResponseNonNullableFields {
2192
- collections: DataCollectionNonNullableFields[];
2841
+ declare function listDataCollections$1(httpClient: HttpClient$2): ListDataCollectionsSignature;
2842
+ interface ListDataCollectionsSignature {
2843
+ /**
2844
+ * Retrieves a list of all data collections associated with the site or project.
2845
+ *
2846
+ * By default, the list is ordered by ID in ascending order.
2847
+ * @param - Options for retrieving a list of data collections.
2848
+ */
2849
+ (options?: ListDataCollectionsOptions | undefined): Promise<ListDataCollectionsResponse & ListDataCollectionsResponseNonNullableFields>;
2193
2850
  }
2194
- interface UpdateDataCollectionResponseNonNullableFields {
2195
- collection?: DataCollectionNonNullableFields;
2851
+ declare function updateDataCollection$1(httpClient: HttpClient$2): UpdateDataCollectionSignature;
2852
+ interface UpdateDataCollectionSignature {
2853
+ /**
2854
+ * Updates a data collection.
2855
+ *
2856
+ * A collection ID, revision number, permissions, and at least 1 field must be provided within `options.collection`.
2857
+ * If a collection with that ID exists, and if its current `revision` number matches the one provided, it is updated.
2858
+ * Otherwise, the request fails.
2859
+ *
2860
+ * When a collection is updated, its `_updatedDate` property is changed to the current date and its `revision` property is incremented.
2861
+ *
2862
+ * > **Note:**
2863
+ * > After a collection is updated, it only contains the properties included in the `updateDataCollection()` call. If the existing collection has properties with values and those properties
2864
+ * > aren't included in the updated collection details, their values are lost.
2865
+ * @param - Updated collection details. The existing collection is replaced with this version.
2866
+ * @param - Options for updating a data collection.
2867
+ * @returns Updated collection details.
2868
+ */
2869
+ (collection: DataCollection): Promise<DataCollection & DataCollectionNonNullableFields>;
2196
2870
  }
2197
- interface BaseEventMetadata$1 {
2198
- /** App instance ID. */
2199
- instanceId?: string | null;
2200
- /** Event type. */
2201
- eventType?: string;
2202
- /** The identification type and identity data. */
2203
- identity?: IdentificationData$1;
2871
+ declare function deleteDataCollection$1(httpClient: HttpClient$2): DeleteDataCollectionSignature;
2872
+ interface DeleteDataCollectionSignature {
2873
+ /**
2874
+ * Deletes a data collection.
2875
+ *
2876
+ * > **Note:**
2877
+ * > Once a collection is deleted, it can't be restored.
2878
+ * @param - ID of the collection to delete.
2879
+ */
2880
+ (dataCollectionId: string): Promise<void>;
2881
+ }
2882
+ declare const onDataCollectionClonedEvent$1: EventDefinition$2<DataCollectionClonedEnvelope, "wix.data.v2.data_collection_data_collection_cloned_event">;
2883
+ declare const onDataCollectionChangedEvent$1: EventDefinition$2<DataCollectionChangedEnvelope, "wix.data.v2.data_collection_data_collection_changed_event">;
2884
+ declare const onDataCollectionCreated$1: EventDefinition$2<DataCollectionCreatedEnvelope, "wix.data.v2.data_collection_created">;
2885
+ declare const onDataCollectionUpdated$1: EventDefinition$2<DataCollectionUpdatedEnvelope, "wix.data.v2.data_collection_updated">;
2886
+ declare const onDataCollectionDeleted$1: EventDefinition$2<DataCollectionDeletedEnvelope, "wix.data.v2.data_collection_deleted">;
2887
+
2888
+ declare function createEventModule$1<T extends EventDefinition$2<any, string>>(eventDefinition: T): BuildEventDefinition$2<T> & T;
2889
+
2890
+ declare const createDataCollection: MaybeContext$2<BuildRESTFunction$2<typeof createDataCollection$1> & typeof createDataCollection$1>;
2891
+ declare const getDataCollection: MaybeContext$2<BuildRESTFunction$2<typeof getDataCollection$1> & typeof getDataCollection$1>;
2892
+ declare const listDataCollections: MaybeContext$2<BuildRESTFunction$2<typeof listDataCollections$1> & typeof listDataCollections$1>;
2893
+ declare const updateDataCollection: MaybeContext$2<BuildRESTFunction$2<typeof updateDataCollection$1> & typeof updateDataCollection$1>;
2894
+ declare const deleteDataCollection: MaybeContext$2<BuildRESTFunction$2<typeof deleteDataCollection$1> & typeof deleteDataCollection$1>;
2895
+
2896
+ type _publicOnDataCollectionClonedEventType = typeof onDataCollectionClonedEvent$1;
2897
+ /**
2898
+ * Event triggered when collection is cloned from other instance
2899
+ * CREATED event will be also triggered along with this action
2900
+ */
2901
+ declare const onDataCollectionClonedEvent: ReturnType<typeof createEventModule$1<_publicOnDataCollectionClonedEventType>>;
2902
+
2903
+ type _publicOnDataCollectionChangedEventType = typeof onDataCollectionChangedEvent$1;
2904
+ /**
2905
+ * Event triggered when collection is changed, describing some of changes
2906
+ * UPDATED event will be also triggered along with this action
2907
+ */
2908
+ declare const onDataCollectionChangedEvent: ReturnType<typeof createEventModule$1<_publicOnDataCollectionChangedEventType>>;
2909
+
2910
+ type _publicOnDataCollectionCreatedType = typeof onDataCollectionCreated$1;
2911
+ /** */
2912
+ declare const onDataCollectionCreated: ReturnType<typeof createEventModule$1<_publicOnDataCollectionCreatedType>>;
2913
+
2914
+ type _publicOnDataCollectionUpdatedType = typeof onDataCollectionUpdated$1;
2915
+ /** */
2916
+ declare const onDataCollectionUpdated: ReturnType<typeof createEventModule$1<_publicOnDataCollectionUpdatedType>>;
2917
+
2918
+ type _publicOnDataCollectionDeletedType = typeof onDataCollectionDeleted$1;
2919
+ /** */
2920
+ declare const onDataCollectionDeleted: ReturnType<typeof createEventModule$1<_publicOnDataCollectionDeletedType>>;
2921
+
2922
+ type index_d$2_AccessLevel = AccessLevel;
2923
+ declare const index_d$2_AccessLevel: typeof AccessLevel;
2924
+ type index_d$2_AllowedDataPermissions = AllowedDataPermissions;
2925
+ type index_d$2_ArraySizeRange = ArraySizeRange;
2926
+ type index_d$2_BulkGetDataCollectionsPageBySnapshotsRequest = BulkGetDataCollectionsPageBySnapshotsRequest;
2927
+ type index_d$2_BulkGetDataCollectionsPageBySnapshotsResponse = BulkGetDataCollectionsPageBySnapshotsResponse;
2928
+ type index_d$2_BulkGetDataCollectionsRequest = BulkGetDataCollectionsRequest;
2929
+ type index_d$2_BulkGetDataCollectionsResponse = BulkGetDataCollectionsResponse;
2930
+ type index_d$2_Calculator = Calculator;
2931
+ type index_d$2_CalculatorPatternOneOf = CalculatorPatternOneOf;
2932
+ type index_d$2_CmsOptions = CmsOptions;
2933
+ type index_d$2_CollectionCapabilities = CollectionCapabilities;
2934
+ type index_d$2_CollectionOperation = CollectionOperation;
2935
+ declare const index_d$2_CollectionOperation: typeof CollectionOperation;
2936
+ type index_d$2_CollectionType = CollectionType;
2937
+ declare const index_d$2_CollectionType: typeof CollectionType;
2938
+ type index_d$2_CreateDataCollectionFieldRequest = CreateDataCollectionFieldRequest;
2939
+ type index_d$2_CreateDataCollectionFieldResponse = CreateDataCollectionFieldResponse;
2940
+ type index_d$2_CreateDataCollectionRequest = CreateDataCollectionRequest;
2941
+ type index_d$2_CreateDataCollectionResponse = CreateDataCollectionResponse;
2942
+ type index_d$2_CreateDataCollectionResponseNonNullableFields = CreateDataCollectionResponseNonNullableFields;
2943
+ type index_d$2_CreateDataCollectionsSnapshotRequest = CreateDataCollectionsSnapshotRequest;
2944
+ type index_d$2_CreateDataCollectionsSnapshotResponse = CreateDataCollectionsSnapshotResponse;
2945
+ type index_d$2_CreateMigratedCollectionsSnapshotRequest = CreateMigratedCollectionsSnapshotRequest;
2946
+ type index_d$2_CreateMigratedCollectionsSnapshotResponse = CreateMigratedCollectionsSnapshotResponse;
2947
+ type index_d$2_DataCollection = DataCollection;
2948
+ type index_d$2_DataCollectionChangedEnvelope = DataCollectionChangedEnvelope;
2949
+ type index_d$2_DataCollectionChangedEvent = DataCollectionChangedEvent;
2950
+ type index_d$2_DataCollectionClonedEnvelope = DataCollectionClonedEnvelope;
2951
+ type index_d$2_DataCollectionClonedEvent = DataCollectionClonedEvent;
2952
+ type index_d$2_DataCollectionCreatedEnvelope = DataCollectionCreatedEnvelope;
2953
+ type index_d$2_DataCollectionDeletedEnvelope = DataCollectionDeletedEnvelope;
2954
+ type index_d$2_DataCollectionNonNullableFields = DataCollectionNonNullableFields;
2955
+ type index_d$2_DataCollectionUpdatedEnvelope = DataCollectionUpdatedEnvelope;
2956
+ type index_d$2_DataOperation = DataOperation;
2957
+ declare const index_d$2_DataOperation: typeof DataOperation;
2958
+ type index_d$2_DataPermissions = DataPermissions;
2959
+ type index_d$2_DeleteDataCollectionFieldRequest = DeleteDataCollectionFieldRequest;
2960
+ type index_d$2_DeleteDataCollectionFieldResponse = DeleteDataCollectionFieldResponse;
2961
+ type index_d$2_DeleteDataCollectionRequest = DeleteDataCollectionRequest;
2962
+ type index_d$2_DeleteDataCollectionResponse = DeleteDataCollectionResponse;
2963
+ type index_d$2_DeleteDataCollectionsSnapshotRequest = DeleteDataCollectionsSnapshotRequest;
2964
+ type index_d$2_DeleteDataCollectionsSnapshotResponse = DeleteDataCollectionsSnapshotResponse;
2965
+ type index_d$2_Direction = Direction;
2966
+ declare const index_d$2_Direction: typeof Direction;
2967
+ type index_d$2_FieldCapabilities = FieldCapabilities;
2968
+ type index_d$2_FieldPlugin = FieldPlugin;
2969
+ type index_d$2_FieldPluginOptionsOneOf = FieldPluginOptionsOneOf;
2970
+ type index_d$2_FieldPluginType = FieldPluginType;
2971
+ declare const index_d$2_FieldPluginType: typeof FieldPluginType;
2972
+ type index_d$2_FieldRangeValidationsOneOf = FieldRangeValidationsOneOf;
2973
+ type index_d$2_FieldsPattern = FieldsPattern;
2974
+ type index_d$2_Format = Format;
2975
+ declare const index_d$2_Format: typeof Format;
2976
+ type index_d$2_GetDataCollectionOptions = GetDataCollectionOptions;
2977
+ type index_d$2_GetDataCollectionRequest = GetDataCollectionRequest;
2978
+ type index_d$2_GetDataCollectionResponse = GetDataCollectionResponse;
2979
+ type index_d$2_GetDataCollectionResponseNonNullableFields = GetDataCollectionResponseNonNullableFields;
2980
+ type index_d$2_IndexField = IndexField;
2981
+ type index_d$2_IndexLimits = IndexLimits;
2982
+ type index_d$2_IndexStatus = IndexStatus;
2983
+ declare const index_d$2_IndexStatus: typeof IndexStatus;
2984
+ type index_d$2_ListDataCollectionsOptions = ListDataCollectionsOptions;
2985
+ type index_d$2_ListDataCollectionsRequest = ListDataCollectionsRequest;
2986
+ type index_d$2_ListDataCollectionsResponse = ListDataCollectionsResponse;
2987
+ type index_d$2_ListDataCollectionsResponseNonNullableFields = ListDataCollectionsResponseNonNullableFields;
2988
+ type index_d$2_MultiReference = MultiReference;
2989
+ type index_d$2_MultilingualOptions = MultilingualOptions;
2990
+ type index_d$2_NumberRange = NumberRange;
2991
+ type index_d$2_ObjectField = ObjectField;
2992
+ type index_d$2_PageLink = PageLink;
2993
+ type index_d$2_PageLinkPluginOptions = PageLinkPluginOptions;
2994
+ type index_d$2_PagingMode = PagingMode;
2995
+ declare const index_d$2_PagingMode: typeof PagingMode;
2996
+ type index_d$2_Permissions = Permissions;
2997
+ type index_d$2_Plugin = Plugin;
2998
+ type index_d$2_PluginCmsOptions = PluginCmsOptions;
2999
+ type index_d$2_PluginOptionsOneOf = PluginOptionsOneOf;
3000
+ type index_d$2_PluginType = PluginType;
3001
+ declare const index_d$2_PluginType: typeof PluginType;
3002
+ type index_d$2_PluginUpdate = PluginUpdate;
3003
+ type index_d$2_QueryOperator = QueryOperator;
3004
+ declare const index_d$2_QueryOperator: typeof QueryOperator;
3005
+ type index_d$2_Reference = Reference;
3006
+ type index_d$2_RestoreDataCollectionsFromSnapshotRequest = RestoreDataCollectionsFromSnapshotRequest;
3007
+ type index_d$2_RestoreDataCollectionsFromSnapshotResponse = RestoreDataCollectionsFromSnapshotResponse;
3008
+ type index_d$2_Role = Role;
3009
+ declare const index_d$2_Role: typeof Role;
3010
+ type index_d$2_Segment = Segment;
3011
+ declare const index_d$2_Segment: typeof Segment;
3012
+ type index_d$2_SingleItemPluginOptions = SingleItemPluginOptions;
3013
+ type index_d$2_SiteSort = SiteSort;
3014
+ type index_d$2_SnapshotCollection = SnapshotCollection;
3015
+ type index_d$2_Sort = Sort;
3016
+ type index_d$2_StringLengthRange = StringLengthRange;
3017
+ type index_d$2_Type = Type;
3018
+ declare const index_d$2_Type: typeof Type;
3019
+ type index_d$2_TypeMetadata = TypeMetadata;
3020
+ type index_d$2_TypeMetadataMetadataOneOf = TypeMetadataMetadataOneOf;
3021
+ type index_d$2_UpdateDataCollectionFieldRequest = UpdateDataCollectionFieldRequest;
3022
+ type index_d$2_UpdateDataCollectionFieldResponse = UpdateDataCollectionFieldResponse;
3023
+ type index_d$2_UpdateDataCollectionRequest = UpdateDataCollectionRequest;
3024
+ type index_d$2_UpdateDataCollectionResponse = UpdateDataCollectionResponse;
3025
+ type index_d$2_UpdateDataCollectionResponseNonNullableFields = UpdateDataCollectionResponseNonNullableFields;
3026
+ type index_d$2_UpdateDataPermissionsRequest = UpdateDataPermissionsRequest;
3027
+ type index_d$2_UpdateDataPermissionsResponse = UpdateDataPermissionsResponse;
3028
+ type index_d$2_UrlizedOnlyPattern = UrlizedOnlyPattern;
3029
+ type index_d$2_UrlizedPluginOptions = UrlizedPluginOptions;
3030
+ type index_d$2__Array = _Array;
3031
+ type index_d$2__Object = _Object;
3032
+ type index_d$2__publicOnDataCollectionChangedEventType = _publicOnDataCollectionChangedEventType;
3033
+ type index_d$2__publicOnDataCollectionClonedEventType = _publicOnDataCollectionClonedEventType;
3034
+ type index_d$2__publicOnDataCollectionCreatedType = _publicOnDataCollectionCreatedType;
3035
+ type index_d$2__publicOnDataCollectionDeletedType = _publicOnDataCollectionDeletedType;
3036
+ type index_d$2__publicOnDataCollectionUpdatedType = _publicOnDataCollectionUpdatedType;
3037
+ declare const index_d$2_createDataCollection: typeof createDataCollection;
3038
+ declare const index_d$2_deleteDataCollection: typeof deleteDataCollection;
3039
+ declare const index_d$2_getDataCollection: typeof getDataCollection;
3040
+ declare const index_d$2_listDataCollections: typeof listDataCollections;
3041
+ declare const index_d$2_onDataCollectionChangedEvent: typeof onDataCollectionChangedEvent;
3042
+ declare const index_d$2_onDataCollectionClonedEvent: typeof onDataCollectionClonedEvent;
3043
+ declare const index_d$2_onDataCollectionCreated: typeof onDataCollectionCreated;
3044
+ declare const index_d$2_onDataCollectionDeleted: typeof onDataCollectionDeleted;
3045
+ declare const index_d$2_onDataCollectionUpdated: typeof onDataCollectionUpdated;
3046
+ declare const index_d$2_updateDataCollection: typeof updateDataCollection;
3047
+ declare namespace index_d$2 {
3048
+ export { index_d$2_AccessLevel as AccessLevel, type ActionEvent$1 as ActionEvent, type index_d$2_AllowedDataPermissions as AllowedDataPermissions, type index_d$2_ArraySizeRange as ArraySizeRange, type BaseEventMetadata$1 as BaseEventMetadata, type index_d$2_BulkGetDataCollectionsPageBySnapshotsRequest as BulkGetDataCollectionsPageBySnapshotsRequest, type index_d$2_BulkGetDataCollectionsPageBySnapshotsResponse as BulkGetDataCollectionsPageBySnapshotsResponse, type index_d$2_BulkGetDataCollectionsRequest as BulkGetDataCollectionsRequest, type index_d$2_BulkGetDataCollectionsResponse as BulkGetDataCollectionsResponse, type index_d$2_Calculator as Calculator, type index_d$2_CalculatorPatternOneOf as CalculatorPatternOneOf, type index_d$2_CmsOptions as CmsOptions, type index_d$2_CollectionCapabilities as CollectionCapabilities, index_d$2_CollectionOperation as CollectionOperation, index_d$2_CollectionType as CollectionType, type index_d$2_CreateDataCollectionFieldRequest as CreateDataCollectionFieldRequest, type index_d$2_CreateDataCollectionFieldResponse as CreateDataCollectionFieldResponse, type index_d$2_CreateDataCollectionRequest as CreateDataCollectionRequest, type index_d$2_CreateDataCollectionResponse as CreateDataCollectionResponse, type index_d$2_CreateDataCollectionResponseNonNullableFields as CreateDataCollectionResponseNonNullableFields, type index_d$2_CreateDataCollectionsSnapshotRequest as CreateDataCollectionsSnapshotRequest, type index_d$2_CreateDataCollectionsSnapshotResponse as CreateDataCollectionsSnapshotResponse, type index_d$2_CreateMigratedCollectionsSnapshotRequest as CreateMigratedCollectionsSnapshotRequest, type index_d$2_CreateMigratedCollectionsSnapshotResponse as CreateMigratedCollectionsSnapshotResponse, type index_d$2_DataCollection as DataCollection, type index_d$2_DataCollectionChangedEnvelope as DataCollectionChangedEnvelope, type index_d$2_DataCollectionChangedEvent as DataCollectionChangedEvent, type index_d$2_DataCollectionClonedEnvelope as DataCollectionClonedEnvelope, type index_d$2_DataCollectionClonedEvent as DataCollectionClonedEvent, type index_d$2_DataCollectionCreatedEnvelope as DataCollectionCreatedEnvelope, type index_d$2_DataCollectionDeletedEnvelope as DataCollectionDeletedEnvelope, type index_d$2_DataCollectionNonNullableFields as DataCollectionNonNullableFields, type index_d$2_DataCollectionUpdatedEnvelope as DataCollectionUpdatedEnvelope, index_d$2_DataOperation as DataOperation, type index_d$2_DataPermissions as DataPermissions, type index_d$2_DeleteDataCollectionFieldRequest as DeleteDataCollectionFieldRequest, type index_d$2_DeleteDataCollectionFieldResponse as DeleteDataCollectionFieldResponse, type index_d$2_DeleteDataCollectionRequest as DeleteDataCollectionRequest, type index_d$2_DeleteDataCollectionResponse as DeleteDataCollectionResponse, type index_d$2_DeleteDataCollectionsSnapshotRequest as DeleteDataCollectionsSnapshotRequest, type index_d$2_DeleteDataCollectionsSnapshotResponse as DeleteDataCollectionsSnapshotResponse, index_d$2_Direction as Direction, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type EventMetadata$1 as EventMetadata, type Failure$1 as Failure, type Field$1 as Field, type index_d$2_FieldCapabilities as FieldCapabilities, type index_d$2_FieldPlugin as FieldPlugin, type index_d$2_FieldPluginOptionsOneOf as FieldPluginOptionsOneOf, index_d$2_FieldPluginType as FieldPluginType, type index_d$2_FieldRangeValidationsOneOf as FieldRangeValidationsOneOf, type FieldUpdate$1 as FieldUpdate, type index_d$2_FieldsPattern as FieldsPattern, index_d$2_Format as Format, type index_d$2_GetDataCollectionOptions as GetDataCollectionOptions, type index_d$2_GetDataCollectionRequest as GetDataCollectionRequest, type index_d$2_GetDataCollectionResponse as GetDataCollectionResponse, type index_d$2_GetDataCollectionResponseNonNullableFields as GetDataCollectionResponseNonNullableFields, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type Index$1 as Index, type index_d$2_IndexField as IndexField, type index_d$2_IndexLimits as IndexLimits, index_d$2_IndexStatus as IndexStatus, type index_d$2_ListDataCollectionsOptions as ListDataCollectionsOptions, type index_d$2_ListDataCollectionsRequest as ListDataCollectionsRequest, type index_d$2_ListDataCollectionsResponse as ListDataCollectionsResponse, type index_d$2_ListDataCollectionsResponseNonNullableFields as ListDataCollectionsResponseNonNullableFields, type MessageEnvelope$1 as MessageEnvelope, type index_d$2_MultiReference as MultiReference, type index_d$2_MultilingualOptions as MultilingualOptions, type index_d$2_NumberRange as NumberRange, type index_d$2_ObjectField as ObjectField, Order$1 as Order, type index_d$2_PageLink as PageLink, type index_d$2_PageLinkPluginOptions as PageLinkPluginOptions, type Paging$2 as Paging, type PagingMetadataV2$1 as PagingMetadataV2, index_d$2_PagingMode as PagingMode, type index_d$2_Permissions as Permissions, type index_d$2_Plugin as Plugin, type index_d$2_PluginCmsOptions as PluginCmsOptions, type index_d$2_PluginOptionsOneOf as PluginOptionsOneOf, index_d$2_PluginType as PluginType, type index_d$2_PluginUpdate as PluginUpdate, type PublishPluginOptions$1 as PublishPluginOptions, index_d$2_QueryOperator as QueryOperator, type index_d$2_Reference as Reference, type index_d$2_RestoreDataCollectionsFromSnapshotRequest as RestoreDataCollectionsFromSnapshotRequest, type index_d$2_RestoreDataCollectionsFromSnapshotResponse as RestoreDataCollectionsFromSnapshotResponse, type RestoreInfo$1 as RestoreInfo, index_d$2_Role as Role, index_d$2_Segment as Segment, type index_d$2_SingleItemPluginOptions as SingleItemPluginOptions, type index_d$2_SiteSort as SiteSort, type index_d$2_SnapshotCollection as SnapshotCollection, type index_d$2_Sort as Sort, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, Status$1 as Status, type index_d$2_StringLengthRange as StringLengthRange, index_d$2_Type as Type, type index_d$2_TypeMetadata as TypeMetadata, type index_d$2_TypeMetadataMetadataOneOf as TypeMetadataMetadataOneOf, type index_d$2_UpdateDataCollectionFieldRequest as UpdateDataCollectionFieldRequest, type index_d$2_UpdateDataCollectionFieldResponse as UpdateDataCollectionFieldResponse, type index_d$2_UpdateDataCollectionRequest as UpdateDataCollectionRequest, type index_d$2_UpdateDataCollectionResponse as UpdateDataCollectionResponse, type index_d$2_UpdateDataCollectionResponseNonNullableFields as UpdateDataCollectionResponseNonNullableFields, type index_d$2_UpdateDataPermissionsRequest as UpdateDataPermissionsRequest, type index_d$2_UpdateDataPermissionsResponse as UpdateDataPermissionsResponse, type index_d$2_UrlizedOnlyPattern as UrlizedOnlyPattern, type index_d$2_UrlizedPluginOptions as UrlizedPluginOptions, WebhookIdentityType$1 as WebhookIdentityType, type index_d$2__Array as _Array, type index_d$2__Object as _Object, type index_d$2__publicOnDataCollectionChangedEventType as _publicOnDataCollectionChangedEventType, type index_d$2__publicOnDataCollectionClonedEventType as _publicOnDataCollectionClonedEventType, type index_d$2__publicOnDataCollectionCreatedType as _publicOnDataCollectionCreatedType, type index_d$2__publicOnDataCollectionDeletedType as _publicOnDataCollectionDeletedType, type index_d$2__publicOnDataCollectionUpdatedType as _publicOnDataCollectionUpdatedType, index_d$2_createDataCollection as createDataCollection, index_d$2_deleteDataCollection as deleteDataCollection, index_d$2_getDataCollection as getDataCollection, index_d$2_listDataCollections as listDataCollections, index_d$2_onDataCollectionChangedEvent as onDataCollectionChangedEvent, index_d$2_onDataCollectionClonedEvent as onDataCollectionClonedEvent, index_d$2_onDataCollectionCreated as onDataCollectionCreated, index_d$2_onDataCollectionDeleted as onDataCollectionDeleted, index_d$2_onDataCollectionUpdated as onDataCollectionUpdated, onDataCollectionChangedEvent$1 as publicOnDataCollectionChangedEvent, onDataCollectionClonedEvent$1 as publicOnDataCollectionClonedEvent, onDataCollectionCreated$1 as publicOnDataCollectionCreated, onDataCollectionDeleted$1 as publicOnDataCollectionDeleted, onDataCollectionUpdated$1 as publicOnDataCollectionUpdated, index_d$2_updateDataCollection as updateDataCollection };
2204
3049
  }
2205
- interface EventMetadata$1 extends BaseEventMetadata$1 {
2206
- /**
2207
- * Unique event ID.
2208
- * Allows clients to ignore duplicate webhooks.
2209
- */
2210
- _id?: string;
2211
- /**
2212
- * Assumes actions are also always typed to an entity_type
2213
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
2214
- */
2215
- entityFqdn?: string;
2216
- /**
2217
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
2218
- * This is although the created/updated/deleted notion is duplication of the oneof types
2219
- * Example: created/updated/deleted/started/completed/email_opened
2220
- */
2221
- slug?: string;
2222
- /** ID of the entity associated with the event. */
2223
- entityId?: string;
2224
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
2225
- eventTime?: Date;
3050
+
3051
+ type HostModule$1<T, H extends Host$1> = {
3052
+ __type: 'host';
3053
+ create(host: H): T;
3054
+ };
3055
+ type HostModuleAPI$1<T extends HostModule$1<any, any>> = T extends HostModule$1<infer U, any> ? U : never;
3056
+ type Host$1<Environment = unknown> = {
3057
+ channel: {
3058
+ observeState(callback: (props: unknown, environment: Environment) => unknown): {
3059
+ disconnect: () => void;
3060
+ } | Promise<{
3061
+ disconnect: () => void;
3062
+ }>;
3063
+ };
3064
+ environment?: Environment;
2226
3065
  /**
2227
- * Whether the event was triggered as a result of a privacy regulation application
2228
- * (for example, GDPR).
3066
+ * Optional name of the environment, use for logging
2229
3067
  */
2230
- triggeredByAnonymizeRequest?: boolean | null;
2231
- /** If present, indicates the action that triggered the event. */
2232
- originatedFrom?: string | null;
3068
+ name?: string;
2233
3069
  /**
2234
- * A sequence number defining the order of updates to the underlying entity.
2235
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
2236
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
2237
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
2238
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
2239
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
3070
+ * Optional bast url to use for API requests, for example `www.wixapis.com`
2240
3071
  */
2241
- entityEventSequence?: string | null;
2242
- }
2243
- interface DataCollectionClonedEnvelope {
2244
- data: DataCollectionClonedEvent;
2245
- metadata: EventMetadata$1;
2246
- }
2247
- interface DataCollectionChangedEnvelope {
2248
- data: DataCollectionChangedEvent;
2249
- metadata: EventMetadata$1;
2250
- }
2251
- interface DataCollectionCreatedEnvelope {
2252
- entity: DataCollection;
2253
- metadata: EventMetadata$1;
2254
- }
2255
- interface DataCollectionUpdatedEnvelope {
2256
- entity: DataCollection;
2257
- metadata: EventMetadata$1;
2258
- }
2259
- interface DataCollectionDeletedEnvelope {
2260
- metadata: EventMetadata$1;
2261
- }
2262
- interface GetDataCollectionOptions {
3072
+ apiBaseUrl?: string;
2263
3073
  /**
2264
- * Whether to retrieve data from the primary database instance.
2265
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
2266
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
2267
- *
2268
- * Default: `false`
3074
+ * Possible data to be provided by every host, for cross cutting concerns
3075
+ * like internationalization, billing, etc.
2269
3076
  */
2270
- consistentRead?: boolean;
3077
+ essentials?: {
3078
+ /**
3079
+ * The language of the currently viewed session
3080
+ */
3081
+ language?: string;
3082
+ /**
3083
+ * The locale of the currently viewed session
3084
+ */
3085
+ locale?: string;
3086
+ /**
3087
+ * Any headers that should be passed through to the API requests
3088
+ */
3089
+ passThroughHeaders?: Record<string, string>;
3090
+ };
3091
+ };
3092
+
3093
+ type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
3094
+ interface HttpClient$1 {
3095
+ request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
3096
+ fetchWithAuth: typeof fetch;
3097
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
3098
+ getActiveToken?: () => string | undefined;
2271
3099
  }
2272
- interface ListDataCollectionsOptions {
2273
- /**
2274
- * Defines how collections in the response are sorted.
2275
- *
2276
- * Default: Ordered by ID in ascending order.
2277
- */
2278
- sort?: Sorting$1;
2279
- /** Pagination information. */
2280
- paging?: Paging$2;
2281
- /**
2282
- * Whether to retrieve data from the primary database instance.
2283
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
2284
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
2285
- *
2286
- * Default: `false`
2287
- */
2288
- consistentRead?: boolean;
3100
+ type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
3101
+ type HttpResponse$1<T = any> = {
3102
+ data: T;
3103
+ status: number;
3104
+ statusText: string;
3105
+ headers: any;
3106
+ request?: any;
3107
+ };
3108
+ type RequestOptions$1<_TResponse = any, Data = any> = {
3109
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
3110
+ url: string;
3111
+ data?: Data;
3112
+ params?: URLSearchParams;
3113
+ } & APIMetadata$1;
3114
+ type APIMetadata$1 = {
3115
+ methodFqn?: string;
3116
+ entityFqdn?: string;
3117
+ packageName?: string;
3118
+ };
3119
+ type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
3120
+ type EventDefinition$1<Payload = unknown, Type extends string = string> = {
3121
+ __type: 'event-definition';
3122
+ type: Type;
3123
+ isDomainEvent?: boolean;
3124
+ transformations?: (envelope: unknown) => Payload;
3125
+ __payload: Payload;
3126
+ };
3127
+ declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
3128
+ type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
3129
+ type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
3130
+
3131
+ type ServicePluginMethodInput$1 = {
3132
+ request: any;
3133
+ metadata: any;
3134
+ };
3135
+ type ServicePluginContract$1 = Record<string, (payload: ServicePluginMethodInput$1) => unknown | Promise<unknown>>;
3136
+ type ServicePluginMethodMetadata$1 = {
3137
+ name: string;
3138
+ primaryHttpMappingPath: string;
3139
+ transformations: {
3140
+ fromREST: (...args: unknown[]) => ServicePluginMethodInput$1;
3141
+ toREST: (...args: unknown[]) => unknown;
3142
+ };
3143
+ };
3144
+ type ServicePluginDefinition$1<Contract extends ServicePluginContract$1> = {
3145
+ __type: 'service-plugin-definition';
3146
+ componentType: string;
3147
+ methods: ServicePluginMethodMetadata$1[];
3148
+ __contract: Contract;
3149
+ };
3150
+ declare function ServicePluginDefinition$1<Contract extends ServicePluginContract$1>(componentType: string, methods: ServicePluginMethodMetadata$1[]): ServicePluginDefinition$1<Contract>;
3151
+ type BuildServicePluginDefinition$1<T extends ServicePluginDefinition$1<any>> = (implementation: T['__contract']) => void;
3152
+ declare const SERVICE_PLUGIN_ERROR_TYPE$1 = "wix_spi_error";
3153
+
3154
+ type RequestContext$1 = {
3155
+ isSSR: boolean;
3156
+ host: string;
3157
+ protocol?: string;
3158
+ };
3159
+ type ResponseTransformer$1 = (data: any, headers?: any) => any;
3160
+ /**
3161
+ * Ambassador request options types are copied mostly from AxiosRequestConfig.
3162
+ * They are copied and not imported to reduce the amount of dependencies (to reduce install time).
3163
+ * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
3164
+ */
3165
+ type Method$1 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
3166
+ type AmbassadorRequestOptions$1<T = any> = {
3167
+ _?: T;
3168
+ url?: string;
3169
+ method?: Method$1;
3170
+ params?: any;
3171
+ data?: any;
3172
+ transformResponse?: ResponseTransformer$1 | ResponseTransformer$1[];
3173
+ };
3174
+ type AmbassadorFactory$1<Request, Response> = (payload: Request) => ((context: RequestContext$1) => AmbassadorRequestOptions$1<Response>) & {
3175
+ __isAmbassador: boolean;
3176
+ };
3177
+ type AmbassadorFunctionDescriptor$1<Request = any, Response = any> = AmbassadorFactory$1<Request, Response>;
3178
+ type BuildAmbassadorFunction$1<T extends AmbassadorFunctionDescriptor$1> = T extends AmbassadorFunctionDescriptor$1<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
3179
+
3180
+ declare global {
3181
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
3182
+ interface SymbolConstructor {
3183
+ readonly observable: symbol;
3184
+ }
2289
3185
  }
2290
3186
 
2291
- declare function createDataCollection$1(httpClient: HttpClient): CreateDataCollectionSignature;
2292
- interface CreateDataCollectionSignature {
2293
- /**
2294
- * Creates a new data collection.
2295
- *
2296
- * The request body must include an ID, details for at least 1 field, and a permissions object. If any of these are missing, the collection isn't created.
2297
- * @param - Collection details.
2298
- * @param - Options for creating a data collection.
2299
- * @returns Details of collection created.
2300
- */
2301
- (collection: DataCollection): Promise<DataCollection & DataCollectionNonNullableFields>;
2302
- }
2303
- declare function getDataCollection$1(httpClient: HttpClient): GetDataCollectionSignature;
2304
- interface GetDataCollectionSignature {
2305
- /**
2306
- * Retrieves a data collection by ID.
2307
- * @param - ID of the collection to retrieve.
2308
- * @param - Options for retrieving a data collection.
2309
- * @returns Details of the collection requested.
2310
- */
2311
- (dataCollectionId: string, options?: GetDataCollectionOptions | undefined): Promise<DataCollection & DataCollectionNonNullableFields>;
2312
- }
2313
- declare function listDataCollections$1(httpClient: HttpClient): ListDataCollectionsSignature;
2314
- interface ListDataCollectionsSignature {
2315
- /**
2316
- * Retrieves a list of all data collections associated with the site or project.
2317
- *
2318
- * By default, the list is ordered by ID in ascending order.
2319
- * @param - Options for retrieving a list of data collections.
2320
- */
2321
- (options?: ListDataCollectionsOptions | undefined): Promise<ListDataCollectionsResponse & ListDataCollectionsResponseNonNullableFields>;
3187
+ declare const emptyObjectSymbol$1: unique symbol;
3188
+
3189
+ /**
3190
+ Represents a strictly empty plain object, the `{}` value.
3191
+
3192
+ 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)).
3193
+
3194
+ @example
3195
+ ```
3196
+ import type {EmptyObject} from 'type-fest';
3197
+
3198
+ // The following illustrates the problem with `{}`.
3199
+ const foo1: {} = {}; // Pass
3200
+ const foo2: {} = []; // Pass
3201
+ const foo3: {} = 42; // Pass
3202
+ const foo4: {} = {a: 1}; // Pass
3203
+
3204
+ // With `EmptyObject` only the first case is valid.
3205
+ const bar1: EmptyObject = {}; // Pass
3206
+ const bar2: EmptyObject = 42; // Fail
3207
+ const bar3: EmptyObject = []; // Fail
3208
+ const bar4: EmptyObject = {a: 1}; // Fail
3209
+ ```
3210
+
3211
+ 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}.
3212
+
3213
+ @category Object
3214
+ */
3215
+ type EmptyObject$1 = {[emptyObjectSymbol$1]?: never};
3216
+
3217
+ /**
3218
+ Returns a boolean for whether the two given types are equal.
3219
+
3220
+ @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
3221
+ @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
3222
+
3223
+ Use-cases:
3224
+ - If you want to make a conditional branch based on the result of a comparison of two types.
3225
+
3226
+ @example
3227
+ ```
3228
+ import type {IsEqual} from 'type-fest';
3229
+
3230
+ // This type returns a boolean for whether the given array includes the given item.
3231
+ // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
3232
+ type Includes<Value extends readonly any[], Item> =
3233
+ Value extends readonly [Value[0], ...infer rest]
3234
+ ? IsEqual<Value[0], Item> extends true
3235
+ ? true
3236
+ : Includes<rest, Item>
3237
+ : false;
3238
+ ```
3239
+
3240
+ @category Type Guard
3241
+ @category Utilities
3242
+ */
3243
+ type IsEqual$1<A, B> =
3244
+ (<G>() => G extends A ? 1 : 2) extends
3245
+ (<G>() => G extends B ? 1 : 2)
3246
+ ? true
3247
+ : false;
3248
+
3249
+ /**
3250
+ Filter out keys from an object.
3251
+
3252
+ Returns `never` if `Exclude` is strictly equal to `Key`.
3253
+ Returns `never` if `Key` extends `Exclude`.
3254
+ Returns `Key` otherwise.
3255
+
3256
+ @example
3257
+ ```
3258
+ type Filtered = Filter<'foo', 'foo'>;
3259
+ //=> never
3260
+ ```
3261
+
3262
+ @example
3263
+ ```
3264
+ type Filtered = Filter<'bar', string>;
3265
+ //=> never
3266
+ ```
3267
+
3268
+ @example
3269
+ ```
3270
+ type Filtered = Filter<'bar', 'foo'>;
3271
+ //=> 'bar'
3272
+ ```
3273
+
3274
+ @see {Except}
3275
+ */
3276
+ type Filter$1<KeyType, ExcludeType> = IsEqual$1<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
3277
+
3278
+ type ExceptOptions$1 = {
3279
+ /**
3280
+ Disallow assigning non-specified properties.
3281
+
3282
+ Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
3283
+
3284
+ @default false
3285
+ */
3286
+ requireExactProps?: boolean;
3287
+ };
3288
+
3289
+ /**
3290
+ Create a type from an object type without certain keys.
3291
+
3292
+ We recommend setting the `requireExactProps` option to `true`.
3293
+
3294
+ 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.
3295
+
3296
+ 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)).
3297
+
3298
+ @example
3299
+ ```
3300
+ import type {Except} from 'type-fest';
3301
+
3302
+ type Foo = {
3303
+ a: number;
3304
+ b: string;
3305
+ };
3306
+
3307
+ type FooWithoutA = Except<Foo, 'a'>;
3308
+ //=> {b: string}
3309
+
3310
+ const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
3311
+ //=> errors: 'a' does not exist in type '{ b: string; }'
3312
+
3313
+ type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
3314
+ //=> {a: number} & Partial<Record<"b", never>>
3315
+
3316
+ const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
3317
+ //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
3318
+ ```
3319
+
3320
+ @category Object
3321
+ */
3322
+ type Except$1<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$1 = {requireExactProps: false}> = {
3323
+ [KeyType in keyof ObjectType as Filter$1<KeyType, KeysType>]: ObjectType[KeyType];
3324
+ } & (Options['requireExactProps'] extends true
3325
+ ? Partial<Record<KeysType, never>>
3326
+ : {});
3327
+
3328
+ /**
3329
+ Returns a boolean for whether the given type is `never`.
3330
+
3331
+ @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
3332
+ @link https://stackoverflow.com/a/53984913/10292952
3333
+ @link https://www.zhenghao.io/posts/ts-never
3334
+
3335
+ Useful in type utilities, such as checking if something does not occur.
3336
+
3337
+ @example
3338
+ ```
3339
+ import type {IsNever, And} from 'type-fest';
3340
+
3341
+ // https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
3342
+ type AreStringsEqual<A extends string, B extends string> =
3343
+ And<
3344
+ IsNever<Exclude<A, B>> extends true ? true : false,
3345
+ IsNever<Exclude<B, A>> extends true ? true : false
3346
+ >;
3347
+
3348
+ type EndIfEqual<I extends string, O extends string> =
3349
+ AreStringsEqual<I, O> extends true
3350
+ ? never
3351
+ : void;
3352
+
3353
+ function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
3354
+ if (input === output) {
3355
+ process.exit(0);
3356
+ }
2322
3357
  }
2323
- declare function updateDataCollection$1(httpClient: HttpClient): UpdateDataCollectionSignature;
2324
- interface UpdateDataCollectionSignature {
2325
- /**
2326
- * Updates a data collection.
2327
- *
2328
- * A collection ID, revision number, permissions, and at least 1 field must be provided within `options.collection`.
2329
- * If a collection with that ID exists, and if its current `revision` number matches the one provided, it is updated.
2330
- * Otherwise, the request fails.
2331
- *
2332
- * When a collection is updated, its `_updatedDate` property is changed to the current date and its `revision` property is incremented.
2333
- *
2334
- * > **Note:**
2335
- * > After a collection is updated, it only contains the properties included in the `updateDataCollection()` call. If the existing collection has properties with values and those properties
2336
- * > aren't included in the updated collection details, their values are lost.
2337
- * @param - Updated collection details. The existing collection is replaced with this version.
2338
- * @param - Options for updating a data collection.
2339
- * @returns Updated collection details.
2340
- */
2341
- (collection: DataCollection): Promise<DataCollection & DataCollectionNonNullableFields>;
3358
+
3359
+ endIfEqual('abc', 'abc');
3360
+ //=> never
3361
+
3362
+ endIfEqual('abc', '123');
3363
+ //=> void
3364
+ ```
3365
+
3366
+ @category Type Guard
3367
+ @category Utilities
3368
+ */
3369
+ type IsNever$1<T> = [T] extends [never] ? true : false;
3370
+
3371
+ /**
3372
+ An if-else-like type that resolves depending on whether the given type is `never`.
3373
+
3374
+ @see {@link IsNever}
3375
+
3376
+ @example
3377
+ ```
3378
+ import type {IfNever} from 'type-fest';
3379
+
3380
+ type ShouldBeTrue = IfNever<never>;
3381
+ //=> true
3382
+
3383
+ type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
3384
+ //=> 'bar'
3385
+ ```
3386
+
3387
+ @category Type Guard
3388
+ @category Utilities
3389
+ */
3390
+ type IfNever$1<T, TypeIfNever = true, TypeIfNotNever = false> = (
3391
+ IsNever$1<T> extends true ? TypeIfNever : TypeIfNotNever
3392
+ );
3393
+
3394
+ /**
3395
+ Extract the keys from a type where the value type of the key extends the given `Condition`.
3396
+
3397
+ Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
3398
+
3399
+ @example
3400
+ ```
3401
+ import type {ConditionalKeys} from 'type-fest';
3402
+
3403
+ interface Example {
3404
+ a: string;
3405
+ b: string | number;
3406
+ c?: string;
3407
+ d: {};
2342
3408
  }
2343
- declare function deleteDataCollection$1(httpClient: HttpClient): DeleteDataCollectionSignature;
2344
- interface DeleteDataCollectionSignature {
2345
- /**
2346
- * Deletes a data collection.
2347
- *
2348
- * > **Note:**
2349
- * > Once a collection is deleted, it can't be restored.
2350
- * @param - ID of the collection to delete.
2351
- */
2352
- (dataCollectionId: string): Promise<void>;
3409
+
3410
+ type StringKeysOnly = ConditionalKeys<Example, string>;
3411
+ //=> 'a'
3412
+ ```
3413
+
3414
+ To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
3415
+
3416
+ @example
3417
+ ```
3418
+ import type {ConditionalKeys} from 'type-fest';
3419
+
3420
+ type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
3421
+ //=> 'a' | 'c'
3422
+ ```
3423
+
3424
+ @category Object
3425
+ */
3426
+ type ConditionalKeys$1<Base, Condition> =
3427
+ {
3428
+ // Map through all the keys of the given base type.
3429
+ [Key in keyof Base]-?:
3430
+ // Pick only keys with types extending the given `Condition` type.
3431
+ Base[Key] extends Condition
3432
+ // Retain this key
3433
+ // If the value for the key extends never, only include it if `Condition` also extends never
3434
+ ? IfNever$1<Base[Key], IfNever$1<Condition, Key, never>, Key>
3435
+ // Discard this key since the condition fails.
3436
+ : never;
3437
+ // Convert the produced object into a union type of the keys which passed the conditional test.
3438
+ }[keyof Base];
3439
+
3440
+ /**
3441
+ Exclude keys from a shape that matches the given `Condition`.
3442
+
3443
+ 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.
3444
+
3445
+ @example
3446
+ ```
3447
+ import type {Primitive, ConditionalExcept} from 'type-fest';
3448
+
3449
+ class Awesome {
3450
+ name: string;
3451
+ successes: number;
3452
+ failures: bigint;
3453
+
3454
+ run() {}
2353
3455
  }
2354
- declare const onDataCollectionClonedEvent$1: EventDefinition$3<DataCollectionClonedEnvelope, "wix.data.v2.data_collection_data_collection_cloned_event">;
2355
- declare const onDataCollectionChangedEvent$1: EventDefinition$3<DataCollectionChangedEnvelope, "wix.data.v2.data_collection_data_collection_changed_event">;
2356
- declare const onDataCollectionCreated$1: EventDefinition$3<DataCollectionCreatedEnvelope, "wix.data.v2.data_collection_created">;
2357
- declare const onDataCollectionUpdated$1: EventDefinition$3<DataCollectionUpdatedEnvelope, "wix.data.v2.data_collection_updated">;
2358
- declare const onDataCollectionDeleted$1: EventDefinition$3<DataCollectionDeletedEnvelope, "wix.data.v2.data_collection_deleted">;
2359
3456
 
2360
- type EventDefinition$1<Payload = unknown, Type extends string = string> = {
2361
- __type: 'event-definition';
2362
- type: Type;
2363
- isDomainEvent?: boolean;
2364
- transformations?: (envelope: unknown) => Payload;
2365
- __payload: Payload;
2366
- };
2367
- declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
2368
- type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
2369
- type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
3457
+ type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
3458
+ //=> {run: () => void}
3459
+ ```
2370
3460
 
2371
- declare global {
2372
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
2373
- interface SymbolConstructor {
2374
- readonly observable: symbol;
2375
- }
3461
+ @example
3462
+ ```
3463
+ import type {ConditionalExcept} from 'type-fest';
3464
+
3465
+ interface Example {
3466
+ a: string;
3467
+ b: string | number;
3468
+ c: () => void;
3469
+ d: {};
2376
3470
  }
2377
3471
 
2378
- declare function createEventModule$1<T extends EventDefinition$1<any, string>>(eventDefinition: T): BuildEventDefinition$1<T> & T;
3472
+ type NonStringKeysOnly = ConditionalExcept<Example, string>;
3473
+ //=> {b: string | number; c: () => void; d: {}}
3474
+ ```
2379
3475
 
2380
- declare const createDataCollection: MaybeContext<BuildRESTFunction<typeof createDataCollection$1> & typeof createDataCollection$1>;
2381
- declare const getDataCollection: MaybeContext<BuildRESTFunction<typeof getDataCollection$1> & typeof getDataCollection$1>;
2382
- declare const listDataCollections: MaybeContext<BuildRESTFunction<typeof listDataCollections$1> & typeof listDataCollections$1>;
2383
- declare const updateDataCollection: MaybeContext<BuildRESTFunction<typeof updateDataCollection$1> & typeof updateDataCollection$1>;
2384
- declare const deleteDataCollection: MaybeContext<BuildRESTFunction<typeof deleteDataCollection$1> & typeof deleteDataCollection$1>;
3476
+ @category Object
3477
+ */
3478
+ type ConditionalExcept$1<Base, Condition> = Except$1<
3479
+ Base,
3480
+ ConditionalKeys$1<Base, Condition>
3481
+ >;
2385
3482
 
2386
- type _publicOnDataCollectionClonedEventType = typeof onDataCollectionClonedEvent$1;
2387
3483
  /**
2388
- * Event triggered when collection is cloned from other instance
2389
- * CREATED event will be also triggered along with this action
3484
+ * Descriptors are objects that describe the API of a module, and the module
3485
+ * can either be a REST module or a host module.
3486
+ * This type is recursive, so it can describe nested modules.
2390
3487
  */
2391
- declare const onDataCollectionClonedEvent: ReturnType<typeof createEventModule$1<_publicOnDataCollectionClonedEventType>>;
3488
+ type Descriptors$1 = RESTFunctionDescriptor$1 | AmbassadorFunctionDescriptor$1 | HostModule$1<any, any> | EventDefinition$1<any> | ServicePluginDefinition$1<any> | {
3489
+ [key: string]: Descriptors$1 | PublicMetadata$1 | any;
3490
+ };
3491
+ /**
3492
+ * This type takes in a descriptors object of a certain Host (including an `unknown` host)
3493
+ * and returns an object with the same structure, but with all descriptors replaced with their API.
3494
+ * Any non-descriptor properties are removed from the returned object, including descriptors that
3495
+ * do not match the given host (as they will not work with the given host).
3496
+ */
3497
+ type BuildDescriptors$1<T extends Descriptors$1, H extends Host$1<any> | undefined, Depth extends number = 5> = {
3498
+ done: T;
3499
+ recurse: T extends {
3500
+ __type: typeof SERVICE_PLUGIN_ERROR_TYPE$1;
3501
+ } ? 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<{
3502
+ [Key in keyof T]: T[Key] extends Descriptors$1 ? BuildDescriptors$1<T[Key], H, [
3503
+ -1,
3504
+ 0,
3505
+ 1,
3506
+ 2,
3507
+ 3,
3508
+ 4,
3509
+ 5
3510
+ ][Depth]> : never;
3511
+ }, EmptyObject$1>;
3512
+ }[Depth extends -1 ? 'done' : 'recurse'];
3513
+ type PublicMetadata$1 = {
3514
+ PACKAGE_NAME?: string;
3515
+ };
2392
3516
 
2393
- type _publicOnDataCollectionChangedEventType = typeof onDataCollectionChangedEvent$1;
3517
+ declare global {
3518
+ interface ContextualClient {
3519
+ }
3520
+ }
2394
3521
  /**
2395
- * Event triggered when collection is changed, describing some of changes
2396
- * UPDATED event will be also triggered along with this action
3522
+ * A type used to create concerete types from SDK descriptors in
3523
+ * case a contextual client is available.
2397
3524
  */
2398
- declare const onDataCollectionChangedEvent: ReturnType<typeof createEventModule$1<_publicOnDataCollectionChangedEventType>>;
2399
-
2400
- type _publicOnDataCollectionCreatedType = typeof onDataCollectionCreated$1;
2401
- /** */
2402
- declare const onDataCollectionCreated: ReturnType<typeof createEventModule$1<_publicOnDataCollectionCreatedType>>;
2403
-
2404
- type _publicOnDataCollectionUpdatedType = typeof onDataCollectionUpdated$1;
2405
- /** */
2406
- declare const onDataCollectionUpdated: ReturnType<typeof createEventModule$1<_publicOnDataCollectionUpdatedType>>;
2407
-
2408
- type _publicOnDataCollectionDeletedType = typeof onDataCollectionDeleted$1;
2409
- /** */
2410
- declare const onDataCollectionDeleted: ReturnType<typeof createEventModule$1<_publicOnDataCollectionDeletedType>>;
2411
-
2412
- type index_d$2_AccessLevel = AccessLevel;
2413
- declare const index_d$2_AccessLevel: typeof AccessLevel;
2414
- type index_d$2_AllowedDataPermissions = AllowedDataPermissions;
2415
- type index_d$2_ArraySizeRange = ArraySizeRange;
2416
- type index_d$2_BulkGetDataCollectionsPageBySnapshotsRequest = BulkGetDataCollectionsPageBySnapshotsRequest;
2417
- type index_d$2_BulkGetDataCollectionsPageBySnapshotsResponse = BulkGetDataCollectionsPageBySnapshotsResponse;
2418
- type index_d$2_BulkGetDataCollectionsRequest = BulkGetDataCollectionsRequest;
2419
- type index_d$2_BulkGetDataCollectionsResponse = BulkGetDataCollectionsResponse;
2420
- type index_d$2_Calculator = Calculator;
2421
- type index_d$2_CalculatorPatternOneOf = CalculatorPatternOneOf;
2422
- type index_d$2_CmsOptions = CmsOptions;
2423
- type index_d$2_CollectionCapabilities = CollectionCapabilities;
2424
- type index_d$2_CollectionOperation = CollectionOperation;
2425
- declare const index_d$2_CollectionOperation: typeof CollectionOperation;
2426
- type index_d$2_CollectionType = CollectionType;
2427
- declare const index_d$2_CollectionType: typeof CollectionType;
2428
- type index_d$2_CreateDataCollectionFieldRequest = CreateDataCollectionFieldRequest;
2429
- type index_d$2_CreateDataCollectionFieldResponse = CreateDataCollectionFieldResponse;
2430
- type index_d$2_CreateDataCollectionRequest = CreateDataCollectionRequest;
2431
- type index_d$2_CreateDataCollectionResponse = CreateDataCollectionResponse;
2432
- type index_d$2_CreateDataCollectionResponseNonNullableFields = CreateDataCollectionResponseNonNullableFields;
2433
- type index_d$2_CreateDataCollectionsSnapshotRequest = CreateDataCollectionsSnapshotRequest;
2434
- type index_d$2_CreateDataCollectionsSnapshotResponse = CreateDataCollectionsSnapshotResponse;
2435
- type index_d$2_CreateMigratedCollectionsSnapshotRequest = CreateMigratedCollectionsSnapshotRequest;
2436
- type index_d$2_CreateMigratedCollectionsSnapshotResponse = CreateMigratedCollectionsSnapshotResponse;
2437
- type index_d$2_DataCollection = DataCollection;
2438
- type index_d$2_DataCollectionChangedEnvelope = DataCollectionChangedEnvelope;
2439
- type index_d$2_DataCollectionChangedEvent = DataCollectionChangedEvent;
2440
- type index_d$2_DataCollectionClonedEnvelope = DataCollectionClonedEnvelope;
2441
- type index_d$2_DataCollectionClonedEvent = DataCollectionClonedEvent;
2442
- type index_d$2_DataCollectionCreatedEnvelope = DataCollectionCreatedEnvelope;
2443
- type index_d$2_DataCollectionDeletedEnvelope = DataCollectionDeletedEnvelope;
2444
- type index_d$2_DataCollectionNonNullableFields = DataCollectionNonNullableFields;
2445
- type index_d$2_DataCollectionUpdatedEnvelope = DataCollectionUpdatedEnvelope;
2446
- type index_d$2_DataOperation = DataOperation;
2447
- declare const index_d$2_DataOperation: typeof DataOperation;
2448
- type index_d$2_DataPermissions = DataPermissions;
2449
- type index_d$2_DeleteDataCollectionFieldRequest = DeleteDataCollectionFieldRequest;
2450
- type index_d$2_DeleteDataCollectionFieldResponse = DeleteDataCollectionFieldResponse;
2451
- type index_d$2_DeleteDataCollectionRequest = DeleteDataCollectionRequest;
2452
- type index_d$2_DeleteDataCollectionResponse = DeleteDataCollectionResponse;
2453
- type index_d$2_DeleteDataCollectionsSnapshotRequest = DeleteDataCollectionsSnapshotRequest;
2454
- type index_d$2_DeleteDataCollectionsSnapshotResponse = DeleteDataCollectionsSnapshotResponse;
2455
- type index_d$2_Direction = Direction;
2456
- declare const index_d$2_Direction: typeof Direction;
2457
- type index_d$2_FieldCapabilities = FieldCapabilities;
2458
- type index_d$2_FieldPlugin = FieldPlugin;
2459
- type index_d$2_FieldPluginOptionsOneOf = FieldPluginOptionsOneOf;
2460
- type index_d$2_FieldPluginType = FieldPluginType;
2461
- declare const index_d$2_FieldPluginType: typeof FieldPluginType;
2462
- type index_d$2_FieldRangeValidationsOneOf = FieldRangeValidationsOneOf;
2463
- type index_d$2_FieldsPattern = FieldsPattern;
2464
- type index_d$2_Format = Format;
2465
- declare const index_d$2_Format: typeof Format;
2466
- type index_d$2_GetDataCollectionOptions = GetDataCollectionOptions;
2467
- type index_d$2_GetDataCollectionRequest = GetDataCollectionRequest;
2468
- type index_d$2_GetDataCollectionResponse = GetDataCollectionResponse;
2469
- type index_d$2_GetDataCollectionResponseNonNullableFields = GetDataCollectionResponseNonNullableFields;
2470
- type index_d$2_IndexField = IndexField;
2471
- type index_d$2_IndexLimits = IndexLimits;
2472
- type index_d$2_IndexStatus = IndexStatus;
2473
- declare const index_d$2_IndexStatus: typeof IndexStatus;
2474
- type index_d$2_ListDataCollectionsOptions = ListDataCollectionsOptions;
2475
- type index_d$2_ListDataCollectionsRequest = ListDataCollectionsRequest;
2476
- type index_d$2_ListDataCollectionsResponse = ListDataCollectionsResponse;
2477
- type index_d$2_ListDataCollectionsResponseNonNullableFields = ListDataCollectionsResponseNonNullableFields;
2478
- type index_d$2_MultiReference = MultiReference;
2479
- type index_d$2_MultilingualOptions = MultilingualOptions;
2480
- type index_d$2_NumberRange = NumberRange;
2481
- type index_d$2_ObjectField = ObjectField;
2482
- type index_d$2_PageLink = PageLink;
2483
- type index_d$2_PageLinkPluginOptions = PageLinkPluginOptions;
2484
- type index_d$2_PagingMode = PagingMode;
2485
- declare const index_d$2_PagingMode: typeof PagingMode;
2486
- type index_d$2_Permissions = Permissions;
2487
- type index_d$2_Plugin = Plugin;
2488
- type index_d$2_PluginCmsOptions = PluginCmsOptions;
2489
- type index_d$2_PluginOptionsOneOf = PluginOptionsOneOf;
2490
- type index_d$2_PluginType = PluginType;
2491
- declare const index_d$2_PluginType: typeof PluginType;
2492
- type index_d$2_PluginUpdate = PluginUpdate;
2493
- type index_d$2_QueryOperator = QueryOperator;
2494
- declare const index_d$2_QueryOperator: typeof QueryOperator;
2495
- type index_d$2_Reference = Reference;
2496
- type index_d$2_RestoreDataCollectionsFromSnapshotRequest = RestoreDataCollectionsFromSnapshotRequest;
2497
- type index_d$2_RestoreDataCollectionsFromSnapshotResponse = RestoreDataCollectionsFromSnapshotResponse;
2498
- type index_d$2_Role = Role;
2499
- declare const index_d$2_Role: typeof Role;
2500
- type index_d$2_Segment = Segment;
2501
- declare const index_d$2_Segment: typeof Segment;
2502
- type index_d$2_SingleItemPluginOptions = SingleItemPluginOptions;
2503
- type index_d$2_SiteSort = SiteSort;
2504
- type index_d$2_SnapshotCollection = SnapshotCollection;
2505
- type index_d$2_Sort = Sort;
2506
- type index_d$2_StringLengthRange = StringLengthRange;
2507
- type index_d$2_Type = Type;
2508
- declare const index_d$2_Type: typeof Type;
2509
- type index_d$2_TypeMetadata = TypeMetadata;
2510
- type index_d$2_TypeMetadataMetadataOneOf = TypeMetadataMetadataOneOf;
2511
- type index_d$2_UpdateDataCollectionFieldRequest = UpdateDataCollectionFieldRequest;
2512
- type index_d$2_UpdateDataCollectionFieldResponse = UpdateDataCollectionFieldResponse;
2513
- type index_d$2_UpdateDataCollectionRequest = UpdateDataCollectionRequest;
2514
- type index_d$2_UpdateDataCollectionResponse = UpdateDataCollectionResponse;
2515
- type index_d$2_UpdateDataCollectionResponseNonNullableFields = UpdateDataCollectionResponseNonNullableFields;
2516
- type index_d$2_UpdateDataPermissionsRequest = UpdateDataPermissionsRequest;
2517
- type index_d$2_UpdateDataPermissionsResponse = UpdateDataPermissionsResponse;
2518
- type index_d$2_UrlizedOnlyPattern = UrlizedOnlyPattern;
2519
- type index_d$2_UrlizedPluginOptions = UrlizedPluginOptions;
2520
- type index_d$2__Array = _Array;
2521
- type index_d$2__Object = _Object;
2522
- type index_d$2__publicOnDataCollectionChangedEventType = _publicOnDataCollectionChangedEventType;
2523
- type index_d$2__publicOnDataCollectionClonedEventType = _publicOnDataCollectionClonedEventType;
2524
- type index_d$2__publicOnDataCollectionCreatedType = _publicOnDataCollectionCreatedType;
2525
- type index_d$2__publicOnDataCollectionDeletedType = _publicOnDataCollectionDeletedType;
2526
- type index_d$2__publicOnDataCollectionUpdatedType = _publicOnDataCollectionUpdatedType;
2527
- declare const index_d$2_createDataCollection: typeof createDataCollection;
2528
- declare const index_d$2_deleteDataCollection: typeof deleteDataCollection;
2529
- declare const index_d$2_getDataCollection: typeof getDataCollection;
2530
- declare const index_d$2_listDataCollections: typeof listDataCollections;
2531
- declare const index_d$2_onDataCollectionChangedEvent: typeof onDataCollectionChangedEvent;
2532
- declare const index_d$2_onDataCollectionClonedEvent: typeof onDataCollectionClonedEvent;
2533
- declare const index_d$2_onDataCollectionCreated: typeof onDataCollectionCreated;
2534
- declare const index_d$2_onDataCollectionDeleted: typeof onDataCollectionDeleted;
2535
- declare const index_d$2_onDataCollectionUpdated: typeof onDataCollectionUpdated;
2536
- declare const index_d$2_updateDataCollection: typeof updateDataCollection;
2537
- declare namespace index_d$2 {
2538
- export { index_d$2_AccessLevel as AccessLevel, type ActionEvent$1 as ActionEvent, type index_d$2_AllowedDataPermissions as AllowedDataPermissions, type index_d$2_ArraySizeRange as ArraySizeRange, type BaseEventMetadata$1 as BaseEventMetadata, type index_d$2_BulkGetDataCollectionsPageBySnapshotsRequest as BulkGetDataCollectionsPageBySnapshotsRequest, type index_d$2_BulkGetDataCollectionsPageBySnapshotsResponse as BulkGetDataCollectionsPageBySnapshotsResponse, type index_d$2_BulkGetDataCollectionsRequest as BulkGetDataCollectionsRequest, type index_d$2_BulkGetDataCollectionsResponse as BulkGetDataCollectionsResponse, type index_d$2_Calculator as Calculator, type index_d$2_CalculatorPatternOneOf as CalculatorPatternOneOf, type index_d$2_CmsOptions as CmsOptions, type index_d$2_CollectionCapabilities as CollectionCapabilities, index_d$2_CollectionOperation as CollectionOperation, index_d$2_CollectionType as CollectionType, type index_d$2_CreateDataCollectionFieldRequest as CreateDataCollectionFieldRequest, type index_d$2_CreateDataCollectionFieldResponse as CreateDataCollectionFieldResponse, type index_d$2_CreateDataCollectionRequest as CreateDataCollectionRequest, type index_d$2_CreateDataCollectionResponse as CreateDataCollectionResponse, type index_d$2_CreateDataCollectionResponseNonNullableFields as CreateDataCollectionResponseNonNullableFields, type index_d$2_CreateDataCollectionsSnapshotRequest as CreateDataCollectionsSnapshotRequest, type index_d$2_CreateDataCollectionsSnapshotResponse as CreateDataCollectionsSnapshotResponse, type index_d$2_CreateMigratedCollectionsSnapshotRequest as CreateMigratedCollectionsSnapshotRequest, type index_d$2_CreateMigratedCollectionsSnapshotResponse as CreateMigratedCollectionsSnapshotResponse, type index_d$2_DataCollection as DataCollection, type index_d$2_DataCollectionChangedEnvelope as DataCollectionChangedEnvelope, type index_d$2_DataCollectionChangedEvent as DataCollectionChangedEvent, type index_d$2_DataCollectionClonedEnvelope as DataCollectionClonedEnvelope, type index_d$2_DataCollectionClonedEvent as DataCollectionClonedEvent, type index_d$2_DataCollectionCreatedEnvelope as DataCollectionCreatedEnvelope, type index_d$2_DataCollectionDeletedEnvelope as DataCollectionDeletedEnvelope, type index_d$2_DataCollectionNonNullableFields as DataCollectionNonNullableFields, type index_d$2_DataCollectionUpdatedEnvelope as DataCollectionUpdatedEnvelope, index_d$2_DataOperation as DataOperation, type index_d$2_DataPermissions as DataPermissions, type index_d$2_DeleteDataCollectionFieldRequest as DeleteDataCollectionFieldRequest, type index_d$2_DeleteDataCollectionFieldResponse as DeleteDataCollectionFieldResponse, type index_d$2_DeleteDataCollectionRequest as DeleteDataCollectionRequest, type index_d$2_DeleteDataCollectionResponse as DeleteDataCollectionResponse, type index_d$2_DeleteDataCollectionsSnapshotRequest as DeleteDataCollectionsSnapshotRequest, type index_d$2_DeleteDataCollectionsSnapshotResponse as DeleteDataCollectionsSnapshotResponse, index_d$2_Direction as Direction, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type EventMetadata$1 as EventMetadata, type Failure$1 as Failure, type Field$1 as Field, type index_d$2_FieldCapabilities as FieldCapabilities, type index_d$2_FieldPlugin as FieldPlugin, type index_d$2_FieldPluginOptionsOneOf as FieldPluginOptionsOneOf, index_d$2_FieldPluginType as FieldPluginType, type index_d$2_FieldRangeValidationsOneOf as FieldRangeValidationsOneOf, type FieldUpdate$1 as FieldUpdate, type index_d$2_FieldsPattern as FieldsPattern, index_d$2_Format as Format, type index_d$2_GetDataCollectionOptions as GetDataCollectionOptions, type index_d$2_GetDataCollectionRequest as GetDataCollectionRequest, type index_d$2_GetDataCollectionResponse as GetDataCollectionResponse, type index_d$2_GetDataCollectionResponseNonNullableFields as GetDataCollectionResponseNonNullableFields, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type Index$1 as Index, type index_d$2_IndexField as IndexField, type index_d$2_IndexLimits as IndexLimits, index_d$2_IndexStatus as IndexStatus, type index_d$2_ListDataCollectionsOptions as ListDataCollectionsOptions, type index_d$2_ListDataCollectionsRequest as ListDataCollectionsRequest, type index_d$2_ListDataCollectionsResponse as ListDataCollectionsResponse, type index_d$2_ListDataCollectionsResponseNonNullableFields as ListDataCollectionsResponseNonNullableFields, type MessageEnvelope$1 as MessageEnvelope, type index_d$2_MultiReference as MultiReference, type index_d$2_MultilingualOptions as MultilingualOptions, type index_d$2_NumberRange as NumberRange, type index_d$2_ObjectField as ObjectField, Order$1 as Order, type index_d$2_PageLink as PageLink, type index_d$2_PageLinkPluginOptions as PageLinkPluginOptions, type Paging$2 as Paging, type PagingMetadataV2$1 as PagingMetadataV2, index_d$2_PagingMode as PagingMode, type index_d$2_Permissions as Permissions, type index_d$2_Plugin as Plugin, type index_d$2_PluginCmsOptions as PluginCmsOptions, type index_d$2_PluginOptionsOneOf as PluginOptionsOneOf, index_d$2_PluginType as PluginType, type index_d$2_PluginUpdate as PluginUpdate, type PublishPluginOptions$1 as PublishPluginOptions, index_d$2_QueryOperator as QueryOperator, type index_d$2_Reference as Reference, type index_d$2_RestoreDataCollectionsFromSnapshotRequest as RestoreDataCollectionsFromSnapshotRequest, type index_d$2_RestoreDataCollectionsFromSnapshotResponse as RestoreDataCollectionsFromSnapshotResponse, type RestoreInfo$1 as RestoreInfo, index_d$2_Role as Role, index_d$2_Segment as Segment, type index_d$2_SingleItemPluginOptions as SingleItemPluginOptions, type index_d$2_SiteSort as SiteSort, type index_d$2_SnapshotCollection as SnapshotCollection, type index_d$2_Sort as Sort, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, Status$1 as Status, type index_d$2_StringLengthRange as StringLengthRange, index_d$2_Type as Type, type index_d$2_TypeMetadata as TypeMetadata, type index_d$2_TypeMetadataMetadataOneOf as TypeMetadataMetadataOneOf, type index_d$2_UpdateDataCollectionFieldRequest as UpdateDataCollectionFieldRequest, type index_d$2_UpdateDataCollectionFieldResponse as UpdateDataCollectionFieldResponse, type index_d$2_UpdateDataCollectionRequest as UpdateDataCollectionRequest, type index_d$2_UpdateDataCollectionResponse as UpdateDataCollectionResponse, type index_d$2_UpdateDataCollectionResponseNonNullableFields as UpdateDataCollectionResponseNonNullableFields, type index_d$2_UpdateDataPermissionsRequest as UpdateDataPermissionsRequest, type index_d$2_UpdateDataPermissionsResponse as UpdateDataPermissionsResponse, type index_d$2_UrlizedOnlyPattern as UrlizedOnlyPattern, type index_d$2_UrlizedPluginOptions as UrlizedPluginOptions, WebhookIdentityType$1 as WebhookIdentityType, type index_d$2__Array as _Array, type index_d$2__Object as _Object, type index_d$2__publicOnDataCollectionChangedEventType as _publicOnDataCollectionChangedEventType, type index_d$2__publicOnDataCollectionClonedEventType as _publicOnDataCollectionClonedEventType, type index_d$2__publicOnDataCollectionCreatedType as _publicOnDataCollectionCreatedType, type index_d$2__publicOnDataCollectionDeletedType as _publicOnDataCollectionDeletedType, type index_d$2__publicOnDataCollectionUpdatedType as _publicOnDataCollectionUpdatedType, index_d$2_createDataCollection as createDataCollection, index_d$2_deleteDataCollection as deleteDataCollection, index_d$2_getDataCollection as getDataCollection, index_d$2_listDataCollections as listDataCollections, index_d$2_onDataCollectionChangedEvent as onDataCollectionChangedEvent, index_d$2_onDataCollectionClonedEvent as onDataCollectionClonedEvent, index_d$2_onDataCollectionCreated as onDataCollectionCreated, index_d$2_onDataCollectionDeleted as onDataCollectionDeleted, index_d$2_onDataCollectionUpdated as onDataCollectionUpdated, onDataCollectionChangedEvent$1 as publicOnDataCollectionChangedEvent, onDataCollectionClonedEvent$1 as publicOnDataCollectionClonedEvent, onDataCollectionCreated$1 as publicOnDataCollectionCreated, onDataCollectionDeleted$1 as publicOnDataCollectionDeleted, onDataCollectionUpdated$1 as publicOnDataCollectionUpdated, index_d$2_updateDataCollection as updateDataCollection };
2539
- }
3525
+ type MaybeContext$1<T extends Descriptors$1> = globalThis.ContextualClient extends {
3526
+ host: Host$1;
3527
+ } ? BuildDescriptors$1<T, globalThis.ContextualClient['host']> : T;
2540
3528
 
2541
3529
  interface DataItem {
2542
3530
  /** Data item ID. */
@@ -4475,7 +5463,7 @@ interface ReplaceDataItemReferencesOptions {
4475
5463
  newReferencedItemIds?: string[];
4476
5464
  }
4477
5465
 
4478
- declare function insertDataItem$1(httpClient: HttpClient): InsertDataItemSignature;
5466
+ declare function insertDataItem$1(httpClient: HttpClient$1): InsertDataItemSignature;
4479
5467
  interface InsertDataItemSignature {
4480
5468
  /**
4481
5469
  * Adds an item to a collection.
@@ -4493,7 +5481,7 @@ interface InsertDataItemSignature {
4493
5481
  */
4494
5482
  (options?: InsertDataItemOptions | undefined): Promise<InsertDataItemResponse & InsertDataItemResponseNonNullableFields>;
4495
5483
  }
4496
- declare function updateDataItem$1(httpClient: HttpClient): UpdateDataItemSignature;
5484
+ declare function updateDataItem$1(httpClient: HttpClient$1): UpdateDataItemSignature;
4497
5485
  interface UpdateDataItemSignature {
4498
5486
  /**
4499
5487
  * Updates an item in a collection.
@@ -4515,7 +5503,7 @@ interface UpdateDataItemSignature {
4515
5503
  */
4516
5504
  (_id: string, options?: UpdateDataItemOptions | undefined): Promise<UpdateDataItemResponse & UpdateDataItemResponseNonNullableFields>;
4517
5505
  }
4518
- declare function saveDataItem$1(httpClient: HttpClient): SaveDataItemSignature;
5506
+ declare function saveDataItem$1(httpClient: HttpClient$1): SaveDataItemSignature;
4519
5507
  interface SaveDataItemSignature {
4520
5508
  /**
4521
5509
  * Inserts or updates an item in a collection.
@@ -4535,7 +5523,7 @@ interface SaveDataItemSignature {
4535
5523
  */
4536
5524
  (options?: SaveDataItemOptions | undefined): Promise<SaveDataItemResponse & SaveDataItemResponseNonNullableFields>;
4537
5525
  }
4538
- declare function getDataItem$1(httpClient: HttpClient): GetDataItemSignature;
5526
+ declare function getDataItem$1(httpClient: HttpClient$1): GetDataItemSignature;
4539
5527
  interface GetDataItemSignature {
4540
5528
  /**
4541
5529
  * Retrieves an item from a collection.
@@ -4548,7 +5536,7 @@ interface GetDataItemSignature {
4548
5536
  */
4549
5537
  (dataItemId: string, options?: GetDataItemOptions | undefined): Promise<DataItem & DataItemNonNullableFields>;
4550
5538
  }
4551
- declare function removeDataItem$1(httpClient: HttpClient): RemoveDataItemSignature;
5539
+ declare function removeDataItem$1(httpClient: HttpClient$1): RemoveDataItemSignature;
4552
5540
  interface RemoveDataItemSignature {
4553
5541
  /**
4554
5542
  * Removes an item from a collection.
@@ -4563,7 +5551,7 @@ interface RemoveDataItemSignature {
4563
5551
  */
4564
5552
  (dataItemId: string, options?: RemoveDataItemOptions | undefined): Promise<RemoveDataItemResponse & RemoveDataItemResponseNonNullableFields>;
4565
5553
  }
4566
- declare function truncateDataItems$1(httpClient: HttpClient): TruncateDataItemsSignature;
5554
+ declare function truncateDataItems$1(httpClient: HttpClient$1): TruncateDataItemsSignature;
4567
5555
  interface TruncateDataItemsSignature {
4568
5556
  /**
4569
5557
  * Removes all items from a collection.
@@ -4577,7 +5565,7 @@ interface TruncateDataItemsSignature {
4577
5565
  */
4578
5566
  (options: TruncateDataItemsOptions): Promise<void>;
4579
5567
  }
4580
- declare function queryDataItems$1(httpClient: HttpClient): QueryDataItemsSignature;
5568
+ declare function queryDataItems$1(httpClient: HttpClient$1): QueryDataItemsSignature;
4581
5569
  interface QueryDataItemsSignature {
4582
5570
  /**
4583
5571
  * Creates a query to retrieve items from a database collection.
@@ -4605,7 +5593,7 @@ interface QueryDataItemsSignature {
4605
5593
  */
4606
5594
  (options: QueryDataItemsOptions): DataItemsQueryBuilder;
4607
5595
  }
4608
- declare function aggregateDataItems$1(httpClient: HttpClient): AggregateDataItemsSignature;
5596
+ declare function aggregateDataItems$1(httpClient: HttpClient$1): AggregateDataItemsSignature;
4609
5597
  interface AggregateDataItemsSignature {
4610
5598
  /**
4611
5599
  * Runs an aggregation on a data collection and returns the resulting list of items.
@@ -4617,7 +5605,7 @@ interface AggregateDataItemsSignature {
4617
5605
  */
4618
5606
  (options?: AggregateDataItemsOptions | undefined): Promise<AggregateDataItemsResponse>;
4619
5607
  }
4620
- declare function countDataItems$1(httpClient: HttpClient): CountDataItemsSignature;
5608
+ declare function countDataItems$1(httpClient: HttpClient$1): CountDataItemsSignature;
4621
5609
  interface CountDataItemsSignature {
4622
5610
  /**
4623
5611
  * Counts the number of items in a data collection that match the provided filtering preferences.
@@ -4627,7 +5615,7 @@ interface CountDataItemsSignature {
4627
5615
  */
4628
5616
  (options?: CountDataItemsOptions | undefined): Promise<CountDataItemsResponse & CountDataItemsResponseNonNullableFields>;
4629
5617
  }
4630
- declare function queryDistinctValues$1(httpClient: HttpClient): QueryDistinctValuesSignature;
5618
+ declare function queryDistinctValues$1(httpClient: HttpClient$1): QueryDistinctValuesSignature;
4631
5619
  interface QueryDistinctValuesSignature {
4632
5620
  /**
4633
5621
  * Retrieves a list of distinct values for a given field in all items that match a query, without duplicates.
@@ -4645,7 +5633,7 @@ interface QueryDistinctValuesSignature {
4645
5633
  */
4646
5634
  (options?: QueryDistinctValuesOptions | undefined): Promise<QueryDistinctValuesResponse>;
4647
5635
  }
4648
- declare function bulkInsertDataItems$1(httpClient: HttpClient): BulkInsertDataItemsSignature;
5636
+ declare function bulkInsertDataItems$1(httpClient: HttpClient$1): BulkInsertDataItemsSignature;
4649
5637
  interface BulkInsertDataItemsSignature {
4650
5638
  /**
4651
5639
  * Adds multiple items to a collection.
@@ -4657,7 +5645,7 @@ interface BulkInsertDataItemsSignature {
4657
5645
  */
4658
5646
  (options?: BulkInsertDataItemsOptions | undefined): Promise<BulkInsertDataItemsResponse & BulkInsertDataItemsResponseNonNullableFields>;
4659
5647
  }
4660
- declare function bulkUpdateDataItems$1(httpClient: HttpClient): BulkUpdateDataItemsSignature;
5648
+ declare function bulkUpdateDataItems$1(httpClient: HttpClient$1): BulkUpdateDataItemsSignature;
4661
5649
  interface BulkUpdateDataItemsSignature {
4662
5650
  /**
4663
5651
  * Updates multiple items in a collection.
@@ -4677,7 +5665,7 @@ interface BulkUpdateDataItemsSignature {
4677
5665
  */
4678
5666
  (options?: BulkUpdateDataItemsOptions | undefined): Promise<BulkUpdateDataItemsResponse & BulkUpdateDataItemsResponseNonNullableFields>;
4679
5667
  }
4680
- declare function bulkSaveDataItems$1(httpClient: HttpClient): BulkSaveDataItemsSignature;
5668
+ declare function bulkSaveDataItems$1(httpClient: HttpClient$1): BulkSaveDataItemsSignature;
4681
5669
  interface BulkSaveDataItemsSignature {
4682
5670
  /**
4683
5671
  * Inserts or updates multiple items in a collection.
@@ -4697,7 +5685,7 @@ interface BulkSaveDataItemsSignature {
4697
5685
  */
4698
5686
  (options?: BulkSaveDataItemsOptions | undefined): Promise<BulkSaveDataItemsResponse & BulkSaveDataItemsResponseNonNullableFields>;
4699
5687
  }
4700
- declare function bulkRemoveDataItems$1(httpClient: HttpClient): BulkRemoveDataItemsSignature;
5688
+ declare function bulkRemoveDataItems$1(httpClient: HttpClient$1): BulkRemoveDataItemsSignature;
4701
5689
  interface BulkRemoveDataItemsSignature {
4702
5690
  /**
4703
5691
  * Removes multiple items from a collection.
@@ -4710,7 +5698,7 @@ interface BulkRemoveDataItemsSignature {
4710
5698
  */
4711
5699
  (options?: BulkRemoveDataItemsOptions | undefined): Promise<BulkRemoveDataItemsResponse & BulkRemoveDataItemsResponseNonNullableFields>;
4712
5700
  }
4713
- declare function queryReferencedDataItems$1(httpClient: HttpClient): QueryReferencedDataItemsSignature;
5701
+ declare function queryReferencedDataItems$1(httpClient: HttpClient$1): QueryReferencedDataItemsSignature;
4714
5702
  interface QueryReferencedDataItemsSignature {
4715
5703
  /**
4716
5704
  * Retrieves the full items referenced in the specified field of an item.
@@ -4728,7 +5716,7 @@ interface QueryReferencedDataItemsSignature {
4728
5716
  */
4729
5717
  (options?: QueryReferencedDataItemsOptions | undefined): Promise<QueryReferencedDataItemsResponse & QueryReferencedDataItemsResponseNonNullableFields>;
4730
5718
  }
4731
- declare function isReferencedDataItem$1(httpClient: HttpClient): IsReferencedDataItemSignature;
5719
+ declare function isReferencedDataItem$1(httpClient: HttpClient$1): IsReferencedDataItemSignature;
4732
5720
  interface IsReferencedDataItemSignature {
4733
5721
  /**
4734
5722
  * Checks whether a field in a referring item contains a reference to a specified item.
@@ -4738,7 +5726,7 @@ interface IsReferencedDataItemSignature {
4738
5726
  */
4739
5727
  (options?: IsReferencedDataItemOptions | undefined): Promise<IsReferencedDataItemResponse & IsReferencedDataItemResponseNonNullableFields>;
4740
5728
  }
4741
- declare function insertDataItemReference$1(httpClient: HttpClient): InsertDataItemReferenceSignature;
5729
+ declare function insertDataItemReference$1(httpClient: HttpClient$1): InsertDataItemReferenceSignature;
4742
5730
  interface InsertDataItemReferenceSignature {
4743
5731
  /**
4744
5732
  * Inserts a reference in the specified field in an item in a collection.
@@ -4749,7 +5737,7 @@ interface InsertDataItemReferenceSignature {
4749
5737
  */
4750
5738
  (options?: InsertDataItemReferenceOptions | undefined): Promise<InsertDataItemReferenceResponse & InsertDataItemReferenceResponseNonNullableFields>;
4751
5739
  }
4752
- declare function removeDataItemReference$1(httpClient: HttpClient): RemoveDataItemReferenceSignature;
5740
+ declare function removeDataItemReference$1(httpClient: HttpClient$1): RemoveDataItemReferenceSignature;
4753
5741
  interface RemoveDataItemReferenceSignature {
4754
5742
  /**
4755
5743
  * Removes the specified reference from the specified field.
@@ -4757,44 +5745,340 @@ interface RemoveDataItemReferenceSignature {
4757
5745
  */
4758
5746
  (options: RemoveDataItemReferenceOptions): Promise<RemoveDataItemReferenceResponse & RemoveDataItemReferenceResponseNonNullableFields>;
4759
5747
  }
4760
- declare function bulkInsertDataItemReferences$1(httpClient: HttpClient): BulkInsertDataItemReferencesSignature;
4761
- interface BulkInsertDataItemReferencesSignature {
5748
+ declare function bulkInsertDataItemReferences$1(httpClient: HttpClient$1): BulkInsertDataItemReferencesSignature;
5749
+ interface BulkInsertDataItemReferencesSignature {
5750
+ /**
5751
+ * Inserts one or more references in the specified fields of items in a collection.
5752
+ *
5753
+ *
5754
+ * This endpoint adds one or more references to a collection.
5755
+ * Each new reference in `options.dataItemReferences` specifies a referring item's ID, the field in which to insert the reference, and the ID of the referenced item.
5756
+ * @param - Options for inserting one or more references.
5757
+ */
5758
+ (options?: BulkInsertDataItemReferencesOptions | undefined): Promise<BulkInsertDataItemReferencesResponse & BulkInsertDataItemReferencesResponseNonNullableFields>;
5759
+ }
5760
+ declare function bulkRemoveDataItemReferences$1(httpClient: HttpClient$1): BulkRemoveDataItemReferencesSignature;
5761
+ interface BulkRemoveDataItemReferencesSignature {
5762
+ /**
5763
+ * Removes one or more references.
5764
+ * @param - Options for removing one or more references.
5765
+ */
5766
+ (options: BulkRemoveDataItemReferencesOptions): Promise<BulkRemoveDataItemReferencesResponse & BulkRemoveDataItemReferencesResponseNonNullableFields>;
5767
+ }
5768
+ declare function replaceDataItemReferences$1(httpClient: HttpClient$1): ReplaceDataItemReferencesSignature;
5769
+ interface ReplaceDataItemReferencesSignature {
5770
+ /**
5771
+ * Replaces references in a specified field of a specified data item.
5772
+ *
5773
+ *
5774
+ * This function replaces the existing reference or references contained in the field specified in `options.referringItemFieldName` within the data item specified in `options.referringItemId`.
5775
+ * The function removes existing references and in their place it adds references to the items specified in `options.newReferencedItemIds`.
5776
+ *
5777
+ * > **Note:** If you pass an empty array in `options.newReferencedItemIds`, all existing references are removed.
5778
+ * @param - Options for replacing references.
5779
+ */
5780
+ (options?: ReplaceDataItemReferencesOptions | undefined): Promise<ReplaceDataItemReferencesResponse & ReplaceDataItemReferencesResponseNonNullableFields>;
5781
+ }
5782
+ declare const onDataItemCreated$1: EventDefinition$1<DataItemCreatedEnvelope, "wix.data.v2.data_item_created">;
5783
+ declare const onDataItemUpdated$1: EventDefinition$1<DataItemUpdatedEnvelope, "wix.data.v2.data_item_updated">;
5784
+ declare const onDataItemDeleted$1: EventDefinition$1<DataItemDeletedEnvelope, "wix.data.v2.data_item_deleted">;
5785
+
5786
+ declare function createEventModule<T extends EventDefinition$1<any, string>>(eventDefinition: T): BuildEventDefinition$1<T> & T;
5787
+
5788
+ declare const insertDataItem: MaybeContext$1<BuildRESTFunction$1<typeof insertDataItem$1> & typeof insertDataItem$1>;
5789
+ declare const updateDataItem: MaybeContext$1<BuildRESTFunction$1<typeof updateDataItem$1> & typeof updateDataItem$1>;
5790
+ declare const saveDataItem: MaybeContext$1<BuildRESTFunction$1<typeof saveDataItem$1> & typeof saveDataItem$1>;
5791
+ declare const getDataItem: MaybeContext$1<BuildRESTFunction$1<typeof getDataItem$1> & typeof getDataItem$1>;
5792
+ declare const removeDataItem: MaybeContext$1<BuildRESTFunction$1<typeof removeDataItem$1> & typeof removeDataItem$1>;
5793
+ declare const truncateDataItems: MaybeContext$1<BuildRESTFunction$1<typeof truncateDataItems$1> & typeof truncateDataItems$1>;
5794
+ declare const queryDataItems: MaybeContext$1<BuildRESTFunction$1<typeof queryDataItems$1> & typeof queryDataItems$1>;
5795
+ declare const aggregateDataItems: MaybeContext$1<BuildRESTFunction$1<typeof aggregateDataItems$1> & typeof aggregateDataItems$1>;
5796
+ declare const countDataItems: MaybeContext$1<BuildRESTFunction$1<typeof countDataItems$1> & typeof countDataItems$1>;
5797
+ declare const queryDistinctValues: MaybeContext$1<BuildRESTFunction$1<typeof queryDistinctValues$1> & typeof queryDistinctValues$1>;
5798
+ declare const bulkInsertDataItems: MaybeContext$1<BuildRESTFunction$1<typeof bulkInsertDataItems$1> & typeof bulkInsertDataItems$1>;
5799
+ declare const bulkUpdateDataItems: MaybeContext$1<BuildRESTFunction$1<typeof bulkUpdateDataItems$1> & typeof bulkUpdateDataItems$1>;
5800
+ declare const bulkSaveDataItems: MaybeContext$1<BuildRESTFunction$1<typeof bulkSaveDataItems$1> & typeof bulkSaveDataItems$1>;
5801
+ declare const bulkRemoveDataItems: MaybeContext$1<BuildRESTFunction$1<typeof bulkRemoveDataItems$1> & typeof bulkRemoveDataItems$1>;
5802
+ declare const queryReferencedDataItems: MaybeContext$1<BuildRESTFunction$1<typeof queryReferencedDataItems$1> & typeof queryReferencedDataItems$1>;
5803
+ declare const isReferencedDataItem: MaybeContext$1<BuildRESTFunction$1<typeof isReferencedDataItem$1> & typeof isReferencedDataItem$1>;
5804
+ declare const insertDataItemReference: MaybeContext$1<BuildRESTFunction$1<typeof insertDataItemReference$1> & typeof insertDataItemReference$1>;
5805
+ declare const removeDataItemReference: MaybeContext$1<BuildRESTFunction$1<typeof removeDataItemReference$1> & typeof removeDataItemReference$1>;
5806
+ declare const bulkInsertDataItemReferences: MaybeContext$1<BuildRESTFunction$1<typeof bulkInsertDataItemReferences$1> & typeof bulkInsertDataItemReferences$1>;
5807
+ declare const bulkRemoveDataItemReferences: MaybeContext$1<BuildRESTFunction$1<typeof bulkRemoveDataItemReferences$1> & typeof bulkRemoveDataItemReferences$1>;
5808
+ declare const replaceDataItemReferences: MaybeContext$1<BuildRESTFunction$1<typeof replaceDataItemReferences$1> & typeof replaceDataItemReferences$1>;
5809
+
5810
+ type _publicOnDataItemCreatedType = typeof onDataItemCreated$1;
5811
+ /**
5812
+ * Triggered when a data item is inserted.
5813
+ */
5814
+ declare const onDataItemCreated: ReturnType<typeof createEventModule<_publicOnDataItemCreatedType>>;
5815
+
5816
+ type _publicOnDataItemUpdatedType = typeof onDataItemUpdated$1;
5817
+ /**
5818
+ * Triggered when a data item is updated.
5819
+ *
5820
+ * **Note**: When [scheduling an item's visibility change](https://support.wix.com/en/article/cms-controlling-live-site-item-visibility-from-your-collection#scheduling-changes-to-item-visibility), the event is triggered when the scheduled change is set up, not when it goes into effect.
5821
+ */
5822
+ declare const onDataItemUpdated: ReturnType<typeof createEventModule<_publicOnDataItemUpdatedType>>;
5823
+
5824
+ type _publicOnDataItemDeletedType = typeof onDataItemDeleted$1;
5825
+ /**
5826
+ * Triggered when a data item is deleted.
5827
+ */
5828
+ declare const onDataItemDeleted: ReturnType<typeof createEventModule<_publicOnDataItemDeletedType>>;
5829
+
5830
+ type index_d$1_ACTION = ACTION;
5831
+ declare const index_d$1_ACTION: typeof ACTION;
5832
+ type index_d$1_Action = Action;
5833
+ declare const index_d$1_Action: typeof Action;
5834
+ type index_d$1_ActionEvent = ActionEvent;
5835
+ type index_d$1_AggregateDataItemsOptions = AggregateDataItemsOptions;
5836
+ type index_d$1_AggregateDataItemsRequest = AggregateDataItemsRequest;
5837
+ type index_d$1_AggregateDataItemsRequestPagingMethodOneOf = AggregateDataItemsRequestPagingMethodOneOf;
5838
+ type index_d$1_AggregateDataItemsResponse = AggregateDataItemsResponse;
5839
+ type index_d$1_Aggregation = Aggregation;
5840
+ type index_d$1_AppendToArray = AppendToArray;
5841
+ type index_d$1_ApplicationError = ApplicationError;
5842
+ type index_d$1_Average = Average;
5843
+ type index_d$1_BaseEventMetadata = BaseEventMetadata;
5844
+ type index_d$1_BulkActionMetadata = BulkActionMetadata;
5845
+ type index_d$1_BulkActionType = BulkActionType;
5846
+ declare const index_d$1_BulkActionType: typeof BulkActionType;
5847
+ type index_d$1_BulkDataItemReferenceResult = BulkDataItemReferenceResult;
5848
+ type index_d$1_BulkDataItemResult = BulkDataItemResult;
5849
+ type index_d$1_BulkInsertDataItemReferencesOptions = BulkInsertDataItemReferencesOptions;
5850
+ type index_d$1_BulkInsertDataItemReferencesRequest = BulkInsertDataItemReferencesRequest;
5851
+ type index_d$1_BulkInsertDataItemReferencesResponse = BulkInsertDataItemReferencesResponse;
5852
+ type index_d$1_BulkInsertDataItemReferencesResponseNonNullableFields = BulkInsertDataItemReferencesResponseNonNullableFields;
5853
+ type index_d$1_BulkInsertDataItemsOptions = BulkInsertDataItemsOptions;
5854
+ type index_d$1_BulkInsertDataItemsRequest = BulkInsertDataItemsRequest;
5855
+ type index_d$1_BulkInsertDataItemsResponse = BulkInsertDataItemsResponse;
5856
+ type index_d$1_BulkInsertDataItemsResponseNonNullableFields = BulkInsertDataItemsResponseNonNullableFields;
5857
+ type index_d$1_BulkPatchDataItemsRequest = BulkPatchDataItemsRequest;
5858
+ type index_d$1_BulkPatchDataItemsResponse = BulkPatchDataItemsResponse;
5859
+ type index_d$1_BulkRemoveDataItemReferencesOptions = BulkRemoveDataItemReferencesOptions;
5860
+ type index_d$1_BulkRemoveDataItemReferencesRequest = BulkRemoveDataItemReferencesRequest;
5861
+ type index_d$1_BulkRemoveDataItemReferencesResponse = BulkRemoveDataItemReferencesResponse;
5862
+ type index_d$1_BulkRemoveDataItemReferencesResponseNonNullableFields = BulkRemoveDataItemReferencesResponseNonNullableFields;
5863
+ type index_d$1_BulkRemoveDataItemsOptions = BulkRemoveDataItemsOptions;
5864
+ type index_d$1_BulkRemoveDataItemsRequest = BulkRemoveDataItemsRequest;
5865
+ type index_d$1_BulkRemoveDataItemsResponse = BulkRemoveDataItemsResponse;
5866
+ type index_d$1_BulkRemoveDataItemsResponseNonNullableFields = BulkRemoveDataItemsResponseNonNullableFields;
5867
+ type index_d$1_BulkSaveDataItemsOptions = BulkSaveDataItemsOptions;
5868
+ type index_d$1_BulkSaveDataItemsRequest = BulkSaveDataItemsRequest;
5869
+ type index_d$1_BulkSaveDataItemsResponse = BulkSaveDataItemsResponse;
5870
+ type index_d$1_BulkSaveDataItemsResponseNonNullableFields = BulkSaveDataItemsResponseNonNullableFields;
5871
+ type index_d$1_BulkUpdateDataItemsOptions = BulkUpdateDataItemsOptions;
5872
+ type index_d$1_BulkUpdateDataItemsRequest = BulkUpdateDataItemsRequest;
5873
+ type index_d$1_BulkUpdateDataItemsResponse = BulkUpdateDataItemsResponse;
5874
+ type index_d$1_BulkUpdateDataItemsResponseNonNullableFields = BulkUpdateDataItemsResponseNonNullableFields;
5875
+ type index_d$1_CachingInfo = CachingInfo;
5876
+ type index_d$1_Count = Count;
5877
+ type index_d$1_CountDataItemsOptions = CountDataItemsOptions;
5878
+ type index_d$1_CountDataItemsRequest = CountDataItemsRequest;
5879
+ type index_d$1_CountDataItemsResponse = CountDataItemsResponse;
5880
+ type index_d$1_CountDataItemsResponseNonNullableFields = CountDataItemsResponseNonNullableFields;
5881
+ type index_d$1_CursorPaging = CursorPaging;
5882
+ type index_d$1_Cursors = Cursors;
5883
+ type index_d$1_DataItem = DataItem;
5884
+ type index_d$1_DataItemCreatedEnvelope = DataItemCreatedEnvelope;
5885
+ type index_d$1_DataItemDeletedEnvelope = DataItemDeletedEnvelope;
5886
+ type index_d$1_DataItemNonNullableFields = DataItemNonNullableFields;
5887
+ type index_d$1_DataItemReference = DataItemReference;
5888
+ type index_d$1_DataItemUpdatedEnvelope = DataItemUpdatedEnvelope;
5889
+ type index_d$1_DataItemsQueryBuilder = DataItemsQueryBuilder;
5890
+ type index_d$1_DataItemsQueryResult = DataItemsQueryResult;
5891
+ type index_d$1_DataPublishPluginOptions = DataPublishPluginOptions;
5892
+ type index_d$1_DomainEvent = DomainEvent;
5893
+ type index_d$1_DomainEventBodyOneOf = DomainEventBodyOneOf;
5894
+ type index_d$1_EntityCreatedEvent = EntityCreatedEvent;
5895
+ type index_d$1_EntityDeletedEvent = EntityDeletedEvent;
5896
+ type index_d$1_EntityUpdatedEvent = EntityUpdatedEvent;
5897
+ type index_d$1_EventMetadata = EventMetadata;
5898
+ type index_d$1_FieldUpdate = FieldUpdate;
5899
+ type index_d$1_FieldUpdateActionOptionsOneOf = FieldUpdateActionOptionsOneOf;
5900
+ type index_d$1_GetDataItemOptions = GetDataItemOptions;
5901
+ type index_d$1_GetDataItemRequest = GetDataItemRequest;
5902
+ type index_d$1_GetDataItemResponse = GetDataItemResponse;
5903
+ type index_d$1_GetDataItemResponseNonNullableFields = GetDataItemResponseNonNullableFields;
5904
+ type index_d$1_IdentificationData = IdentificationData;
5905
+ type index_d$1_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
5906
+ type index_d$1_IncrementField = IncrementField;
5907
+ type index_d$1_InsertDataItemOptions = InsertDataItemOptions;
5908
+ type index_d$1_InsertDataItemReferenceOptions = InsertDataItemReferenceOptions;
5909
+ type index_d$1_InsertDataItemReferenceRequest = InsertDataItemReferenceRequest;
5910
+ type index_d$1_InsertDataItemReferenceResponse = InsertDataItemReferenceResponse;
5911
+ type index_d$1_InsertDataItemReferenceResponseNonNullableFields = InsertDataItemReferenceResponseNonNullableFields;
5912
+ type index_d$1_InsertDataItemRequest = InsertDataItemRequest;
5913
+ type index_d$1_InsertDataItemResponse = InsertDataItemResponse;
5914
+ type index_d$1_InsertDataItemResponseNonNullableFields = InsertDataItemResponseNonNullableFields;
5915
+ type index_d$1_IsReferencedDataItemOptions = IsReferencedDataItemOptions;
5916
+ type index_d$1_IsReferencedDataItemRequest = IsReferencedDataItemRequest;
5917
+ type index_d$1_IsReferencedDataItemResponse = IsReferencedDataItemResponse;
5918
+ type index_d$1_IsReferencedDataItemResponseNonNullableFields = IsReferencedDataItemResponseNonNullableFields;
5919
+ type index_d$1_ItemMetadata = ItemMetadata;
5920
+ type index_d$1_Max = Max;
5921
+ type index_d$1_MessageEnvelope = MessageEnvelope;
5922
+ type index_d$1_Min = Min;
5923
+ type index_d$1_Operation = Operation;
5924
+ type index_d$1_OperationCalculateOneOf = OperationCalculateOneOf;
5925
+ type index_d$1_Options = Options;
5926
+ type index_d$1_PagingMetadataV2 = PagingMetadataV2;
5927
+ type index_d$1_PatchDataItemRequest = PatchDataItemRequest;
5928
+ type index_d$1_PatchDataItemResponse = PatchDataItemResponse;
5929
+ type index_d$1_PatchSet = PatchSet;
5930
+ type index_d$1_PublishPluginOptions = PublishPluginOptions;
5931
+ type index_d$1_QueryDataItemsOptions = QueryDataItemsOptions;
5932
+ type index_d$1_QueryDataItemsRequest = QueryDataItemsRequest;
5933
+ type index_d$1_QueryDataItemsResponse = QueryDataItemsResponse;
5934
+ type index_d$1_QueryDataItemsResponseNonNullableFields = QueryDataItemsResponseNonNullableFields;
5935
+ type index_d$1_QueryDistinctValuesOptions = QueryDistinctValuesOptions;
5936
+ type index_d$1_QueryDistinctValuesRequest = QueryDistinctValuesRequest;
5937
+ type index_d$1_QueryDistinctValuesRequestPagingMethodOneOf = QueryDistinctValuesRequestPagingMethodOneOf;
5938
+ type index_d$1_QueryDistinctValuesResponse = QueryDistinctValuesResponse;
5939
+ type index_d$1_QueryReferencedDataItemsOptions = QueryReferencedDataItemsOptions;
5940
+ type index_d$1_QueryReferencedDataItemsRequest = QueryReferencedDataItemsRequest;
5941
+ type index_d$1_QueryReferencedDataItemsRequestPagingMethodOneOf = QueryReferencedDataItemsRequestPagingMethodOneOf;
5942
+ type index_d$1_QueryReferencedDataItemsResponse = QueryReferencedDataItemsResponse;
5943
+ type index_d$1_QueryReferencedDataItemsResponseNonNullableFields = QueryReferencedDataItemsResponseNonNullableFields;
5944
+ type index_d$1_QueryV2 = QueryV2;
5945
+ type index_d$1_QueryV2PagingMethodOneOf = QueryV2PagingMethodOneOf;
5946
+ type index_d$1_ReferencedItemOptions = ReferencedItemOptions;
5947
+ type index_d$1_ReferencedResult = ReferencedResult;
5948
+ type index_d$1_ReferencedResultEntityOneOf = ReferencedResultEntityOneOf;
5949
+ type index_d$1_RemoveDataItemOptions = RemoveDataItemOptions;
5950
+ type index_d$1_RemoveDataItemReferenceOptions = RemoveDataItemReferenceOptions;
5951
+ type index_d$1_RemoveDataItemReferenceRequest = RemoveDataItemReferenceRequest;
5952
+ type index_d$1_RemoveDataItemReferenceResponse = RemoveDataItemReferenceResponse;
5953
+ type index_d$1_RemoveDataItemReferenceResponseNonNullableFields = RemoveDataItemReferenceResponseNonNullableFields;
5954
+ type index_d$1_RemoveDataItemRequest = RemoveDataItemRequest;
5955
+ type index_d$1_RemoveDataItemResponse = RemoveDataItemResponse;
5956
+ type index_d$1_RemoveDataItemResponseNonNullableFields = RemoveDataItemResponseNonNullableFields;
5957
+ type index_d$1_RemoveFromArray = RemoveFromArray;
5958
+ type index_d$1_ReplaceDataItemReferencesOptions = ReplaceDataItemReferencesOptions;
5959
+ type index_d$1_ReplaceDataItemReferencesRequest = ReplaceDataItemReferencesRequest;
5960
+ type index_d$1_ReplaceDataItemReferencesResponse = ReplaceDataItemReferencesResponse;
5961
+ type index_d$1_ReplaceDataItemReferencesResponseNonNullableFields = ReplaceDataItemReferencesResponseNonNullableFields;
5962
+ type index_d$1_RestoreInfo = RestoreInfo;
5963
+ type index_d$1_SaveDataItemOptions = SaveDataItemOptions;
5964
+ type index_d$1_SaveDataItemRequest = SaveDataItemRequest;
5965
+ type index_d$1_SaveDataItemResponse = SaveDataItemResponse;
5966
+ type index_d$1_SaveDataItemResponseNonNullableFields = SaveDataItemResponseNonNullableFields;
5967
+ type index_d$1_SetField = SetField;
5968
+ type index_d$1_SortOrder = SortOrder;
5969
+ declare const index_d$1_SortOrder: typeof SortOrder;
5970
+ type index_d$1_Sorting = Sorting;
5971
+ type index_d$1_Sum = Sum;
5972
+ type index_d$1_TruncateDataItemsOptions = TruncateDataItemsOptions;
5973
+ type index_d$1_TruncateDataItemsRequest = TruncateDataItemsRequest;
5974
+ type index_d$1_TruncateDataItemsResponse = TruncateDataItemsResponse;
5975
+ type index_d$1_UnresolvedReference = UnresolvedReference;
5976
+ type index_d$1_UpdateDataItemOptions = UpdateDataItemOptions;
5977
+ type index_d$1_UpdateDataItemRequest = UpdateDataItemRequest;
5978
+ type index_d$1_UpdateDataItemResponse = UpdateDataItemResponse;
5979
+ type index_d$1_UpdateDataItemResponseNonNullableFields = UpdateDataItemResponseNonNullableFields;
5980
+ type index_d$1_WebhookIdentityType = WebhookIdentityType;
5981
+ declare const index_d$1_WebhookIdentityType: typeof WebhookIdentityType;
5982
+ type index_d$1__publicOnDataItemCreatedType = _publicOnDataItemCreatedType;
5983
+ type index_d$1__publicOnDataItemDeletedType = _publicOnDataItemDeletedType;
5984
+ type index_d$1__publicOnDataItemUpdatedType = _publicOnDataItemUpdatedType;
5985
+ declare const index_d$1_aggregateDataItems: typeof aggregateDataItems;
5986
+ declare const index_d$1_bulkInsertDataItemReferences: typeof bulkInsertDataItemReferences;
5987
+ declare const index_d$1_bulkInsertDataItems: typeof bulkInsertDataItems;
5988
+ declare const index_d$1_bulkRemoveDataItemReferences: typeof bulkRemoveDataItemReferences;
5989
+ declare const index_d$1_bulkRemoveDataItems: typeof bulkRemoveDataItems;
5990
+ declare const index_d$1_bulkSaveDataItems: typeof bulkSaveDataItems;
5991
+ declare const index_d$1_bulkUpdateDataItems: typeof bulkUpdateDataItems;
5992
+ declare const index_d$1_countDataItems: typeof countDataItems;
5993
+ declare const index_d$1_getDataItem: typeof getDataItem;
5994
+ declare const index_d$1_insertDataItem: typeof insertDataItem;
5995
+ declare const index_d$1_insertDataItemReference: typeof insertDataItemReference;
5996
+ declare const index_d$1_isReferencedDataItem: typeof isReferencedDataItem;
5997
+ declare const index_d$1_onDataItemCreated: typeof onDataItemCreated;
5998
+ declare const index_d$1_onDataItemDeleted: typeof onDataItemDeleted;
5999
+ declare const index_d$1_onDataItemUpdated: typeof onDataItemUpdated;
6000
+ declare const index_d$1_queryDataItems: typeof queryDataItems;
6001
+ declare const index_d$1_queryDistinctValues: typeof queryDistinctValues;
6002
+ declare const index_d$1_queryReferencedDataItems: typeof queryReferencedDataItems;
6003
+ declare const index_d$1_removeDataItem: typeof removeDataItem;
6004
+ declare const index_d$1_removeDataItemReference: typeof removeDataItemReference;
6005
+ declare const index_d$1_replaceDataItemReferences: typeof replaceDataItemReferences;
6006
+ declare const index_d$1_saveDataItem: typeof saveDataItem;
6007
+ declare const index_d$1_truncateDataItems: typeof truncateDataItems;
6008
+ declare const index_d$1_updateDataItem: typeof updateDataItem;
6009
+ declare namespace index_d$1 {
6010
+ export { index_d$1_ACTION as ACTION, index_d$1_Action as Action, type index_d$1_ActionEvent as ActionEvent, type index_d$1_AggregateDataItemsOptions as AggregateDataItemsOptions, type index_d$1_AggregateDataItemsRequest as AggregateDataItemsRequest, type index_d$1_AggregateDataItemsRequestPagingMethodOneOf as AggregateDataItemsRequestPagingMethodOneOf, type index_d$1_AggregateDataItemsResponse as AggregateDataItemsResponse, type index_d$1_Aggregation as Aggregation, type index_d$1_AppendToArray as AppendToArray, type index_d$1_ApplicationError as ApplicationError, type index_d$1_Average as Average, type index_d$1_BaseEventMetadata as BaseEventMetadata, type index_d$1_BulkActionMetadata as BulkActionMetadata, index_d$1_BulkActionType as BulkActionType, type index_d$1_BulkDataItemReferenceResult as BulkDataItemReferenceResult, type index_d$1_BulkDataItemResult as BulkDataItemResult, type index_d$1_BulkInsertDataItemReferencesOptions as BulkInsertDataItemReferencesOptions, type index_d$1_BulkInsertDataItemReferencesRequest as BulkInsertDataItemReferencesRequest, type index_d$1_BulkInsertDataItemReferencesResponse as BulkInsertDataItemReferencesResponse, type index_d$1_BulkInsertDataItemReferencesResponseNonNullableFields as BulkInsertDataItemReferencesResponseNonNullableFields, type index_d$1_BulkInsertDataItemsOptions as BulkInsertDataItemsOptions, type index_d$1_BulkInsertDataItemsRequest as BulkInsertDataItemsRequest, type index_d$1_BulkInsertDataItemsResponse as BulkInsertDataItemsResponse, type index_d$1_BulkInsertDataItemsResponseNonNullableFields as BulkInsertDataItemsResponseNonNullableFields, type index_d$1_BulkPatchDataItemsRequest as BulkPatchDataItemsRequest, type index_d$1_BulkPatchDataItemsResponse as BulkPatchDataItemsResponse, type index_d$1_BulkRemoveDataItemReferencesOptions as BulkRemoveDataItemReferencesOptions, type index_d$1_BulkRemoveDataItemReferencesRequest as BulkRemoveDataItemReferencesRequest, type index_d$1_BulkRemoveDataItemReferencesResponse as BulkRemoveDataItemReferencesResponse, type index_d$1_BulkRemoveDataItemReferencesResponseNonNullableFields as BulkRemoveDataItemReferencesResponseNonNullableFields, type index_d$1_BulkRemoveDataItemsOptions as BulkRemoveDataItemsOptions, type index_d$1_BulkRemoveDataItemsRequest as BulkRemoveDataItemsRequest, type index_d$1_BulkRemoveDataItemsResponse as BulkRemoveDataItemsResponse, type index_d$1_BulkRemoveDataItemsResponseNonNullableFields as BulkRemoveDataItemsResponseNonNullableFields, type index_d$1_BulkSaveDataItemsOptions as BulkSaveDataItemsOptions, type index_d$1_BulkSaveDataItemsRequest as BulkSaveDataItemsRequest, type index_d$1_BulkSaveDataItemsResponse as BulkSaveDataItemsResponse, type index_d$1_BulkSaveDataItemsResponseNonNullableFields as BulkSaveDataItemsResponseNonNullableFields, type index_d$1_BulkUpdateDataItemsOptions as BulkUpdateDataItemsOptions, type index_d$1_BulkUpdateDataItemsRequest as BulkUpdateDataItemsRequest, type index_d$1_BulkUpdateDataItemsResponse as BulkUpdateDataItemsResponse, type index_d$1_BulkUpdateDataItemsResponseNonNullableFields as BulkUpdateDataItemsResponseNonNullableFields, type index_d$1_CachingInfo as CachingInfo, type index_d$1_Count as Count, type index_d$1_CountDataItemsOptions as CountDataItemsOptions, type index_d$1_CountDataItemsRequest as CountDataItemsRequest, type index_d$1_CountDataItemsResponse as CountDataItemsResponse, type index_d$1_CountDataItemsResponseNonNullableFields as CountDataItemsResponseNonNullableFields, type index_d$1_CursorPaging as CursorPaging, type index_d$1_Cursors as Cursors, type index_d$1_DataItem as DataItem, type index_d$1_DataItemCreatedEnvelope as DataItemCreatedEnvelope, type index_d$1_DataItemDeletedEnvelope as DataItemDeletedEnvelope, type index_d$1_DataItemNonNullableFields as DataItemNonNullableFields, type index_d$1_DataItemReference as DataItemReference, type index_d$1_DataItemUpdatedEnvelope as DataItemUpdatedEnvelope, type index_d$1_DataItemsQueryBuilder as DataItemsQueryBuilder, type index_d$1_DataItemsQueryResult as DataItemsQueryResult, type index_d$1_DataPublishPluginOptions as DataPublishPluginOptions, type index_d$1_DomainEvent as DomainEvent, type index_d$1_DomainEventBodyOneOf as DomainEventBodyOneOf, type index_d$1_EntityCreatedEvent as EntityCreatedEvent, type index_d$1_EntityDeletedEvent as EntityDeletedEvent, type index_d$1_EntityUpdatedEvent as EntityUpdatedEvent, Environment$1 as Environment, type index_d$1_EventMetadata as EventMetadata, type index_d$1_FieldUpdate as FieldUpdate, type index_d$1_FieldUpdateActionOptionsOneOf as FieldUpdateActionOptionsOneOf, type index_d$1_GetDataItemOptions as GetDataItemOptions, type index_d$1_GetDataItemRequest as GetDataItemRequest, type index_d$1_GetDataItemResponse as GetDataItemResponse, type index_d$1_GetDataItemResponseNonNullableFields as GetDataItemResponseNonNullableFields, type index_d$1_IdentificationData as IdentificationData, type index_d$1_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type index_d$1_IncrementField as IncrementField, type index_d$1_InsertDataItemOptions as InsertDataItemOptions, type index_d$1_InsertDataItemReferenceOptions as InsertDataItemReferenceOptions, type index_d$1_InsertDataItemReferenceRequest as InsertDataItemReferenceRequest, type index_d$1_InsertDataItemReferenceResponse as InsertDataItemReferenceResponse, type index_d$1_InsertDataItemReferenceResponseNonNullableFields as InsertDataItemReferenceResponseNonNullableFields, type index_d$1_InsertDataItemRequest as InsertDataItemRequest, type index_d$1_InsertDataItemResponse as InsertDataItemResponse, type index_d$1_InsertDataItemResponseNonNullableFields as InsertDataItemResponseNonNullableFields, type index_d$1_IsReferencedDataItemOptions as IsReferencedDataItemOptions, type index_d$1_IsReferencedDataItemRequest as IsReferencedDataItemRequest, type index_d$1_IsReferencedDataItemResponse as IsReferencedDataItemResponse, type index_d$1_IsReferencedDataItemResponseNonNullableFields as IsReferencedDataItemResponseNonNullableFields, type index_d$1_ItemMetadata as ItemMetadata, type index_d$1_Max as Max, type index_d$1_MessageEnvelope as MessageEnvelope, type index_d$1_Min as Min, type index_d$1_Operation as Operation, type index_d$1_OperationCalculateOneOf as OperationCalculateOneOf, type index_d$1_Options as Options, type Paging$1 as Paging, type index_d$1_PagingMetadataV2 as PagingMetadataV2, type index_d$1_PatchDataItemRequest as PatchDataItemRequest, type index_d$1_PatchDataItemResponse as PatchDataItemResponse, type index_d$1_PatchSet as PatchSet, type index_d$1_PublishPluginOptions as PublishPluginOptions, type index_d$1_QueryDataItemsOptions as QueryDataItemsOptions, type index_d$1_QueryDataItemsRequest as QueryDataItemsRequest, type index_d$1_QueryDataItemsResponse as QueryDataItemsResponse, type index_d$1_QueryDataItemsResponseNonNullableFields as QueryDataItemsResponseNonNullableFields, type index_d$1_QueryDistinctValuesOptions as QueryDistinctValuesOptions, type index_d$1_QueryDistinctValuesRequest as QueryDistinctValuesRequest, type index_d$1_QueryDistinctValuesRequestPagingMethodOneOf as QueryDistinctValuesRequestPagingMethodOneOf, type index_d$1_QueryDistinctValuesResponse as QueryDistinctValuesResponse, type index_d$1_QueryReferencedDataItemsOptions as QueryReferencedDataItemsOptions, type index_d$1_QueryReferencedDataItemsRequest as QueryReferencedDataItemsRequest, type index_d$1_QueryReferencedDataItemsRequestPagingMethodOneOf as QueryReferencedDataItemsRequestPagingMethodOneOf, type index_d$1_QueryReferencedDataItemsResponse as QueryReferencedDataItemsResponse, type index_d$1_QueryReferencedDataItemsResponseNonNullableFields as QueryReferencedDataItemsResponseNonNullableFields, type index_d$1_QueryV2 as QueryV2, type index_d$1_QueryV2PagingMethodOneOf as QueryV2PagingMethodOneOf, type index_d$1_ReferencedItemOptions as ReferencedItemOptions, type index_d$1_ReferencedResult as ReferencedResult, type index_d$1_ReferencedResultEntityOneOf as ReferencedResultEntityOneOf, type index_d$1_RemoveDataItemOptions as RemoveDataItemOptions, type index_d$1_RemoveDataItemReferenceOptions as RemoveDataItemReferenceOptions, type index_d$1_RemoveDataItemReferenceRequest as RemoveDataItemReferenceRequest, type index_d$1_RemoveDataItemReferenceResponse as RemoveDataItemReferenceResponse, type index_d$1_RemoveDataItemReferenceResponseNonNullableFields as RemoveDataItemReferenceResponseNonNullableFields, type index_d$1_RemoveDataItemRequest as RemoveDataItemRequest, type index_d$1_RemoveDataItemResponse as RemoveDataItemResponse, type index_d$1_RemoveDataItemResponseNonNullableFields as RemoveDataItemResponseNonNullableFields, type index_d$1_RemoveFromArray as RemoveFromArray, type index_d$1_ReplaceDataItemReferencesOptions as ReplaceDataItemReferencesOptions, type index_d$1_ReplaceDataItemReferencesRequest as ReplaceDataItemReferencesRequest, type index_d$1_ReplaceDataItemReferencesResponse as ReplaceDataItemReferencesResponse, type index_d$1_ReplaceDataItemReferencesResponseNonNullableFields as ReplaceDataItemReferencesResponseNonNullableFields, type index_d$1_RestoreInfo as RestoreInfo, type index_d$1_SaveDataItemOptions as SaveDataItemOptions, type index_d$1_SaveDataItemRequest as SaveDataItemRequest, type index_d$1_SaveDataItemResponse as SaveDataItemResponse, type index_d$1_SaveDataItemResponseNonNullableFields as SaveDataItemResponseNonNullableFields, type index_d$1_SetField as SetField, index_d$1_SortOrder as SortOrder, type index_d$1_Sorting as Sorting, type index_d$1_Sum as Sum, type index_d$1_TruncateDataItemsOptions as TruncateDataItemsOptions, type index_d$1_TruncateDataItemsRequest as TruncateDataItemsRequest, type index_d$1_TruncateDataItemsResponse as TruncateDataItemsResponse, type index_d$1_UnresolvedReference as UnresolvedReference, type index_d$1_UpdateDataItemOptions as UpdateDataItemOptions, type index_d$1_UpdateDataItemRequest as UpdateDataItemRequest, type index_d$1_UpdateDataItemResponse as UpdateDataItemResponse, type index_d$1_UpdateDataItemResponseNonNullableFields as UpdateDataItemResponseNonNullableFields, index_d$1_WebhookIdentityType as WebhookIdentityType, type index_d$1__publicOnDataItemCreatedType as _publicOnDataItemCreatedType, type index_d$1__publicOnDataItemDeletedType as _publicOnDataItemDeletedType, type index_d$1__publicOnDataItemUpdatedType as _publicOnDataItemUpdatedType, index_d$1_aggregateDataItems as aggregateDataItems, index_d$1_bulkInsertDataItemReferences as bulkInsertDataItemReferences, index_d$1_bulkInsertDataItems as bulkInsertDataItems, index_d$1_bulkRemoveDataItemReferences as bulkRemoveDataItemReferences, index_d$1_bulkRemoveDataItems as bulkRemoveDataItems, index_d$1_bulkSaveDataItems as bulkSaveDataItems, index_d$1_bulkUpdateDataItems as bulkUpdateDataItems, index_d$1_countDataItems as countDataItems, index_d$1_getDataItem as getDataItem, index_d$1_insertDataItem as insertDataItem, index_d$1_insertDataItemReference as insertDataItemReference, index_d$1_isReferencedDataItem as isReferencedDataItem, index_d$1_onDataItemCreated as onDataItemCreated, index_d$1_onDataItemDeleted as onDataItemDeleted, index_d$1_onDataItemUpdated as onDataItemUpdated, onDataItemCreated$1 as publicOnDataItemCreated, onDataItemDeleted$1 as publicOnDataItemDeleted, onDataItemUpdated$1 as publicOnDataItemUpdated, index_d$1_queryDataItems as queryDataItems, index_d$1_queryDistinctValues as queryDistinctValues, index_d$1_queryReferencedDataItems as queryReferencedDataItems, index_d$1_removeDataItem as removeDataItem, index_d$1_removeDataItemReference as removeDataItemReference, index_d$1_replaceDataItemReferences as replaceDataItemReferences, index_d$1_saveDataItem as saveDataItem, index_d$1_truncateDataItems as truncateDataItems, index_d$1_updateDataItem as updateDataItem };
6011
+ }
6012
+
6013
+ type HostModule<T, H extends Host> = {
6014
+ __type: 'host';
6015
+ create(host: H): T;
6016
+ };
6017
+ type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
6018
+ type Host<Environment = unknown> = {
6019
+ channel: {
6020
+ observeState(callback: (props: unknown, environment: Environment) => unknown): {
6021
+ disconnect: () => void;
6022
+ } | Promise<{
6023
+ disconnect: () => void;
6024
+ }>;
6025
+ };
6026
+ environment?: Environment;
4762
6027
  /**
4763
- * Inserts one or more references in the specified fields of items in a collection.
4764
- *
4765
- *
4766
- * This endpoint adds one or more references to a collection.
4767
- * Each new reference in `options.dataItemReferences` specifies a referring item's ID, the field in which to insert the reference, and the ID of the referenced item.
4768
- * @param - Options for inserting one or more references.
6028
+ * Optional name of the environment, use for logging
4769
6029
  */
4770
- (options?: BulkInsertDataItemReferencesOptions | undefined): Promise<BulkInsertDataItemReferencesResponse & BulkInsertDataItemReferencesResponseNonNullableFields>;
4771
- }
4772
- declare function bulkRemoveDataItemReferences$1(httpClient: HttpClient): BulkRemoveDataItemReferencesSignature;
4773
- interface BulkRemoveDataItemReferencesSignature {
6030
+ name?: string;
4774
6031
  /**
4775
- * Removes one or more references.
4776
- * @param - Options for removing one or more references.
6032
+ * Optional bast url to use for API requests, for example `www.wixapis.com`
4777
6033
  */
4778
- (options: BulkRemoveDataItemReferencesOptions): Promise<BulkRemoveDataItemReferencesResponse & BulkRemoveDataItemReferencesResponseNonNullableFields>;
4779
- }
4780
- declare function replaceDataItemReferences$1(httpClient: HttpClient): ReplaceDataItemReferencesSignature;
4781
- interface ReplaceDataItemReferencesSignature {
6034
+ apiBaseUrl?: string;
4782
6035
  /**
4783
- * Replaces references in a specified field of a specified data item.
4784
- *
4785
- *
4786
- * This function replaces the existing reference or references contained in the field specified in `options.referringItemFieldName` within the data item specified in `options.referringItemId`.
4787
- * The function removes existing references and in their place it adds references to the items specified in `options.newReferencedItemIds`.
4788
- *
4789
- * > **Note:** If you pass an empty array in `options.newReferencedItemIds`, all existing references are removed.
4790
- * @param - Options for replacing references.
6036
+ * Possible data to be provided by every host, for cross cutting concerns
6037
+ * like internationalization, billing, etc.
4791
6038
  */
4792
- (options?: ReplaceDataItemReferencesOptions | undefined): Promise<ReplaceDataItemReferencesResponse & ReplaceDataItemReferencesResponseNonNullableFields>;
4793
- }
4794
- declare const onDataItemCreated$1: EventDefinition$3<DataItemCreatedEnvelope, "wix.data.v2.data_item_created">;
4795
- declare const onDataItemUpdated$1: EventDefinition$3<DataItemUpdatedEnvelope, "wix.data.v2.data_item_updated">;
4796
- declare const onDataItemDeleted$1: EventDefinition$3<DataItemDeletedEnvelope, "wix.data.v2.data_item_deleted">;
6039
+ essentials?: {
6040
+ /**
6041
+ * The language of the currently viewed session
6042
+ */
6043
+ language?: string;
6044
+ /**
6045
+ * The locale of the currently viewed session
6046
+ */
6047
+ locale?: string;
6048
+ /**
6049
+ * Any headers that should be passed through to the API requests
6050
+ */
6051
+ passThroughHeaders?: Record<string, string>;
6052
+ };
6053
+ };
4797
6054
 
6055
+ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
6056
+ interface HttpClient {
6057
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
6058
+ fetchWithAuth: typeof fetch;
6059
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
6060
+ getActiveToken?: () => string | undefined;
6061
+ }
6062
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
6063
+ type HttpResponse<T = any> = {
6064
+ data: T;
6065
+ status: number;
6066
+ statusText: string;
6067
+ headers: any;
6068
+ request?: any;
6069
+ };
6070
+ type RequestOptions<_TResponse = any, Data = any> = {
6071
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
6072
+ url: string;
6073
+ data?: Data;
6074
+ params?: URLSearchParams;
6075
+ } & APIMetadata;
6076
+ type APIMetadata = {
6077
+ methodFqn?: string;
6078
+ entityFqdn?: string;
6079
+ packageName?: string;
6080
+ };
6081
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
4798
6082
  type EventDefinition<Payload = unknown, Type extends string = string> = {
4799
6083
  __type: 'event-definition';
4800
6084
  type: Type;
@@ -4802,9 +6086,58 @@ type EventDefinition<Payload = unknown, Type extends string = string> = {
4802
6086
  transformations?: (envelope: unknown) => Payload;
4803
6087
  __payload: Payload;
4804
6088
  };
4805
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
4806
- type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
4807
- type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
6089
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
6090
+ type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
6091
+ type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
6092
+
6093
+ type ServicePluginMethodInput = {
6094
+ request: any;
6095
+ metadata: any;
6096
+ };
6097
+ type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
6098
+ type ServicePluginMethodMetadata = {
6099
+ name: string;
6100
+ primaryHttpMappingPath: string;
6101
+ transformations: {
6102
+ fromREST: (...args: unknown[]) => ServicePluginMethodInput;
6103
+ toREST: (...args: unknown[]) => unknown;
6104
+ };
6105
+ };
6106
+ type ServicePluginDefinition<Contract extends ServicePluginContract> = {
6107
+ __type: 'service-plugin-definition';
6108
+ componentType: string;
6109
+ methods: ServicePluginMethodMetadata[];
6110
+ __contract: Contract;
6111
+ };
6112
+ declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
6113
+ type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
6114
+ declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
6115
+
6116
+ type RequestContext = {
6117
+ isSSR: boolean;
6118
+ host: string;
6119
+ protocol?: string;
6120
+ };
6121
+ type ResponseTransformer = (data: any, headers?: any) => any;
6122
+ /**
6123
+ * Ambassador request options types are copied mostly from AxiosRequestConfig.
6124
+ * They are copied and not imported to reduce the amount of dependencies (to reduce install time).
6125
+ * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
6126
+ */
6127
+ type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
6128
+ type AmbassadorRequestOptions<T = any> = {
6129
+ _?: T;
6130
+ url?: string;
6131
+ method?: Method;
6132
+ params?: any;
6133
+ data?: any;
6134
+ transformResponse?: ResponseTransformer | ResponseTransformer[];
6135
+ };
6136
+ type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
6137
+ __isAmbassador: boolean;
6138
+ };
6139
+ type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
6140
+ type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
4808
6141
 
4809
6142
  declare global {
4810
6143
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
@@ -4813,232 +6146,347 @@ declare global {
4813
6146
  }
4814
6147
  }
4815
6148
 
4816
- declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
4817
-
4818
- declare const insertDataItem: MaybeContext<BuildRESTFunction<typeof insertDataItem$1> & typeof insertDataItem$1>;
4819
- declare const updateDataItem: MaybeContext<BuildRESTFunction<typeof updateDataItem$1> & typeof updateDataItem$1>;
4820
- declare const saveDataItem: MaybeContext<BuildRESTFunction<typeof saveDataItem$1> & typeof saveDataItem$1>;
4821
- declare const getDataItem: MaybeContext<BuildRESTFunction<typeof getDataItem$1> & typeof getDataItem$1>;
4822
- declare const removeDataItem: MaybeContext<BuildRESTFunction<typeof removeDataItem$1> & typeof removeDataItem$1>;
4823
- declare const truncateDataItems: MaybeContext<BuildRESTFunction<typeof truncateDataItems$1> & typeof truncateDataItems$1>;
4824
- declare const queryDataItems: MaybeContext<BuildRESTFunction<typeof queryDataItems$1> & typeof queryDataItems$1>;
4825
- declare const aggregateDataItems: MaybeContext<BuildRESTFunction<typeof aggregateDataItems$1> & typeof aggregateDataItems$1>;
4826
- declare const countDataItems: MaybeContext<BuildRESTFunction<typeof countDataItems$1> & typeof countDataItems$1>;
4827
- declare const queryDistinctValues: MaybeContext<BuildRESTFunction<typeof queryDistinctValues$1> & typeof queryDistinctValues$1>;
4828
- declare const bulkInsertDataItems: MaybeContext<BuildRESTFunction<typeof bulkInsertDataItems$1> & typeof bulkInsertDataItems$1>;
4829
- declare const bulkUpdateDataItems: MaybeContext<BuildRESTFunction<typeof bulkUpdateDataItems$1> & typeof bulkUpdateDataItems$1>;
4830
- declare const bulkSaveDataItems: MaybeContext<BuildRESTFunction<typeof bulkSaveDataItems$1> & typeof bulkSaveDataItems$1>;
4831
- declare const bulkRemoveDataItems: MaybeContext<BuildRESTFunction<typeof bulkRemoveDataItems$1> & typeof bulkRemoveDataItems$1>;
4832
- declare const queryReferencedDataItems: MaybeContext<BuildRESTFunction<typeof queryReferencedDataItems$1> & typeof queryReferencedDataItems$1>;
4833
- declare const isReferencedDataItem: MaybeContext<BuildRESTFunction<typeof isReferencedDataItem$1> & typeof isReferencedDataItem$1>;
4834
- declare const insertDataItemReference: MaybeContext<BuildRESTFunction<typeof insertDataItemReference$1> & typeof insertDataItemReference$1>;
4835
- declare const removeDataItemReference: MaybeContext<BuildRESTFunction<typeof removeDataItemReference$1> & typeof removeDataItemReference$1>;
4836
- declare const bulkInsertDataItemReferences: MaybeContext<BuildRESTFunction<typeof bulkInsertDataItemReferences$1> & typeof bulkInsertDataItemReferences$1>;
4837
- declare const bulkRemoveDataItemReferences: MaybeContext<BuildRESTFunction<typeof bulkRemoveDataItemReferences$1> & typeof bulkRemoveDataItemReferences$1>;
4838
- declare const replaceDataItemReferences: MaybeContext<BuildRESTFunction<typeof replaceDataItemReferences$1> & typeof replaceDataItemReferences$1>;
6149
+ declare const emptyObjectSymbol: unique symbol;
6150
+
6151
+ /**
6152
+ Represents a strictly empty plain object, the `{}` value.
6153
+
6154
+ 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)).
6155
+
6156
+ @example
6157
+ ```
6158
+ import type {EmptyObject} from 'type-fest';
6159
+
6160
+ // The following illustrates the problem with `{}`.
6161
+ const foo1: {} = {}; // Pass
6162
+ const foo2: {} = []; // Pass
6163
+ const foo3: {} = 42; // Pass
6164
+ const foo4: {} = {a: 1}; // Pass
6165
+
6166
+ // With `EmptyObject` only the first case is valid.
6167
+ const bar1: EmptyObject = {}; // Pass
6168
+ const bar2: EmptyObject = 42; // Fail
6169
+ const bar3: EmptyObject = []; // Fail
6170
+ const bar4: EmptyObject = {a: 1}; // Fail
6171
+ ```
6172
+
6173
+ 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}.
6174
+
6175
+ @category Object
6176
+ */
6177
+ type EmptyObject = {[emptyObjectSymbol]?: never};
6178
+
6179
+ /**
6180
+ Returns a boolean for whether the two given types are equal.
6181
+
6182
+ @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
6183
+ @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
6184
+
6185
+ Use-cases:
6186
+ - If you want to make a conditional branch based on the result of a comparison of two types.
6187
+
6188
+ @example
6189
+ ```
6190
+ import type {IsEqual} from 'type-fest';
6191
+
6192
+ // This type returns a boolean for whether the given array includes the given item.
6193
+ // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
6194
+ type Includes<Value extends readonly any[], Item> =
6195
+ Value extends readonly [Value[0], ...infer rest]
6196
+ ? IsEqual<Value[0], Item> extends true
6197
+ ? true
6198
+ : Includes<rest, Item>
6199
+ : false;
6200
+ ```
6201
+
6202
+ @category Type Guard
6203
+ @category Utilities
6204
+ */
6205
+ type IsEqual<A, B> =
6206
+ (<G>() => G extends A ? 1 : 2) extends
6207
+ (<G>() => G extends B ? 1 : 2)
6208
+ ? true
6209
+ : false;
6210
+
6211
+ /**
6212
+ Filter out keys from an object.
6213
+
6214
+ Returns `never` if `Exclude` is strictly equal to `Key`.
6215
+ Returns `never` if `Key` extends `Exclude`.
6216
+ Returns `Key` otherwise.
6217
+
6218
+ @example
6219
+ ```
6220
+ type Filtered = Filter<'foo', 'foo'>;
6221
+ //=> never
6222
+ ```
6223
+
6224
+ @example
6225
+ ```
6226
+ type Filtered = Filter<'bar', string>;
6227
+ //=> never
6228
+ ```
6229
+
6230
+ @example
6231
+ ```
6232
+ type Filtered = Filter<'bar', 'foo'>;
6233
+ //=> 'bar'
6234
+ ```
6235
+
6236
+ @see {Except}
6237
+ */
6238
+ type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
6239
+
6240
+ type ExceptOptions = {
6241
+ /**
6242
+ Disallow assigning non-specified properties.
6243
+
6244
+ Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
6245
+
6246
+ @default false
6247
+ */
6248
+ requireExactProps?: boolean;
6249
+ };
6250
+
6251
+ /**
6252
+ Create a type from an object type without certain keys.
6253
+
6254
+ We recommend setting the `requireExactProps` option to `true`.
6255
+
6256
+ 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.
6257
+
6258
+ 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)).
6259
+
6260
+ @example
6261
+ ```
6262
+ import type {Except} from 'type-fest';
6263
+
6264
+ type Foo = {
6265
+ a: number;
6266
+ b: string;
6267
+ };
6268
+
6269
+ type FooWithoutA = Except<Foo, 'a'>;
6270
+ //=> {b: string}
6271
+
6272
+ const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
6273
+ //=> errors: 'a' does not exist in type '{ b: string; }'
6274
+
6275
+ type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
6276
+ //=> {a: number} & Partial<Record<"b", never>>
6277
+
6278
+ const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
6279
+ //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
6280
+ ```
6281
+
6282
+ @category Object
6283
+ */
6284
+ type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
6285
+ [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
6286
+ } & (Options['requireExactProps'] extends true
6287
+ ? Partial<Record<KeysType, never>>
6288
+ : {});
6289
+
6290
+ /**
6291
+ Returns a boolean for whether the given type is `never`.
6292
+
6293
+ @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
6294
+ @link https://stackoverflow.com/a/53984913/10292952
6295
+ @link https://www.zhenghao.io/posts/ts-never
6296
+
6297
+ Useful in type utilities, such as checking if something does not occur.
6298
+
6299
+ @example
6300
+ ```
6301
+ import type {IsNever, And} from 'type-fest';
6302
+
6303
+ // https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
6304
+ type AreStringsEqual<A extends string, B extends string> =
6305
+ And<
6306
+ IsNever<Exclude<A, B>> extends true ? true : false,
6307
+ IsNever<Exclude<B, A>> extends true ? true : false
6308
+ >;
6309
+
6310
+ type EndIfEqual<I extends string, O extends string> =
6311
+ AreStringsEqual<I, O> extends true
6312
+ ? never
6313
+ : void;
6314
+
6315
+ function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
6316
+ if (input === output) {
6317
+ process.exit(0);
6318
+ }
6319
+ }
6320
+
6321
+ endIfEqual('abc', 'abc');
6322
+ //=> never
6323
+
6324
+ endIfEqual('abc', '123');
6325
+ //=> void
6326
+ ```
6327
+
6328
+ @category Type Guard
6329
+ @category Utilities
6330
+ */
6331
+ type IsNever<T> = [T] extends [never] ? true : false;
6332
+
6333
+ /**
6334
+ An if-else-like type that resolves depending on whether the given type is `never`.
6335
+
6336
+ @see {@link IsNever}
6337
+
6338
+ @example
6339
+ ```
6340
+ import type {IfNever} from 'type-fest';
6341
+
6342
+ type ShouldBeTrue = IfNever<never>;
6343
+ //=> true
6344
+
6345
+ type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
6346
+ //=> 'bar'
6347
+ ```
6348
+
6349
+ @category Type Guard
6350
+ @category Utilities
6351
+ */
6352
+ type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (
6353
+ IsNever<T> extends true ? TypeIfNever : TypeIfNotNever
6354
+ );
6355
+
6356
+ /**
6357
+ Extract the keys from a type where the value type of the key extends the given `Condition`.
6358
+
6359
+ Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
6360
+
6361
+ @example
6362
+ ```
6363
+ import type {ConditionalKeys} from 'type-fest';
6364
+
6365
+ interface Example {
6366
+ a: string;
6367
+ b: string | number;
6368
+ c?: string;
6369
+ d: {};
6370
+ }
6371
+
6372
+ type StringKeysOnly = ConditionalKeys<Example, string>;
6373
+ //=> 'a'
6374
+ ```
6375
+
6376
+ To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
6377
+
6378
+ @example
6379
+ ```
6380
+ import type {ConditionalKeys} from 'type-fest';
6381
+
6382
+ type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
6383
+ //=> 'a' | 'c'
6384
+ ```
6385
+
6386
+ @category Object
6387
+ */
6388
+ type ConditionalKeys<Base, Condition> =
6389
+ {
6390
+ // Map through all the keys of the given base type.
6391
+ [Key in keyof Base]-?:
6392
+ // Pick only keys with types extending the given `Condition` type.
6393
+ Base[Key] extends Condition
6394
+ // Retain this key
6395
+ // If the value for the key extends never, only include it if `Condition` also extends never
6396
+ ? IfNever<Base[Key], IfNever<Condition, Key, never>, Key>
6397
+ // Discard this key since the condition fails.
6398
+ : never;
6399
+ // Convert the produced object into a union type of the keys which passed the conditional test.
6400
+ }[keyof Base];
6401
+
6402
+ /**
6403
+ Exclude keys from a shape that matches the given `Condition`.
6404
+
6405
+ 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.
6406
+
6407
+ @example
6408
+ ```
6409
+ import type {Primitive, ConditionalExcept} from 'type-fest';
6410
+
6411
+ class Awesome {
6412
+ name: string;
6413
+ successes: number;
6414
+ failures: bigint;
6415
+
6416
+ run() {}
6417
+ }
6418
+
6419
+ type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
6420
+ //=> {run: () => void}
6421
+ ```
6422
+
6423
+ @example
6424
+ ```
6425
+ import type {ConditionalExcept} from 'type-fest';
6426
+
6427
+ interface Example {
6428
+ a: string;
6429
+ b: string | number;
6430
+ c: () => void;
6431
+ d: {};
6432
+ }
6433
+
6434
+ type NonStringKeysOnly = ConditionalExcept<Example, string>;
6435
+ //=> {b: string | number; c: () => void; d: {}}
6436
+ ```
4839
6437
 
4840
- type _publicOnDataItemCreatedType = typeof onDataItemCreated$1;
4841
- /**
4842
- * Triggered when a data item is inserted.
4843
- */
4844
- declare const onDataItemCreated: ReturnType<typeof createEventModule<_publicOnDataItemCreatedType>>;
6438
+ @category Object
6439
+ */
6440
+ type ConditionalExcept<Base, Condition> = Except<
6441
+ Base,
6442
+ ConditionalKeys<Base, Condition>
6443
+ >;
4845
6444
 
4846
- type _publicOnDataItemUpdatedType = typeof onDataItemUpdated$1;
4847
6445
  /**
4848
- * Triggered when a data item is updated.
4849
- *
4850
- * **Note**: When [scheduling an item's visibility change](https://support.wix.com/en/article/cms-controlling-live-site-item-visibility-from-your-collection#scheduling-changes-to-item-visibility), the event is triggered when the scheduled change is set up, not when it goes into effect.
6446
+ * Descriptors are objects that describe the API of a module, and the module
6447
+ * can either be a REST module or a host module.
6448
+ * This type is recursive, so it can describe nested modules.
4851
6449
  */
4852
- declare const onDataItemUpdated: ReturnType<typeof createEventModule<_publicOnDataItemUpdatedType>>;
4853
-
4854
- type _publicOnDataItemDeletedType = typeof onDataItemDeleted$1;
6450
+ type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
6451
+ [key: string]: Descriptors | PublicMetadata | any;
6452
+ };
4855
6453
  /**
4856
- * Triggered when a data item is deleted.
6454
+ * This type takes in a descriptors object of a certain Host (including an `unknown` host)
6455
+ * and returns an object with the same structure, but with all descriptors replaced with their API.
6456
+ * Any non-descriptor properties are removed from the returned object, including descriptors that
6457
+ * do not match the given host (as they will not work with the given host).
4857
6458
  */
4858
- declare const onDataItemDeleted: ReturnType<typeof createEventModule<_publicOnDataItemDeletedType>>;
6459
+ type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
6460
+ done: T;
6461
+ recurse: T extends {
6462
+ __type: typeof SERVICE_PLUGIN_ERROR_TYPE;
6463
+ } ? 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<{
6464
+ [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
6465
+ -1,
6466
+ 0,
6467
+ 1,
6468
+ 2,
6469
+ 3,
6470
+ 4,
6471
+ 5
6472
+ ][Depth]> : never;
6473
+ }, EmptyObject>;
6474
+ }[Depth extends -1 ? 'done' : 'recurse'];
6475
+ type PublicMetadata = {
6476
+ PACKAGE_NAME?: string;
6477
+ };
4859
6478
 
4860
- type index_d$1_ACTION = ACTION;
4861
- declare const index_d$1_ACTION: typeof ACTION;
4862
- type index_d$1_Action = Action;
4863
- declare const index_d$1_Action: typeof Action;
4864
- type index_d$1_ActionEvent = ActionEvent;
4865
- type index_d$1_AggregateDataItemsOptions = AggregateDataItemsOptions;
4866
- type index_d$1_AggregateDataItemsRequest = AggregateDataItemsRequest;
4867
- type index_d$1_AggregateDataItemsRequestPagingMethodOneOf = AggregateDataItemsRequestPagingMethodOneOf;
4868
- type index_d$1_AggregateDataItemsResponse = AggregateDataItemsResponse;
4869
- type index_d$1_Aggregation = Aggregation;
4870
- type index_d$1_AppendToArray = AppendToArray;
4871
- type index_d$1_ApplicationError = ApplicationError;
4872
- type index_d$1_Average = Average;
4873
- type index_d$1_BaseEventMetadata = BaseEventMetadata;
4874
- type index_d$1_BulkActionMetadata = BulkActionMetadata;
4875
- type index_d$1_BulkActionType = BulkActionType;
4876
- declare const index_d$1_BulkActionType: typeof BulkActionType;
4877
- type index_d$1_BulkDataItemReferenceResult = BulkDataItemReferenceResult;
4878
- type index_d$1_BulkDataItemResult = BulkDataItemResult;
4879
- type index_d$1_BulkInsertDataItemReferencesOptions = BulkInsertDataItemReferencesOptions;
4880
- type index_d$1_BulkInsertDataItemReferencesRequest = BulkInsertDataItemReferencesRequest;
4881
- type index_d$1_BulkInsertDataItemReferencesResponse = BulkInsertDataItemReferencesResponse;
4882
- type index_d$1_BulkInsertDataItemReferencesResponseNonNullableFields = BulkInsertDataItemReferencesResponseNonNullableFields;
4883
- type index_d$1_BulkInsertDataItemsOptions = BulkInsertDataItemsOptions;
4884
- type index_d$1_BulkInsertDataItemsRequest = BulkInsertDataItemsRequest;
4885
- type index_d$1_BulkInsertDataItemsResponse = BulkInsertDataItemsResponse;
4886
- type index_d$1_BulkInsertDataItemsResponseNonNullableFields = BulkInsertDataItemsResponseNonNullableFields;
4887
- type index_d$1_BulkPatchDataItemsRequest = BulkPatchDataItemsRequest;
4888
- type index_d$1_BulkPatchDataItemsResponse = BulkPatchDataItemsResponse;
4889
- type index_d$1_BulkRemoveDataItemReferencesOptions = BulkRemoveDataItemReferencesOptions;
4890
- type index_d$1_BulkRemoveDataItemReferencesRequest = BulkRemoveDataItemReferencesRequest;
4891
- type index_d$1_BulkRemoveDataItemReferencesResponse = BulkRemoveDataItemReferencesResponse;
4892
- type index_d$1_BulkRemoveDataItemReferencesResponseNonNullableFields = BulkRemoveDataItemReferencesResponseNonNullableFields;
4893
- type index_d$1_BulkRemoveDataItemsOptions = BulkRemoveDataItemsOptions;
4894
- type index_d$1_BulkRemoveDataItemsRequest = BulkRemoveDataItemsRequest;
4895
- type index_d$1_BulkRemoveDataItemsResponse = BulkRemoveDataItemsResponse;
4896
- type index_d$1_BulkRemoveDataItemsResponseNonNullableFields = BulkRemoveDataItemsResponseNonNullableFields;
4897
- type index_d$1_BulkSaveDataItemsOptions = BulkSaveDataItemsOptions;
4898
- type index_d$1_BulkSaveDataItemsRequest = BulkSaveDataItemsRequest;
4899
- type index_d$1_BulkSaveDataItemsResponse = BulkSaveDataItemsResponse;
4900
- type index_d$1_BulkSaveDataItemsResponseNonNullableFields = BulkSaveDataItemsResponseNonNullableFields;
4901
- type index_d$1_BulkUpdateDataItemsOptions = BulkUpdateDataItemsOptions;
4902
- type index_d$1_BulkUpdateDataItemsRequest = BulkUpdateDataItemsRequest;
4903
- type index_d$1_BulkUpdateDataItemsResponse = BulkUpdateDataItemsResponse;
4904
- type index_d$1_BulkUpdateDataItemsResponseNonNullableFields = BulkUpdateDataItemsResponseNonNullableFields;
4905
- type index_d$1_CachingInfo = CachingInfo;
4906
- type index_d$1_Count = Count;
4907
- type index_d$1_CountDataItemsOptions = CountDataItemsOptions;
4908
- type index_d$1_CountDataItemsRequest = CountDataItemsRequest;
4909
- type index_d$1_CountDataItemsResponse = CountDataItemsResponse;
4910
- type index_d$1_CountDataItemsResponseNonNullableFields = CountDataItemsResponseNonNullableFields;
4911
- type index_d$1_CursorPaging = CursorPaging;
4912
- type index_d$1_Cursors = Cursors;
4913
- type index_d$1_DataItem = DataItem;
4914
- type index_d$1_DataItemCreatedEnvelope = DataItemCreatedEnvelope;
4915
- type index_d$1_DataItemDeletedEnvelope = DataItemDeletedEnvelope;
4916
- type index_d$1_DataItemNonNullableFields = DataItemNonNullableFields;
4917
- type index_d$1_DataItemReference = DataItemReference;
4918
- type index_d$1_DataItemUpdatedEnvelope = DataItemUpdatedEnvelope;
4919
- type index_d$1_DataItemsQueryBuilder = DataItemsQueryBuilder;
4920
- type index_d$1_DataItemsQueryResult = DataItemsQueryResult;
4921
- type index_d$1_DataPublishPluginOptions = DataPublishPluginOptions;
4922
- type index_d$1_DomainEvent = DomainEvent;
4923
- type index_d$1_DomainEventBodyOneOf = DomainEventBodyOneOf;
4924
- type index_d$1_EntityCreatedEvent = EntityCreatedEvent;
4925
- type index_d$1_EntityDeletedEvent = EntityDeletedEvent;
4926
- type index_d$1_EntityUpdatedEvent = EntityUpdatedEvent;
4927
- type index_d$1_EventMetadata = EventMetadata;
4928
- type index_d$1_FieldUpdate = FieldUpdate;
4929
- type index_d$1_FieldUpdateActionOptionsOneOf = FieldUpdateActionOptionsOneOf;
4930
- type index_d$1_GetDataItemOptions = GetDataItemOptions;
4931
- type index_d$1_GetDataItemRequest = GetDataItemRequest;
4932
- type index_d$1_GetDataItemResponse = GetDataItemResponse;
4933
- type index_d$1_GetDataItemResponseNonNullableFields = GetDataItemResponseNonNullableFields;
4934
- type index_d$1_IdentificationData = IdentificationData;
4935
- type index_d$1_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
4936
- type index_d$1_IncrementField = IncrementField;
4937
- type index_d$1_InsertDataItemOptions = InsertDataItemOptions;
4938
- type index_d$1_InsertDataItemReferenceOptions = InsertDataItemReferenceOptions;
4939
- type index_d$1_InsertDataItemReferenceRequest = InsertDataItemReferenceRequest;
4940
- type index_d$1_InsertDataItemReferenceResponse = InsertDataItemReferenceResponse;
4941
- type index_d$1_InsertDataItemReferenceResponseNonNullableFields = InsertDataItemReferenceResponseNonNullableFields;
4942
- type index_d$1_InsertDataItemRequest = InsertDataItemRequest;
4943
- type index_d$1_InsertDataItemResponse = InsertDataItemResponse;
4944
- type index_d$1_InsertDataItemResponseNonNullableFields = InsertDataItemResponseNonNullableFields;
4945
- type index_d$1_IsReferencedDataItemOptions = IsReferencedDataItemOptions;
4946
- type index_d$1_IsReferencedDataItemRequest = IsReferencedDataItemRequest;
4947
- type index_d$1_IsReferencedDataItemResponse = IsReferencedDataItemResponse;
4948
- type index_d$1_IsReferencedDataItemResponseNonNullableFields = IsReferencedDataItemResponseNonNullableFields;
4949
- type index_d$1_ItemMetadata = ItemMetadata;
4950
- type index_d$1_Max = Max;
4951
- type index_d$1_MessageEnvelope = MessageEnvelope;
4952
- type index_d$1_Min = Min;
4953
- type index_d$1_Operation = Operation;
4954
- type index_d$1_OperationCalculateOneOf = OperationCalculateOneOf;
4955
- type index_d$1_Options = Options;
4956
- type index_d$1_PagingMetadataV2 = PagingMetadataV2;
4957
- type index_d$1_PatchDataItemRequest = PatchDataItemRequest;
4958
- type index_d$1_PatchDataItemResponse = PatchDataItemResponse;
4959
- type index_d$1_PatchSet = PatchSet;
4960
- type index_d$1_PublishPluginOptions = PublishPluginOptions;
4961
- type index_d$1_QueryDataItemsOptions = QueryDataItemsOptions;
4962
- type index_d$1_QueryDataItemsRequest = QueryDataItemsRequest;
4963
- type index_d$1_QueryDataItemsResponse = QueryDataItemsResponse;
4964
- type index_d$1_QueryDataItemsResponseNonNullableFields = QueryDataItemsResponseNonNullableFields;
4965
- type index_d$1_QueryDistinctValuesOptions = QueryDistinctValuesOptions;
4966
- type index_d$1_QueryDistinctValuesRequest = QueryDistinctValuesRequest;
4967
- type index_d$1_QueryDistinctValuesRequestPagingMethodOneOf = QueryDistinctValuesRequestPagingMethodOneOf;
4968
- type index_d$1_QueryDistinctValuesResponse = QueryDistinctValuesResponse;
4969
- type index_d$1_QueryReferencedDataItemsOptions = QueryReferencedDataItemsOptions;
4970
- type index_d$1_QueryReferencedDataItemsRequest = QueryReferencedDataItemsRequest;
4971
- type index_d$1_QueryReferencedDataItemsRequestPagingMethodOneOf = QueryReferencedDataItemsRequestPagingMethodOneOf;
4972
- type index_d$1_QueryReferencedDataItemsResponse = QueryReferencedDataItemsResponse;
4973
- type index_d$1_QueryReferencedDataItemsResponseNonNullableFields = QueryReferencedDataItemsResponseNonNullableFields;
4974
- type index_d$1_QueryV2 = QueryV2;
4975
- type index_d$1_QueryV2PagingMethodOneOf = QueryV2PagingMethodOneOf;
4976
- type index_d$1_ReferencedItemOptions = ReferencedItemOptions;
4977
- type index_d$1_ReferencedResult = ReferencedResult;
4978
- type index_d$1_ReferencedResultEntityOneOf = ReferencedResultEntityOneOf;
4979
- type index_d$1_RemoveDataItemOptions = RemoveDataItemOptions;
4980
- type index_d$1_RemoveDataItemReferenceOptions = RemoveDataItemReferenceOptions;
4981
- type index_d$1_RemoveDataItemReferenceRequest = RemoveDataItemReferenceRequest;
4982
- type index_d$1_RemoveDataItemReferenceResponse = RemoveDataItemReferenceResponse;
4983
- type index_d$1_RemoveDataItemReferenceResponseNonNullableFields = RemoveDataItemReferenceResponseNonNullableFields;
4984
- type index_d$1_RemoveDataItemRequest = RemoveDataItemRequest;
4985
- type index_d$1_RemoveDataItemResponse = RemoveDataItemResponse;
4986
- type index_d$1_RemoveDataItemResponseNonNullableFields = RemoveDataItemResponseNonNullableFields;
4987
- type index_d$1_RemoveFromArray = RemoveFromArray;
4988
- type index_d$1_ReplaceDataItemReferencesOptions = ReplaceDataItemReferencesOptions;
4989
- type index_d$1_ReplaceDataItemReferencesRequest = ReplaceDataItemReferencesRequest;
4990
- type index_d$1_ReplaceDataItemReferencesResponse = ReplaceDataItemReferencesResponse;
4991
- type index_d$1_ReplaceDataItemReferencesResponseNonNullableFields = ReplaceDataItemReferencesResponseNonNullableFields;
4992
- type index_d$1_RestoreInfo = RestoreInfo;
4993
- type index_d$1_SaveDataItemOptions = SaveDataItemOptions;
4994
- type index_d$1_SaveDataItemRequest = SaveDataItemRequest;
4995
- type index_d$1_SaveDataItemResponse = SaveDataItemResponse;
4996
- type index_d$1_SaveDataItemResponseNonNullableFields = SaveDataItemResponseNonNullableFields;
4997
- type index_d$1_SetField = SetField;
4998
- type index_d$1_SortOrder = SortOrder;
4999
- declare const index_d$1_SortOrder: typeof SortOrder;
5000
- type index_d$1_Sorting = Sorting;
5001
- type index_d$1_Sum = Sum;
5002
- type index_d$1_TruncateDataItemsOptions = TruncateDataItemsOptions;
5003
- type index_d$1_TruncateDataItemsRequest = TruncateDataItemsRequest;
5004
- type index_d$1_TruncateDataItemsResponse = TruncateDataItemsResponse;
5005
- type index_d$1_UnresolvedReference = UnresolvedReference;
5006
- type index_d$1_UpdateDataItemOptions = UpdateDataItemOptions;
5007
- type index_d$1_UpdateDataItemRequest = UpdateDataItemRequest;
5008
- type index_d$1_UpdateDataItemResponse = UpdateDataItemResponse;
5009
- type index_d$1_UpdateDataItemResponseNonNullableFields = UpdateDataItemResponseNonNullableFields;
5010
- type index_d$1_WebhookIdentityType = WebhookIdentityType;
5011
- declare const index_d$1_WebhookIdentityType: typeof WebhookIdentityType;
5012
- type index_d$1__publicOnDataItemCreatedType = _publicOnDataItemCreatedType;
5013
- type index_d$1__publicOnDataItemDeletedType = _publicOnDataItemDeletedType;
5014
- type index_d$1__publicOnDataItemUpdatedType = _publicOnDataItemUpdatedType;
5015
- declare const index_d$1_aggregateDataItems: typeof aggregateDataItems;
5016
- declare const index_d$1_bulkInsertDataItemReferences: typeof bulkInsertDataItemReferences;
5017
- declare const index_d$1_bulkInsertDataItems: typeof bulkInsertDataItems;
5018
- declare const index_d$1_bulkRemoveDataItemReferences: typeof bulkRemoveDataItemReferences;
5019
- declare const index_d$1_bulkRemoveDataItems: typeof bulkRemoveDataItems;
5020
- declare const index_d$1_bulkSaveDataItems: typeof bulkSaveDataItems;
5021
- declare const index_d$1_bulkUpdateDataItems: typeof bulkUpdateDataItems;
5022
- declare const index_d$1_countDataItems: typeof countDataItems;
5023
- declare const index_d$1_getDataItem: typeof getDataItem;
5024
- declare const index_d$1_insertDataItem: typeof insertDataItem;
5025
- declare const index_d$1_insertDataItemReference: typeof insertDataItemReference;
5026
- declare const index_d$1_isReferencedDataItem: typeof isReferencedDataItem;
5027
- declare const index_d$1_onDataItemCreated: typeof onDataItemCreated;
5028
- declare const index_d$1_onDataItemDeleted: typeof onDataItemDeleted;
5029
- declare const index_d$1_onDataItemUpdated: typeof onDataItemUpdated;
5030
- declare const index_d$1_queryDataItems: typeof queryDataItems;
5031
- declare const index_d$1_queryDistinctValues: typeof queryDistinctValues;
5032
- declare const index_d$1_queryReferencedDataItems: typeof queryReferencedDataItems;
5033
- declare const index_d$1_removeDataItem: typeof removeDataItem;
5034
- declare const index_d$1_removeDataItemReference: typeof removeDataItemReference;
5035
- declare const index_d$1_replaceDataItemReferences: typeof replaceDataItemReferences;
5036
- declare const index_d$1_saveDataItem: typeof saveDataItem;
5037
- declare const index_d$1_truncateDataItems: typeof truncateDataItems;
5038
- declare const index_d$1_updateDataItem: typeof updateDataItem;
5039
- declare namespace index_d$1 {
5040
- export { index_d$1_ACTION as ACTION, index_d$1_Action as Action, type index_d$1_ActionEvent as ActionEvent, type index_d$1_AggregateDataItemsOptions as AggregateDataItemsOptions, type index_d$1_AggregateDataItemsRequest as AggregateDataItemsRequest, type index_d$1_AggregateDataItemsRequestPagingMethodOneOf as AggregateDataItemsRequestPagingMethodOneOf, type index_d$1_AggregateDataItemsResponse as AggregateDataItemsResponse, type index_d$1_Aggregation as Aggregation, type index_d$1_AppendToArray as AppendToArray, type index_d$1_ApplicationError as ApplicationError, type index_d$1_Average as Average, type index_d$1_BaseEventMetadata as BaseEventMetadata, type index_d$1_BulkActionMetadata as BulkActionMetadata, index_d$1_BulkActionType as BulkActionType, type index_d$1_BulkDataItemReferenceResult as BulkDataItemReferenceResult, type index_d$1_BulkDataItemResult as BulkDataItemResult, type index_d$1_BulkInsertDataItemReferencesOptions as BulkInsertDataItemReferencesOptions, type index_d$1_BulkInsertDataItemReferencesRequest as BulkInsertDataItemReferencesRequest, type index_d$1_BulkInsertDataItemReferencesResponse as BulkInsertDataItemReferencesResponse, type index_d$1_BulkInsertDataItemReferencesResponseNonNullableFields as BulkInsertDataItemReferencesResponseNonNullableFields, type index_d$1_BulkInsertDataItemsOptions as BulkInsertDataItemsOptions, type index_d$1_BulkInsertDataItemsRequest as BulkInsertDataItemsRequest, type index_d$1_BulkInsertDataItemsResponse as BulkInsertDataItemsResponse, type index_d$1_BulkInsertDataItemsResponseNonNullableFields as BulkInsertDataItemsResponseNonNullableFields, type index_d$1_BulkPatchDataItemsRequest as BulkPatchDataItemsRequest, type index_d$1_BulkPatchDataItemsResponse as BulkPatchDataItemsResponse, type index_d$1_BulkRemoveDataItemReferencesOptions as BulkRemoveDataItemReferencesOptions, type index_d$1_BulkRemoveDataItemReferencesRequest as BulkRemoveDataItemReferencesRequest, type index_d$1_BulkRemoveDataItemReferencesResponse as BulkRemoveDataItemReferencesResponse, type index_d$1_BulkRemoveDataItemReferencesResponseNonNullableFields as BulkRemoveDataItemReferencesResponseNonNullableFields, type index_d$1_BulkRemoveDataItemsOptions as BulkRemoveDataItemsOptions, type index_d$1_BulkRemoveDataItemsRequest as BulkRemoveDataItemsRequest, type index_d$1_BulkRemoveDataItemsResponse as BulkRemoveDataItemsResponse, type index_d$1_BulkRemoveDataItemsResponseNonNullableFields as BulkRemoveDataItemsResponseNonNullableFields, type index_d$1_BulkSaveDataItemsOptions as BulkSaveDataItemsOptions, type index_d$1_BulkSaveDataItemsRequest as BulkSaveDataItemsRequest, type index_d$1_BulkSaveDataItemsResponse as BulkSaveDataItemsResponse, type index_d$1_BulkSaveDataItemsResponseNonNullableFields as BulkSaveDataItemsResponseNonNullableFields, type index_d$1_BulkUpdateDataItemsOptions as BulkUpdateDataItemsOptions, type index_d$1_BulkUpdateDataItemsRequest as BulkUpdateDataItemsRequest, type index_d$1_BulkUpdateDataItemsResponse as BulkUpdateDataItemsResponse, type index_d$1_BulkUpdateDataItemsResponseNonNullableFields as BulkUpdateDataItemsResponseNonNullableFields, type index_d$1_CachingInfo as CachingInfo, type index_d$1_Count as Count, type index_d$1_CountDataItemsOptions as CountDataItemsOptions, type index_d$1_CountDataItemsRequest as CountDataItemsRequest, type index_d$1_CountDataItemsResponse as CountDataItemsResponse, type index_d$1_CountDataItemsResponseNonNullableFields as CountDataItemsResponseNonNullableFields, type index_d$1_CursorPaging as CursorPaging, type index_d$1_Cursors as Cursors, type index_d$1_DataItem as DataItem, type index_d$1_DataItemCreatedEnvelope as DataItemCreatedEnvelope, type index_d$1_DataItemDeletedEnvelope as DataItemDeletedEnvelope, type index_d$1_DataItemNonNullableFields as DataItemNonNullableFields, type index_d$1_DataItemReference as DataItemReference, type index_d$1_DataItemUpdatedEnvelope as DataItemUpdatedEnvelope, type index_d$1_DataItemsQueryBuilder as DataItemsQueryBuilder, type index_d$1_DataItemsQueryResult as DataItemsQueryResult, type index_d$1_DataPublishPluginOptions as DataPublishPluginOptions, type index_d$1_DomainEvent as DomainEvent, type index_d$1_DomainEventBodyOneOf as DomainEventBodyOneOf, type index_d$1_EntityCreatedEvent as EntityCreatedEvent, type index_d$1_EntityDeletedEvent as EntityDeletedEvent, type index_d$1_EntityUpdatedEvent as EntityUpdatedEvent, Environment$1 as Environment, type index_d$1_EventMetadata as EventMetadata, type index_d$1_FieldUpdate as FieldUpdate, type index_d$1_FieldUpdateActionOptionsOneOf as FieldUpdateActionOptionsOneOf, type index_d$1_GetDataItemOptions as GetDataItemOptions, type index_d$1_GetDataItemRequest as GetDataItemRequest, type index_d$1_GetDataItemResponse as GetDataItemResponse, type index_d$1_GetDataItemResponseNonNullableFields as GetDataItemResponseNonNullableFields, type index_d$1_IdentificationData as IdentificationData, type index_d$1_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type index_d$1_IncrementField as IncrementField, type index_d$1_InsertDataItemOptions as InsertDataItemOptions, type index_d$1_InsertDataItemReferenceOptions as InsertDataItemReferenceOptions, type index_d$1_InsertDataItemReferenceRequest as InsertDataItemReferenceRequest, type index_d$1_InsertDataItemReferenceResponse as InsertDataItemReferenceResponse, type index_d$1_InsertDataItemReferenceResponseNonNullableFields as InsertDataItemReferenceResponseNonNullableFields, type index_d$1_InsertDataItemRequest as InsertDataItemRequest, type index_d$1_InsertDataItemResponse as InsertDataItemResponse, type index_d$1_InsertDataItemResponseNonNullableFields as InsertDataItemResponseNonNullableFields, type index_d$1_IsReferencedDataItemOptions as IsReferencedDataItemOptions, type index_d$1_IsReferencedDataItemRequest as IsReferencedDataItemRequest, type index_d$1_IsReferencedDataItemResponse as IsReferencedDataItemResponse, type index_d$1_IsReferencedDataItemResponseNonNullableFields as IsReferencedDataItemResponseNonNullableFields, type index_d$1_ItemMetadata as ItemMetadata, type index_d$1_Max as Max, type index_d$1_MessageEnvelope as MessageEnvelope, type index_d$1_Min as Min, type index_d$1_Operation as Operation, type index_d$1_OperationCalculateOneOf as OperationCalculateOneOf, type index_d$1_Options as Options, type Paging$1 as Paging, type index_d$1_PagingMetadataV2 as PagingMetadataV2, type index_d$1_PatchDataItemRequest as PatchDataItemRequest, type index_d$1_PatchDataItemResponse as PatchDataItemResponse, type index_d$1_PatchSet as PatchSet, type index_d$1_PublishPluginOptions as PublishPluginOptions, type index_d$1_QueryDataItemsOptions as QueryDataItemsOptions, type index_d$1_QueryDataItemsRequest as QueryDataItemsRequest, type index_d$1_QueryDataItemsResponse as QueryDataItemsResponse, type index_d$1_QueryDataItemsResponseNonNullableFields as QueryDataItemsResponseNonNullableFields, type index_d$1_QueryDistinctValuesOptions as QueryDistinctValuesOptions, type index_d$1_QueryDistinctValuesRequest as QueryDistinctValuesRequest, type index_d$1_QueryDistinctValuesRequestPagingMethodOneOf as QueryDistinctValuesRequestPagingMethodOneOf, type index_d$1_QueryDistinctValuesResponse as QueryDistinctValuesResponse, type index_d$1_QueryReferencedDataItemsOptions as QueryReferencedDataItemsOptions, type index_d$1_QueryReferencedDataItemsRequest as QueryReferencedDataItemsRequest, type index_d$1_QueryReferencedDataItemsRequestPagingMethodOneOf as QueryReferencedDataItemsRequestPagingMethodOneOf, type index_d$1_QueryReferencedDataItemsResponse as QueryReferencedDataItemsResponse, type index_d$1_QueryReferencedDataItemsResponseNonNullableFields as QueryReferencedDataItemsResponseNonNullableFields, type index_d$1_QueryV2 as QueryV2, type index_d$1_QueryV2PagingMethodOneOf as QueryV2PagingMethodOneOf, type index_d$1_ReferencedItemOptions as ReferencedItemOptions, type index_d$1_ReferencedResult as ReferencedResult, type index_d$1_ReferencedResultEntityOneOf as ReferencedResultEntityOneOf, type index_d$1_RemoveDataItemOptions as RemoveDataItemOptions, type index_d$1_RemoveDataItemReferenceOptions as RemoveDataItemReferenceOptions, type index_d$1_RemoveDataItemReferenceRequest as RemoveDataItemReferenceRequest, type index_d$1_RemoveDataItemReferenceResponse as RemoveDataItemReferenceResponse, type index_d$1_RemoveDataItemReferenceResponseNonNullableFields as RemoveDataItemReferenceResponseNonNullableFields, type index_d$1_RemoveDataItemRequest as RemoveDataItemRequest, type index_d$1_RemoveDataItemResponse as RemoveDataItemResponse, type index_d$1_RemoveDataItemResponseNonNullableFields as RemoveDataItemResponseNonNullableFields, type index_d$1_RemoveFromArray as RemoveFromArray, type index_d$1_ReplaceDataItemReferencesOptions as ReplaceDataItemReferencesOptions, type index_d$1_ReplaceDataItemReferencesRequest as ReplaceDataItemReferencesRequest, type index_d$1_ReplaceDataItemReferencesResponse as ReplaceDataItemReferencesResponse, type index_d$1_ReplaceDataItemReferencesResponseNonNullableFields as ReplaceDataItemReferencesResponseNonNullableFields, type index_d$1_RestoreInfo as RestoreInfo, type index_d$1_SaveDataItemOptions as SaveDataItemOptions, type index_d$1_SaveDataItemRequest as SaveDataItemRequest, type index_d$1_SaveDataItemResponse as SaveDataItemResponse, type index_d$1_SaveDataItemResponseNonNullableFields as SaveDataItemResponseNonNullableFields, type index_d$1_SetField as SetField, index_d$1_SortOrder as SortOrder, type index_d$1_Sorting as Sorting, type index_d$1_Sum as Sum, type index_d$1_TruncateDataItemsOptions as TruncateDataItemsOptions, type index_d$1_TruncateDataItemsRequest as TruncateDataItemsRequest, type index_d$1_TruncateDataItemsResponse as TruncateDataItemsResponse, type index_d$1_UnresolvedReference as UnresolvedReference, type index_d$1_UpdateDataItemOptions as UpdateDataItemOptions, type index_d$1_UpdateDataItemRequest as UpdateDataItemRequest, type index_d$1_UpdateDataItemResponse as UpdateDataItemResponse, type index_d$1_UpdateDataItemResponseNonNullableFields as UpdateDataItemResponseNonNullableFields, index_d$1_WebhookIdentityType as WebhookIdentityType, type index_d$1__publicOnDataItemCreatedType as _publicOnDataItemCreatedType, type index_d$1__publicOnDataItemDeletedType as _publicOnDataItemDeletedType, type index_d$1__publicOnDataItemUpdatedType as _publicOnDataItemUpdatedType, index_d$1_aggregateDataItems as aggregateDataItems, index_d$1_bulkInsertDataItemReferences as bulkInsertDataItemReferences, index_d$1_bulkInsertDataItems as bulkInsertDataItems, index_d$1_bulkRemoveDataItemReferences as bulkRemoveDataItemReferences, index_d$1_bulkRemoveDataItems as bulkRemoveDataItems, index_d$1_bulkSaveDataItems as bulkSaveDataItems, index_d$1_bulkUpdateDataItems as bulkUpdateDataItems, index_d$1_countDataItems as countDataItems, index_d$1_getDataItem as getDataItem, index_d$1_insertDataItem as insertDataItem, index_d$1_insertDataItemReference as insertDataItemReference, index_d$1_isReferencedDataItem as isReferencedDataItem, index_d$1_onDataItemCreated as onDataItemCreated, index_d$1_onDataItemDeleted as onDataItemDeleted, index_d$1_onDataItemUpdated as onDataItemUpdated, onDataItemCreated$1 as publicOnDataItemCreated, onDataItemDeleted$1 as publicOnDataItemDeleted, onDataItemUpdated$1 as publicOnDataItemUpdated, index_d$1_queryDataItems as queryDataItems, index_d$1_queryDistinctValues as queryDistinctValues, index_d$1_queryReferencedDataItems as queryReferencedDataItems, index_d$1_removeDataItem as removeDataItem, index_d$1_removeDataItemReference as removeDataItemReference, index_d$1_replaceDataItemReferences as replaceDataItemReferences, index_d$1_saveDataItem as saveDataItem, index_d$1_truncateDataItems as truncateDataItems, index_d$1_updateDataItem as updateDataItem };
6479
+ declare global {
6480
+ interface ContextualClient {
6481
+ }
5041
6482
  }
6483
+ /**
6484
+ * A type used to create concerete types from SDK descriptors in
6485
+ * case a contextual client is available.
6486
+ */
6487
+ type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
6488
+ host: Host;
6489
+ } ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
5042
6490
 
5043
6491
  /** An index is a map of a collection's data, organized according to specific fields to increase query speed. */
5044
6492
  interface Index {
@@ -5184,6 +6632,23 @@ interface PagingMetadata {
5184
6632
  /** Flag that indicates the server failed to calculate the `total` field. */
5185
6633
  tooManyToCount?: boolean | null;
5186
6634
  }
6635
+ interface ListAvailableIndexesRequest {
6636
+ /** Data collection to show available indexes for */
6637
+ dataCollectionId?: string;
6638
+ }
6639
+ interface ListAvailableIndexesResponse {
6640
+ /**
6641
+ * limit of regular single-field indexes, even if 0 1-field indices may be created using
6642
+ * 3-field quota (if available)
6643
+ */
6644
+ regular1Field?: number;
6645
+ /** limit of regular indexes up to 3-fields (in addition to 1-field indexes quota) */
6646
+ regular3Field?: number;
6647
+ /** limit of unique indexes */
6648
+ unique1Field?: number;
6649
+ /** Overall index limit, missing value means there's no overall limit */
6650
+ total?: number | null;
6651
+ }
5187
6652
  interface FieldNonNullableFields {
5188
6653
  path: string;
5189
6654
  order: Order;
@@ -5273,6 +6738,8 @@ type index_d_Failure = Failure;
5273
6738
  type index_d_Field = Field;
5274
6739
  type index_d_Index = Index;
5275
6740
  type index_d_IndexNonNullableFields = IndexNonNullableFields;
6741
+ type index_d_ListAvailableIndexesRequest = ListAvailableIndexesRequest;
6742
+ type index_d_ListAvailableIndexesResponse = ListAvailableIndexesResponse;
5276
6743
  type index_d_ListIndexesOptions = ListIndexesOptions;
5277
6744
  type index_d_ListIndexesRequest = ListIndexesRequest;
5278
6745
  type index_d_ListIndexesResponse = ListIndexesResponse;
@@ -5287,7 +6754,7 @@ declare const index_d_createIndex: typeof createIndex;
5287
6754
  declare const index_d_dropIndex: typeof dropIndex;
5288
6755
  declare const index_d_listIndexes: typeof listIndexes;
5289
6756
  declare namespace index_d {
5290
- export { type index_d_CreateIndexRequest as CreateIndexRequest, type index_d_CreateIndexResponse as CreateIndexResponse, type index_d_CreateIndexResponseNonNullableFields as CreateIndexResponseNonNullableFields, type index_d_DropIndexRequest as DropIndexRequest, type index_d_DropIndexResponse as DropIndexResponse, index_d_Environment as Environment, type index_d_Failure as Failure, type index_d_Field as Field, type index_d_Index as Index, type index_d_IndexNonNullableFields as IndexNonNullableFields, type index_d_ListIndexesOptions as ListIndexesOptions, type index_d_ListIndexesRequest as ListIndexesRequest, type index_d_ListIndexesResponse as ListIndexesResponse, type index_d_ListIndexesResponseNonNullableFields as ListIndexesResponseNonNullableFields, index_d_Order as Order, type index_d_Paging as Paging, type index_d_PagingMetadata as PagingMetadata, index_d_Status as Status, index_d_createIndex as createIndex, index_d_dropIndex as dropIndex, index_d_listIndexes as listIndexes };
6757
+ export { type index_d_CreateIndexRequest as CreateIndexRequest, type index_d_CreateIndexResponse as CreateIndexResponse, type index_d_CreateIndexResponseNonNullableFields as CreateIndexResponseNonNullableFields, type index_d_DropIndexRequest as DropIndexRequest, type index_d_DropIndexResponse as DropIndexResponse, index_d_Environment as Environment, type index_d_Failure as Failure, type index_d_Field as Field, type index_d_Index as Index, type index_d_IndexNonNullableFields as IndexNonNullableFields, type index_d_ListAvailableIndexesRequest as ListAvailableIndexesRequest, type index_d_ListAvailableIndexesResponse as ListAvailableIndexesResponse, type index_d_ListIndexesOptions as ListIndexesOptions, type index_d_ListIndexesRequest as ListIndexesRequest, type index_d_ListIndexesResponse as ListIndexesResponse, type index_d_ListIndexesResponseNonNullableFields as ListIndexesResponseNonNullableFields, index_d_Order as Order, type index_d_Paging as Paging, type index_d_PagingMetadata as PagingMetadata, index_d_Status as Status, index_d_createIndex as createIndex, index_d_dropIndex as dropIndex, index_d_listIndexes as listIndexes };
5291
6758
  }
5292
6759
 
5293
6760
  export { index_d$2 as collections, index_d$3 as externalDatabaseConnections, index_d as indexes, index_d$1 as items };