@wix/auto_sdk_data_collections 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-v2-data-collection-collections.context.d.ts +9 -0
  11. package/build/cjs/src/data-v2-data-collection-collections.context.js +38 -0
  12. package/build/cjs/src/data-v2-data-collection-collections.context.js.map +1 -0
  13. package/build/cjs/src/data-v2-data-collection-collections.http.d.ts +48 -0
  14. package/build/cjs/src/data-v2-data-collection-collections.http.js +704 -0
  15. package/build/cjs/src/data-v2-data-collection-collections.http.js.map +1 -0
  16. package/build/cjs/src/data-v2-data-collection-collections.meta.d.ts +27 -0
  17. package/build/cjs/src/data-v2-data-collection-collections.meta.js +199 -0
  18. package/build/cjs/src/data-v2-data-collection-collections.meta.js.map +1 -0
  19. package/build/cjs/src/data-v2-data-collection-collections.public.d.ts +69 -0
  20. package/build/cjs/src/data-v2-data-collection-collections.public.js +83 -0
  21. package/build/cjs/src/data-v2-data-collection-collections.public.js.map +1 -0
  22. package/build/cjs/src/data-v2-data-collection-collections.types.d.ts +1238 -0
  23. package/build/cjs/src/data-v2-data-collection-collections.types.js +235 -0
  24. package/build/cjs/src/data-v2-data-collection-collections.types.js.map +1 -0
  25. package/build/cjs/src/data-v2-data-collection-collections.universal.d.ts +1394 -0
  26. package/build/cjs/src/data-v2-data-collection-collections.universal.js +669 -0
  27. package/build/cjs/src/data-v2-data-collection-collections.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-v2-data-collection-collections.context.d.ts +9 -0
  39. package/build/es/src/data-v2-data-collection-collections.context.js +17 -0
  40. package/build/es/src/data-v2-data-collection-collections.context.js.map +1 -0
  41. package/build/es/src/data-v2-data-collection-collections.http.d.ts +48 -0
  42. package/build/es/src/data-v2-data-collection-collections.http.js +692 -0
  43. package/build/es/src/data-v2-data-collection-collections.http.js.map +1 -0
  44. package/build/es/src/data-v2-data-collection-collections.meta.d.ts +27 -0
  45. package/build/es/src/data-v2-data-collection-collections.meta.js +164 -0
  46. package/build/es/src/data-v2-data-collection-collections.meta.js.map +1 -0
  47. package/build/es/src/data-v2-data-collection-collections.public.d.ts +69 -0
  48. package/build/es/src/data-v2-data-collection-collections.public.js +53 -0
  49. package/build/es/src/data-v2-data-collection-collections.public.js.map +1 -0
  50. package/build/es/src/data-v2-data-collection-collections.types.d.ts +1238 -0
  51. package/build/es/src/data-v2-data-collection-collections.types.js +232 -0
  52. package/build/es/src/data-v2-data-collection-collections.types.js.map +1 -0
  53. package/build/es/src/data-v2-data-collection-collections.universal.d.ts +1394 -0
  54. package/build/es/src/data-v2-data-collection-collections.universal.js +634 -0
  55. package/build/es/src/data-v2-data-collection-collections.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-v2-data-collection-collections.context.d.ts +17 -0
  66. package/build/internal/cjs/src/data-v2-data-collection-collections.context.js +38 -0
  67. package/build/internal/cjs/src/data-v2-data-collection-collections.context.js.map +1 -0
  68. package/build/internal/cjs/src/data-v2-data-collection-collections.http.d.ts +48 -0
  69. package/build/internal/cjs/src/data-v2-data-collection-collections.http.js +704 -0
  70. package/build/internal/cjs/src/data-v2-data-collection-collections.http.js.map +1 -0
  71. package/build/internal/cjs/src/data-v2-data-collection-collections.meta.d.ts +27 -0
  72. package/build/internal/cjs/src/data-v2-data-collection-collections.meta.js +199 -0
  73. package/build/internal/cjs/src/data-v2-data-collection-collections.meta.js.map +1 -0
  74. package/build/internal/cjs/src/data-v2-data-collection-collections.public.d.ts +107 -0
  75. package/build/internal/cjs/src/data-v2-data-collection-collections.public.js +83 -0
  76. package/build/internal/cjs/src/data-v2-data-collection-collections.public.js.map +1 -0
  77. package/build/internal/cjs/src/data-v2-data-collection-collections.types.d.ts +1254 -0
  78. package/build/internal/cjs/src/data-v2-data-collection-collections.types.js +235 -0
  79. package/build/internal/cjs/src/data-v2-data-collection-collections.types.js.map +1 -0
  80. package/build/internal/cjs/src/data-v2-data-collection-collections.universal.d.ts +1504 -0
  81. package/build/internal/cjs/src/data-v2-data-collection-collections.universal.js +669 -0
  82. package/build/internal/cjs/src/data-v2-data-collection-collections.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-v2-data-collection-collections.context.d.ts +17 -0
  93. package/build/internal/es/src/data-v2-data-collection-collections.context.js +17 -0
  94. package/build/internal/es/src/data-v2-data-collection-collections.context.js.map +1 -0
  95. package/build/internal/es/src/data-v2-data-collection-collections.http.d.ts +48 -0
  96. package/build/internal/es/src/data-v2-data-collection-collections.http.js +692 -0
  97. package/build/internal/es/src/data-v2-data-collection-collections.http.js.map +1 -0
  98. package/build/internal/es/src/data-v2-data-collection-collections.meta.d.ts +27 -0
  99. package/build/internal/es/src/data-v2-data-collection-collections.meta.js +164 -0
  100. package/build/internal/es/src/data-v2-data-collection-collections.meta.js.map +1 -0
  101. package/build/internal/es/src/data-v2-data-collection-collections.public.d.ts +107 -0
  102. package/build/internal/es/src/data-v2-data-collection-collections.public.js +53 -0
  103. package/build/internal/es/src/data-v2-data-collection-collections.public.js.map +1 -0
  104. package/build/internal/es/src/data-v2-data-collection-collections.types.d.ts +1254 -0
  105. package/build/internal/es/src/data-v2-data-collection-collections.types.js +232 -0
  106. package/build/internal/es/src/data-v2-data-collection-collections.types.js.map +1 -0
  107. package/build/internal/es/src/data-v2-data-collection-collections.universal.d.ts +1504 -0
  108. package/build/internal/es/src/data-v2-data-collection-collections.universal.js +634 -0
  109. package/build/internal/es/src/data-v2-data-collection-collections.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,704 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteDataCollectionField = exports.updateDataCollectionField = exports.createDataCollectionField = exports.restoreDataCollection = exports.deleteDataCollection = exports.updateDataCollection = exports.listDataCollections = exports.getDataCollection = exports.createDataCollection = void 0;
4
+ const rest_modules_1 = require("@wix/sdk-runtime/rest-modules");
5
+ const float_1 = require("@wix/sdk-runtime/transformations/float");
6
+ const float_2 = require("@wix/sdk-runtime/transformations/float");
7
+ const timestamp_1 = require("@wix/sdk-runtime/transformations/timestamp");
8
+ const timestamp_2 = require("@wix/sdk-runtime/transformations/timestamp");
9
+ const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
10
+ const rest_modules_2 = require("@wix/sdk-runtime/rest-modules");
11
+ function resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl(opts) {
12
+ const domainToMappings = {
13
+ 'api._api_base_domain_': [
14
+ {
15
+ srcPath: '/cloud-data',
16
+ destPath: '',
17
+ },
18
+ ],
19
+ 'code._base_domain_': [
20
+ {
21
+ srcPath: '/_api/cloud-data/v1/data-settings',
22
+ destPath: '/v1/data-settings',
23
+ },
24
+ {
25
+ srcPath: '/_api/cloud-data/v1/schemas',
26
+ destPath: '/v1/schemas',
27
+ },
28
+ {
29
+ srcPath: '/_api/cloud-data/v1/connector',
30
+ destPath: '/v1/connector',
31
+ },
32
+ {
33
+ srcPath: '/_api/data/v1/data-settings',
34
+ destPath: '/v1/data-settings',
35
+ },
36
+ {
37
+ srcPath: '/_api/data/v1/schemas',
38
+ destPath: '/v1/schemas',
39
+ },
40
+ {
41
+ srcPath: '/_api/data/v1/connector',
42
+ destPath: '/v1/connector',
43
+ },
44
+ {
45
+ srcPath: '/_api/cloud-data/v1/wix-data',
46
+ destPath: '/v1/wix-data',
47
+ },
48
+ ],
49
+ 'cloud-data.wix-code.com': [
50
+ {
51
+ srcPath: '',
52
+ destPath: '',
53
+ },
54
+ ],
55
+ _: [
56
+ {
57
+ srcPath: '/_api/cloud-data',
58
+ destPath: '',
59
+ },
60
+ ],
61
+ 'www._base_domain_': [
62
+ {
63
+ srcPath: '/_api/cloud-data',
64
+ destPath: '',
65
+ },
66
+ {
67
+ srcPath: '/_api/data',
68
+ destPath: '',
69
+ },
70
+ {
71
+ srcPath: '/_api/cloud-data',
72
+ destPath: '',
73
+ },
74
+ ],
75
+ 'dev._base_domain_': [
76
+ {
77
+ srcPath: '/_api/cloud-data',
78
+ destPath: '',
79
+ },
80
+ ],
81
+ 'bo._base_domain_': [
82
+ {
83
+ srcPath: '/_api/cloud-data/v1',
84
+ destPath: '/v1',
85
+ },
86
+ {
87
+ srcPath: '/_api/cloud-data/v2',
88
+ destPath: '/v2',
89
+ },
90
+ ],
91
+ 'wixbo.ai': [
92
+ {
93
+ srcPath: '/_api/cloud-data/v1',
94
+ destPath: '/v1',
95
+ },
96
+ {
97
+ srcPath: '/_api/cloud-data/v2',
98
+ destPath: '/v2',
99
+ },
100
+ ],
101
+ 'wix-bo.com': [
102
+ {
103
+ srcPath: '/_api/cloud-data/v1',
104
+ destPath: '/v1',
105
+ },
106
+ {
107
+ srcPath: '/_api/cloud-data/v2',
108
+ destPath: '/v2',
109
+ },
110
+ ],
111
+ 'manage._base_domain_': [
112
+ {
113
+ srcPath: '/_api/cloud-data',
114
+ destPath: '',
115
+ },
116
+ {
117
+ srcPath: '/_api/data',
118
+ destPath: '',
119
+ },
120
+ {
121
+ srcPath: '/_api/cloud-data',
122
+ destPath: '',
123
+ },
124
+ ],
125
+ 'editor._base_domain_': [
126
+ {
127
+ srcPath: '/_api/cloud-data/v1/schemas',
128
+ destPath: '/v1/schemas',
129
+ },
130
+ {
131
+ srcPath: '/_api/cloud-data/dbs/tasks',
132
+ destPath: '/dbs/tasks',
133
+ },
134
+ {
135
+ srcPath: '/_api/data/v1/schemas',
136
+ destPath: '/v1/schemas',
137
+ },
138
+ {
139
+ srcPath: '/_api/data/dbs/tasks',
140
+ destPath: '/dbs/tasks',
141
+ },
142
+ {
143
+ srcPath: '/_api/cloud-data/v1/wix-data',
144
+ destPath: '/v1/wix-data',
145
+ },
146
+ {
147
+ srcPath: '/_api/cloud-data/v1/data-settings',
148
+ destPath: '/v1/data-settings',
149
+ },
150
+ {
151
+ srcPath: '/_api/data/v2/indexes',
152
+ destPath: '/v2/indexes',
153
+ },
154
+ {
155
+ srcPath: '/_api/cloud-data/v1/external-database-connections',
156
+ destPath: '/v1/external-database-connections',
157
+ },
158
+ {
159
+ srcPath: '/_api/data/v1/data-collection-sharing',
160
+ destPath: '/v1/data-collection-sharing',
161
+ },
162
+ {
163
+ srcPath: '/_api/cloud-data/v2/collections',
164
+ destPath: '/v2/collections',
165
+ },
166
+ {
167
+ srcPath: '/_api/cloud-data/v2/bulk',
168
+ destPath: '/v2/bulk',
169
+ },
170
+ {
171
+ srcPath: '/_api/cloud-data/v2/items',
172
+ destPath: '/v2/items',
173
+ },
174
+ {
175
+ srcPath: '/_api/cloud-data/v2/dbs/tasks',
176
+ destPath: '/v2/dbs/tasks',
177
+ },
178
+ ],
179
+ 'blocks._base_domain_': [
180
+ {
181
+ srcPath: '/_api/cloud-data/v1/schemas',
182
+ destPath: '/v1/schemas',
183
+ },
184
+ {
185
+ srcPath: '/_api/cloud-data/dbs/tasks',
186
+ destPath: '/dbs/tasks',
187
+ },
188
+ {
189
+ srcPath: '/_api/data/v1/schemas',
190
+ destPath: '/v1/schemas',
191
+ },
192
+ {
193
+ srcPath: '/_api/data/dbs/tasks',
194
+ destPath: '/dbs/tasks',
195
+ },
196
+ {
197
+ srcPath: '/_api/cloud-data/v1/wix-data',
198
+ destPath: '/v1/wix-data',
199
+ },
200
+ {
201
+ srcPath: '/_api/cloud-data/v1/data-settings',
202
+ destPath: '/v1/data-settings',
203
+ },
204
+ {
205
+ srcPath: '/_api/data/v2/indexes',
206
+ destPath: '/v2/indexes',
207
+ },
208
+ {
209
+ srcPath: '/_api/cloud-data/v1/external-database-connections',
210
+ destPath: '/v1/external-database-connections',
211
+ },
212
+ {
213
+ srcPath: '/_api/data/v1/data-collection-sharing',
214
+ destPath: '/v1/data-collection-sharing',
215
+ },
216
+ {
217
+ srcPath: '/_api/cloud-data/v2/collections',
218
+ destPath: '/v2/collections',
219
+ },
220
+ {
221
+ srcPath: '/_api/cloud-data/v2/bulk',
222
+ destPath: '/v2/bulk',
223
+ },
224
+ {
225
+ srcPath: '/_api/cloud-data/v2/items',
226
+ destPath: '/v2/items',
227
+ },
228
+ {
229
+ srcPath: '/_api/cloud-data/v2/dbs/tasks',
230
+ destPath: '/v2/dbs/tasks',
231
+ },
232
+ ],
233
+ 'create.editorx': [
234
+ {
235
+ srcPath: '/_api/cloud-data/v1/schemas',
236
+ destPath: '/v1/schemas',
237
+ },
238
+ {
239
+ srcPath: '/_api/cloud-data/dbs/tasks',
240
+ destPath: '/dbs/tasks',
241
+ },
242
+ {
243
+ srcPath: '/_api/data/v1/schemas',
244
+ destPath: '/v1/schemas',
245
+ },
246
+ {
247
+ srcPath: '/_api/data/dbs/tasks',
248
+ destPath: '/dbs/tasks',
249
+ },
250
+ {
251
+ srcPath: '/_api/cloud-data/v1/wix-data',
252
+ destPath: '/v1/wix-data',
253
+ },
254
+ {
255
+ srcPath: '/_api/cloud-data/v1/data-settings',
256
+ destPath: '/v1/data-settings',
257
+ },
258
+ {
259
+ srcPath: '/_api/data/v2/indexes',
260
+ destPath: '/v2/indexes',
261
+ },
262
+ {
263
+ srcPath: '/_api/cloud-data/v1/external-database-connections',
264
+ destPath: '/v1/external-database-connections',
265
+ },
266
+ {
267
+ srcPath: '/_api/data/v1/data-collection-sharing',
268
+ destPath: '/v1/data-collection-sharing',
269
+ },
270
+ {
271
+ srcPath: '/_api/cloud-data/v2/collections',
272
+ destPath: '/v2/collections',
273
+ },
274
+ {
275
+ srcPath: '/_api/cloud-data/v2/bulk',
276
+ destPath: '/v2/bulk',
277
+ },
278
+ {
279
+ srcPath: '/_api/cloud-data/v2/items',
280
+ destPath: '/v2/items',
281
+ },
282
+ {
283
+ srcPath: '/_api/cloud-data/v2/dbs/tasks',
284
+ destPath: '/v2/dbs/tasks',
285
+ },
286
+ ],
287
+ 'www.wixapis.com': [
288
+ {
289
+ srcPath: '/wix-data/v1/collections',
290
+ destPath: '/v1/wix-data/collections',
291
+ },
292
+ {
293
+ srcPath: '/wix-data/v1/external-database-connections',
294
+ destPath: '/v1/external-database-connections',
295
+ },
296
+ {
297
+ srcPath: '/wix-data/v2/indexes',
298
+ destPath: '/v2/indexes',
299
+ },
300
+ {
301
+ srcPath: '/wix-data/v1/items',
302
+ destPath: '/v1/items',
303
+ },
304
+ {
305
+ srcPath: '/wix-data/v1/bulk',
306
+ destPath: '/v1/bulk',
307
+ },
308
+ {
309
+ srcPath: '/wix-data/v1/external-databases',
310
+ destPath: '/v1/external-databases',
311
+ },
312
+ {
313
+ srcPath: '/wix-data/v2',
314
+ destPath: '/v2',
315
+ },
316
+ ],
317
+ 'www.wixgateway.com': [
318
+ {
319
+ srcPath: '/wix-data/v1/items',
320
+ destPath: '/v1/items',
321
+ },
322
+ {
323
+ srcPath: '/wix-data/v1/bulk',
324
+ destPath: '/v1/bulk',
325
+ },
326
+ ],
327
+ '*.dev.wix-code.com': [
328
+ {
329
+ srcPath: '/_api/cloud-data/v2',
330
+ destPath: '/v2',
331
+ },
332
+ ],
333
+ };
334
+ return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
335
+ }
336
+ const PACKAGE_NAME = '@wix/auto_sdk_data_collections';
337
+ /**
338
+ * Creates a new data collection.
339
+ *
340
+ * The request body must include an ID, details for at least 1 field, and a permissions object. If any of these are missing, the collection isn't created.
341
+ */
342
+ function createDataCollection(payload) {
343
+ function __createDataCollection({ host }) {
344
+ const serializedData = (0, transform_paths_1.transformPaths)(payload, [
345
+ {
346
+ transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
347
+ paths: [
348
+ { path: 'collection.createdDate' },
349
+ { path: 'collection.updatedDate' },
350
+ ],
351
+ },
352
+ {
353
+ transformFn: float_1.transformSDKFloatToRESTFloat,
354
+ paths: [
355
+ { path: 'collection.fields.numberRange.min' },
356
+ { path: 'collection.fields.numberRange.max' },
357
+ ],
358
+ },
359
+ ]);
360
+ const metadata = {
361
+ entityFqdn: 'wix.data.v2.data_collection',
362
+ method: 'POST',
363
+ methodFqn: 'com.wixpress.cloud.data.api.collectionservice.DataCollectionService.CreateDataCollection',
364
+ packageName: PACKAGE_NAME,
365
+ url: resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl({ protoPath: '/v2/collections', data: serializedData, host }),
366
+ data: serializedData,
367
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
368
+ {
369
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
370
+ paths: [
371
+ { path: 'collection.createdDate' },
372
+ { path: 'collection.updatedDate' },
373
+ ],
374
+ },
375
+ {
376
+ transformFn: float_2.transformRESTFloatToSDKFloat,
377
+ paths: [
378
+ { path: 'collection.fields.numberRange.min' },
379
+ { path: 'collection.fields.numberRange.max' },
380
+ ],
381
+ },
382
+ ]),
383
+ };
384
+ return metadata;
385
+ }
386
+ return __createDataCollection;
387
+ }
388
+ exports.createDataCollection = createDataCollection;
389
+ /** Retrieves a data collection by ID. */
390
+ function getDataCollection(payload) {
391
+ function __getDataCollection({ host }) {
392
+ const metadata = {
393
+ entityFqdn: 'wix.data.v2.data_collection',
394
+ method: 'GET',
395
+ methodFqn: 'com.wixpress.cloud.data.api.collectionservice.DataCollectionService.GetDataCollection',
396
+ packageName: PACKAGE_NAME,
397
+ url: resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl({ protoPath: '/v2/collections/{dataCollectionId}', data: payload, host }),
398
+ params: (0, rest_modules_1.toURLSearchParams)(payload),
399
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
400
+ {
401
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
402
+ paths: [
403
+ { path: 'collection.createdDate' },
404
+ { path: 'collection.updatedDate' },
405
+ { path: 'referencedCollections.createdDate' },
406
+ { path: 'referencedCollections.updatedDate' },
407
+ ],
408
+ },
409
+ {
410
+ transformFn: float_2.transformRESTFloatToSDKFloat,
411
+ paths: [
412
+ { path: 'collection.fields.numberRange.min' },
413
+ { path: 'collection.fields.numberRange.max' },
414
+ { path: 'referencedCollections.fields.numberRange.min' },
415
+ { path: 'referencedCollections.fields.numberRange.max' },
416
+ ],
417
+ },
418
+ ]),
419
+ };
420
+ return metadata;
421
+ }
422
+ return __getDataCollection;
423
+ }
424
+ exports.getDataCollection = getDataCollection;
425
+ /**
426
+ * Retrieves a list of all data collections associated with the site or project.
427
+ *
428
+ * By default, the list is ordered by ID in ascending order.
429
+ */
430
+ function listDataCollections(payload) {
431
+ function __listDataCollections({ host }) {
432
+ const metadata = {
433
+ entityFqdn: 'wix.data.v2.data_collection',
434
+ method: 'GET',
435
+ methodFqn: 'com.wixpress.cloud.data.api.collectionservice.DataCollectionService.ListDataCollections',
436
+ packageName: PACKAGE_NAME,
437
+ url: resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl({ protoPath: '/v2/collections', data: payload, host }),
438
+ params: (0, rest_modules_1.toURLSearchParams)(payload),
439
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
440
+ {
441
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
442
+ paths: [
443
+ { path: 'collections.createdDate' },
444
+ { path: 'collections.updatedDate' },
445
+ ],
446
+ },
447
+ {
448
+ transformFn: float_2.transformRESTFloatToSDKFloat,
449
+ paths: [
450
+ { path: 'collections.fields.numberRange.min' },
451
+ { path: 'collections.fields.numberRange.max' },
452
+ ],
453
+ },
454
+ ]),
455
+ };
456
+ return metadata;
457
+ }
458
+ return __listDataCollections;
459
+ }
460
+ exports.listDataCollections = listDataCollections;
461
+ /**
462
+ * Updates a data collection.
463
+ *
464
+ * A collection ID, revision number, permissions, and at least 1 field must be provided within the `collection` body parameter.
465
+ * If a collection with that ID exists, and if its current `revision` number matches the one provided, it is updated.
466
+ * Otherwise, the request fails.
467
+ *
468
+ * When a collection is updated, its `updatedDate` property is changed to the current date and its `revision` property is incremented.
469
+ *
470
+ * > **Note:**
471
+ * > After a collection is updated, it only contains the properties included in the Update Data Collection request. If the existing collection has properties with values and those properties
472
+ * > aren't included in the updated collection details, their values are lost.
473
+ */
474
+ function updateDataCollection(payload) {
475
+ function __updateDataCollection({ host }) {
476
+ const serializedData = (0, transform_paths_1.transformPaths)(payload, [
477
+ {
478
+ transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
479
+ paths: [
480
+ { path: 'collection.createdDate' },
481
+ { path: 'collection.updatedDate' },
482
+ ],
483
+ },
484
+ {
485
+ transformFn: float_1.transformSDKFloatToRESTFloat,
486
+ paths: [
487
+ { path: 'collection.fields.numberRange.min' },
488
+ { path: 'collection.fields.numberRange.max' },
489
+ ],
490
+ },
491
+ ]);
492
+ const metadata = {
493
+ entityFqdn: 'wix.data.v2.data_collection',
494
+ method: 'PUT',
495
+ methodFqn: 'com.wixpress.cloud.data.api.collectionservice.DataCollectionService.UpdateDataCollection',
496
+ packageName: PACKAGE_NAME,
497
+ url: resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl({ protoPath: '/v2/collections', data: serializedData, host }),
498
+ data: serializedData,
499
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
500
+ {
501
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
502
+ paths: [
503
+ { path: 'collection.createdDate' },
504
+ { path: 'collection.updatedDate' },
505
+ ],
506
+ },
507
+ {
508
+ transformFn: float_2.transformRESTFloatToSDKFloat,
509
+ paths: [
510
+ { path: 'collection.fields.numberRange.min' },
511
+ { path: 'collection.fields.numberRange.max' },
512
+ ],
513
+ },
514
+ ]),
515
+ };
516
+ return metadata;
517
+ }
518
+ return __updateDataCollection;
519
+ }
520
+ exports.updateDataCollection = updateDataCollection;
521
+ /**
522
+ * Deletes a data collection.
523
+ *
524
+ * > **Note:**
525
+ * > Once a collection is deleted, it can only be restored for limited amount of time.
526
+ */
527
+ function deleteDataCollection(payload) {
528
+ function __deleteDataCollection({ host }) {
529
+ const metadata = {
530
+ entityFqdn: 'wix.data.v2.data_collection',
531
+ method: 'DELETE',
532
+ methodFqn: 'com.wixpress.cloud.data.api.collectionservice.DataCollectionService.DeleteDataCollection',
533
+ packageName: PACKAGE_NAME,
534
+ url: resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl({ protoPath: '/v2/collections/{dataCollectionId}', data: payload, host }),
535
+ params: (0, rest_modules_1.toURLSearchParams)(payload),
536
+ };
537
+ return metadata;
538
+ }
539
+ return __deleteDataCollection;
540
+ }
541
+ exports.deleteDataCollection = deleteDataCollection;
542
+ /**
543
+ * Restores recently deleted collection.
544
+ *
545
+ * Fails with `WDE0025` if collection was deleted too long ago or has never existed.
546
+ */
547
+ function restoreDataCollection(payload) {
548
+ function __restoreDataCollection({ host }) {
549
+ const metadata = {
550
+ entityFqdn: 'wix.data.v2.data_collection',
551
+ method: 'POST',
552
+ methodFqn: 'com.wixpress.cloud.data.api.collectionservice.DataCollectionService.RestoreDataCollection',
553
+ packageName: PACKAGE_NAME,
554
+ url: resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl({
555
+ protoPath: '/v2/collections/restore/{dataCollectionId}',
556
+ data: payload,
557
+ host,
558
+ }),
559
+ data: payload,
560
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
561
+ {
562
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
563
+ paths: [
564
+ { path: 'dataCollection.createdDate' },
565
+ { path: 'dataCollection.updatedDate' },
566
+ ],
567
+ },
568
+ {
569
+ transformFn: float_2.transformRESTFloatToSDKFloat,
570
+ paths: [
571
+ { path: 'dataCollection.fields.numberRange.min' },
572
+ { path: 'dataCollection.fields.numberRange.max' },
573
+ ],
574
+ },
575
+ ]),
576
+ };
577
+ return metadata;
578
+ }
579
+ return __restoreDataCollection;
580
+ }
581
+ exports.restoreDataCollection = restoreDataCollection;
582
+ /** Adds new field to data collection schema */
583
+ function createDataCollectionField(payload) {
584
+ function __createDataCollectionField({ host }) {
585
+ const serializedData = (0, transform_paths_1.transformPaths)(payload, [
586
+ {
587
+ transformFn: float_1.transformSDKFloatToRESTFloat,
588
+ paths: [
589
+ { path: 'field.numberRange.min' },
590
+ { path: 'field.numberRange.max' },
591
+ ],
592
+ },
593
+ ]);
594
+ const metadata = {
595
+ entityFqdn: 'wix.data.v2.data_collection',
596
+ method: 'POST',
597
+ methodFqn: 'com.wixpress.cloud.data.api.collectionservice.DataCollectionService.CreateDataCollectionField',
598
+ packageName: PACKAGE_NAME,
599
+ url: resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl({
600
+ protoPath: '/v2/collections/create-field',
601
+ data: serializedData,
602
+ host,
603
+ }),
604
+ data: serializedData,
605
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
606
+ {
607
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
608
+ paths: [
609
+ { path: 'dataCollection.createdDate' },
610
+ { path: 'dataCollection.updatedDate' },
611
+ ],
612
+ },
613
+ {
614
+ transformFn: float_2.transformRESTFloatToSDKFloat,
615
+ paths: [
616
+ { path: 'dataCollection.fields.numberRange.min' },
617
+ { path: 'dataCollection.fields.numberRange.max' },
618
+ ],
619
+ },
620
+ ]),
621
+ };
622
+ return metadata;
623
+ }
624
+ return __createDataCollectionField;
625
+ }
626
+ exports.createDataCollectionField = createDataCollectionField;
627
+ /** Updates data collection field */
628
+ function updateDataCollectionField(payload) {
629
+ function __updateDataCollectionField({ host }) {
630
+ const serializedData = (0, transform_paths_1.transformPaths)(payload, [
631
+ {
632
+ transformFn: float_1.transformSDKFloatToRESTFloat,
633
+ paths: [
634
+ { path: 'field.numberRange.min' },
635
+ { path: 'field.numberRange.max' },
636
+ ],
637
+ },
638
+ ]);
639
+ const metadata = {
640
+ entityFqdn: 'wix.data.v2.data_collection',
641
+ method: 'POST',
642
+ methodFqn: 'com.wixpress.cloud.data.api.collectionservice.DataCollectionService.UpdateDataCollectionField',
643
+ packageName: PACKAGE_NAME,
644
+ url: resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl({
645
+ protoPath: '/v2/collections/update-field',
646
+ data: serializedData,
647
+ host,
648
+ }),
649
+ data: serializedData,
650
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
651
+ {
652
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
653
+ paths: [
654
+ { path: 'dataCollection.createdDate' },
655
+ { path: 'dataCollection.updatedDate' },
656
+ ],
657
+ },
658
+ {
659
+ transformFn: float_2.transformRESTFloatToSDKFloat,
660
+ paths: [
661
+ { path: 'dataCollection.fields.numberRange.min' },
662
+ { path: 'dataCollection.fields.numberRange.max' },
663
+ ],
664
+ },
665
+ ]),
666
+ };
667
+ return metadata;
668
+ }
669
+ return __updateDataCollectionField;
670
+ }
671
+ exports.updateDataCollectionField = updateDataCollectionField;
672
+ /** Deletes data collection field */
673
+ function deleteDataCollectionField(payload) {
674
+ function __deleteDataCollectionField({ host }) {
675
+ const metadata = {
676
+ entityFqdn: 'wix.data.v2.data_collection',
677
+ method: 'POST',
678
+ methodFqn: 'com.wixpress.cloud.data.api.collectionservice.DataCollectionService.DeleteDataCollectionField',
679
+ packageName: PACKAGE_NAME,
680
+ url: resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl({ protoPath: '/v2/collections/delete-field', data: payload, host }),
681
+ data: payload,
682
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
683
+ {
684
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
685
+ paths: [
686
+ { path: 'dataCollection.createdDate' },
687
+ { path: 'dataCollection.updatedDate' },
688
+ ],
689
+ },
690
+ {
691
+ transformFn: float_2.transformRESTFloatToSDKFloat,
692
+ paths: [
693
+ { path: 'dataCollection.fields.numberRange.min' },
694
+ { path: 'dataCollection.fields.numberRange.max' },
695
+ ],
696
+ },
697
+ ]),
698
+ };
699
+ return metadata;
700
+ }
701
+ return __deleteDataCollectionField;
702
+ }
703
+ exports.deleteDataCollectionField = deleteDataCollectionField;
704
+ //# sourceMappingURL=data-v2-data-collection-collections.http.js.map