@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,3346 +0,0 @@
1
- /** An external database connection defines a connection between an external database and a Wix site or project. */
2
- interface ExternalDatabaseConnection$1 {
3
- /**
4
- * Name of the external database connection.
5
- * An external database connection may connect to one or more external data collections or tables.
6
- * These are represented as `connectionName/dataCollectionId`.
7
- */
8
- name?: string;
9
- /** Base URL for provisioning and managing data in the external database. For example: `https://example.com/my-external-database`. */
10
- endpoint?: string | null;
11
- /**
12
- * Settings passed to the external database connection as part of each request.
13
- * These settings can relate to authentication, tenancy, or provide any other information needed for processing a request.
14
- * Their content and structure depend on the specific requirements of the external database's API.
15
- */
16
- configuration?: Record<string, any> | null;
17
- /**
18
- * Status of the external database connection. Includes whether the connection was established successfully, and if not, the reason for the failure.
19
- * @readonly
20
- */
21
- connectionStatus?: ConnectionStatus$1;
22
- /**
23
- * The external database's capabilities.
24
- * @readonly
25
- */
26
- capabilities?: Capabilities$1;
27
- }
28
- declare enum CauseOfFailure$1 {
29
- /** No connection failure. */
30
- NONE = "NONE",
31
- /** General communication failure. */
32
- COMMUNICATION_FAILURE = "COMMUNICATION_FAILURE",
33
- /** External database host is unreachable. */
34
- DESTINATION_HOST_UNREACHABLE = "DESTINATION_HOST_UNREACHABLE",
35
- /** Unauthorized to access the external database. */
36
- UNAUTHORIZED = "UNAUTHORIZED",
37
- /** `endpoint` is not set. */
38
- DESTINATION_ENDPOINT_NOT_DEFINED = "DESTINATION_ENDPOINT_NOT_DEFINED"
39
- }
40
- declare enum CollectionsFound$1 {
41
- /** Attempt to connect to the external database failed, so status is unknown. */
42
- UNKNOWN = "UNKNOWN",
43
- /** External database has existing collections. */
44
- YES = "YES",
45
- /** External database does not have any existing collections. */
46
- NO = "NO"
47
- }
48
- declare enum FieldType$1 {
49
- UNKNOWN_FIELD_TYPE = "UNKNOWN_FIELD_TYPE",
50
- TEXT = "TEXT",
51
- NUMBER = "NUMBER",
52
- DATE = "DATE",
53
- DATETIME = "DATETIME",
54
- IMAGE = "IMAGE",
55
- BOOLEAN = "BOOLEAN",
56
- DOCUMENT = "DOCUMENT",
57
- URL = "URL",
58
- RICH_TEXT = "RICH_TEXT",
59
- VIDEO = "VIDEO",
60
- ANY = "ANY",
61
- ARRAY_STRING = "ARRAY_STRING",
62
- ARRAY_DOCUMENT = "ARRAY_DOCUMENT",
63
- AUDIO = "AUDIO",
64
- TIME = "TIME",
65
- LANGUAGE = "LANGUAGE",
66
- RICH_CONTENT = "RICH_CONTENT",
67
- MEDIA_GALLERY = "MEDIA_GALLERY",
68
- ADDRESS = "ADDRESS",
69
- PAGE_LINK = "PAGE_LINK",
70
- REFERENCE = "REFERENCE",
71
- MULTI_REFERENCE = "MULTI_REFERENCE",
72
- OBJECT = "OBJECT",
73
- ARRAY = "ARRAY",
74
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
75
- LEGACY_TIME = "LEGACY_TIME",
76
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
77
- LEGACY_BOOK = "LEGACY_BOOK",
78
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
79
- LEGACY_EXTERNAL_URL = "LEGACY_EXTERNAL_URL",
80
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
81
- LEGACY_BROKEN_REFERENCE = "LEGACY_BROKEN_REFERENCE",
82
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
83
- LEGACY_IMAGE = "LEGACY_IMAGE",
84
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
85
- LEGACY_COLOR = "LEGACY_COLOR",
86
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
87
- LEGACY_EXTERNAL_VIDEO = "LEGACY_EXTERNAL_VIDEO"
88
- }
89
- interface ConnectionStatus$1 {
90
- /** Whether the connection was established successfully. */
91
- successful?: boolean;
92
- /** Whether and why a connection attempt failed. */
93
- causeOfFailure?: CauseOfFailure$1;
94
- /**
95
- * Whether the external database has existing collections.
96
- * @readonly
97
- */
98
- hasCollections?: CollectionsFound$1;
99
- }
100
- declare enum ProtocolVersion$1 {
101
- UNKNOWN_PROTOCOL_VERSION = "UNKNOWN_PROTOCOL_VERSION",
102
- V1 = "V1",
103
- V2 = "V2",
104
- V3 = "V3"
105
- }
106
- interface Capabilities$1 {
107
- /** Whether the external database supports creating new collections, updating the structure of existing collections, or deleting them. */
108
- collectionModificationsSupported?: boolean;
109
- /**
110
- * Field types the external database supports.
111
- * This field only applies when `collectionModificationsSupported` is `true`.
112
- */
113
- fieldTypes?: FieldType$1[];
114
- }
115
- interface GetExternalDatabaseConnectionRequest$1 {
116
- /** Name of the external database connection to retrieve. */
117
- name: string;
118
- }
119
- interface GetExternalDatabaseConnectionResponse$1 {
120
- /** Details of the external database connection requested. */
121
- externalDatabaseConnection?: ExternalDatabaseConnection$1;
122
- }
123
- interface ListExternalDatabaseConnectionsRequest$1 {
124
- /** Paging */
125
- paging?: Paging$5;
126
- }
127
- interface Paging$5 {
128
- /** Number of items to load. */
129
- limit?: number | null;
130
- /** Number of items to skip in the current sort order. */
131
- offset?: number | null;
132
- }
133
- interface ListExternalDatabaseConnectionsResponse$1 {
134
- /** List of external database connections. */
135
- externalDatabaseConnections?: ExternalDatabaseConnection$1[];
136
- /** Paging metadata */
137
- pagingMetadata?: PagingMetadata$3;
138
- }
139
- interface PagingMetadata$3 {
140
- /** Number of items returned in the response. */
141
- count?: number | null;
142
- /** Offset that was requested. */
143
- offset?: number | null;
144
- /** Total number of items that match the query. */
145
- total?: number | null;
146
- /** Flag that indicates the server failed to calculate the `total` field. */
147
- tooManyToCount?: boolean | null;
148
- }
149
- interface CreateExternalDatabaseConnectionRequest$1 {
150
- /** External database connection details. */
151
- externalDatabaseConnection: ExternalDatabaseConnection$1;
152
- /** Connection type. */
153
- connectionType: ConnectionType$1;
154
- }
155
- declare enum ConnectionType$1 {
156
- /** Unknown connection type. */
157
- UNKNOWN_CONNECTION_TYPE = "UNKNOWN_CONNECTION_TYPE",
158
- /**
159
- * Connection to database adapter that implements legacy External Database Collections SPI (protocol version 1 or 2)
160
- * https://www.wix.com/velo/reference/spis/external-database-collections/introduction
161
- */
162
- STANDALONE = "STANDALONE",
163
- /**
164
- * Connection to database adapter that implements External Database SPI (protocol version 3)
165
- * https://dev.wix.com/docs/rest/internal-only/wix-data/external-database-spi/introduction
166
- * https://dev.wix.com/docs/rest/articles/getting-started/service-provider-interface
167
- */
168
- WIX_SPI = "WIX_SPI"
169
- }
170
- interface CreateExternalDatabaseConnectionResponse$1 {
171
- /** Details of external database connection created. */
172
- externalDatabaseConnection?: ExternalDatabaseConnection$1;
173
- }
174
- interface UpdateExternalDatabaseConnectionRequest$1 {
175
- /** Updated external database connection details. The existing connection is replaced with this version. */
176
- externalDatabaseConnection: ExternalDatabaseConnection$1;
177
- }
178
- interface UpdateExternalDatabaseConnectionResponse$1 {
179
- /** Updated external database connection details. */
180
- externalDatabaseConnection?: ExternalDatabaseConnection$1;
181
- }
182
- interface DeleteExternalDatabaseConnectionRequest$1 {
183
- /** Name of the external database connection to delete. */
184
- name: string;
185
- }
186
- interface DeleteExternalDatabaseConnectionResponse$1 {
187
- }
188
- interface ConnectionStatusNonNullableFields$1 {
189
- successful: boolean;
190
- causeOfFailure: CauseOfFailure$1;
191
- hasCollections: CollectionsFound$1;
192
- }
193
- interface CapabilitiesNonNullableFields$1 {
194
- collectionModificationsSupported: boolean;
195
- fieldTypes: FieldType$1[];
196
- }
197
- interface ExternalDatabaseConnectionNonNullableFields$1 {
198
- name: string;
199
- connectionStatus?: ConnectionStatusNonNullableFields$1;
200
- protocolVersion: ProtocolVersion$1;
201
- capabilities?: CapabilitiesNonNullableFields$1;
202
- }
203
- interface GetExternalDatabaseConnectionResponseNonNullableFields$1 {
204
- externalDatabaseConnection?: ExternalDatabaseConnectionNonNullableFields$1;
205
- }
206
- interface ListExternalDatabaseConnectionsResponseNonNullableFields$1 {
207
- externalDatabaseConnections: ExternalDatabaseConnectionNonNullableFields$1[];
208
- }
209
- interface CreateExternalDatabaseConnectionResponseNonNullableFields$1 {
210
- externalDatabaseConnection?: ExternalDatabaseConnectionNonNullableFields$1;
211
- }
212
- interface UpdateExternalDatabaseConnectionResponseNonNullableFields$1 {
213
- externalDatabaseConnection?: ExternalDatabaseConnectionNonNullableFields$1;
214
- }
215
-
216
- /** An external database connection defines a connection between an external database and a Wix site or project. */
217
- interface ExternalDatabaseConnection {
218
- /**
219
- * Name of the external database connection.
220
- * An external database connection may connect to one or more external data collections or tables.
221
- * These are represented as `connectionName/dataCollectionId`.
222
- */
223
- name?: string;
224
- /** Base URL for provisioning and managing data in the external database. For example: `https://example.com/my-external-database`. */
225
- endpoint?: string | null;
226
- /**
227
- * Settings passed to the external database connection as part of each request.
228
- * These settings can relate to authentication, tenancy, or provide any other information needed for processing a request.
229
- * Their content and structure depend on the specific requirements of the external database's API.
230
- */
231
- configuration?: Record<string, any> | null;
232
- /**
233
- * Status of the external database connection. Includes whether the connection was established successfully, and if not, the reason for the failure.
234
- * @readonly
235
- */
236
- connectionStatus?: ConnectionStatus;
237
- /**
238
- * The external database's capabilities.
239
- * @readonly
240
- */
241
- capabilities?: Capabilities;
242
- }
243
- declare enum CauseOfFailure {
244
- /** No connection failure. */
245
- NONE = "NONE",
246
- /** General communication failure. */
247
- COMMUNICATION_FAILURE = "COMMUNICATION_FAILURE",
248
- /** External database host is unreachable. */
249
- DESTINATION_HOST_UNREACHABLE = "DESTINATION_HOST_UNREACHABLE",
250
- /** Unauthorized to access the external database. */
251
- UNAUTHORIZED = "UNAUTHORIZED",
252
- /** `endpoint` is not set. */
253
- DESTINATION_ENDPOINT_NOT_DEFINED = "DESTINATION_ENDPOINT_NOT_DEFINED"
254
- }
255
- declare enum CollectionsFound {
256
- /** Attempt to connect to the external database failed, so status is unknown. */
257
- UNKNOWN = "UNKNOWN",
258
- /** External database has existing collections. */
259
- YES = "YES",
260
- /** External database does not have any existing collections. */
261
- NO = "NO"
262
- }
263
- declare enum FieldType {
264
- UNKNOWN_FIELD_TYPE = "UNKNOWN_FIELD_TYPE",
265
- TEXT = "TEXT",
266
- NUMBER = "NUMBER",
267
- DATE = "DATE",
268
- DATETIME = "DATETIME",
269
- IMAGE = "IMAGE",
270
- BOOLEAN = "BOOLEAN",
271
- DOCUMENT = "DOCUMENT",
272
- URL = "URL",
273
- RICH_TEXT = "RICH_TEXT",
274
- VIDEO = "VIDEO",
275
- ANY = "ANY",
276
- ARRAY_STRING = "ARRAY_STRING",
277
- ARRAY_DOCUMENT = "ARRAY_DOCUMENT",
278
- AUDIO = "AUDIO",
279
- TIME = "TIME",
280
- LANGUAGE = "LANGUAGE",
281
- RICH_CONTENT = "RICH_CONTENT",
282
- MEDIA_GALLERY = "MEDIA_GALLERY",
283
- ADDRESS = "ADDRESS",
284
- PAGE_LINK = "PAGE_LINK",
285
- REFERENCE = "REFERENCE",
286
- MULTI_REFERENCE = "MULTI_REFERENCE",
287
- OBJECT = "OBJECT",
288
- ARRAY = "ARRAY",
289
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
290
- LEGACY_TIME = "LEGACY_TIME",
291
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
292
- LEGACY_BOOK = "LEGACY_BOOK",
293
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
294
- LEGACY_EXTERNAL_URL = "LEGACY_EXTERNAL_URL",
295
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
296
- LEGACY_BROKEN_REFERENCE = "LEGACY_BROKEN_REFERENCE",
297
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
298
- LEGACY_IMAGE = "LEGACY_IMAGE",
299
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
300
- LEGACY_COLOR = "LEGACY_COLOR",
301
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
302
- LEGACY_EXTERNAL_VIDEO = "LEGACY_EXTERNAL_VIDEO"
303
- }
304
- interface ConnectionStatus {
305
- /** Whether the connection was established successfully. */
306
- successful?: boolean;
307
- /** Whether and why a connection attempt failed. */
308
- causeOfFailure?: CauseOfFailure;
309
- /**
310
- * Whether the external database has existing collections.
311
- * @readonly
312
- */
313
- hasCollections?: CollectionsFound;
314
- }
315
- declare enum ProtocolVersion {
316
- UNKNOWN_PROTOCOL_VERSION = "UNKNOWN_PROTOCOL_VERSION",
317
- V1 = "V1",
318
- V2 = "V2",
319
- V3 = "V3"
320
- }
321
- interface Capabilities {
322
- /** Whether the external database supports creating new collections, updating the structure of existing collections, or deleting them. */
323
- collectionModificationsSupported?: boolean;
324
- /**
325
- * Field types the external database supports.
326
- * This field only applies when `collectionModificationsSupported` is `true`.
327
- */
328
- fieldTypes?: FieldType[];
329
- }
330
- interface GetExternalDatabaseConnectionRequest {
331
- /** Name of the external database connection to retrieve. */
332
- name: string;
333
- }
334
- interface GetExternalDatabaseConnectionResponse {
335
- /** Details of the external database connection requested. */
336
- externalDatabaseConnection?: ExternalDatabaseConnection;
337
- }
338
- interface ListExternalDatabaseConnectionsRequest {
339
- /** Paging */
340
- paging?: Paging$4;
341
- }
342
- interface Paging$4 {
343
- /** Number of items to load. */
344
- limit?: number | null;
345
- /** Number of items to skip in the current sort order. */
346
- offset?: number | null;
347
- }
348
- interface ListExternalDatabaseConnectionsResponse {
349
- /** List of external database connections. */
350
- externalDatabaseConnections?: ExternalDatabaseConnection[];
351
- /** Paging metadata */
352
- pagingMetadata?: PagingMetadata$2;
353
- }
354
- interface PagingMetadata$2 {
355
- /** Number of items returned in the response. */
356
- count?: number | null;
357
- /** Offset that was requested. */
358
- offset?: number | null;
359
- /** Total number of items that match the query. */
360
- total?: number | null;
361
- /** Flag that indicates the server failed to calculate the `total` field. */
362
- tooManyToCount?: boolean | null;
363
- }
364
- interface CreateExternalDatabaseConnectionRequest {
365
- /** External database connection details. */
366
- externalDatabaseConnection: ExternalDatabaseConnection;
367
- /** Connection type. */
368
- connectionType: ConnectionType;
369
- }
370
- declare enum ConnectionType {
371
- /** Unknown connection type. */
372
- UNKNOWN_CONNECTION_TYPE = "UNKNOWN_CONNECTION_TYPE",
373
- /**
374
- * Connection to database adapter that implements legacy External Database Collections SPI (protocol version 1 or 2)
375
- * https://www.wix.com/velo/reference/spis/external-database-collections/introduction
376
- */
377
- STANDALONE = "STANDALONE",
378
- /**
379
- * Connection to database adapter that implements External Database SPI (protocol version 3)
380
- * https://dev.wix.com/docs/rest/internal-only/wix-data/external-database-spi/introduction
381
- * https://dev.wix.com/docs/rest/articles/getting-started/service-provider-interface
382
- */
383
- WIX_SPI = "WIX_SPI"
384
- }
385
- interface CreateExternalDatabaseConnectionResponse {
386
- /** Details of external database connection created. */
387
- externalDatabaseConnection?: ExternalDatabaseConnection;
388
- }
389
- interface UpdateExternalDatabaseConnectionRequest {
390
- /** Updated external database connection details. The existing connection is replaced with this version. */
391
- externalDatabaseConnection: ExternalDatabaseConnection;
392
- }
393
- interface UpdateExternalDatabaseConnectionResponse {
394
- /** Updated external database connection details. */
395
- externalDatabaseConnection?: ExternalDatabaseConnection;
396
- }
397
- interface DeleteExternalDatabaseConnectionRequest {
398
- /** Name of the external database connection to delete. */
399
- name: string;
400
- }
401
- interface DeleteExternalDatabaseConnectionResponse {
402
- }
403
- interface ConnectionStatusNonNullableFields {
404
- successful: boolean;
405
- causeOfFailure: CauseOfFailure;
406
- hasCollections: CollectionsFound;
407
- }
408
- interface CapabilitiesNonNullableFields {
409
- collectionModificationsSupported: boolean;
410
- fieldTypes: FieldType[];
411
- }
412
- interface ExternalDatabaseConnectionNonNullableFields {
413
- name: string;
414
- connectionStatus?: ConnectionStatusNonNullableFields;
415
- protocolVersion: ProtocolVersion;
416
- capabilities?: CapabilitiesNonNullableFields;
417
- }
418
- interface GetExternalDatabaseConnectionResponseNonNullableFields {
419
- externalDatabaseConnection?: ExternalDatabaseConnectionNonNullableFields;
420
- }
421
- interface ListExternalDatabaseConnectionsResponseNonNullableFields {
422
- externalDatabaseConnections: ExternalDatabaseConnectionNonNullableFields[];
423
- }
424
- interface CreateExternalDatabaseConnectionResponseNonNullableFields {
425
- externalDatabaseConnection?: ExternalDatabaseConnectionNonNullableFields;
426
- }
427
- interface UpdateExternalDatabaseConnectionResponseNonNullableFields {
428
- externalDatabaseConnection?: ExternalDatabaseConnectionNonNullableFields;
429
- }
430
-
431
- type __PublicMethodMetaInfo$3<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
432
- getUrl: (context: any) => string;
433
- httpMethod: K;
434
- path: string;
435
- pathParams: M;
436
- __requestType: T;
437
- __originalRequestType: S;
438
- __responseType: Q;
439
- __originalResponseType: R;
440
- };
441
- declare function getExternalDatabaseConnection(): __PublicMethodMetaInfo$3<'GET', {
442
- name: string;
443
- }, GetExternalDatabaseConnectionRequest, GetExternalDatabaseConnectionRequest$1, GetExternalDatabaseConnectionResponse & GetExternalDatabaseConnectionResponseNonNullableFields, GetExternalDatabaseConnectionResponse$1 & GetExternalDatabaseConnectionResponseNonNullableFields$1>;
444
- declare function listExternalDatabaseConnections(): __PublicMethodMetaInfo$3<'GET', {}, ListExternalDatabaseConnectionsRequest, ListExternalDatabaseConnectionsRequest$1, ListExternalDatabaseConnectionsResponse & ListExternalDatabaseConnectionsResponseNonNullableFields, ListExternalDatabaseConnectionsResponse$1 & ListExternalDatabaseConnectionsResponseNonNullableFields$1>;
445
- declare function createExternalDatabaseConnection(): __PublicMethodMetaInfo$3<'POST', {}, CreateExternalDatabaseConnectionRequest, CreateExternalDatabaseConnectionRequest$1, CreateExternalDatabaseConnectionResponse & CreateExternalDatabaseConnectionResponseNonNullableFields, CreateExternalDatabaseConnectionResponse$1 & CreateExternalDatabaseConnectionResponseNonNullableFields$1>;
446
- declare function updateExternalDatabaseConnection(): __PublicMethodMetaInfo$3<'PUT', {
447
- externalDatabaseConnectionName: string;
448
- }, UpdateExternalDatabaseConnectionRequest, UpdateExternalDatabaseConnectionRequest$1, UpdateExternalDatabaseConnectionResponse & UpdateExternalDatabaseConnectionResponseNonNullableFields, UpdateExternalDatabaseConnectionResponse$1 & UpdateExternalDatabaseConnectionResponseNonNullableFields$1>;
449
- declare function deleteExternalDatabaseConnection(): __PublicMethodMetaInfo$3<'DELETE', {
450
- name: string;
451
- }, DeleteExternalDatabaseConnectionRequest, DeleteExternalDatabaseConnectionRequest$1, DeleteExternalDatabaseConnectionResponse, DeleteExternalDatabaseConnectionResponse$1>;
452
-
453
- declare const meta$2_createExternalDatabaseConnection: typeof createExternalDatabaseConnection;
454
- declare const meta$2_deleteExternalDatabaseConnection: typeof deleteExternalDatabaseConnection;
455
- declare const meta$2_getExternalDatabaseConnection: typeof getExternalDatabaseConnection;
456
- declare const meta$2_listExternalDatabaseConnections: typeof listExternalDatabaseConnections;
457
- declare const meta$2_updateExternalDatabaseConnection: typeof updateExternalDatabaseConnection;
458
- declare namespace meta$2 {
459
- export { type __PublicMethodMetaInfo$3 as __PublicMethodMetaInfo, meta$2_createExternalDatabaseConnection as createExternalDatabaseConnection, meta$2_deleteExternalDatabaseConnection as deleteExternalDatabaseConnection, meta$2_getExternalDatabaseConnection as getExternalDatabaseConnection, meta$2_listExternalDatabaseConnections as listExternalDatabaseConnections, meta$2_updateExternalDatabaseConnection as updateExternalDatabaseConnection };
460
- }
461
-
462
- /** A data collection determines the structure of data to be stored in a database. */
463
- interface DataCollection$1 {
464
- /** Collection ID. For example, `my-first-collection`. May include a namespace. */
465
- id?: string;
466
- /**
467
- * Collection type. Indicates how the collection was created and how it is stored.
468
- * @readonly
469
- */
470
- collectionType?: CollectionType$1;
471
- /**
472
- * ID of the app that defined this collection. For collections defined by Wix users, this value is null.
473
- * @readonly
474
- */
475
- ownerAppId?: string | null;
476
- /**
477
- * Maximum number of items returned in a single query, based on the underlying storage.
478
- * Native collections have a maximum page size of 1000 for offset-based queries or 100 for cursor-based queries.
479
- * External collections' maximum page size defaults to 50, but an external provider can set any maximum value up to 1000.
480
- * @readonly
481
- */
482
- maxPageSize?: number | null;
483
- /** Collection's display name as shown in the CMS. For example, `My First Collection`. */
484
- displayName?: string | null;
485
- /**
486
- * Default item sorting order when a query doesn't specify one.
487
- * @readonly
488
- */
489
- defaultDisplayOrder?: Sort$1;
490
- /**
491
- * UI-friendly namespace of the Wix app with which the data collection is associated, such as Stores or Bookings.
492
- * Empty for all data collections not owned by Wix apps.
493
- * @readonly
494
- */
495
- displayNamespace?: string | null;
496
- /** Field whose value the CMS displays to represent the collection item when referenced in a different collection. */
497
- displayField?: string | null;
498
- /**
499
- * Capabilities the collection supports.
500
- * @readonly
501
- */
502
- capabilities?: CollectionCapabilities$1;
503
- /** Collection's field structure. */
504
- fields?: Field$3[];
505
- /** Levels of permission for accessing and modifying data, defined by lowest role needed to perform each action. */
506
- permissions?: Permissions$1;
507
- /**
508
- * 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.
509
- * @readonly
510
- */
511
- revision?: string | null;
512
- /** Plugins the collection uses. Plugins apply additional capabilities to the collection or extend its functionality. */
513
- plugins?: Plugin$1[];
514
- /**
515
- * Paging modes the collection supports. In native collections, offset-based paging is supported by default.
516
- * @readonly
517
- */
518
- pagingModes?: PagingMode$1[];
519
- /**
520
- * Date the collection was created.
521
- * @readonly
522
- */
523
- createdDate?: Date | null;
524
- /**
525
- * Date the collection was last updated.
526
- * @readonly
527
- */
528
- updatedDate?: Date | null;
529
- }
530
- declare enum CollectionType$1 {
531
- /** User-created collection. */
532
- NATIVE = "NATIVE",
533
- /** [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). */
534
- WIX_APP = "WIX_APP",
535
- /** Collection created by a Wix Blocks app. */
536
- BLOCKS_APP = "BLOCKS_APP",
537
- /** Collection located in externally connected storage. */
538
- EXTERNAL = "EXTERNAL"
539
- }
540
- interface Sort$1 {
541
- /** Field to sort by. */
542
- fieldKey?: string;
543
- /**
544
- * Sort order. Use `ASC` for ascending order or `DESC` for descending order.
545
- *
546
- * Default: `ASC`
547
- */
548
- direction?: Direction$1;
549
- }
550
- declare enum Direction$1 {
551
- ASC = "ASC",
552
- DESC = "DESC"
553
- }
554
- interface CollectionCapabilities$1 {
555
- /**
556
- * Data operations the collection supports. The listed operations can be performed on data the collection contains.
557
- *
558
- * > **Note**: The `PATCH` and `BULK_PATCH` oeprations aren't currently supported.
559
- */
560
- dataOperations?: DataOperation$1[];
561
- /** Collection operations supported. The listed operations can be performed on the collection itself. */
562
- collectionOperations?: CollectionOperation$1[];
563
- /** Maximum number of indexes for the collection. */
564
- indexLimits?: IndexLimits$1;
565
- }
566
- declare enum DataOperation$1 {
567
- AGGREGATE = "AGGREGATE",
568
- BULK_INSERT = "BULK_INSERT",
569
- BULK_REMOVE = "BULK_REMOVE",
570
- BULK_SAVE = "BULK_SAVE",
571
- BULK_UPDATE = "BULK_UPDATE",
572
- COUNT = "COUNT",
573
- DISTINCT = "DISTINCT",
574
- FIND = "FIND",
575
- GET = "GET",
576
- INSERT = "INSERT",
577
- INSERT_REFERENCE = "INSERT_REFERENCE",
578
- IS_REFERENCED = "IS_REFERENCED",
579
- QUERY_REFERENCED = "QUERY_REFERENCED",
580
- REMOVE = "REMOVE",
581
- REMOVE_REFERENCE = "REMOVE_REFERENCE",
582
- REPLACE_REFERENCES = "REPLACE_REFERENCES",
583
- SAVE = "SAVE",
584
- TRUNCATE = "TRUNCATE",
585
- UPDATE = "UPDATE",
586
- PATCH = "PATCH",
587
- BULK_PATCH = "BULK_PATCH"
588
- }
589
- declare enum CollectionOperation$1 {
590
- /** Allows updating the collection's structure, for example adding, updating, or deleting fields. If not included, the collection's structure can't be changed. */
591
- UPDATE = "UPDATE",
592
- /** Allows deleting the entire collection. If not included, the collection can't be deleted. */
593
- REMOVE = "REMOVE"
594
- }
595
- interface IndexLimits$1 {
596
- /** Maximum number of regular (non-unique) indexes allowed for this collection. */
597
- regular?: number;
598
- /** Maximum number of unique indexes allowed for this collection. */
599
- unique?: number;
600
- /** Maximum number of regular and unique indexes allowed for this collection. */
601
- total?: number;
602
- }
603
- interface Field$3 extends FieldRangeValidationsOneOf$1 {
604
- /** Range of possible values for a numerical field. */
605
- numberRange?: NumberRange$1;
606
- /** Length range permitted for a text field. Relevant for fields that hold strings, such as those of type `TEXT` or `RICH_TEXT`. */
607
- stringLengthRange?: StringLengthRange$1;
608
- /** Array size range permitted. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`. */
609
- arraySizeRange?: ArraySizeRange$1;
610
- /** Unique identifier for the field. For example, `firstName`. */
611
- key?: string;
612
- /** Field's display name when displayed in the CMS. For example, `First Name`. */
613
- displayName?: string | null;
614
- /** Field's data type. */
615
- type?: Type$1;
616
- /** Metadata for complex data types. This property only exists for references, multi-references, objects, and arrays. */
617
- typeMetadata?: TypeMetadata$1;
618
- /**
619
- * Whether the field is a system field.
620
- * @readonly
621
- */
622
- systemField?: boolean;
623
- /**
624
- * Capabilities the field supports.
625
- * @readonly
626
- */
627
- capabilities?: FieldCapabilities$1;
628
- /** Whether the field is encrypted. */
629
- encrypted?: boolean;
630
- /** Field description. */
631
- description?: string | null;
632
- /**
633
- * Whether the field is read-only. A read-only field can't be changed.
634
- *
635
- * Default: `false`
636
- */
637
- readOnly?: boolean | null;
638
- /**
639
- * Whether the field is immutable. An immutable field can be set once, but then cannot be updated.
640
- *
641
- * Default: `false`
642
- */
643
- immutable?: boolean | null;
644
- /**
645
- * Whether the field is required.
646
- *
647
- * Default: `false`
648
- */
649
- required?: boolean | null;
650
- /** Additional optional plugins for the field. */
651
- plugins?: FieldPlugin$1[];
652
- }
653
- /** @oneof */
654
- interface FieldRangeValidationsOneOf$1 {
655
- /** Range of possible values for a numerical field. */
656
- numberRange?: NumberRange$1;
657
- /** Length range permitted for a text field. Relevant for fields that hold strings, such as those of type `TEXT` or `RICH_TEXT`. */
658
- stringLengthRange?: StringLengthRange$1;
659
- /** Array size range permitted. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`. */
660
- arraySizeRange?: ArraySizeRange$1;
661
- }
662
- declare enum Type$1 {
663
- UNKNOWN_FIELD_TYPE = "UNKNOWN_FIELD_TYPE",
664
- TEXT = "TEXT",
665
- NUMBER = "NUMBER",
666
- DATE = "DATE",
667
- DATETIME = "DATETIME",
668
- IMAGE = "IMAGE",
669
- BOOLEAN = "BOOLEAN",
670
- DOCUMENT = "DOCUMENT",
671
- URL = "URL",
672
- RICH_TEXT = "RICH_TEXT",
673
- VIDEO = "VIDEO",
674
- ANY = "ANY",
675
- ARRAY_STRING = "ARRAY_STRING",
676
- ARRAY_DOCUMENT = "ARRAY_DOCUMENT",
677
- AUDIO = "AUDIO",
678
- TIME = "TIME",
679
- LANGUAGE = "LANGUAGE",
680
- RICH_CONTENT = "RICH_CONTENT",
681
- MEDIA_GALLERY = "MEDIA_GALLERY",
682
- ADDRESS = "ADDRESS",
683
- PAGE_LINK = "PAGE_LINK",
684
- REFERENCE = "REFERENCE",
685
- MULTI_REFERENCE = "MULTI_REFERENCE",
686
- OBJECT = "OBJECT",
687
- ARRAY = "ARRAY",
688
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
689
- LEGACY_TIME = "LEGACY_TIME",
690
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
691
- LEGACY_BOOK = "LEGACY_BOOK",
692
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
693
- LEGACY_EXTERNAL_URL = "LEGACY_EXTERNAL_URL",
694
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
695
- LEGACY_BROKEN_REFERENCE = "LEGACY_BROKEN_REFERENCE",
696
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
697
- LEGACY_IMAGE = "LEGACY_IMAGE",
698
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
699
- LEGACY_COLOR = "LEGACY_COLOR",
700
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
701
- LEGACY_EXTERNAL_VIDEO = "LEGACY_EXTERNAL_VIDEO"
702
- }
703
- interface TypeMetadata$1 extends TypeMetadataMetadataOneOf$1 {
704
- /** Metadata for a reference field. */
705
- reference?: Reference$1;
706
- /** Metadata for a multi-reference field. */
707
- multiReference?: MultiReference$1;
708
- /** Metadata for an object field. */
709
- object?: _Object$1;
710
- /** Metadata for an array field. */
711
- array?: _Array$1;
712
- /** Metadata for a page link field. */
713
- pageLink?: PageLink$1;
714
- }
715
- /** @oneof */
716
- interface TypeMetadataMetadataOneOf$1 {
717
- /** Metadata for a reference field. */
718
- reference?: Reference$1;
719
- /** Metadata for a multi-reference field. */
720
- multiReference?: MultiReference$1;
721
- /** Metadata for an object field. */
722
- object?: _Object$1;
723
- /** Metadata for an array field. */
724
- array?: _Array$1;
725
- /** Metadata for a page link field. */
726
- pageLink?: PageLink$1;
727
- }
728
- interface FieldCapabilities$1 {
729
- /**
730
- * Whether the collection can be sorted by this field.
731
- *
732
- * Default: `false`
733
- */
734
- sortable?: boolean;
735
- /** Query operators that can be used for this field. */
736
- queryOperators?: QueryOperator$1[];
737
- }
738
- declare enum QueryOperator$1 {
739
- EQ = "EQ",
740
- LT = "LT",
741
- GT = "GT",
742
- NE = "NE",
743
- LTE = "LTE",
744
- GTE = "GTE",
745
- STARTS_WITH = "STARTS_WITH",
746
- ENDS_WITH = "ENDS_WITH",
747
- CONTAINS = "CONTAINS",
748
- HAS_SOME = "HAS_SOME",
749
- HAS_ALL = "HAS_ALL",
750
- EXISTS = "EXISTS",
751
- URLIZED = "URLIZED"
752
- }
753
- interface ObjectField$1 {
754
- /** Field ID. */
755
- key?: string;
756
- /** Display name for the field. */
757
- displayName?: string | null;
758
- /** Field type. */
759
- type?: Type$1;
760
- /** Metadata for complex data types. This property only exists for references, multi-references, objects, and arrays. */
761
- typeMetadata?: TypeMetadata$1;
762
- /**
763
- * Capabilities the object field supports.
764
- * @readonly
765
- */
766
- capabilities?: FieldCapabilities$1;
767
- }
768
- interface FieldsPattern$1 {
769
- pattern?: string;
770
- lowercase?: boolean;
771
- }
772
- interface UrlizedOnlyPattern$1 {
773
- pattern?: string;
774
- }
775
- interface Calculator$1 extends CalculatorPatternOneOf$1 {
776
- /** Value is calculated according to pattern, whitespaces are replaced with dash [-]. */
777
- fieldsPattern?: FieldsPattern$1;
778
- /** Value is only URL encoded. */
779
- urlizedOnlyPattern?: UrlizedOnlyPattern$1;
780
- }
781
- /** @oneof */
782
- interface CalculatorPatternOneOf$1 {
783
- /** Value is calculated according to pattern, whitespaces are replaced with dash [-]. */
784
- fieldsPattern?: FieldsPattern$1;
785
- /** Value is only URL encoded. */
786
- urlizedOnlyPattern?: UrlizedOnlyPattern$1;
787
- }
788
- interface Reference$1 {
789
- /** Referenced collection ID. */
790
- referencedCollectionId?: string;
791
- }
792
- interface MultiReference$1 {
793
- /** Referenced collection ID. */
794
- referencedCollectionId?: string;
795
- /** Referencing field ID. */
796
- referencingFieldKey?: string;
797
- /** Display name in the CMS for the referenced data. */
798
- referencingDisplayName?: string;
799
- }
800
- interface _Object$1 {
801
- /** Fields within the object. */
802
- fields?: ObjectField$1[];
803
- }
804
- interface _Array$1 {
805
- /** Element's data type. */
806
- elementType?: Type$1;
807
- /** Metadata for complex data types. This property only exists for references, multi-references, objects, and arrays. */
808
- typeMetadata?: TypeMetadata$1;
809
- }
810
- interface PageLink$1 {
811
- calculator?: Calculator$1;
812
- /** Defines reference to router pattern in the site document. */
813
- linkedRouterPage?: string | null;
814
- }
815
- interface NumberRange$1 {
816
- /**
817
- * Minimum permitted value for a numerical field.
818
- *
819
- * Default: No validation
820
- */
821
- min?: number | null;
822
- /**
823
- * Maximum permitted value for a numerical field.
824
- *
825
- * Default: No validation
826
- */
827
- max?: number | null;
828
- }
829
- interface StringLengthRange$1 {
830
- /**
831
- * Minimum permitted length for a text field.
832
- *
833
- * Default: No validation
834
- */
835
- minLength?: number | null;
836
- /**
837
- * Maximum permitted length for a text field.
838
- *
839
- * Default: No validation
840
- */
841
- maxLength?: number | null;
842
- }
843
- interface ArraySizeRange$1 {
844
- /**
845
- * 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`.
846
- *
847
- * Default: No validation
848
- */
849
- minSize?: number | null;
850
- /**
851
- * 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`.
852
- *
853
- * Default: No validation
854
- */
855
- maxSize?: number | null;
856
- }
857
- /** Optional plug-in aspects for fields */
858
- interface FieldPlugin$1 extends FieldPluginOptionsOneOf$1 {
859
- /** Options for the CMS plugin. */
860
- cmsOptions?: CmsOptions$1;
861
- type?: FieldPluginType$1;
862
- }
863
- /** @oneof */
864
- interface FieldPluginOptionsOneOf$1 {
865
- /** Options for the CMS plugin. */
866
- cmsOptions?: CmsOptions$1;
867
- }
868
- declare enum FieldPluginType$1 {
869
- /** Uknown plugin type. */
870
- UNKNOWN = "UNKNOWN",
871
- /** CMS-related field attributes */
872
- CMS = "CMS"
873
- }
874
- /** Options for the CMS plugin. */
875
- interface CmsOptions$1 {
876
- /**
877
- * Indicates an internal CMS field. The CMS does not display internal fields.
878
- *
879
- * Default: `false`
880
- */
881
- internal?: boolean;
882
- }
883
- /** Permissions defined by the lowest role needed to perform each action. */
884
- interface Permissions$1 {
885
- /** Lowest role needed to add a collection. */
886
- insert?: Role$1;
887
- /** Lowest role needed to update a collection. */
888
- update?: Role$1;
889
- /** Lowest role needed to remove a collection. */
890
- remove?: Role$1;
891
- /** Lowest role needed to read a collection. */
892
- read?: Role$1;
893
- }
894
- declare enum Role$1 {
895
- /** Unknown role. */
896
- UNKNOWN_ROLE = "UNKNOWN_ROLE",
897
- /** Site administrator. */
898
- ADMIN = "ADMIN",
899
- /** Signed-in user who added content to this collection. */
900
- SITE_MEMBER_AUTHOR = "SITE_MEMBER_AUTHOR",
901
- /** Any signed-in user. */
902
- SITE_MEMBER = "SITE_MEMBER",
903
- /** Any site visitor. */
904
- ANYONE = "ANYONE"
905
- }
906
- interface Plugin$1 extends PluginOptionsOneOf$1 {
907
- /**
908
- * Options for the Publish plugin.
909
- * 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.
910
- */
911
- publishOptions?: PublishPluginOptions$2;
912
- /** Options for the Single Item plugin. */
913
- singleItemOptions?: SingleItemPluginOptions$1;
914
- /** Options for the Urlized plugin. */
915
- urlizedOptions?: UrlizedPluginOptions$1;
916
- /** Options for the Multilingual plugin. */
917
- multilingualOptions?: MultilingualOptions$1;
918
- /** Options for the PageLink plugin. */
919
- editablePageLinkOptions?: PageLinkPluginOptions$1;
920
- /** Options for the CMS plugin. */
921
- cmsOptions?: PluginCmsOptions$1;
922
- /** Plugin types. */
923
- type?: PluginType$1;
924
- }
925
- /** @oneof */
926
- interface PluginOptionsOneOf$1 {
927
- /**
928
- * Options for the Publish plugin.
929
- * 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.
930
- */
931
- publishOptions?: PublishPluginOptions$2;
932
- /** Options for the Single Item plugin. */
933
- singleItemOptions?: SingleItemPluginOptions$1;
934
- /** Options for the Urlized plugin. */
935
- urlizedOptions?: UrlizedPluginOptions$1;
936
- /** Options for the Multilingual plugin. */
937
- multilingualOptions?: MultilingualOptions$1;
938
- /** Options for the PageLink plugin. */
939
- editablePageLinkOptions?: PageLinkPluginOptions$1;
940
- /** Options for the CMS plugin. */
941
- cmsOptions?: PluginCmsOptions$1;
942
- }
943
- declare enum Status$3 {
944
- UNKNOWN_PUBLISH_PLUGIN_STATUS = "UNKNOWN_PUBLISH_PLUGIN_STATUS",
945
- PUBLISHED = "PUBLISHED",
946
- DRAFT = "DRAFT"
947
- }
948
- declare enum Format$1 {
949
- UNKNOWN_URLIZED_PLUGIN_FORMAT = "UNKNOWN_URLIZED_PLUGIN_FORMAT",
950
- /** Letters are converted to lower case and spaces are replaced with dashes before generating the encoded URL. */
951
- ORIGINAL = "ORIGINAL",
952
- /** No changes are made before generating the encoded URL. */
953
- PLAIN = "PLAIN"
954
- }
955
- /** if CMS-defined sort is enabled and should be used in site */
956
- interface SiteSort$1 {
957
- /** Field and order for the site sort. */
958
- sort?: Sort$1[];
959
- }
960
- declare enum PluginType$1 {
961
- /** Unknown plugin type. */
962
- UNKNOWN_PLUGIN_TYPE = "UNKNOWN_PLUGIN_TYPE",
963
- /** 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. */
964
- PUBLISH = "PUBLISH",
965
- /** Ensures the collection can have one item at most. Can only be applied to a new collection. */
966
- SINGLE_ITEM = "SINGLE_ITEM",
967
- /** Generates item URLs for collections used by dynamic pages. */
968
- URLIZED = "URLIZED",
969
- /** Deprecated. Will be removed in the future. */
970
- GRIDAPPLESS = "GRIDAPPLESS",
971
- /** 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). */
972
- MULTILINGUAL = "MULTILINGUAL",
973
- /** Indicates that collection is shared with current site. */
974
- SHARED = "SHARED",
975
- /** Indicates that page link fields are persisted and can be updated. */
976
- EDITABLE_PAGE_LINK = "EDITABLE_PAGE_LINK",
977
- /** CMS-specific collection properties. */
978
- CMS = "CMS"
979
- }
980
- interface PublishPluginOptions$2 {
981
- /** Default status. */
982
- defaultStatus?: Status$3;
983
- }
984
- interface SingleItemPluginOptions$1 {
985
- /** ID of the single item in this collection. If you insert or update an item, its ID value is always changed to this. */
986
- singleItemId?: string;
987
- }
988
- interface UrlizedPluginOptions$1 {
989
- /** Encoding method for generating a URL in ASCII characters. */
990
- format?: Format$1;
991
- }
992
- interface MultilingualOptions$1 {
993
- /** IDs of fields to allow translation. */
994
- translatableFieldKeys?: string[];
995
- }
996
- interface PageLinkPluginOptions$1 {
997
- isPersisted?: boolean;
998
- isMutable?: boolean;
999
- }
1000
- interface PluginCmsOptions$1 {
1001
- /** CMS sort, applied when a collection is displayed on a site. */
1002
- siteSort?: SiteSort$1;
1003
- }
1004
- declare enum PagingMode$1 {
1005
- /** Offset-based paging. */
1006
- OFFSET = "OFFSET",
1007
- /** Cursor-based paging. */
1008
- CURSOR = "CURSOR"
1009
- }
1010
- /**
1011
- * Describes who can perform certain action.
1012
- * Each level includes all levels below it (except UNDEFINED).
1013
- */
1014
- declare enum AccessLevel$1 {
1015
- /** Not set. */
1016
- UNDEFINED = "UNDEFINED",
1017
- /** Any subject, including visitors. */
1018
- ANYONE = "ANYONE",
1019
- /** Any signed-in user (both site members and collaborators). */
1020
- SITE_MEMBER = "SITE_MEMBER",
1021
- /** Any signed-in user, but site members only have access to own items. */
1022
- SITE_MEMBER_AUTHOR = "SITE_MEMBER_AUTHOR",
1023
- /** Site collaborator that has a role with CMS Access permission. */
1024
- CMS_EDITOR = "CMS_EDITOR",
1025
- /** CMS administrators and users or roles granted with special access. */
1026
- PRIVILEGED = "PRIVILEGED"
1027
- }
1028
- interface CreateDataCollectionRequest$1 {
1029
- /** Collection details. */
1030
- collection: DataCollection$1;
1031
- }
1032
- interface CreateDataCollectionResponse$1 {
1033
- /** Details of collection created. */
1034
- collection?: DataCollection$1;
1035
- }
1036
- interface GetDataCollectionRequest$1 {
1037
- /** ID of the collection to retrieve. */
1038
- dataCollectionId: string;
1039
- /**
1040
- * Whether to retrieve data from the primary database instance.
1041
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
1042
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
1043
- *
1044
- * Default: `false`
1045
- */
1046
- consistentRead?: boolean;
1047
- /**
1048
- * List of specific field names to return, if empty all fields are returned.
1049
- * Affects all returned collections
1050
- */
1051
- fields?: string[];
1052
- }
1053
- interface GetDataCollectionResponse$1 {
1054
- /** Details of the collection requested. */
1055
- collection?: DataCollection$1;
1056
- /**
1057
- * Details of collections referenced by the collection requested.
1058
- * Only populated when `includeReferencedCollections` is `true` in the request.
1059
- */
1060
- referencedCollections?: DataCollection$1[];
1061
- }
1062
- interface ListDataCollectionsRequest$1 {
1063
- /**
1064
- * Defines how collections in the response are sorted.
1065
- *
1066
- * Default: Ordered by ID in ascending order.
1067
- */
1068
- sort?: Sorting$1;
1069
- /** Pagination information. */
1070
- paging?: Paging$3;
1071
- /**
1072
- * Whether to retrieve data from the primary database instance.
1073
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
1074
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
1075
- *
1076
- * Default: `false`
1077
- */
1078
- consistentRead?: boolean;
1079
- /**
1080
- * List of specific field names to return, if empty all fields are returned.
1081
- * Affects all returned collections
1082
- */
1083
- fields?: string[];
1084
- }
1085
- interface Sorting$1 {
1086
- /** Name of the field to sort by. */
1087
- fieldName?: string;
1088
- /** Sort order. */
1089
- order?: SortOrder$1;
1090
- }
1091
- declare enum SortOrder$1 {
1092
- ASC = "ASC",
1093
- DESC = "DESC"
1094
- }
1095
- interface Paging$3 {
1096
- /** Number of items to load. */
1097
- limit?: number | null;
1098
- /** Number of items to skip in the current sort order. */
1099
- offset?: number | null;
1100
- }
1101
- interface ListDataCollectionsResponse$1 {
1102
- /** List of collections. */
1103
- collections?: DataCollection$1[];
1104
- /** Paging information. */
1105
- pagingMetadata?: PagingMetadataV2$1;
1106
- }
1107
- interface PagingMetadataV2$1 {
1108
- /** Number of items returned in the response. */
1109
- count?: number | null;
1110
- /** Offset that was requested. */
1111
- offset?: number | null;
1112
- /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
1113
- total?: number | null;
1114
- /** Flag that indicates the server failed to calculate the `total` field. */
1115
- tooManyToCount?: boolean | null;
1116
- }
1117
- interface UpdateDataCollectionRequest$1 {
1118
- /** Updated collection details. The existing collection is replaced with this version. */
1119
- collection: DataCollection$1;
1120
- }
1121
- interface UpdateDataCollectionResponse$1 {
1122
- /** Updated collection details. */
1123
- collection?: DataCollection$1;
1124
- }
1125
- interface DeleteDataCollectionRequest$1 {
1126
- /** ID of the collection to delete. */
1127
- dataCollectionId: string;
1128
- }
1129
- interface DeleteDataCollectionResponse$1 {
1130
- }
1131
- interface SortNonNullableFields$1 {
1132
- fieldKey: string;
1133
- direction: Direction$1;
1134
- }
1135
- interface IndexLimitsNonNullableFields$1 {
1136
- regular: number;
1137
- unique: number;
1138
- total: number;
1139
- }
1140
- interface CollectionCapabilitiesNonNullableFields$1 {
1141
- dataOperations: DataOperation$1[];
1142
- collectionOperations: CollectionOperation$1[];
1143
- indexLimits?: IndexLimitsNonNullableFields$1;
1144
- }
1145
- interface ReferenceNonNullableFields$1 {
1146
- referencedCollectionId: string;
1147
- }
1148
- interface MultiReferenceNonNullableFields$1 {
1149
- referencedCollectionId: string;
1150
- referencingFieldKey: string;
1151
- referencingDisplayName: string;
1152
- }
1153
- interface FieldCapabilitiesNonNullableFields$1 {
1154
- sortable: boolean;
1155
- queryOperators: QueryOperator$1[];
1156
- }
1157
- interface ObjectFieldNonNullableFields$1 {
1158
- key: string;
1159
- type: Type$1;
1160
- typeMetadata?: TypeMetadataNonNullableFields$1;
1161
- capabilities?: FieldCapabilitiesNonNullableFields$1;
1162
- }
1163
- interface _ObjectNonNullableFields$1 {
1164
- fields: ObjectFieldNonNullableFields$1[];
1165
- }
1166
- interface _ArrayNonNullableFields$1 {
1167
- elementType: Type$1;
1168
- typeMetadata?: TypeMetadataNonNullableFields$1;
1169
- }
1170
- interface FieldsPatternNonNullableFields$1 {
1171
- pattern: string;
1172
- lowercase: boolean;
1173
- }
1174
- interface UrlizedOnlyPatternNonNullableFields$1 {
1175
- pattern: string;
1176
- }
1177
- interface CalculatorNonNullableFields$1 {
1178
- fieldsPattern?: FieldsPatternNonNullableFields$1;
1179
- urlizedOnlyPattern?: UrlizedOnlyPatternNonNullableFields$1;
1180
- }
1181
- interface PageLinkNonNullableFields$1 {
1182
- calculator?: CalculatorNonNullableFields$1;
1183
- }
1184
- interface TypeMetadataNonNullableFields$1 {
1185
- reference?: ReferenceNonNullableFields$1;
1186
- multiReference?: MultiReferenceNonNullableFields$1;
1187
- object?: _ObjectNonNullableFields$1;
1188
- array?: _ArrayNonNullableFields$1;
1189
- pageLink?: PageLinkNonNullableFields$1;
1190
- }
1191
- interface CmsOptionsNonNullableFields$1 {
1192
- internal: boolean;
1193
- }
1194
- interface FieldPluginNonNullableFields$1 {
1195
- cmsOptions?: CmsOptionsNonNullableFields$1;
1196
- type: FieldPluginType$1;
1197
- }
1198
- interface FieldNonNullableFields$3 {
1199
- key: string;
1200
- type: Type$1;
1201
- typeMetadata?: TypeMetadataNonNullableFields$1;
1202
- systemField: boolean;
1203
- capabilities?: FieldCapabilitiesNonNullableFields$1;
1204
- encrypted: boolean;
1205
- plugins: FieldPluginNonNullableFields$1[];
1206
- }
1207
- interface PermissionsNonNullableFields$1 {
1208
- insert: Role$1;
1209
- update: Role$1;
1210
- remove: Role$1;
1211
- read: Role$1;
1212
- }
1213
- interface PublishPluginOptionsNonNullableFields$1 {
1214
- defaultStatus: Status$3;
1215
- }
1216
- interface SingleItemPluginOptionsNonNullableFields$1 {
1217
- singleItemId: string;
1218
- }
1219
- interface UrlizedPluginOptionsNonNullableFields$1 {
1220
- format: Format$1;
1221
- }
1222
- interface MultilingualOptionsNonNullableFields$1 {
1223
- translatableFieldKeys: string[];
1224
- }
1225
- interface PageLinkPluginOptionsNonNullableFields$1 {
1226
- isPersisted: boolean;
1227
- isMutable: boolean;
1228
- }
1229
- interface SiteSortNonNullableFields$1 {
1230
- sort: SortNonNullableFields$1[];
1231
- }
1232
- interface PluginCmsOptionsNonNullableFields$1 {
1233
- siteSort?: SiteSortNonNullableFields$1;
1234
- }
1235
- interface PluginNonNullableFields$1 {
1236
- publishOptions?: PublishPluginOptionsNonNullableFields$1;
1237
- singleItemOptions?: SingleItemPluginOptionsNonNullableFields$1;
1238
- urlizedOptions?: UrlizedPluginOptionsNonNullableFields$1;
1239
- multilingualOptions?: MultilingualOptionsNonNullableFields$1;
1240
- editablePageLinkOptions?: PageLinkPluginOptionsNonNullableFields$1;
1241
- cmsOptions?: PluginCmsOptionsNonNullableFields$1;
1242
- type: PluginType$1;
1243
- }
1244
- interface DataPermissionsNonNullableFields$1 {
1245
- itemRead: AccessLevel$1;
1246
- itemInsert: AccessLevel$1;
1247
- itemUpdate: AccessLevel$1;
1248
- itemRemove: AccessLevel$1;
1249
- }
1250
- interface AllowedDataPermissionsNonNullableFields$1 {
1251
- itemRead: boolean;
1252
- itemInsert: boolean;
1253
- itemUpdate: boolean;
1254
- itemRemove: boolean;
1255
- }
1256
- interface DataCollectionNonNullableFields$1 {
1257
- id: string;
1258
- collectionType: CollectionType$1;
1259
- defaultDisplayOrder?: SortNonNullableFields$1;
1260
- capabilities?: CollectionCapabilitiesNonNullableFields$1;
1261
- fields: FieldNonNullableFields$3[];
1262
- permissions?: PermissionsNonNullableFields$1;
1263
- plugins: PluginNonNullableFields$1[];
1264
- pagingModes: PagingMode$1[];
1265
- dataPermissions?: DataPermissionsNonNullableFields$1;
1266
- allowedDataPermissions?: AllowedDataPermissionsNonNullableFields$1;
1267
- }
1268
- interface CreateDataCollectionResponseNonNullableFields$1 {
1269
- collection?: DataCollectionNonNullableFields$1;
1270
- }
1271
- interface GetDataCollectionResponseNonNullableFields$1 {
1272
- collection?: DataCollectionNonNullableFields$1;
1273
- referencedCollections: DataCollectionNonNullableFields$1[];
1274
- }
1275
- interface ListDataCollectionsResponseNonNullableFields$1 {
1276
- collections: DataCollectionNonNullableFields$1[];
1277
- }
1278
- interface UpdateDataCollectionResponseNonNullableFields$1 {
1279
- collection?: DataCollectionNonNullableFields$1;
1280
- }
1281
-
1282
- /** A data collection determines the structure of data to be stored in a database. */
1283
- interface DataCollection {
1284
- /** Collection ID. For example, `my-first-collection`. May include a namespace. */
1285
- _id?: string;
1286
- /**
1287
- * Collection type. Indicates how the collection was created and how it is stored.
1288
- * @readonly
1289
- */
1290
- collectionType?: CollectionType;
1291
- /**
1292
- * ID of the app that defined this collection. For collections defined by Wix users, this value is null.
1293
- * @readonly
1294
- */
1295
- ownerAppId?: string | null;
1296
- /**
1297
- * Maximum number of items returned in a single query, based on the underlying storage.
1298
- * Native collections have a maximum page size of 1000 for offset-based queries or 100 for cursor-based queries.
1299
- * External collections' maximum page size defaults to 50, but an external provider can set any maximum value up to 1000.
1300
- * @readonly
1301
- */
1302
- maxPageSize?: number | null;
1303
- /** Collection's display name as shown in the CMS. For example, `My First Collection`. */
1304
- displayName?: string | null;
1305
- /**
1306
- * Default item sorting order when a query doesn't specify one.
1307
- * @readonly
1308
- */
1309
- defaultDisplayOrder?: Sort;
1310
- /**
1311
- * UI-friendly namespace of the Wix app with which the data collection is associated, such as Stores or Bookings.
1312
- * Empty for all data collections not owned by Wix apps.
1313
- * @readonly
1314
- */
1315
- displayNamespace?: string | null;
1316
- /** Field whose value the CMS displays to represent the collection item when referenced in a different collection. */
1317
- displayField?: string | null;
1318
- /**
1319
- * Capabilities the collection supports.
1320
- * @readonly
1321
- */
1322
- capabilities?: CollectionCapabilities;
1323
- /** Collection's field structure. */
1324
- fields?: Field$2[];
1325
- /** Levels of permission for accessing and modifying data, defined by lowest role needed to perform each action. */
1326
- permissions?: Permissions;
1327
- /**
1328
- * 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.
1329
- * @readonly
1330
- */
1331
- revision?: string | null;
1332
- /** Plugins the collection uses. Plugins apply additional capabilities to the collection or extend its functionality. */
1333
- plugins?: Plugin[];
1334
- /**
1335
- * Paging modes the collection supports. In native collections, offset-based paging is supported by default.
1336
- * @readonly
1337
- */
1338
- pagingModes?: PagingMode[];
1339
- /**
1340
- * Date the collection was created.
1341
- * @readonly
1342
- */
1343
- _createdDate?: Date | null;
1344
- /**
1345
- * Date the collection was last updated.
1346
- * @readonly
1347
- */
1348
- _updatedDate?: Date | null;
1349
- }
1350
- declare enum CollectionType {
1351
- /** User-created collection. */
1352
- NATIVE = "NATIVE",
1353
- /** [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). */
1354
- WIX_APP = "WIX_APP",
1355
- /** Collection created by a Wix Blocks app. */
1356
- BLOCKS_APP = "BLOCKS_APP",
1357
- /** Collection located in externally connected storage. */
1358
- EXTERNAL = "EXTERNAL"
1359
- }
1360
- interface Sort {
1361
- /** Field to sort by. */
1362
- fieldKey?: string;
1363
- /**
1364
- * Sort order. Use `ASC` for ascending order or `DESC` for descending order.
1365
- *
1366
- * Default: `ASC`
1367
- */
1368
- direction?: Direction;
1369
- }
1370
- declare enum Direction {
1371
- ASC = "ASC",
1372
- DESC = "DESC"
1373
- }
1374
- interface CollectionCapabilities {
1375
- /**
1376
- * Data operations the collection supports. The listed operations can be performed on data the collection contains.
1377
- *
1378
- * > **Note**: The `PATCH` and `BULK_PATCH` oeprations aren't currently supported.
1379
- */
1380
- dataOperations?: DataOperation[];
1381
- /** Collection operations supported. The listed operations can be performed on the collection itself. */
1382
- collectionOperations?: CollectionOperation[];
1383
- /** Maximum number of indexes for the collection. */
1384
- indexLimits?: IndexLimits;
1385
- }
1386
- declare enum DataOperation {
1387
- AGGREGATE = "AGGREGATE",
1388
- BULK_INSERT = "BULK_INSERT",
1389
- BULK_REMOVE = "BULK_REMOVE",
1390
- BULK_SAVE = "BULK_SAVE",
1391
- BULK_UPDATE = "BULK_UPDATE",
1392
- COUNT = "COUNT",
1393
- DISTINCT = "DISTINCT",
1394
- FIND = "FIND",
1395
- GET = "GET",
1396
- INSERT = "INSERT",
1397
- INSERT_REFERENCE = "INSERT_REFERENCE",
1398
- IS_REFERENCED = "IS_REFERENCED",
1399
- QUERY_REFERENCED = "QUERY_REFERENCED",
1400
- REMOVE = "REMOVE",
1401
- REMOVE_REFERENCE = "REMOVE_REFERENCE",
1402
- REPLACE_REFERENCES = "REPLACE_REFERENCES",
1403
- SAVE = "SAVE",
1404
- TRUNCATE = "TRUNCATE",
1405
- UPDATE = "UPDATE",
1406
- PATCH = "PATCH",
1407
- BULK_PATCH = "BULK_PATCH"
1408
- }
1409
- declare enum CollectionOperation {
1410
- /** Allows updating the collection's structure, for example adding, updating, or deleting fields. If not included, the collection's structure can't be changed. */
1411
- UPDATE = "UPDATE",
1412
- /** Allows deleting the entire collection. If not included, the collection can't be deleted. */
1413
- REMOVE = "REMOVE"
1414
- }
1415
- interface IndexLimits {
1416
- /** Maximum number of regular (non-unique) indexes allowed for this collection. */
1417
- regular?: number;
1418
- /** Maximum number of unique indexes allowed for this collection. */
1419
- unique?: number;
1420
- /** Maximum number of regular and unique indexes allowed for this collection. */
1421
- total?: number;
1422
- }
1423
- interface Field$2 extends FieldRangeValidationsOneOf {
1424
- /** Range of possible values for a numerical field. */
1425
- numberRange?: NumberRange;
1426
- /** Length range permitted for a text field. Relevant for fields that hold strings, such as those of type `TEXT` or `RICH_TEXT`. */
1427
- stringLengthRange?: StringLengthRange;
1428
- /** Array size range permitted. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`. */
1429
- arraySizeRange?: ArraySizeRange;
1430
- /** Unique identifier for the field. For example, `firstName`. */
1431
- key?: string;
1432
- /** Field's display name when displayed in the CMS. For example, `First Name`. */
1433
- displayName?: string | null;
1434
- /** Field's data type. */
1435
- type?: Type;
1436
- /** Metadata for complex data types. This property only exists for references, multi-references, objects, and arrays. */
1437
- typeMetadata?: TypeMetadata;
1438
- /**
1439
- * Whether the field is a system field.
1440
- * @readonly
1441
- */
1442
- systemField?: boolean;
1443
- /**
1444
- * Capabilities the field supports.
1445
- * @readonly
1446
- */
1447
- capabilities?: FieldCapabilities;
1448
- /** Whether the field is encrypted. */
1449
- encrypted?: boolean;
1450
- /** Field description. */
1451
- description?: string | null;
1452
- /**
1453
- * Whether the field is read-only. A read-only field can't be changed.
1454
- *
1455
- * Default: `false`
1456
- */
1457
- readOnly?: boolean | null;
1458
- /**
1459
- * Whether the field is immutable. An immutable field can be set once, but then cannot be updated.
1460
- *
1461
- * Default: `false`
1462
- */
1463
- immutable?: boolean | null;
1464
- /**
1465
- * Whether the field is required.
1466
- *
1467
- * Default: `false`
1468
- */
1469
- required?: boolean | null;
1470
- /** Additional optional plugins for the field. */
1471
- plugins?: FieldPlugin[];
1472
- }
1473
- /** @oneof */
1474
- interface FieldRangeValidationsOneOf {
1475
- /** Range of possible values for a numerical field. */
1476
- numberRange?: NumberRange;
1477
- /** Length range permitted for a text field. Relevant for fields that hold strings, such as those of type `TEXT` or `RICH_TEXT`. */
1478
- stringLengthRange?: StringLengthRange;
1479
- /** Array size range permitted. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`. */
1480
- arraySizeRange?: ArraySizeRange;
1481
- }
1482
- declare enum Type {
1483
- UNKNOWN_FIELD_TYPE = "UNKNOWN_FIELD_TYPE",
1484
- TEXT = "TEXT",
1485
- NUMBER = "NUMBER",
1486
- DATE = "DATE",
1487
- DATETIME = "DATETIME",
1488
- IMAGE = "IMAGE",
1489
- BOOLEAN = "BOOLEAN",
1490
- DOCUMENT = "DOCUMENT",
1491
- URL = "URL",
1492
- RICH_TEXT = "RICH_TEXT",
1493
- VIDEO = "VIDEO",
1494
- ANY = "ANY",
1495
- ARRAY_STRING = "ARRAY_STRING",
1496
- ARRAY_DOCUMENT = "ARRAY_DOCUMENT",
1497
- AUDIO = "AUDIO",
1498
- TIME = "TIME",
1499
- LANGUAGE = "LANGUAGE",
1500
- RICH_CONTENT = "RICH_CONTENT",
1501
- MEDIA_GALLERY = "MEDIA_GALLERY",
1502
- ADDRESS = "ADDRESS",
1503
- PAGE_LINK = "PAGE_LINK",
1504
- REFERENCE = "REFERENCE",
1505
- MULTI_REFERENCE = "MULTI_REFERENCE",
1506
- OBJECT = "OBJECT",
1507
- ARRAY = "ARRAY",
1508
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
1509
- LEGACY_TIME = "LEGACY_TIME",
1510
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
1511
- LEGACY_BOOK = "LEGACY_BOOK",
1512
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
1513
- LEGACY_EXTERNAL_URL = "LEGACY_EXTERNAL_URL",
1514
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
1515
- LEGACY_BROKEN_REFERENCE = "LEGACY_BROKEN_REFERENCE",
1516
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
1517
- LEGACY_IMAGE = "LEGACY_IMAGE",
1518
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
1519
- LEGACY_COLOR = "LEGACY_COLOR",
1520
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
1521
- LEGACY_EXTERNAL_VIDEO = "LEGACY_EXTERNAL_VIDEO"
1522
- }
1523
- interface TypeMetadata extends TypeMetadataMetadataOneOf {
1524
- /** Metadata for a reference field. */
1525
- reference?: Reference;
1526
- /** Metadata for a multi-reference field. */
1527
- multiReference?: MultiReference;
1528
- /** Metadata for an object field. */
1529
- object?: _Object;
1530
- /** Metadata for an array field. */
1531
- array?: _Array;
1532
- /** Metadata for a page link field. */
1533
- pageLink?: PageLink;
1534
- }
1535
- /** @oneof */
1536
- interface TypeMetadataMetadataOneOf {
1537
- /** Metadata for a reference field. */
1538
- reference?: Reference;
1539
- /** Metadata for a multi-reference field. */
1540
- multiReference?: MultiReference;
1541
- /** Metadata for an object field. */
1542
- object?: _Object;
1543
- /** Metadata for an array field. */
1544
- array?: _Array;
1545
- /** Metadata for a page link field. */
1546
- pageLink?: PageLink;
1547
- }
1548
- interface FieldCapabilities {
1549
- /**
1550
- * Whether the collection can be sorted by this field.
1551
- *
1552
- * Default: `false`
1553
- */
1554
- sortable?: boolean;
1555
- /** Query operators that can be used for this field. */
1556
- queryOperators?: QueryOperator[];
1557
- }
1558
- declare enum QueryOperator {
1559
- EQ = "EQ",
1560
- LT = "LT",
1561
- GT = "GT",
1562
- NE = "NE",
1563
- LTE = "LTE",
1564
- GTE = "GTE",
1565
- STARTS_WITH = "STARTS_WITH",
1566
- ENDS_WITH = "ENDS_WITH",
1567
- CONTAINS = "CONTAINS",
1568
- HAS_SOME = "HAS_SOME",
1569
- HAS_ALL = "HAS_ALL",
1570
- EXISTS = "EXISTS",
1571
- URLIZED = "URLIZED"
1572
- }
1573
- interface ObjectField {
1574
- /** Field ID. */
1575
- key?: string;
1576
- /** Display name for the field. */
1577
- displayName?: string | null;
1578
- /** Field type. */
1579
- type?: Type;
1580
- /** Metadata for complex data types. This property only exists for references, multi-references, objects, and arrays. */
1581
- typeMetadata?: TypeMetadata;
1582
- /**
1583
- * Capabilities the object field supports.
1584
- * @readonly
1585
- */
1586
- capabilities?: FieldCapabilities;
1587
- }
1588
- interface FieldsPattern {
1589
- pattern?: string;
1590
- lowercase?: boolean;
1591
- }
1592
- interface UrlizedOnlyPattern {
1593
- pattern?: string;
1594
- }
1595
- interface Calculator extends CalculatorPatternOneOf {
1596
- /** Value is calculated according to pattern, whitespaces are replaced with dash [-]. */
1597
- fieldsPattern?: FieldsPattern;
1598
- /** Value is only URL encoded. */
1599
- urlizedOnlyPattern?: UrlizedOnlyPattern;
1600
- }
1601
- /** @oneof */
1602
- interface CalculatorPatternOneOf {
1603
- /** Value is calculated according to pattern, whitespaces are replaced with dash [-]. */
1604
- fieldsPattern?: FieldsPattern;
1605
- /** Value is only URL encoded. */
1606
- urlizedOnlyPattern?: UrlizedOnlyPattern;
1607
- }
1608
- interface Reference {
1609
- /** Referenced collection ID. */
1610
- referencedCollectionId?: string;
1611
- }
1612
- interface MultiReference {
1613
- /** Referenced collection ID. */
1614
- referencedCollectionId?: string;
1615
- /** Referencing field ID. */
1616
- referencingFieldKey?: string;
1617
- /** Display name in the CMS for the referenced data. */
1618
- referencingDisplayName?: string;
1619
- }
1620
- interface _Object {
1621
- /** Fields within the object. */
1622
- fields?: ObjectField[];
1623
- }
1624
- interface _Array {
1625
- /** Element's data type. */
1626
- elementType?: Type;
1627
- /** Metadata for complex data types. This property only exists for references, multi-references, objects, and arrays. */
1628
- typeMetadata?: TypeMetadata;
1629
- }
1630
- interface PageLink {
1631
- calculator?: Calculator;
1632
- /** Defines reference to router pattern in the site document. */
1633
- linkedRouterPage?: string | null;
1634
- }
1635
- interface NumberRange {
1636
- /**
1637
- * Minimum permitted value for a numerical field.
1638
- *
1639
- * Default: No validation
1640
- */
1641
- min?: number | null;
1642
- /**
1643
- * Maximum permitted value for a numerical field.
1644
- *
1645
- * Default: No validation
1646
- */
1647
- max?: number | null;
1648
- }
1649
- interface StringLengthRange {
1650
- /**
1651
- * Minimum permitted length for a text field.
1652
- *
1653
- * Default: No validation
1654
- */
1655
- minLength?: number | null;
1656
- /**
1657
- * Maximum permitted length for a text field.
1658
- *
1659
- * Default: No validation
1660
- */
1661
- maxLength?: number | null;
1662
- }
1663
- interface ArraySizeRange {
1664
- /**
1665
- * 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`.
1666
- *
1667
- * Default: No validation
1668
- */
1669
- minSize?: number | null;
1670
- /**
1671
- * 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`.
1672
- *
1673
- * Default: No validation
1674
- */
1675
- maxSize?: number | null;
1676
- }
1677
- /** Optional plug-in aspects for fields */
1678
- interface FieldPlugin extends FieldPluginOptionsOneOf {
1679
- /** Options for the CMS plugin. */
1680
- cmsOptions?: CmsOptions;
1681
- type?: FieldPluginType;
1682
- }
1683
- /** @oneof */
1684
- interface FieldPluginOptionsOneOf {
1685
- /** Options for the CMS plugin. */
1686
- cmsOptions?: CmsOptions;
1687
- }
1688
- declare enum FieldPluginType {
1689
- /** Uknown plugin type. */
1690
- UNKNOWN = "UNKNOWN",
1691
- /** CMS-related field attributes */
1692
- CMS = "CMS"
1693
- }
1694
- /** Options for the CMS plugin. */
1695
- interface CmsOptions {
1696
- /**
1697
- * Indicates an internal CMS field. The CMS does not display internal fields.
1698
- *
1699
- * Default: `false`
1700
- */
1701
- internal?: boolean;
1702
- }
1703
- /** Permissions defined by the lowest role needed to perform each action. */
1704
- interface Permissions {
1705
- /** Lowest role needed to add a collection. */
1706
- insert?: Role;
1707
- /** Lowest role needed to update a collection. */
1708
- update?: Role;
1709
- /** Lowest role needed to remove a collection. */
1710
- remove?: Role;
1711
- /** Lowest role needed to read a collection. */
1712
- read?: Role;
1713
- }
1714
- declare enum Role {
1715
- /** Unknown role. */
1716
- UNKNOWN_ROLE = "UNKNOWN_ROLE",
1717
- /** Site administrator. */
1718
- ADMIN = "ADMIN",
1719
- /** Signed-in user who added content to this collection. */
1720
- SITE_MEMBER_AUTHOR = "SITE_MEMBER_AUTHOR",
1721
- /** Any signed-in user. */
1722
- SITE_MEMBER = "SITE_MEMBER",
1723
- /** Any site visitor. */
1724
- ANYONE = "ANYONE"
1725
- }
1726
- interface Plugin extends PluginOptionsOneOf {
1727
- /**
1728
- * Options for the Publish plugin.
1729
- * 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.
1730
- */
1731
- publishOptions?: PublishPluginOptions$1;
1732
- /** Options for the Single Item plugin. */
1733
- singleItemOptions?: SingleItemPluginOptions;
1734
- /** Options for the Urlized plugin. */
1735
- urlizedOptions?: UrlizedPluginOptions;
1736
- /** Options for the Multilingual plugin. */
1737
- multilingualOptions?: MultilingualOptions;
1738
- /** Options for the PageLink plugin. */
1739
- editablePageLinkOptions?: PageLinkPluginOptions;
1740
- /** Options for the CMS plugin. */
1741
- cmsOptions?: PluginCmsOptions;
1742
- /** Plugin types. */
1743
- type?: PluginType;
1744
- }
1745
- /** @oneof */
1746
- interface PluginOptionsOneOf {
1747
- /**
1748
- * Options for the Publish plugin.
1749
- * 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.
1750
- */
1751
- publishOptions?: PublishPluginOptions$1;
1752
- /** Options for the Single Item plugin. */
1753
- singleItemOptions?: SingleItemPluginOptions;
1754
- /** Options for the Urlized plugin. */
1755
- urlizedOptions?: UrlizedPluginOptions;
1756
- /** Options for the Multilingual plugin. */
1757
- multilingualOptions?: MultilingualOptions;
1758
- /** Options for the PageLink plugin. */
1759
- editablePageLinkOptions?: PageLinkPluginOptions;
1760
- /** Options for the CMS plugin. */
1761
- cmsOptions?: PluginCmsOptions;
1762
- }
1763
- declare enum Status$2 {
1764
- UNKNOWN_PUBLISH_PLUGIN_STATUS = "UNKNOWN_PUBLISH_PLUGIN_STATUS",
1765
- PUBLISHED = "PUBLISHED",
1766
- DRAFT = "DRAFT"
1767
- }
1768
- declare enum Format {
1769
- UNKNOWN_URLIZED_PLUGIN_FORMAT = "UNKNOWN_URLIZED_PLUGIN_FORMAT",
1770
- /** Letters are converted to lower case and spaces are replaced with dashes before generating the encoded URL. */
1771
- ORIGINAL = "ORIGINAL",
1772
- /** No changes are made before generating the encoded URL. */
1773
- PLAIN = "PLAIN"
1774
- }
1775
- /** if CMS-defined sort is enabled and should be used in site */
1776
- interface SiteSort {
1777
- /** Field and order for the site sort. */
1778
- sort?: Sort[];
1779
- }
1780
- declare enum PluginType {
1781
- /** Unknown plugin type. */
1782
- UNKNOWN_PLUGIN_TYPE = "UNKNOWN_PLUGIN_TYPE",
1783
- /** 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. */
1784
- PUBLISH = "PUBLISH",
1785
- /** Ensures the collection can have one item at most. Can only be applied to a new collection. */
1786
- SINGLE_ITEM = "SINGLE_ITEM",
1787
- /** Generates item URLs for collections used by dynamic pages. */
1788
- URLIZED = "URLIZED",
1789
- /** Deprecated. Will be removed in the future. */
1790
- GRIDAPPLESS = "GRIDAPPLESS",
1791
- /** 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). */
1792
- MULTILINGUAL = "MULTILINGUAL",
1793
- /** Indicates that collection is shared with current site. */
1794
- SHARED = "SHARED",
1795
- /** Indicates that page link fields are persisted and can be updated. */
1796
- EDITABLE_PAGE_LINK = "EDITABLE_PAGE_LINK",
1797
- /** CMS-specific collection properties. */
1798
- CMS = "CMS"
1799
- }
1800
- interface PublishPluginOptions$1 {
1801
- /** Default status. */
1802
- defaultStatus?: Status$2;
1803
- }
1804
- interface SingleItemPluginOptions {
1805
- /** ID of the single item in this collection. If you insert or update an item, its ID value is always changed to this. */
1806
- singleItemId?: string;
1807
- }
1808
- interface UrlizedPluginOptions {
1809
- /** Encoding method for generating a URL in ASCII characters. */
1810
- format?: Format;
1811
- }
1812
- interface MultilingualOptions {
1813
- /** IDs of fields to allow translation. */
1814
- translatableFieldKeys?: string[];
1815
- }
1816
- interface PageLinkPluginOptions {
1817
- isPersisted?: boolean;
1818
- isMutable?: boolean;
1819
- }
1820
- interface PluginCmsOptions {
1821
- /** CMS sort, applied when a collection is displayed on a site. */
1822
- siteSort?: SiteSort;
1823
- }
1824
- declare enum PagingMode {
1825
- /** Offset-based paging. */
1826
- OFFSET = "OFFSET",
1827
- /** Cursor-based paging. */
1828
- CURSOR = "CURSOR"
1829
- }
1830
- /**
1831
- * Describes who can perform certain action.
1832
- * Each level includes all levels below it (except UNDEFINED).
1833
- */
1834
- declare enum AccessLevel {
1835
- /** Not set. */
1836
- UNDEFINED = "UNDEFINED",
1837
- /** Any subject, including visitors. */
1838
- ANYONE = "ANYONE",
1839
- /** Any signed-in user (both site members and collaborators). */
1840
- SITE_MEMBER = "SITE_MEMBER",
1841
- /** Any signed-in user, but site members only have access to own items. */
1842
- SITE_MEMBER_AUTHOR = "SITE_MEMBER_AUTHOR",
1843
- /** Site collaborator that has a role with CMS Access permission. */
1844
- CMS_EDITOR = "CMS_EDITOR",
1845
- /** CMS administrators and users or roles granted with special access. */
1846
- PRIVILEGED = "PRIVILEGED"
1847
- }
1848
- interface CreateDataCollectionRequest {
1849
- /** Collection details. */
1850
- collection: DataCollection;
1851
- }
1852
- interface CreateDataCollectionResponse {
1853
- /** Details of collection created. */
1854
- collection?: DataCollection;
1855
- }
1856
- interface GetDataCollectionRequest {
1857
- /** ID of the collection to retrieve. */
1858
- dataCollectionId: string;
1859
- /**
1860
- * Whether to retrieve data from the primary database instance.
1861
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
1862
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
1863
- *
1864
- * Default: `false`
1865
- */
1866
- consistentRead?: boolean;
1867
- /**
1868
- * List of specific field names to return, if empty all fields are returned.
1869
- * Affects all returned collections
1870
- */
1871
- fields?: string[];
1872
- }
1873
- interface GetDataCollectionResponse {
1874
- /** Details of the collection requested. */
1875
- collection?: DataCollection;
1876
- /**
1877
- * Details of collections referenced by the collection requested.
1878
- * Only populated when `includeReferencedCollections` is `true` in the request.
1879
- */
1880
- referencedCollections?: DataCollection[];
1881
- }
1882
- interface ListDataCollectionsRequest {
1883
- /**
1884
- * Defines how collections in the response are sorted.
1885
- *
1886
- * Default: Ordered by ID in ascending order.
1887
- */
1888
- sort?: Sorting;
1889
- /** Pagination information. */
1890
- paging?: Paging$2;
1891
- /**
1892
- * Whether to retrieve data from the primary database instance.
1893
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
1894
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
1895
- *
1896
- * Default: `false`
1897
- */
1898
- consistentRead?: boolean;
1899
- /**
1900
- * List of specific field names to return, if empty all fields are returned.
1901
- * Affects all returned collections
1902
- */
1903
- fields?: string[];
1904
- }
1905
- interface Sorting {
1906
- /** Name of the field to sort by. */
1907
- fieldName?: string;
1908
- /** Sort order. */
1909
- order?: SortOrder;
1910
- }
1911
- declare enum SortOrder {
1912
- ASC = "ASC",
1913
- DESC = "DESC"
1914
- }
1915
- interface Paging$2 {
1916
- /** Number of items to load. */
1917
- limit?: number | null;
1918
- /** Number of items to skip in the current sort order. */
1919
- offset?: number | null;
1920
- }
1921
- interface ListDataCollectionsResponse {
1922
- /** List of collections. */
1923
- collections?: DataCollection[];
1924
- /** Paging information. */
1925
- pagingMetadata?: PagingMetadataV2;
1926
- }
1927
- interface PagingMetadataV2 {
1928
- /** Number of items returned in the response. */
1929
- count?: number | null;
1930
- /** Offset that was requested. */
1931
- offset?: number | null;
1932
- /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
1933
- total?: number | null;
1934
- /** Flag that indicates the server failed to calculate the `total` field. */
1935
- tooManyToCount?: boolean | null;
1936
- }
1937
- interface UpdateDataCollectionRequest {
1938
- /** Updated collection details. The existing collection is replaced with this version. */
1939
- collection: DataCollection;
1940
- }
1941
- interface UpdateDataCollectionResponse {
1942
- /** Updated collection details. */
1943
- collection?: DataCollection;
1944
- }
1945
- interface DeleteDataCollectionRequest {
1946
- /** ID of the collection to delete. */
1947
- dataCollectionId: string;
1948
- }
1949
- interface DeleteDataCollectionResponse {
1950
- }
1951
- interface SortNonNullableFields {
1952
- fieldKey: string;
1953
- direction: Direction;
1954
- }
1955
- interface IndexLimitsNonNullableFields {
1956
- regular: number;
1957
- unique: number;
1958
- total: number;
1959
- }
1960
- interface CollectionCapabilitiesNonNullableFields {
1961
- dataOperations: DataOperation[];
1962
- collectionOperations: CollectionOperation[];
1963
- indexLimits?: IndexLimitsNonNullableFields;
1964
- }
1965
- interface ReferenceNonNullableFields {
1966
- referencedCollectionId: string;
1967
- }
1968
- interface MultiReferenceNonNullableFields {
1969
- referencedCollectionId: string;
1970
- referencingFieldKey: string;
1971
- referencingDisplayName: string;
1972
- }
1973
- interface FieldCapabilitiesNonNullableFields {
1974
- sortable: boolean;
1975
- queryOperators: QueryOperator[];
1976
- }
1977
- interface ObjectFieldNonNullableFields {
1978
- key: string;
1979
- type: Type;
1980
- typeMetadata?: TypeMetadataNonNullableFields;
1981
- capabilities?: FieldCapabilitiesNonNullableFields;
1982
- }
1983
- interface _ObjectNonNullableFields {
1984
- fields: ObjectFieldNonNullableFields[];
1985
- }
1986
- interface _ArrayNonNullableFields {
1987
- elementType: Type;
1988
- typeMetadata?: TypeMetadataNonNullableFields;
1989
- }
1990
- interface FieldsPatternNonNullableFields {
1991
- pattern: string;
1992
- lowercase: boolean;
1993
- }
1994
- interface UrlizedOnlyPatternNonNullableFields {
1995
- pattern: string;
1996
- }
1997
- interface CalculatorNonNullableFields {
1998
- fieldsPattern?: FieldsPatternNonNullableFields;
1999
- urlizedOnlyPattern?: UrlizedOnlyPatternNonNullableFields;
2000
- }
2001
- interface PageLinkNonNullableFields {
2002
- calculator?: CalculatorNonNullableFields;
2003
- }
2004
- interface TypeMetadataNonNullableFields {
2005
- reference?: ReferenceNonNullableFields;
2006
- multiReference?: MultiReferenceNonNullableFields;
2007
- object?: _ObjectNonNullableFields;
2008
- array?: _ArrayNonNullableFields;
2009
- pageLink?: PageLinkNonNullableFields;
2010
- }
2011
- interface CmsOptionsNonNullableFields {
2012
- internal: boolean;
2013
- }
2014
- interface FieldPluginNonNullableFields {
2015
- cmsOptions?: CmsOptionsNonNullableFields;
2016
- type: FieldPluginType;
2017
- }
2018
- interface FieldNonNullableFields$2 {
2019
- key: string;
2020
- type: Type;
2021
- typeMetadata?: TypeMetadataNonNullableFields;
2022
- systemField: boolean;
2023
- capabilities?: FieldCapabilitiesNonNullableFields;
2024
- encrypted: boolean;
2025
- plugins: FieldPluginNonNullableFields[];
2026
- }
2027
- interface PermissionsNonNullableFields {
2028
- insert: Role;
2029
- update: Role;
2030
- remove: Role;
2031
- read: Role;
2032
- }
2033
- interface PublishPluginOptionsNonNullableFields {
2034
- defaultStatus: Status$2;
2035
- }
2036
- interface SingleItemPluginOptionsNonNullableFields {
2037
- singleItemId: string;
2038
- }
2039
- interface UrlizedPluginOptionsNonNullableFields {
2040
- format: Format;
2041
- }
2042
- interface MultilingualOptionsNonNullableFields {
2043
- translatableFieldKeys: string[];
2044
- }
2045
- interface PageLinkPluginOptionsNonNullableFields {
2046
- isPersisted: boolean;
2047
- isMutable: boolean;
2048
- }
2049
- interface SiteSortNonNullableFields {
2050
- sort: SortNonNullableFields[];
2051
- }
2052
- interface PluginCmsOptionsNonNullableFields {
2053
- siteSort?: SiteSortNonNullableFields;
2054
- }
2055
- interface PluginNonNullableFields {
2056
- publishOptions?: PublishPluginOptionsNonNullableFields;
2057
- singleItemOptions?: SingleItemPluginOptionsNonNullableFields;
2058
- urlizedOptions?: UrlizedPluginOptionsNonNullableFields;
2059
- multilingualOptions?: MultilingualOptionsNonNullableFields;
2060
- editablePageLinkOptions?: PageLinkPluginOptionsNonNullableFields;
2061
- cmsOptions?: PluginCmsOptionsNonNullableFields;
2062
- type: PluginType;
2063
- }
2064
- interface DataPermissionsNonNullableFields {
2065
- itemRead: AccessLevel;
2066
- itemInsert: AccessLevel;
2067
- itemUpdate: AccessLevel;
2068
- itemRemove: AccessLevel;
2069
- }
2070
- interface AllowedDataPermissionsNonNullableFields {
2071
- itemRead: boolean;
2072
- itemInsert: boolean;
2073
- itemUpdate: boolean;
2074
- itemRemove: boolean;
2075
- }
2076
- interface DataCollectionNonNullableFields {
2077
- _id: string;
2078
- collectionType: CollectionType;
2079
- defaultDisplayOrder?: SortNonNullableFields;
2080
- capabilities?: CollectionCapabilitiesNonNullableFields;
2081
- fields: FieldNonNullableFields$2[];
2082
- permissions?: PermissionsNonNullableFields;
2083
- plugins: PluginNonNullableFields[];
2084
- pagingModes: PagingMode[];
2085
- dataPermissions?: DataPermissionsNonNullableFields;
2086
- allowedDataPermissions?: AllowedDataPermissionsNonNullableFields;
2087
- }
2088
- interface CreateDataCollectionResponseNonNullableFields {
2089
- collection?: DataCollectionNonNullableFields;
2090
- }
2091
- interface GetDataCollectionResponseNonNullableFields {
2092
- collection?: DataCollectionNonNullableFields;
2093
- referencedCollections: DataCollectionNonNullableFields[];
2094
- }
2095
- interface ListDataCollectionsResponseNonNullableFields {
2096
- collections: DataCollectionNonNullableFields[];
2097
- }
2098
- interface UpdateDataCollectionResponseNonNullableFields {
2099
- collection?: DataCollectionNonNullableFields;
2100
- }
2101
-
2102
- type __PublicMethodMetaInfo$2<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
2103
- getUrl: (context: any) => string;
2104
- httpMethod: K;
2105
- path: string;
2106
- pathParams: M;
2107
- __requestType: T;
2108
- __originalRequestType: S;
2109
- __responseType: Q;
2110
- __originalResponseType: R;
2111
- };
2112
- declare function createDataCollection(): __PublicMethodMetaInfo$2<'POST', {}, CreateDataCollectionRequest, CreateDataCollectionRequest$1, CreateDataCollectionResponse & CreateDataCollectionResponseNonNullableFields, CreateDataCollectionResponse$1 & CreateDataCollectionResponseNonNullableFields$1>;
2113
- declare function getDataCollection(): __PublicMethodMetaInfo$2<'GET', {
2114
- dataCollectionId: string;
2115
- }, GetDataCollectionRequest, GetDataCollectionRequest$1, GetDataCollectionResponse & GetDataCollectionResponseNonNullableFields, GetDataCollectionResponse$1 & GetDataCollectionResponseNonNullableFields$1>;
2116
- declare function listDataCollections(): __PublicMethodMetaInfo$2<'GET', {}, ListDataCollectionsRequest, ListDataCollectionsRequest$1, ListDataCollectionsResponse & ListDataCollectionsResponseNonNullableFields, ListDataCollectionsResponse$1 & ListDataCollectionsResponseNonNullableFields$1>;
2117
- declare function updateDataCollection(): __PublicMethodMetaInfo$2<'PUT', {}, UpdateDataCollectionRequest, UpdateDataCollectionRequest$1, UpdateDataCollectionResponse & UpdateDataCollectionResponseNonNullableFields, UpdateDataCollectionResponse$1 & UpdateDataCollectionResponseNonNullableFields$1>;
2118
- declare function deleteDataCollection(): __PublicMethodMetaInfo$2<'DELETE', {
2119
- dataCollectionId: string;
2120
- }, DeleteDataCollectionRequest, DeleteDataCollectionRequest$1, DeleteDataCollectionResponse, DeleteDataCollectionResponse$1>;
2121
-
2122
- declare const meta$1_createDataCollection: typeof createDataCollection;
2123
- declare const meta$1_deleteDataCollection: typeof deleteDataCollection;
2124
- declare const meta$1_getDataCollection: typeof getDataCollection;
2125
- declare const meta$1_listDataCollections: typeof listDataCollections;
2126
- declare const meta$1_updateDataCollection: typeof updateDataCollection;
2127
- declare namespace meta$1 {
2128
- export { type __PublicMethodMetaInfo$2 as __PublicMethodMetaInfo, meta$1_createDataCollection as createDataCollection, meta$1_deleteDataCollection as deleteDataCollection, meta$1_getDataCollection as getDataCollection, meta$1_listDataCollections as listDataCollections, meta$1_updateDataCollection as updateDataCollection };
2129
- }
2130
-
2131
- /** An index is a map of a collection's data, organized according to specific fields to increase query speed. */
2132
- interface Index$1 {
2133
- /** Name of the index. */
2134
- name?: string;
2135
- /**
2136
- * Fields for which the index is defined.
2137
- *
2138
- * Max: 3 fields (for a unique index: 1 field)
2139
- */
2140
- fields?: Field$1[];
2141
- /**
2142
- * Current status of the index.
2143
- * @readonly
2144
- */
2145
- status?: Status$1;
2146
- /**
2147
- * Contains details about the reasons for failure when `status` is `FAILED`.
2148
- * @readonly
2149
- */
2150
- failure?: Failure$1;
2151
- /**
2152
- * Whether the index enforces uniqueness of values in the field for which it is defined.
2153
- * If `true`, the index can have only one field.
2154
- *
2155
- * Default: `false`
2156
- */
2157
- unique?: boolean;
2158
- /**
2159
- * Whether the index ignores case.
2160
- *
2161
- * Default: `false`
2162
- */
2163
- caseInsensitive?: boolean;
2164
- }
2165
- /**
2166
- * Order determines how values are ordered in the index. This is important when
2167
- * ordering and/or range querying by indexed fields.
2168
- */
2169
- declare enum Order$1 {
2170
- ASC = "ASC",
2171
- DESC = "DESC"
2172
- }
2173
- interface Field$1 {
2174
- /** Path of the field to index. For example: `title` or `options.price`. */
2175
- path?: string;
2176
- /**
2177
- * Sort order for the index. Base on how the data is regularly queried.
2178
- *
2179
- * Default: `ASC`
2180
- */
2181
- order?: Order$1;
2182
- }
2183
- declare enum Status$1 {
2184
- /** Place holder. Never returned by the service. */
2185
- UNKNOWN = "UNKNOWN",
2186
- /** Index creation is in progress. */
2187
- BUILDING = "BUILDING",
2188
- /** Index has been successfully created and can be used in queries. */
2189
- ACTIVE = "ACTIVE",
2190
- /** Index is in the process of being dropped. */
2191
- DROPPING = "DROPPING",
2192
- /** Index has been dropped successfully. */
2193
- DROPPED = "DROPPED",
2194
- /** Index creation has failed. */
2195
- FAILED = "FAILED",
2196
- /** Index contains incorrectly indexed data. */
2197
- INVALID = "INVALID"
2198
- }
2199
- interface Failure$1 {
2200
- /**
2201
- * Error code.
2202
- * - `WDE0112`: Unknown error while building collection index.
2203
- * - `WDE0113`: Duplicate key error while building collection index.
2204
- * - `WDE0114`: Document too large while building collection index.
2205
- */
2206
- code?: string;
2207
- /** Description of the failure. */
2208
- description?: string;
2209
- /**
2210
- * ID of the data item that caused the failure.
2211
- * For example, if `unique` is `true`, the ID of an item containing a duplicate value.
2212
- */
2213
- itemId?: string | null;
2214
- }
2215
- interface CreateIndexRequest$1 {
2216
- /** Details of the index to be created. */
2217
- index: Index$1;
2218
- /** ID of the data collection for which to generate the index. */
2219
- dataCollectionId: string;
2220
- }
2221
- interface CreateIndexResponse$1 {
2222
- /** Details of the index being generated. */
2223
- index?: Index$1;
2224
- }
2225
- interface DropIndexRequest$1 {
2226
- /** Name of the index to drop. */
2227
- indexName: string;
2228
- /** ID of the data collection for which the index to be dropped is defined. */
2229
- dataCollectionId: string;
2230
- }
2231
- interface DropIndexResponse$1 {
2232
- }
2233
- interface ListIndexesRequest$1 {
2234
- /** ID of the data collection for which to list indexes. */
2235
- dataCollectionId: string;
2236
- /** Paging options to limit and skip the number of items. */
2237
- paging?: Paging$1;
2238
- }
2239
- interface Paging$1 {
2240
- /** Number of items to load. */
2241
- limit?: number | null;
2242
- /** Number of items to skip in the current sort order. */
2243
- offset?: number | null;
2244
- }
2245
- interface ListIndexesResponse$1 {
2246
- /** List of all indexes for the requested data collection. */
2247
- indexes?: Index$1[];
2248
- /** Paging metadata. */
2249
- pagingMetadata?: PagingMetadata$1;
2250
- }
2251
- interface PagingMetadata$1 {
2252
- /** Number of items returned in the response. */
2253
- count?: number | null;
2254
- /** Offset that was requested. */
2255
- offset?: number | null;
2256
- /** Total number of items that match the query. */
2257
- total?: number | null;
2258
- /** Flag that indicates the server failed to calculate the `total` field. */
2259
- tooManyToCount?: boolean | null;
2260
- }
2261
- interface FieldNonNullableFields$1 {
2262
- path: string;
2263
- order: Order$1;
2264
- }
2265
- interface FailureNonNullableFields$1 {
2266
- code: string;
2267
- broadCode: string;
2268
- description: string;
2269
- }
2270
- interface IndexNonNullableFields$1 {
2271
- name: string;
2272
- fields: FieldNonNullableFields$1[];
2273
- status: Status$1;
2274
- failure?: FailureNonNullableFields$1;
2275
- unique: boolean;
2276
- caseInsensitive: boolean;
2277
- }
2278
- interface CreateIndexResponseNonNullableFields$1 {
2279
- index?: IndexNonNullableFields$1;
2280
- }
2281
- interface ListIndexesResponseNonNullableFields$1 {
2282
- indexes: IndexNonNullableFields$1[];
2283
- }
2284
-
2285
- /** An index is a map of a collection's data, organized according to specific fields to increase query speed. */
2286
- interface Index {
2287
- /** Name of the index. */
2288
- name?: string;
2289
- /**
2290
- * Fields for which the index is defined.
2291
- *
2292
- * Max: 3 fields (for a unique index: 1 field)
2293
- */
2294
- fields?: Field[];
2295
- /**
2296
- * Current status of the index.
2297
- * @readonly
2298
- */
2299
- status?: Status;
2300
- /**
2301
- * Contains details about the reasons for failure when `status` is `FAILED`.
2302
- * @readonly
2303
- */
2304
- failure?: Failure;
2305
- /**
2306
- * Whether the index enforces uniqueness of values in the field for which it is defined.
2307
- * If `true`, the index can have only one field.
2308
- *
2309
- * Default: `false`
2310
- */
2311
- unique?: boolean;
2312
- /**
2313
- * Whether the index ignores case.
2314
- *
2315
- * Default: `false`
2316
- */
2317
- caseInsensitive?: boolean;
2318
- }
2319
- /**
2320
- * Order determines how values are ordered in the index. This is important when
2321
- * ordering and/or range querying by indexed fields.
2322
- */
2323
- declare enum Order {
2324
- ASC = "ASC",
2325
- DESC = "DESC"
2326
- }
2327
- interface Field {
2328
- /** Path of the field to index. For example: `title` or `options.price`. */
2329
- path?: string;
2330
- /**
2331
- * Sort order for the index. Base on how the data is regularly queried.
2332
- *
2333
- * Default: `ASC`
2334
- */
2335
- order?: Order;
2336
- }
2337
- declare enum Status {
2338
- /** Place holder. Never returned by the service. */
2339
- UNKNOWN = "UNKNOWN",
2340
- /** Index creation is in progress. */
2341
- BUILDING = "BUILDING",
2342
- /** Index has been successfully created and can be used in queries. */
2343
- ACTIVE = "ACTIVE",
2344
- /** Index is in the process of being dropped. */
2345
- DROPPING = "DROPPING",
2346
- /** Index has been dropped successfully. */
2347
- DROPPED = "DROPPED",
2348
- /** Index creation has failed. */
2349
- FAILED = "FAILED",
2350
- /** Index contains incorrectly indexed data. */
2351
- INVALID = "INVALID"
2352
- }
2353
- interface Failure {
2354
- /**
2355
- * Error code.
2356
- * - `WDE0112`: Unknown error while building collection index.
2357
- * - `WDE0113`: Duplicate key error while building collection index.
2358
- * - `WDE0114`: Document too large while building collection index.
2359
- */
2360
- code?: string;
2361
- /** Description of the failure. */
2362
- description?: string;
2363
- /**
2364
- * ID of the data item that caused the failure.
2365
- * For example, if `unique` is `true`, the ID of an item containing a duplicate value.
2366
- */
2367
- itemId?: string | null;
2368
- }
2369
- interface CreateIndexRequest {
2370
- /** Details of the index to be created. */
2371
- index: Index;
2372
- /** ID of the data collection for which to generate the index. */
2373
- dataCollectionId: string;
2374
- }
2375
- interface CreateIndexResponse {
2376
- /** Details of the index being generated. */
2377
- index?: Index;
2378
- }
2379
- interface DropIndexRequest {
2380
- /** Name of the index to drop. */
2381
- indexName: string;
2382
- /** ID of the data collection for which the index to be dropped is defined. */
2383
- dataCollectionId: string;
2384
- }
2385
- interface DropIndexResponse {
2386
- }
2387
- interface ListIndexesRequest {
2388
- /** ID of the data collection for which to list indexes. */
2389
- dataCollectionId: string;
2390
- /** Paging options to limit and skip the number of items. */
2391
- paging?: Paging;
2392
- }
2393
- interface Paging {
2394
- /** Number of items to load. */
2395
- limit?: number | null;
2396
- /** Number of items to skip in the current sort order. */
2397
- offset?: number | null;
2398
- }
2399
- interface ListIndexesResponse {
2400
- /** List of all indexes for the requested data collection. */
2401
- indexes?: Index[];
2402
- /** Paging metadata. */
2403
- pagingMetadata?: PagingMetadata;
2404
- }
2405
- interface PagingMetadata {
2406
- /** Number of items returned in the response. */
2407
- count?: number | null;
2408
- /** Offset that was requested. */
2409
- offset?: number | null;
2410
- /** Total number of items that match the query. */
2411
- total?: number | null;
2412
- /** Flag that indicates the server failed to calculate the `total` field. */
2413
- tooManyToCount?: boolean | null;
2414
- }
2415
- interface FieldNonNullableFields {
2416
- path: string;
2417
- order: Order;
2418
- }
2419
- interface FailureNonNullableFields {
2420
- code: string;
2421
- broadCode: string;
2422
- description: string;
2423
- }
2424
- interface IndexNonNullableFields {
2425
- name: string;
2426
- fields: FieldNonNullableFields[];
2427
- status: Status;
2428
- failure?: FailureNonNullableFields;
2429
- unique: boolean;
2430
- caseInsensitive: boolean;
2431
- }
2432
- interface CreateIndexResponseNonNullableFields {
2433
- index?: IndexNonNullableFields;
2434
- }
2435
- interface ListIndexesResponseNonNullableFields {
2436
- indexes: IndexNonNullableFields[];
2437
- }
2438
-
2439
- type __PublicMethodMetaInfo$1<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
2440
- getUrl: (context: any) => string;
2441
- httpMethod: K;
2442
- path: string;
2443
- pathParams: M;
2444
- __requestType: T;
2445
- __originalRequestType: S;
2446
- __responseType: Q;
2447
- __originalResponseType: R;
2448
- };
2449
- declare function createIndex(): __PublicMethodMetaInfo$1<'POST', {}, CreateIndexRequest, CreateIndexRequest$1, CreateIndexResponse & CreateIndexResponseNonNullableFields, CreateIndexResponse$1 & CreateIndexResponseNonNullableFields$1>;
2450
- declare function dropIndex(): __PublicMethodMetaInfo$1<'DELETE', {}, DropIndexRequest, DropIndexRequest$1, DropIndexResponse, DropIndexResponse$1>;
2451
- declare function listIndexes(): __PublicMethodMetaInfo$1<'GET', {}, ListIndexesRequest, ListIndexesRequest$1, ListIndexesResponse & ListIndexesResponseNonNullableFields, ListIndexesResponse$1 & ListIndexesResponseNonNullableFields$1>;
2452
-
2453
- declare const meta_createIndex: typeof createIndex;
2454
- declare const meta_dropIndex: typeof dropIndex;
2455
- declare const meta_listIndexes: typeof listIndexes;
2456
- declare namespace meta {
2457
- export { type __PublicMethodMetaInfo$1 as __PublicMethodMetaInfo, meta_createIndex as createIndex, meta_dropIndex as dropIndex, meta_listIndexes as listIndexes };
2458
- }
2459
-
2460
- declare global {
2461
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
2462
- interface SymbolConstructor {
2463
- readonly observable: symbol;
2464
- }
2465
- }
2466
-
2467
- declare global {
2468
- interface ContextualClient {
2469
- }
2470
- }
2471
-
2472
- interface DataItem {
2473
- /** Data item ID. */
2474
- id?: string;
2475
- /**
2476
- * ID of the collection to which this item belongs.
2477
- * @readonly
2478
- */
2479
- dataCollectionId?: string;
2480
- /**
2481
- * Data item contents.
2482
- *
2483
- * Property-value pairs representing the data item's payload. When retrieving a data item, it also includes the following read-only fields:
2484
- *
2485
- * + `_id`: Item ID.
2486
- * + `_createdDate`: Date and time the item was added to the collection.
2487
- * + `_updatedDate`: Date and time the item was last modified. When the item is first inserted, `_createdDate` and `_updatedDate` have the same value.
2488
- * + `_ownerId`: ID of the user who created the item. Can be modified with site owner permissions.
2489
- */
2490
- data?: Record<string, any> | null;
2491
- }
2492
- interface InsertDataItemRequest {
2493
- /**
2494
- * Environment: `LIVE` or `SANDBOX`.
2495
- * @internal
2496
- */
2497
- environment?: Environment;
2498
- /** ID of the collection in which to insert the item. */
2499
- dataCollectionId: string;
2500
- /** Item to insert. */
2501
- dataItem: DataItem;
2502
- /**
2503
- * Grid app id. Optional in Live segment.
2504
- * @internal
2505
- */
2506
- appId?: string | null;
2507
- /**
2508
- * If true, referenced items will be included.
2509
- * @internal
2510
- */
2511
- includeReferencedItems?: boolean;
2512
- /**
2513
- * Data access options
2514
- * @internal
2515
- * @deprecated
2516
- * @replacedBy inlined
2517
- * @removalDate 2024-07-12
2518
- */
2519
- options?: Options;
2520
- /**
2521
- * Should hooks execution be suppressed.
2522
- * This option can only be used with Corvid backend
2523
- * code identity.
2524
- * @internal
2525
- */
2526
- suppressHooks?: boolean;
2527
- /** @internal */
2528
- appOptions?: Record<string, any> | null;
2529
- }
2530
- declare enum Environment {
2531
- LIVE = "LIVE",
2532
- SANDBOX = "SANDBOX",
2533
- SANDBOX_PREFERRED = "SANDBOX_PREFERRED"
2534
- }
2535
- interface Options {
2536
- /**
2537
- * Should hooks execution be suppressed.
2538
- * This option can only be used with Corvid backend
2539
- * code identity.
2540
- * @internal
2541
- */
2542
- suppressHooks?: boolean;
2543
- /** @internal */
2544
- appOptions?: Record<string, any> | null;
2545
- /** @internal */
2546
- publishPluginOptions?: PublishPluginOptions;
2547
- }
2548
- interface PublishPluginOptions {
2549
- showDraftItems?: boolean;
2550
- }
2551
- interface InsertDataItemResponse {
2552
- /** Inserted data item. */
2553
- dataItem?: DataItem;
2554
- }
2555
- interface PatchDataItemRequest {
2556
- /**
2557
- * Environment: `LIVE` or `SANDBOX`.
2558
- * @internal
2559
- */
2560
- environment?: Environment;
2561
- /** ID of the collection containing the existing item. */
2562
- dataCollectionId: string;
2563
- /** Patch set applied during item update. */
2564
- patchSet: PatchSet;
2565
- /**
2566
- * Grid app id. Optional in Live segment.
2567
- * @internal
2568
- */
2569
- appId?: string | null;
2570
- /**
2571
- * Data access options
2572
- * @internal
2573
- * @deprecated
2574
- * @replacedBy inlined
2575
- * @removalDate 2024-07-12
2576
- */
2577
- options?: Options;
2578
- /**
2579
- * Should hooks execution be suppressed.
2580
- * This option can only be used with Corvid backend
2581
- * code identity.
2582
- * @internal
2583
- */
2584
- suppressHooks?: boolean;
2585
- /** @internal */
2586
- appOptions?: Record<string, any> | null;
2587
- /** @internal */
2588
- publishPluginOptions?: DataPublishPluginOptions;
2589
- }
2590
- interface PatchSet {
2591
- /** Data item ID. */
2592
- dataItemId?: string;
2593
- /** Set of field updates to be applied. */
2594
- fieldUpdates?: FieldUpdate[];
2595
- }
2596
- interface FieldUpdate extends FieldUpdateActionOptionsOneOf {
2597
- setField?: SetField;
2598
- incrementField?: IncrementField;
2599
- appendToArray?: AppendToArray;
2600
- removeFromArray?: RemoveFromArray;
2601
- /** Field key to be patched. For ex "title", "address.street" */
2602
- fieldPath?: string;
2603
- /** Action to be applied */
2604
- action?: ACTION;
2605
- }
2606
- /** @oneof */
2607
- interface FieldUpdateActionOptionsOneOf {
2608
- setField?: SetField;
2609
- incrementField?: IncrementField;
2610
- appendToArray?: AppendToArray;
2611
- removeFromArray?: RemoveFromArray;
2612
- }
2613
- declare enum ACTION {
2614
- UNKNOWN_ACTION = "UNKNOWN_ACTION",
2615
- SET_FIELD = "SET_FIELD",
2616
- REMOVE_FIELD = "REMOVE_FIELD",
2617
- INCREMENT_FIELD = "INCREMENT_FIELD",
2618
- APPEND_TO_ARRAY = "APPEND_TO_ARRAY",
2619
- REMOVE_FROM_ARRAY = "REMOVE_FROM_ARRAY"
2620
- }
2621
- interface SetField {
2622
- value?: any;
2623
- }
2624
- interface IncrementField {
2625
- value?: number;
2626
- }
2627
- interface AppendToArray {
2628
- value?: any;
2629
- }
2630
- interface RemoveFromArray {
2631
- value?: any;
2632
- }
2633
- interface DataPublishPluginOptions {
2634
- includeDraftItems?: boolean;
2635
- }
2636
- interface PatchDataItemResponse {
2637
- /** Updated data item. */
2638
- dataItem?: DataItem;
2639
- }
2640
- interface BulkPatchDataItemsRequest {
2641
- /**
2642
- * Environment: `LIVE` or `SANDBOX`.
2643
- * @internal
2644
- */
2645
- environment?: Environment;
2646
- /** ID of the collection in which to update items. */
2647
- dataCollectionId: string;
2648
- /** Patch sets to apply. */
2649
- patchSets: PatchSet[];
2650
- /**
2651
- * Grid app id. Optional in Live segment.
2652
- * @internal
2653
- */
2654
- appId?: string | null;
2655
- /**
2656
- * Data access options
2657
- * @internal
2658
- * @deprecated
2659
- * @replacedBy inlined
2660
- * @removalDate 2024-07-12
2661
- */
2662
- options?: Options;
2663
- /**
2664
- * Whether to return the updated data items.
2665
- * When `true`, the `results` objects contain a `dataItem` field.
2666
- *
2667
- * Default: `false`
2668
- */
2669
- returnEntity?: boolean;
2670
- /**
2671
- * Should hooks execution be suppressed.
2672
- * This option can only be used with Corvid backend
2673
- * code identity.
2674
- * @internal
2675
- */
2676
- suppressHooks?: boolean;
2677
- /** @internal */
2678
- appOptions?: Record<string, any> | null;
2679
- /** @internal */
2680
- publishPluginOptions?: DataPublishPluginOptions;
2681
- }
2682
- interface BulkPatchDataItemsResponse {
2683
- /** Information about the updated items. */
2684
- results?: BulkDataItemResult[];
2685
- /** Bulk action metadata. */
2686
- bulkActionMetadata?: BulkActionMetadata;
2687
- }
2688
- interface BulkDataItemResult {
2689
- /** The action attempted for the data item. */
2690
- action?: BulkActionType;
2691
- /** Metadata related to the data item for which the action was attempted. */
2692
- itemMetadata?: ItemMetadata;
2693
- /** The data item for which the action was attempted. Only returned if `returnEntity` is `true` in the request and the action is successful. */
2694
- dataItem?: DataItem;
2695
- }
2696
- declare enum BulkActionType {
2697
- UNKNOWN_ACTION_TYPE = "UNKNOWN_ACTION_TYPE",
2698
- INSERT = "INSERT",
2699
- UPDATE = "UPDATE",
2700
- DELETE = "DELETE",
2701
- PATCH = "PATCH"
2702
- }
2703
- interface ItemMetadata {
2704
- /** Item ID. This field doesn't appear if there is no item ID, for example, when item creation fails. */
2705
- id?: string | null;
2706
- /** Index of the item within the request array. Allows for correlation between request and response items. */
2707
- originalIndex?: number;
2708
- /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
2709
- success?: boolean;
2710
- /** Details about the error in case of failure. */
2711
- error?: ApplicationError;
2712
- }
2713
- interface ApplicationError {
2714
- /** Error code. */
2715
- code?: string;
2716
- /** Description of the error. */
2717
- description?: string;
2718
- /** Data related to the error. */
2719
- data?: Record<string, any> | null;
2720
- }
2721
- interface BulkActionMetadata {
2722
- /** Number of items successfully processed. */
2723
- totalSuccesses?: number;
2724
- /** Number of items that couldn't be processed. */
2725
- totalFailures?: number;
2726
- }
2727
- interface UpdateDataItemRequest {
2728
- /**
2729
- * Environment: `LIVE` or `SANDBOX`.
2730
- * @internal
2731
- */
2732
- environment?: Environment;
2733
- /** ID of the collection containing the existing item. */
2734
- dataCollectionId: string;
2735
- /** Updated data item content. The existing data item's content is replaced entirely. */
2736
- dataItem: DataItem;
2737
- /**
2738
- * Grid app id. Optional in Live segment.
2739
- * @internal
2740
- */
2741
- appId?: string | null;
2742
- /**
2743
- * If true, referenced items will be included.
2744
- * @internal
2745
- */
2746
- includeReferencedItems?: boolean;
2747
- /**
2748
- * Data access options
2749
- * @internal
2750
- * @deprecated
2751
- * @replacedBy inlined
2752
- * @removalDate 2024-07-12
2753
- */
2754
- options?: Options;
2755
- /**
2756
- * Should hooks execution be suppressed.
2757
- * This option can only be used with Corvid backend
2758
- * code identity.
2759
- * @internal
2760
- */
2761
- suppressHooks?: boolean;
2762
- /** @internal */
2763
- appOptions?: Record<string, any> | null;
2764
- /** @internal */
2765
- publishPluginOptions?: DataPublishPluginOptions;
2766
- }
2767
- interface UpdateDataItemResponse {
2768
- /** Updated data item. */
2769
- dataItem?: DataItem;
2770
- }
2771
- interface SaveDataItemRequest {
2772
- /**
2773
- * Environment: `LIVE` or `SANDBOX`.
2774
- * @internal
2775
- */
2776
- environment?: Environment;
2777
- /** ID of the collection in which to insert or update the item. */
2778
- dataCollectionId: string;
2779
- /** Data item to insert or update. */
2780
- dataItem: DataItem;
2781
- /**
2782
- * Grid app id. Optional in Live segment.
2783
- * @internal
2784
- */
2785
- appId?: string | null;
2786
- /**
2787
- * If true, referenced items will be included.
2788
- * @internal
2789
- */
2790
- includeReferencedItems?: boolean;
2791
- /**
2792
- * Data access options
2793
- * @internal
2794
- * @deprecated
2795
- * @replacedBy inlined
2796
- * @removalDate 2024-07-12
2797
- */
2798
- options?: Options;
2799
- /**
2800
- * Should hooks execution be suppressed.
2801
- * This option can only be used with Corvid backend
2802
- * code identity.
2803
- * @internal
2804
- */
2805
- suppressHooks?: boolean;
2806
- /** @internal */
2807
- appOptions?: Record<string, any> | null;
2808
- /** @internal */
2809
- publishPluginOptions?: DataPublishPluginOptions;
2810
- }
2811
- interface SaveDataItemResponse {
2812
- /**
2813
- * Action carried out for the item.
2814
- *
2815
- * + `INSERTED`: A new item was added to the collection.
2816
- * + `UPDATED`: An existing item in the collection was updated.
2817
- */
2818
- action?: Action;
2819
- /** Inserted or updated data item. */
2820
- dataItem?: DataItem;
2821
- }
2822
- declare enum Action {
2823
- UNKNOWN_ACTION = "UNKNOWN_ACTION",
2824
- INSERTED = "INSERTED",
2825
- UPDATED = "UPDATED"
2826
- }
2827
- interface GetDataItemRequest {
2828
- /**
2829
- * Environment: `LIVE` or `SANDBOX`.
2830
- * @internal
2831
- */
2832
- environment?: Environment;
2833
- /** ID of the collection from which to retrieve the data item. */
2834
- dataCollectionId: string;
2835
- /** ID of the data item to retrieve. */
2836
- dataItemId: string;
2837
- /**
2838
- * Grid app id. Optional in Live segment.
2839
- * @internal
2840
- */
2841
- appId?: string | null;
2842
- /**
2843
- * Data access options
2844
- * @internal
2845
- * @deprecated
2846
- * @replacedBy inlined
2847
- * @removalDate 2024-07-12
2848
- */
2849
- options?: Options;
2850
- /**
2851
- * Whether to retrieve data from the primary database instance.
2852
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
2853
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
2854
- *
2855
- * Default: `false`
2856
- */
2857
- consistentRead?: boolean;
2858
- /**
2859
- * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
2860
- * If provided, the result text is returned in the specified language. If not provided, the result text is not translated.
2861
- *
2862
- * **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
2863
- *
2864
- */
2865
- language?: string | null;
2866
- /**
2867
- * Fields to return for the item. Only fields specified in the array are included in the response. If the array is empty, all fields are returned.
2868
- *
2869
- * **Note:** The `_id` system field is always returned.
2870
- */
2871
- fields?: string[];
2872
- /**
2873
- * Should hooks execution be suppressed.
2874
- * This option can only be used with Corvid backend
2875
- * code identity.
2876
- * @internal
2877
- */
2878
- suppressHooks?: boolean;
2879
- /** @internal */
2880
- appOptions?: Record<string, any> | null;
2881
- /** @internal */
2882
- publishPluginOptions?: DataPublishPluginOptions;
2883
- }
2884
- interface GetDataItemResponse {
2885
- /** Retrieved item. */
2886
- dataItem?: DataItem;
2887
- }
2888
- interface RemoveDataItemRequest {
2889
- /**
2890
- * Environment: `LIVE` or `SANDBOX`
2891
- * @internal
2892
- */
2893
- environment?: Environment;
2894
- /** ID of the collection from which to remove the item. */
2895
- dataCollectionId: string;
2896
- /** ID of the item to remove. */
2897
- dataItemId: string;
2898
- /**
2899
- * Grid app id. Optional in Live segment.
2900
- * @internal
2901
- */
2902
- appId?: string | null;
2903
- /**
2904
- * Data access options
2905
- * @internal
2906
- * @deprecated
2907
- * @replacedBy inlined
2908
- * @removalDate 2024-07-12
2909
- */
2910
- options?: Options;
2911
- /**
2912
- * Should hooks execution be suppressed.
2913
- * This option can only be used with Corvid backend
2914
- * code identity.
2915
- * @internal
2916
- */
2917
- suppressHooks?: boolean;
2918
- /** @internal */
2919
- appOptions?: Record<string, any> | null;
2920
- /** @internal */
2921
- publishPluginOptions?: DataPublishPluginOptions;
2922
- }
2923
- interface RemoveDataItemResponse {
2924
- /** Removed item. */
2925
- dataItem?: DataItem;
2926
- }
2927
- interface TruncateDataItemsRequest {
2928
- /**
2929
- * Environment: `LIVE` or `SANDBOX`.
2930
- * @internal
2931
- */
2932
- environment?: Environment;
2933
- /** ID of the collection to truncate. */
2934
- dataCollectionId: string;
2935
- /**
2936
- * Grid app id. Optional in Live segment.
2937
- * @internal
2938
- */
2939
- appId?: string | null;
2940
- /**
2941
- * Data access options
2942
- * @internal
2943
- * @deprecated
2944
- * @replacedBy inlined
2945
- * @removalDate 2024-07-12
2946
- */
2947
- options?: Options;
2948
- }
2949
- interface TruncateDataItemsResponse {
2950
- }
2951
- interface BulkInsertDataItemsRequest {
2952
- /**
2953
- * Environment: `LIVE` or `SANDBOX`.
2954
- * @internal
2955
- */
2956
- environment?: Environment;
2957
- /** ID of the collection in which to insert the items. */
2958
- dataCollectionId: string;
2959
- /** Data items to insert. */
2960
- dataItems: DataItem[];
2961
- /**
2962
- * Grid app ID. Optional in `LIVE` segment.
2963
- * @internal
2964
- */
2965
- appId?: string | null;
2966
- /**
2967
- * Data access options.
2968
- * @internal
2969
- * @deprecated
2970
- * @replacedBy inlined
2971
- * @removalDate 2024-07-12
2972
- */
2973
- options?: Options;
2974
- /**
2975
- * Whether to return the inserted data items.
2976
- * When `true`, the `results` objects contain a `dataItem` field.
2977
- *
2978
- * Default: `false`
2979
- */
2980
- returnEntity?: boolean;
2981
- /**
2982
- * Should hooks execution be suppressed.
2983
- * This option can only be used with Corvid backend
2984
- * code identity.
2985
- * @internal
2986
- */
2987
- suppressHooks?: boolean;
2988
- /** @internal */
2989
- appOptions?: Record<string, any> | null;
2990
- }
2991
- interface BulkInsertDataItemsResponse {
2992
- /** Information about the inserted items. */
2993
- results?: BulkDataItemResult[];
2994
- /** Bulk action metadata. */
2995
- bulkActionMetadata?: BulkActionMetadata;
2996
- }
2997
- interface BulkUpdateDataItemsRequest {
2998
- /**
2999
- * Environment: `LIVE` or `SANDBOX`.
3000
- * @internal
3001
- */
3002
- environment?: Environment;
3003
- /** ID of the collection in which to update items. */
3004
- dataCollectionId: string;
3005
- /** Data items to update. */
3006
- dataItems: DataItem[];
3007
- /**
3008
- * Grid app id. Optional in Live segment.
3009
- * @internal
3010
- */
3011
- appId?: string | null;
3012
- /**
3013
- * Data access options
3014
- * @internal
3015
- * @deprecated
3016
- * @replacedBy inlined
3017
- * @removalDate 2024-07-12
3018
- */
3019
- options?: Options;
3020
- /**
3021
- * Whether to return the updated data items.
3022
- * When `true`, the `results` objects contain a `dataItem` field.
3023
- *
3024
- * Default: `false`
3025
- */
3026
- returnEntity?: boolean;
3027
- /**
3028
- * Should hooks execution be suppressed.
3029
- * This option can only be used with Corvid backend
3030
- * code identity.
3031
- * @internal
3032
- */
3033
- suppressHooks?: boolean;
3034
- /** @internal */
3035
- appOptions?: Record<string, any> | null;
3036
- /** @internal */
3037
- publishPluginOptions?: DataPublishPluginOptions;
3038
- }
3039
- interface BulkUpdateDataItemsResponse {
3040
- /** Information about the updated items. */
3041
- results?: BulkDataItemResult[];
3042
- /** Bulk action metadata. */
3043
- bulkActionMetadata?: BulkActionMetadata;
3044
- }
3045
- interface BulkSaveDataItemsRequest {
3046
- /**
3047
- * Environment: LIVE or SANDBOX
3048
- * @internal
3049
- */
3050
- environment?: Environment;
3051
- /** ID of the collection in which to insert or update the items. */
3052
- dataCollectionId: string;
3053
- /** Data items to insert or update. */
3054
- dataItems: DataItem[];
3055
- /**
3056
- * Grid app id. Optional in Live segment.
3057
- * @internal
3058
- */
3059
- appId?: string | null;
3060
- /**
3061
- * Data access options
3062
- * @internal
3063
- * @deprecated
3064
- * @replacedBy inlined
3065
- * @removalDate 2024-07-12
3066
- */
3067
- options?: Options;
3068
- /**
3069
- * Whether to return the saved data item.
3070
- * When `true`, the `results` objects contain a `dataItem` field.
3071
- *
3072
- * Default: `false`
3073
- */
3074
- returnEntity?: boolean;
3075
- /**
3076
- * Should hooks execution be suppressed.
3077
- * This option can only be used with Corvid backend
3078
- * code identity.
3079
- * @internal
3080
- */
3081
- suppressHooks?: boolean;
3082
- /** @internal */
3083
- appOptions?: Record<string, any> | null;
3084
- /** @internal */
3085
- publishPluginOptions?: DataPublishPluginOptions;
3086
- }
3087
- interface BulkSaveDataItemsResponse {
3088
- /** Information about the saved items. */
3089
- results?: BulkDataItemResult[];
3090
- /** Bulk action metadata. */
3091
- bulkActionMetadata?: BulkActionMetadata;
3092
- }
3093
- interface BulkRemoveDataItemsRequest {
3094
- /**
3095
- * Environment: `LIVE` or `SANDBOX`.
3096
- * @internal
3097
- */
3098
- environment?: Environment;
3099
- /** ID of the collection from which to remove the item. */
3100
- dataCollectionId: string;
3101
- /** IDs of data items to remove. */
3102
- dataItemIds: string[];
3103
- /**
3104
- * Grid app id. Optional in Live segment.
3105
- * @internal
3106
- */
3107
- appId?: string | null;
3108
- /**
3109
- * Data access options
3110
- * @internal
3111
- * @deprecated
3112
- * @replacedBy inlined
3113
- * @removalDate 2024-07-12
3114
- */
3115
- options?: Options;
3116
- /**
3117
- * Should hooks execution be suppressed.
3118
- * This option can only be used with Corvid backend
3119
- * code identity.
3120
- * @internal
3121
- */
3122
- suppressHooks?: boolean;
3123
- /** @internal */
3124
- appOptions?: Record<string, any> | null;
3125
- /** @internal */
3126
- publishPluginOptions?: DataPublishPluginOptions;
3127
- }
3128
- interface BulkRemoveDataItemsResponse {
3129
- /** Information about the removed data items. */
3130
- results?: BulkDataItemResult[];
3131
- /** Bulk action metadata. */
3132
- bulkActionMetadata?: BulkActionMetadata;
3133
- }
3134
- interface IsReferencedDataItemRequest {
3135
- /**
3136
- * Environment: `LIVE` or `SANDBOX`.
3137
- * @internal
3138
- */
3139
- environment?: Environment;
3140
- /** ID of the collection containing the referring data item. */
3141
- dataCollectionId: string;
3142
- /** Field to check for a reference to the item that may be referenced. */
3143
- referringItemFieldName: string;
3144
- /** ID of the referring item. */
3145
- referringItemId: string;
3146
- /** ID of the item that may be referenced. */
3147
- referencedItemId: string;
3148
- /**
3149
- * Grid app id. Optional in Live segment.
3150
- * @internal
3151
- */
3152
- appId?: string | null;
3153
- /**
3154
- * Data access options
3155
- * @internal
3156
- * @deprecated
3157
- * @replacedBy inlined
3158
- * @removalDate 2024-07-12
3159
- */
3160
- options?: Options;
3161
- /**
3162
- * Whether to retrieve data from the primary database instance.
3163
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
3164
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
3165
- *
3166
- * Default: `false`
3167
- */
3168
- consistentRead?: boolean;
3169
- /** @internal */
3170
- appOptions?: Record<string, any> | null;
3171
- }
3172
- interface IsReferencedDataItemResponse {
3173
- /** Whether the specified reference exists. */
3174
- isReferenced?: boolean;
3175
- }
3176
- interface DataItemReference {
3177
- /** Referring item field containing the references to the referenced items. */
3178
- referringItemFieldName?: string;
3179
- /** ID of the referring item. */
3180
- referringItemId?: string;
3181
- /** ID of the referenced item. */
3182
- referencedItemId?: string;
3183
- }
3184
- interface BulkInsertDataItemReferencesRequest {
3185
- /**
3186
- * Environment: `LIVE` or `SANDBOX`.
3187
- * @internal
3188
- */
3189
- environment?: Environment;
3190
- /** ID of the collection containing the referring items. */
3191
- dataCollectionId: string;
3192
- /** References to insert. */
3193
- dataItemReferences: DataItemReference[];
3194
- /**
3195
- * Grid app ID. Optional in `LIVE` segment.
3196
- * @internal
3197
- */
3198
- appId?: string | null;
3199
- /**
3200
- * Data access options
3201
- * @internal
3202
- * @deprecated
3203
- * @replacedBy inlined
3204
- * @removalDate 2024-07-12
3205
- */
3206
- options?: Options;
3207
- /**
3208
- * Whether to return the inserted data item references.
3209
- * When `true`, the `results` objects contain a `dataItemReference` field.
3210
- *
3211
- * Default: `false`
3212
- */
3213
- returnEntity?: boolean;
3214
- /** @internal */
3215
- appOptions?: Record<string, any> | null;
3216
- }
3217
- interface BulkInsertDataItemReferencesResponse {
3218
- /** Information about the inserted references. */
3219
- results?: BulkDataItemReferenceResult[];
3220
- /** Bulk action metadata. */
3221
- bulkActionMetadata?: BulkActionMetadata;
3222
- }
3223
- interface BulkDataItemReferenceResult {
3224
- /** Action attempted for the reference. */
3225
- action?: BulkActionType;
3226
- /** Metadata related to the reference for which the action was attempted. */
3227
- referenceMetadata?: ItemMetadata;
3228
- /** Reference for which the action was attempted. Only returned if `returnEntity` is `true` in the request and the action is successful. */
3229
- dataItemReference?: DataItemReference;
3230
- }
3231
- interface BulkRemoveDataItemReferencesRequest {
3232
- /**
3233
- * Environment: `LIVE` or `SANDBOX`.
3234
- * @internal
3235
- */
3236
- environment?: Environment;
3237
- /** ID of the collection containing the referring items. */
3238
- dataCollectionId: string;
3239
- /** References to remove. */
3240
- dataItemReferences: DataItemReference[];
3241
- /**
3242
- * Grid app ID. Optional in `LIVE` segment.
3243
- * @internal
3244
- */
3245
- appId?: string | null;
3246
- /**
3247
- * Data access options
3248
- * @internal
3249
- * @deprecated
3250
- * @replacedBy inlined
3251
- * @removalDate 2024-07-12
3252
- */
3253
- options?: Options;
3254
- /** @internal */
3255
- appOptions?: Record<string, any> | null;
3256
- }
3257
- interface BulkRemoveDataItemReferencesResponse {
3258
- /** Information about the removed references. */
3259
- results?: BulkDataItemReferenceResult[];
3260
- /** Bulk action metadata. */
3261
- bulkActionMetadata?: BulkActionMetadata;
3262
- }
3263
- interface ReplaceDataItemReferencesRequest {
3264
- /**
3265
- * Environment: `LIVE` or `SANDBOX`.
3266
- * @internal
3267
- */
3268
- environment?: Environment;
3269
- /** ID of the collection containing the referring item. */
3270
- dataCollectionId: string;
3271
- /** Field containing references in the referring item. */
3272
- referringItemFieldName: string;
3273
- /** ID of the referring item. */
3274
- referringItemId: string;
3275
- /** List of new referenced item IDs to replace the existing ones. */
3276
- newReferencedItemIds?: string[];
3277
- /**
3278
- * Grid app ID. Optional in `LIVE` segment.
3279
- * @internal
3280
- */
3281
- appId?: string | null;
3282
- /**
3283
- * Data access options
3284
- * @internal
3285
- * @deprecated
3286
- * @replacedBy inlined
3287
- * @removalDate 2024-07-12
3288
- */
3289
- options?: Options;
3290
- /** @internal */
3291
- appOptions?: Record<string, any> | null;
3292
- }
3293
- interface ReplaceDataItemReferencesResponse {
3294
- /** Updated references. */
3295
- dataItemReferences?: DataItemReference[];
3296
- }
3297
-
3298
- type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
3299
- getUrl: (context: any) => string;
3300
- httpMethod: K;
3301
- path: string;
3302
- pathParams: M;
3303
- __requestType: T;
3304
- __originalRequestType: S;
3305
- __responseType: Q;
3306
- __originalResponseType: R;
3307
- };
3308
- declare function insert(): __PublicMethodMetaInfo<'POST', {}, InsertDataItemRequest, InsertDataItemRequest, InsertDataItemResponse, InsertDataItemResponse>;
3309
- declare function update(): __PublicMethodMetaInfo<'POST', {}, UpdateDataItemRequest, UpdateDataItemRequest, UpdateDataItemResponse, UpdateDataItemResponse>;
3310
- declare function save(): __PublicMethodMetaInfo<'POST', {}, SaveDataItemRequest, SaveDataItemRequest, SaveDataItemResponse, SaveDataItemResponse>;
3311
- declare function get(): __PublicMethodMetaInfo<'GET', {}, GetDataItemRequest, GetDataItemRequest, GetDataItemResponse, GetDataItemResponse>;
3312
- declare function remove(): __PublicMethodMetaInfo<'POST', {}, RemoveDataItemRequest, RemoveDataItemRequest, RemoveDataItemResponse, RemoveDataItemResponse>;
3313
- declare function truncate(): __PublicMethodMetaInfo<'POST', {}, TruncateDataItemsRequest, TruncateDataItemsRequest, TruncateDataItemsResponse, TruncateDataItemsResponse>;
3314
- declare function bulkInsert(): __PublicMethodMetaInfo<'POST', {}, BulkInsertDataItemsRequest, BulkInsertDataItemsRequest, BulkInsertDataItemsResponse, BulkInsertDataItemsResponse>;
3315
- declare function patch(): __PublicMethodMetaInfo<'POST', {}, PatchDataItemRequest, PatchDataItemRequest, PatchDataItemResponse, PatchDataItemResponse>;
3316
- declare function bulkPatch(): __PublicMethodMetaInfo<'POST', {}, BulkPatchDataItemsRequest, BulkPatchDataItemsRequest, BulkPatchDataItemsResponse, BulkPatchDataItemsResponse>;
3317
- declare function bulkUpdate(): __PublicMethodMetaInfo<'POST', {}, BulkUpdateDataItemsRequest, BulkUpdateDataItemsRequest, BulkUpdateDataItemsResponse, BulkUpdateDataItemsResponse>;
3318
- declare function bulkSave(): __PublicMethodMetaInfo<'POST', {}, BulkSaveDataItemsRequest, BulkSaveDataItemsRequest, BulkSaveDataItemsResponse, BulkSaveDataItemsResponse>;
3319
- declare function bulkRemove(): __PublicMethodMetaInfo<'POST', {}, BulkRemoveDataItemsRequest, BulkRemoveDataItemsRequest, BulkRemoveDataItemsResponse, BulkRemoveDataItemsResponse>;
3320
- declare function isReferenced(): __PublicMethodMetaInfo<'POST', {}, IsReferencedDataItemRequest, IsReferencedDataItemRequest, IsReferencedDataItemResponse, IsReferencedDataItemResponse>;
3321
- declare function insertReference(): __PublicMethodMetaInfo<'POST', {}, BulkInsertDataItemReferencesRequest, BulkInsertDataItemReferencesRequest, BulkInsertDataItemReferencesResponse, BulkInsertDataItemReferencesResponse>;
3322
- declare function removeReference(): __PublicMethodMetaInfo<'POST', {}, BulkRemoveDataItemReferencesRequest, BulkRemoveDataItemReferencesRequest, BulkRemoveDataItemReferencesResponse, BulkRemoveDataItemReferencesResponse>;
3323
- declare function replaceReferences(): __PublicMethodMetaInfo<'POST', {}, ReplaceDataItemReferencesRequest, ReplaceDataItemReferencesRequest, ReplaceDataItemReferencesResponse, ReplaceDataItemReferencesResponse>;
3324
-
3325
- type meta_d___PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = __PublicMethodMetaInfo<K, M, T, S, Q, R>;
3326
- declare const meta_d_bulkInsert: typeof bulkInsert;
3327
- declare const meta_d_bulkPatch: typeof bulkPatch;
3328
- declare const meta_d_bulkRemove: typeof bulkRemove;
3329
- declare const meta_d_bulkSave: typeof bulkSave;
3330
- declare const meta_d_bulkUpdate: typeof bulkUpdate;
3331
- declare const meta_d_get: typeof get;
3332
- declare const meta_d_insert: typeof insert;
3333
- declare const meta_d_insertReference: typeof insertReference;
3334
- declare const meta_d_isReferenced: typeof isReferenced;
3335
- declare const meta_d_patch: typeof patch;
3336
- declare const meta_d_remove: typeof remove;
3337
- declare const meta_d_removeReference: typeof removeReference;
3338
- declare const meta_d_replaceReferences: typeof replaceReferences;
3339
- declare const meta_d_save: typeof save;
3340
- declare const meta_d_truncate: typeof truncate;
3341
- declare const meta_d_update: typeof update;
3342
- declare namespace meta_d {
3343
- export { type meta_d___PublicMethodMetaInfo as __PublicMethodMetaInfo, meta_d_bulkInsert as bulkInsert, meta_d_bulkPatch as bulkPatch, meta_d_bulkRemove as bulkRemove, meta_d_bulkSave as bulkSave, meta_d_bulkUpdate as bulkUpdate, meta_d_get as get, meta_d_insert as insert, meta_d_insertReference as insertReference, meta_d_isReferenced as isReferenced, meta_d_patch as patch, meta_d_remove as remove, meta_d_removeReference as removeReference, meta_d_replaceReferences as replaceReferences, meta_d_save as save, meta_d_truncate as truncate, meta_d_update as update };
3344
- }
3345
-
3346
- export { meta$1 as collections, meta$2 as externalDatabaseConnections, meta as indexes, meta_d as items };