@wix/data 1.0.180 → 1.0.182

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.
Files changed (44) hide show
  1. package/build/es/context.d.ts +1 -0
  2. package/build/es/context.js +1 -0
  3. package/build/es/context.js.map +1 -1
  4. package/build/es/index.d.ts +2 -2
  5. package/build/es/index.js +2 -2
  6. package/build/es/index.js.map +1 -1
  7. package/build/es/meta.d.ts +1 -1
  8. package/build/es/meta.js +1 -1
  9. package/build/es/meta.js.map +1 -1
  10. package/{build/cjs/context.d.ts → context.d.ts} +1 -0
  11. package/{build/cjs/context.js → context.js} +2 -1
  12. package/context.js.map +1 -0
  13. package/context.ts +4 -0
  14. package/{build/cjs/index.d.ts → index.d.ts} +2 -2
  15. package/{build/cjs/index.js → index.js} +3 -3
  16. package/index.js.map +1 -0
  17. package/index.ts +6 -0
  18. package/{build/cjs/meta.d.ts → meta.d.ts} +1 -1
  19. package/{build/cjs/meta.js → meta.js} +2 -2
  20. package/meta.js.map +1 -0
  21. package/meta.ts +4 -0
  22. package/package.json +35 -23
  23. package/service-plugins-context.js.map +1 -0
  24. package/service-plugins-context.ts +1 -0
  25. package/service-plugins.js.map +1 -0
  26. package/service-plugins.ts +1 -0
  27. package/build/cjs/context.js.map +0 -1
  28. package/build/cjs/index.js.map +0 -1
  29. package/build/cjs/meta.js.map +0 -1
  30. package/build/cjs/service-plugins-context.js.map +0 -1
  31. package/build/cjs/service-plugins.js.map +0 -1
  32. package/context/package.json +0 -7
  33. package/meta/package.json +0 -7
  34. package/service-plugins/context/package.json +0 -7
  35. package/service-plugins/package.json +0 -7
  36. package/type-bundles/context.bundle.d.ts +0 -2766
  37. package/type-bundles/index.bundle.d.ts +0 -4625
  38. package/type-bundles/meta.bundle.d.ts +0 -3346
  39. package/type-bundles/service-plugins-context.bundle.d.ts +0 -1330
  40. package/type-bundles/service-plugins.bundle.d.ts +0 -1330
  41. /package/{build/cjs/service-plugins-context.d.ts → service-plugins-context.d.ts} +0 -0
  42. /package/{build/cjs/service-plugins-context.js → service-plugins-context.js} +0 -0
  43. /package/{build/cjs/service-plugins.d.ts → service-plugins.d.ts} +0 -0
  44. /package/{build/cjs/service-plugins.js → service-plugins.js} +0 -0
@@ -1,2766 +0,0 @@
1
- type HostModule<T, H extends Host> = {
2
- __type: 'host';
3
- create(host: H): T;
4
- };
5
- type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
6
- type Host<Environment = unknown> = {
7
- channel: {
8
- observeState(callback: (props: unknown, environment: Environment) => unknown): {
9
- disconnect: () => void;
10
- } | Promise<{
11
- disconnect: () => void;
12
- }>;
13
- };
14
- environment?: Environment;
15
- /**
16
- * Optional name of the environment, use for logging
17
- */
18
- name?: string;
19
- /**
20
- * Optional bast url to use for API requests, for example `www.wixapis.com`
21
- */
22
- apiBaseUrl?: string;
23
- /**
24
- * Possible data to be provided by every host, for cross cutting concerns
25
- * like internationalization, billing, etc.
26
- */
27
- essentials?: {
28
- /**
29
- * The language of the currently viewed session
30
- */
31
- language?: string;
32
- /**
33
- * The locale of the currently viewed session
34
- */
35
- locale?: string;
36
- /**
37
- * Any headers that should be passed through to the API requests
38
- */
39
- passThroughHeaders?: Record<string, string>;
40
- };
41
- };
42
-
43
- type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
44
- interface HttpClient {
45
- request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
46
- fetchWithAuth: typeof fetch;
47
- wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
48
- getActiveToken?: () => string | undefined;
49
- }
50
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
51
- type HttpResponse<T = any> = {
52
- data: T;
53
- status: number;
54
- statusText: string;
55
- headers: any;
56
- request?: any;
57
- };
58
- type RequestOptions<_TResponse = any, Data = any> = {
59
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
60
- url: string;
61
- data?: Data;
62
- params?: URLSearchParams;
63
- } & APIMetadata;
64
- type APIMetadata = {
65
- methodFqn?: string;
66
- entityFqdn?: string;
67
- packageName?: string;
68
- };
69
- type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
70
- type EventDefinition<Payload = unknown, Type extends string = string> = {
71
- __type: 'event-definition';
72
- type: Type;
73
- isDomainEvent?: boolean;
74
- transformations?: (envelope: unknown) => Payload;
75
- __payload: Payload;
76
- };
77
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
78
- type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
79
- type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
80
-
81
- type ServicePluginMethodInput = {
82
- request: any;
83
- metadata: any;
84
- };
85
- type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
86
- type ServicePluginMethodMetadata = {
87
- name: string;
88
- primaryHttpMappingPath: string;
89
- transformations: {
90
- fromREST: (...args: unknown[]) => ServicePluginMethodInput;
91
- toREST: (...args: unknown[]) => unknown;
92
- };
93
- };
94
- type ServicePluginDefinition<Contract extends ServicePluginContract> = {
95
- __type: 'service-plugin-definition';
96
- componentType: string;
97
- methods: ServicePluginMethodMetadata[];
98
- __contract: Contract;
99
- };
100
- declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
101
- type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
102
- declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
103
-
104
- type RequestContext = {
105
- isSSR: boolean;
106
- host: string;
107
- protocol?: string;
108
- };
109
- type ResponseTransformer = (data: any, headers?: any) => any;
110
- /**
111
- * Ambassador request options types are copied mostly from AxiosRequestConfig.
112
- * They are copied and not imported to reduce the amount of dependencies (to reduce install time).
113
- * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
114
- */
115
- type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
116
- type AmbassadorRequestOptions<T = any> = {
117
- _?: T;
118
- url?: string;
119
- method?: Method;
120
- params?: any;
121
- data?: any;
122
- transformResponse?: ResponseTransformer | ResponseTransformer[];
123
- };
124
- type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
125
- __isAmbassador: boolean;
126
- };
127
- type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
128
- type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
129
-
130
- declare global {
131
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
132
- interface SymbolConstructor {
133
- readonly observable: symbol;
134
- }
135
- }
136
-
137
- declare const emptyObjectSymbol: unique symbol;
138
-
139
- /**
140
- Represents a strictly empty plain object, the `{}` value.
141
-
142
- 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)).
143
-
144
- @example
145
- ```
146
- import type {EmptyObject} from 'type-fest';
147
-
148
- // The following illustrates the problem with `{}`.
149
- const foo1: {} = {}; // Pass
150
- const foo2: {} = []; // Pass
151
- const foo3: {} = 42; // Pass
152
- const foo4: {} = {a: 1}; // Pass
153
-
154
- // With `EmptyObject` only the first case is valid.
155
- const bar1: EmptyObject = {}; // Pass
156
- const bar2: EmptyObject = 42; // Fail
157
- const bar3: EmptyObject = []; // Fail
158
- const bar4: EmptyObject = {a: 1}; // Fail
159
- ```
160
-
161
- 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}.
162
-
163
- @category Object
164
- */
165
- type EmptyObject = {[emptyObjectSymbol]?: never};
166
-
167
- /**
168
- Returns a boolean for whether the two given types are equal.
169
-
170
- @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
171
- @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
172
-
173
- Use-cases:
174
- - If you want to make a conditional branch based on the result of a comparison of two types.
175
-
176
- @example
177
- ```
178
- import type {IsEqual} from 'type-fest';
179
-
180
- // This type returns a boolean for whether the given array includes the given item.
181
- // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
182
- type Includes<Value extends readonly any[], Item> =
183
- Value extends readonly [Value[0], ...infer rest]
184
- ? IsEqual<Value[0], Item> extends true
185
- ? true
186
- : Includes<rest, Item>
187
- : false;
188
- ```
189
-
190
- @category Type Guard
191
- @category Utilities
192
- */
193
- type IsEqual<A, B> =
194
- (<G>() => G extends A ? 1 : 2) extends
195
- (<G>() => G extends B ? 1 : 2)
196
- ? true
197
- : false;
198
-
199
- /**
200
- Filter out keys from an object.
201
-
202
- Returns `never` if `Exclude` is strictly equal to `Key`.
203
- Returns `never` if `Key` extends `Exclude`.
204
- Returns `Key` otherwise.
205
-
206
- @example
207
- ```
208
- type Filtered = Filter<'foo', 'foo'>;
209
- //=> never
210
- ```
211
-
212
- @example
213
- ```
214
- type Filtered = Filter<'bar', string>;
215
- //=> never
216
- ```
217
-
218
- @example
219
- ```
220
- type Filtered = Filter<'bar', 'foo'>;
221
- //=> 'bar'
222
- ```
223
-
224
- @see {Except}
225
- */
226
- type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
227
-
228
- type ExceptOptions = {
229
- /**
230
- Disallow assigning non-specified properties.
231
-
232
- Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
233
-
234
- @default false
235
- */
236
- requireExactProps?: boolean;
237
- };
238
-
239
- /**
240
- Create a type from an object type without certain keys.
241
-
242
- We recommend setting the `requireExactProps` option to `true`.
243
-
244
- 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.
245
-
246
- 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)).
247
-
248
- @example
249
- ```
250
- import type {Except} from 'type-fest';
251
-
252
- type Foo = {
253
- a: number;
254
- b: string;
255
- };
256
-
257
- type FooWithoutA = Except<Foo, 'a'>;
258
- //=> {b: string}
259
-
260
- const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
261
- //=> errors: 'a' does not exist in type '{ b: string; }'
262
-
263
- type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
264
- //=> {a: number} & Partial<Record<"b", never>>
265
-
266
- const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
267
- //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
268
- ```
269
-
270
- @category Object
271
- */
272
- type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
273
- [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
274
- } & (Options['requireExactProps'] extends true
275
- ? Partial<Record<KeysType, never>>
276
- : {});
277
-
278
- /**
279
- Returns a boolean for whether the given type is `never`.
280
-
281
- @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
282
- @link https://stackoverflow.com/a/53984913/10292952
283
- @link https://www.zhenghao.io/posts/ts-never
284
-
285
- Useful in type utilities, such as checking if something does not occur.
286
-
287
- @example
288
- ```
289
- import type {IsNever, And} from 'type-fest';
290
-
291
- // https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
292
- type AreStringsEqual<A extends string, B extends string> =
293
- And<
294
- IsNever<Exclude<A, B>> extends true ? true : false,
295
- IsNever<Exclude<B, A>> extends true ? true : false
296
- >;
297
-
298
- type EndIfEqual<I extends string, O extends string> =
299
- AreStringsEqual<I, O> extends true
300
- ? never
301
- : void;
302
-
303
- function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
304
- if (input === output) {
305
- process.exit(0);
306
- }
307
- }
308
-
309
- endIfEqual('abc', 'abc');
310
- //=> never
311
-
312
- endIfEqual('abc', '123');
313
- //=> void
314
- ```
315
-
316
- @category Type Guard
317
- @category Utilities
318
- */
319
- type IsNever<T> = [T] extends [never] ? true : false;
320
-
321
- /**
322
- An if-else-like type that resolves depending on whether the given type is `never`.
323
-
324
- @see {@link IsNever}
325
-
326
- @example
327
- ```
328
- import type {IfNever} from 'type-fest';
329
-
330
- type ShouldBeTrue = IfNever<never>;
331
- //=> true
332
-
333
- type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
334
- //=> 'bar'
335
- ```
336
-
337
- @category Type Guard
338
- @category Utilities
339
- */
340
- type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (
341
- IsNever<T> extends true ? TypeIfNever : TypeIfNotNever
342
- );
343
-
344
- /**
345
- Extract the keys from a type where the value type of the key extends the given `Condition`.
346
-
347
- Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
348
-
349
- @example
350
- ```
351
- import type {ConditionalKeys} from 'type-fest';
352
-
353
- interface Example {
354
- a: string;
355
- b: string | number;
356
- c?: string;
357
- d: {};
358
- }
359
-
360
- type StringKeysOnly = ConditionalKeys<Example, string>;
361
- //=> 'a'
362
- ```
363
-
364
- To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
365
-
366
- @example
367
- ```
368
- import type {ConditionalKeys} from 'type-fest';
369
-
370
- type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
371
- //=> 'a' | 'c'
372
- ```
373
-
374
- @category Object
375
- */
376
- type ConditionalKeys<Base, Condition> =
377
- {
378
- // Map through all the keys of the given base type.
379
- [Key in keyof Base]-?:
380
- // Pick only keys with types extending the given `Condition` type.
381
- Base[Key] extends Condition
382
- // Retain this key
383
- // If the value for the key extends never, only include it if `Condition` also extends never
384
- ? IfNever<Base[Key], IfNever<Condition, Key, never>, Key>
385
- // Discard this key since the condition fails.
386
- : never;
387
- // Convert the produced object into a union type of the keys which passed the conditional test.
388
- }[keyof Base];
389
-
390
- /**
391
- Exclude keys from a shape that matches the given `Condition`.
392
-
393
- 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.
394
-
395
- @example
396
- ```
397
- import type {Primitive, ConditionalExcept} from 'type-fest';
398
-
399
- class Awesome {
400
- name: string;
401
- successes: number;
402
- failures: bigint;
403
-
404
- run() {}
405
- }
406
-
407
- type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
408
- //=> {run: () => void}
409
- ```
410
-
411
- @example
412
- ```
413
- import type {ConditionalExcept} from 'type-fest';
414
-
415
- interface Example {
416
- a: string;
417
- b: string | number;
418
- c: () => void;
419
- d: {};
420
- }
421
-
422
- type NonStringKeysOnly = ConditionalExcept<Example, string>;
423
- //=> {b: string | number; c: () => void; d: {}}
424
- ```
425
-
426
- @category Object
427
- */
428
- type ConditionalExcept<Base, Condition> = Except<
429
- Base,
430
- ConditionalKeys<Base, Condition>
431
- >;
432
-
433
- /**
434
- * Descriptors are objects that describe the API of a module, and the module
435
- * can either be a REST module or a host module.
436
- * This type is recursive, so it can describe nested modules.
437
- */
438
- type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
439
- [key: string]: Descriptors | PublicMetadata | any;
440
- };
441
- /**
442
- * This type takes in a descriptors object of a certain Host (including an `unknown` host)
443
- * and returns an object with the same structure, but with all descriptors replaced with their API.
444
- * Any non-descriptor properties are removed from the returned object, including descriptors that
445
- * do not match the given host (as they will not work with the given host).
446
- */
447
- type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
448
- done: T;
449
- recurse: T extends {
450
- __type: typeof SERVICE_PLUGIN_ERROR_TYPE;
451
- } ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition<any> ? BuildEventDefinition<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
452
- [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
453
- -1,
454
- 0,
455
- 1,
456
- 2,
457
- 3,
458
- 4,
459
- 5
460
- ][Depth]> : never;
461
- }, EmptyObject>;
462
- }[Depth extends -1 ? 'done' : 'recurse'];
463
- type PublicMetadata = {
464
- PACKAGE_NAME?: string;
465
- };
466
-
467
- declare global {
468
- interface ContextualClient {
469
- }
470
- }
471
- /**
472
- * A type used to create concerete types from SDK descriptors in
473
- * case a contextual client is available.
474
- */
475
- type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
476
- host: Host;
477
- } ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
478
-
479
- /** An external database connection defines a connection between an external database and a Wix site or project. */
480
- interface ExternalDatabaseConnection {
481
- /**
482
- * Name of the external database connection.
483
- * An external database connection may connect to one or more external data collections or tables.
484
- * These are represented as `connectionName/dataCollectionId`.
485
- */
486
- name?: string;
487
- /** Base URL for provisioning and managing data in the external database. For example: `https://example.com/my-external-database`. */
488
- endpoint?: string | null;
489
- /**
490
- * Settings passed to the external database connection as part of each request.
491
- * These settings can relate to authentication, tenancy, or provide any other information needed for processing a request.
492
- * Their content and structure depend on the specific requirements of the external database's API.
493
- */
494
- configuration?: Record<string, any> | null;
495
- /**
496
- * Status of the external database connection. Includes whether the connection was established successfully, and if not, the reason for the failure.
497
- * @readonly
498
- */
499
- connectionStatus?: ConnectionStatus;
500
- /**
501
- * The external database's capabilities.
502
- * @readonly
503
- */
504
- capabilities?: Capabilities;
505
- }
506
- declare enum CauseOfFailure {
507
- /** No connection failure. */
508
- NONE = "NONE",
509
- /** General communication failure. */
510
- COMMUNICATION_FAILURE = "COMMUNICATION_FAILURE",
511
- /** External database host is unreachable. */
512
- DESTINATION_HOST_UNREACHABLE = "DESTINATION_HOST_UNREACHABLE",
513
- /** Unauthorized to access the external database. */
514
- UNAUTHORIZED = "UNAUTHORIZED",
515
- /** `endpoint` is not set. */
516
- DESTINATION_ENDPOINT_NOT_DEFINED = "DESTINATION_ENDPOINT_NOT_DEFINED"
517
- }
518
- declare enum CollectionsFound {
519
- /** Attempt to connect to the external database failed, so status is unknown. */
520
- UNKNOWN = "UNKNOWN",
521
- /** External database has existing collections. */
522
- YES = "YES",
523
- /** External database does not have any existing collections. */
524
- NO = "NO"
525
- }
526
- declare enum FieldType {
527
- UNKNOWN_FIELD_TYPE = "UNKNOWN_FIELD_TYPE",
528
- TEXT = "TEXT",
529
- NUMBER = "NUMBER",
530
- DATE = "DATE",
531
- DATETIME = "DATETIME",
532
- IMAGE = "IMAGE",
533
- BOOLEAN = "BOOLEAN",
534
- DOCUMENT = "DOCUMENT",
535
- URL = "URL",
536
- RICH_TEXT = "RICH_TEXT",
537
- VIDEO = "VIDEO",
538
- ANY = "ANY",
539
- ARRAY_STRING = "ARRAY_STRING",
540
- ARRAY_DOCUMENT = "ARRAY_DOCUMENT",
541
- AUDIO = "AUDIO",
542
- TIME = "TIME",
543
- LANGUAGE = "LANGUAGE",
544
- RICH_CONTENT = "RICH_CONTENT",
545
- MEDIA_GALLERY = "MEDIA_GALLERY",
546
- ADDRESS = "ADDRESS",
547
- PAGE_LINK = "PAGE_LINK",
548
- REFERENCE = "REFERENCE",
549
- MULTI_REFERENCE = "MULTI_REFERENCE",
550
- OBJECT = "OBJECT",
551
- ARRAY = "ARRAY",
552
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
553
- LEGACY_TIME = "LEGACY_TIME",
554
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
555
- LEGACY_BOOK = "LEGACY_BOOK",
556
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
557
- LEGACY_EXTERNAL_URL = "LEGACY_EXTERNAL_URL",
558
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
559
- LEGACY_BROKEN_REFERENCE = "LEGACY_BROKEN_REFERENCE",
560
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
561
- LEGACY_IMAGE = "LEGACY_IMAGE",
562
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
563
- LEGACY_COLOR = "LEGACY_COLOR",
564
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
565
- LEGACY_EXTERNAL_VIDEO = "LEGACY_EXTERNAL_VIDEO"
566
- }
567
- interface ConnectionStatus {
568
- /** Whether the connection was established successfully. */
569
- successful?: boolean;
570
- /** Whether and why a connection attempt failed. */
571
- causeOfFailure?: CauseOfFailure;
572
- /**
573
- * Whether the external database has existing collections.
574
- * @readonly
575
- */
576
- hasCollections?: CollectionsFound;
577
- }
578
- declare enum ProtocolVersion {
579
- UNKNOWN_PROTOCOL_VERSION = "UNKNOWN_PROTOCOL_VERSION",
580
- V1 = "V1",
581
- V2 = "V2",
582
- V3 = "V3"
583
- }
584
- interface Capabilities {
585
- /** Whether the external database supports creating new collections, updating the structure of existing collections, or deleting them. */
586
- collectionModificationsSupported?: boolean;
587
- /**
588
- * Field types the external database supports.
589
- * This field only applies when `collectionModificationsSupported` is `true`.
590
- */
591
- fieldTypes?: FieldType[];
592
- }
593
- interface GetExternalDatabaseConnectionRequest {
594
- /** Name of the external database connection to retrieve. */
595
- name: string;
596
- }
597
- interface GetExternalDatabaseConnectionResponse {
598
- /** Details of the external database connection requested. */
599
- externalDatabaseConnection?: ExternalDatabaseConnection;
600
- }
601
- interface ListExternalDatabaseConnectionsRequest {
602
- /** Paging */
603
- paging?: Paging$2;
604
- }
605
- interface Paging$2 {
606
- /** Number of items to load. */
607
- limit?: number | null;
608
- /** Number of items to skip in the current sort order. */
609
- offset?: number | null;
610
- }
611
- interface ListExternalDatabaseConnectionsResponse {
612
- /** List of external database connections. */
613
- externalDatabaseConnections?: ExternalDatabaseConnection[];
614
- /** Paging metadata */
615
- pagingMetadata?: PagingMetadata$1;
616
- }
617
- interface PagingMetadata$1 {
618
- /** Number of items returned in the response. */
619
- count?: number | null;
620
- /** Offset that was requested. */
621
- offset?: number | null;
622
- /** Total number of items that match the query. */
623
- total?: number | null;
624
- /** Flag that indicates the server failed to calculate the `total` field. */
625
- tooManyToCount?: boolean | null;
626
- }
627
- interface CreateExternalDatabaseConnectionRequest {
628
- /** External database connection details. */
629
- externalDatabaseConnection: ExternalDatabaseConnection;
630
- /** Connection type. */
631
- connectionType: ConnectionType;
632
- }
633
- declare enum ConnectionType {
634
- /** Unknown connection type. */
635
- UNKNOWN_CONNECTION_TYPE = "UNKNOWN_CONNECTION_TYPE",
636
- /**
637
- * Connection to database adapter that implements legacy External Database Collections SPI (protocol version 1 or 2)
638
- * https://www.wix.com/velo/reference/spis/external-database-collections/introduction
639
- */
640
- STANDALONE = "STANDALONE",
641
- /**
642
- * Connection to database adapter that implements External Database SPI (protocol version 3)
643
- * https://dev.wix.com/docs/rest/internal-only/wix-data/external-database-spi/introduction
644
- * https://dev.wix.com/docs/rest/articles/getting-started/service-provider-interface
645
- */
646
- WIX_SPI = "WIX_SPI"
647
- }
648
- interface CreateExternalDatabaseConnectionResponse {
649
- /** Details of external database connection created. */
650
- externalDatabaseConnection?: ExternalDatabaseConnection;
651
- }
652
- interface UpdateExternalDatabaseConnectionRequest {
653
- /** Updated external database connection details. The existing connection is replaced with this version. */
654
- externalDatabaseConnection: ExternalDatabaseConnection;
655
- }
656
- interface UpdateExternalDatabaseConnectionResponse {
657
- /** Updated external database connection details. */
658
- externalDatabaseConnection?: ExternalDatabaseConnection;
659
- }
660
- interface DeleteExternalDatabaseConnectionRequest {
661
- /** Name of the external database connection to delete. */
662
- name: string;
663
- }
664
- interface DeleteExternalDatabaseConnectionResponse {
665
- }
666
- interface DomainEvent$1 extends DomainEventBodyOneOf$1 {
667
- createdEvent?: EntityCreatedEvent$1;
668
- updatedEvent?: EntityUpdatedEvent$1;
669
- deletedEvent?: EntityDeletedEvent$1;
670
- actionEvent?: ActionEvent$1;
671
- /**
672
- * Unique event ID.
673
- * Allows clients to ignore duplicate webhooks.
674
- */
675
- _id?: string;
676
- /**
677
- * Assumes actions are also always typed to an entity_type
678
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
679
- */
680
- entityFqdn?: string;
681
- /**
682
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
683
- * This is although the created/updated/deleted notion is duplication of the oneof types
684
- * Example: created/updated/deleted/started/completed/email_opened
685
- */
686
- slug?: string;
687
- /** ID of the entity associated with the event. */
688
- entityId?: string;
689
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
690
- eventTime?: Date | null;
691
- /**
692
- * Whether the event was triggered as a result of a privacy regulation application
693
- * (for example, GDPR).
694
- */
695
- triggeredByAnonymizeRequest?: boolean | null;
696
- /** If present, indicates the action that triggered the event. */
697
- originatedFrom?: string | null;
698
- /**
699
- * A sequence number defining the order of updates to the underlying entity.
700
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
701
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
702
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
703
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
704
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
705
- */
706
- entityEventSequence?: string | null;
707
- }
708
- /** @oneof */
709
- interface DomainEventBodyOneOf$1 {
710
- createdEvent?: EntityCreatedEvent$1;
711
- updatedEvent?: EntityUpdatedEvent$1;
712
- deletedEvent?: EntityDeletedEvent$1;
713
- actionEvent?: ActionEvent$1;
714
- }
715
- interface EntityCreatedEvent$1 {
716
- entity?: string;
717
- }
718
- interface RestoreInfo$1 {
719
- deletedDate?: Date | null;
720
- }
721
- interface EntityUpdatedEvent$1 {
722
- /**
723
- * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
724
- * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
725
- * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
726
- */
727
- currentEntity?: string;
728
- }
729
- interface EntityDeletedEvent$1 {
730
- /** Entity that was deleted */
731
- deletedEntity?: string | null;
732
- }
733
- interface ActionEvent$1 {
734
- body?: string;
735
- }
736
- interface MessageEnvelope$1 {
737
- /** App instance ID. */
738
- instanceId?: string | null;
739
- /** Event type. */
740
- eventType?: string;
741
- /** The identification type and identity data. */
742
- identity?: IdentificationData$1;
743
- /** Stringify payload. */
744
- data?: string;
745
- }
746
- interface IdentificationData$1 extends IdentificationDataIdOneOf$1 {
747
- /** ID of a site visitor that has not logged in to the site. */
748
- anonymousVisitorId?: string;
749
- /** ID of a site visitor that has logged in to the site. */
750
- memberId?: string;
751
- /** ID of a Wix user (site owner, contributor, etc.). */
752
- wixUserId?: string;
753
- /** ID of an app. */
754
- appId?: string;
755
- /** @readonly */
756
- identityType?: WebhookIdentityType$1;
757
- }
758
- /** @oneof */
759
- interface IdentificationDataIdOneOf$1 {
760
- /** ID of a site visitor that has not logged in to the site. */
761
- anonymousVisitorId?: string;
762
- /** ID of a site visitor that has logged in to the site. */
763
- memberId?: string;
764
- /** ID of a Wix user (site owner, contributor, etc.). */
765
- wixUserId?: string;
766
- /** ID of an app. */
767
- appId?: string;
768
- }
769
- declare enum WebhookIdentityType$1 {
770
- UNKNOWN = "UNKNOWN",
771
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
772
- MEMBER = "MEMBER",
773
- WIX_USER = "WIX_USER",
774
- APP = "APP"
775
- }
776
- interface ConnectionStatusNonNullableFields {
777
- successful: boolean;
778
- causeOfFailure: CauseOfFailure;
779
- hasCollections: CollectionsFound;
780
- }
781
- interface CapabilitiesNonNullableFields {
782
- collectionModificationsSupported: boolean;
783
- fieldTypes: FieldType[];
784
- }
785
- interface ExternalDatabaseConnectionNonNullableFields {
786
- name: string;
787
- connectionStatus?: ConnectionStatusNonNullableFields;
788
- protocolVersion: ProtocolVersion;
789
- capabilities?: CapabilitiesNonNullableFields;
790
- }
791
- interface GetExternalDatabaseConnectionResponseNonNullableFields {
792
- externalDatabaseConnection?: ExternalDatabaseConnectionNonNullableFields;
793
- }
794
- interface ListExternalDatabaseConnectionsResponseNonNullableFields {
795
- externalDatabaseConnections: ExternalDatabaseConnectionNonNullableFields[];
796
- }
797
- interface CreateExternalDatabaseConnectionResponseNonNullableFields {
798
- externalDatabaseConnection?: ExternalDatabaseConnectionNonNullableFields;
799
- }
800
- interface UpdateExternalDatabaseConnectionResponseNonNullableFields {
801
- externalDatabaseConnection?: ExternalDatabaseConnectionNonNullableFields;
802
- }
803
- interface BaseEventMetadata {
804
- /** App instance ID. */
805
- instanceId?: string | null;
806
- /** Event type. */
807
- eventType?: string;
808
- /** The identification type and identity data. */
809
- identity?: IdentificationData$1;
810
- }
811
- interface EventMetadata extends BaseEventMetadata {
812
- /**
813
- * Unique event ID.
814
- * Allows clients to ignore duplicate webhooks.
815
- */
816
- _id?: string;
817
- /**
818
- * Assumes actions are also always typed to an entity_type
819
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
820
- */
821
- entityFqdn?: string;
822
- /**
823
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
824
- * This is although the created/updated/deleted notion is duplication of the oneof types
825
- * Example: created/updated/deleted/started/completed/email_opened
826
- */
827
- slug?: string;
828
- /** ID of the entity associated with the event. */
829
- entityId?: string;
830
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
831
- eventTime?: Date | null;
832
- /**
833
- * Whether the event was triggered as a result of a privacy regulation application
834
- * (for example, GDPR).
835
- */
836
- triggeredByAnonymizeRequest?: boolean | null;
837
- /** If present, indicates the action that triggered the event. */
838
- originatedFrom?: string | null;
839
- /**
840
- * A sequence number defining the order of updates to the underlying entity.
841
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
842
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
843
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
844
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
845
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
846
- */
847
- entityEventSequence?: string | null;
848
- }
849
- interface ExternalDatabaseConnectionCreatedEnvelope {
850
- entity: ExternalDatabaseConnection;
851
- metadata: EventMetadata;
852
- }
853
- interface ExternalDatabaseConnectionDeletedEnvelope {
854
- metadata: EventMetadata;
855
- }
856
- interface ExternalDatabaseConnectionUpdatedEnvelope {
857
- entity: ExternalDatabaseConnection;
858
- metadata: EventMetadata;
859
- }
860
- interface ListExternalDatabaseConnectionsOptions {
861
- /** Paging */
862
- paging?: Paging$2;
863
- }
864
- interface CreateExternalDatabaseConnectionOptions {
865
- /** Connection type. */
866
- connectionType: ConnectionType;
867
- }
868
- interface UpdateExternalDatabaseConnection {
869
- /** Base URL for provisioning and managing data in the external database. For example: `https://example.com/my-external-database`. */
870
- endpoint?: string | null;
871
- /**
872
- * Settings passed to the external database connection as part of each request.
873
- * These settings can relate to authentication, tenancy, or provide any other information needed for processing a request.
874
- * Their content and structure depend on the specific requirements of the external database's API.
875
- */
876
- configuration?: Record<string, any> | null;
877
- /**
878
- * Status of the external database connection. Includes whether the connection was established successfully, and if not, the reason for the failure.
879
- * @readonly
880
- */
881
- connectionStatus?: ConnectionStatus;
882
- /**
883
- * The external database's capabilities.
884
- * @readonly
885
- */
886
- capabilities?: Capabilities;
887
- }
888
-
889
- declare function getExternalDatabaseConnection$1(httpClient: HttpClient): GetExternalDatabaseConnectionSignature;
890
- interface GetExternalDatabaseConnectionSignature {
891
- /**
892
- * Retrieves an external database connection by name.
893
- * @param - Name of the external database connection to retrieve.
894
- * @returns Details of the external database connection requested.
895
- */
896
- (name: string): Promise<ExternalDatabaseConnection & ExternalDatabaseConnectionNonNullableFields>;
897
- }
898
- declare function listExternalDatabaseConnections$1(httpClient: HttpClient): ListExternalDatabaseConnectionsSignature;
899
- interface ListExternalDatabaseConnectionsSignature {
900
- /**
901
- * Retrieves a list of all external database collections associated with the site or project.
902
- */
903
- (options?: ListExternalDatabaseConnectionsOptions | undefined): Promise<ListExternalDatabaseConnectionsResponse & ListExternalDatabaseConnectionsResponseNonNullableFields>;
904
- }
905
- declare function createExternalDatabaseConnection$1(httpClient: HttpClient): CreateExternalDatabaseConnectionSignature;
906
- interface CreateExternalDatabaseConnectionSignature {
907
- /**
908
- * Creates a new external database connection.
909
- *
910
- * The `externalDatabaseConnection` parameter must include a `name`, `endpoint`, and `configuration` details for the external database.
911
- * If any of these are missing, the external database connection isn't created.
912
- * @param - External database connection details.
913
- * @param - Options for creating an external database connection.
914
- * @returns Details of external database connection created.
915
- */
916
- (externalDatabaseConnection: ExternalDatabaseConnection, options: CreateExternalDatabaseConnectionOptions): Promise<ExternalDatabaseConnection & ExternalDatabaseConnectionNonNullableFields>;
917
- }
918
- declare function updateExternalDatabaseConnection$1(httpClient: HttpClient): UpdateExternalDatabaseConnectionSignature;
919
- interface UpdateExternalDatabaseConnectionSignature {
920
- /**
921
- * Updates an external database connection.
922
- *
923
- * An external database collection name must be provided in `name`.
924
- * If an existing external database connection is found with the same name, that connection's details are updated.
925
- * If no external database connection has that name, the request fails.
926
- *
927
- * > **Note:** After an external database connection is updated, it only contains the values provided in the request. All previous values are lost.
928
- * @param - Name of the external database connection.
929
- * An external database connection may connect to one or more external data collections or tables.
930
- * These are represented as `connectionName/dataCollectionId`.
931
- * @param - Options for updating an external database connection.
932
- * @param - Updated external database connection details. The existing connection is replaced with this version.
933
- * @returns Updated external database connection details.
934
- */
935
- (name: string, externalDatabaseConnection: UpdateExternalDatabaseConnection): Promise<ExternalDatabaseConnection & ExternalDatabaseConnectionNonNullableFields>;
936
- }
937
- declare function deleteExternalDatabaseConnection$1(httpClient: HttpClient): DeleteExternalDatabaseConnectionSignature;
938
- interface DeleteExternalDatabaseConnectionSignature {
939
- /**
940
- * Deletes an external database connection.
941
- *
942
- * > **Note:** Once an external database connection is deleted, it can't be restored. To reconnect the database you need to create a new external database connection.
943
- * @param - Name of the external database connection to delete.
944
- */
945
- (name: string): Promise<void>;
946
- }
947
- declare const onExternalDatabaseConnectionCreated$1: EventDefinition<ExternalDatabaseConnectionCreatedEnvelope, "wix.data.v1.external_database_connection_created">;
948
- declare const onExternalDatabaseConnectionDeleted$1: EventDefinition<ExternalDatabaseConnectionDeletedEnvelope, "wix.data.v1.external_database_connection_deleted">;
949
- declare const onExternalDatabaseConnectionUpdated$1: EventDefinition<ExternalDatabaseConnectionUpdatedEnvelope, "wix.data.v1.external_database_connection_updated">;
950
-
951
- declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
952
-
953
- declare const getExternalDatabaseConnection: MaybeContext<BuildRESTFunction<typeof getExternalDatabaseConnection$1> & typeof getExternalDatabaseConnection$1>;
954
- declare const listExternalDatabaseConnections: MaybeContext<BuildRESTFunction<typeof listExternalDatabaseConnections$1> & typeof listExternalDatabaseConnections$1>;
955
- declare const createExternalDatabaseConnection: MaybeContext<BuildRESTFunction<typeof createExternalDatabaseConnection$1> & typeof createExternalDatabaseConnection$1>;
956
- declare const updateExternalDatabaseConnection: MaybeContext<BuildRESTFunction<typeof updateExternalDatabaseConnection$1> & typeof updateExternalDatabaseConnection$1>;
957
- declare const deleteExternalDatabaseConnection: MaybeContext<BuildRESTFunction<typeof deleteExternalDatabaseConnection$1> & typeof deleteExternalDatabaseConnection$1>;
958
-
959
- type _publicOnExternalDatabaseConnectionCreatedType = typeof onExternalDatabaseConnectionCreated$1;
960
- /**
961
- * Triggered when an external database connection is created.
962
- */
963
- declare const onExternalDatabaseConnectionCreated: ReturnType<typeof createEventModule<_publicOnExternalDatabaseConnectionCreatedType>>;
964
-
965
- type _publicOnExternalDatabaseConnectionDeletedType = typeof onExternalDatabaseConnectionDeleted$1;
966
- /**
967
- * Triggered when an external database connection is deleted.
968
- */
969
- declare const onExternalDatabaseConnectionDeleted: ReturnType<typeof createEventModule<_publicOnExternalDatabaseConnectionDeletedType>>;
970
-
971
- type _publicOnExternalDatabaseConnectionUpdatedType = typeof onExternalDatabaseConnectionUpdated$1;
972
- /**
973
- * Triggered when an external database connection is updated.
974
- */
975
- declare const onExternalDatabaseConnectionUpdated: ReturnType<typeof createEventModule<_publicOnExternalDatabaseConnectionUpdatedType>>;
976
-
977
- type context$2_BaseEventMetadata = BaseEventMetadata;
978
- type context$2_Capabilities = Capabilities;
979
- type context$2_CauseOfFailure = CauseOfFailure;
980
- declare const context$2_CauseOfFailure: typeof CauseOfFailure;
981
- type context$2_CollectionsFound = CollectionsFound;
982
- declare const context$2_CollectionsFound: typeof CollectionsFound;
983
- type context$2_ConnectionStatus = ConnectionStatus;
984
- type context$2_ConnectionType = ConnectionType;
985
- declare const context$2_ConnectionType: typeof ConnectionType;
986
- type context$2_CreateExternalDatabaseConnectionOptions = CreateExternalDatabaseConnectionOptions;
987
- type context$2_CreateExternalDatabaseConnectionRequest = CreateExternalDatabaseConnectionRequest;
988
- type context$2_CreateExternalDatabaseConnectionResponse = CreateExternalDatabaseConnectionResponse;
989
- type context$2_CreateExternalDatabaseConnectionResponseNonNullableFields = CreateExternalDatabaseConnectionResponseNonNullableFields;
990
- type context$2_DeleteExternalDatabaseConnectionRequest = DeleteExternalDatabaseConnectionRequest;
991
- type context$2_DeleteExternalDatabaseConnectionResponse = DeleteExternalDatabaseConnectionResponse;
992
- type context$2_EventMetadata = EventMetadata;
993
- type context$2_ExternalDatabaseConnection = ExternalDatabaseConnection;
994
- type context$2_ExternalDatabaseConnectionCreatedEnvelope = ExternalDatabaseConnectionCreatedEnvelope;
995
- type context$2_ExternalDatabaseConnectionDeletedEnvelope = ExternalDatabaseConnectionDeletedEnvelope;
996
- type context$2_ExternalDatabaseConnectionNonNullableFields = ExternalDatabaseConnectionNonNullableFields;
997
- type context$2_ExternalDatabaseConnectionUpdatedEnvelope = ExternalDatabaseConnectionUpdatedEnvelope;
998
- type context$2_FieldType = FieldType;
999
- declare const context$2_FieldType: typeof FieldType;
1000
- type context$2_GetExternalDatabaseConnectionRequest = GetExternalDatabaseConnectionRequest;
1001
- type context$2_GetExternalDatabaseConnectionResponse = GetExternalDatabaseConnectionResponse;
1002
- type context$2_GetExternalDatabaseConnectionResponseNonNullableFields = GetExternalDatabaseConnectionResponseNonNullableFields;
1003
- type context$2_ListExternalDatabaseConnectionsOptions = ListExternalDatabaseConnectionsOptions;
1004
- type context$2_ListExternalDatabaseConnectionsRequest = ListExternalDatabaseConnectionsRequest;
1005
- type context$2_ListExternalDatabaseConnectionsResponse = ListExternalDatabaseConnectionsResponse;
1006
- type context$2_ListExternalDatabaseConnectionsResponseNonNullableFields = ListExternalDatabaseConnectionsResponseNonNullableFields;
1007
- type context$2_ProtocolVersion = ProtocolVersion;
1008
- declare const context$2_ProtocolVersion: typeof ProtocolVersion;
1009
- type context$2_UpdateExternalDatabaseConnection = UpdateExternalDatabaseConnection;
1010
- type context$2_UpdateExternalDatabaseConnectionRequest = UpdateExternalDatabaseConnectionRequest;
1011
- type context$2_UpdateExternalDatabaseConnectionResponse = UpdateExternalDatabaseConnectionResponse;
1012
- type context$2_UpdateExternalDatabaseConnectionResponseNonNullableFields = UpdateExternalDatabaseConnectionResponseNonNullableFields;
1013
- type context$2__publicOnExternalDatabaseConnectionCreatedType = _publicOnExternalDatabaseConnectionCreatedType;
1014
- type context$2__publicOnExternalDatabaseConnectionDeletedType = _publicOnExternalDatabaseConnectionDeletedType;
1015
- type context$2__publicOnExternalDatabaseConnectionUpdatedType = _publicOnExternalDatabaseConnectionUpdatedType;
1016
- declare const context$2_createExternalDatabaseConnection: typeof createExternalDatabaseConnection;
1017
- declare const context$2_deleteExternalDatabaseConnection: typeof deleteExternalDatabaseConnection;
1018
- declare const context$2_getExternalDatabaseConnection: typeof getExternalDatabaseConnection;
1019
- declare const context$2_listExternalDatabaseConnections: typeof listExternalDatabaseConnections;
1020
- declare const context$2_onExternalDatabaseConnectionCreated: typeof onExternalDatabaseConnectionCreated;
1021
- declare const context$2_onExternalDatabaseConnectionDeleted: typeof onExternalDatabaseConnectionDeleted;
1022
- declare const context$2_onExternalDatabaseConnectionUpdated: typeof onExternalDatabaseConnectionUpdated;
1023
- declare const context$2_updateExternalDatabaseConnection: typeof updateExternalDatabaseConnection;
1024
- declare namespace context$2 {
1025
- export { type ActionEvent$1 as ActionEvent, type context$2_BaseEventMetadata as BaseEventMetadata, type context$2_Capabilities as Capabilities, context$2_CauseOfFailure as CauseOfFailure, context$2_CollectionsFound as CollectionsFound, type context$2_ConnectionStatus as ConnectionStatus, context$2_ConnectionType as ConnectionType, type context$2_CreateExternalDatabaseConnectionOptions as CreateExternalDatabaseConnectionOptions, type context$2_CreateExternalDatabaseConnectionRequest as CreateExternalDatabaseConnectionRequest, type context$2_CreateExternalDatabaseConnectionResponse as CreateExternalDatabaseConnectionResponse, type context$2_CreateExternalDatabaseConnectionResponseNonNullableFields as CreateExternalDatabaseConnectionResponseNonNullableFields, type context$2_DeleteExternalDatabaseConnectionRequest as DeleteExternalDatabaseConnectionRequest, type context$2_DeleteExternalDatabaseConnectionResponse as DeleteExternalDatabaseConnectionResponse, 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 context$2_EventMetadata as EventMetadata, type context$2_ExternalDatabaseConnection as ExternalDatabaseConnection, type context$2_ExternalDatabaseConnectionCreatedEnvelope as ExternalDatabaseConnectionCreatedEnvelope, type context$2_ExternalDatabaseConnectionDeletedEnvelope as ExternalDatabaseConnectionDeletedEnvelope, type context$2_ExternalDatabaseConnectionNonNullableFields as ExternalDatabaseConnectionNonNullableFields, type context$2_ExternalDatabaseConnectionUpdatedEnvelope as ExternalDatabaseConnectionUpdatedEnvelope, context$2_FieldType as FieldType, type context$2_GetExternalDatabaseConnectionRequest as GetExternalDatabaseConnectionRequest, type context$2_GetExternalDatabaseConnectionResponse as GetExternalDatabaseConnectionResponse, type context$2_GetExternalDatabaseConnectionResponseNonNullableFields as GetExternalDatabaseConnectionResponseNonNullableFields, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type context$2_ListExternalDatabaseConnectionsOptions as ListExternalDatabaseConnectionsOptions, type context$2_ListExternalDatabaseConnectionsRequest as ListExternalDatabaseConnectionsRequest, type context$2_ListExternalDatabaseConnectionsResponse as ListExternalDatabaseConnectionsResponse, type context$2_ListExternalDatabaseConnectionsResponseNonNullableFields as ListExternalDatabaseConnectionsResponseNonNullableFields, type MessageEnvelope$1 as MessageEnvelope, type Paging$2 as Paging, type PagingMetadata$1 as PagingMetadata, context$2_ProtocolVersion as ProtocolVersion, type RestoreInfo$1 as RestoreInfo, type context$2_UpdateExternalDatabaseConnection as UpdateExternalDatabaseConnection, type context$2_UpdateExternalDatabaseConnectionRequest as UpdateExternalDatabaseConnectionRequest, type context$2_UpdateExternalDatabaseConnectionResponse as UpdateExternalDatabaseConnectionResponse, type context$2_UpdateExternalDatabaseConnectionResponseNonNullableFields as UpdateExternalDatabaseConnectionResponseNonNullableFields, WebhookIdentityType$1 as WebhookIdentityType, type context$2__publicOnExternalDatabaseConnectionCreatedType as _publicOnExternalDatabaseConnectionCreatedType, type context$2__publicOnExternalDatabaseConnectionDeletedType as _publicOnExternalDatabaseConnectionDeletedType, type context$2__publicOnExternalDatabaseConnectionUpdatedType as _publicOnExternalDatabaseConnectionUpdatedType, context$2_createExternalDatabaseConnection as createExternalDatabaseConnection, context$2_deleteExternalDatabaseConnection as deleteExternalDatabaseConnection, context$2_getExternalDatabaseConnection as getExternalDatabaseConnection, context$2_listExternalDatabaseConnections as listExternalDatabaseConnections, context$2_onExternalDatabaseConnectionCreated as onExternalDatabaseConnectionCreated, context$2_onExternalDatabaseConnectionDeleted as onExternalDatabaseConnectionDeleted, context$2_onExternalDatabaseConnectionUpdated as onExternalDatabaseConnectionUpdated, onExternalDatabaseConnectionCreated$1 as publicOnExternalDatabaseConnectionCreated, onExternalDatabaseConnectionDeleted$1 as publicOnExternalDatabaseConnectionDeleted, onExternalDatabaseConnectionUpdated$1 as publicOnExternalDatabaseConnectionUpdated, context$2_updateExternalDatabaseConnection as updateExternalDatabaseConnection };
1026
- }
1027
-
1028
- /** A data collection determines the structure of data to be stored in a database. */
1029
- interface DataCollection {
1030
- /** Collection ID. For example, `my-first-collection`. May include a namespace. */
1031
- _id?: string;
1032
- /**
1033
- * Collection type. Indicates how the collection was created and how it is stored.
1034
- * @readonly
1035
- */
1036
- collectionType?: CollectionType;
1037
- /**
1038
- * ID of the app that defined this collection. For collections defined by Wix users, this value is null.
1039
- * @readonly
1040
- */
1041
- ownerAppId?: string | null;
1042
- /**
1043
- * Maximum number of items returned in a single query, based on the underlying storage.
1044
- * Native collections have a maximum page size of 1000 for offset-based queries or 100 for cursor-based queries.
1045
- * External collections' maximum page size defaults to 50, but an external provider can set any maximum value up to 1000.
1046
- * @readonly
1047
- */
1048
- maxPageSize?: number | null;
1049
- /** Collection's display name as shown in the CMS. For example, `My First Collection`. */
1050
- displayName?: string | null;
1051
- /**
1052
- * Default item sorting order when a query doesn't specify one.
1053
- * @readonly
1054
- */
1055
- defaultDisplayOrder?: Sort;
1056
- /**
1057
- * UI-friendly namespace of the Wix app with which the data collection is associated, such as Stores or Bookings.
1058
- * Empty for all data collections not owned by Wix apps.
1059
- * @readonly
1060
- */
1061
- displayNamespace?: string | null;
1062
- /** Field whose value the CMS displays to represent the collection item when referenced in a different collection. */
1063
- displayField?: string | null;
1064
- /**
1065
- * Capabilities the collection supports.
1066
- * @readonly
1067
- */
1068
- capabilities?: CollectionCapabilities;
1069
- /** Collection's field structure. */
1070
- fields?: Field$1[];
1071
- /** Levels of permission for accessing and modifying data, defined by lowest role needed to perform each action. */
1072
- permissions?: Permissions;
1073
- /**
1074
- * Collection's current revision number, which increments each time the collection is updated. For an update operation to succeed, you must specify the latest revision number.
1075
- * @readonly
1076
- */
1077
- revision?: string | null;
1078
- /** Plugins the collection uses. Plugins apply additional capabilities to the collection or extend its functionality. */
1079
- plugins?: Plugin[];
1080
- /**
1081
- * Paging modes the collection supports. In native collections, offset-based paging is supported by default.
1082
- * @readonly
1083
- */
1084
- pagingModes?: PagingMode[];
1085
- /**
1086
- * Date the collection was created.
1087
- * @readonly
1088
- */
1089
- _createdDate?: Date | null;
1090
- /**
1091
- * Date the collection was last updated.
1092
- * @readonly
1093
- */
1094
- _updatedDate?: Date | null;
1095
- }
1096
- declare enum CollectionType {
1097
- /** User-created collection. */
1098
- NATIVE = "NATIVE",
1099
- /** [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). */
1100
- WIX_APP = "WIX_APP",
1101
- /** Collection created by a Wix Blocks app. */
1102
- BLOCKS_APP = "BLOCKS_APP",
1103
- /** Collection located in externally connected storage. */
1104
- EXTERNAL = "EXTERNAL"
1105
- }
1106
- interface Sort {
1107
- /** Field to sort by. */
1108
- fieldKey?: string;
1109
- /**
1110
- * Sort order. Use `ASC` for ascending order or `DESC` for descending order.
1111
- *
1112
- * Default: `ASC`
1113
- */
1114
- direction?: Direction;
1115
- }
1116
- declare enum Direction {
1117
- ASC = "ASC",
1118
- DESC = "DESC"
1119
- }
1120
- interface CollectionCapabilities {
1121
- /**
1122
- * Data operations the collection supports. The listed operations can be performed on data the collection contains.
1123
- *
1124
- * > **Note**: The `PATCH` and `BULK_PATCH` oeprations aren't currently supported.
1125
- */
1126
- dataOperations?: DataOperation[];
1127
- /** Collection operations supported. The listed operations can be performed on the collection itself. */
1128
- collectionOperations?: CollectionOperation[];
1129
- /** Maximum number of indexes for the collection. */
1130
- indexLimits?: IndexLimits;
1131
- }
1132
- declare enum DataOperation {
1133
- AGGREGATE = "AGGREGATE",
1134
- BULK_INSERT = "BULK_INSERT",
1135
- BULK_REMOVE = "BULK_REMOVE",
1136
- BULK_SAVE = "BULK_SAVE",
1137
- BULK_UPDATE = "BULK_UPDATE",
1138
- COUNT = "COUNT",
1139
- DISTINCT = "DISTINCT",
1140
- FIND = "FIND",
1141
- GET = "GET",
1142
- INSERT = "INSERT",
1143
- INSERT_REFERENCE = "INSERT_REFERENCE",
1144
- IS_REFERENCED = "IS_REFERENCED",
1145
- QUERY_REFERENCED = "QUERY_REFERENCED",
1146
- REMOVE = "REMOVE",
1147
- REMOVE_REFERENCE = "REMOVE_REFERENCE",
1148
- REPLACE_REFERENCES = "REPLACE_REFERENCES",
1149
- SAVE = "SAVE",
1150
- TRUNCATE = "TRUNCATE",
1151
- UPDATE = "UPDATE",
1152
- PATCH = "PATCH",
1153
- BULK_PATCH = "BULK_PATCH"
1154
- }
1155
- declare enum CollectionOperation {
1156
- /** Allows updating the collection's structure, for example adding, updating, or deleting fields. If not included, the collection's structure can't be changed. */
1157
- UPDATE = "UPDATE",
1158
- /** Allows deleting the entire collection. If not included, the collection can't be deleted. */
1159
- REMOVE = "REMOVE"
1160
- }
1161
- interface IndexLimits {
1162
- /** Maximum number of regular (non-unique) indexes allowed for this collection. */
1163
- regular?: number;
1164
- /** Maximum number of unique indexes allowed for this collection. */
1165
- unique?: number;
1166
- /** Maximum number of regular and unique indexes allowed for this collection. */
1167
- total?: number;
1168
- }
1169
- interface Field$1 extends FieldRangeValidationsOneOf {
1170
- /** Range of possible values for a numerical field. */
1171
- numberRange?: NumberRange;
1172
- /** Length range permitted for a text field. Relevant for fields that hold strings, such as those of type `TEXT` or `RICH_TEXT`. */
1173
- stringLengthRange?: StringLengthRange;
1174
- /** Array size range permitted. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`. */
1175
- arraySizeRange?: ArraySizeRange;
1176
- /** Unique identifier for the field. For example, `firstName`. */
1177
- key?: string;
1178
- /** Field's display name when displayed in the CMS. For example, `First Name`. */
1179
- displayName?: string | null;
1180
- /** Field's data type. */
1181
- type?: Type;
1182
- /** Metadata for complex data types. This property only exists for references, multi-references, objects, and arrays. */
1183
- typeMetadata?: TypeMetadata;
1184
- /**
1185
- * Whether the field is a system field.
1186
- * @readonly
1187
- */
1188
- systemField?: boolean;
1189
- /**
1190
- * Capabilities the field supports.
1191
- * @readonly
1192
- */
1193
- capabilities?: FieldCapabilities;
1194
- /** Whether the field is encrypted. */
1195
- encrypted?: boolean;
1196
- /** Field description. */
1197
- description?: string | null;
1198
- /**
1199
- * Whether the field is read-only. A read-only field can't be changed.
1200
- *
1201
- * Default: `false`
1202
- */
1203
- readOnly?: boolean | null;
1204
- /**
1205
- * Whether the field is immutable. An immutable field can be set once, but then cannot be updated.
1206
- *
1207
- * Default: `false`
1208
- */
1209
- immutable?: boolean | null;
1210
- /**
1211
- * Whether the field is required.
1212
- *
1213
- * Default: `false`
1214
- */
1215
- required?: boolean | null;
1216
- /** Additional optional plugins for the field. */
1217
- plugins?: FieldPlugin[];
1218
- }
1219
- /** @oneof */
1220
- interface FieldRangeValidationsOneOf {
1221
- /** Range of possible values for a numerical field. */
1222
- numberRange?: NumberRange;
1223
- /** Length range permitted for a text field. Relevant for fields that hold strings, such as those of type `TEXT` or `RICH_TEXT`. */
1224
- stringLengthRange?: StringLengthRange;
1225
- /** Array size range permitted. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`. */
1226
- arraySizeRange?: ArraySizeRange;
1227
- }
1228
- declare enum Type {
1229
- UNKNOWN_FIELD_TYPE = "UNKNOWN_FIELD_TYPE",
1230
- TEXT = "TEXT",
1231
- NUMBER = "NUMBER",
1232
- DATE = "DATE",
1233
- DATETIME = "DATETIME",
1234
- IMAGE = "IMAGE",
1235
- BOOLEAN = "BOOLEAN",
1236
- DOCUMENT = "DOCUMENT",
1237
- URL = "URL",
1238
- RICH_TEXT = "RICH_TEXT",
1239
- VIDEO = "VIDEO",
1240
- ANY = "ANY",
1241
- ARRAY_STRING = "ARRAY_STRING",
1242
- ARRAY_DOCUMENT = "ARRAY_DOCUMENT",
1243
- AUDIO = "AUDIO",
1244
- TIME = "TIME",
1245
- LANGUAGE = "LANGUAGE",
1246
- RICH_CONTENT = "RICH_CONTENT",
1247
- MEDIA_GALLERY = "MEDIA_GALLERY",
1248
- ADDRESS = "ADDRESS",
1249
- PAGE_LINK = "PAGE_LINK",
1250
- REFERENCE = "REFERENCE",
1251
- MULTI_REFERENCE = "MULTI_REFERENCE",
1252
- OBJECT = "OBJECT",
1253
- ARRAY = "ARRAY",
1254
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
1255
- LEGACY_TIME = "LEGACY_TIME",
1256
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
1257
- LEGACY_BOOK = "LEGACY_BOOK",
1258
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
1259
- LEGACY_EXTERNAL_URL = "LEGACY_EXTERNAL_URL",
1260
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
1261
- LEGACY_BROKEN_REFERENCE = "LEGACY_BROKEN_REFERENCE",
1262
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
1263
- LEGACY_IMAGE = "LEGACY_IMAGE",
1264
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
1265
- LEGACY_COLOR = "LEGACY_COLOR",
1266
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
1267
- LEGACY_EXTERNAL_VIDEO = "LEGACY_EXTERNAL_VIDEO"
1268
- }
1269
- interface TypeMetadata extends TypeMetadataMetadataOneOf {
1270
- /** Metadata for a reference field. */
1271
- reference?: Reference;
1272
- /** Metadata for a multi-reference field. */
1273
- multiReference?: MultiReference;
1274
- /** Metadata for an object field. */
1275
- object?: _Object;
1276
- /** Metadata for an array field. */
1277
- array?: _Array;
1278
- /** Metadata for a page link field. */
1279
- pageLink?: PageLink;
1280
- }
1281
- /** @oneof */
1282
- interface TypeMetadataMetadataOneOf {
1283
- /** Metadata for a reference field. */
1284
- reference?: Reference;
1285
- /** Metadata for a multi-reference field. */
1286
- multiReference?: MultiReference;
1287
- /** Metadata for an object field. */
1288
- object?: _Object;
1289
- /** Metadata for an array field. */
1290
- array?: _Array;
1291
- /** Metadata for a page link field. */
1292
- pageLink?: PageLink;
1293
- }
1294
- interface FieldCapabilities {
1295
- /**
1296
- * Whether the collection can be sorted by this field.
1297
- *
1298
- * Default: `false`
1299
- */
1300
- sortable?: boolean;
1301
- /** Query operators that can be used for this field. */
1302
- queryOperators?: QueryOperator[];
1303
- }
1304
- declare enum QueryOperator {
1305
- EQ = "EQ",
1306
- LT = "LT",
1307
- GT = "GT",
1308
- NE = "NE",
1309
- LTE = "LTE",
1310
- GTE = "GTE",
1311
- STARTS_WITH = "STARTS_WITH",
1312
- ENDS_WITH = "ENDS_WITH",
1313
- CONTAINS = "CONTAINS",
1314
- HAS_SOME = "HAS_SOME",
1315
- HAS_ALL = "HAS_ALL",
1316
- EXISTS = "EXISTS",
1317
- URLIZED = "URLIZED"
1318
- }
1319
- interface ObjectField {
1320
- /** Field ID. */
1321
- key?: string;
1322
- /** Display name for the field. */
1323
- displayName?: string | null;
1324
- /** Field type. */
1325
- type?: Type;
1326
- /** Metadata for complex data types. This property only exists for references, multi-references, objects, and arrays. */
1327
- typeMetadata?: TypeMetadata;
1328
- /**
1329
- * Capabilities the object field supports.
1330
- * @readonly
1331
- */
1332
- capabilities?: FieldCapabilities;
1333
- }
1334
- interface FieldsPattern {
1335
- pattern?: string;
1336
- lowercase?: boolean;
1337
- }
1338
- interface UrlizedOnlyPattern {
1339
- pattern?: string;
1340
- }
1341
- interface Calculator extends CalculatorPatternOneOf {
1342
- /** Value is calculated according to pattern, whitespaces are replaced with dash [-]. */
1343
- fieldsPattern?: FieldsPattern;
1344
- /** Value is only URL encoded. */
1345
- urlizedOnlyPattern?: UrlizedOnlyPattern;
1346
- }
1347
- /** @oneof */
1348
- interface CalculatorPatternOneOf {
1349
- /** Value is calculated according to pattern, whitespaces are replaced with dash [-]. */
1350
- fieldsPattern?: FieldsPattern;
1351
- /** Value is only URL encoded. */
1352
- urlizedOnlyPattern?: UrlizedOnlyPattern;
1353
- }
1354
- interface Reference {
1355
- /** Referenced collection ID. */
1356
- referencedCollectionId?: string;
1357
- }
1358
- interface MultiReference {
1359
- /** Referenced collection ID. */
1360
- referencedCollectionId?: string;
1361
- /** Referencing field ID. */
1362
- referencingFieldKey?: string;
1363
- /** Display name in the CMS for the referenced data. */
1364
- referencingDisplayName?: string;
1365
- }
1366
- interface _Object {
1367
- /** Fields within the object. */
1368
- fields?: ObjectField[];
1369
- }
1370
- interface _Array {
1371
- /** Element's data type. */
1372
- elementType?: Type;
1373
- /** Metadata for complex data types. This property only exists for references, multi-references, objects, and arrays. */
1374
- typeMetadata?: TypeMetadata;
1375
- }
1376
- interface PageLink {
1377
- calculator?: Calculator;
1378
- /** Defines reference to router pattern in the site document. */
1379
- linkedRouterPage?: string | null;
1380
- }
1381
- interface NumberRange {
1382
- /**
1383
- * Minimum permitted value for a numerical field.
1384
- *
1385
- * Default: No validation
1386
- */
1387
- min?: number | null;
1388
- /**
1389
- * Maximum permitted value for a numerical field.
1390
- *
1391
- * Default: No validation
1392
- */
1393
- max?: number | null;
1394
- }
1395
- interface StringLengthRange {
1396
- /**
1397
- * Minimum permitted length for a text field.
1398
- *
1399
- * Default: No validation
1400
- */
1401
- minLength?: number | null;
1402
- /**
1403
- * Maximum permitted length for a text field.
1404
- *
1405
- * Default: No validation
1406
- */
1407
- maxLength?: number | null;
1408
- }
1409
- interface ArraySizeRange {
1410
- /**
1411
- * Minimum permitted number of items in an array field. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`.
1412
- *
1413
- * Default: No validation
1414
- */
1415
- minSize?: number | null;
1416
- /**
1417
- * Maximum permitted number of items in an array field. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`.
1418
- *
1419
- * Default: No validation
1420
- */
1421
- maxSize?: number | null;
1422
- }
1423
- /** Optional plug-in aspects for fields */
1424
- interface FieldPlugin extends FieldPluginOptionsOneOf {
1425
- /** Options for the CMS plugin. */
1426
- cmsOptions?: CmsOptions;
1427
- type?: FieldPluginType;
1428
- }
1429
- /** @oneof */
1430
- interface FieldPluginOptionsOneOf {
1431
- /** Options for the CMS plugin. */
1432
- cmsOptions?: CmsOptions;
1433
- }
1434
- declare enum FieldPluginType {
1435
- /** Uknown plugin type. */
1436
- UNKNOWN = "UNKNOWN",
1437
- /** CMS-related field attributes */
1438
- CMS = "CMS"
1439
- }
1440
- /** Options for the CMS plugin. */
1441
- interface CmsOptions {
1442
- /**
1443
- * Indicates an internal CMS field. The CMS does not display internal fields.
1444
- *
1445
- * Default: `false`
1446
- */
1447
- internal?: boolean;
1448
- }
1449
- /** Permissions defined by the lowest role needed to perform each action. */
1450
- interface Permissions {
1451
- /** Lowest role needed to add a collection. */
1452
- insert?: Role;
1453
- /** Lowest role needed to update a collection. */
1454
- update?: Role;
1455
- /** Lowest role needed to remove a collection. */
1456
- remove?: Role;
1457
- /** Lowest role needed to read a collection. */
1458
- read?: Role;
1459
- }
1460
- declare enum Role {
1461
- /** Unknown role. */
1462
- UNKNOWN_ROLE = "UNKNOWN_ROLE",
1463
- /** Site administrator. */
1464
- ADMIN = "ADMIN",
1465
- /** Signed-in user who added content to this collection. */
1466
- SITE_MEMBER_AUTHOR = "SITE_MEMBER_AUTHOR",
1467
- /** Any signed-in user. */
1468
- SITE_MEMBER = "SITE_MEMBER",
1469
- /** Any site visitor. */
1470
- ANYONE = "ANYONE"
1471
- }
1472
- interface Plugin extends PluginOptionsOneOf {
1473
- /**
1474
- * Options for the Publish plugin.
1475
- * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not.
1476
- */
1477
- publishOptions?: PublishPluginOptions;
1478
- /** Options for the Single Item plugin. */
1479
- singleItemOptions?: SingleItemPluginOptions;
1480
- /** Options for the Urlized plugin. */
1481
- urlizedOptions?: UrlizedPluginOptions;
1482
- /** Options for the Multilingual plugin. */
1483
- multilingualOptions?: MultilingualOptions;
1484
- /** Options for the PageLink plugin. */
1485
- editablePageLinkOptions?: PageLinkPluginOptions;
1486
- /** Options for the CMS plugin. */
1487
- cmsOptions?: PluginCmsOptions;
1488
- /** Plugin types. */
1489
- type?: PluginType;
1490
- }
1491
- /** @oneof */
1492
- interface PluginOptionsOneOf {
1493
- /**
1494
- * Options for the Publish plugin.
1495
- * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not.
1496
- */
1497
- publishOptions?: PublishPluginOptions;
1498
- /** Options for the Single Item plugin. */
1499
- singleItemOptions?: SingleItemPluginOptions;
1500
- /** Options for the Urlized plugin. */
1501
- urlizedOptions?: UrlizedPluginOptions;
1502
- /** Options for the Multilingual plugin. */
1503
- multilingualOptions?: MultilingualOptions;
1504
- /** Options for the PageLink plugin. */
1505
- editablePageLinkOptions?: PageLinkPluginOptions;
1506
- /** Options for the CMS plugin. */
1507
- cmsOptions?: PluginCmsOptions;
1508
- }
1509
- declare enum Status$1 {
1510
- UNKNOWN_PUBLISH_PLUGIN_STATUS = "UNKNOWN_PUBLISH_PLUGIN_STATUS",
1511
- PUBLISHED = "PUBLISHED",
1512
- DRAFT = "DRAFT"
1513
- }
1514
- declare enum Format {
1515
- UNKNOWN_URLIZED_PLUGIN_FORMAT = "UNKNOWN_URLIZED_PLUGIN_FORMAT",
1516
- /** Letters are converted to lower case and spaces are replaced with dashes before generating the encoded URL. */
1517
- ORIGINAL = "ORIGINAL",
1518
- /** No changes are made before generating the encoded URL. */
1519
- PLAIN = "PLAIN"
1520
- }
1521
- /** if CMS-defined sort is enabled and should be used in site */
1522
- interface SiteSort {
1523
- /** Field and order for the site sort. */
1524
- sort?: Sort[];
1525
- }
1526
- declare enum PluginType {
1527
- /** Unknown plugin type. */
1528
- UNKNOWN_PLUGIN_TYPE = "UNKNOWN_PLUGIN_TYPE",
1529
- /** Allows items to be marked as either draft or published. For each item you can set a publishing time when the item will become visible to site visitors. */
1530
- PUBLISH = "PUBLISH",
1531
- /** Ensures the collection can have one item at most. Can only be applied to a new collection. */
1532
- SINGLE_ITEM = "SINGLE_ITEM",
1533
- /** Generates item URLs for collections used by dynamic pages. */
1534
- URLIZED = "URLIZED",
1535
- /** Deprecated. Will be removed in the future. */
1536
- GRIDAPPLESS = "GRIDAPPLESS",
1537
- /** Indicates that the collection is translatable. This allows you to manage translation for selected fields using [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual). */
1538
- MULTILINGUAL = "MULTILINGUAL",
1539
- /** Indicates that collection is shared with current site. */
1540
- SHARED = "SHARED",
1541
- /** Indicates that page link fields are persisted and can be updated. */
1542
- EDITABLE_PAGE_LINK = "EDITABLE_PAGE_LINK",
1543
- /** CMS-specific collection properties. */
1544
- CMS = "CMS"
1545
- }
1546
- interface PublishPluginOptions {
1547
- /** Default status. */
1548
- defaultStatus?: Status$1;
1549
- }
1550
- interface SingleItemPluginOptions {
1551
- /** ID of the single item in this collection. If you insert or update an item, its ID value is always changed to this. */
1552
- singleItemId?: string;
1553
- }
1554
- interface UrlizedPluginOptions {
1555
- /** Encoding method for generating a URL in ASCII characters. */
1556
- format?: Format;
1557
- }
1558
- interface MultilingualOptions {
1559
- /** IDs of fields to allow translation. */
1560
- translatableFieldKeys?: string[];
1561
- }
1562
- interface PageLinkPluginOptions {
1563
- isPersisted?: boolean;
1564
- isMutable?: boolean;
1565
- }
1566
- interface PluginCmsOptions {
1567
- /** CMS sort, applied when a collection is displayed on a site. */
1568
- siteSort?: SiteSort;
1569
- }
1570
- declare enum PagingMode {
1571
- /** Offset-based paging. */
1572
- OFFSET = "OFFSET",
1573
- /** Cursor-based paging. */
1574
- CURSOR = "CURSOR"
1575
- }
1576
- /** Data permissions defined by access level for each action. */
1577
- interface DataPermissions {
1578
- /** Access level for data items read */
1579
- itemRead?: AccessLevel;
1580
- /** Access level for data items insert */
1581
- itemInsert?: AccessLevel;
1582
- /** Access level for data items update */
1583
- itemUpdate?: AccessLevel;
1584
- /** Access level for data items removal */
1585
- itemRemove?: AccessLevel;
1586
- }
1587
- /**
1588
- * Describes who can perform certain action.
1589
- * Each level includes all levels below it (except UNDEFINED).
1590
- */
1591
- declare enum AccessLevel {
1592
- /** Not set. */
1593
- UNDEFINED = "UNDEFINED",
1594
- /** Any subject, including visitors. */
1595
- ANYONE = "ANYONE",
1596
- /** Any signed-in user (both site members and collaborators). */
1597
- SITE_MEMBER = "SITE_MEMBER",
1598
- /** Any signed-in user, but site members only have access to own items. */
1599
- SITE_MEMBER_AUTHOR = "SITE_MEMBER_AUTHOR",
1600
- /** Site collaborator that has a role with CMS Access permission. */
1601
- CMS_EDITOR = "CMS_EDITOR",
1602
- /** CMS administrators and users or roles granted with special access. */
1603
- PRIVILEGED = "PRIVILEGED"
1604
- }
1605
- interface AllowedDataPermissions {
1606
- /** If data items read permitted */
1607
- itemRead?: boolean;
1608
- /** If for data items insert permitted */
1609
- itemInsert?: boolean;
1610
- /** If data items update permitted */
1611
- itemUpdate?: boolean;
1612
- /** If data items removal permitted */
1613
- itemRemove?: boolean;
1614
- }
1615
- interface DataCollectionClonedEvent {
1616
- /** Instance ID of the collection from which the data is cloned. */
1617
- originInstanceId?: string;
1618
- /** ID of the collection from which the data is cloned. */
1619
- originId?: string;
1620
- }
1621
- interface DataCollectionChangedEvent {
1622
- /** list of new fields */
1623
- fieldsAdded?: Field$1[];
1624
- /** list of changed fields */
1625
- fieldsUpdated?: FieldUpdate[];
1626
- /** list of removed fields */
1627
- fieldsRemoved?: Field$1[];
1628
- /** list of new plugins */
1629
- pluginsAdded?: Plugin[];
1630
- /** list of changed plugins */
1631
- pluginsUpdated?: PluginUpdate[];
1632
- /** list of removed plugins */
1633
- pluginsRemoved?: Plugin[];
1634
- }
1635
- interface FieldUpdate {
1636
- /** previous state of the field */
1637
- previous?: Field$1;
1638
- /** current state of the field */
1639
- current?: Field$1;
1640
- }
1641
- interface PluginUpdate {
1642
- /** previous state of the plugin */
1643
- previous?: Plugin;
1644
- /** current state of the plugin */
1645
- current?: Plugin;
1646
- }
1647
- interface CreateDataCollectionRequest {
1648
- /** Collection details. */
1649
- collection: DataCollection;
1650
- }
1651
- interface CreateDataCollectionResponse {
1652
- /** Details of collection created. */
1653
- collection?: DataCollection;
1654
- }
1655
- interface GetDataCollectionRequest {
1656
- /** ID of the collection to retrieve. */
1657
- dataCollectionId: string;
1658
- /**
1659
- * Whether to retrieve data from the primary database instance.
1660
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
1661
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
1662
- *
1663
- * Default: `false`
1664
- */
1665
- consistentRead?: boolean;
1666
- /**
1667
- * List of specific field names to return, if empty all fields are returned.
1668
- * Affects all returned collections
1669
- */
1670
- fields?: string[];
1671
- }
1672
- declare enum Segment {
1673
- UNKNOWN_SEGMENT = "UNKNOWN_SEGMENT",
1674
- PUBLIC = "PUBLIC",
1675
- DEV = "DEV"
1676
- }
1677
- interface GetDataCollectionResponse {
1678
- /** Details of the collection requested. */
1679
- collection?: DataCollection;
1680
- /**
1681
- * Details of collections referenced by the collection requested.
1682
- * Only populated when `includeReferencedCollections` is `true` in the request.
1683
- */
1684
- referencedCollections?: DataCollection[];
1685
- }
1686
- interface ListDataCollectionsRequest {
1687
- /**
1688
- * Defines how collections in the response are sorted.
1689
- *
1690
- * Default: Ordered by ID in ascending order.
1691
- */
1692
- sort?: Sorting;
1693
- /** Pagination information. */
1694
- paging?: Paging$1;
1695
- /**
1696
- * Whether to retrieve data from the primary database instance.
1697
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
1698
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
1699
- *
1700
- * Default: `false`
1701
- */
1702
- consistentRead?: boolean;
1703
- /**
1704
- * List of specific field names to return, if empty all fields are returned.
1705
- * Affects all returned collections
1706
- */
1707
- fields?: string[];
1708
- }
1709
- interface Sorting {
1710
- /** Name of the field to sort by. */
1711
- fieldName?: string;
1712
- /** Sort order. */
1713
- order?: SortOrder;
1714
- }
1715
- declare enum SortOrder {
1716
- ASC = "ASC",
1717
- DESC = "DESC"
1718
- }
1719
- interface Paging$1 {
1720
- /** Number of items to load. */
1721
- limit?: number | null;
1722
- /** Number of items to skip in the current sort order. */
1723
- offset?: number | null;
1724
- }
1725
- interface ListDataCollectionsResponse {
1726
- /** List of collections. */
1727
- collections?: DataCollection[];
1728
- /** Paging information. */
1729
- pagingMetadata?: PagingMetadataV2;
1730
- }
1731
- interface PagingMetadataV2 {
1732
- /** Number of items returned in the response. */
1733
- count?: number | null;
1734
- /** Offset that was requested. */
1735
- offset?: number | null;
1736
- /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
1737
- total?: number | null;
1738
- /** Flag that indicates the server failed to calculate the `total` field. */
1739
- tooManyToCount?: boolean | null;
1740
- }
1741
- interface BulkGetDataCollectionsRequest {
1742
- /** IDs of the collections to retrieve. */
1743
- dataCollectionIds?: string[];
1744
- /**
1745
- * Whether to include deleted collections.
1746
- *
1747
- * Default: `false`
1748
- */
1749
- showDeletedCollections?: boolean;
1750
- /**
1751
- * Whether the returned collection list should include referenced collections.
1752
- *
1753
- * Default: `false`
1754
- */
1755
- includeReferencedCollections?: boolean;
1756
- /** Sorting preferences. */
1757
- sort?: Sorting;
1758
- /**
1759
- * Whether to retrieve data from the primary database instance.
1760
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
1761
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
1762
- *
1763
- * Default: `false`
1764
- */
1765
- consistentRead?: boolean;
1766
- /**
1767
- * List of specific field names to return, if empty all fields are returned.
1768
- * Affects all returned collections
1769
- */
1770
- fields?: string[];
1771
- }
1772
- interface BulkGetDataCollectionsResponse {
1773
- /**
1774
- * List of requested collections.
1775
- * When `include_referenced_collections` is `true` in the request, referenced collections are included here.
1776
- */
1777
- activeCollections?: DataCollection[];
1778
- /** List of requested deleted collections. Only populated when `showDeletedCollections` is true in the request. */
1779
- deletedCollections?: DataCollection[];
1780
- }
1781
- interface UpdateDataCollectionRequest {
1782
- /** Updated collection details. The existing collection is replaced with this version. */
1783
- collection: DataCollection;
1784
- }
1785
- interface UpdateDataCollectionResponse {
1786
- /** Updated collection details. */
1787
- collection?: DataCollection;
1788
- }
1789
- interface DeleteDataCollectionRequest {
1790
- /** ID of the collection to delete. */
1791
- dataCollectionId: string;
1792
- }
1793
- interface DeleteDataCollectionResponse {
1794
- }
1795
- interface RestoreDataCollectionRequest {
1796
- /** Data Collection ID to restore */
1797
- dataCollectionId?: string;
1798
- }
1799
- interface RestoreDataCollectionResponse {
1800
- /** Restored data collection */
1801
- dataCollection?: DataCollection;
1802
- }
1803
- interface CreateDataCollectionFieldRequest {
1804
- /** ID of data collection to update */
1805
- dataCollectionId?: string;
1806
- /** field to create */
1807
- field?: Field$1;
1808
- }
1809
- interface CreateDataCollectionFieldResponse {
1810
- /** updated data collection */
1811
- dataCollection?: DataCollection;
1812
- }
1813
- interface UpdateDataCollectionFieldRequest {
1814
- /** ID of data collection to update */
1815
- dataCollectionId?: string;
1816
- /** Field to update */
1817
- field?: Field$1;
1818
- }
1819
- interface UpdateDataCollectionFieldResponse {
1820
- /** updated data collection */
1821
- dataCollection?: DataCollection;
1822
- }
1823
- interface DeleteDataCollectionFieldRequest {
1824
- /** ID of data collection to update */
1825
- dataCollectionId?: string;
1826
- /** Field ID to delete */
1827
- fieldKey?: string;
1828
- }
1829
- interface DeleteDataCollectionFieldResponse {
1830
- /** updated data collection */
1831
- dataCollection?: DataCollection;
1832
- }
1833
- interface UpdateDataPermissionsRequest {
1834
- /** ID of data collections to update */
1835
- dataCollectionId?: string;
1836
- /** Data permissions to set */
1837
- dataPermissions?: DataPermissions;
1838
- }
1839
- interface UpdateDataPermissionsResponse {
1840
- /** Updated data collection */
1841
- dataCollection?: DataCollection;
1842
- }
1843
- interface BulkGetDataCollectionsPageBySnapshotsRequest {
1844
- /** Ids of schema snapshot */
1845
- snapshotIds?: string[];
1846
- /** Pagination information. */
1847
- paging?: Paging$1;
1848
- }
1849
- interface BulkGetDataCollectionsPageBySnapshotsResponse {
1850
- /** List of snapshot collection map */
1851
- snapshotCollections?: SnapshotCollection[];
1852
- /** Paging information. */
1853
- pagingMetadata?: PagingMetadataV2;
1854
- }
1855
- interface SnapshotCollection {
1856
- /** snapshot to which collection belongs */
1857
- snapshotId?: string;
1858
- /** snapshot collection */
1859
- collection?: DataCollection;
1860
- /** snapshot of collection indexes */
1861
- indexes?: Index$1[];
1862
- }
1863
- /** An index is a map of a collection's data, organized according to specific fields to increase query speed. */
1864
- interface Index$1 {
1865
- /** Name of the index. */
1866
- name?: string;
1867
- /**
1868
- * Fields for which the index is defined.
1869
- *
1870
- * Max: 3 fields (for a unique index: 1 field)
1871
- */
1872
- fields?: IndexField[];
1873
- /**
1874
- * Current status of the index.
1875
- * @readonly
1876
- */
1877
- status?: IndexStatus;
1878
- /**
1879
- * Contains details about the reasons for failure when `status` is `FAILED`.
1880
- * @readonly
1881
- */
1882
- failure?: Failure$1;
1883
- /**
1884
- * Whether the index enforces uniqueness of values in the field for which it is defined.
1885
- * If `true`, the index can have only one field.
1886
- *
1887
- * Default: `false`
1888
- */
1889
- unique?: boolean;
1890
- /**
1891
- * Whether the index ignores case.
1892
- *
1893
- * Default: `false`
1894
- */
1895
- caseInsensitive?: boolean;
1896
- }
1897
- /**
1898
- * Order determines how values are ordered in the index. This is important when
1899
- * ordering and/or range querying by indexed fields.
1900
- */
1901
- declare enum Order$1 {
1902
- ASC = "ASC",
1903
- DESC = "DESC"
1904
- }
1905
- interface IndexField {
1906
- /** Path of the field to index. For example: `title` or `options.price`. */
1907
- path?: string;
1908
- /**
1909
- * Sort order for the index. Base on how the data is regularly queried.
1910
- *
1911
- * Default: `ASC`
1912
- */
1913
- order?: Order$1;
1914
- }
1915
- declare enum IndexStatus {
1916
- /** Place holder. Never returned by the service. */
1917
- UNKNOWN = "UNKNOWN",
1918
- /** Index creation is in progress. */
1919
- BUILDING = "BUILDING",
1920
- /** Index has been successfully created and can be used in queries. */
1921
- ACTIVE = "ACTIVE",
1922
- /** Index is in the process of being dropped. */
1923
- DROPPING = "DROPPING",
1924
- /** Index has been dropped successfully. */
1925
- DROPPED = "DROPPED",
1926
- /** Index creation has failed. */
1927
- FAILED = "FAILED",
1928
- /** Index contains incorrectly indexed data. */
1929
- INVALID = "INVALID"
1930
- }
1931
- interface Failure$1 {
1932
- /**
1933
- * Error code.
1934
- * - `WDE0112`: Unknown error while building collection index.
1935
- * - `WDE0113`: Duplicate key error while building collection index.
1936
- * - `WDE0114`: Document too large while building collection index.
1937
- */
1938
- code?: string;
1939
- /** Description of the failure. */
1940
- description?: string;
1941
- /**
1942
- * ID of the data item that caused the failure.
1943
- * For example, if `unique` is `true`, the ID of an item containing a duplicate value.
1944
- */
1945
- itemId?: string | null;
1946
- }
1947
- interface CreateDataCollectionsSnapshotRequest {
1948
- }
1949
- interface CreateDataCollectionsSnapshotResponse {
1950
- /** created snapshot ID */
1951
- snapshotId?: string;
1952
- /** data collections in snapshot */
1953
- snapshotCollections?: DataCollection[];
1954
- }
1955
- interface RestoreDataCollectionsFromSnapshotRequest {
1956
- /** snapshot ID to restore */
1957
- snapshotId?: string;
1958
- /**
1959
- * collection IDs to restore, if empty – all collections would be restored
1960
- * @deprecated
1961
- * @replacedBy restoration_collections
1962
- * @targetRemovalDate 2025-12-31
1963
- */
1964
- dataCollectionIds?: string[];
1965
- /** collection to restore, if empty – all collections would be restored */
1966
- restorationCollections?: RestorationCollection[];
1967
- }
1968
- interface Destination {
1969
- /** Collection id. */
1970
- dataCollectionId?: string;
1971
- /** Display name. When not specified value is taken from the snapshot. */
1972
- displayName?: string | null;
1973
- }
1974
- interface RestorationCollection {
1975
- /** Collection ID to restore */
1976
- dataCollectionId?: string;
1977
- /**
1978
- * Destination where to restore the collection.
1979
- * When not specified destination is taken from snapshot.
1980
- */
1981
- destination?: Destination;
1982
- }
1983
- interface RestoreDataCollectionsFromSnapshotResponse {
1984
- /** restored collections */
1985
- restoredCollections?: DataCollection[];
1986
- }
1987
- interface DeleteDataCollectionsSnapshotRequest {
1988
- /** snapshot ID to delete */
1989
- snapshotId?: string;
1990
- }
1991
- interface DeleteDataCollectionsSnapshotResponse {
1992
- }
1993
- interface CreateMigratedCollectionsSnapshotRequest {
1994
- existingSnapshotId?: string;
1995
- newNamespace?: string;
1996
- existingNamespace?: string;
1997
- }
1998
- interface CreateMigratedCollectionsSnapshotResponse {
1999
- snapshotId?: string;
2000
- }
2001
- interface DomainEvent extends DomainEventBodyOneOf {
2002
- createdEvent?: EntityCreatedEvent;
2003
- updatedEvent?: EntityUpdatedEvent;
2004
- deletedEvent?: EntityDeletedEvent;
2005
- actionEvent?: ActionEvent;
2006
- /**
2007
- * Unique event ID.
2008
- * Allows clients to ignore duplicate webhooks.
2009
- */
2010
- _id?: string;
2011
- /**
2012
- * Assumes actions are also always typed to an entity_type
2013
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
2014
- */
2015
- entityFqdn?: string;
2016
- /**
2017
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
2018
- * This is although the created/updated/deleted notion is duplication of the oneof types
2019
- * Example: created/updated/deleted/started/completed/email_opened
2020
- */
2021
- slug?: string;
2022
- /** ID of the entity associated with the event. */
2023
- entityId?: string;
2024
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
2025
- eventTime?: Date | null;
2026
- /**
2027
- * Whether the event was triggered as a result of a privacy regulation application
2028
- * (for example, GDPR).
2029
- */
2030
- triggeredByAnonymizeRequest?: boolean | null;
2031
- /** If present, indicates the action that triggered the event. */
2032
- originatedFrom?: string | null;
2033
- /**
2034
- * A sequence number defining the order of updates to the underlying entity.
2035
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
2036
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
2037
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
2038
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
2039
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
2040
- */
2041
- entityEventSequence?: string | null;
2042
- }
2043
- /** @oneof */
2044
- interface DomainEventBodyOneOf {
2045
- createdEvent?: EntityCreatedEvent;
2046
- updatedEvent?: EntityUpdatedEvent;
2047
- deletedEvent?: EntityDeletedEvent;
2048
- actionEvent?: ActionEvent;
2049
- }
2050
- interface EntityCreatedEvent {
2051
- entity?: string;
2052
- }
2053
- interface RestoreInfo {
2054
- deletedDate?: Date | null;
2055
- }
2056
- interface EntityUpdatedEvent {
2057
- /**
2058
- * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
2059
- * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
2060
- * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
2061
- */
2062
- currentEntity?: string;
2063
- }
2064
- interface EntityDeletedEvent {
2065
- /** Entity that was deleted */
2066
- deletedEntity?: string | null;
2067
- }
2068
- interface ActionEvent {
2069
- body?: string;
2070
- }
2071
- interface MessageEnvelope {
2072
- /** App instance ID. */
2073
- instanceId?: string | null;
2074
- /** Event type. */
2075
- eventType?: string;
2076
- /** The identification type and identity data. */
2077
- identity?: IdentificationData;
2078
- /** Stringify payload. */
2079
- data?: string;
2080
- }
2081
- interface IdentificationData extends IdentificationDataIdOneOf {
2082
- /** ID of a site visitor that has not logged in to the site. */
2083
- anonymousVisitorId?: string;
2084
- /** ID of a site visitor that has logged in to the site. */
2085
- memberId?: string;
2086
- /** ID of a Wix user (site owner, contributor, etc.). */
2087
- wixUserId?: string;
2088
- /** ID of an app. */
2089
- appId?: string;
2090
- /** @readonly */
2091
- identityType?: WebhookIdentityType;
2092
- }
2093
- /** @oneof */
2094
- interface IdentificationDataIdOneOf {
2095
- /** ID of a site visitor that has not logged in to the site. */
2096
- anonymousVisitorId?: string;
2097
- /** ID of a site visitor that has logged in to the site. */
2098
- memberId?: string;
2099
- /** ID of a Wix user (site owner, contributor, etc.). */
2100
- wixUserId?: string;
2101
- /** ID of an app. */
2102
- appId?: string;
2103
- }
2104
- declare enum WebhookIdentityType {
2105
- UNKNOWN = "UNKNOWN",
2106
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
2107
- MEMBER = "MEMBER",
2108
- WIX_USER = "WIX_USER",
2109
- APP = "APP"
2110
- }
2111
- interface SortNonNullableFields {
2112
- fieldKey: string;
2113
- direction: Direction;
2114
- }
2115
- interface IndexLimitsNonNullableFields {
2116
- regular: number;
2117
- unique: number;
2118
- total: number;
2119
- }
2120
- interface CollectionCapabilitiesNonNullableFields {
2121
- dataOperations: DataOperation[];
2122
- collectionOperations: CollectionOperation[];
2123
- indexLimits?: IndexLimitsNonNullableFields;
2124
- }
2125
- interface ReferenceNonNullableFields {
2126
- referencedCollectionId: string;
2127
- }
2128
- interface MultiReferenceNonNullableFields {
2129
- referencedCollectionId: string;
2130
- referencingFieldKey: string;
2131
- referencingDisplayName: string;
2132
- }
2133
- interface FieldCapabilitiesNonNullableFields {
2134
- sortable: boolean;
2135
- queryOperators: QueryOperator[];
2136
- }
2137
- interface ObjectFieldNonNullableFields {
2138
- key: string;
2139
- type: Type;
2140
- typeMetadata?: TypeMetadataNonNullableFields;
2141
- capabilities?: FieldCapabilitiesNonNullableFields;
2142
- }
2143
- interface _ObjectNonNullableFields {
2144
- fields: ObjectFieldNonNullableFields[];
2145
- }
2146
- interface _ArrayNonNullableFields {
2147
- elementType: Type;
2148
- typeMetadata?: TypeMetadataNonNullableFields;
2149
- }
2150
- interface FieldsPatternNonNullableFields {
2151
- pattern: string;
2152
- lowercase: boolean;
2153
- }
2154
- interface UrlizedOnlyPatternNonNullableFields {
2155
- pattern: string;
2156
- }
2157
- interface CalculatorNonNullableFields {
2158
- fieldsPattern?: FieldsPatternNonNullableFields;
2159
- urlizedOnlyPattern?: UrlizedOnlyPatternNonNullableFields;
2160
- }
2161
- interface PageLinkNonNullableFields {
2162
- calculator?: CalculatorNonNullableFields;
2163
- }
2164
- interface TypeMetadataNonNullableFields {
2165
- reference?: ReferenceNonNullableFields;
2166
- multiReference?: MultiReferenceNonNullableFields;
2167
- object?: _ObjectNonNullableFields;
2168
- array?: _ArrayNonNullableFields;
2169
- pageLink?: PageLinkNonNullableFields;
2170
- }
2171
- interface CmsOptionsNonNullableFields {
2172
- internal: boolean;
2173
- }
2174
- interface FieldPluginNonNullableFields {
2175
- cmsOptions?: CmsOptionsNonNullableFields;
2176
- type: FieldPluginType;
2177
- }
2178
- interface FieldNonNullableFields$1 {
2179
- key: string;
2180
- type: Type;
2181
- typeMetadata?: TypeMetadataNonNullableFields;
2182
- systemField: boolean;
2183
- capabilities?: FieldCapabilitiesNonNullableFields;
2184
- encrypted: boolean;
2185
- plugins: FieldPluginNonNullableFields[];
2186
- }
2187
- interface PermissionsNonNullableFields {
2188
- insert: Role;
2189
- update: Role;
2190
- remove: Role;
2191
- read: Role;
2192
- }
2193
- interface PublishPluginOptionsNonNullableFields {
2194
- defaultStatus: Status$1;
2195
- }
2196
- interface SingleItemPluginOptionsNonNullableFields {
2197
- singleItemId: string;
2198
- }
2199
- interface UrlizedPluginOptionsNonNullableFields {
2200
- format: Format;
2201
- }
2202
- interface MultilingualOptionsNonNullableFields {
2203
- translatableFieldKeys: string[];
2204
- }
2205
- interface PageLinkPluginOptionsNonNullableFields {
2206
- isPersisted: boolean;
2207
- isMutable: boolean;
2208
- }
2209
- interface SiteSortNonNullableFields {
2210
- sort: SortNonNullableFields[];
2211
- }
2212
- interface PluginCmsOptionsNonNullableFields {
2213
- siteSort?: SiteSortNonNullableFields;
2214
- }
2215
- interface PluginNonNullableFields {
2216
- publishOptions?: PublishPluginOptionsNonNullableFields;
2217
- singleItemOptions?: SingleItemPluginOptionsNonNullableFields;
2218
- urlizedOptions?: UrlizedPluginOptionsNonNullableFields;
2219
- multilingualOptions?: MultilingualOptionsNonNullableFields;
2220
- editablePageLinkOptions?: PageLinkPluginOptionsNonNullableFields;
2221
- cmsOptions?: PluginCmsOptionsNonNullableFields;
2222
- type: PluginType;
2223
- }
2224
- interface DataPermissionsNonNullableFields {
2225
- itemRead: AccessLevel;
2226
- itemInsert: AccessLevel;
2227
- itemUpdate: AccessLevel;
2228
- itemRemove: AccessLevel;
2229
- }
2230
- interface AllowedDataPermissionsNonNullableFields {
2231
- itemRead: boolean;
2232
- itemInsert: boolean;
2233
- itemUpdate: boolean;
2234
- itemRemove: boolean;
2235
- }
2236
- interface DataCollectionNonNullableFields {
2237
- _id: string;
2238
- collectionType: CollectionType;
2239
- defaultDisplayOrder?: SortNonNullableFields;
2240
- capabilities?: CollectionCapabilitiesNonNullableFields;
2241
- fields: FieldNonNullableFields$1[];
2242
- permissions?: PermissionsNonNullableFields;
2243
- plugins: PluginNonNullableFields[];
2244
- pagingModes: PagingMode[];
2245
- dataPermissions?: DataPermissionsNonNullableFields;
2246
- allowedDataPermissions?: AllowedDataPermissionsNonNullableFields;
2247
- }
2248
- interface CreateDataCollectionResponseNonNullableFields {
2249
- collection?: DataCollectionNonNullableFields;
2250
- }
2251
- interface GetDataCollectionResponseNonNullableFields {
2252
- collection?: DataCollectionNonNullableFields;
2253
- referencedCollections: DataCollectionNonNullableFields[];
2254
- }
2255
- interface ListDataCollectionsResponseNonNullableFields {
2256
- collections: DataCollectionNonNullableFields[];
2257
- }
2258
- interface UpdateDataCollectionResponseNonNullableFields {
2259
- collection?: DataCollectionNonNullableFields;
2260
- }
2261
- interface GetDataCollectionOptions {
2262
- /**
2263
- * Whether to retrieve data from the primary database instance.
2264
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
2265
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
2266
- *
2267
- * Default: `false`
2268
- */
2269
- consistentRead?: boolean;
2270
- /**
2271
- * List of specific field names to return, if empty all fields are returned.
2272
- * Affects all returned collections
2273
- */
2274
- fields?: string[];
2275
- }
2276
- interface ListDataCollectionsOptions {
2277
- /**
2278
- * Defines how collections in the response are sorted.
2279
- *
2280
- * Default: Ordered by ID in ascending order.
2281
- */
2282
- sort?: Sorting;
2283
- /** Pagination information. */
2284
- paging?: Paging$1;
2285
- /**
2286
- * Whether to retrieve data from the primary database instance.
2287
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
2288
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
2289
- *
2290
- * Default: `false`
2291
- */
2292
- consistentRead?: boolean;
2293
- /**
2294
- * List of specific field names to return, if empty all fields are returned.
2295
- * Affects all returned collections
2296
- */
2297
- fields?: string[];
2298
- }
2299
-
2300
- declare function createDataCollection$1(httpClient: HttpClient): CreateDataCollectionSignature;
2301
- interface CreateDataCollectionSignature {
2302
- /**
2303
- * Creates a new data collection.
2304
- *
2305
- * 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.
2306
- * @param - Collection details.
2307
- * @param - Options for creating a data collection.
2308
- * @returns Details of collection created.
2309
- */
2310
- (collection: DataCollection): Promise<DataCollection & DataCollectionNonNullableFields>;
2311
- }
2312
- declare function getDataCollection$1(httpClient: HttpClient): GetDataCollectionSignature;
2313
- interface GetDataCollectionSignature {
2314
- /**
2315
- * Retrieves a data collection by ID.
2316
- * @param - ID of the collection to retrieve.
2317
- * @param - Options for retrieving a data collection.
2318
- * @returns Details of the collection requested.
2319
- */
2320
- (dataCollectionId: string, options?: GetDataCollectionOptions | undefined): Promise<DataCollection & DataCollectionNonNullableFields>;
2321
- }
2322
- declare function listDataCollections$1(httpClient: HttpClient): ListDataCollectionsSignature;
2323
- interface ListDataCollectionsSignature {
2324
- /**
2325
- * Retrieves a list of all data collections associated with the site or project.
2326
- *
2327
- * By default, the list is ordered by ID in ascending order.
2328
- * @param - Options for retrieving a list of data collections.
2329
- */
2330
- (options?: ListDataCollectionsOptions | undefined): Promise<ListDataCollectionsResponse & ListDataCollectionsResponseNonNullableFields>;
2331
- }
2332
- declare function updateDataCollection$1(httpClient: HttpClient): UpdateDataCollectionSignature;
2333
- interface UpdateDataCollectionSignature {
2334
- /**
2335
- * Updates a data collection.
2336
- *
2337
- * A collection ID, revision number, permissions, and at least 1 field must be provided within the `collection` body parameter.
2338
- * If a collection with that ID exists, and if its current `revision` number matches the one provided, it is updated.
2339
- * Otherwise, the request fails.
2340
- *
2341
- * When a collection is updated, its `updatedDate` property is changed to the current date and its `revision` property is incremented.
2342
- *
2343
- * > **Note:**
2344
- * > After a collection is updated, it only contains the properties included in the Update Data Collection request. If the existing collection has properties with values and those properties
2345
- * > aren't included in the updated collection details, their values are lost.
2346
- * @param - Updated collection details. The existing collection is replaced with this version.
2347
- * @param - Options for updating a data collection.
2348
- * @returns Updated collection details.
2349
- */
2350
- (collection: DataCollection): Promise<DataCollection & DataCollectionNonNullableFields>;
2351
- }
2352
- declare function deleteDataCollection$1(httpClient: HttpClient): DeleteDataCollectionSignature;
2353
- interface DeleteDataCollectionSignature {
2354
- /**
2355
- * Deletes a data collection.
2356
- *
2357
- * > **Note:**
2358
- * > Once a collection is deleted, it can only be restored for limited amount of time.
2359
- * @param - ID of the collection to delete.
2360
- */
2361
- (dataCollectionId: string): Promise<void>;
2362
- }
2363
-
2364
- declare const createDataCollection: MaybeContext<BuildRESTFunction<typeof createDataCollection$1> & typeof createDataCollection$1>;
2365
- declare const getDataCollection: MaybeContext<BuildRESTFunction<typeof getDataCollection$1> & typeof getDataCollection$1>;
2366
- declare const listDataCollections: MaybeContext<BuildRESTFunction<typeof listDataCollections$1> & typeof listDataCollections$1>;
2367
- declare const updateDataCollection: MaybeContext<BuildRESTFunction<typeof updateDataCollection$1> & typeof updateDataCollection$1>;
2368
- declare const deleteDataCollection: MaybeContext<BuildRESTFunction<typeof deleteDataCollection$1> & typeof deleteDataCollection$1>;
2369
-
2370
- type context$1_AccessLevel = AccessLevel;
2371
- declare const context$1_AccessLevel: typeof AccessLevel;
2372
- type context$1_ActionEvent = ActionEvent;
2373
- type context$1_AllowedDataPermissions = AllowedDataPermissions;
2374
- type context$1_ArraySizeRange = ArraySizeRange;
2375
- type context$1_BulkGetDataCollectionsPageBySnapshotsRequest = BulkGetDataCollectionsPageBySnapshotsRequest;
2376
- type context$1_BulkGetDataCollectionsPageBySnapshotsResponse = BulkGetDataCollectionsPageBySnapshotsResponse;
2377
- type context$1_BulkGetDataCollectionsRequest = BulkGetDataCollectionsRequest;
2378
- type context$1_BulkGetDataCollectionsResponse = BulkGetDataCollectionsResponse;
2379
- type context$1_Calculator = Calculator;
2380
- type context$1_CalculatorPatternOneOf = CalculatorPatternOneOf;
2381
- type context$1_CmsOptions = CmsOptions;
2382
- type context$1_CollectionCapabilities = CollectionCapabilities;
2383
- type context$1_CollectionOperation = CollectionOperation;
2384
- declare const context$1_CollectionOperation: typeof CollectionOperation;
2385
- type context$1_CollectionType = CollectionType;
2386
- declare const context$1_CollectionType: typeof CollectionType;
2387
- type context$1_CreateDataCollectionFieldRequest = CreateDataCollectionFieldRequest;
2388
- type context$1_CreateDataCollectionFieldResponse = CreateDataCollectionFieldResponse;
2389
- type context$1_CreateDataCollectionRequest = CreateDataCollectionRequest;
2390
- type context$1_CreateDataCollectionResponse = CreateDataCollectionResponse;
2391
- type context$1_CreateDataCollectionResponseNonNullableFields = CreateDataCollectionResponseNonNullableFields;
2392
- type context$1_CreateDataCollectionsSnapshotRequest = CreateDataCollectionsSnapshotRequest;
2393
- type context$1_CreateDataCollectionsSnapshotResponse = CreateDataCollectionsSnapshotResponse;
2394
- type context$1_CreateMigratedCollectionsSnapshotRequest = CreateMigratedCollectionsSnapshotRequest;
2395
- type context$1_CreateMigratedCollectionsSnapshotResponse = CreateMigratedCollectionsSnapshotResponse;
2396
- type context$1_DataCollection = DataCollection;
2397
- type context$1_DataCollectionChangedEvent = DataCollectionChangedEvent;
2398
- type context$1_DataCollectionClonedEvent = DataCollectionClonedEvent;
2399
- type context$1_DataCollectionNonNullableFields = DataCollectionNonNullableFields;
2400
- type context$1_DataOperation = DataOperation;
2401
- declare const context$1_DataOperation: typeof DataOperation;
2402
- type context$1_DataPermissions = DataPermissions;
2403
- type context$1_DeleteDataCollectionFieldRequest = DeleteDataCollectionFieldRequest;
2404
- type context$1_DeleteDataCollectionFieldResponse = DeleteDataCollectionFieldResponse;
2405
- type context$1_DeleteDataCollectionRequest = DeleteDataCollectionRequest;
2406
- type context$1_DeleteDataCollectionResponse = DeleteDataCollectionResponse;
2407
- type context$1_DeleteDataCollectionsSnapshotRequest = DeleteDataCollectionsSnapshotRequest;
2408
- type context$1_DeleteDataCollectionsSnapshotResponse = DeleteDataCollectionsSnapshotResponse;
2409
- type context$1_Destination = Destination;
2410
- type context$1_Direction = Direction;
2411
- declare const context$1_Direction: typeof Direction;
2412
- type context$1_DomainEvent = DomainEvent;
2413
- type context$1_DomainEventBodyOneOf = DomainEventBodyOneOf;
2414
- type context$1_EntityCreatedEvent = EntityCreatedEvent;
2415
- type context$1_EntityDeletedEvent = EntityDeletedEvent;
2416
- type context$1_EntityUpdatedEvent = EntityUpdatedEvent;
2417
- type context$1_FieldCapabilities = FieldCapabilities;
2418
- type context$1_FieldPlugin = FieldPlugin;
2419
- type context$1_FieldPluginOptionsOneOf = FieldPluginOptionsOneOf;
2420
- type context$1_FieldPluginType = FieldPluginType;
2421
- declare const context$1_FieldPluginType: typeof FieldPluginType;
2422
- type context$1_FieldRangeValidationsOneOf = FieldRangeValidationsOneOf;
2423
- type context$1_FieldUpdate = FieldUpdate;
2424
- type context$1_FieldsPattern = FieldsPattern;
2425
- type context$1_Format = Format;
2426
- declare const context$1_Format: typeof Format;
2427
- type context$1_GetDataCollectionOptions = GetDataCollectionOptions;
2428
- type context$1_GetDataCollectionRequest = GetDataCollectionRequest;
2429
- type context$1_GetDataCollectionResponse = GetDataCollectionResponse;
2430
- type context$1_GetDataCollectionResponseNonNullableFields = GetDataCollectionResponseNonNullableFields;
2431
- type context$1_IdentificationData = IdentificationData;
2432
- type context$1_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
2433
- type context$1_IndexField = IndexField;
2434
- type context$1_IndexLimits = IndexLimits;
2435
- type context$1_IndexStatus = IndexStatus;
2436
- declare const context$1_IndexStatus: typeof IndexStatus;
2437
- type context$1_ListDataCollectionsOptions = ListDataCollectionsOptions;
2438
- type context$1_ListDataCollectionsRequest = ListDataCollectionsRequest;
2439
- type context$1_ListDataCollectionsResponse = ListDataCollectionsResponse;
2440
- type context$1_ListDataCollectionsResponseNonNullableFields = ListDataCollectionsResponseNonNullableFields;
2441
- type context$1_MessageEnvelope = MessageEnvelope;
2442
- type context$1_MultiReference = MultiReference;
2443
- type context$1_MultilingualOptions = MultilingualOptions;
2444
- type context$1_NumberRange = NumberRange;
2445
- type context$1_ObjectField = ObjectField;
2446
- type context$1_PageLink = PageLink;
2447
- type context$1_PageLinkPluginOptions = PageLinkPluginOptions;
2448
- type context$1_PagingMetadataV2 = PagingMetadataV2;
2449
- type context$1_PagingMode = PagingMode;
2450
- declare const context$1_PagingMode: typeof PagingMode;
2451
- type context$1_Permissions = Permissions;
2452
- type context$1_Plugin = Plugin;
2453
- type context$1_PluginCmsOptions = PluginCmsOptions;
2454
- type context$1_PluginOptionsOneOf = PluginOptionsOneOf;
2455
- type context$1_PluginType = PluginType;
2456
- declare const context$1_PluginType: typeof PluginType;
2457
- type context$1_PluginUpdate = PluginUpdate;
2458
- type context$1_PublishPluginOptions = PublishPluginOptions;
2459
- type context$1_QueryOperator = QueryOperator;
2460
- declare const context$1_QueryOperator: typeof QueryOperator;
2461
- type context$1_Reference = Reference;
2462
- type context$1_RestorationCollection = RestorationCollection;
2463
- type context$1_RestoreDataCollectionRequest = RestoreDataCollectionRequest;
2464
- type context$1_RestoreDataCollectionResponse = RestoreDataCollectionResponse;
2465
- type context$1_RestoreDataCollectionsFromSnapshotRequest = RestoreDataCollectionsFromSnapshotRequest;
2466
- type context$1_RestoreDataCollectionsFromSnapshotResponse = RestoreDataCollectionsFromSnapshotResponse;
2467
- type context$1_RestoreInfo = RestoreInfo;
2468
- type context$1_Role = Role;
2469
- declare const context$1_Role: typeof Role;
2470
- type context$1_Segment = Segment;
2471
- declare const context$1_Segment: typeof Segment;
2472
- type context$1_SingleItemPluginOptions = SingleItemPluginOptions;
2473
- type context$1_SiteSort = SiteSort;
2474
- type context$1_SnapshotCollection = SnapshotCollection;
2475
- type context$1_Sort = Sort;
2476
- type context$1_SortOrder = SortOrder;
2477
- declare const context$1_SortOrder: typeof SortOrder;
2478
- type context$1_Sorting = Sorting;
2479
- type context$1_StringLengthRange = StringLengthRange;
2480
- type context$1_Type = Type;
2481
- declare const context$1_Type: typeof Type;
2482
- type context$1_TypeMetadata = TypeMetadata;
2483
- type context$1_TypeMetadataMetadataOneOf = TypeMetadataMetadataOneOf;
2484
- type context$1_UpdateDataCollectionFieldRequest = UpdateDataCollectionFieldRequest;
2485
- type context$1_UpdateDataCollectionFieldResponse = UpdateDataCollectionFieldResponse;
2486
- type context$1_UpdateDataCollectionRequest = UpdateDataCollectionRequest;
2487
- type context$1_UpdateDataCollectionResponse = UpdateDataCollectionResponse;
2488
- type context$1_UpdateDataCollectionResponseNonNullableFields = UpdateDataCollectionResponseNonNullableFields;
2489
- type context$1_UpdateDataPermissionsRequest = UpdateDataPermissionsRequest;
2490
- type context$1_UpdateDataPermissionsResponse = UpdateDataPermissionsResponse;
2491
- type context$1_UrlizedOnlyPattern = UrlizedOnlyPattern;
2492
- type context$1_UrlizedPluginOptions = UrlizedPluginOptions;
2493
- type context$1_WebhookIdentityType = WebhookIdentityType;
2494
- declare const context$1_WebhookIdentityType: typeof WebhookIdentityType;
2495
- type context$1__Array = _Array;
2496
- type context$1__Object = _Object;
2497
- declare const context$1_createDataCollection: typeof createDataCollection;
2498
- declare const context$1_deleteDataCollection: typeof deleteDataCollection;
2499
- declare const context$1_getDataCollection: typeof getDataCollection;
2500
- declare const context$1_listDataCollections: typeof listDataCollections;
2501
- declare const context$1_updateDataCollection: typeof updateDataCollection;
2502
- declare namespace context$1 {
2503
- export { context$1_AccessLevel as AccessLevel, type context$1_ActionEvent as ActionEvent, type context$1_AllowedDataPermissions as AllowedDataPermissions, type context$1_ArraySizeRange as ArraySizeRange, type context$1_BulkGetDataCollectionsPageBySnapshotsRequest as BulkGetDataCollectionsPageBySnapshotsRequest, type context$1_BulkGetDataCollectionsPageBySnapshotsResponse as BulkGetDataCollectionsPageBySnapshotsResponse, type context$1_BulkGetDataCollectionsRequest as BulkGetDataCollectionsRequest, type context$1_BulkGetDataCollectionsResponse as BulkGetDataCollectionsResponse, type context$1_Calculator as Calculator, type context$1_CalculatorPatternOneOf as CalculatorPatternOneOf, type context$1_CmsOptions as CmsOptions, type context$1_CollectionCapabilities as CollectionCapabilities, context$1_CollectionOperation as CollectionOperation, context$1_CollectionType as CollectionType, type context$1_CreateDataCollectionFieldRequest as CreateDataCollectionFieldRequest, type context$1_CreateDataCollectionFieldResponse as CreateDataCollectionFieldResponse, type context$1_CreateDataCollectionRequest as CreateDataCollectionRequest, type context$1_CreateDataCollectionResponse as CreateDataCollectionResponse, type context$1_CreateDataCollectionResponseNonNullableFields as CreateDataCollectionResponseNonNullableFields, type context$1_CreateDataCollectionsSnapshotRequest as CreateDataCollectionsSnapshotRequest, type context$1_CreateDataCollectionsSnapshotResponse as CreateDataCollectionsSnapshotResponse, type context$1_CreateMigratedCollectionsSnapshotRequest as CreateMigratedCollectionsSnapshotRequest, type context$1_CreateMigratedCollectionsSnapshotResponse as CreateMigratedCollectionsSnapshotResponse, type context$1_DataCollection as DataCollection, type context$1_DataCollectionChangedEvent as DataCollectionChangedEvent, type context$1_DataCollectionClonedEvent as DataCollectionClonedEvent, type context$1_DataCollectionNonNullableFields as DataCollectionNonNullableFields, context$1_DataOperation as DataOperation, type context$1_DataPermissions as DataPermissions, type context$1_DeleteDataCollectionFieldRequest as DeleteDataCollectionFieldRequest, type context$1_DeleteDataCollectionFieldResponse as DeleteDataCollectionFieldResponse, type context$1_DeleteDataCollectionRequest as DeleteDataCollectionRequest, type context$1_DeleteDataCollectionResponse as DeleteDataCollectionResponse, type context$1_DeleteDataCollectionsSnapshotRequest as DeleteDataCollectionsSnapshotRequest, type context$1_DeleteDataCollectionsSnapshotResponse as DeleteDataCollectionsSnapshotResponse, type context$1_Destination as Destination, context$1_Direction as Direction, type context$1_DomainEvent as DomainEvent, type context$1_DomainEventBodyOneOf as DomainEventBodyOneOf, type context$1_EntityCreatedEvent as EntityCreatedEvent, type context$1_EntityDeletedEvent as EntityDeletedEvent, type context$1_EntityUpdatedEvent as EntityUpdatedEvent, type Failure$1 as Failure, type Field$1 as Field, type context$1_FieldCapabilities as FieldCapabilities, type context$1_FieldPlugin as FieldPlugin, type context$1_FieldPluginOptionsOneOf as FieldPluginOptionsOneOf, context$1_FieldPluginType as FieldPluginType, type context$1_FieldRangeValidationsOneOf as FieldRangeValidationsOneOf, type context$1_FieldUpdate as FieldUpdate, type context$1_FieldsPattern as FieldsPattern, context$1_Format as Format, type context$1_GetDataCollectionOptions as GetDataCollectionOptions, type context$1_GetDataCollectionRequest as GetDataCollectionRequest, type context$1_GetDataCollectionResponse as GetDataCollectionResponse, type context$1_GetDataCollectionResponseNonNullableFields as GetDataCollectionResponseNonNullableFields, type context$1_IdentificationData as IdentificationData, type context$1_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type Index$1 as Index, type context$1_IndexField as IndexField, type context$1_IndexLimits as IndexLimits, context$1_IndexStatus as IndexStatus, type context$1_ListDataCollectionsOptions as ListDataCollectionsOptions, type context$1_ListDataCollectionsRequest as ListDataCollectionsRequest, type context$1_ListDataCollectionsResponse as ListDataCollectionsResponse, type context$1_ListDataCollectionsResponseNonNullableFields as ListDataCollectionsResponseNonNullableFields, type context$1_MessageEnvelope as MessageEnvelope, type context$1_MultiReference as MultiReference, type context$1_MultilingualOptions as MultilingualOptions, type context$1_NumberRange as NumberRange, type context$1_ObjectField as ObjectField, Order$1 as Order, type context$1_PageLink as PageLink, type context$1_PageLinkPluginOptions as PageLinkPluginOptions, type Paging$1 as Paging, type context$1_PagingMetadataV2 as PagingMetadataV2, context$1_PagingMode as PagingMode, type context$1_Permissions as Permissions, type context$1_Plugin as Plugin, type context$1_PluginCmsOptions as PluginCmsOptions, type context$1_PluginOptionsOneOf as PluginOptionsOneOf, context$1_PluginType as PluginType, type context$1_PluginUpdate as PluginUpdate, type context$1_PublishPluginOptions as PublishPluginOptions, context$1_QueryOperator as QueryOperator, type context$1_Reference as Reference, type context$1_RestorationCollection as RestorationCollection, type context$1_RestoreDataCollectionRequest as RestoreDataCollectionRequest, type context$1_RestoreDataCollectionResponse as RestoreDataCollectionResponse, type context$1_RestoreDataCollectionsFromSnapshotRequest as RestoreDataCollectionsFromSnapshotRequest, type context$1_RestoreDataCollectionsFromSnapshotResponse as RestoreDataCollectionsFromSnapshotResponse, type context$1_RestoreInfo as RestoreInfo, context$1_Role as Role, context$1_Segment as Segment, type context$1_SingleItemPluginOptions as SingleItemPluginOptions, type context$1_SiteSort as SiteSort, type context$1_SnapshotCollection as SnapshotCollection, type context$1_Sort as Sort, context$1_SortOrder as SortOrder, type context$1_Sorting as Sorting, Status$1 as Status, type context$1_StringLengthRange as StringLengthRange, context$1_Type as Type, type context$1_TypeMetadata as TypeMetadata, type context$1_TypeMetadataMetadataOneOf as TypeMetadataMetadataOneOf, type context$1_UpdateDataCollectionFieldRequest as UpdateDataCollectionFieldRequest, type context$1_UpdateDataCollectionFieldResponse as UpdateDataCollectionFieldResponse, type context$1_UpdateDataCollectionRequest as UpdateDataCollectionRequest, type context$1_UpdateDataCollectionResponse as UpdateDataCollectionResponse, type context$1_UpdateDataCollectionResponseNonNullableFields as UpdateDataCollectionResponseNonNullableFields, type context$1_UpdateDataPermissionsRequest as UpdateDataPermissionsRequest, type context$1_UpdateDataPermissionsResponse as UpdateDataPermissionsResponse, type context$1_UrlizedOnlyPattern as UrlizedOnlyPattern, type context$1_UrlizedPluginOptions as UrlizedPluginOptions, context$1_WebhookIdentityType as WebhookIdentityType, type context$1__Array as _Array, type context$1__Object as _Object, context$1_createDataCollection as createDataCollection, context$1_deleteDataCollection as deleteDataCollection, context$1_getDataCollection as getDataCollection, context$1_listDataCollections as listDataCollections, context$1_updateDataCollection as updateDataCollection };
2504
- }
2505
-
2506
- /** An index is a map of a collection's data, organized according to specific fields to increase query speed. */
2507
- interface Index {
2508
- /** Name of the index. */
2509
- name?: string;
2510
- /**
2511
- * Fields for which the index is defined.
2512
- *
2513
- * Max: 3 fields (for a unique index: 1 field)
2514
- */
2515
- fields?: Field[];
2516
- /**
2517
- * Current status of the index.
2518
- * @readonly
2519
- */
2520
- status?: Status;
2521
- /**
2522
- * Contains details about the reasons for failure when `status` is `FAILED`.
2523
- * @readonly
2524
- */
2525
- failure?: Failure;
2526
- /**
2527
- * Whether the index enforces uniqueness of values in the field for which it is defined.
2528
- * If `true`, the index can have only one field.
2529
- *
2530
- * Default: `false`
2531
- */
2532
- unique?: boolean;
2533
- /**
2534
- * Whether the index ignores case.
2535
- *
2536
- * Default: `false`
2537
- */
2538
- caseInsensitive?: boolean;
2539
- }
2540
- /**
2541
- * Order determines how values are ordered in the index. This is important when
2542
- * ordering and/or range querying by indexed fields.
2543
- */
2544
- declare enum Order {
2545
- ASC = "ASC",
2546
- DESC = "DESC"
2547
- }
2548
- interface Field {
2549
- /** Path of the field to index. For example: `title` or `options.price`. */
2550
- path?: string;
2551
- /**
2552
- * Sort order for the index. Base on how the data is regularly queried.
2553
- *
2554
- * Default: `ASC`
2555
- */
2556
- order?: Order;
2557
- }
2558
- declare enum Status {
2559
- /** Place holder. Never returned by the service. */
2560
- UNKNOWN = "UNKNOWN",
2561
- /** Index creation is in progress. */
2562
- BUILDING = "BUILDING",
2563
- /** Index has been successfully created and can be used in queries. */
2564
- ACTIVE = "ACTIVE",
2565
- /** Index is in the process of being dropped. */
2566
- DROPPING = "DROPPING",
2567
- /** Index has been dropped successfully. */
2568
- DROPPED = "DROPPED",
2569
- /** Index creation has failed. */
2570
- FAILED = "FAILED",
2571
- /** Index contains incorrectly indexed data. */
2572
- INVALID = "INVALID"
2573
- }
2574
- interface Failure {
2575
- /**
2576
- * Error code.
2577
- * - `WDE0112`: Unknown error while building collection index.
2578
- * - `WDE0113`: Duplicate key error while building collection index.
2579
- * - `WDE0114`: Document too large while building collection index.
2580
- */
2581
- code?: string;
2582
- /** Description of the failure. */
2583
- description?: string;
2584
- /**
2585
- * ID of the data item that caused the failure.
2586
- * For example, if `unique` is `true`, the ID of an item containing a duplicate value.
2587
- */
2588
- itemId?: string | null;
2589
- }
2590
- interface CreateIndexRequest {
2591
- /** Details of the index to be created. */
2592
- index: Index;
2593
- /** ID of the data collection for which to generate the index. */
2594
- dataCollectionId: string;
2595
- }
2596
- declare enum Environment {
2597
- LIVE = "LIVE",
2598
- SANDBOX = "SANDBOX",
2599
- SANDBOX_PREFERRED = "SANDBOX_PREFERRED"
2600
- }
2601
- interface CreateIndexResponse {
2602
- /** Details of the index being generated. */
2603
- index?: Index;
2604
- }
2605
- interface DropIndexRequest {
2606
- /** Name of the index to drop. */
2607
- indexName: string;
2608
- /** ID of the data collection for which the index to be dropped is defined. */
2609
- dataCollectionId: string;
2610
- }
2611
- interface DropIndexResponse {
2612
- }
2613
- interface ListIndexesRequest {
2614
- /** ID of the data collection for which to list indexes. */
2615
- dataCollectionId: string;
2616
- /** Paging options to limit and skip the number of items. */
2617
- paging?: Paging;
2618
- }
2619
- interface Paging {
2620
- /** Number of items to load. */
2621
- limit?: number | null;
2622
- /** Number of items to skip in the current sort order. */
2623
- offset?: number | null;
2624
- }
2625
- interface ListIndexesResponse {
2626
- /** List of all indexes for the requested data collection. */
2627
- indexes?: Index[];
2628
- /** Paging metadata. */
2629
- pagingMetadata?: PagingMetadata;
2630
- }
2631
- interface PagingMetadata {
2632
- /** Number of items returned in the response. */
2633
- count?: number | null;
2634
- /** Offset that was requested. */
2635
- offset?: number | null;
2636
- /** Total number of items that match the query. */
2637
- total?: number | null;
2638
- /** Flag that indicates the server failed to calculate the `total` field. */
2639
- tooManyToCount?: boolean | null;
2640
- }
2641
- interface ListAvailableIndexesRequest {
2642
- /** Data collection to show available indexes for */
2643
- dataCollectionId?: string;
2644
- }
2645
- interface ListAvailableIndexesResponse {
2646
- /**
2647
- * limit of regular single-field indexes, even if 0 1-field indices may be created using
2648
- * 3-field quota (if available)
2649
- */
2650
- regular1Field?: number;
2651
- /** limit of regular indexes up to 3-fields (in addition to 1-field indexes quota) */
2652
- regular3Field?: number;
2653
- /** limit of unique indexes */
2654
- unique1Field?: number;
2655
- /** Overall index limit, missing value means there's no overall limit */
2656
- total?: number | null;
2657
- }
2658
- interface FieldNonNullableFields {
2659
- path: string;
2660
- order: Order;
2661
- }
2662
- interface FailureNonNullableFields {
2663
- code: string;
2664
- broadCode: string;
2665
- description: string;
2666
- }
2667
- interface IndexNonNullableFields {
2668
- name: string;
2669
- fields: FieldNonNullableFields[];
2670
- status: Status;
2671
- failure?: FailureNonNullableFields;
2672
- unique: boolean;
2673
- caseInsensitive: boolean;
2674
- }
2675
- interface CreateIndexResponseNonNullableFields {
2676
- index?: IndexNonNullableFields;
2677
- }
2678
- interface ListIndexesResponseNonNullableFields {
2679
- indexes: IndexNonNullableFields[];
2680
- }
2681
- interface ListIndexesOptions {
2682
- /** Paging options to limit and skip the number of items. */
2683
- paging?: Paging;
2684
- }
2685
-
2686
- declare function createIndex$1(httpClient: HttpClient): CreateIndexSignature;
2687
- interface CreateIndexSignature {
2688
- /**
2689
- * Creates an index for a data collection.
2690
- *
2691
- * The index can't be used immediately, as the process of generating the index takes time.
2692
- * You can check whether an index is ready by calling List Indexes.
2693
- *
2694
- * Note that when an index fails to create, the failed index still occupies a slot.
2695
- * To remove the failed index and free up the slot for a new index, call Drop Index.
2696
- * @param - ID of the data collection for which to generate the index.
2697
- * @param - Details of the index to be created.
2698
- * @param - Options for creating an index.
2699
- * @returns Details of the index being generated.
2700
- */
2701
- (dataCollectionId: string, index: Index): Promise<Index & IndexNonNullableFields>;
2702
- }
2703
- declare function dropIndex$1(httpClient: HttpClient): DropIndexSignature;
2704
- interface DropIndexSignature {
2705
- /**
2706
- * Removes an index from a data collection.
2707
- *
2708
- * The process of dropping an index from a collection takes time.
2709
- * You can check whether an index has been dropped by calling List Indexes.
2710
- * @param - ID of the data collection for which the index to be dropped is defined.
2711
- * @param - Name of the index to drop.
2712
- * @param - Options for dropping an index.
2713
- */
2714
- (dataCollectionId: string, indexName: string): Promise<void>;
2715
- }
2716
- declare function listIndexes$1(httpClient: HttpClient): ListIndexesSignature;
2717
- interface ListIndexesSignature {
2718
- /**
2719
- * Lists all indexes defined for a data collection.
2720
- *
2721
- * When an index's status is `ACTIVE`, it is ready to use.
2722
- * While it is still being created, its status is `BUILDING`.
2723
- *
2724
- * When an index's status is `DROPPED`, it has been dropped successfully.
2725
- * While it is still in the process of being removed, its status is `DROPPING`.
2726
- * @param - ID of the data collection for which to list indexes.
2727
- * @param - Options for retrieving a list of indexes.
2728
- */
2729
- (dataCollectionId: string, options?: ListIndexesOptions | undefined): Promise<ListIndexesResponse & ListIndexesResponseNonNullableFields>;
2730
- }
2731
-
2732
- declare const createIndex: MaybeContext<BuildRESTFunction<typeof createIndex$1> & typeof createIndex$1>;
2733
- declare const dropIndex: MaybeContext<BuildRESTFunction<typeof dropIndex$1> & typeof dropIndex$1>;
2734
- declare const listIndexes: MaybeContext<BuildRESTFunction<typeof listIndexes$1> & typeof listIndexes$1>;
2735
-
2736
- type context_CreateIndexRequest = CreateIndexRequest;
2737
- type context_CreateIndexResponse = CreateIndexResponse;
2738
- type context_CreateIndexResponseNonNullableFields = CreateIndexResponseNonNullableFields;
2739
- type context_DropIndexRequest = DropIndexRequest;
2740
- type context_DropIndexResponse = DropIndexResponse;
2741
- type context_Environment = Environment;
2742
- declare const context_Environment: typeof Environment;
2743
- type context_Failure = Failure;
2744
- type context_Field = Field;
2745
- type context_Index = Index;
2746
- type context_IndexNonNullableFields = IndexNonNullableFields;
2747
- type context_ListAvailableIndexesRequest = ListAvailableIndexesRequest;
2748
- type context_ListAvailableIndexesResponse = ListAvailableIndexesResponse;
2749
- type context_ListIndexesOptions = ListIndexesOptions;
2750
- type context_ListIndexesRequest = ListIndexesRequest;
2751
- type context_ListIndexesResponse = ListIndexesResponse;
2752
- type context_ListIndexesResponseNonNullableFields = ListIndexesResponseNonNullableFields;
2753
- type context_Order = Order;
2754
- declare const context_Order: typeof Order;
2755
- type context_Paging = Paging;
2756
- type context_PagingMetadata = PagingMetadata;
2757
- type context_Status = Status;
2758
- declare const context_Status: typeof Status;
2759
- declare const context_createIndex: typeof createIndex;
2760
- declare const context_dropIndex: typeof dropIndex;
2761
- declare const context_listIndexes: typeof listIndexes;
2762
- declare namespace context {
2763
- export { type context_CreateIndexRequest as CreateIndexRequest, type context_CreateIndexResponse as CreateIndexResponse, type context_CreateIndexResponseNonNullableFields as CreateIndexResponseNonNullableFields, type context_DropIndexRequest as DropIndexRequest, type context_DropIndexResponse as DropIndexResponse, context_Environment as Environment, type context_Failure as Failure, type context_Field as Field, type context_Index as Index, type context_IndexNonNullableFields as IndexNonNullableFields, type context_ListAvailableIndexesRequest as ListAvailableIndexesRequest, type context_ListAvailableIndexesResponse as ListAvailableIndexesResponse, type context_ListIndexesOptions as ListIndexesOptions, type context_ListIndexesRequest as ListIndexesRequest, type context_ListIndexesResponse as ListIndexesResponse, type context_ListIndexesResponseNonNullableFields as ListIndexesResponseNonNullableFields, context_Order as Order, type context_Paging as Paging, type context_PagingMetadata as PagingMetadata, context_Status as Status, context_createIndex as createIndex, context_dropIndex as dropIndex, context_listIndexes as listIndexes };
2764
- }
2765
-
2766
- export { context$1 as collections, context$2 as externalDatabaseConnections, context as indexes };