@wix/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.
- package/build/cjs/index.d.ts +4 -0
- package/build/cjs/index.js +27 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/src/data-v1-external-database-connection.http.d.ts +29 -0
- package/build/cjs/src/data-v1-external-database-connection.http.js +397 -0
- package/build/cjs/src/data-v1-external-database-connection.http.js.map +1 -0
- package/build/cjs/src/data-v1-external-database-connection.public.d.ts +11 -0
- package/build/cjs/src/data-v1-external-database-connection.public.js +36 -0
- package/build/cjs/src/data-v1-external-database-connection.public.js.map +1 -0
- package/build/cjs/src/data-v1-external-database-connection.types.d.ts +53 -0
- package/build/cjs/src/data-v1-external-database-connection.types.js +3 -0
- package/build/cjs/src/data-v1-external-database-connection.types.js.map +1 -0
- package/build/cjs/src/data-v1-external-database-connection.universal.d.ts +129 -0
- package/build/cjs/src/data-v1-external-database-connection.universal.js +334 -0
- package/build/cjs/src/data-v1-external-database-connection.universal.js.map +1 -0
- package/build/cjs/src/data-v2-data-collection.http.d.ts +37 -0
- package/build/cjs/src/data-v2-data-collection.http.js +458 -0
- package/build/cjs/src/data-v2-data-collection.http.js.map +1 -0
- package/build/cjs/src/data-v2-data-collection.public.d.ts +12 -0
- package/build/cjs/src/data-v2-data-collection.public.js +48 -0
- package/build/cjs/src/data-v2-data-collection.public.js.map +1 -0
- package/build/cjs/src/data-v2-data-collection.types.d.ts +638 -0
- package/build/cjs/src/data-v2-data-collection.types.js +143 -0
- package/build/cjs/src/data-v2-data-collection.types.js.map +1 -0
- package/build/cjs/src/data-v2-data-collection.universal.d.ts +732 -0
- package/build/cjs/src/data-v2-data-collection.universal.js +532 -0
- package/build/cjs/src/data-v2-data-collection.universal.js.map +1 -0
- package/build/cjs/src/data-v2-data-item.http.d.ts +192 -0
- package/build/cjs/src/data-v2-data-item.http.js +944 -0
- package/build/cjs/src/data-v2-data-item.http.js.map +1 -0
- package/build/cjs/src/data-v2-data-item.public.d.ts +28 -0
- package/build/cjs/src/data-v2-data-item.public.js +137 -0
- package/build/cjs/src/data-v2-data-item.public.js.map +1 -0
- package/build/cjs/src/data-v2-data-item.types.d.ts +656 -0
- package/build/cjs/src/data-v2-data-item.types.js +27 -0
- package/build/cjs/src/data-v2-data-item.types.js.map +1 -0
- package/build/cjs/src/data-v2-data-item.universal.d.ts +1343 -0
- package/build/cjs/src/data-v2-data-item.universal.js +1435 -0
- package/build/cjs/src/data-v2-data-item.universal.js.map +1 -0
- package/build/cjs/src/data-v2-index.http.d.ts +29 -0
- package/build/cjs/src/data-v2-index.http.js +349 -0
- package/build/cjs/src/data-v2-index.http.js.map +1 -0
- package/build/cjs/src/data-v2-index.public.d.ts +10 -0
- package/build/cjs/src/data-v2-index.public.js +28 -0
- package/build/cjs/src/data-v2-index.public.js.map +1 -0
- package/build/cjs/src/data-v2-index.types.d.ts +120 -0
- package/build/cjs/src/data-v2-index.types.js +35 -0
- package/build/cjs/src/data-v2-index.types.js.map +1 -0
- package/build/cjs/src/data-v2-index.universal.d.ts +182 -0
- package/build/cjs/src/data-v2-index.universal.js +261 -0
- package/build/cjs/src/data-v2-index.universal.js.map +1 -0
- package/build/es/index.d.ts +4 -0
- package/build/es/index.js +5 -0
- package/build/es/index.js.map +1 -0
- package/build/es/src/data-v1-external-database-connection.http.d.ts +29 -0
- package/build/es/src/data-v1-external-database-connection.http.js +389 -0
- package/build/es/src/data-v1-external-database-connection.http.js.map +1 -0
- package/build/es/src/data-v1-external-database-connection.public.d.ts +11 -0
- package/build/es/src/data-v1-external-database-connection.public.js +28 -0
- package/build/es/src/data-v1-external-database-connection.public.js.map +1 -0
- package/build/es/src/data-v1-external-database-connection.types.d.ts +53 -0
- package/build/es/src/data-v1-external-database-connection.types.js +2 -0
- package/build/es/src/data-v1-external-database-connection.types.js.map +1 -0
- package/build/es/src/data-v1-external-database-connection.universal.d.ts +129 -0
- package/build/es/src/data-v1-external-database-connection.universal.js +307 -0
- package/build/es/src/data-v1-external-database-connection.universal.js.map +1 -0
- package/build/es/src/data-v2-data-collection.http.d.ts +37 -0
- package/build/es/src/data-v2-data-collection.http.js +450 -0
- package/build/es/src/data-v2-data-collection.http.js.map +1 -0
- package/build/es/src/data-v2-data-collection.public.d.ts +12 -0
- package/build/es/src/data-v2-data-collection.public.js +29 -0
- package/build/es/src/data-v2-data-collection.public.js.map +1 -0
- package/build/es/src/data-v2-data-collection.types.d.ts +638 -0
- package/build/es/src/data-v2-data-collection.types.js +140 -0
- package/build/es/src/data-v2-data-collection.types.js.map +1 -0
- package/build/es/src/data-v2-data-collection.universal.d.ts +732 -0
- package/build/es/src/data-v2-data-collection.universal.js +505 -0
- package/build/es/src/data-v2-data-collection.universal.js.map +1 -0
- package/build/es/src/data-v2-data-item.http.d.ts +192 -0
- package/build/es/src/data-v2-data-item.http.js +920 -0
- package/build/es/src/data-v2-data-item.http.js.map +1 -0
- package/build/es/src/data-v2-data-item.public.d.ts +28 -0
- package/build/es/src/data-v2-data-item.public.js +109 -0
- package/build/es/src/data-v2-data-item.public.js.map +1 -0
- package/build/es/src/data-v2-data-item.types.d.ts +656 -0
- package/build/es/src/data-v2-data-item.types.js +24 -0
- package/build/es/src/data-v2-data-item.types.js.map +1 -0
- package/build/es/src/data-v2-data-item.universal.d.ts +1343 -0
- package/build/es/src/data-v2-data-item.universal.js +1392 -0
- package/build/es/src/data-v2-data-item.universal.js.map +1 -0
- package/build/es/src/data-v2-index.http.d.ts +29 -0
- package/build/es/src/data-v2-index.http.js +343 -0
- package/build/es/src/data-v2-index.http.js.map +1 -0
- package/build/es/src/data-v2-index.public.d.ts +10 -0
- package/build/es/src/data-v2-index.public.js +19 -0
- package/build/es/src/data-v2-index.public.js.map +1 -0
- package/build/es/src/data-v2-index.types.d.ts +120 -0
- package/build/es/src/data-v2-index.types.js +32 -0
- package/build/es/src/data-v2-index.types.js.map +1 -0
- package/build/es/src/data-v2-index.universal.d.ts +182 -0
- package/build/es/src/data-v2-index.universal.js +236 -0
- package/build/es/src/data-v2-index.universal.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1,944 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.replaceDataItemReferences = exports.bulkRemoveDataItemReferences = exports.bulkInsertDataItemReferences = exports.removeDataItemReference = exports.insertDataItemReference = exports.isReferencedDataItem = exports.queryReferencedDataItems = exports.bulkRemoveDataItems = exports.bulkSaveDataItems = exports.bulkUpdateDataItems = exports.bulkInsertDataItems = exports.queryDistinctValues = exports.countDataItems = exports.aggregateDataItems = exports.queryDataItems = exports.truncateDataItems = exports.removeDataItem = exports.getDataItem = exports.saveDataItem = exports.updateDataItem = exports.insertDataItem = void 0;
|
|
4
|
+
const metro_runtime_1 = require("@wix/metro-runtime");
|
|
5
|
+
const ambassador_1 = require("@wix/metro-runtime/ambassador");
|
|
6
|
+
const metro_runtime_2 = require("@wix/metro-runtime");
|
|
7
|
+
const _aggregateDataItemsRequest = {};
|
|
8
|
+
const _aggregateDataItemsResponse = {};
|
|
9
|
+
const _bulkInsertDataItemReferencesRequest = {};
|
|
10
|
+
const _bulkInsertDataItemReferencesResponse = {};
|
|
11
|
+
const _bulkInsertDataItemsRequest = {};
|
|
12
|
+
const _bulkInsertDataItemsResponse = {};
|
|
13
|
+
const _bulkRemoveDataItemReferencesRequest = {};
|
|
14
|
+
const _bulkRemoveDataItemReferencesResponse = {};
|
|
15
|
+
const _bulkRemoveDataItemsRequest = {};
|
|
16
|
+
const _bulkRemoveDataItemsResponse = {};
|
|
17
|
+
const _bulkSaveDataItemsRequest = {};
|
|
18
|
+
const _bulkSaveDataItemsResponse = {};
|
|
19
|
+
const _bulkUpdateDataItemsRequest = {};
|
|
20
|
+
const _bulkUpdateDataItemsResponse = {};
|
|
21
|
+
const _countDataItemsRequest = {};
|
|
22
|
+
const _countDataItemsResponse = {};
|
|
23
|
+
const _getDataItemRequest = {};
|
|
24
|
+
const _getDataItemResponse = {};
|
|
25
|
+
const _insertDataItemReferenceRequest = {};
|
|
26
|
+
const _insertDataItemReferenceResponse = {};
|
|
27
|
+
const _insertDataItemRequest = {};
|
|
28
|
+
const _insertDataItemResponse = {};
|
|
29
|
+
const _isReferencedDataItemRequest = {};
|
|
30
|
+
const _isReferencedDataItemResponse = {};
|
|
31
|
+
const _queryDataItemsRequest = {};
|
|
32
|
+
const _queryDataItemsResponse = {};
|
|
33
|
+
const _queryDistinctValuesRequest = {};
|
|
34
|
+
const _queryDistinctValuesResponse = {};
|
|
35
|
+
const _queryReferencedDataItemsRequest = {};
|
|
36
|
+
const _queryReferencedDataItemsResponse = {};
|
|
37
|
+
const _removeDataItemReferenceRequest = {};
|
|
38
|
+
const _removeDataItemReferenceResponse = {};
|
|
39
|
+
const _removeDataItemRequest = {};
|
|
40
|
+
const _removeDataItemResponse = {};
|
|
41
|
+
const _replaceDataItemReferencesRequest = {};
|
|
42
|
+
const _replaceDataItemReferencesResponse = {};
|
|
43
|
+
const _saveDataItemRequest = {};
|
|
44
|
+
const _saveDataItemResponse = {};
|
|
45
|
+
const _truncateDataItemsRequest = {};
|
|
46
|
+
const _truncateDataItemsResponse = {};
|
|
47
|
+
const _updateDataItemRequest = {};
|
|
48
|
+
const _updateDataItemResponse = {};
|
|
49
|
+
function resolveComWixpressCloudDataApiDataDataItemServiceUrl(opts) {
|
|
50
|
+
const domainToMappings = {
|
|
51
|
+
'api._api_base_domain_': [
|
|
52
|
+
{
|
|
53
|
+
srcPath: '/cloud-data',
|
|
54
|
+
destPath: '',
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
'code._base_domain_': [
|
|
58
|
+
{
|
|
59
|
+
srcPath: '/_api/cloud-data/v1/data-settings',
|
|
60
|
+
destPath: '/v1/data-settings',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
srcPath: '/_api/cloud-data/v1/schemas',
|
|
64
|
+
destPath: '/v1/schemas',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
srcPath: '/_api/cloud-data/v1/connector',
|
|
68
|
+
destPath: '/v1/connector',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
srcPath: '/_api/data/v1/data-settings',
|
|
72
|
+
destPath: '/v1/data-settings',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
srcPath: '/_api/data/v1/schemas',
|
|
76
|
+
destPath: '/v1/schemas',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
srcPath: '/_api/data/v1/connector',
|
|
80
|
+
destPath: '/v1/connector',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
srcPath: '/_api/cloud-data/v1/wix-data',
|
|
84
|
+
destPath: '/v1/wix-data',
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
'cloud-data.wix-code.com': [
|
|
88
|
+
{
|
|
89
|
+
srcPath: '',
|
|
90
|
+
destPath: '',
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
_: [
|
|
94
|
+
{
|
|
95
|
+
srcPath: '/_api/cloud-data',
|
|
96
|
+
destPath: '',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
srcPath: '/_api/cloud-data/v1/schemas',
|
|
100
|
+
destPath: '/v1/schemas',
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
'www._base_domain_': [
|
|
104
|
+
{
|
|
105
|
+
srcPath: '/_api/cloud-data',
|
|
106
|
+
destPath: '',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
srcPath: '/_api/data',
|
|
110
|
+
destPath: '',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
srcPath: '/[a-z0-9-_/]+/_api/cloud-data',
|
|
114
|
+
destPath: '',
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
'dev._base_domain_': [
|
|
118
|
+
{
|
|
119
|
+
srcPath: '/_api/cloud-data',
|
|
120
|
+
destPath: '',
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
'bo._base_domain_': [
|
|
124
|
+
{
|
|
125
|
+
srcPath: '/_api/cloud-data/v1',
|
|
126
|
+
destPath: '/v1',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
srcPath: '/[a-z0-9-_/]+/_api/cloud-data',
|
|
130
|
+
destPath: '',
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
'manage._base_domain_': [
|
|
134
|
+
{
|
|
135
|
+
srcPath: '/_api/cloud-data',
|
|
136
|
+
destPath: '',
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
srcPath: '/_api/data',
|
|
140
|
+
destPath: '',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
srcPath: '/[a-z0-9-_/]+/_api/cloud-data',
|
|
144
|
+
destPath: '',
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
'editor._base_domain_': [
|
|
148
|
+
{
|
|
149
|
+
srcPath: '/_api/cloud-data/v1/schemas',
|
|
150
|
+
destPath: '/v1/schemas',
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
srcPath: '/_api/cloud-data/dbs/tasks',
|
|
154
|
+
destPath: '/dbs/tasks',
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
srcPath: '/_api/data/v1/schemas',
|
|
158
|
+
destPath: '/v1/schemas',
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
srcPath: '/_api/data/dbs/tasks',
|
|
162
|
+
destPath: '/dbs/tasks',
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
srcPath: '/_api/cloud-data/v1/wix-data',
|
|
166
|
+
destPath: '/v1/wix-data',
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
srcPath: '/_api/cloud-data/v1/data-settings',
|
|
170
|
+
destPath: '/v1/data-settings',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
srcPath: '/_api/data/v2/indexes',
|
|
174
|
+
destPath: '/v2/indexes',
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
srcPath: '/_api/cloud-data/v1/external-database-connections',
|
|
178
|
+
destPath: '/v1/external-database-connections',
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
'blocks._base_domain_': [
|
|
182
|
+
{
|
|
183
|
+
srcPath: '/_api/cloud-data/v1/schemas',
|
|
184
|
+
destPath: '/v1/schemas',
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
srcPath: '/_api/cloud-data/dbs/tasks',
|
|
188
|
+
destPath: '/dbs/tasks',
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
srcPath: '/_api/data/v1/schemas',
|
|
192
|
+
destPath: '/v1/schemas',
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
srcPath: '/_api/data/dbs/tasks',
|
|
196
|
+
destPath: '/dbs/tasks',
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
srcPath: '/_api/cloud-data/v1/wix-data',
|
|
200
|
+
destPath: '/v1/wix-data',
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
srcPath: '/_api/cloud-data/v1/data-settings',
|
|
204
|
+
destPath: '/v1/data-settings',
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
srcPath: '/_api/data/v2/indexes',
|
|
208
|
+
destPath: '/v2/indexes',
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
srcPath: '/_api/cloud-data/v1/external-database-connections',
|
|
212
|
+
destPath: '/v1/external-database-connections',
|
|
213
|
+
},
|
|
214
|
+
],
|
|
215
|
+
'create.editorx': [
|
|
216
|
+
{
|
|
217
|
+
srcPath: '/_api/cloud-data/v1/schemas',
|
|
218
|
+
destPath: '/v1/schemas',
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
srcPath: '/_api/cloud-data/dbs/tasks',
|
|
222
|
+
destPath: '/dbs/tasks',
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
srcPath: '/_api/data/v1/schemas',
|
|
226
|
+
destPath: '/v1/schemas',
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
srcPath: '/_api/data/dbs/tasks',
|
|
230
|
+
destPath: '/dbs/tasks',
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
srcPath: '/_api/cloud-data/v1/wix-data',
|
|
234
|
+
destPath: '/v1/wix-data',
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
srcPath: '/_api/cloud-data/v1/data-settings',
|
|
238
|
+
destPath: '/v1/data-settings',
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
srcPath: '/_api/data/v2/indexes',
|
|
242
|
+
destPath: '/v2/indexes',
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
srcPath: '/_api/cloud-data/v1/external-database-connections',
|
|
246
|
+
destPath: '/v1/external-database-connections',
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
'www.wixapis.com': [
|
|
250
|
+
{
|
|
251
|
+
srcPath: '/wix-data/v1/collections',
|
|
252
|
+
destPath: '/v1/wix-data/collections',
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
srcPath: '/wix-data/v1/external-database-connections',
|
|
256
|
+
destPath: '/v1/external-database-connections',
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
srcPath: '/wix-data/v2/indexes',
|
|
260
|
+
destPath: '/v2/indexes',
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
srcPath: '/wix-data/v1/items',
|
|
264
|
+
destPath: '/v1/items',
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
srcPath: '/wix-data/v1/bulk',
|
|
268
|
+
destPath: '/v1/bulk',
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
srcPath: '/wix-data/v1/external-databases',
|
|
272
|
+
destPath: '/v1/external-databases',
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
srcPath: '/wix-data/v2',
|
|
276
|
+
destPath: '/v2',
|
|
277
|
+
},
|
|
278
|
+
],
|
|
279
|
+
'www.wixgateway.com': [
|
|
280
|
+
{
|
|
281
|
+
srcPath: '/wix-data/v1/items',
|
|
282
|
+
destPath: '/v1/items',
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
srcPath: '/wix-data/v1/bulk',
|
|
286
|
+
destPath: '/v1/bulk',
|
|
287
|
+
},
|
|
288
|
+
],
|
|
289
|
+
};
|
|
290
|
+
return (0, metro_runtime_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Adds an item to a collection.
|
|
294
|
+
*
|
|
295
|
+
*
|
|
296
|
+
* An item can only be inserted into an existing connection.
|
|
297
|
+
* You can create a new collection using the [Data Collections API](https://dev.wix.com/api/rest/wix-data/wix-data/data-collections).
|
|
298
|
+
*
|
|
299
|
+
* When an item is inserted into a collection, the item's ID is automatically assigned a random value.
|
|
300
|
+
* You can optionally provide a custom ID in `dataItem.id` when inserting the item.
|
|
301
|
+
* If you specify an ID that already exists in the collection, the insertion will fail.
|
|
302
|
+
*
|
|
303
|
+
* If `dataItem.data` is empty, a new item is created with no data fields.
|
|
304
|
+
*/
|
|
305
|
+
function insertDataItem(payload) {
|
|
306
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_insertDataItemRequest, {});
|
|
307
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_insertDataItemResponse, {});
|
|
308
|
+
function __insertDataItem({ host }) {
|
|
309
|
+
const serializedData = toReq(payload);
|
|
310
|
+
const metadata = {
|
|
311
|
+
entityFqdn: 'wix.data.v2.data_item',
|
|
312
|
+
method: 'POST',
|
|
313
|
+
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.InsertDataItem',
|
|
314
|
+
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
315
|
+
protoPath: '/v2/items',
|
|
316
|
+
data: serializedData,
|
|
317
|
+
host,
|
|
318
|
+
}),
|
|
319
|
+
data: serializedData,
|
|
320
|
+
transformResponse: fromRes,
|
|
321
|
+
};
|
|
322
|
+
return metadata;
|
|
323
|
+
}
|
|
324
|
+
__insertDataItem.fromReq = fromReq;
|
|
325
|
+
return __insertDataItem;
|
|
326
|
+
}
|
|
327
|
+
exports.insertDataItem = insertDataItem;
|
|
328
|
+
/**
|
|
329
|
+
* Updates an item in a collection.
|
|
330
|
+
*
|
|
331
|
+
*
|
|
332
|
+
* This endpoint replaces the data item's existing data with the payload provided in `dataItem.data` in the request.
|
|
333
|
+
*
|
|
334
|
+
* To update an item, you need to specify an item ID and a collection ID.
|
|
335
|
+
* If an item is found in the specified collection with the specified ID, that item is updated.
|
|
336
|
+
* If the collection doesn't contain an item with that ID, the request fails.
|
|
337
|
+
*
|
|
338
|
+
* When an item is updated, its `data._updatedDate` field is changed to the current date and time.
|
|
339
|
+
*
|
|
340
|
+
* > **Note:**
|
|
341
|
+
* > After an item is updated, it only contains the fields included in the `dataItem.data` payload in Update Data Item request.
|
|
342
|
+
* > If the existing item has fields with values and those fields aren't included in the updated item, their values are lost.
|
|
343
|
+
*/
|
|
344
|
+
function updateDataItem(payload) {
|
|
345
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_updateDataItemRequest, {});
|
|
346
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_updateDataItemResponse, {});
|
|
347
|
+
function __updateDataItem({ host }) {
|
|
348
|
+
const serializedData = toReq(payload);
|
|
349
|
+
const metadata = {
|
|
350
|
+
entityFqdn: 'wix.data.v2.data_item',
|
|
351
|
+
method: 'PUT',
|
|
352
|
+
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.UpdateDataItem',
|
|
353
|
+
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
354
|
+
protoPath: '/v2/items/{dataItem.id}',
|
|
355
|
+
data: serializedData,
|
|
356
|
+
host,
|
|
357
|
+
}),
|
|
358
|
+
data: serializedData,
|
|
359
|
+
transformResponse: fromRes,
|
|
360
|
+
};
|
|
361
|
+
return metadata;
|
|
362
|
+
}
|
|
363
|
+
__updateDataItem.fromReq = fromReq;
|
|
364
|
+
return __updateDataItem;
|
|
365
|
+
}
|
|
366
|
+
exports.updateDataItem = updateDataItem;
|
|
367
|
+
/**
|
|
368
|
+
* Inserts or updates an item in a collection.
|
|
369
|
+
*
|
|
370
|
+
*
|
|
371
|
+
* The Save Data Item endpoint inserts or updates the specified item, depending on whether it already exists in the collection.
|
|
372
|
+
*
|
|
373
|
+
* + If you don't provide an ID, a new item is created.
|
|
374
|
+
*
|
|
375
|
+
* + If you provide an ID that does not exist in the collection, a new item is created with that ID.
|
|
376
|
+
*
|
|
377
|
+
* + If an item with the ID you provide already exists in the collection, that item is updated. When an item is updated, its `data._updatedDate` field is changed to the current date and time.
|
|
378
|
+
*
|
|
379
|
+
* > **Note:** When you provide an item with an ID that already exists in the collection, the payload you provide in `dataItem.data` replaces the existing item with that ID.
|
|
380
|
+
* > This means that the item's previous fields and values are lost.
|
|
381
|
+
*/
|
|
382
|
+
function saveDataItem(payload) {
|
|
383
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_saveDataItemRequest, {});
|
|
384
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_saveDataItemResponse, {});
|
|
385
|
+
function __saveDataItem({ host }) {
|
|
386
|
+
const serializedData = toReq(payload);
|
|
387
|
+
const metadata = {
|
|
388
|
+
entityFqdn: 'wix.data.v2.data_item',
|
|
389
|
+
method: 'POST',
|
|
390
|
+
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.SaveDataItem',
|
|
391
|
+
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
392
|
+
protoPath: '/v2/items/save',
|
|
393
|
+
data: serializedData,
|
|
394
|
+
host,
|
|
395
|
+
}),
|
|
396
|
+
data: serializedData,
|
|
397
|
+
transformResponse: fromRes,
|
|
398
|
+
};
|
|
399
|
+
return metadata;
|
|
400
|
+
}
|
|
401
|
+
__saveDataItem.fromReq = fromReq;
|
|
402
|
+
return __saveDataItem;
|
|
403
|
+
}
|
|
404
|
+
exports.saveDataItem = saveDataItem;
|
|
405
|
+
/** Retrieves an item from a collection. */
|
|
406
|
+
function getDataItem(payload) {
|
|
407
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_getDataItemRequest, {});
|
|
408
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_getDataItemResponse, {});
|
|
409
|
+
function __getDataItem({ host }) {
|
|
410
|
+
const serializedData = toReq(payload);
|
|
411
|
+
const metadata = {
|
|
412
|
+
entityFqdn: 'wix.data.v2.data_item',
|
|
413
|
+
method: 'GET',
|
|
414
|
+
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.GetDataItem',
|
|
415
|
+
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
416
|
+
protoPath: '/v2/items/{dataItemId}',
|
|
417
|
+
data: serializedData,
|
|
418
|
+
host,
|
|
419
|
+
}),
|
|
420
|
+
params: (0, metro_runtime_1.toURLSearchParams)(serializedData),
|
|
421
|
+
transformResponse: fromRes,
|
|
422
|
+
};
|
|
423
|
+
return metadata;
|
|
424
|
+
}
|
|
425
|
+
__getDataItem.fromReq = fromReq;
|
|
426
|
+
return __getDataItem;
|
|
427
|
+
}
|
|
428
|
+
exports.getDataItem = getDataItem;
|
|
429
|
+
/**
|
|
430
|
+
* Removes an item from a collection.
|
|
431
|
+
*
|
|
432
|
+
*
|
|
433
|
+
* If any items in other collections reference the removed item in reference or multi-reference fields, those fields are cleared.
|
|
434
|
+
*
|
|
435
|
+
* > **Note:**
|
|
436
|
+
* > Once an item has been removed from a collection, it can't be restored.
|
|
437
|
+
*/
|
|
438
|
+
function removeDataItem(payload) {
|
|
439
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_removeDataItemRequest, {});
|
|
440
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_removeDataItemResponse, {});
|
|
441
|
+
function __removeDataItem({ host }) {
|
|
442
|
+
const serializedData = toReq(payload);
|
|
443
|
+
const metadata = {
|
|
444
|
+
entityFqdn: 'wix.data.v2.data_item',
|
|
445
|
+
method: 'DELETE',
|
|
446
|
+
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.RemoveDataItem',
|
|
447
|
+
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
448
|
+
protoPath: '/v2/items/{dataItemId}',
|
|
449
|
+
data: serializedData,
|
|
450
|
+
host,
|
|
451
|
+
}),
|
|
452
|
+
params: (0, metro_runtime_1.toURLSearchParams)(serializedData),
|
|
453
|
+
transformResponse: fromRes,
|
|
454
|
+
};
|
|
455
|
+
return metadata;
|
|
456
|
+
}
|
|
457
|
+
__removeDataItem.fromReq = fromReq;
|
|
458
|
+
return __removeDataItem;
|
|
459
|
+
}
|
|
460
|
+
exports.removeDataItem = removeDataItem;
|
|
461
|
+
/**
|
|
462
|
+
* Removes all items from a collection.
|
|
463
|
+
*
|
|
464
|
+
*
|
|
465
|
+
* If any items in other collections reference the removed items in reference or multi-reference fields, those fields are cleared.
|
|
466
|
+
*
|
|
467
|
+
* > **Note:**
|
|
468
|
+
* > Once items have been removed from a collection, they can't be restored.
|
|
469
|
+
*/
|
|
470
|
+
function truncateDataItems(payload) {
|
|
471
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_truncateDataItemsRequest, {});
|
|
472
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_truncateDataItemsResponse, {});
|
|
473
|
+
function __truncateDataItems({ host }) {
|
|
474
|
+
const serializedData = toReq(payload);
|
|
475
|
+
const metadata = {
|
|
476
|
+
entityFqdn: 'wix.data.v2.data_item',
|
|
477
|
+
method: 'POST',
|
|
478
|
+
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.TruncateDataItems',
|
|
479
|
+
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
480
|
+
protoPath: '/v2/items/truncate',
|
|
481
|
+
data: serializedData,
|
|
482
|
+
host,
|
|
483
|
+
}),
|
|
484
|
+
data: serializedData,
|
|
485
|
+
transformResponse: fromRes,
|
|
486
|
+
};
|
|
487
|
+
return metadata;
|
|
488
|
+
}
|
|
489
|
+
__truncateDataItems.fromReq = fromReq;
|
|
490
|
+
return __truncateDataItems;
|
|
491
|
+
}
|
|
492
|
+
exports.truncateDataItems = truncateDataItems;
|
|
493
|
+
/**
|
|
494
|
+
* Retrieves a list of items, on the basis of the filtering, sorting, and paging preferences you provide.
|
|
495
|
+
*
|
|
496
|
+
*
|
|
497
|
+
* For more details on using queries, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
|
|
498
|
+
*/
|
|
499
|
+
function queryDataItems(payload) {
|
|
500
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_queryDataItemsRequest, {});
|
|
501
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_queryDataItemsResponse, {});
|
|
502
|
+
function __queryDataItems({ host }) {
|
|
503
|
+
const serializedData = toReq(payload);
|
|
504
|
+
const metadata = {
|
|
505
|
+
entityFqdn: 'wix.data.v2.data_item',
|
|
506
|
+
method: 'POST',
|
|
507
|
+
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.QueryDataItems',
|
|
508
|
+
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
509
|
+
protoPath: '/v2/items/query',
|
|
510
|
+
data: serializedData,
|
|
511
|
+
host,
|
|
512
|
+
}),
|
|
513
|
+
data: serializedData,
|
|
514
|
+
transformResponse: fromRes,
|
|
515
|
+
};
|
|
516
|
+
return metadata;
|
|
517
|
+
}
|
|
518
|
+
__queryDataItems.fromReq = fromReq;
|
|
519
|
+
return __queryDataItems;
|
|
520
|
+
}
|
|
521
|
+
exports.queryDataItems = queryDataItems;
|
|
522
|
+
/**
|
|
523
|
+
* Runs an aggregation on a data collection and returns the resulting list of items.
|
|
524
|
+
*
|
|
525
|
+
*
|
|
526
|
+
* An aggregation enables you to perform certain calculations on your collection data, or on groups of items that you define, to retrieve meaningful summaries.
|
|
527
|
+
* You can also add paging, filtering, and sorting preferences to your aggregation to retrieve exactly what you need.
|
|
528
|
+
*/
|
|
529
|
+
function aggregateDataItems(payload) {
|
|
530
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_aggregateDataItemsRequest, {});
|
|
531
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_aggregateDataItemsResponse, {});
|
|
532
|
+
function __aggregateDataItems({ host }) {
|
|
533
|
+
const serializedData = toReq(payload);
|
|
534
|
+
const metadata = {
|
|
535
|
+
entityFqdn: 'wix.data.v2.data_item',
|
|
536
|
+
method: 'POST',
|
|
537
|
+
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.AggregateDataItems',
|
|
538
|
+
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
539
|
+
protoPath: '/v2/items/aggregate',
|
|
540
|
+
data: serializedData,
|
|
541
|
+
host,
|
|
542
|
+
}),
|
|
543
|
+
data: serializedData,
|
|
544
|
+
transformResponse: fromRes,
|
|
545
|
+
};
|
|
546
|
+
return metadata;
|
|
547
|
+
}
|
|
548
|
+
__aggregateDataItems.fromReq = fromReq;
|
|
549
|
+
return __aggregateDataItems;
|
|
550
|
+
}
|
|
551
|
+
exports.aggregateDataItems = aggregateDataItems;
|
|
552
|
+
/** Counts the number of items in a data collection that match the provided filtering preferences. */
|
|
553
|
+
function countDataItems(payload) {
|
|
554
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_countDataItemsRequest, {});
|
|
555
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_countDataItemsResponse, {});
|
|
556
|
+
function __countDataItems({ host }) {
|
|
557
|
+
const serializedData = toReq(payload);
|
|
558
|
+
const metadata = {
|
|
559
|
+
entityFqdn: 'wix.data.v2.data_item',
|
|
560
|
+
method: 'POST',
|
|
561
|
+
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.CountDataItems',
|
|
562
|
+
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
563
|
+
protoPath: '/v2/items/count',
|
|
564
|
+
data: serializedData,
|
|
565
|
+
host,
|
|
566
|
+
}),
|
|
567
|
+
data: serializedData,
|
|
568
|
+
transformResponse: fromRes,
|
|
569
|
+
};
|
|
570
|
+
return metadata;
|
|
571
|
+
}
|
|
572
|
+
__countDataItems.fromReq = fromReq;
|
|
573
|
+
return __countDataItems;
|
|
574
|
+
}
|
|
575
|
+
exports.countDataItems = countDataItems;
|
|
576
|
+
/**
|
|
577
|
+
* Retrieves a list of distinct values for a given field in all items that match a query, without duplicates.
|
|
578
|
+
*
|
|
579
|
+
*
|
|
580
|
+
* As with the [Query Data Items](https://dev.wix.com/api/rest/wix-data/wix-data/data-items/query-data-items) endpoint, this endpoint retrieves items based on the filtering, sorting, and paging preferences you provide.
|
|
581
|
+
* However, the Query Distinct Values endpoint doesn't return all of the full items that match the query.
|
|
582
|
+
* Rather, it returns all unique values of the field you specify in `fieldName` for items that match the query.
|
|
583
|
+
* If more than one item has the same value for that field, that value appears only once.
|
|
584
|
+
*
|
|
585
|
+
* For more details on using queries, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
|
|
586
|
+
*/
|
|
587
|
+
function queryDistinctValues(payload) {
|
|
588
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_queryDistinctValuesRequest, {});
|
|
589
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_queryDistinctValuesResponse, {});
|
|
590
|
+
function __queryDistinctValues({ host }) {
|
|
591
|
+
const serializedData = toReq(payload);
|
|
592
|
+
const metadata = {
|
|
593
|
+
entityFqdn: 'wix.data.v2.data_item',
|
|
594
|
+
method: 'POST',
|
|
595
|
+
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.QueryDistinctValues',
|
|
596
|
+
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
597
|
+
protoPath: '/v2/items/query-distinct-values',
|
|
598
|
+
data: serializedData,
|
|
599
|
+
host,
|
|
600
|
+
}),
|
|
601
|
+
data: serializedData,
|
|
602
|
+
transformResponse: fromRes,
|
|
603
|
+
};
|
|
604
|
+
return metadata;
|
|
605
|
+
}
|
|
606
|
+
__queryDistinctValues.fromReq = fromReq;
|
|
607
|
+
return __queryDistinctValues;
|
|
608
|
+
}
|
|
609
|
+
exports.queryDistinctValues = queryDistinctValues;
|
|
610
|
+
/**
|
|
611
|
+
* Adds multiple items to a collection.
|
|
612
|
+
*
|
|
613
|
+
*
|
|
614
|
+
* When each item is inserted into a collection, its ID is automatically assigned to random value.
|
|
615
|
+
* 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.
|
|
616
|
+
*/
|
|
617
|
+
function bulkInsertDataItems(payload) {
|
|
618
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_bulkInsertDataItemsRequest, {});
|
|
619
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_bulkInsertDataItemsResponse, {});
|
|
620
|
+
function __bulkInsertDataItems({ host }) {
|
|
621
|
+
const serializedData = toReq(payload);
|
|
622
|
+
const metadata = {
|
|
623
|
+
entityFqdn: 'wix.data.v2.data_item',
|
|
624
|
+
method: 'POST',
|
|
625
|
+
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.BulkInsertDataItems',
|
|
626
|
+
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
627
|
+
protoPath: '/v2/bulk/items/insert',
|
|
628
|
+
data: serializedData,
|
|
629
|
+
host,
|
|
630
|
+
}),
|
|
631
|
+
data: serializedData,
|
|
632
|
+
transformResponse: fromRes,
|
|
633
|
+
};
|
|
634
|
+
return metadata;
|
|
635
|
+
}
|
|
636
|
+
__bulkInsertDataItems.fromReq = fromReq;
|
|
637
|
+
return __bulkInsertDataItems;
|
|
638
|
+
}
|
|
639
|
+
exports.bulkInsertDataItems = bulkInsertDataItems;
|
|
640
|
+
/**
|
|
641
|
+
* Updates multiple items in a collection.
|
|
642
|
+
*
|
|
643
|
+
*
|
|
644
|
+
* This endpoint replaces each specified data item's existing data with the payload provided in the request.
|
|
645
|
+
*
|
|
646
|
+
* Each item in the request must include an ID. If an item is found in the specified collection with
|
|
647
|
+
* the same ID, that item is updated. If the collection doesn't contain an item with that ID, the update fails.
|
|
648
|
+
*
|
|
649
|
+
* When an item is updated, its `data._updatedDate` field is changed to the current date and time.
|
|
650
|
+
*
|
|
651
|
+
* > **Note:**
|
|
652
|
+
* > After each item is updated, it only contains the fields included in the request. If the existing item has fields with values and those fields
|
|
653
|
+
* > aren't included in the updated item, their values are lost.
|
|
654
|
+
*/
|
|
655
|
+
function bulkUpdateDataItems(payload) {
|
|
656
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_bulkUpdateDataItemsRequest, {});
|
|
657
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_bulkUpdateDataItemsResponse, {});
|
|
658
|
+
function __bulkUpdateDataItems({ host }) {
|
|
659
|
+
const serializedData = toReq(payload);
|
|
660
|
+
const metadata = {
|
|
661
|
+
entityFqdn: 'wix.data.v2.data_item',
|
|
662
|
+
method: 'POST',
|
|
663
|
+
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.BulkUpdateDataItems',
|
|
664
|
+
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
665
|
+
protoPath: '/v2/bulk/items/update',
|
|
666
|
+
data: serializedData,
|
|
667
|
+
host,
|
|
668
|
+
}),
|
|
669
|
+
data: serializedData,
|
|
670
|
+
transformResponse: fromRes,
|
|
671
|
+
};
|
|
672
|
+
return metadata;
|
|
673
|
+
}
|
|
674
|
+
__bulkUpdateDataItems.fromReq = fromReq;
|
|
675
|
+
return __bulkUpdateDataItems;
|
|
676
|
+
}
|
|
677
|
+
exports.bulkUpdateDataItems = bulkUpdateDataItems;
|
|
678
|
+
/**
|
|
679
|
+
* Inserts or updates multiple items in a collection.
|
|
680
|
+
*
|
|
681
|
+
*
|
|
682
|
+
* The Bulk Save Data Items endpoint inserts or updates each item provided, depending on whether it already exists in the collection. For each item:
|
|
683
|
+
*
|
|
684
|
+
* + If you don't provide an ID, a new item is created.
|
|
685
|
+
*
|
|
686
|
+
* + If you provide an ID that doesn't exist in the collection, a new item is created with that ID.
|
|
687
|
+
*
|
|
688
|
+
* + If an item with the ID you provide already exists in the collection, that item is updated. When an item is updated, its `data._updatedDate` field is changed to the current date and time.
|
|
689
|
+
*
|
|
690
|
+
* > **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.
|
|
691
|
+
* > This means that all of the item's previous fields and values are lost.
|
|
692
|
+
*/
|
|
693
|
+
function bulkSaveDataItems(payload) {
|
|
694
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_bulkSaveDataItemsRequest, {});
|
|
695
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_bulkSaveDataItemsResponse, {});
|
|
696
|
+
function __bulkSaveDataItems({ host }) {
|
|
697
|
+
const serializedData = toReq(payload);
|
|
698
|
+
const metadata = {
|
|
699
|
+
entityFqdn: 'wix.data.v2.data_item',
|
|
700
|
+
method: 'POST',
|
|
701
|
+
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.BulkSaveDataItems',
|
|
702
|
+
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
703
|
+
protoPath: '/v2/bulk/items/save',
|
|
704
|
+
data: serializedData,
|
|
705
|
+
host,
|
|
706
|
+
}),
|
|
707
|
+
data: serializedData,
|
|
708
|
+
transformResponse: fromRes,
|
|
709
|
+
};
|
|
710
|
+
return metadata;
|
|
711
|
+
}
|
|
712
|
+
__bulkSaveDataItems.fromReq = fromReq;
|
|
713
|
+
return __bulkSaveDataItems;
|
|
714
|
+
}
|
|
715
|
+
exports.bulkSaveDataItems = bulkSaveDataItems;
|
|
716
|
+
/**
|
|
717
|
+
* Removes multiple items from a collection.
|
|
718
|
+
*
|
|
719
|
+
*
|
|
720
|
+
* If any items in other collections reference the removed items in reference or multi-reference fields, those fields are cleared.
|
|
721
|
+
*
|
|
722
|
+
* > **Note:** Once an item has been removed from a collection, it can't be restored.
|
|
723
|
+
*/
|
|
724
|
+
function bulkRemoveDataItems(payload) {
|
|
725
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_bulkRemoveDataItemsRequest, {});
|
|
726
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_bulkRemoveDataItemsResponse, {});
|
|
727
|
+
function __bulkRemoveDataItems({ host }) {
|
|
728
|
+
const serializedData = toReq(payload);
|
|
729
|
+
const metadata = {
|
|
730
|
+
entityFqdn: 'wix.data.v2.data_item',
|
|
731
|
+
method: 'POST',
|
|
732
|
+
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.BulkRemoveDataItems',
|
|
733
|
+
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
734
|
+
protoPath: '/v2/bulk/items/remove',
|
|
735
|
+
data: serializedData,
|
|
736
|
+
host,
|
|
737
|
+
}),
|
|
738
|
+
data: serializedData,
|
|
739
|
+
transformResponse: fromRes,
|
|
740
|
+
};
|
|
741
|
+
return metadata;
|
|
742
|
+
}
|
|
743
|
+
__bulkRemoveDataItems.fromReq = fromReq;
|
|
744
|
+
return __bulkRemoveDataItems;
|
|
745
|
+
}
|
|
746
|
+
exports.bulkRemoveDataItems = bulkRemoveDataItems;
|
|
747
|
+
/**
|
|
748
|
+
* Retrieves the full items referenced in the specified field of an item.
|
|
749
|
+
*
|
|
750
|
+
*
|
|
751
|
+
* Reference and multi-reference fields refer to items in different collections.
|
|
752
|
+
* Use this endpoint to retrieve the full details of the referenced items themselves.
|
|
753
|
+
*
|
|
754
|
+
* For example, suppose you have a **Movies** collection with an **Actors** field that contains references to items in a **People** collection.
|
|
755
|
+
* 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.
|
|
756
|
+
* This gives you information from the **People** collection about each of the actors in the specified movie.
|
|
757
|
+
*/
|
|
758
|
+
function queryReferencedDataItems(payload) {
|
|
759
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_queryReferencedDataItemsRequest, {});
|
|
760
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_queryReferencedDataItemsResponse, {});
|
|
761
|
+
function __queryReferencedDataItems({ host }) {
|
|
762
|
+
const serializedData = toReq(payload);
|
|
763
|
+
const metadata = {
|
|
764
|
+
entityFqdn: 'wix.data.v2.data_item',
|
|
765
|
+
method: 'POST',
|
|
766
|
+
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.QueryReferencedDataItems',
|
|
767
|
+
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
768
|
+
protoPath: '/v2/items/query-referenced',
|
|
769
|
+
data: serializedData,
|
|
770
|
+
host,
|
|
771
|
+
}),
|
|
772
|
+
data: serializedData,
|
|
773
|
+
transformResponse: fromRes,
|
|
774
|
+
};
|
|
775
|
+
return metadata;
|
|
776
|
+
}
|
|
777
|
+
__queryReferencedDataItems.fromReq = fromReq;
|
|
778
|
+
return __queryReferencedDataItems;
|
|
779
|
+
}
|
|
780
|
+
exports.queryReferencedDataItems = queryReferencedDataItems;
|
|
781
|
+
/** Checks whether a field in a referring item contains a reference to a specified item. */
|
|
782
|
+
function isReferencedDataItem(payload) {
|
|
783
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_isReferencedDataItemRequest, {});
|
|
784
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_isReferencedDataItemResponse, {});
|
|
785
|
+
function __isReferencedDataItem({ host }) {
|
|
786
|
+
const serializedData = toReq(payload);
|
|
787
|
+
const metadata = {
|
|
788
|
+
entityFqdn: 'wix.data.v2.data_item',
|
|
789
|
+
method: 'POST',
|
|
790
|
+
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.IsReferencedDataItem',
|
|
791
|
+
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
792
|
+
protoPath: '/v2/items/is-referenced',
|
|
793
|
+
data: serializedData,
|
|
794
|
+
host,
|
|
795
|
+
}),
|
|
796
|
+
data: serializedData,
|
|
797
|
+
transformResponse: fromRes,
|
|
798
|
+
};
|
|
799
|
+
return metadata;
|
|
800
|
+
}
|
|
801
|
+
__isReferencedDataItem.fromReq = fromReq;
|
|
802
|
+
return __isReferencedDataItem;
|
|
803
|
+
}
|
|
804
|
+
exports.isReferencedDataItem = isReferencedDataItem;
|
|
805
|
+
/**
|
|
806
|
+
* Inserts a reference in the specified field in an item in a collection.
|
|
807
|
+
*
|
|
808
|
+
*
|
|
809
|
+
* A reference in the `dataItemReference` field specifies a referring item's ID, the field in which to insert the reference, and the ID of the referenced item.
|
|
810
|
+
*/
|
|
811
|
+
function insertDataItemReference(payload) {
|
|
812
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_insertDataItemReferenceRequest, {});
|
|
813
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_insertDataItemReferenceResponse, {});
|
|
814
|
+
function __insertDataItemReference({ host }) {
|
|
815
|
+
const serializedData = toReq(payload);
|
|
816
|
+
const metadata = {
|
|
817
|
+
entityFqdn: 'wix.data.v2.data_item',
|
|
818
|
+
method: 'POST',
|
|
819
|
+
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.InsertDataItemReference',
|
|
820
|
+
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
821
|
+
protoPath: '/v2/items/insert-reference',
|
|
822
|
+
data: serializedData,
|
|
823
|
+
host,
|
|
824
|
+
}),
|
|
825
|
+
data: serializedData,
|
|
826
|
+
transformResponse: fromRes,
|
|
827
|
+
};
|
|
828
|
+
return metadata;
|
|
829
|
+
}
|
|
830
|
+
__insertDataItemReference.fromReq = fromReq;
|
|
831
|
+
return __insertDataItemReference;
|
|
832
|
+
}
|
|
833
|
+
exports.insertDataItemReference = insertDataItemReference;
|
|
834
|
+
/** Removes the specified reference from the specified field. */
|
|
835
|
+
function removeDataItemReference(payload) {
|
|
836
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_removeDataItemReferenceRequest, {});
|
|
837
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_removeDataItemReferenceResponse, {});
|
|
838
|
+
function __removeDataItemReference({ host }) {
|
|
839
|
+
const serializedData = toReq(payload);
|
|
840
|
+
const metadata = {
|
|
841
|
+
entityFqdn: 'wix.data.v2.data_item',
|
|
842
|
+
method: 'POST',
|
|
843
|
+
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.RemoveDataItemReference',
|
|
844
|
+
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
845
|
+
protoPath: '/v2/items/remove-reference',
|
|
846
|
+
data: serializedData,
|
|
847
|
+
host,
|
|
848
|
+
}),
|
|
849
|
+
data: serializedData,
|
|
850
|
+
transformResponse: fromRes,
|
|
851
|
+
};
|
|
852
|
+
return metadata;
|
|
853
|
+
}
|
|
854
|
+
__removeDataItemReference.fromReq = fromReq;
|
|
855
|
+
return __removeDataItemReference;
|
|
856
|
+
}
|
|
857
|
+
exports.removeDataItemReference = removeDataItemReference;
|
|
858
|
+
/**
|
|
859
|
+
* Inserts one or more references in the specified fields of items in a collection.
|
|
860
|
+
*
|
|
861
|
+
*
|
|
862
|
+
* This endpoint adds one or more references to a collection.
|
|
863
|
+
* Each new reference in the `dataItemReferences` field specifies a referring item's ID, the field in which to insert the reference, and the ID of the referenced item.
|
|
864
|
+
*/
|
|
865
|
+
function bulkInsertDataItemReferences(payload) {
|
|
866
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_bulkInsertDataItemReferencesRequest, {});
|
|
867
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_bulkInsertDataItemReferencesResponse, {});
|
|
868
|
+
function __bulkInsertDataItemReferences({ host }) {
|
|
869
|
+
const serializedData = toReq(payload);
|
|
870
|
+
const metadata = {
|
|
871
|
+
entityFqdn: 'wix.data.v2.data_item',
|
|
872
|
+
method: 'POST',
|
|
873
|
+
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.BulkInsertDataItemReferences',
|
|
874
|
+
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
875
|
+
protoPath: '/v2/bulk/items/insert-references',
|
|
876
|
+
data: serializedData,
|
|
877
|
+
host,
|
|
878
|
+
}),
|
|
879
|
+
data: serializedData,
|
|
880
|
+
transformResponse: fromRes,
|
|
881
|
+
};
|
|
882
|
+
return metadata;
|
|
883
|
+
}
|
|
884
|
+
__bulkInsertDataItemReferences.fromReq = fromReq;
|
|
885
|
+
return __bulkInsertDataItemReferences;
|
|
886
|
+
}
|
|
887
|
+
exports.bulkInsertDataItemReferences = bulkInsertDataItemReferences;
|
|
888
|
+
/** Removes one or more references. */
|
|
889
|
+
function bulkRemoveDataItemReferences(payload) {
|
|
890
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_bulkRemoveDataItemReferencesRequest, {});
|
|
891
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_bulkRemoveDataItemReferencesResponse, {});
|
|
892
|
+
function __bulkRemoveDataItemReferences({ host }) {
|
|
893
|
+
const serializedData = toReq(payload);
|
|
894
|
+
const metadata = {
|
|
895
|
+
entityFqdn: 'wix.data.v2.data_item',
|
|
896
|
+
method: 'POST',
|
|
897
|
+
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.BulkRemoveDataItemReferences',
|
|
898
|
+
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
899
|
+
protoPath: '/v2/bulk/items/remove-references',
|
|
900
|
+
data: serializedData,
|
|
901
|
+
host,
|
|
902
|
+
}),
|
|
903
|
+
data: serializedData,
|
|
904
|
+
transformResponse: fromRes,
|
|
905
|
+
};
|
|
906
|
+
return metadata;
|
|
907
|
+
}
|
|
908
|
+
__bulkRemoveDataItemReferences.fromReq = fromReq;
|
|
909
|
+
return __bulkRemoveDataItemReferences;
|
|
910
|
+
}
|
|
911
|
+
exports.bulkRemoveDataItemReferences = bulkRemoveDataItemReferences;
|
|
912
|
+
/**
|
|
913
|
+
* Replaces references in a specified field of a specified data item.
|
|
914
|
+
*
|
|
915
|
+
*
|
|
916
|
+
* This endpoint replaces the existing reference or references contained in the field specified in `referringItemFieldName` within the data item specified in `referringItemId`.
|
|
917
|
+
* The endpoint removes existing references and in their place it adds references to the items specified in `newReferencedItemIds`.
|
|
918
|
+
*
|
|
919
|
+
* > **Note:** If you pass an empty array in `newReferencedItemIds`, all existing references are removed.
|
|
920
|
+
*/
|
|
921
|
+
function replaceDataItemReferences(payload) {
|
|
922
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_replaceDataItemReferencesRequest, {});
|
|
923
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_replaceDataItemReferencesResponse, {});
|
|
924
|
+
function __replaceDataItemReferences({ host }) {
|
|
925
|
+
const serializedData = toReq(payload);
|
|
926
|
+
const metadata = {
|
|
927
|
+
entityFqdn: 'wix.data.v2.data_item',
|
|
928
|
+
method: 'POST',
|
|
929
|
+
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.ReplaceDataItemReferences',
|
|
930
|
+
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
931
|
+
protoPath: '/v2/items/replace-references',
|
|
932
|
+
data: serializedData,
|
|
933
|
+
host,
|
|
934
|
+
}),
|
|
935
|
+
data: serializedData,
|
|
936
|
+
transformResponse: fromRes,
|
|
937
|
+
};
|
|
938
|
+
return metadata;
|
|
939
|
+
}
|
|
940
|
+
__replaceDataItemReferences.fromReq = fromReq;
|
|
941
|
+
return __replaceDataItemReferences;
|
|
942
|
+
}
|
|
943
|
+
exports.replaceDataItemReferences = replaceDataItemReferences;
|
|
944
|
+
//# sourceMappingURL=data-v2-data-item.http.js.map
|