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