@wix/auto_sdk_data_collections 1.0.11 → 1.0.13

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 (121) hide show
  1. package/build/{es/src/data-v2-data-collection-collections.types.d.ts → cjs/data-v2-data-collection-collections.universal-DFG8hhGA.d.ts} +199 -144
  2. package/build/cjs/index.d.ts +75 -1
  3. package/build/cjs/index.js +1275 -15
  4. package/build/cjs/index.js.map +1 -1
  5. package/build/cjs/meta.d.ts +882 -1
  6. package/build/cjs/meta.js +880 -15
  7. package/build/cjs/meta.js.map +1 -1
  8. package/build/{cjs/src/data-v2-data-collection-collections.types.d.ts → es/data-v2-data-collection-collections.universal-DFG8hhGA.d.mts} +199 -144
  9. package/build/es/index.d.mts +75 -0
  10. package/build/es/index.mjs +1227 -0
  11. package/build/es/index.mjs.map +1 -0
  12. package/build/es/meta.d.mts +882 -0
  13. package/build/es/meta.mjs +848 -0
  14. package/build/es/meta.mjs.map +1 -0
  15. package/build/internal/cjs/{src/data-v2-data-collection-collections.types.d.ts → data-v2-data-collection-collections.universal-DZ3_N2Cv.d.ts} +230 -144
  16. package/build/internal/cjs/index.d.ts +121 -1
  17. package/build/internal/cjs/index.js +1275 -15
  18. package/build/internal/cjs/index.js.map +1 -1
  19. package/build/internal/cjs/meta.d.ts +882 -1
  20. package/build/internal/cjs/meta.js +880 -15
  21. package/build/internal/cjs/meta.js.map +1 -1
  22. package/build/internal/es/{src/data-v2-data-collection-collections.types.d.ts → data-v2-data-collection-collections.universal-DZ3_N2Cv.d.mts} +230 -144
  23. package/build/internal/es/index.d.mts +121 -0
  24. package/build/internal/es/index.mjs +1227 -0
  25. package/build/internal/es/index.mjs.map +1 -0
  26. package/build/internal/es/meta.d.mts +882 -0
  27. package/build/internal/es/meta.mjs +848 -0
  28. package/build/internal/es/meta.mjs.map +1 -0
  29. package/package.json +9 -8
  30. package/build/cjs/index.typings.d.ts +0 -1
  31. package/build/cjs/index.typings.js +0 -18
  32. package/build/cjs/index.typings.js.map +0 -1
  33. package/build/cjs/src/data-v2-data-collection-collections.context.d.ts +0 -9
  34. package/build/cjs/src/data-v2-data-collection-collections.context.js +0 -39
  35. package/build/cjs/src/data-v2-data-collection-collections.context.js.map +0 -1
  36. package/build/cjs/src/data-v2-data-collection-collections.http.d.ts +0 -48
  37. package/build/cjs/src/data-v2-data-collection-collections.http.js +0 -704
  38. package/build/cjs/src/data-v2-data-collection-collections.http.js.map +0 -1
  39. package/build/cjs/src/data-v2-data-collection-collections.meta.d.ts +0 -27
  40. package/build/cjs/src/data-v2-data-collection-collections.meta.js +0 -199
  41. package/build/cjs/src/data-v2-data-collection-collections.meta.js.map +0 -1
  42. package/build/cjs/src/data-v2-data-collection-collections.public.d.ts +0 -69
  43. package/build/cjs/src/data-v2-data-collection-collections.public.js +0 -84
  44. package/build/cjs/src/data-v2-data-collection-collections.public.js.map +0 -1
  45. package/build/cjs/src/data-v2-data-collection-collections.types.js +0 -270
  46. package/build/cjs/src/data-v2-data-collection-collections.types.js.map +0 -1
  47. package/build/cjs/src/data-v2-data-collection-collections.universal.d.ts +0 -1572
  48. package/build/cjs/src/data-v2-data-collection-collections.universal.js +0 -704
  49. package/build/cjs/src/data-v2-data-collection-collections.universal.js.map +0 -1
  50. package/build/es/index.d.ts +0 -1
  51. package/build/es/index.js +0 -2
  52. package/build/es/index.js.map +0 -1
  53. package/build/es/index.typings.d.ts +0 -1
  54. package/build/es/index.typings.js +0 -2
  55. package/build/es/index.typings.js.map +0 -1
  56. package/build/es/meta.d.ts +0 -1
  57. package/build/es/meta.js +0 -2
  58. package/build/es/meta.js.map +0 -1
  59. package/build/es/src/data-v2-data-collection-collections.context.d.ts +0 -9
  60. package/build/es/src/data-v2-data-collection-collections.context.js +0 -17
  61. package/build/es/src/data-v2-data-collection-collections.context.js.map +0 -1
  62. package/build/es/src/data-v2-data-collection-collections.http.d.ts +0 -48
  63. package/build/es/src/data-v2-data-collection-collections.http.js +0 -692
  64. package/build/es/src/data-v2-data-collection-collections.http.js.map +0 -1
  65. package/build/es/src/data-v2-data-collection-collections.meta.d.ts +0 -27
  66. package/build/es/src/data-v2-data-collection-collections.meta.js +0 -164
  67. package/build/es/src/data-v2-data-collection-collections.meta.js.map +0 -1
  68. package/build/es/src/data-v2-data-collection-collections.public.d.ts +0 -69
  69. package/build/es/src/data-v2-data-collection-collections.public.js +0 -53
  70. package/build/es/src/data-v2-data-collection-collections.public.js.map +0 -1
  71. package/build/es/src/data-v2-data-collection-collections.types.js +0 -267
  72. package/build/es/src/data-v2-data-collection-collections.types.js.map +0 -1
  73. package/build/es/src/data-v2-data-collection-collections.universal.d.ts +0 -1572
  74. package/build/es/src/data-v2-data-collection-collections.universal.js +0 -669
  75. package/build/es/src/data-v2-data-collection-collections.universal.js.map +0 -1
  76. package/build/internal/cjs/index.typings.d.ts +0 -1
  77. package/build/internal/cjs/index.typings.js +0 -18
  78. package/build/internal/cjs/index.typings.js.map +0 -1
  79. package/build/internal/cjs/src/data-v2-data-collection-collections.context.d.ts +0 -17
  80. package/build/internal/cjs/src/data-v2-data-collection-collections.context.js +0 -39
  81. package/build/internal/cjs/src/data-v2-data-collection-collections.context.js.map +0 -1
  82. package/build/internal/cjs/src/data-v2-data-collection-collections.http.d.ts +0 -48
  83. package/build/internal/cjs/src/data-v2-data-collection-collections.http.js +0 -704
  84. package/build/internal/cjs/src/data-v2-data-collection-collections.http.js.map +0 -1
  85. package/build/internal/cjs/src/data-v2-data-collection-collections.meta.d.ts +0 -27
  86. package/build/internal/cjs/src/data-v2-data-collection-collections.meta.js +0 -199
  87. package/build/internal/cjs/src/data-v2-data-collection-collections.meta.js.map +0 -1
  88. package/build/internal/cjs/src/data-v2-data-collection-collections.public.d.ts +0 -107
  89. package/build/internal/cjs/src/data-v2-data-collection-collections.public.js +0 -84
  90. package/build/internal/cjs/src/data-v2-data-collection-collections.public.js.map +0 -1
  91. package/build/internal/cjs/src/data-v2-data-collection-collections.types.js +0 -270
  92. package/build/internal/cjs/src/data-v2-data-collection-collections.types.js.map +0 -1
  93. package/build/internal/cjs/src/data-v2-data-collection-collections.universal.d.ts +0 -1679
  94. package/build/internal/cjs/src/data-v2-data-collection-collections.universal.js +0 -704
  95. package/build/internal/cjs/src/data-v2-data-collection-collections.universal.js.map +0 -1
  96. package/build/internal/es/index.d.ts +0 -1
  97. package/build/internal/es/index.js +0 -2
  98. package/build/internal/es/index.js.map +0 -1
  99. package/build/internal/es/index.typings.d.ts +0 -1
  100. package/build/internal/es/index.typings.js +0 -2
  101. package/build/internal/es/index.typings.js.map +0 -1
  102. package/build/internal/es/meta.d.ts +0 -1
  103. package/build/internal/es/meta.js +0 -2
  104. package/build/internal/es/meta.js.map +0 -1
  105. package/build/internal/es/src/data-v2-data-collection-collections.context.d.ts +0 -17
  106. package/build/internal/es/src/data-v2-data-collection-collections.context.js +0 -17
  107. package/build/internal/es/src/data-v2-data-collection-collections.context.js.map +0 -1
  108. package/build/internal/es/src/data-v2-data-collection-collections.http.d.ts +0 -48
  109. package/build/internal/es/src/data-v2-data-collection-collections.http.js +0 -692
  110. package/build/internal/es/src/data-v2-data-collection-collections.http.js.map +0 -1
  111. package/build/internal/es/src/data-v2-data-collection-collections.meta.d.ts +0 -27
  112. package/build/internal/es/src/data-v2-data-collection-collections.meta.js +0 -164
  113. package/build/internal/es/src/data-v2-data-collection-collections.meta.js.map +0 -1
  114. package/build/internal/es/src/data-v2-data-collection-collections.public.d.ts +0 -107
  115. package/build/internal/es/src/data-v2-data-collection-collections.public.js +0 -53
  116. package/build/internal/es/src/data-v2-data-collection-collections.public.js.map +0 -1
  117. package/build/internal/es/src/data-v2-data-collection-collections.types.js +0 -267
  118. package/build/internal/es/src/data-v2-data-collection-collections.types.js.map +0 -1
  119. package/build/internal/es/src/data-v2-data-collection-collections.universal.d.ts +0 -1679
  120. package/build/internal/es/src/data-v2-data-collection-collections.universal.js +0 -669
  121. package/build/internal/es/src/data-v2-data-collection-collections.universal.js.map +0 -1
@@ -1,1572 +0,0 @@
1
- import { NonNullablePaths } from '@wix/sdk-types';
2
- /** A data collection determines the structure of data to be stored in a database. */
3
- export interface DataCollection {
4
- /**
5
- * Collection ID. For example, `my-first-collection`. May include a namespace.
6
- * @immutable
7
- * @maxLength 256
8
- */
9
- _id?: string;
10
- /**
11
- * Collection type. Indicates how the collection was created and how it is stored.
12
- * @readonly
13
- */
14
- collectionType?: CollectionTypeWithLiterals;
15
- /**
16
- * ID of the app that defined this collection. For collections defined by Wix users, this value is null.
17
- * @format GUID
18
- * @readonly
19
- */
20
- ownerAppId?: string | null;
21
- /**
22
- * Maximum number of items returned in a single query, based on the underlying storage.
23
- * Native collections have a maximum page size of 1000 for offset-based queries or 100 for cursor-based queries.
24
- * External collections' maximum page size defaults to 50, but an external provider can set any maximum value up to 1000.
25
- * @readonly
26
- */
27
- maxPageSize?: number | null;
28
- /**
29
- * Collection's display name as shown in the CMS. For example, `My First Collection`.
30
- * @maxLength 1000
31
- */
32
- displayName?: string | null;
33
- /**
34
- * Default item sorting order when a query doesn't specify one.
35
- * @readonly
36
- */
37
- defaultDisplayOrder?: Sort;
38
- /**
39
- * UI-friendly namespace of the Wix app with which the data collection is associated, such as Stores or Bookings.
40
- * Empty for all data collections not owned by Wix apps.
41
- * @readonly
42
- * @maxLength 1000
43
- */
44
- displayNamespace?: string | null;
45
- /**
46
- * Field whose value the CMS displays to represent the collection item when referenced in a different collection.
47
- * @maxLength 1000
48
- */
49
- displayField?: string | null;
50
- /**
51
- * Capabilities the collection supports.
52
- * @readonly
53
- */
54
- capabilities?: CollectionCapabilities;
55
- /**
56
- * Collection's field structure.
57
- * @maxSize 1000
58
- */
59
- fields?: Field[];
60
- /** Levels of permission for accessing and modifying data, defined by lowest role needed to perform each action. */
61
- permissions?: Permissions;
62
- /**
63
- * 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.
64
- * @readonly
65
- */
66
- revision?: string | null;
67
- /**
68
- * Plugins the collection uses. Plugins apply additional capabilities to the collection or extend its functionality.
69
- * @maxSize 100
70
- */
71
- plugins?: Plugin[];
72
- /**
73
- * Paging modes the collection supports. In native collections, offset-based paging is supported by default.
74
- * @readonly
75
- * @maxSize 2
76
- */
77
- pagingModes?: PagingModeWithLiterals[];
78
- /**
79
- * Date the collection was created.
80
- * @readonly
81
- */
82
- _createdDate?: Date | null;
83
- /**
84
- * Date the collection was last updated.
85
- * @readonly
86
- */
87
- _updatedDate?: Date | null;
88
- }
89
- export declare enum CollectionType {
90
- /** User-created collection. */
91
- NATIVE = "NATIVE",
92
- /** [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). */
93
- WIX_APP = "WIX_APP",
94
- /** Collection created by a Wix Blocks app. */
95
- BLOCKS_APP = "BLOCKS_APP",
96
- /** Collection located in externally connected storage. */
97
- EXTERNAL = "EXTERNAL"
98
- }
99
- /** @enumType */
100
- export type CollectionTypeWithLiterals = CollectionType | 'NATIVE' | 'WIX_APP' | 'BLOCKS_APP' | 'EXTERNAL';
101
- export interface Sort {
102
- /**
103
- * Field to sort by.
104
- * @maxLength 1000
105
- */
106
- fieldKey?: string;
107
- /**
108
- * Sort order. Use `ASC` for ascending order or `DESC` for descending order.
109
- *
110
- * Default: `ASC`
111
- */
112
- direction?: DirectionWithLiterals;
113
- }
114
- export declare enum Direction {
115
- ASC = "ASC",
116
- DESC = "DESC"
117
- }
118
- /** @enumType */
119
- export type DirectionWithLiterals = Direction | 'ASC' | 'DESC';
120
- export interface CollectionCapabilities {
121
- /**
122
- * Data operations the collection supports. The listed operations can be performed on data the collection contains.
123
- *
124
- * > **Note**: The `PATCH` and `BULK_PATCH` oeprations aren't currently supported.
125
- * @maxSize 100
126
- */
127
- dataOperations?: DataOperationWithLiterals[];
128
- /**
129
- * Collection operations supported. The listed operations can be performed on the collection itself.
130
- * @maxSize 100
131
- */
132
- collectionOperations?: CollectionOperationWithLiterals[];
133
- /** Maximum number of indexes for the collection. */
134
- indexLimits?: IndexLimits;
135
- }
136
- export declare enum DataOperation {
137
- AGGREGATE = "AGGREGATE",
138
- BULK_INSERT = "BULK_INSERT",
139
- BULK_REMOVE = "BULK_REMOVE",
140
- BULK_SAVE = "BULK_SAVE",
141
- BULK_UPDATE = "BULK_UPDATE",
142
- COUNT = "COUNT",
143
- DISTINCT = "DISTINCT",
144
- FIND = "FIND",
145
- GET = "GET",
146
- INSERT = "INSERT",
147
- INSERT_REFERENCE = "INSERT_REFERENCE",
148
- IS_REFERENCED = "IS_REFERENCED",
149
- QUERY_REFERENCED = "QUERY_REFERENCED",
150
- REMOVE = "REMOVE",
151
- REMOVE_REFERENCE = "REMOVE_REFERENCE",
152
- REPLACE_REFERENCES = "REPLACE_REFERENCES",
153
- SAVE = "SAVE",
154
- TRUNCATE = "TRUNCATE",
155
- UPDATE = "UPDATE",
156
- PATCH = "PATCH",
157
- BULK_PATCH = "BULK_PATCH"
158
- }
159
- /** @enumType */
160
- export type DataOperationWithLiterals = DataOperation | 'AGGREGATE' | 'BULK_INSERT' | 'BULK_REMOVE' | 'BULK_SAVE' | 'BULK_UPDATE' | 'COUNT' | 'DISTINCT' | 'FIND' | 'GET' | 'INSERT' | 'INSERT_REFERENCE' | 'IS_REFERENCED' | 'QUERY_REFERENCED' | 'REMOVE' | 'REMOVE_REFERENCE' | 'REPLACE_REFERENCES' | 'SAVE' | 'TRUNCATE' | 'UPDATE' | 'PATCH' | 'BULK_PATCH';
161
- export declare enum CollectionOperation {
162
- /** Allows updating the collection's structure, for example adding, updating, or deleting fields. If not included, the collection's structure can't be changed. */
163
- UPDATE = "UPDATE",
164
- /** Allows deleting the entire collection. If not included, the collection can't be deleted. */
165
- REMOVE = "REMOVE"
166
- }
167
- /** @enumType */
168
- export type CollectionOperationWithLiterals = CollectionOperation | 'UPDATE' | 'REMOVE';
169
- export interface IndexLimits {
170
- /** Maximum number of regular (non-unique) indexes allowed for this collection. */
171
- regular?: number;
172
- /** Maximum number of unique indexes allowed for this collection. */
173
- unique?: number;
174
- /** Maximum number of regular and unique indexes allowed for this collection. */
175
- total?: number;
176
- }
177
- export interface IndexQuotaLimits {
178
- /**
179
- * limit of regular single-field indexes, even if 0 1-field indices may be created using
180
- * 3-field quota (if available)
181
- */
182
- regular1Field?: number;
183
- /** limit of regular indexes up to 3-fields (in addition to 1-field indexes quota) */
184
- regular3Field?: number;
185
- /** limit of unique indexes */
186
- unique1Field?: number;
187
- /** Maximum number of regular and unique indexes allowed for this collection. */
188
- total?: number;
189
- }
190
- export interface Field extends FieldRangeValidationsOneOf {
191
- /** Range of possible values for a numerical field. */
192
- numberRange?: NumberRange;
193
- /** Length range permitted for a text field. Relevant for fields that hold strings, such as those of type `TEXT` or `RICH_TEXT`. */
194
- stringLengthRange?: StringLengthRange;
195
- /** Array size range permitted. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`. */
196
- arraySizeRange?: ArraySizeRange;
197
- /**
198
- * Unique identifier for the field. For example, `firstName`.
199
- * @maxLength 1000
200
- */
201
- key?: string;
202
- /**
203
- * Field's display name when displayed in the CMS. For example, `First Name`.
204
- * @maxLength 1000
205
- */
206
- displayName?: string | null;
207
- /**
208
- * Field's data type.
209
- *
210
- * Learn more about data types in Wix Data ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/data-types-in-wix-data) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-types-in-wix-data)).
211
- */
212
- type?: TypeWithLiterals;
213
- /** Metadata for complex data types. This property only exists for references, multi-references, objects, and arrays. */
214
- typeMetadata?: TypeMetadata;
215
- /**
216
- * Whether the field is a system field.
217
- * @readonly
218
- */
219
- systemField?: boolean;
220
- /**
221
- * Capabilities the field supports.
222
- * @readonly
223
- */
224
- capabilities?: FieldCapabilities;
225
- /** Whether the field is encrypted. */
226
- encrypted?: boolean;
227
- /**
228
- * Field description.
229
- * @maxLength 16000
230
- */
231
- description?: string | null;
232
- /**
233
- * Whether the field is read-only. A read-only field can't be changed.
234
- *
235
- * Default: `false`
236
- */
237
- readOnly?: boolean | null;
238
- /**
239
- * Whether the field is immutable. An immutable field can be set once, but then cannot be updated.
240
- *
241
- * Default: `false`
242
- */
243
- immutable?: boolean | null;
244
- /**
245
- * Whether the field is required.
246
- *
247
- * Default: `false`
248
- */
249
- required?: boolean | null;
250
- /**
251
- * Additional optional plugins for the field.
252
- * @maxSize 100
253
- */
254
- plugins?: FieldPlugin[];
255
- }
256
- /** @oneof */
257
- export interface FieldRangeValidationsOneOf {
258
- /** Range of possible values for a numerical field. */
259
- numberRange?: NumberRange;
260
- /** Length range permitted for a text field. Relevant for fields that hold strings, such as those of type `TEXT` or `RICH_TEXT`. */
261
- stringLengthRange?: StringLengthRange;
262
- /** Array size range permitted. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`. */
263
- arraySizeRange?: ArraySizeRange;
264
- }
265
- export declare enum Type {
266
- UNKNOWN_FIELD_TYPE = "UNKNOWN_FIELD_TYPE",
267
- /** Plain-text string. */
268
- TEXT = "TEXT",
269
- /** Number. */
270
- NUMBER = "NUMBER",
271
- /** Date string in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DD`. */
272
- DATE = "DATE",
273
- /** [JavaScript Date object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/data-types-in-wix-data)) or an object in the following format: `"someFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}` ([REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-types-in-wix-data)). */
274
- DATETIME = "DATETIME",
275
- /** Web URL or a [Media Manager](https://dev.wix.com/docs/rest/assets/media/media-manager/introduction) URL. */
276
- IMAGE = "IMAGE",
277
- /** Boolean `true` or `false` value. */
278
- BOOLEAN = "BOOLEAN",
279
- /** Web URL or a [Media Manager](https://dev.wix.com/docs/rest/assets/media/media-manager/introduction) URL. */
280
- DOCUMENT = "DOCUMENT",
281
- /** URL in one of the following formats: `http://`, `https://`, `ftp://`, `mailto:`, `sms:`, `tel:`. */
282
- URL = "URL",
283
- /** [Rich-text](https://dev.wix.com/docs/rest/articles/getting-started/rich-text) string that may contain a subset of HTML tags. */
284
- RICH_TEXT = "RICH_TEXT",
285
- /** Web URL or a [Media Manager](https://dev.wix.com/docs/rest/assets/media/media-manager/introduction) URL. */
286
- VIDEO = "VIDEO",
287
- /** Any field type. */
288
- ANY = "ANY",
289
- /** Array of strings. */
290
- ARRAY_STRING = "ARRAY_STRING",
291
- /** Array of documents: web or [Media Manager](https://dev.wix.com/docs/rest/assets/media/media-manager/introduction) URLs. */
292
- ARRAY_DOCUMENT = "ARRAY_DOCUMENT",
293
- /** Web URL or a [Media Manager](https://dev.wix.com/docs/rest/assets/media/media-manager/introduction) URL. */
294
- AUDIO = "AUDIO",
295
- /** Time string in `hh:mm:ss.SSS` format. */
296
- TIME = "TIME",
297
- /** Language codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. These may include country codes in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#officially_assigned_code_elements) format. */
298
- LANGUAGE = "LANGUAGE",
299
- /** [Rich content](https://dev.wix.com/docs/ricos/getting-started/introduction). */
300
- RICH_CONTENT = "RICH_CONTENT",
301
- /** Array of web or [Media Manager](https://dev.wix.com/docs/rest/assets/media/media-manager/introduction) URLs. */
302
- MEDIA_GALLERY = "MEDIA_GALLERY",
303
- /** Physical address object ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/data-types-in-wix-data#address-object) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-types-in-wix-data#address-object)). */
304
- ADDRESS = "ADDRESS",
305
- /** [Dynamic page link](https://support.wix.com/en/article/cms-linking-to-dynamic-pages). */
306
- PAGE_LINK = "PAGE_LINK",
307
- /** Reference to another item in another collection. See Query Referenced Data Items ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/items/query-referenced) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/query-referenced-data-items)) to learn about item references. */
308
- REFERENCE = "REFERENCE",
309
- /** References to multiple items in another collection. See Query Referenced Data Items ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/items/query-referenced) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/query-referenced-data-items)) to learn about item references. */
310
- MULTI_REFERENCE = "MULTI_REFERENCE",
311
- /** JSON object. */
312
- OBJECT = "OBJECT",
313
- /** Array. */
314
- ARRAY = "ARRAY",
315
- /** Deprecated type that might appear in legacy collections. */
316
- LEGACY_TIME = "LEGACY_TIME",
317
- /** Deprecated type that might appear in legacy collections. */
318
- LEGACY_BOOK = "LEGACY_BOOK",
319
- /** Deprecated type that might appear in legacy collections. */
320
- LEGACY_EXTERNAL_URL = "LEGACY_EXTERNAL_URL",
321
- /** Deprecated type that might appear in legacy collections. */
322
- LEGACY_BROKEN_REFERENCE = "LEGACY_BROKEN_REFERENCE",
323
- /** Deprecated type that might appear in legacy collections. */
324
- LEGACY_IMAGE = "LEGACY_IMAGE",
325
- /** Deprecated type that might appear in legacy collections. */
326
- LEGACY_COLOR = "LEGACY_COLOR",
327
- /** Deprecated type that might appear in legacy collections. */
328
- LEGACY_EXTERNAL_VIDEO = "LEGACY_EXTERNAL_VIDEO"
329
- }
330
- /** @enumType */
331
- export type TypeWithLiterals = Type | 'UNKNOWN_FIELD_TYPE' | 'TEXT' | 'NUMBER' | 'DATE' | 'DATETIME' | 'IMAGE' | 'BOOLEAN' | 'DOCUMENT' | 'URL' | 'RICH_TEXT' | 'VIDEO' | 'ANY' | 'ARRAY_STRING' | 'ARRAY_DOCUMENT' | 'AUDIO' | 'TIME' | 'LANGUAGE' | 'RICH_CONTENT' | 'MEDIA_GALLERY' | 'ADDRESS' | 'PAGE_LINK' | 'REFERENCE' | 'MULTI_REFERENCE' | 'OBJECT' | 'ARRAY' | 'LEGACY_TIME' | 'LEGACY_BOOK' | 'LEGACY_EXTERNAL_URL' | 'LEGACY_BROKEN_REFERENCE' | 'LEGACY_IMAGE' | 'LEGACY_COLOR' | 'LEGACY_EXTERNAL_VIDEO';
332
- export interface TypeMetadata extends TypeMetadataMetadataOneOf {
333
- /** Metadata for a reference field. */
334
- reference?: Reference;
335
- /** Metadata for a multi-reference field. */
336
- multiReference?: MultiReference;
337
- /** Metadata for an object field. */
338
- object?: _Object;
339
- /** Metadata for an array field. */
340
- array?: _Array;
341
- /** Metadata for a page link field. */
342
- pageLink?: PageLink;
343
- }
344
- /** @oneof */
345
- export interface TypeMetadataMetadataOneOf {
346
- /** Metadata for a reference field. */
347
- reference?: Reference;
348
- /** Metadata for a multi-reference field. */
349
- multiReference?: MultiReference;
350
- /** Metadata for an object field. */
351
- object?: _Object;
352
- /** Metadata for an array field. */
353
- array?: _Array;
354
- /** Metadata for a page link field. */
355
- pageLink?: PageLink;
356
- }
357
- export interface FieldCapabilities {
358
- /**
359
- * Whether the collection can be sorted by this field.
360
- *
361
- * Default: `false`
362
- */
363
- sortable?: boolean;
364
- /**
365
- * Query operators that can be used for this field.
366
- * @maxSize 100
367
- */
368
- queryOperators?: QueryOperatorWithLiterals[];
369
- }
370
- export declare enum QueryOperator {
371
- EQ = "EQ",
372
- LT = "LT",
373
- GT = "GT",
374
- NE = "NE",
375
- LTE = "LTE",
376
- GTE = "GTE",
377
- STARTS_WITH = "STARTS_WITH",
378
- ENDS_WITH = "ENDS_WITH",
379
- CONTAINS = "CONTAINS",
380
- HAS_SOME = "HAS_SOME",
381
- HAS_ALL = "HAS_ALL",
382
- EXISTS = "EXISTS",
383
- URLIZED = "URLIZED"
384
- }
385
- /** @enumType */
386
- export type QueryOperatorWithLiterals = QueryOperator | 'EQ' | 'LT' | 'GT' | 'NE' | 'LTE' | 'GTE' | 'STARTS_WITH' | 'ENDS_WITH' | 'CONTAINS' | 'HAS_SOME' | 'HAS_ALL' | 'EXISTS' | 'URLIZED';
387
- export interface ObjectField {
388
- /**
389
- * Field ID.
390
- * @maxLength 1000
391
- */
392
- key?: string;
393
- /**
394
- * Display name for the field.
395
- * @maxLength 1000
396
- */
397
- displayName?: string | null;
398
- /**
399
- * Field type.
400
- *
401
- * Learn more about data types in Wix Data ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/data-types-in-wix-data) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-types-in-wix-data)).
402
- */
403
- type?: TypeWithLiterals;
404
- /** Metadata for complex data types. This property only exists for references, multi-references, objects, and arrays. */
405
- typeMetadata?: TypeMetadata;
406
- /**
407
- * Capabilities the object field supports.
408
- * @readonly
409
- */
410
- capabilities?: FieldCapabilities;
411
- }
412
- export interface FieldsPattern {
413
- /** @maxLength 1000 */
414
- pattern?: string;
415
- lowercase?: boolean;
416
- }
417
- export interface UrlizedOnlyPattern {
418
- /** @maxLength 1000 */
419
- pattern?: string;
420
- }
421
- export interface Calculator extends CalculatorPatternOneOf {
422
- /** Value is calculated according to pattern, whitespaces are replaced with dash [-]. */
423
- fieldsPattern?: FieldsPattern;
424
- /** Value is only URL encoded. */
425
- urlizedOnlyPattern?: UrlizedOnlyPattern;
426
- }
427
- /** @oneof */
428
- export interface CalculatorPatternOneOf {
429
- /** Value is calculated according to pattern, whitespaces are replaced with dash [-]. */
430
- fieldsPattern?: FieldsPattern;
431
- /** Value is only URL encoded. */
432
- urlizedOnlyPattern?: UrlizedOnlyPattern;
433
- }
434
- export interface Reference {
435
- /**
436
- * Referenced collection ID.
437
- * @maxLength 256
438
- */
439
- referencedCollectionId?: string;
440
- }
441
- export interface MultiReference {
442
- /**
443
- * Referenced collection ID.
444
- * @maxLength 256
445
- */
446
- referencedCollectionId?: string;
447
- /**
448
- * Referencing field ID.
449
- * @maxLength 1000
450
- */
451
- referencingFieldKey?: string;
452
- /**
453
- * Display name in the CMS for the referenced data.
454
- * @maxLength 1000
455
- */
456
- referencingDisplayName?: string;
457
- }
458
- export interface _Object {
459
- /**
460
- * Fields within the object.
461
- * @maxSize 1000
462
- */
463
- fields?: ObjectField[];
464
- }
465
- export interface _Array {
466
- /** Element's data type. */
467
- elementType?: TypeWithLiterals;
468
- /** Metadata for complex data types. This property only exists for references, multi-references, objects, and arrays. */
469
- typeMetadata?: TypeMetadata;
470
- }
471
- export interface PageLink {
472
- calculator?: Calculator;
473
- /**
474
- * Defines reference to router pattern in the site document.
475
- * @maxLength 1000
476
- */
477
- linkedRouterPage?: string | null;
478
- }
479
- export interface NumberRange {
480
- /**
481
- * Minimum permitted value for a numerical field.
482
- *
483
- * Default: No validation
484
- */
485
- min?: number | null;
486
- /**
487
- * Maximum permitted value for a numerical field.
488
- *
489
- * Default: No validation
490
- */
491
- max?: number | null;
492
- }
493
- export interface StringLengthRange {
494
- /**
495
- * Minimum permitted length for a text field.
496
- *
497
- * Default: No validation
498
- */
499
- minLength?: number | null;
500
- /**
501
- * Maximum permitted length for a text field.
502
- *
503
- * Default: No validation
504
- */
505
- maxLength?: number | null;
506
- }
507
- export interface ArraySizeRange {
508
- /**
509
- * 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`.
510
- *
511
- * Default: No validation
512
- */
513
- minSize?: number | null;
514
- /**
515
- * 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`.
516
- *
517
- * Default: No validation
518
- */
519
- maxSize?: number | null;
520
- }
521
- /** Optional plug-in aspects for fields */
522
- export interface FieldPlugin extends FieldPluginOptionsOneOf {
523
- /** Options for the CMS plugin. */
524
- cmsOptions?: CmsOptions;
525
- type?: FieldPluginTypeWithLiterals;
526
- }
527
- /** @oneof */
528
- export interface FieldPluginOptionsOneOf {
529
- /** Options for the CMS plugin. */
530
- cmsOptions?: CmsOptions;
531
- }
532
- export declare enum FieldPluginType {
533
- /** Uknown plugin type. */
534
- UNKNOWN = "UNKNOWN",
535
- /** CMS-related field attributes */
536
- CMS = "CMS"
537
- }
538
- /** @enumType */
539
- export type FieldPluginTypeWithLiterals = FieldPluginType | 'UNKNOWN' | 'CMS';
540
- /** Options for the CMS plugin. */
541
- export interface CmsOptions {
542
- /**
543
- * Indicates an internal CMS field. The CMS does not display internal fields.
544
- *
545
- * Default: `false`
546
- */
547
- internal?: boolean;
548
- }
549
- /** Permissions defined by the lowest role needed to perform each action. */
550
- export interface Permissions {
551
- /** Lowest role needed to add a collection. */
552
- insert?: RoleWithLiterals;
553
- /** Lowest role needed to update a collection. */
554
- update?: RoleWithLiterals;
555
- /** Lowest role needed to remove a collection. */
556
- remove?: RoleWithLiterals;
557
- /** Lowest role needed to read a collection. */
558
- read?: RoleWithLiterals;
559
- }
560
- export declare enum Role {
561
- /** Unknown role. */
562
- UNKNOWN_ROLE = "UNKNOWN_ROLE",
563
- /** Site administrator. */
564
- ADMIN = "ADMIN",
565
- /** Signed-in user who added content to this collection. */
566
- SITE_MEMBER_AUTHOR = "SITE_MEMBER_AUTHOR",
567
- /** Any signed-in user. */
568
- SITE_MEMBER = "SITE_MEMBER",
569
- /** Any site visitor. */
570
- ANYONE = "ANYONE"
571
- }
572
- /** @enumType */
573
- export type RoleWithLiterals = Role | 'UNKNOWN_ROLE' | 'ADMIN' | 'SITE_MEMBER_AUTHOR' | 'SITE_MEMBER' | 'ANYONE';
574
- export interface Plugin extends PluginOptionsOneOf {
575
- /**
576
- * Options for the Publish plugin.
577
- * 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.
578
- */
579
- publishOptions?: PublishPluginOptions;
580
- /** Options for the Single Item plugin. */
581
- singleItemOptions?: SingleItemPluginOptions;
582
- /** Options for the Urlized plugin. */
583
- urlizedOptions?: UrlizedPluginOptions;
584
- /** Options for the Multilingual plugin. */
585
- multilingualOptions?: MultilingualOptions;
586
- /** Options for the PageLink plugin. */
587
- editablePageLinkOptions?: PageLinkPluginOptions;
588
- /** Options for the CMS plugin. */
589
- cmsOptions?: PluginCmsOptions;
590
- /** Plugin type. */
591
- type?: PluginTypeWithLiterals;
592
- }
593
- /** @oneof */
594
- export interface PluginOptionsOneOf {
595
- /**
596
- * Options for the Publish plugin.
597
- * 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.
598
- */
599
- publishOptions?: PublishPluginOptions;
600
- /** Options for the Single Item plugin. */
601
- singleItemOptions?: SingleItemPluginOptions;
602
- /** Options for the Urlized plugin. */
603
- urlizedOptions?: UrlizedPluginOptions;
604
- /** Options for the Multilingual plugin. */
605
- multilingualOptions?: MultilingualOptions;
606
- /** Options for the PageLink plugin. */
607
- editablePageLinkOptions?: PageLinkPluginOptions;
608
- /** Options for the CMS plugin. */
609
- cmsOptions?: PluginCmsOptions;
610
- }
611
- export declare enum Status {
612
- UNKNOWN_PUBLISH_PLUGIN_STATUS = "UNKNOWN_PUBLISH_PLUGIN_STATUS",
613
- PUBLISHED = "PUBLISHED",
614
- DRAFT = "DRAFT"
615
- }
616
- /** @enumType */
617
- export type StatusWithLiterals = Status | 'UNKNOWN_PUBLISH_PLUGIN_STATUS' | 'PUBLISHED' | 'DRAFT';
618
- export declare enum Format {
619
- UNKNOWN_URLIZED_PLUGIN_FORMAT = "UNKNOWN_URLIZED_PLUGIN_FORMAT",
620
- /** Letters are converted to lower case and spaces are replaced with dashes before generating the encoded URL. */
621
- ORIGINAL = "ORIGINAL",
622
- /** No changes are made before generating the encoded URL. */
623
- PLAIN = "PLAIN"
624
- }
625
- /** @enumType */
626
- export type FormatWithLiterals = Format | 'UNKNOWN_URLIZED_PLUGIN_FORMAT' | 'ORIGINAL' | 'PLAIN';
627
- /** if CMS-defined sort is enabled and should be used in site */
628
- export interface SiteSort {
629
- /**
630
- * Field and order for the site sort.
631
- * @maxSize 100
632
- */
633
- sort?: Sort[];
634
- }
635
- export declare enum PluginType {
636
- /** Unknown plugin type. */
637
- UNKNOWN_PLUGIN_TYPE = "UNKNOWN_PLUGIN_TYPE",
638
- /** 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. */
639
- PUBLISH = "PUBLISH",
640
- /** Ensures the collection can have one item at most. Can only be applied to a new collection. */
641
- SINGLE_ITEM = "SINGLE_ITEM",
642
- /** Generates item URLs for collections used by dynamic pages. */
643
- URLIZED = "URLIZED",
644
- /** Deprecated. Will be removed in the future. */
645
- GRIDAPPLESS = "GRIDAPPLESS",
646
- /** 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). */
647
- MULTILINGUAL = "MULTILINGUAL",
648
- /** Indicates that collection is shared with current site. */
649
- SHARED = "SHARED",
650
- /** Indicates that page link fields are persisted and can be updated. */
651
- EDITABLE_PAGE_LINK = "EDITABLE_PAGE_LINK",
652
- /** CMS-specific collection properties. */
653
- CMS = "CMS"
654
- }
655
- /** @enumType */
656
- export type PluginTypeWithLiterals = PluginType | 'UNKNOWN_PLUGIN_TYPE' | 'PUBLISH' | 'SINGLE_ITEM' | 'URLIZED' | 'GRIDAPPLESS' | 'MULTILINGUAL' | 'SHARED' | 'EDITABLE_PAGE_LINK' | 'CMS';
657
- export interface PublishPluginOptions {
658
- /** Default status. */
659
- defaultStatus?: StatusWithLiterals;
660
- }
661
- export interface SingleItemPluginOptions {
662
- /**
663
- * ID of the single item in this collection. If you insert or update an item, its ID value is always changed to this.
664
- * @maxLength 16000
665
- */
666
- singleItemId?: string;
667
- }
668
- export interface UrlizedPluginOptions {
669
- /** Encoding method for generating a URL in ASCII characters. */
670
- format?: FormatWithLiterals;
671
- }
672
- export interface MultilingualOptions {
673
- /**
674
- * IDs of fields to allow translation.
675
- * @maxSize 1000
676
- * @maxLength 1000
677
- */
678
- translatableFieldKeys?: string[];
679
- }
680
- export interface PageLinkPluginOptions {
681
- isPersisted?: boolean;
682
- isMutable?: boolean;
683
- }
684
- export interface PluginCmsOptions {
685
- /** CMS sort, applied when a collection is displayed on a site. */
686
- siteSort?: SiteSort;
687
- }
688
- export declare enum PagingMode {
689
- /** Offset-based paging. */
690
- OFFSET = "OFFSET",
691
- /** Cursor-based paging. */
692
- CURSOR = "CURSOR"
693
- }
694
- /** @enumType */
695
- export type PagingModeWithLiterals = PagingMode | 'OFFSET' | 'CURSOR';
696
- /** Data permissions defined by access level for each action. */
697
- export interface DataPermissions {
698
- /** Access level for data items read */
699
- itemRead?: AccessLevelWithLiterals;
700
- /** Access level for data items insert */
701
- itemInsert?: AccessLevelWithLiterals;
702
- /** Access level for data items update */
703
- itemUpdate?: AccessLevelWithLiterals;
704
- /** Access level for data items removal */
705
- itemRemove?: AccessLevelWithLiterals;
706
- }
707
- /**
708
- * Describes who can perform certain action.
709
- * Each level includes all levels below it (except UNDEFINED).
710
- */
711
- export declare enum AccessLevel {
712
- /** Not set. */
713
- UNDEFINED = "UNDEFINED",
714
- /** Any subject, including visitors. */
715
- ANYONE = "ANYONE",
716
- /** Any signed-in user (both site members and collaborators). */
717
- SITE_MEMBER = "SITE_MEMBER",
718
- /** Any signed-in user, but site members only have access to own items. */
719
- SITE_MEMBER_AUTHOR = "SITE_MEMBER_AUTHOR",
720
- /** Site collaborator that has a role with CMS Access permission. */
721
- CMS_EDITOR = "CMS_EDITOR",
722
- /** CMS administrators and users or roles granted with special access. */
723
- PRIVILEGED = "PRIVILEGED"
724
- }
725
- /** @enumType */
726
- export type AccessLevelWithLiterals = AccessLevel | 'UNDEFINED' | 'ANYONE' | 'SITE_MEMBER' | 'SITE_MEMBER_AUTHOR' | 'CMS_EDITOR' | 'PRIVILEGED';
727
- export interface AllowedDataPermissions {
728
- /** If data items read permitted */
729
- itemRead?: boolean;
730
- /** If for data items insert permitted */
731
- itemInsert?: boolean;
732
- /** If data items update permitted */
733
- itemUpdate?: boolean;
734
- /** If data items removal permitted */
735
- itemRemove?: boolean;
736
- }
737
- export interface DataCollectionClonedEvent {
738
- /**
739
- * Instance ID of the collection from which the data is cloned.
740
- * @format GUID
741
- */
742
- originInstanceId?: string;
743
- /**
744
- * ID of the collection from which the data is cloned.
745
- * @maxLength 256
746
- */
747
- originId?: string;
748
- }
749
- export interface DataCollectionChangedEvent {
750
- /**
751
- * list of new fields
752
- * @maxSize 1000
753
- */
754
- fieldsAdded?: Field[];
755
- /**
756
- * list of changed fields
757
- * @maxSize 1000
758
- */
759
- fieldsUpdated?: FieldUpdate[];
760
- /**
761
- * list of removed fields
762
- * @maxSize 1000
763
- */
764
- fieldsRemoved?: Field[];
765
- /**
766
- * list of new plugins
767
- * @maxSize 100
768
- */
769
- pluginsAdded?: Plugin[];
770
- /**
771
- * list of changed plugins
772
- * @maxSize 100
773
- */
774
- pluginsUpdated?: PluginUpdate[];
775
- /**
776
- * list of removed plugins
777
- * @maxSize 100
778
- */
779
- pluginsRemoved?: Plugin[];
780
- }
781
- export interface FieldUpdate {
782
- /** previous state of the field */
783
- previous?: Field;
784
- /** current state of the field */
785
- current?: Field;
786
- }
787
- export interface PluginUpdate {
788
- /** previous state of the plugin */
789
- previous?: Plugin;
790
- /** current state of the plugin */
791
- current?: Plugin;
792
- }
793
- export interface DataCollectionEvictedEvent {
794
- /**
795
- * ID of the collection that was permanently deleted.
796
- * @minLength 1
797
- * @maxLength 1000
798
- */
799
- _id?: string;
800
- }
801
- export interface CreateDataCollectionRequest {
802
- /** Collection details. */
803
- collection: DataCollection;
804
- }
805
- export interface CreateDataCollectionResponse {
806
- /** Details of collection created. */
807
- collection?: DataCollection;
808
- }
809
- export interface GetDataCollectionRequest {
810
- /**
811
- * ID of the collection to retrieve.
812
- * @maxLength 256
813
- */
814
- dataCollectionId: string;
815
- /**
816
- * Whether to retrieve data from the primary database instance.
817
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
818
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
819
- *
820
- * Default: `false`
821
- */
822
- consistentRead?: boolean;
823
- /**
824
- * List of specific field names to return, if empty all fields are returned.
825
- * Affects all returned collections
826
- * @maxSize 100
827
- * @maxLength 1000
828
- */
829
- fields?: string[];
830
- }
831
- export declare enum Segment {
832
- UNKNOWN_SEGMENT = "UNKNOWN_SEGMENT",
833
- PUBLIC = "PUBLIC",
834
- DEV = "DEV"
835
- }
836
- /** @enumType */
837
- export type SegmentWithLiterals = Segment | 'UNKNOWN_SEGMENT' | 'PUBLIC' | 'DEV';
838
- export interface GetDataCollectionResponse {
839
- /** Details of the collection requested. */
840
- collection?: DataCollection;
841
- /**
842
- * Details of collections referenced by the collection requested.
843
- * Only populated when `includeReferencedCollections` is `true` in the request.
844
- */
845
- referencedCollections?: DataCollection[];
846
- }
847
- export interface ListDataCollectionsRequest {
848
- /**
849
- * Defines how collections in the response are sorted.
850
- *
851
- * Default: Ordered by ID in ascending order.
852
- */
853
- sort?: Sorting;
854
- /** Pagination information. */
855
- paging?: Paging;
856
- /**
857
- * Whether to retrieve data from the primary database instance.
858
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
859
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
860
- *
861
- * Default: `false`
862
- */
863
- consistentRead?: boolean;
864
- /**
865
- * List of specific field names to return, if empty all fields are returned.
866
- * Affects all returned collections
867
- * @maxSize 100
868
- * @maxLength 128
869
- */
870
- fields?: string[];
871
- }
872
- export interface Sorting {
873
- /**
874
- * Name of the field to sort by.
875
- * @maxLength 1000
876
- */
877
- fieldName?: string;
878
- /** Sort order. */
879
- order?: SortOrderWithLiterals;
880
- }
881
- export declare enum SortOrder {
882
- ASC = "ASC",
883
- DESC = "DESC"
884
- }
885
- /** @enumType */
886
- export type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
887
- export interface Paging {
888
- /** Number of items to load. */
889
- limit?: number | null;
890
- /** Number of items to skip in the current sort order. */
891
- offset?: number | null;
892
- }
893
- export interface ListDataCollectionsResponse {
894
- /** List of collections. */
895
- collections?: DataCollection[];
896
- /** Paging information. */
897
- pagingMetadata?: PagingMetadataV2;
898
- }
899
- export interface PagingMetadataV2 {
900
- /** Number of items returned in the response. */
901
- count?: number | null;
902
- /** Offset that was requested. */
903
- offset?: number | null;
904
- /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
905
- total?: number | null;
906
- /** Flag that indicates the server failed to calculate the `total` field. */
907
- tooManyToCount?: boolean | null;
908
- }
909
- export interface BulkGetDataCollectionsRequest {
910
- /**
911
- * IDs of the collections to retrieve.
912
- * @minSize 1
913
- * @maxSize 100
914
- * @maxLength 256
915
- */
916
- dataCollectionIds?: string[];
917
- /**
918
- * Whether to include deleted collections.
919
- *
920
- * Default: `false`
921
- */
922
- showDeletedCollections?: boolean;
923
- /**
924
- * Whether the returned collection list should include referenced collections.
925
- *
926
- * Default: `false`
927
- */
928
- includeReferencedCollections?: boolean;
929
- /** Sorting preferences. */
930
- sort?: Sorting;
931
- /**
932
- * Whether to retrieve data from the primary database instance.
933
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
934
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
935
- *
936
- * Default: `false`
937
- */
938
- consistentRead?: boolean;
939
- /**
940
- * List of specific field names to return, if empty all fields are returned.
941
- * Affects all returned collections
942
- * @maxSize 100
943
- * @maxLength 1000
944
- */
945
- fields?: string[];
946
- }
947
- export interface BulkGetDataCollectionsResponse {
948
- /**
949
- * List of requested collections.
950
- * When `include_referenced_collections` is `true` in the request, referenced collections are included here.
951
- */
952
- activeCollections?: DataCollection[];
953
- /** List of requested deleted collections. Only populated when `showDeletedCollections` is true in the request. */
954
- deletedCollections?: DataCollection[];
955
- }
956
- export interface UpdateDataCollectionRequest {
957
- /** Updated collection details. The existing collection is replaced with this version. */
958
- collection: DataCollection;
959
- }
960
- export interface UpdateDataCollectionResponse {
961
- /** Updated collection details. */
962
- collection?: DataCollection;
963
- }
964
- export interface DeleteDataCollectionRequest {
965
- /**
966
- * ID of the collection to delete.
967
- * @maxLength 256
968
- */
969
- dataCollectionId: string;
970
- }
971
- export interface DeleteDataCollectionResponse {
972
- }
973
- export interface RestoreDataCollectionRequest {
974
- /**
975
- * Data Collection ID to restore
976
- * @maxLength 256
977
- */
978
- dataCollectionId?: string;
979
- }
980
- export interface RestoreDataCollectionResponse {
981
- /** Restored data collection */
982
- dataCollection?: DataCollection;
983
- }
984
- export interface CreateDataCollectionFieldRequest {
985
- /**
986
- * ID of data collection to update
987
- * @maxLength 256
988
- */
989
- dataCollectionId: string;
990
- /** field to create */
991
- field: Field;
992
- }
993
- export interface CreateDataCollectionFieldResponse {
994
- /** updated data collection */
995
- dataCollection?: DataCollection;
996
- }
997
- export interface UpdateDataCollectionFieldRequest {
998
- /**
999
- * ID of data collection to update
1000
- * @maxLength 256
1001
- */
1002
- dataCollectionId: string;
1003
- /** Field to update */
1004
- field: Field;
1005
- }
1006
- export interface UpdateDataCollectionFieldResponse {
1007
- /** updated data collection */
1008
- dataCollection?: DataCollection;
1009
- }
1010
- export interface DeleteDataCollectionFieldRequest {
1011
- /**
1012
- * ID of data collection to update
1013
- * @maxLength 256
1014
- */
1015
- dataCollectionId: string;
1016
- /**
1017
- * Field ID to delete
1018
- * @maxLength 1000
1019
- */
1020
- fieldKey: string;
1021
- }
1022
- export interface DeleteDataCollectionFieldResponse {
1023
- /** updated data collection */
1024
- dataCollection?: DataCollection;
1025
- }
1026
- export interface UpdateDataPermissionsRequest {
1027
- /**
1028
- * ID of data collections to update
1029
- * @maxLength 256
1030
- */
1031
- dataCollectionId?: string;
1032
- /** Data permissions to set */
1033
- dataPermissions?: DataPermissions;
1034
- }
1035
- export interface UpdateDataPermissionsResponse {
1036
- /** Updated data collection */
1037
- dataCollection?: DataCollection;
1038
- }
1039
- export interface BulkGetDataCollectionsPageBySnapshotsRequest {
1040
- /**
1041
- * Ids of schema snapshot
1042
- * @format GUID
1043
- * @minSize 1
1044
- * @maxSize 1000
1045
- */
1046
- snapshotIds?: string[];
1047
- /** Pagination information. */
1048
- paging?: Paging;
1049
- }
1050
- export interface BulkGetDataCollectionsPageBySnapshotsResponse {
1051
- /** List of snapshot collection map */
1052
- snapshotCollections?: SnapshotCollection[];
1053
- /** Paging information. */
1054
- pagingMetadata?: PagingMetadataV2;
1055
- }
1056
- export interface SnapshotCollection {
1057
- /**
1058
- * snapshot to which collection belongs
1059
- * @format GUID
1060
- */
1061
- snapshotId?: string;
1062
- /** snapshot collection */
1063
- collection?: DataCollection;
1064
- /**
1065
- * snapshot of collection indexes
1066
- * @maxSize 100
1067
- */
1068
- indexes?: Index[];
1069
- }
1070
- /** An index is a map of a collection's data, organized according to specific fields to increase query speed. */
1071
- export interface Index {
1072
- /**
1073
- * Name of the index.
1074
- * @minLength 1
1075
- * @maxLength 128
1076
- */
1077
- name?: string;
1078
- /**
1079
- * Fields for which the index is defined.
1080
- *
1081
- * Max: 3 fields (for a unique index: 1 field)
1082
- * @minSize 1
1083
- * @maxSize 3
1084
- */
1085
- fields?: IndexField[];
1086
- /**
1087
- * Current status of the index.
1088
- * @readonly
1089
- */
1090
- status?: IndexStatusWithLiterals;
1091
- /**
1092
- * Contains details about the reasons for failure when `status` is `FAILED`.
1093
- * @readonly
1094
- */
1095
- failure?: Failure;
1096
- /**
1097
- * Whether the index enforces uniqueness of values in the field for which it is defined.
1098
- * If `true`, the index can have only one field.
1099
- *
1100
- * Default: `false`
1101
- */
1102
- unique?: boolean;
1103
- /**
1104
- * Whether the index ignores case.
1105
- *
1106
- * Default: `false`
1107
- */
1108
- caseInsensitive?: boolean;
1109
- /** Specifies the origin of the index definition. */
1110
- source?: IndexSourceWithLiterals;
1111
- }
1112
- /**
1113
- * Order determines how values are ordered in the index. This is important when
1114
- * ordering and/or range querying by indexed fields.
1115
- */
1116
- export declare enum Order {
1117
- ASC = "ASC",
1118
- DESC = "DESC"
1119
- }
1120
- /** @enumType */
1121
- export type OrderWithLiterals = Order | 'ASC' | 'DESC';
1122
- export interface IndexField {
1123
- /**
1124
- * Path of the field to index. For example: `title` or `options.price`.
1125
- * @minLength 1
1126
- * @maxLength 128
1127
- */
1128
- path?: string;
1129
- /**
1130
- * Sort order for the index. Base on how the data is regularly queried.
1131
- *
1132
- * Default: `ASC`
1133
- */
1134
- order?: OrderWithLiterals;
1135
- }
1136
- export declare enum IndexStatus {
1137
- /** Place holder. Never returned by the service. */
1138
- UNKNOWN = "UNKNOWN",
1139
- /** Index creation is in progress. */
1140
- BUILDING = "BUILDING",
1141
- /** Index has been successfully created and can be used in queries. */
1142
- ACTIVE = "ACTIVE",
1143
- /** Index is in the process of being dropped. */
1144
- DROPPING = "DROPPING",
1145
- /** Index has been dropped successfully. */
1146
- DROPPED = "DROPPED",
1147
- /** Index creation has failed. */
1148
- FAILED = "FAILED",
1149
- /** Index contains incorrectly indexed data. */
1150
- INVALID = "INVALID"
1151
- }
1152
- /** @enumType */
1153
- export type IndexStatusWithLiterals = IndexStatus | 'UNKNOWN' | 'BUILDING' | 'ACTIVE' | 'DROPPING' | 'DROPPED' | 'FAILED' | 'INVALID';
1154
- export interface Failure {
1155
- /**
1156
- * Error code.
1157
- * - `WDE0112`: Unknown error while building collection index.
1158
- * - `WDE0113`: Duplicate key error while building collection index.
1159
- * - `WDE0114`: Document too large while building collection index.
1160
- * @maxLength 7
1161
- */
1162
- code?: string;
1163
- /**
1164
- * Description of the failure.
1165
- * @maxLength 1024
1166
- */
1167
- description?: string;
1168
- /**
1169
- * ID of the data item that caused the failure.
1170
- * For example, if `unique` is `true`, the ID of an item containing a duplicate value.
1171
- * @maxLength 16000
1172
- */
1173
- itemId?: string | null;
1174
- }
1175
- export declare enum IndexSource {
1176
- /** Place holder. Never returned by the service. */
1177
- UNKNOWN_INDEX_SOURCE = "UNKNOWN_INDEX_SOURCE",
1178
- /** Index is created by the system, present for all collections. */
1179
- SYSTEM = "SYSTEM",
1180
- /** Index was created by a user via API or UI. */
1181
- USER = "USER",
1182
- /** Index is created automatically by the system based on user queries. */
1183
- AUTO = "AUTO"
1184
- }
1185
- /** @enumType */
1186
- export type IndexSourceWithLiterals = IndexSource | 'UNKNOWN_INDEX_SOURCE' | 'SYSTEM' | 'USER' | 'AUTO';
1187
- export interface CreateDataCollectionsSnapshotRequest {
1188
- }
1189
- export interface CreateDataCollectionsSnapshotResponse {
1190
- /**
1191
- * created snapshot ID
1192
- * @format GUID
1193
- */
1194
- snapshotId?: string;
1195
- /** data collections in snapshot */
1196
- snapshotCollections?: DataCollection[];
1197
- }
1198
- export interface RestoreDataCollectionsFromSnapshotRequest {
1199
- /**
1200
- * snapshot ID to restore
1201
- * @format GUID
1202
- */
1203
- snapshotId?: string;
1204
- /**
1205
- * collection IDs to restore, if empty – all collections would be restored
1206
- * @maxSize 1000
1207
- * @maxLength 256
1208
- * @deprecated
1209
- * @replacedBy restoration_collections
1210
- * @targetRemovalDate 2025-12-31
1211
- */
1212
- dataCollectionIds?: string[];
1213
- /**
1214
- * collection to restore, if empty – all collections would be restored
1215
- * @maxSize 1000
1216
- */
1217
- restorationCollections?: RestorationCollection[];
1218
- }
1219
- export interface Destination {
1220
- /**
1221
- * Collection id.
1222
- * @minLength 1
1223
- * @maxLength 1000
1224
- */
1225
- dataCollectionId?: string;
1226
- /**
1227
- * Display name. When not specified value is taken from the snapshot.
1228
- * @maxLength 1000
1229
- */
1230
- displayName?: string | null;
1231
- }
1232
- export interface RestorationCollection {
1233
- /**
1234
- * Collection ID to restore
1235
- * @minLength 1
1236
- * @maxLength 1000
1237
- */
1238
- dataCollectionId?: string;
1239
- /**
1240
- * Destination where to restore the collection.
1241
- * When not specified destination is taken from snapshot.
1242
- */
1243
- destination?: Destination;
1244
- }
1245
- export interface RestoreDataCollectionsFromSnapshotResponse {
1246
- /** restored collections */
1247
- restoredCollections?: DataCollection[];
1248
- }
1249
- export interface DeleteDataCollectionsSnapshotRequest {
1250
- /**
1251
- * snapshot ID to delete
1252
- * @format GUID
1253
- */
1254
- snapshotId?: string;
1255
- }
1256
- export interface DeleteDataCollectionsSnapshotResponse {
1257
- }
1258
- export interface CreateMigratedCollectionsSnapshotRequest {
1259
- /** @format GUID */
1260
- existingSnapshotId?: string;
1261
- /** @maxLength 255 */
1262
- newNamespace?: string;
1263
- /** @maxLength 255 */
1264
- existingNamespace?: string;
1265
- }
1266
- export interface CreateMigratedCollectionsSnapshotResponse {
1267
- /** @format GUID */
1268
- snapshotId?: string;
1269
- }
1270
- export interface DomainEvent extends DomainEventBodyOneOf {
1271
- createdEvent?: EntityCreatedEvent;
1272
- updatedEvent?: EntityUpdatedEvent;
1273
- deletedEvent?: EntityDeletedEvent;
1274
- actionEvent?: ActionEvent;
1275
- /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
1276
- _id?: string;
1277
- /**
1278
- * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
1279
- * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
1280
- */
1281
- entityFqdn?: string;
1282
- /**
1283
- * Event action name, placed at the top level to make it easier for users to dispatch messages.
1284
- * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
1285
- */
1286
- slug?: string;
1287
- /** ID of the entity associated with the event. */
1288
- entityId?: string;
1289
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
1290
- eventTime?: Date | null;
1291
- /**
1292
- * Whether the event was triggered as a result of a privacy regulation application
1293
- * (for example, GDPR).
1294
- */
1295
- triggeredByAnonymizeRequest?: boolean | null;
1296
- /** If present, indicates the action that triggered the event. */
1297
- originatedFrom?: string | null;
1298
- /**
1299
- * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.
1300
- * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
1301
- */
1302
- entityEventSequence?: string | null;
1303
- }
1304
- /** @oneof */
1305
- export interface DomainEventBodyOneOf {
1306
- createdEvent?: EntityCreatedEvent;
1307
- updatedEvent?: EntityUpdatedEvent;
1308
- deletedEvent?: EntityDeletedEvent;
1309
- actionEvent?: ActionEvent;
1310
- }
1311
- export interface EntityCreatedEvent {
1312
- entity?: string;
1313
- }
1314
- export interface RestoreInfo {
1315
- deletedDate?: Date | null;
1316
- }
1317
- export interface EntityUpdatedEvent {
1318
- /**
1319
- * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
1320
- * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
1321
- * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
1322
- */
1323
- currentEntity?: string;
1324
- }
1325
- export interface EntityDeletedEvent {
1326
- /** Entity that was deleted. */
1327
- deletedEntity?: string | null;
1328
- }
1329
- export interface ActionEvent {
1330
- body?: string;
1331
- }
1332
- export interface MessageEnvelope {
1333
- /**
1334
- * App instance ID.
1335
- * @format GUID
1336
- */
1337
- instanceId?: string | null;
1338
- /**
1339
- * Event type.
1340
- * @maxLength 150
1341
- */
1342
- eventType?: string;
1343
- /** The identification type and identity data. */
1344
- identity?: IdentificationData;
1345
- /** Stringify payload. */
1346
- data?: string;
1347
- }
1348
- export interface IdentificationData extends IdentificationDataIdOneOf {
1349
- /**
1350
- * ID of a site visitor that has not logged in to the site.
1351
- * @format GUID
1352
- */
1353
- anonymousVisitorId?: string;
1354
- /**
1355
- * ID of a site visitor that has logged in to the site.
1356
- * @format GUID
1357
- */
1358
- memberId?: string;
1359
- /**
1360
- * ID of a Wix user (site owner, contributor, etc.).
1361
- * @format GUID
1362
- */
1363
- wixUserId?: string;
1364
- /**
1365
- * ID of an app.
1366
- * @format GUID
1367
- */
1368
- appId?: string;
1369
- /** @readonly */
1370
- identityType?: WebhookIdentityTypeWithLiterals;
1371
- }
1372
- /** @oneof */
1373
- export interface IdentificationDataIdOneOf {
1374
- /**
1375
- * ID of a site visitor that has not logged in to the site.
1376
- * @format GUID
1377
- */
1378
- anonymousVisitorId?: string;
1379
- /**
1380
- * ID of a site visitor that has logged in to the site.
1381
- * @format GUID
1382
- */
1383
- memberId?: string;
1384
- /**
1385
- * ID of a Wix user (site owner, contributor, etc.).
1386
- * @format GUID
1387
- */
1388
- wixUserId?: string;
1389
- /**
1390
- * ID of an app.
1391
- * @format GUID
1392
- */
1393
- appId?: string;
1394
- }
1395
- export declare enum WebhookIdentityType {
1396
- UNKNOWN = "UNKNOWN",
1397
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
1398
- MEMBER = "MEMBER",
1399
- WIX_USER = "WIX_USER",
1400
- APP = "APP"
1401
- }
1402
- /** @enumType */
1403
- export type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
1404
- type DataCollectionNonNullablePaths = `_id` | `collectionType` | `defaultDisplayOrder.fieldKey` | `defaultDisplayOrder.direction` | `capabilities.dataOperations` | `capabilities.collectionOperations` | `capabilities.indexLimits.regular` | `capabilities.indexLimits.unique` | `capabilities.indexLimits.total` | `fields` | `fields.${number}.key` | `fields.${number}.type` | `fields.${number}.typeMetadata.reference.referencedCollectionId` | `fields.${number}.typeMetadata.multiReference.referencedCollectionId` | `fields.${number}.typeMetadata.multiReference.referencingFieldKey` | `fields.${number}.typeMetadata.multiReference.referencingDisplayName` | `fields.${number}.typeMetadata.array.elementType` | `fields.${number}.typeMetadata.pageLink.calculator.fieldsPattern.pattern` | `fields.${number}.typeMetadata.pageLink.calculator.fieldsPattern.lowercase` | `fields.${number}.typeMetadata.pageLink.calculator.urlizedOnlyPattern.pattern` | `fields.${number}.systemField` | `fields.${number}.encrypted` | `permissions.insert` | `permissions.update` | `permissions.remove` | `permissions.read` | `plugins` | `plugins.${number}.publishOptions.defaultStatus` | `plugins.${number}.singleItemOptions.singleItemId` | `plugins.${number}.urlizedOptions.format` | `plugins.${number}.editablePageLinkOptions.isPersisted` | `plugins.${number}.editablePageLinkOptions.isMutable` | `plugins.${number}.type` | `pagingModes`;
1405
- /**
1406
- * Creates a new data collection.
1407
- *
1408
- * The request body must include an ID, details for at least 1 field, and a permissions object. If any of these are missing, the collection isn't created.
1409
- * @param collection - Collection details.
1410
- * @public
1411
- * @requiredField collection
1412
- * @requiredField collection._id
1413
- * @requiredField collection.fields.key
1414
- * @requiredField collection.fields.type
1415
- * @requiredField collection.permissions.insert
1416
- * @requiredField collection.permissions.read
1417
- * @requiredField collection.permissions.remove
1418
- * @requiredField collection.permissions.update
1419
- * @param options - Options for creating a data collection.
1420
- * @permissionId WIX_DATA.CREATE_COLLECTION
1421
- * @permissionScope Manage All Data Resources
1422
- * @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL
1423
- * @permissionScope Manage Data Collections
1424
- * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
1425
- * @applicableIdentity APP
1426
- * @returns Details of collection created.
1427
- * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.CreateDataCollection
1428
- */
1429
- export declare function createDataCollection(collection: NonNullablePaths<DataCollection, `_id` | `fields.${number}.key` | `fields.${number}.type` | `permissions.insert` | `permissions.read` | `permissions.remove` | `permissions.update`>): Promise<NonNullablePaths<DataCollection, DataCollectionNonNullablePaths>>;
1430
- /**
1431
- * Retrieves a data collection by ID.
1432
- * @param dataCollectionId - ID of the collection to retrieve.
1433
- * @public
1434
- * @requiredField dataCollectionId
1435
- * @param options - Options for retrieving a data collection.
1436
- * @permissionId WIX_DATA.GET_COLLECTION
1437
- * @permissionScope Manage All Data Resources
1438
- * @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL
1439
- * @permissionScope Manage Data Collections
1440
- * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
1441
- * @applicableIdentity APP
1442
- * @applicableIdentity VISITOR
1443
- * @returns Details of the collection requested.
1444
- * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.GetDataCollection
1445
- */
1446
- export declare function getDataCollection(dataCollectionId: string, options?: GetDataCollectionOptions): Promise<NonNullablePaths<DataCollection, DataCollectionNonNullablePaths>>;
1447
- export interface GetDataCollectionOptions {
1448
- /**
1449
- * Whether to retrieve data from the primary database instance.
1450
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
1451
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
1452
- *
1453
- * Default: `false`
1454
- */
1455
- consistentRead?: boolean;
1456
- /**
1457
- * List of specific field names to return, if empty all fields are returned.
1458
- * Affects all returned collections
1459
- * @maxSize 100
1460
- * @maxLength 1000
1461
- */
1462
- fields?: string[];
1463
- }
1464
- /**
1465
- * Retrieves a list of all data collections associated with the site or project.
1466
- *
1467
- * By default, the list is ordered by ID in ascending order.
1468
- * @public
1469
- * @param options - Options for retrieving a list of data collections.
1470
- * @permissionId WIX_DATA.LIST_COLLECTIONS
1471
- * @permissionScope Manage All Data Resources
1472
- * @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL
1473
- * @permissionScope Manage Data Collections
1474
- * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
1475
- * @applicableIdentity APP
1476
- * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.ListDataCollections
1477
- */
1478
- export declare function listDataCollections(options?: ListDataCollectionsOptions): Promise<NonNullablePaths<ListDataCollectionsResponse, {
1479
- [P in DataCollectionNonNullablePaths]: `collections.${number}.${P}`;
1480
- }[DataCollectionNonNullablePaths]>>;
1481
- export interface ListDataCollectionsOptions {
1482
- /**
1483
- * Defines how collections in the response are sorted.
1484
- *
1485
- * Default: Ordered by ID in ascending order.
1486
- */
1487
- sort?: Sorting;
1488
- /** Pagination information. */
1489
- paging?: Paging;
1490
- /**
1491
- * Whether to retrieve data from the primary database instance.
1492
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
1493
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
1494
- *
1495
- * Default: `false`
1496
- */
1497
- consistentRead?: boolean;
1498
- /**
1499
- * List of specific field names to return, if empty all fields are returned.
1500
- * Affects all returned collections
1501
- * @maxSize 100
1502
- * @maxLength 128
1503
- */
1504
- fields?: string[];
1505
- }
1506
- /**
1507
- * Updates a data collection.
1508
- *
1509
- * A collection ID, revision number, permissions, and at least 1 field must be provided within the `collection` body parameter.
1510
- * If a collection with that ID exists, and if its current `revision` number matches the one provided, it is updated.
1511
- * Otherwise, the request fails.
1512
- *
1513
- * When a collection is updated, its `updatedDate` property is changed to the current date and its `revision` property is incremented.
1514
- *
1515
- * > **Note:**
1516
- * > After a collection is updated, it only contains the properties included in the Update Data Collection request. If the existing collection has properties with values and those properties
1517
- * > aren't included in the updated collection details, their values are lost.
1518
- * @param collection - Updated collection details. The existing collection is replaced with this version.
1519
- * @public
1520
- * @requiredField collection
1521
- * @requiredField collection._id
1522
- * @requiredField collection.fields.key
1523
- * @requiredField collection.fields.type
1524
- * @requiredField collection.permissions.insert
1525
- * @requiredField collection.permissions.read
1526
- * @requiredField collection.permissions.remove
1527
- * @requiredField collection.permissions.update
1528
- * @requiredField collection.revision
1529
- * @param options - Options for updating a data collection.
1530
- * @permissionId WIX_DATA.UPDATE_COLLECTION
1531
- * @permissionScope Manage All Data Resources
1532
- * @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL
1533
- * @permissionScope Manage Data Collections
1534
- * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
1535
- * @applicableIdentity APP
1536
- * @returns Updated collection details.
1537
- * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.UpdateDataCollection
1538
- */
1539
- export declare function updateDataCollection(collection: NonNullablePaths<DataCollection, `_id` | `fields.${number}.key` | `fields.${number}.type` | `permissions.insert` | `permissions.read` | `permissions.remove` | `permissions.update` | `revision`>): Promise<NonNullablePaths<DataCollection, DataCollectionNonNullablePaths>>;
1540
- /**
1541
- * Deletes a data collection.
1542
- *
1543
- * > **Note:**
1544
- * > Once a collection is deleted, it can only be restored for limited amount of time.
1545
- * @param dataCollectionId - ID of the collection to delete.
1546
- * @public
1547
- * @requiredField dataCollectionId
1548
- * @permissionId WIX_DATA.DELETE_COLLECTION
1549
- * @permissionScope Manage All Data Resources
1550
- * @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL
1551
- * @permissionScope Manage Data Collections
1552
- * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
1553
- * @applicableIdentity APP
1554
- * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.DeleteDataCollection
1555
- */
1556
- export declare function deleteDataCollection(dataCollectionId: string): Promise<void>;
1557
- export interface CreateDataCollectionFieldOptions {
1558
- /** field to create */
1559
- field: Field;
1560
- }
1561
- export interface UpdateDataCollectionFieldOptions {
1562
- /** Field to update */
1563
- field: Field;
1564
- }
1565
- export interface DeleteDataCollectionFieldOptions {
1566
- /**
1567
- * Field ID to delete
1568
- * @maxLength 1000
1569
- */
1570
- fieldKey: string;
1571
- }
1572
- export {};