@wix/auto_sdk_data-backend-public-sdk-poc_data 1.0.0

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 (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/data-v1-data-service-data.context.d.ts +5 -0
  11. package/build/cjs/src/data-v1-data-service-data.context.js +47 -0
  12. package/build/cjs/src/data-v1-data-service-data.context.js.map +1 -0
  13. package/build/cjs/src/data-v1-data-service-data.http.d.ts +161 -0
  14. package/build/cjs/src/data-v1-data-service-data.http.js +845 -0
  15. package/build/cjs/src/data-v1-data-service-data.http.js.map +1 -0
  16. package/build/cjs/src/data-v1-data-service-data.meta.d.ts +37 -0
  17. package/build/cjs/src/data-v1-data-service-data.meta.js +389 -0
  18. package/build/cjs/src/data-v1-data-service-data.meta.js.map +1 -0
  19. package/build/cjs/src/data-v1-data-service-data.public.d.ts +15 -0
  20. package/build/cjs/src/data-v1-data-service-data.public.js +142 -0
  21. package/build/cjs/src/data-v1-data-service-data.public.js.map +1 -0
  22. package/build/cjs/src/data-v1-data-service-data.types.d.ts +609 -0
  23. package/build/cjs/src/data-v1-data-service-data.types.js +23 -0
  24. package/build/cjs/src/data-v1-data-service-data.types.js.map +1 -0
  25. package/build/cjs/src/data-v1-data-service-data.universal.d.ts +828 -0
  26. package/build/cjs/src/data-v1-data-service-data.universal.js +908 -0
  27. package/build/cjs/src/data-v1-data-service-data.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/data-v1-data-service-data.context.d.ts +5 -0
  39. package/build/es/src/data-v1-data-service-data.context.js +41 -0
  40. package/build/es/src/data-v1-data-service-data.context.js.map +1 -0
  41. package/build/es/src/data-v1-data-service-data.http.d.ts +161 -0
  42. package/build/es/src/data-v1-data-service-data.http.js +823 -0
  43. package/build/es/src/data-v1-data-service-data.http.js.map +1 -0
  44. package/build/es/src/data-v1-data-service-data.meta.d.ts +37 -0
  45. package/build/es/src/data-v1-data-service-data.meta.js +344 -0
  46. package/build/es/src/data-v1-data-service-data.meta.js.map +1 -0
  47. package/build/es/src/data-v1-data-service-data.public.d.ts +15 -0
  48. package/build/es/src/data-v1-data-service-data.public.js +117 -0
  49. package/build/es/src/data-v1-data-service-data.public.js.map +1 -0
  50. package/build/es/src/data-v1-data-service-data.types.d.ts +609 -0
  51. package/build/es/src/data-v1-data-service-data.types.js +20 -0
  52. package/build/es/src/data-v1-data-service-data.types.js.map +1 -0
  53. package/build/es/src/data-v1-data-service-data.universal.d.ts +828 -0
  54. package/build/es/src/data-v1-data-service-data.universal.js +863 -0
  55. package/build/es/src/data-v1-data-service-data.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/data-v1-data-service-data.context.d.ts +41 -0
  66. package/build/internal/cjs/src/data-v1-data-service-data.context.js +47 -0
  67. package/build/internal/cjs/src/data-v1-data-service-data.context.js.map +1 -0
  68. package/build/internal/cjs/src/data-v1-data-service-data.http.d.ts +161 -0
  69. package/build/internal/cjs/src/data-v1-data-service-data.http.js +845 -0
  70. package/build/internal/cjs/src/data-v1-data-service-data.http.js.map +1 -0
  71. package/build/internal/cjs/src/data-v1-data-service-data.meta.d.ts +37 -0
  72. package/build/internal/cjs/src/data-v1-data-service-data.meta.js +389 -0
  73. package/build/internal/cjs/src/data-v1-data-service-data.meta.js.map +1 -0
  74. package/build/internal/cjs/src/data-v1-data-service-data.public.d.ts +252 -0
  75. package/build/internal/cjs/src/data-v1-data-service-data.public.js +142 -0
  76. package/build/internal/cjs/src/data-v1-data-service-data.public.js.map +1 -0
  77. package/build/internal/cjs/src/data-v1-data-service-data.types.d.ts +609 -0
  78. package/build/internal/cjs/src/data-v1-data-service-data.types.js +23 -0
  79. package/build/internal/cjs/src/data-v1-data-service-data.types.js.map +1 -0
  80. package/build/internal/cjs/src/data-v1-data-service-data.universal.d.ts +1139 -0
  81. package/build/internal/cjs/src/data-v1-data-service-data.universal.js +908 -0
  82. package/build/internal/cjs/src/data-v1-data-service-data.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/data-v1-data-service-data.context.d.ts +41 -0
  93. package/build/internal/es/src/data-v1-data-service-data.context.js +41 -0
  94. package/build/internal/es/src/data-v1-data-service-data.context.js.map +1 -0
  95. package/build/internal/es/src/data-v1-data-service-data.http.d.ts +161 -0
  96. package/build/internal/es/src/data-v1-data-service-data.http.js +823 -0
  97. package/build/internal/es/src/data-v1-data-service-data.http.js.map +1 -0
  98. package/build/internal/es/src/data-v1-data-service-data.meta.d.ts +37 -0
  99. package/build/internal/es/src/data-v1-data-service-data.meta.js +344 -0
  100. package/build/internal/es/src/data-v1-data-service-data.meta.js.map +1 -0
  101. package/build/internal/es/src/data-v1-data-service-data.public.d.ts +252 -0
  102. package/build/internal/es/src/data-v1-data-service-data.public.js +117 -0
  103. package/build/internal/es/src/data-v1-data-service-data.public.js.map +1 -0
  104. package/build/internal/es/src/data-v1-data-service-data.types.d.ts +609 -0
  105. package/build/internal/es/src/data-v1-data-service-data.types.js +20 -0
  106. package/build/internal/es/src/data-v1-data-service-data.types.js.map +1 -0
  107. package/build/internal/es/src/data-v1-data-service-data.universal.d.ts +1139 -0
  108. package/build/internal/es/src/data-v1-data-service-data.universal.js +863 -0
  109. package/build/internal/es/src/data-v1-data-service-data.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,1139 @@
1
+ export interface Item {
2
+ item?: Record<string, any> | null;
3
+ }
4
+ export interface InsertRequest {
5
+ /** Item to insert. */
6
+ item?: Record<string, any> | null;
7
+ /** ID of the collection in which to insert the item. */
8
+ dataCollectionId?: string;
9
+ }
10
+ export declare enum Segment {
11
+ /** Access database used in the Live site. */
12
+ LIVE = "LIVE",
13
+ /** Access staging (sandbox) database used in the editor. */
14
+ SANDBOX = "SANDBOX",
15
+ /** Access deleted database used in the Live site. */
16
+ TRASH_LIVE = "TRASH_LIVE"
17
+ }
18
+ export interface Options {
19
+ }
20
+ export interface InsertResponse {
21
+ /** Inserted item. */
22
+ item?: Record<string, any> | null;
23
+ }
24
+ export interface UpdateRequest {
25
+ /** Item to update. The existing item is replaced with this version. */
26
+ item: Record<string, any> | null;
27
+ /** ID of the collection containing the existing item. */
28
+ dataCollectionId?: string;
29
+ }
30
+ export interface UpdateResponse {
31
+ /** Updated item */
32
+ item?: Record<string, any> | null;
33
+ }
34
+ export interface SaveRequest {
35
+ /** Item to insert or update. */
36
+ item?: Record<string, any> | null;
37
+ /** ID of the collection in which to insert or update the item. */
38
+ dataCollectionId?: string;
39
+ }
40
+ export interface SaveResponse {
41
+ /** Inserted or updated item. */
42
+ item?: Record<string, any> | null;
43
+ }
44
+ export interface PatchRequest {
45
+ /** item id to patch */
46
+ itemId?: string;
47
+ /** Patch data */
48
+ patch?: Record<string, any> | null;
49
+ /** Data access options */
50
+ options?: Options;
51
+ /** ID of the collection */
52
+ dataCollectionId?: string;
53
+ }
54
+ export interface PatchResponse {
55
+ /** Patched item */
56
+ item?: Record<string, any> | null;
57
+ }
58
+ export interface PatchWhereRequest {
59
+ /** Data segment */
60
+ segment?: Segment;
61
+ /** filter items to patch */
62
+ filter?: any;
63
+ /** Patch data */
64
+ patch?: Record<string, any> | null;
65
+ /** Data access options */
66
+ options?: Options;
67
+ /** ID of the collection */
68
+ dataCollectionId?: string;
69
+ }
70
+ export interface PatchWhereResponse {
71
+ /** Number of patched items */
72
+ totalCount?: number;
73
+ totalAffectedValues?: number;
74
+ }
75
+ export interface GetRequest {
76
+ /** ID of the item to retrieve. */
77
+ itemId: string;
78
+ /** ID of the collection from which to retrieve the item. */
79
+ dataCollectionId?: string;
80
+ }
81
+ export interface ReadOptions {
82
+ }
83
+ export interface GetResponse {
84
+ /** Retrieved item. */
85
+ item?: Record<string, any> | null;
86
+ }
87
+ export interface RemoveRequest {
88
+ /** ID of the item to remove. */
89
+ itemId: string;
90
+ /** ID of the collection from which to remove the item. */
91
+ dataCollectionId?: string;
92
+ }
93
+ export interface RemoveResponse {
94
+ /** Removed item. */
95
+ item?: Record<string, any> | null;
96
+ }
97
+ export interface TruncateRequest {
98
+ /** ID of the collection to truncate. */
99
+ dataCollectionId?: string;
100
+ }
101
+ export interface TruncateResponse {
102
+ }
103
+ export interface QueryRequest {
104
+ /** Query preferences. For more details on using queries, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language). */
105
+ dataQuery?: QueryV2;
106
+ /**
107
+ * Whether to omit the total count in the response.
108
+ * When `true`, the `pagingMetadata` object in the response doesn't contain a `total` field.
109
+ *
110
+ * Default: `false`
111
+ */
112
+ omitTotalCount?: boolean;
113
+ /**
114
+ * Properties for which to include referenced items in the query's results.
115
+ * Up to 50 referenced items can be included for each item that matches the query.
116
+ * If more than 50 items are referenced, `partialIncludes` in the response is `true`.
117
+ */
118
+ includeReferencedItems?: string[];
119
+ /** ID of the collection to query. */
120
+ dataCollectionId?: string;
121
+ }
122
+ export interface Query {
123
+ /**
124
+ * Filter object in the following format:
125
+ * `"filter" : {
126
+ * "fieldName1": "value1",
127
+ * "fieldName2":{"$operator":"value2"}
128
+ * }`
129
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
130
+ */
131
+ filter?: any;
132
+ /**
133
+ * Sort object in the following format:
134
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
135
+ */
136
+ sort?: Sorting[];
137
+ /** Paging options to limit and skip the number of items. */
138
+ paging?: Paging;
139
+ /** Array of projected fields. A list of specific field names to return. */
140
+ fields?: string[];
141
+ }
142
+ export interface Sorting {
143
+ /** Name of the field to sort by. */
144
+ fieldName?: string;
145
+ /** Sort order. */
146
+ order?: SortOrder;
147
+ }
148
+ export declare enum SortOrder {
149
+ ASC = "ASC",
150
+ DESC = "DESC"
151
+ }
152
+ export interface Paging {
153
+ /** Number of items to load. */
154
+ limit?: number | null;
155
+ /** Number of items to skip in the current sort order. */
156
+ offset?: number | null;
157
+ }
158
+ export interface QueryV2 extends QueryV2PagingMethodOneOf {
159
+ /** Paging options to limit and skip the number of items. */
160
+ paging?: Paging;
161
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
162
+ cursorPaging?: CursorPaging;
163
+ /**
164
+ * Filter object in the following format:
165
+ * `"filter" : {
166
+ * "fieldName1": "value1",
167
+ * "fieldName2":{"$operator":"value2"}
168
+ * }`
169
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
170
+ */
171
+ filter?: Record<string, any> | null;
172
+ /**
173
+ * Sort object in the following format:
174
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
175
+ */
176
+ sort?: Sorting[];
177
+ /** Array of projected fields. A list of specific field names to return. */
178
+ fields?: string[];
179
+ }
180
+ /** @oneof */
181
+ export interface QueryV2PagingMethodOneOf {
182
+ /** Paging options to limit and skip the number of items. */
183
+ paging?: Paging;
184
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
185
+ cursorPaging?: CursorPaging;
186
+ }
187
+ export interface CursorPaging {
188
+ /** Number of items to load. */
189
+ limit?: number | null;
190
+ /**
191
+ * Pointer to the next or previous page in the list of results.
192
+ *
193
+ * You can get the relevant cursor token
194
+ * from the `pagingMetadata` object in the previous call's response.
195
+ * Not relevant for the first request.
196
+ */
197
+ cursor?: string | null;
198
+ }
199
+ export interface QueryResponse {
200
+ /** Retrieved items. */
201
+ items?: Record<string, any>[] | null;
202
+ /**
203
+ * *Deprecated.** Refer to 'pagingMetadata' instead. Total number of items satisfying the query.
204
+ * @deprecated
205
+ */
206
+ totalCount?: number;
207
+ /**
208
+ * *Deprecated.** Refer to 'pagingMetadata' instead. Total number of items satisfying the query.
209
+ * @deprecated
210
+ */
211
+ totalResults?: number;
212
+ /** Whether referenced items are trimmed from the results. This occurs when there are more than 50 referenced items. */
213
+ partialIncludes?: boolean;
214
+ /** Paging information. */
215
+ pagingMetadata?: PagingMetadataV2;
216
+ }
217
+ export interface PagingMetadataV2 {
218
+ /** Number of items returned in the response. */
219
+ count?: number | null;
220
+ /** Offset that was requested. */
221
+ offset?: number | null;
222
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
223
+ total?: number | null;
224
+ /** Flag that indicates the server failed to calculate the `total` field. */
225
+ tooManyToCount?: boolean | null;
226
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
227
+ cursors?: Cursors;
228
+ }
229
+ export interface Cursors {
230
+ /** Cursor pointing to next page in the list of results. */
231
+ next?: string | null;
232
+ /** Cursor pointing to previous page in the list of results. */
233
+ prev?: string | null;
234
+ }
235
+ export interface AggregationRequest {
236
+ /** Paging preferences. */
237
+ paging?: Paging;
238
+ /** Filter applied to the collection's data prior to running the aggregation. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section) for information on how to structure a filter object. */
239
+ initialFilter?: Record<string, any> | null;
240
+ /**
241
+ * Object defining the steps of the aggregation to be This is an object defining aggregation itself.
242
+ *
243
+ * * Grouping rule is defined as _id field. It takes a form of:
244
+ * {
245
+ * "_id": "$field"
246
+ * }
247
+ *
248
+ * If multiple fields are used for grouping, Group takes a form of:
249
+ * {
250
+ * "_id": {
251
+ * "field1": "$field1"
252
+ * "field2": "$field2"
253
+ * }
254
+ * }
255
+ *
256
+ * * Aggregation functions are defined as special field definitions.
257
+ *
258
+ * Average:
259
+ * {
260
+ * "_id": "$field"
261
+ * "my_avg": {
262
+ * "$avg": "$other_field"
263
+ * }
264
+ * }
265
+ *
266
+ * Max:
267
+ * {
268
+ * "_id": "$field"
269
+ * "my_max": {
270
+ * "$max": "$other_field"
271
+ * }
272
+ * }
273
+ *
274
+ * Min:
275
+ * {
276
+ * "_id": "$field"
277
+ * "my_min": {
278
+ * "$min": "$other_field"
279
+ * }
280
+ * }
281
+ *
282
+ * Sum:
283
+ * {
284
+ * "_id": "$field"
285
+ * "my_sum": {
286
+ * "$sum": "$other_field"
287
+ * }
288
+ * }
289
+ */
290
+ aggregation?: Record<string, any> | null;
291
+ /** Filter applied to the processed data following the aggregation. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section) for information on how to structure a filter object. */
292
+ finalFilter?: Record<string, any> | null;
293
+ /** Sorting preferences. */
294
+ sort?: Sorting[];
295
+ /** ID of the collection on which to run the aggregation. */
296
+ dataCollectionId?: string;
297
+ }
298
+ export interface AggregationResponse {
299
+ /** Aggregation results. */
300
+ items?: Record<string, any>[] | null;
301
+ /** Paging information. */
302
+ pagingMetadata?: PagingMetadataV2;
303
+ }
304
+ export interface CountRequest {
305
+ /** Filter preferences defining the query. For more information on how to structure a filter object, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section). */
306
+ filter?: Record<string, any> | null;
307
+ /** ID of the collection for which to count query results. */
308
+ dataCollectionId?: string;
309
+ }
310
+ export interface CountResponse {
311
+ /** Count of items matching the query. */
312
+ totalCount?: number;
313
+ /**
314
+ * *Deprecated.** Refer to `totalCount` instead.
315
+ * @deprecated
316
+ */
317
+ totalResults?: number;
318
+ }
319
+ export interface DistinctRequest {
320
+ /** Query preferences. For more details on using queries, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language). */
321
+ dataQuery?: QueryV2;
322
+ /** Property name for which to return all distinct values. */
323
+ propertyName: string;
324
+ /** ID of the collection to query. */
325
+ dataCollectionId?: string;
326
+ /**
327
+ * Whether to omit the total count in the response.
328
+ * When `true`, the `pagingMetadata` object in the response doesn't contain a `total` field.
329
+ *
330
+ * Default: `false`
331
+ */
332
+ omitTotalCount?: boolean;
333
+ }
334
+ export interface DistinctResponse {
335
+ /** List of distinct values contained in the property specified in `propertyName`. */
336
+ items?: any[];
337
+ /** Paging information. */
338
+ pagingMetadata?: PagingMetadataV2;
339
+ }
340
+ export interface BulkInsertRequest {
341
+ /** Items to insert. */
342
+ items: Record<string, any>[] | null;
343
+ /** ID of the collection in which to insert the items. */
344
+ dataCollectionId?: string;
345
+ }
346
+ export interface BulkInsertResponse {
347
+ /** IDs of items inserted. */
348
+ insertedItemIds?: string[];
349
+ /** Error details for items that couldn't be inserted. */
350
+ errors?: BulkError[];
351
+ }
352
+ export interface BulkError {
353
+ /** ID of the item that couldn't be inserted. */
354
+ itemId?: string | null;
355
+ /** Error message. */
356
+ message?: string;
357
+ /** Error details. */
358
+ details?: Details;
359
+ /** Index of the failed item in the `items` paramater of the request. */
360
+ originalIndex?: number;
361
+ }
362
+ export interface ApplicationError {
363
+ /** Error code. */
364
+ code?: string;
365
+ /** Error description. */
366
+ description?: string;
367
+ /** Error data. */
368
+ data?: Record<string, any> | null;
369
+ }
370
+ export interface Details {
371
+ /** Application error. */
372
+ applicationError?: ApplicationError;
373
+ }
374
+ export interface BulkSaveRequest {
375
+ /** Items to insert or update. */
376
+ items: Record<string, any>[] | null;
377
+ /** ID of the collection in which to insert or update the items. */
378
+ dataCollectionId?: string;
379
+ }
380
+ export interface BulkSaveResponse {
381
+ /** IDs of items inserted. */
382
+ insertedItemIds?: string[];
383
+ /** IDs of items updated. */
384
+ updatedItemIds?: string[];
385
+ /** Errors for items that couldn't be inserted or updated. */
386
+ errors?: BulkError[];
387
+ }
388
+ export interface BulkUpdateRequest {
389
+ /** Items to update. */
390
+ items: Record<string, any>[] | null;
391
+ /** ID of the collection in which to update items. */
392
+ dataCollectionId?: string;
393
+ }
394
+ export interface BulkUpdateResponse {
395
+ /** IDs of items updated. */
396
+ updatedItemIds?: string[];
397
+ /** Errors for items that couldn't be updated. */
398
+ errors?: BulkError[];
399
+ }
400
+ export interface BulkPatchRequest {
401
+ /** List of items and their patches */
402
+ entries?: Entry[];
403
+ /** Data access options */
404
+ options?: Options;
405
+ /** ID of the collection */
406
+ dataCollectionId?: string;
407
+ }
408
+ export interface Entry {
409
+ /** item id to patch */
410
+ itemId?: string;
411
+ /** Patch data */
412
+ patch?: Record<string, any> | null;
413
+ }
414
+ export interface BulkPatchResponse {
415
+ /** Patched item ids */
416
+ patchedItemIds?: string[];
417
+ /** Errors */
418
+ errors?: BulkError[];
419
+ }
420
+ export interface BulkRemoveRequest {
421
+ /** IDs of items to remove. */
422
+ entries?: BulkRemoveRequestEntry[];
423
+ /** ID of the collection from which to remove the items. */
424
+ dataCollectionId?: string;
425
+ }
426
+ export interface BulkRemoveRequestEntry {
427
+ /** ID of item to remove. */
428
+ itemId?: string;
429
+ }
430
+ export interface BulkRemoveResponse {
431
+ /** IDs of items removed. */
432
+ removedItemIds?: string[];
433
+ /** Errors for items that couldn't be removed. */
434
+ errors?: BulkError[];
435
+ }
436
+ export interface QueryReferencedRequest {
437
+ /** ID of the referring item. */
438
+ referringItemId: string;
439
+ /** Property containing the references to the referenced items. */
440
+ propertyName: string;
441
+ /** Paging preferences. */
442
+ paging?: Paging;
443
+ /** ID of the collection containing the referring item. */
444
+ dataCollectionId?: string;
445
+ /**
446
+ * Whether to omit the total count in the response.
447
+ * When `true`, the `pagingMetadata` object in the response doesn't contain a `total` field.
448
+ *
449
+ * Default: `false`
450
+ */
451
+ omitTotalCount?: boolean;
452
+ }
453
+ export declare enum Order {
454
+ ASC = "ASC",
455
+ DESC = "DESC"
456
+ }
457
+ export interface QueryReferencedResponse {
458
+ /**
459
+ * *Deprecated.** Refer to `entities` instead. List of referenced items.
460
+ * @deprecated
461
+ */
462
+ items?: Record<string, any>[] | null;
463
+ /**
464
+ * *Deprecated**. Refer to 'pagingMetadata' instead. Total number of referenced items satisfying the query.
465
+ * @deprecated
466
+ */
467
+ totalCount?: number;
468
+ /**
469
+ * *Deprecated**. Refer to 'pagingMetadata' instead. Total number of referenced items satisfying the query.
470
+ * @deprecated
471
+ */
472
+ totalResults?: number;
473
+ /** List of referenced items and/or IDs. For successfully resolved references, the referenced data item appears. For references that can't be resolved, the ID appears. */
474
+ entities?: ReferencedEntity[];
475
+ /** Paging information. */
476
+ pagingMetadata?: PagingMetadataV2;
477
+ }
478
+ export interface ReferencedEntity extends ReferencedEntityEntityOneOf {
479
+ /** Data item referenced. */
480
+ item?: Record<string, any> | null;
481
+ /** Unresolved ID. Appears instead of the data item when the reference doesn't resolve. For example, when an ID isn't found or if an item is in draft state. */
482
+ referenceId?: string;
483
+ }
484
+ /** @oneof */
485
+ export interface ReferencedEntityEntityOneOf {
486
+ /** Data item referenced. */
487
+ item?: Record<string, any> | null;
488
+ /** Unresolved ID. Appears instead of the data item when the reference doesn't resolve. For example, when an ID isn't found or if an item is in draft state. */
489
+ referenceId?: string;
490
+ }
491
+ export interface BulkInsertReferencesRequest {
492
+ /** References to insert. */
493
+ references: Reference[];
494
+ /** ID of the collection containing the referring item. */
495
+ dataCollectionId?: string;
496
+ }
497
+ export interface Reference {
498
+ /** Property containing the references to the referenced items. */
499
+ propertyName?: string;
500
+ /** ID of the referring item. */
501
+ referringItemId?: string;
502
+ /** ID of the referenced item. */
503
+ referencedItemId?: string;
504
+ }
505
+ export interface BulkInsertReferencesResponse {
506
+ }
507
+ export interface BulkReplaceReferencesRequest {
508
+ /** Property containing the references to the referenced items. */
509
+ propertyName: string;
510
+ /** ID of the referring item. */
511
+ referringItemId: string;
512
+ /** List of new referenced item IDs to replace the existing ones. */
513
+ newReferencedItemIds?: string[];
514
+ /** ID of the collection containing the referring item. */
515
+ dataCollectionId?: string;
516
+ }
517
+ export interface BulkReplaceReferencesResponse {
518
+ }
519
+ export interface BulkRemoveReferencesRequest {
520
+ /** References to be removed. */
521
+ references: Reference[];
522
+ /** ID of the collection containing the referring item. */
523
+ dataCollectionId?: string;
524
+ }
525
+ export interface BulkRemoveReferencesResponse {
526
+ }
527
+ export interface IsReferencedRequest {
528
+ /** Property that may contain a reference to the specified item. */
529
+ propertyName: string;
530
+ /** ID of the referring item. */
531
+ referringItemId: string;
532
+ /** ID of the item that may be referenced. */
533
+ referencedItemId: string;
534
+ /** ID of the collection containing the referring item. */
535
+ dataCollectionId?: string;
536
+ }
537
+ export interface IsReferencedResponse {
538
+ /** Whether the specified property of the referring item contains a reference to the specified referenced item. */
539
+ isReferenced?: boolean;
540
+ }
541
+ export interface RestoreFromTrashBinRequest {
542
+ /**
543
+ * Deprecated, use dataCollectionId instead.
544
+ * Collection name
545
+ * @deprecated Deprecated, use dataCollectionId instead.
546
+ * Collection name
547
+ * @replacedBy data_collection_id
548
+ */
549
+ collectionName?: string;
550
+ /** Item id */
551
+ itemId?: string;
552
+ /** Data access options */
553
+ options?: Options;
554
+ /** ID of the collection */
555
+ dataCollectionId?: string;
556
+ }
557
+ export interface RestoreFromTrashBinResponse {
558
+ item?: Record<string, any> | null;
559
+ }
560
+ export interface QueryResponseNonNullableFields {
561
+ totalCount: number;
562
+ totalResults: number;
563
+ partialIncludes: boolean;
564
+ }
565
+ export interface CountResponseNonNullableFields {
566
+ totalCount: number;
567
+ totalResults: number;
568
+ }
569
+ interface ApplicationErrorNonNullableFields {
570
+ code: string;
571
+ description: string;
572
+ }
573
+ interface DetailsNonNullableFields {
574
+ applicationError?: ApplicationErrorNonNullableFields;
575
+ }
576
+ interface BulkErrorNonNullableFields {
577
+ message: string;
578
+ details?: DetailsNonNullableFields;
579
+ originalIndex: number;
580
+ }
581
+ export interface BulkInsertResponseNonNullableFields {
582
+ insertedItemIds: string[];
583
+ errors: BulkErrorNonNullableFields[];
584
+ }
585
+ export interface BulkSaveResponseNonNullableFields {
586
+ insertedItemIds: string[];
587
+ updatedItemIds: string[];
588
+ errors: BulkErrorNonNullableFields[];
589
+ }
590
+ export interface BulkUpdateResponseNonNullableFields {
591
+ updatedItemIds: string[];
592
+ errors: BulkErrorNonNullableFields[];
593
+ }
594
+ export interface BulkRemoveResponseNonNullableFields {
595
+ removedItemIds: string[];
596
+ errors: BulkErrorNonNullableFields[];
597
+ }
598
+ interface ReferencedEntityNonNullableFields {
599
+ referenceId: string;
600
+ }
601
+ export interface QueryReferencedResponseNonNullableFields {
602
+ totalCount: number;
603
+ totalResults: number;
604
+ entities: ReferencedEntityNonNullableFields[];
605
+ }
606
+ export interface IsReferencedResponseNonNullableFields {
607
+ isReferenced: boolean;
608
+ }
609
+ /**
610
+ * Adds an item to a collection.
611
+ *
612
+ * When an item is inserted into a collection, the following properties and values are added to it:
613
+ * * `_id`: A unique identifier for an item in a collection. You can optionally provide your own ID when inserting the item. If you specify an ID that already exists in the collection, the insertion will fail.
614
+ * * `_createdDate`: The date the item was added to the collection.
615
+ * * `_updatedDate`: The date the item was last modified. When the item is first inserted, `_createdDate` and `_updatedDate` have the same value.
616
+ * @internal
617
+ * @documentationMaturity preview
618
+ * @permissionId WIX_DATA.INSERT
619
+ * @permissionScope Write Data Items
620
+ * @permissionScopeId SCOPE.DC-DATA.WRITE
621
+ * @applicableIdentity APP
622
+ * @fqn com.wixpress.cloud.data.api.dataservice.WixDataService.Insert
623
+ */
624
+ export declare function insert(options?: InsertOptions): Promise<InsertResponse>;
625
+ export interface InsertOptions {
626
+ /** Item to insert. */
627
+ item?: Record<string, any> | null;
628
+ /** ID of the collection in which to insert the item. */
629
+ dataCollectionId?: string;
630
+ }
631
+ /**
632
+ * Updates an item in a collection.
633
+ *
634
+ * An item ID must be submitted as part of the request, either as a path parameter or within the `item` body parameter. If an item is found in the specified collection with
635
+ * the same ID, that item is updated. If the collection doesn't contain an item with that ID, the request fails.
636
+ *
637
+ * When an item is updated, its `_updatedDate` property is changed to the current date.
638
+ *
639
+ * **Note:**
640
+ * After an item is updated, it only contains the properties included in the Update Data Item request. If the existing item has properties with values and those properties
641
+ * aren't included in the updated item, their values are lost.
642
+ * @internal
643
+ * @documentationMaturity preview
644
+ * @requiredField options.item
645
+ * @permissionId WIX_DATA.UPDATE
646
+ * @permissionScope Write Data Items
647
+ * @permissionScopeId SCOPE.DC-DATA.WRITE
648
+ * @applicableIdentity APP
649
+ * @fqn com.wixpress.cloud.data.api.dataservice.WixDataService.Update
650
+ */
651
+ export declare function update(options?: UpdateOptions): Promise<UpdateResponse>;
652
+ export interface UpdateOptions {
653
+ /** Item to update. The existing item is replaced with this version. */
654
+ item: Record<string, any> | null;
655
+ /** ID of the collection containing the existing item. */
656
+ dataCollectionId?: string;
657
+ }
658
+ /**
659
+ * Inserts or updates an item in a collection.
660
+ *
661
+ * The Save Data Item endpoint inserts or updates the specified item, depending on whether it already exists in the collection.
662
+ *
663
+ * * If you don't provide an ID, a new item is created.
664
+ *
665
+ * * If you provide an ID that doesn't exist in the collection, a new item is created with that ID.
666
+ *
667
+ * * If an item with the ID you provide already exists in the collection, that item is updated. When an item is updated, its `_updatedDate` property is changed to the current date.
668
+ *
669
+ * ***Note:*** When you provide an item with an ID that already exists in the collection, the item you provide completely replaces the existing item with that ID.
670
+ * This means that all of the item's previous properties and values are lost.
671
+ * @internal
672
+ * @documentationMaturity preview
673
+ * @permissionId WIX_DATA.UPDATE
674
+ * @permissionScope Write Data Items
675
+ * @permissionScopeId SCOPE.DC-DATA.WRITE
676
+ * @applicableIdentity APP
677
+ * @fqn com.wixpress.cloud.data.api.dataservice.WixDataService.Save
678
+ */
679
+ export declare function save(options?: SaveOptions): Promise<SaveResponse>;
680
+ export interface SaveOptions {
681
+ /** Item to insert or update. */
682
+ item?: Record<string, any> | null;
683
+ /** ID of the collection in which to insert or update the item. */
684
+ dataCollectionId?: string;
685
+ }
686
+ /**
687
+ * Retrieves an item from a collection.
688
+ * @param itemId - ID of the item to retrieve.
689
+ * @internal
690
+ * @documentationMaturity preview
691
+ * @requiredField itemId
692
+ * @permissionId WIX_DATA.FIND
693
+ * @permissionScope Read Data Items
694
+ * @permissionScopeId SCOPE.DC-DATA.READ
695
+ * @applicableIdentity APP
696
+ * @fqn com.wixpress.cloud.data.api.dataservice.WixDataService.Get
697
+ */
698
+ export declare function get(itemId: string, options?: GetOptions): Promise<GetResponse>;
699
+ export interface GetOptions {
700
+ /** ID of the collection from which to retrieve the item. */
701
+ dataCollectionId?: string;
702
+ }
703
+ /**
704
+ * Removes an item from a collection.
705
+ *
706
+ * If any items in other collections reference the removed item in a reference or multi-reference field, the field is cleared.
707
+ *
708
+ * **Note:**
709
+ * Once an item has been removed from a collection, it can't be restored.
710
+ * @param itemId - ID of the item to remove.
711
+ * @internal
712
+ * @documentationMaturity preview
713
+ * @requiredField itemId
714
+ * @permissionId WIX_DATA.REMOVE
715
+ * @permissionScope Write Data Items
716
+ * @permissionScopeId SCOPE.DC-DATA.WRITE
717
+ * @applicableIdentity APP
718
+ * @fqn com.wixpress.cloud.data.api.dataservice.WixDataService.Remove
719
+ */
720
+ export declare function remove(itemId: string, options?: RemoveOptions): Promise<RemoveResponse>;
721
+ export interface RemoveOptions {
722
+ /** ID of the collection from which to remove the item. */
723
+ dataCollectionId?: string;
724
+ }
725
+ /**
726
+ * Removes all items from a collection. Site owner (`ADMIN`) permissions are required in order to invoke this operation.
727
+ *
728
+ * If any items in other collections reference the removed items in reference or multi-reference fields, those fields are cleared.
729
+ *
730
+ * **Note:**
731
+ * Once items have been removed from a collection, they can't be restored.
732
+ * @internal
733
+ * @documentationMaturity preview
734
+ * @permissionId WIX_DATA.TRUNCATE
735
+ * @permissionScope Write Data Items
736
+ * @permissionScopeId SCOPE.DC-DATA.WRITE
737
+ * @applicableIdentity APP
738
+ * @fqn com.wixpress.cloud.data.api.dataservice.WixDataService.Truncate
739
+ */
740
+ export declare function truncate(options?: TruncateOptions): Promise<void>;
741
+ export interface TruncateOptions {
742
+ /** ID of the collection to truncate. */
743
+ dataCollectionId?: string;
744
+ }
745
+ /**
746
+ * Retrieves a list of items, on the basis of the filtering, sorting, and paging preferences you provide.
747
+ *
748
+ * For more details on using queries, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
749
+ * @public
750
+ * @documentationMaturity preview
751
+ * @permissionId WIX_DATA.FIND
752
+ * @permissionScope Read Data Items
753
+ * @permissionScopeId SCOPE.DC-DATA.READ
754
+ * @applicableIdentity APP
755
+ * @fqn com.wixpress.cloud.data.api.dataservice.WixDataService.Query
756
+ */
757
+ export declare function query(options?: QueryOptions): Promise<QueryResponse & QueryResponseNonNullableFields>;
758
+ export interface QueryOptions {
759
+ /** Query preferences. For more details on using queries, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language). */
760
+ dataQuery?: QueryV2;
761
+ /**
762
+ * Whether to omit the total count in the response.
763
+ * When `true`, the `pagingMetadata` object in the response doesn't contain a `total` field.
764
+ *
765
+ * Default: `false`
766
+ */
767
+ omitTotalCount?: boolean;
768
+ /**
769
+ * Properties for which to include referenced items in the query's results.
770
+ * Up to 50 referenced items can be included for each item that matches the query.
771
+ * If more than 50 items are referenced, `partialIncludes` in the response is `true`.
772
+ */
773
+ includeReferencedItems?: string[];
774
+ /** ID of the collection to query. */
775
+ dataCollectionId?: string;
776
+ }
777
+ /** @internal
778
+ * @documentationMaturity preview
779
+ * @permissionId WIX_DATA.AGGREGATE
780
+ * @permissionScope Read Data Items
781
+ * @permissionScopeId SCOPE.DC-DATA.READ
782
+ * @applicableIdentity APP
783
+ * @fqn com.wixpress.cloud.data.api.dataservice.WixDataService.Aggregate
784
+ */
785
+ export declare function aggregate(options?: AggregateOptions): Promise<AggregationResponse>;
786
+ export interface AggregateOptions {
787
+ /** Paging preferences. */
788
+ paging?: Paging;
789
+ /** Filter applied to the collection's data prior to running the aggregation. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section) for information on how to structure a filter object. */
790
+ initialFilter?: Record<string, any> | null;
791
+ /**
792
+ * Object defining the steps of the aggregation to be This is an object defining aggregation itself.
793
+ *
794
+ * * Grouping rule is defined as _id field. It takes a form of:
795
+ * {
796
+ * "_id": "$field"
797
+ * }
798
+ *
799
+ * If multiple fields are used for grouping, Group takes a form of:
800
+ * {
801
+ * "_id": {
802
+ * "field1": "$field1"
803
+ * "field2": "$field2"
804
+ * }
805
+ * }
806
+ *
807
+ * * Aggregation functions are defined as special field definitions.
808
+ *
809
+ * Average:
810
+ * {
811
+ * "_id": "$field"
812
+ * "my_avg": {
813
+ * "$avg": "$other_field"
814
+ * }
815
+ * }
816
+ *
817
+ * Max:
818
+ * {
819
+ * "_id": "$field"
820
+ * "my_max": {
821
+ * "$max": "$other_field"
822
+ * }
823
+ * }
824
+ *
825
+ * Min:
826
+ * {
827
+ * "_id": "$field"
828
+ * "my_min": {
829
+ * "$min": "$other_field"
830
+ * }
831
+ * }
832
+ *
833
+ * Sum:
834
+ * {
835
+ * "_id": "$field"
836
+ * "my_sum": {
837
+ * "$sum": "$other_field"
838
+ * }
839
+ * }
840
+ */
841
+ aggregation?: Record<string, any> | null;
842
+ /** Filter applied to the processed data following the aggregation. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section) for information on how to structure a filter object. */
843
+ finalFilter?: Record<string, any> | null;
844
+ /** Sorting preferences. */
845
+ sort?: Sorting[];
846
+ /** ID of the collection on which to run the aggregation. */
847
+ dataCollectionId?: string;
848
+ }
849
+ /**
850
+ * Returns the number of items in a collection that match a query.
851
+ * @internal
852
+ * @documentationMaturity preview
853
+ * @permissionId WIX_DATA.FIND
854
+ * @permissionScope Read Data Items
855
+ * @permissionScopeId SCOPE.DC-DATA.READ
856
+ * @applicableIdentity APP
857
+ * @fqn com.wixpress.cloud.data.api.dataservice.WixDataService.Count
858
+ */
859
+ export declare function count(options?: CountOptions): Promise<CountResponse & CountResponseNonNullableFields>;
860
+ export interface CountOptions {
861
+ /** Filter preferences defining the query. For more information on how to structure a filter object, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section). */
862
+ filter?: Record<string, any> | null;
863
+ /** ID of the collection for which to count query results. */
864
+ dataCollectionId?: string;
865
+ }
866
+ /**
867
+ * Retrieves a list of distinct values for a given property in all items that match a query, without duplicates.
868
+ *
869
+ * As with the [Query Data Items]() endpoint, this endpoint retrieves items based on the filtering, sorting, and paging preferences you provide.
870
+ * However, the Query Distinct Values endpoint doesn't return all of the full items that match the query.
871
+ * Rather, it returns all unique values of the property you specify in `propertyName` for items that match the query.
872
+ * If more than one item has the same value for that property, that value appears only once.
873
+ *
874
+ * For more details on using queries, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
875
+ * @internal
876
+ * @documentationMaturity preview
877
+ * @requiredField options.propertyName
878
+ * @permissionId WIX_DATA.FIND
879
+ * @permissionScope Read Data Items
880
+ * @permissionScopeId SCOPE.DC-DATA.READ
881
+ * @applicableIdentity APP
882
+ * @fqn com.wixpress.cloud.data.api.dataservice.WixDataService.Distinct
883
+ */
884
+ export declare function distinct(options?: DistinctOptions): Promise<DistinctResponse>;
885
+ export interface DistinctOptions {
886
+ /** Query preferences. For more details on using queries, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language). */
887
+ dataQuery?: QueryV2;
888
+ /** Property name for which to return all distinct values. */
889
+ propertyName: string;
890
+ /** ID of the collection to query. */
891
+ dataCollectionId?: string;
892
+ /**
893
+ * Whether to omit the total count in the response.
894
+ * When `true`, the `pagingMetadata` object in the response doesn't contain a `total` field.
895
+ *
896
+ * Default: `false`
897
+ */
898
+ omitTotalCount?: boolean;
899
+ }
900
+ /**
901
+ * Adds multiple items to a collection.
902
+ *
903
+ * When each item is inserted into a collection, the following properties and values are added to it:
904
+ * * `_id`: A unique identifier for an item in a collection. You can optionally provide your own ID when inserting the item. If you specify an ID that already exists in the collection, the insertion will fail.
905
+ * * `_createdDate`: The date the item was added to the collection.
906
+ * * `_updatedDate`: The date the item was last modified. When the item is first inserted, `_createdDate` and `_updatedDate` have the same value.
907
+ *
908
+ * The endpoint returns a list of the IDs of items successfully inserted in `insertedItemIds`.
909
+ * When any items can't be inserted, error details are provided for each failed item in `errors`.
910
+ * @internal
911
+ * @documentationMaturity preview
912
+ * @requiredField options.items
913
+ * @permissionId WIX_DATA.INSERT
914
+ * @permissionScope Write Data Items
915
+ * @permissionScopeId SCOPE.DC-DATA.WRITE
916
+ * @applicableIdentity APP
917
+ * @fqn com.wixpress.cloud.data.api.dataservice.WixDataService.BulkInsert
918
+ */
919
+ export declare function bulkInsert(options?: BulkInsertOptions): Promise<BulkInsertResponse & BulkInsertResponseNonNullableFields>;
920
+ export interface BulkInsertOptions {
921
+ /** Items to insert. */
922
+ items: Record<string, any>[] | null;
923
+ /** ID of the collection in which to insert the items. */
924
+ dataCollectionId?: string;
925
+ }
926
+ /**
927
+ * Inserts or updates multiple items in a collection.
928
+ *
929
+ * The Bulk Save Data Items endpoint inserts or updates each item, depending on whether it already exists in the collection. For each item:
930
+ *
931
+ * * If you don't provide an ID, a new item is created.
932
+ *
933
+ * * If you provide an ID that doesn't exist in the collection, a new item is created with that ID.
934
+ *
935
+ * * If an item with the ID you provide already exists in the collection, that item is updated. When an item is updated, its `_updatedDate` property is changed to the current date.
936
+ *
937
+ * The endpoint returns a list of the IDs of items successfully inserted in `insertedItemIds` and a list of the IDs of items successfully updated in `updatedItemIds`.
938
+ * When any items can't be inserted or updated, error details are provided for each failed item in `errors`.
939
+ *
940
+ * ***Note:*** When you provide an item with an ID that already exists in the collection, the item you provide completely replaces the existing item with that ID.
941
+ * This means that all of the item's previous properties and values are lost.
942
+ * @internal
943
+ * @documentationMaturity preview
944
+ * @requiredField options.items
945
+ * @permissionId WIX_DATA.UPDATE
946
+ * @permissionScope Write Data Items
947
+ * @permissionScopeId SCOPE.DC-DATA.WRITE
948
+ * @applicableIdentity APP
949
+ * @fqn com.wixpress.cloud.data.api.dataservice.WixDataService.BulkSave
950
+ */
951
+ export declare function bulkSave(options?: BulkSaveOptions): Promise<BulkSaveResponse & BulkSaveResponseNonNullableFields>;
952
+ export interface BulkSaveOptions {
953
+ /** Items to insert or update. */
954
+ items: Record<string, any>[] | null;
955
+ /** ID of the collection in which to insert or update the items. */
956
+ dataCollectionId?: string;
957
+ }
958
+ /**
959
+ * Updates multiple items in a collection.
960
+ *
961
+ * Each item in the request must include an ID. If an item is found in the specified collection with
962
+ * the same ID, that item is updated. If the collection doesn't contain an item with that ID, the update fails.
963
+ *
964
+ * When an item is updated, its `_updatedDate` property is changed to the current date.
965
+ *
966
+ * The endpoint returns a list of the IDs of items successfully updated in `updatedItemIds`.
967
+ * When any items can't be inserted, error details are provided for each failed item in `errors`.
968
+ *
969
+ * **Note:**
970
+ * After each item is updated, it only contains the properties included in the Update Data Item request. If the existing item has properties with values and those properties
971
+ * aren't included in the updated item, their values are lost.
972
+ * @internal
973
+ * @documentationMaturity preview
974
+ * @requiredField options.items
975
+ * @permissionId WIX_DATA.UPDATE
976
+ * @permissionScope Write Data Items
977
+ * @permissionScopeId SCOPE.DC-DATA.WRITE
978
+ * @applicableIdentity APP
979
+ * @fqn com.wixpress.cloud.data.api.dataservice.WixDataService.BulkUpdate
980
+ */
981
+ export declare function bulkUpdate(options?: BulkUpdateOptions): Promise<BulkUpdateResponse & BulkUpdateResponseNonNullableFields>;
982
+ export interface BulkUpdateOptions {
983
+ /** Items to update. */
984
+ items: Record<string, any>[] | null;
985
+ /** ID of the collection in which to update items. */
986
+ dataCollectionId?: string;
987
+ }
988
+ /**
989
+ * Removes multiple items from a collection.
990
+ *
991
+ * If any items in other collections reference the removed items in reference or multi-reference fields, the fields are cleared.
992
+ *
993
+ * The endpoint returns a list of the IDs of items successfully removed in `removedItemIds`.
994
+ * When any items can't be removed, error details are provided for each failed item in `errors`.
995
+ *
996
+ * **Note:** Once an item has been removed from a collection, it can't be restored.
997
+ * @internal
998
+ * @documentationMaturity preview
999
+ * @permissionId WIX_DATA.REMOVE
1000
+ * @permissionScope Write Data Items
1001
+ * @permissionScopeId SCOPE.DC-DATA.WRITE
1002
+ * @applicableIdentity APP
1003
+ * @fqn com.wixpress.cloud.data.api.dataservice.WixDataService.BulkRemove
1004
+ */
1005
+ export declare function bulkRemove(options?: BulkRemoveOptions): Promise<BulkRemoveResponse & BulkRemoveResponseNonNullableFields>;
1006
+ export interface BulkRemoveOptions {
1007
+ /** IDs of items to remove. */
1008
+ entries?: BulkRemoveRequestEntry[];
1009
+ /** ID of the collection from which to remove the items. */
1010
+ dataCollectionId?: string;
1011
+ }
1012
+ /**
1013
+ * Gets the full items referenced in the specified property of an item.
1014
+ *
1015
+ * For example, suppose you have a **Movies** collection with an **Actors** field that contains references to items in a **People** collection.
1016
+ * Querying the **Movies** collection using the Query Referenced Data Items endpoint returns the relevant **People** items referenced in the **Actors** field of the specified **Movie** item.
1017
+ * This gives you information from the **People** collection about each of the actors in the specified movie.
1018
+ * @internal
1019
+ * @documentationMaturity preview
1020
+ * @requiredField options.propertyName
1021
+ * @requiredField options.referringItemId
1022
+ * @permissionId WIX_DATA.FIND
1023
+ * @permissionScope Read Data Items
1024
+ * @permissionScopeId SCOPE.DC-DATA.READ
1025
+ * @applicableIdentity APP
1026
+ * @fqn com.wixpress.cloud.data.api.dataservice.WixDataService.QueryReferenced
1027
+ */
1028
+ export declare function queryReferenced(options?: QueryReferencedOptions): Promise<QueryReferencedResponse & QueryReferencedResponseNonNullableFields>;
1029
+ export interface QueryReferencedOptions {
1030
+ /** ID of the referring item. */
1031
+ referringItemId: string;
1032
+ /** Property containing the references to the referenced items. */
1033
+ propertyName: string;
1034
+ /** Paging preferences. */
1035
+ paging?: Paging;
1036
+ /** ID of the collection containing the referring item. */
1037
+ dataCollectionId?: string;
1038
+ /**
1039
+ * Whether to omit the total count in the response.
1040
+ * When `true`, the `pagingMetadata` object in the response doesn't contain a `total` field.
1041
+ *
1042
+ * Default: `false`
1043
+ */
1044
+ omitTotalCount?: boolean;
1045
+ }
1046
+ /**
1047
+ * Inserts one or more references in the specified properties of items in a collection.
1048
+ *
1049
+ * The Bulk Insert References endpoint adds one or more references to a collection.
1050
+ * Each new reference in the `references` field specifies a referring item's ID, the property in which to insert the reference, and the ID of the referenced item.
1051
+ * @internal
1052
+ * @documentationMaturity preview
1053
+ * @requiredField options.references
1054
+ * @requiredField options.references.propertyName
1055
+ * @requiredField options.references.referencedItemId
1056
+ * @requiredField options.references.referringItemId
1057
+ * @permissionId WIX_DATA.INSERT
1058
+ * @permissionScope Write Data Items
1059
+ * @permissionScopeId SCOPE.DC-DATA.WRITE
1060
+ * @applicableIdentity APP
1061
+ * @fqn com.wixpress.cloud.data.api.dataservice.WixDataService.BulkInsertReferences
1062
+ */
1063
+ export declare function bulkInsertReferences(options?: BulkInsertReferencesOptions): Promise<void>;
1064
+ export interface BulkInsertReferencesOptions {
1065
+ /** References to insert. */
1066
+ references: Reference[];
1067
+ /** ID of the collection containing the referring item. */
1068
+ dataCollectionId?: string;
1069
+ }
1070
+ /**
1071
+ * Replaces references in a specified property of a specified data item.
1072
+ *
1073
+ * The Bulk Replace References endpoint replaces the existing reference or references contained in the property specified in `propertyName` within the data item specified in `referringItemId`.
1074
+ * The endpoint removes existing references and in their place it adds references to the items specified in `newReferencedItemIds`.
1075
+ * @internal
1076
+ * @documentationMaturity preview
1077
+ * @requiredField options.propertyName
1078
+ * @requiredField options.referringItemId
1079
+ * @permissionId WIX_DATA.UPDATE
1080
+ * @permissionScope Write Data Items
1081
+ * @permissionScopeId SCOPE.DC-DATA.WRITE
1082
+ * @applicableIdentity APP
1083
+ * @fqn com.wixpress.cloud.data.api.dataservice.WixDataService.BulkReplaceReferences
1084
+ */
1085
+ export declare function bulkReplaceReferences(options?: BulkReplaceReferencesOptions): Promise<void>;
1086
+ export interface BulkReplaceReferencesOptions {
1087
+ /** Property containing the references to the referenced items. */
1088
+ propertyName: string;
1089
+ /** ID of the referring item. */
1090
+ referringItemId: string;
1091
+ /** List of new referenced item IDs to replace the existing ones. */
1092
+ newReferencedItemIds?: string[];
1093
+ /** ID of the collection containing the referring item. */
1094
+ dataCollectionId?: string;
1095
+ }
1096
+ /**
1097
+ * Removes one or more references.
1098
+ * @internal
1099
+ * @documentationMaturity preview
1100
+ * @requiredField options.references
1101
+ * @requiredField options.references.propertyName
1102
+ * @permissionId WIX_DATA.REMOVE
1103
+ * @permissionScope Write Data Items
1104
+ * @permissionScopeId SCOPE.DC-DATA.WRITE
1105
+ * @applicableIdentity APP
1106
+ * @fqn com.wixpress.cloud.data.api.dataservice.WixDataService.BulkRemoveReferences
1107
+ */
1108
+ export declare function bulkRemoveReferences(options?: BulkRemoveReferencesOptions): Promise<void>;
1109
+ export interface BulkRemoveReferencesOptions {
1110
+ /** References to be removed. */
1111
+ references: Reference[];
1112
+ /** ID of the collection containing the referring item. */
1113
+ dataCollectionId?: string;
1114
+ }
1115
+ /**
1116
+ * Checks if a specific property of a referring item contains a reference to another specific item.
1117
+ * @internal
1118
+ * @documentationMaturity preview
1119
+ * @requiredField options.propertyName
1120
+ * @requiredField options.referencedItemId
1121
+ * @requiredField options.referringItemId
1122
+ * @permissionId WIX_DATA.FIND
1123
+ * @permissionScope Read Data Items
1124
+ * @permissionScopeId SCOPE.DC-DATA.READ
1125
+ * @applicableIdentity APP
1126
+ * @fqn com.wixpress.cloud.data.api.dataservice.WixDataService.IsReferenced
1127
+ */
1128
+ export declare function isReferenced(options?: IsReferencedOptions): Promise<IsReferencedResponse & IsReferencedResponseNonNullableFields>;
1129
+ export interface IsReferencedOptions {
1130
+ /** Property that may contain a reference to the specified item. */
1131
+ propertyName: string;
1132
+ /** ID of the referring item. */
1133
+ referringItemId: string;
1134
+ /** ID of the item that may be referenced. */
1135
+ referencedItemId: string;
1136
+ /** ID of the collection containing the referring item. */
1137
+ dataCollectionId?: string;
1138
+ }
1139
+ export {};