@wix/auto_sdk_data_collections 1.0.11 → 1.0.12

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 (134) hide show
  1. package/build/{es/src/data-v2-data-collection-collections.types.d.ts → data-v2-data-collection-collections.universal-DFG8hhGA.d.mts} +199 -144
  2. package/build/{cjs/src/data-v2-data-collection-collections.types.d.ts → data-v2-data-collection-collections.universal-DFG8hhGA.d.ts} +199 -144
  3. package/build/index.d.mts +75 -0
  4. package/build/index.d.ts +75 -0
  5. package/build/index.js +1278 -0
  6. package/build/index.js.map +1 -0
  7. package/build/index.mjs +1227 -0
  8. package/build/index.mjs.map +1 -0
  9. package/build/internal/{cjs/src/data-v2-data-collection-collections.types.d.ts → data-v2-data-collection-collections.universal-DZ3_N2Cv.d.mts} +230 -144
  10. package/build/internal/{es/src/data-v2-data-collection-collections.types.d.ts → data-v2-data-collection-collections.universal-DZ3_N2Cv.d.ts} +230 -144
  11. package/build/internal/index.d.mts +121 -0
  12. package/build/internal/index.d.ts +121 -0
  13. package/build/internal/index.js +1278 -0
  14. package/build/internal/index.js.map +1 -0
  15. package/build/internal/index.mjs +1227 -0
  16. package/build/internal/index.mjs.map +1 -0
  17. package/build/internal/meta.d.mts +882 -0
  18. package/build/internal/meta.d.ts +882 -0
  19. package/build/internal/meta.js +883 -0
  20. package/build/internal/meta.js.map +1 -0
  21. package/build/internal/meta.mjs +848 -0
  22. package/build/internal/meta.mjs.map +1 -0
  23. package/build/meta.d.mts +882 -0
  24. package/build/meta.d.ts +882 -0
  25. package/build/meta.js +883 -0
  26. package/build/meta.js.map +1 -0
  27. package/build/meta.mjs +848 -0
  28. package/build/meta.mjs.map +1 -0
  29. package/package.json +12 -11
  30. package/build/cjs/index.d.ts +0 -1
  31. package/build/cjs/index.js +0 -18
  32. package/build/cjs/index.js.map +0 -1
  33. package/build/cjs/index.typings.d.ts +0 -1
  34. package/build/cjs/index.typings.js +0 -18
  35. package/build/cjs/index.typings.js.map +0 -1
  36. package/build/cjs/meta.d.ts +0 -1
  37. package/build/cjs/meta.js +0 -18
  38. package/build/cjs/meta.js.map +0 -1
  39. package/build/cjs/src/data-v2-data-collection-collections.context.d.ts +0 -9
  40. package/build/cjs/src/data-v2-data-collection-collections.context.js +0 -39
  41. package/build/cjs/src/data-v2-data-collection-collections.context.js.map +0 -1
  42. package/build/cjs/src/data-v2-data-collection-collections.http.d.ts +0 -48
  43. package/build/cjs/src/data-v2-data-collection-collections.http.js +0 -704
  44. package/build/cjs/src/data-v2-data-collection-collections.http.js.map +0 -1
  45. package/build/cjs/src/data-v2-data-collection-collections.meta.d.ts +0 -27
  46. package/build/cjs/src/data-v2-data-collection-collections.meta.js +0 -199
  47. package/build/cjs/src/data-v2-data-collection-collections.meta.js.map +0 -1
  48. package/build/cjs/src/data-v2-data-collection-collections.public.d.ts +0 -69
  49. package/build/cjs/src/data-v2-data-collection-collections.public.js +0 -84
  50. package/build/cjs/src/data-v2-data-collection-collections.public.js.map +0 -1
  51. package/build/cjs/src/data-v2-data-collection-collections.types.js +0 -270
  52. package/build/cjs/src/data-v2-data-collection-collections.types.js.map +0 -1
  53. package/build/cjs/src/data-v2-data-collection-collections.universal.d.ts +0 -1572
  54. package/build/cjs/src/data-v2-data-collection-collections.universal.js +0 -704
  55. package/build/cjs/src/data-v2-data-collection-collections.universal.js.map +0 -1
  56. package/build/es/index.d.ts +0 -1
  57. package/build/es/index.js +0 -2
  58. package/build/es/index.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -1
  60. package/build/es/index.typings.js +0 -2
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/meta.d.ts +0 -1
  63. package/build/es/meta.js +0 -2
  64. package/build/es/meta.js.map +0 -1
  65. package/build/es/package.json +0 -3
  66. package/build/es/src/data-v2-data-collection-collections.context.d.ts +0 -9
  67. package/build/es/src/data-v2-data-collection-collections.context.js +0 -17
  68. package/build/es/src/data-v2-data-collection-collections.context.js.map +0 -1
  69. package/build/es/src/data-v2-data-collection-collections.http.d.ts +0 -48
  70. package/build/es/src/data-v2-data-collection-collections.http.js +0 -692
  71. package/build/es/src/data-v2-data-collection-collections.http.js.map +0 -1
  72. package/build/es/src/data-v2-data-collection-collections.meta.d.ts +0 -27
  73. package/build/es/src/data-v2-data-collection-collections.meta.js +0 -164
  74. package/build/es/src/data-v2-data-collection-collections.meta.js.map +0 -1
  75. package/build/es/src/data-v2-data-collection-collections.public.d.ts +0 -69
  76. package/build/es/src/data-v2-data-collection-collections.public.js +0 -53
  77. package/build/es/src/data-v2-data-collection-collections.public.js.map +0 -1
  78. package/build/es/src/data-v2-data-collection-collections.types.js +0 -267
  79. package/build/es/src/data-v2-data-collection-collections.types.js.map +0 -1
  80. package/build/es/src/data-v2-data-collection-collections.universal.d.ts +0 -1572
  81. package/build/es/src/data-v2-data-collection-collections.universal.js +0 -669
  82. package/build/es/src/data-v2-data-collection-collections.universal.js.map +0 -1
  83. package/build/internal/cjs/index.d.ts +0 -1
  84. package/build/internal/cjs/index.js +0 -18
  85. package/build/internal/cjs/index.js.map +0 -1
  86. package/build/internal/cjs/index.typings.d.ts +0 -1
  87. package/build/internal/cjs/index.typings.js +0 -18
  88. package/build/internal/cjs/index.typings.js.map +0 -1
  89. package/build/internal/cjs/meta.d.ts +0 -1
  90. package/build/internal/cjs/meta.js +0 -18
  91. package/build/internal/cjs/meta.js.map +0 -1
  92. package/build/internal/cjs/src/data-v2-data-collection-collections.context.d.ts +0 -17
  93. package/build/internal/cjs/src/data-v2-data-collection-collections.context.js +0 -39
  94. package/build/internal/cjs/src/data-v2-data-collection-collections.context.js.map +0 -1
  95. package/build/internal/cjs/src/data-v2-data-collection-collections.http.d.ts +0 -48
  96. package/build/internal/cjs/src/data-v2-data-collection-collections.http.js +0 -704
  97. package/build/internal/cjs/src/data-v2-data-collection-collections.http.js.map +0 -1
  98. package/build/internal/cjs/src/data-v2-data-collection-collections.meta.d.ts +0 -27
  99. package/build/internal/cjs/src/data-v2-data-collection-collections.meta.js +0 -199
  100. package/build/internal/cjs/src/data-v2-data-collection-collections.meta.js.map +0 -1
  101. package/build/internal/cjs/src/data-v2-data-collection-collections.public.d.ts +0 -107
  102. package/build/internal/cjs/src/data-v2-data-collection-collections.public.js +0 -84
  103. package/build/internal/cjs/src/data-v2-data-collection-collections.public.js.map +0 -1
  104. package/build/internal/cjs/src/data-v2-data-collection-collections.types.js +0 -270
  105. package/build/internal/cjs/src/data-v2-data-collection-collections.types.js.map +0 -1
  106. package/build/internal/cjs/src/data-v2-data-collection-collections.universal.d.ts +0 -1679
  107. package/build/internal/cjs/src/data-v2-data-collection-collections.universal.js +0 -704
  108. package/build/internal/cjs/src/data-v2-data-collection-collections.universal.js.map +0 -1
  109. package/build/internal/es/index.d.ts +0 -1
  110. package/build/internal/es/index.js +0 -2
  111. package/build/internal/es/index.js.map +0 -1
  112. package/build/internal/es/index.typings.d.ts +0 -1
  113. package/build/internal/es/index.typings.js +0 -2
  114. package/build/internal/es/index.typings.js.map +0 -1
  115. package/build/internal/es/meta.d.ts +0 -1
  116. package/build/internal/es/meta.js +0 -2
  117. package/build/internal/es/meta.js.map +0 -1
  118. package/build/internal/es/src/data-v2-data-collection-collections.context.d.ts +0 -17
  119. package/build/internal/es/src/data-v2-data-collection-collections.context.js +0 -17
  120. package/build/internal/es/src/data-v2-data-collection-collections.context.js.map +0 -1
  121. package/build/internal/es/src/data-v2-data-collection-collections.http.d.ts +0 -48
  122. package/build/internal/es/src/data-v2-data-collection-collections.http.js +0 -692
  123. package/build/internal/es/src/data-v2-data-collection-collections.http.js.map +0 -1
  124. package/build/internal/es/src/data-v2-data-collection-collections.meta.d.ts +0 -27
  125. package/build/internal/es/src/data-v2-data-collection-collections.meta.js +0 -164
  126. package/build/internal/es/src/data-v2-data-collection-collections.meta.js.map +0 -1
  127. package/build/internal/es/src/data-v2-data-collection-collections.public.d.ts +0 -107
  128. package/build/internal/es/src/data-v2-data-collection-collections.public.js +0 -53
  129. package/build/internal/es/src/data-v2-data-collection-collections.public.js.map +0 -1
  130. package/build/internal/es/src/data-v2-data-collection-collections.types.js +0 -267
  131. package/build/internal/es/src/data-v2-data-collection-collections.types.js.map +0 -1
  132. package/build/internal/es/src/data-v2-data-collection-collections.universal.d.ts +0 -1679
  133. package/build/internal/es/src/data-v2-data-collection-collections.universal.js +0 -669
  134. package/build/internal/es/src/data-v2-data-collection-collections.universal.js.map +0 -1
@@ -0,0 +1,1227 @@
1
+ // src/data-v2-data-collection-collections.universal.ts
2
+ import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
3
+ import {
4
+ renameKeysFromSDKRequestToRESTRequest,
5
+ renameKeysFromRESTResponseToSDKResponse
6
+ } from "@wix/sdk-runtime/rename-all-nested-keys";
7
+
8
+ // src/data-v2-data-collection-collections.http.ts
9
+ import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
10
+ import { transformSDKFloatToRESTFloat } from "@wix/sdk-runtime/transformations/float";
11
+ import { transformRESTFloatToSDKFloat } from "@wix/sdk-runtime/transformations/float";
12
+ import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
13
+ import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
14
+ import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
15
+ import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
16
+ function resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl(opts) {
17
+ const domainToMappings = {
18
+ "api._api_base_domain_": [
19
+ {
20
+ srcPath: "/cloud-data",
21
+ destPath: ""
22
+ }
23
+ ],
24
+ "code._base_domain_": [
25
+ {
26
+ srcPath: "/_api/cloud-data/v1/data-settings",
27
+ destPath: "/v1/data-settings"
28
+ },
29
+ {
30
+ srcPath: "/_api/cloud-data/v1/schemas",
31
+ destPath: "/v1/schemas"
32
+ },
33
+ {
34
+ srcPath: "/_api/cloud-data/v1/connector",
35
+ destPath: "/v1/connector"
36
+ },
37
+ {
38
+ srcPath: "/_api/data/v1/data-settings",
39
+ destPath: "/v1/data-settings"
40
+ },
41
+ {
42
+ srcPath: "/_api/data/v1/schemas",
43
+ destPath: "/v1/schemas"
44
+ },
45
+ {
46
+ srcPath: "/_api/data/v1/connector",
47
+ destPath: "/v1/connector"
48
+ },
49
+ {
50
+ srcPath: "/_api/cloud-data/v1/wix-data",
51
+ destPath: "/v1/wix-data"
52
+ }
53
+ ],
54
+ "cloud-data.wix-code.com": [
55
+ {
56
+ srcPath: "",
57
+ destPath: ""
58
+ }
59
+ ],
60
+ _: [
61
+ {
62
+ srcPath: "/_api/cloud-data",
63
+ destPath: ""
64
+ }
65
+ ],
66
+ "www._base_domain_": [
67
+ {
68
+ srcPath: "/_api/cloud-data",
69
+ destPath: ""
70
+ },
71
+ {
72
+ srcPath: "/_api/data",
73
+ destPath: ""
74
+ },
75
+ {
76
+ srcPath: "/_api/cloud-data",
77
+ destPath: ""
78
+ }
79
+ ],
80
+ "dev._base_domain_": [
81
+ {
82
+ srcPath: "/_api/cloud-data",
83
+ destPath: ""
84
+ }
85
+ ],
86
+ "bo._base_domain_": [
87
+ {
88
+ srcPath: "/_api/cloud-data/v1",
89
+ destPath: "/v1"
90
+ },
91
+ {
92
+ srcPath: "/_api/cloud-data/v2",
93
+ destPath: "/v2"
94
+ }
95
+ ],
96
+ "wixbo.ai": [
97
+ {
98
+ srcPath: "/_api/cloud-data/v1",
99
+ destPath: "/v1"
100
+ },
101
+ {
102
+ srcPath: "/_api/cloud-data/v2",
103
+ destPath: "/v2"
104
+ }
105
+ ],
106
+ "wix-bo.com": [
107
+ {
108
+ srcPath: "/_api/cloud-data/v1",
109
+ destPath: "/v1"
110
+ },
111
+ {
112
+ srcPath: "/_api/cloud-data/v2",
113
+ destPath: "/v2"
114
+ }
115
+ ],
116
+ "manage._base_domain_": [
117
+ {
118
+ srcPath: "/_api/cloud-data",
119
+ destPath: ""
120
+ },
121
+ {
122
+ srcPath: "/_api/data",
123
+ destPath: ""
124
+ },
125
+ {
126
+ srcPath: "/_api/cloud-data",
127
+ destPath: ""
128
+ }
129
+ ],
130
+ "editor._base_domain_": [
131
+ {
132
+ srcPath: "/_api/cloud-data/v1/schemas",
133
+ destPath: "/v1/schemas"
134
+ },
135
+ {
136
+ srcPath: "/_api/cloud-data/dbs/tasks",
137
+ destPath: "/dbs/tasks"
138
+ },
139
+ {
140
+ srcPath: "/_api/data/v1/schemas",
141
+ destPath: "/v1/schemas"
142
+ },
143
+ {
144
+ srcPath: "/_api/data/dbs/tasks",
145
+ destPath: "/dbs/tasks"
146
+ },
147
+ {
148
+ srcPath: "/_api/cloud-data/v1/wix-data",
149
+ destPath: "/v1/wix-data"
150
+ },
151
+ {
152
+ srcPath: "/_api/cloud-data/v1/data-settings",
153
+ destPath: "/v1/data-settings"
154
+ },
155
+ {
156
+ srcPath: "/_api/data/v2/indexes",
157
+ destPath: "/v2/indexes"
158
+ },
159
+ {
160
+ srcPath: "/_api/cloud-data/v1/external-database-connections",
161
+ destPath: "/v1/external-database-connections"
162
+ },
163
+ {
164
+ srcPath: "/_api/data/v1/data-collection-sharing",
165
+ destPath: "/v1/data-collection-sharing"
166
+ },
167
+ {
168
+ srcPath: "/_api/cloud-data/v2/collections",
169
+ destPath: "/v2/collections"
170
+ },
171
+ {
172
+ srcPath: "/_api/cloud-data/v2/bulk",
173
+ destPath: "/v2/bulk"
174
+ },
175
+ {
176
+ srcPath: "/_api/cloud-data/v2/items",
177
+ destPath: "/v2/items"
178
+ },
179
+ {
180
+ srcPath: "/_api/cloud-data/v2/dbs/tasks",
181
+ destPath: "/v2/dbs/tasks"
182
+ }
183
+ ],
184
+ "blocks._base_domain_": [
185
+ {
186
+ srcPath: "/_api/cloud-data/v1/schemas",
187
+ destPath: "/v1/schemas"
188
+ },
189
+ {
190
+ srcPath: "/_api/cloud-data/dbs/tasks",
191
+ destPath: "/dbs/tasks"
192
+ },
193
+ {
194
+ srcPath: "/_api/data/v1/schemas",
195
+ destPath: "/v1/schemas"
196
+ },
197
+ {
198
+ srcPath: "/_api/data/dbs/tasks",
199
+ destPath: "/dbs/tasks"
200
+ },
201
+ {
202
+ srcPath: "/_api/cloud-data/v1/wix-data",
203
+ destPath: "/v1/wix-data"
204
+ },
205
+ {
206
+ srcPath: "/_api/cloud-data/v1/data-settings",
207
+ destPath: "/v1/data-settings"
208
+ },
209
+ {
210
+ srcPath: "/_api/data/v2/indexes",
211
+ destPath: "/v2/indexes"
212
+ },
213
+ {
214
+ srcPath: "/_api/cloud-data/v1/external-database-connections",
215
+ destPath: "/v1/external-database-connections"
216
+ },
217
+ {
218
+ srcPath: "/_api/data/v1/data-collection-sharing",
219
+ destPath: "/v1/data-collection-sharing"
220
+ },
221
+ {
222
+ srcPath: "/_api/cloud-data/v2/collections",
223
+ destPath: "/v2/collections"
224
+ },
225
+ {
226
+ srcPath: "/_api/cloud-data/v2/bulk",
227
+ destPath: "/v2/bulk"
228
+ },
229
+ {
230
+ srcPath: "/_api/cloud-data/v2/items",
231
+ destPath: "/v2/items"
232
+ },
233
+ {
234
+ srcPath: "/_api/cloud-data/v2/dbs/tasks",
235
+ destPath: "/v2/dbs/tasks"
236
+ }
237
+ ],
238
+ "create.editorx": [
239
+ {
240
+ srcPath: "/_api/cloud-data/v1/schemas",
241
+ destPath: "/v1/schemas"
242
+ },
243
+ {
244
+ srcPath: "/_api/cloud-data/dbs/tasks",
245
+ destPath: "/dbs/tasks"
246
+ },
247
+ {
248
+ srcPath: "/_api/data/v1/schemas",
249
+ destPath: "/v1/schemas"
250
+ },
251
+ {
252
+ srcPath: "/_api/data/dbs/tasks",
253
+ destPath: "/dbs/tasks"
254
+ },
255
+ {
256
+ srcPath: "/_api/cloud-data/v1/wix-data",
257
+ destPath: "/v1/wix-data"
258
+ },
259
+ {
260
+ srcPath: "/_api/cloud-data/v1/data-settings",
261
+ destPath: "/v1/data-settings"
262
+ },
263
+ {
264
+ srcPath: "/_api/data/v2/indexes",
265
+ destPath: "/v2/indexes"
266
+ },
267
+ {
268
+ srcPath: "/_api/cloud-data/v1/external-database-connections",
269
+ destPath: "/v1/external-database-connections"
270
+ },
271
+ {
272
+ srcPath: "/_api/data/v1/data-collection-sharing",
273
+ destPath: "/v1/data-collection-sharing"
274
+ },
275
+ {
276
+ srcPath: "/_api/cloud-data/v2/collections",
277
+ destPath: "/v2/collections"
278
+ },
279
+ {
280
+ srcPath: "/_api/cloud-data/v2/bulk",
281
+ destPath: "/v2/bulk"
282
+ },
283
+ {
284
+ srcPath: "/_api/cloud-data/v2/items",
285
+ destPath: "/v2/items"
286
+ },
287
+ {
288
+ srcPath: "/_api/cloud-data/v2/dbs/tasks",
289
+ destPath: "/v2/dbs/tasks"
290
+ }
291
+ ],
292
+ "www.wixapis.com": [
293
+ {
294
+ srcPath: "/wix-data/v1/collections",
295
+ destPath: "/v1/wix-data/collections"
296
+ },
297
+ {
298
+ srcPath: "/wix-data/v1/external-database-connections",
299
+ destPath: "/v1/external-database-connections"
300
+ },
301
+ {
302
+ srcPath: "/wix-data/v2/indexes",
303
+ destPath: "/v2/indexes"
304
+ },
305
+ {
306
+ srcPath: "/wix-data/v1/items",
307
+ destPath: "/v1/items"
308
+ },
309
+ {
310
+ srcPath: "/wix-data/v1/bulk",
311
+ destPath: "/v1/bulk"
312
+ },
313
+ {
314
+ srcPath: "/wix-data/v1/external-databases",
315
+ destPath: "/v1/external-databases"
316
+ },
317
+ {
318
+ srcPath: "/wix-data/v2",
319
+ destPath: "/v2"
320
+ }
321
+ ],
322
+ "www.wixgateway.com": [
323
+ {
324
+ srcPath: "/wix-data/v1/items",
325
+ destPath: "/v1/items"
326
+ },
327
+ {
328
+ srcPath: "/wix-data/v1/bulk",
329
+ destPath: "/v1/bulk"
330
+ }
331
+ ],
332
+ "*.dev.wix-code.com": [
333
+ {
334
+ srcPath: "/_api/cloud-data/v2",
335
+ destPath: "/v2"
336
+ }
337
+ ]
338
+ };
339
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
340
+ }
341
+ var PACKAGE_NAME = "@wix/auto_sdk_data_collections";
342
+ function createDataCollection(payload) {
343
+ function __createDataCollection({ host }) {
344
+ const serializedData = transformPaths(payload, [
345
+ {
346
+ transformFn: transformSDKTimestampToRESTTimestamp,
347
+ paths: [
348
+ { path: "collection.createdDate" },
349
+ { path: "collection.updatedDate" }
350
+ ]
351
+ },
352
+ {
353
+ transformFn: 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(
366
+ { protoPath: "/v2/collections", data: serializedData, host }
367
+ ),
368
+ data: serializedData,
369
+ transformResponse: (payload2) => transformPaths(payload2, [
370
+ {
371
+ transformFn: transformRESTTimestampToSDKTimestamp,
372
+ paths: [
373
+ { path: "collection.createdDate" },
374
+ { path: "collection.updatedDate" }
375
+ ]
376
+ },
377
+ {
378
+ transformFn: transformRESTFloatToSDKFloat,
379
+ paths: [
380
+ { path: "collection.fields.numberRange.min" },
381
+ { path: "collection.fields.numberRange.max" }
382
+ ]
383
+ }
384
+ ])
385
+ };
386
+ return metadata;
387
+ }
388
+ return __createDataCollection;
389
+ }
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(
398
+ { protoPath: "/v2/collections/{dataCollectionId}", data: payload, host }
399
+ ),
400
+ params: toURLSearchParams(payload),
401
+ transformResponse: (payload2) => transformPaths(payload2, [
402
+ {
403
+ transformFn: transformRESTTimestampToSDKTimestamp,
404
+ paths: [
405
+ { path: "collection.createdDate" },
406
+ { path: "collection.updatedDate" },
407
+ { path: "referencedCollections.createdDate" },
408
+ { path: "referencedCollections.updatedDate" }
409
+ ]
410
+ },
411
+ {
412
+ transformFn: transformRESTFloatToSDKFloat,
413
+ paths: [
414
+ { path: "collection.fields.numberRange.min" },
415
+ { path: "collection.fields.numberRange.max" },
416
+ { path: "referencedCollections.fields.numberRange.min" },
417
+ { path: "referencedCollections.fields.numberRange.max" }
418
+ ]
419
+ }
420
+ ])
421
+ };
422
+ return metadata;
423
+ }
424
+ return __getDataCollection;
425
+ }
426
+ function listDataCollections(payload) {
427
+ function __listDataCollections({ host }) {
428
+ const metadata = {
429
+ entityFqdn: "wix.data.v2.data_collection",
430
+ method: "GET",
431
+ methodFqn: "com.wixpress.cloud.data.api.collectionservice.DataCollectionService.ListDataCollections",
432
+ packageName: PACKAGE_NAME,
433
+ url: resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl(
434
+ { protoPath: "/v2/collections", data: payload, host }
435
+ ),
436
+ params: toURLSearchParams(payload),
437
+ transformResponse: (payload2) => transformPaths(payload2, [
438
+ {
439
+ transformFn: transformRESTTimestampToSDKTimestamp,
440
+ paths: [
441
+ { path: "collections.createdDate" },
442
+ { path: "collections.updatedDate" }
443
+ ]
444
+ },
445
+ {
446
+ transformFn: transformRESTFloatToSDKFloat,
447
+ paths: [
448
+ { path: "collections.fields.numberRange.min" },
449
+ { path: "collections.fields.numberRange.max" }
450
+ ]
451
+ }
452
+ ])
453
+ };
454
+ return metadata;
455
+ }
456
+ return __listDataCollections;
457
+ }
458
+ function updateDataCollection(payload) {
459
+ function __updateDataCollection({ host }) {
460
+ const serializedData = transformPaths(payload, [
461
+ {
462
+ transformFn: transformSDKTimestampToRESTTimestamp,
463
+ paths: [
464
+ { path: "collection.createdDate" },
465
+ { path: "collection.updatedDate" }
466
+ ]
467
+ },
468
+ {
469
+ transformFn: transformSDKFloatToRESTFloat,
470
+ paths: [
471
+ { path: "collection.fields.numberRange.min" },
472
+ { path: "collection.fields.numberRange.max" }
473
+ ]
474
+ }
475
+ ]);
476
+ const metadata = {
477
+ entityFqdn: "wix.data.v2.data_collection",
478
+ method: "PUT",
479
+ methodFqn: "com.wixpress.cloud.data.api.collectionservice.DataCollectionService.UpdateDataCollection",
480
+ packageName: PACKAGE_NAME,
481
+ url: resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl(
482
+ { protoPath: "/v2/collections", data: serializedData, host }
483
+ ),
484
+ data: serializedData,
485
+ transformResponse: (payload2) => transformPaths(payload2, [
486
+ {
487
+ transformFn: transformRESTTimestampToSDKTimestamp,
488
+ paths: [
489
+ { path: "collection.createdDate" },
490
+ { path: "collection.updatedDate" }
491
+ ]
492
+ },
493
+ {
494
+ transformFn: transformRESTFloatToSDKFloat,
495
+ paths: [
496
+ { path: "collection.fields.numberRange.min" },
497
+ { path: "collection.fields.numberRange.max" }
498
+ ]
499
+ }
500
+ ])
501
+ };
502
+ return metadata;
503
+ }
504
+ return __updateDataCollection;
505
+ }
506
+ function deleteDataCollection(payload) {
507
+ function __deleteDataCollection({ host }) {
508
+ const metadata = {
509
+ entityFqdn: "wix.data.v2.data_collection",
510
+ method: "DELETE",
511
+ methodFqn: "com.wixpress.cloud.data.api.collectionservice.DataCollectionService.DeleteDataCollection",
512
+ packageName: PACKAGE_NAME,
513
+ url: resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl(
514
+ { protoPath: "/v2/collections/{dataCollectionId}", data: payload, host }
515
+ ),
516
+ params: toURLSearchParams(payload)
517
+ };
518
+ return metadata;
519
+ }
520
+ return __deleteDataCollection;
521
+ }
522
+ function restoreDataCollection(payload) {
523
+ function __restoreDataCollection({ host }) {
524
+ const metadata = {
525
+ entityFqdn: "wix.data.v2.data_collection",
526
+ method: "POST",
527
+ methodFqn: "com.wixpress.cloud.data.api.collectionservice.DataCollectionService.RestoreDataCollection",
528
+ packageName: PACKAGE_NAME,
529
+ url: resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl(
530
+ {
531
+ protoPath: "/v2/collections/restore/{dataCollectionId}",
532
+ data: payload,
533
+ host
534
+ }
535
+ ),
536
+ data: payload,
537
+ transformResponse: (payload2) => transformPaths(payload2, [
538
+ {
539
+ transformFn: transformRESTTimestampToSDKTimestamp,
540
+ paths: [
541
+ { path: "dataCollection.createdDate" },
542
+ { path: "dataCollection.updatedDate" }
543
+ ]
544
+ },
545
+ {
546
+ transformFn: transformRESTFloatToSDKFloat,
547
+ paths: [
548
+ { path: "dataCollection.fields.numberRange.min" },
549
+ { path: "dataCollection.fields.numberRange.max" }
550
+ ]
551
+ }
552
+ ])
553
+ };
554
+ return metadata;
555
+ }
556
+ return __restoreDataCollection;
557
+ }
558
+ function createDataCollectionField(payload) {
559
+ function __createDataCollectionField({ host }) {
560
+ const serializedData = transformPaths(payload, [
561
+ {
562
+ transformFn: transformSDKFloatToRESTFloat,
563
+ paths: [
564
+ { path: "field.numberRange.min" },
565
+ { path: "field.numberRange.max" }
566
+ ]
567
+ }
568
+ ]);
569
+ const metadata = {
570
+ entityFqdn: "wix.data.v2.data_collection",
571
+ method: "POST",
572
+ methodFqn: "com.wixpress.cloud.data.api.collectionservice.DataCollectionService.CreateDataCollectionField",
573
+ packageName: PACKAGE_NAME,
574
+ url: resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl(
575
+ {
576
+ protoPath: "/v2/collections/create-field",
577
+ data: serializedData,
578
+ host
579
+ }
580
+ ),
581
+ data: serializedData,
582
+ transformResponse: (payload2) => transformPaths(payload2, [
583
+ {
584
+ transformFn: transformRESTTimestampToSDKTimestamp,
585
+ paths: [
586
+ { path: "dataCollection.createdDate" },
587
+ { path: "dataCollection.updatedDate" }
588
+ ]
589
+ },
590
+ {
591
+ transformFn: transformRESTFloatToSDKFloat,
592
+ paths: [
593
+ { path: "dataCollection.fields.numberRange.min" },
594
+ { path: "dataCollection.fields.numberRange.max" }
595
+ ]
596
+ }
597
+ ])
598
+ };
599
+ return metadata;
600
+ }
601
+ return __createDataCollectionField;
602
+ }
603
+ function updateDataCollectionField(payload) {
604
+ function __updateDataCollectionField({ host }) {
605
+ const serializedData = transformPaths(payload, [
606
+ {
607
+ transformFn: transformSDKFloatToRESTFloat,
608
+ paths: [
609
+ { path: "field.numberRange.min" },
610
+ { path: "field.numberRange.max" }
611
+ ]
612
+ }
613
+ ]);
614
+ const metadata = {
615
+ entityFqdn: "wix.data.v2.data_collection",
616
+ method: "POST",
617
+ methodFqn: "com.wixpress.cloud.data.api.collectionservice.DataCollectionService.UpdateDataCollectionField",
618
+ packageName: PACKAGE_NAME,
619
+ url: resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl(
620
+ {
621
+ protoPath: "/v2/collections/update-field",
622
+ data: serializedData,
623
+ host
624
+ }
625
+ ),
626
+ data: serializedData,
627
+ transformResponse: (payload2) => transformPaths(payload2, [
628
+ {
629
+ transformFn: transformRESTTimestampToSDKTimestamp,
630
+ paths: [
631
+ { path: "dataCollection.createdDate" },
632
+ { path: "dataCollection.updatedDate" }
633
+ ]
634
+ },
635
+ {
636
+ transformFn: transformRESTFloatToSDKFloat,
637
+ paths: [
638
+ { path: "dataCollection.fields.numberRange.min" },
639
+ { path: "dataCollection.fields.numberRange.max" }
640
+ ]
641
+ }
642
+ ])
643
+ };
644
+ return metadata;
645
+ }
646
+ return __updateDataCollectionField;
647
+ }
648
+ function deleteDataCollectionField(payload) {
649
+ function __deleteDataCollectionField({ host }) {
650
+ const metadata = {
651
+ entityFqdn: "wix.data.v2.data_collection",
652
+ method: "POST",
653
+ methodFqn: "com.wixpress.cloud.data.api.collectionservice.DataCollectionService.DeleteDataCollectionField",
654
+ packageName: PACKAGE_NAME,
655
+ url: resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl(
656
+ { protoPath: "/v2/collections/delete-field", data: payload, host }
657
+ ),
658
+ data: payload,
659
+ transformResponse: (payload2) => transformPaths(payload2, [
660
+ {
661
+ transformFn: transformRESTTimestampToSDKTimestamp,
662
+ paths: [
663
+ { path: "dataCollection.createdDate" },
664
+ { path: "dataCollection.updatedDate" }
665
+ ]
666
+ },
667
+ {
668
+ transformFn: transformRESTFloatToSDKFloat,
669
+ paths: [
670
+ { path: "dataCollection.fields.numberRange.min" },
671
+ { path: "dataCollection.fields.numberRange.max" }
672
+ ]
673
+ }
674
+ ])
675
+ };
676
+ return metadata;
677
+ }
678
+ return __deleteDataCollectionField;
679
+ }
680
+
681
+ // src/data-v2-data-collection-collections.universal.ts
682
+ var CollectionType = /* @__PURE__ */ ((CollectionType2) => {
683
+ CollectionType2["NATIVE"] = "NATIVE";
684
+ CollectionType2["WIX_APP"] = "WIX_APP";
685
+ CollectionType2["BLOCKS_APP"] = "BLOCKS_APP";
686
+ CollectionType2["EXTERNAL"] = "EXTERNAL";
687
+ return CollectionType2;
688
+ })(CollectionType || {});
689
+ var Direction = /* @__PURE__ */ ((Direction2) => {
690
+ Direction2["ASC"] = "ASC";
691
+ Direction2["DESC"] = "DESC";
692
+ return Direction2;
693
+ })(Direction || {});
694
+ var DataOperation = /* @__PURE__ */ ((DataOperation2) => {
695
+ DataOperation2["AGGREGATE"] = "AGGREGATE";
696
+ DataOperation2["BULK_INSERT"] = "BULK_INSERT";
697
+ DataOperation2["BULK_REMOVE"] = "BULK_REMOVE";
698
+ DataOperation2["BULK_SAVE"] = "BULK_SAVE";
699
+ DataOperation2["BULK_UPDATE"] = "BULK_UPDATE";
700
+ DataOperation2["COUNT"] = "COUNT";
701
+ DataOperation2["DISTINCT"] = "DISTINCT";
702
+ DataOperation2["FIND"] = "FIND";
703
+ DataOperation2["GET"] = "GET";
704
+ DataOperation2["INSERT"] = "INSERT";
705
+ DataOperation2["INSERT_REFERENCE"] = "INSERT_REFERENCE";
706
+ DataOperation2["IS_REFERENCED"] = "IS_REFERENCED";
707
+ DataOperation2["QUERY_REFERENCED"] = "QUERY_REFERENCED";
708
+ DataOperation2["REMOVE"] = "REMOVE";
709
+ DataOperation2["REMOVE_REFERENCE"] = "REMOVE_REFERENCE";
710
+ DataOperation2["REPLACE_REFERENCES"] = "REPLACE_REFERENCES";
711
+ DataOperation2["SAVE"] = "SAVE";
712
+ DataOperation2["TRUNCATE"] = "TRUNCATE";
713
+ DataOperation2["UPDATE"] = "UPDATE";
714
+ DataOperation2["PATCH"] = "PATCH";
715
+ DataOperation2["BULK_PATCH"] = "BULK_PATCH";
716
+ return DataOperation2;
717
+ })(DataOperation || {});
718
+ var CollectionOperation = /* @__PURE__ */ ((CollectionOperation2) => {
719
+ CollectionOperation2["UPDATE"] = "UPDATE";
720
+ CollectionOperation2["REMOVE"] = "REMOVE";
721
+ return CollectionOperation2;
722
+ })(CollectionOperation || {});
723
+ var Type = /* @__PURE__ */ ((Type2) => {
724
+ Type2["UNKNOWN_FIELD_TYPE"] = "UNKNOWN_FIELD_TYPE";
725
+ Type2["TEXT"] = "TEXT";
726
+ Type2["NUMBER"] = "NUMBER";
727
+ Type2["DATE"] = "DATE";
728
+ Type2["DATETIME"] = "DATETIME";
729
+ Type2["IMAGE"] = "IMAGE";
730
+ Type2["BOOLEAN"] = "BOOLEAN";
731
+ Type2["DOCUMENT"] = "DOCUMENT";
732
+ Type2["URL"] = "URL";
733
+ Type2["RICH_TEXT"] = "RICH_TEXT";
734
+ Type2["VIDEO"] = "VIDEO";
735
+ Type2["ANY"] = "ANY";
736
+ Type2["ARRAY_STRING"] = "ARRAY_STRING";
737
+ Type2["ARRAY_DOCUMENT"] = "ARRAY_DOCUMENT";
738
+ Type2["AUDIO"] = "AUDIO";
739
+ Type2["TIME"] = "TIME";
740
+ Type2["LANGUAGE"] = "LANGUAGE";
741
+ Type2["RICH_CONTENT"] = "RICH_CONTENT";
742
+ Type2["MEDIA_GALLERY"] = "MEDIA_GALLERY";
743
+ Type2["ADDRESS"] = "ADDRESS";
744
+ Type2["PAGE_LINK"] = "PAGE_LINK";
745
+ Type2["REFERENCE"] = "REFERENCE";
746
+ Type2["MULTI_REFERENCE"] = "MULTI_REFERENCE";
747
+ Type2["OBJECT"] = "OBJECT";
748
+ Type2["ARRAY"] = "ARRAY";
749
+ Type2["LEGACY_TIME"] = "LEGACY_TIME";
750
+ Type2["LEGACY_BOOK"] = "LEGACY_BOOK";
751
+ Type2["LEGACY_EXTERNAL_URL"] = "LEGACY_EXTERNAL_URL";
752
+ Type2["LEGACY_BROKEN_REFERENCE"] = "LEGACY_BROKEN_REFERENCE";
753
+ Type2["LEGACY_IMAGE"] = "LEGACY_IMAGE";
754
+ Type2["LEGACY_COLOR"] = "LEGACY_COLOR";
755
+ Type2["LEGACY_EXTERNAL_VIDEO"] = "LEGACY_EXTERNAL_VIDEO";
756
+ return Type2;
757
+ })(Type || {});
758
+ var QueryOperator = /* @__PURE__ */ ((QueryOperator2) => {
759
+ QueryOperator2["EQ"] = "EQ";
760
+ QueryOperator2["LT"] = "LT";
761
+ QueryOperator2["GT"] = "GT";
762
+ QueryOperator2["NE"] = "NE";
763
+ QueryOperator2["LTE"] = "LTE";
764
+ QueryOperator2["GTE"] = "GTE";
765
+ QueryOperator2["STARTS_WITH"] = "STARTS_WITH";
766
+ QueryOperator2["ENDS_WITH"] = "ENDS_WITH";
767
+ QueryOperator2["CONTAINS"] = "CONTAINS";
768
+ QueryOperator2["HAS_SOME"] = "HAS_SOME";
769
+ QueryOperator2["HAS_ALL"] = "HAS_ALL";
770
+ QueryOperator2["EXISTS"] = "EXISTS";
771
+ QueryOperator2["URLIZED"] = "URLIZED";
772
+ return QueryOperator2;
773
+ })(QueryOperator || {});
774
+ var FieldPluginType = /* @__PURE__ */ ((FieldPluginType2) => {
775
+ FieldPluginType2["UNKNOWN"] = "UNKNOWN";
776
+ FieldPluginType2["CMS"] = "CMS";
777
+ return FieldPluginType2;
778
+ })(FieldPluginType || {});
779
+ var Role = /* @__PURE__ */ ((Role2) => {
780
+ Role2["UNKNOWN_ROLE"] = "UNKNOWN_ROLE";
781
+ Role2["ADMIN"] = "ADMIN";
782
+ Role2["SITE_MEMBER_AUTHOR"] = "SITE_MEMBER_AUTHOR";
783
+ Role2["SITE_MEMBER"] = "SITE_MEMBER";
784
+ Role2["ANYONE"] = "ANYONE";
785
+ return Role2;
786
+ })(Role || {});
787
+ var Status = /* @__PURE__ */ ((Status2) => {
788
+ Status2["UNKNOWN_PUBLISH_PLUGIN_STATUS"] = "UNKNOWN_PUBLISH_PLUGIN_STATUS";
789
+ Status2["PUBLISHED"] = "PUBLISHED";
790
+ Status2["DRAFT"] = "DRAFT";
791
+ return Status2;
792
+ })(Status || {});
793
+ var Format = /* @__PURE__ */ ((Format2) => {
794
+ Format2["UNKNOWN_URLIZED_PLUGIN_FORMAT"] = "UNKNOWN_URLIZED_PLUGIN_FORMAT";
795
+ Format2["ORIGINAL"] = "ORIGINAL";
796
+ Format2["PLAIN"] = "PLAIN";
797
+ return Format2;
798
+ })(Format || {});
799
+ var PluginType = /* @__PURE__ */ ((PluginType2) => {
800
+ PluginType2["UNKNOWN_PLUGIN_TYPE"] = "UNKNOWN_PLUGIN_TYPE";
801
+ PluginType2["PUBLISH"] = "PUBLISH";
802
+ PluginType2["SINGLE_ITEM"] = "SINGLE_ITEM";
803
+ PluginType2["URLIZED"] = "URLIZED";
804
+ PluginType2["GRIDAPPLESS"] = "GRIDAPPLESS";
805
+ PluginType2["MULTILINGUAL"] = "MULTILINGUAL";
806
+ PluginType2["SHARED"] = "SHARED";
807
+ PluginType2["EDITABLE_PAGE_LINK"] = "EDITABLE_PAGE_LINK";
808
+ PluginType2["CMS"] = "CMS";
809
+ return PluginType2;
810
+ })(PluginType || {});
811
+ var PagingMode = /* @__PURE__ */ ((PagingMode2) => {
812
+ PagingMode2["OFFSET"] = "OFFSET";
813
+ PagingMode2["CURSOR"] = "CURSOR";
814
+ return PagingMode2;
815
+ })(PagingMode || {});
816
+ var AccessLevel = /* @__PURE__ */ ((AccessLevel2) => {
817
+ AccessLevel2["UNDEFINED"] = "UNDEFINED";
818
+ AccessLevel2["ANYONE"] = "ANYONE";
819
+ AccessLevel2["SITE_MEMBER"] = "SITE_MEMBER";
820
+ AccessLevel2["SITE_MEMBER_AUTHOR"] = "SITE_MEMBER_AUTHOR";
821
+ AccessLevel2["CMS_EDITOR"] = "CMS_EDITOR";
822
+ AccessLevel2["PRIVILEGED"] = "PRIVILEGED";
823
+ return AccessLevel2;
824
+ })(AccessLevel || {});
825
+ var Segment = /* @__PURE__ */ ((Segment2) => {
826
+ Segment2["UNKNOWN_SEGMENT"] = "UNKNOWN_SEGMENT";
827
+ Segment2["PUBLIC"] = "PUBLIC";
828
+ Segment2["DEV"] = "DEV";
829
+ return Segment2;
830
+ })(Segment || {});
831
+ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
832
+ SortOrder2["ASC"] = "ASC";
833
+ SortOrder2["DESC"] = "DESC";
834
+ return SortOrder2;
835
+ })(SortOrder || {});
836
+ var Order = /* @__PURE__ */ ((Order2) => {
837
+ Order2["ASC"] = "ASC";
838
+ Order2["DESC"] = "DESC";
839
+ return Order2;
840
+ })(Order || {});
841
+ var IndexStatus = /* @__PURE__ */ ((IndexStatus2) => {
842
+ IndexStatus2["UNKNOWN"] = "UNKNOWN";
843
+ IndexStatus2["BUILDING"] = "BUILDING";
844
+ IndexStatus2["ACTIVE"] = "ACTIVE";
845
+ IndexStatus2["DROPPING"] = "DROPPING";
846
+ IndexStatus2["DROPPED"] = "DROPPED";
847
+ IndexStatus2["FAILED"] = "FAILED";
848
+ IndexStatus2["INVALID"] = "INVALID";
849
+ return IndexStatus2;
850
+ })(IndexStatus || {});
851
+ var IndexSource = /* @__PURE__ */ ((IndexSource2) => {
852
+ IndexSource2["UNKNOWN_INDEX_SOURCE"] = "UNKNOWN_INDEX_SOURCE";
853
+ IndexSource2["SYSTEM"] = "SYSTEM";
854
+ IndexSource2["USER"] = "USER";
855
+ IndexSource2["AUTO"] = "AUTO";
856
+ return IndexSource2;
857
+ })(IndexSource || {});
858
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
859
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
860
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
861
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
862
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
863
+ WebhookIdentityType2["APP"] = "APP";
864
+ return WebhookIdentityType2;
865
+ })(WebhookIdentityType || {});
866
+ async function createDataCollection2(collection) {
867
+ const { httpClient, sideEffects } = arguments[1];
868
+ const payload = renameKeysFromSDKRequestToRESTRequest({
869
+ collection
870
+ });
871
+ const reqOpts = createDataCollection(payload);
872
+ sideEffects?.onSiteCall?.();
873
+ try {
874
+ const result = await httpClient.request(reqOpts);
875
+ sideEffects?.onSuccess?.(result);
876
+ return renameKeysFromRESTResponseToSDKResponse(result.data)?.collection;
877
+ } catch (err) {
878
+ const transformedError = sdkTransformError(
879
+ err,
880
+ {
881
+ spreadPathsToArguments: {},
882
+ explicitPathsToArguments: { collection: "$[0]" },
883
+ singleArgumentUnchanged: false
884
+ },
885
+ ["collection"]
886
+ );
887
+ sideEffects?.onError?.(err);
888
+ throw transformedError;
889
+ }
890
+ }
891
+ async function getDataCollection2(dataCollectionId, options) {
892
+ const { httpClient, sideEffects } = arguments[2];
893
+ const payload = renameKeysFromSDKRequestToRESTRequest({
894
+ dataCollectionId,
895
+ consistentRead: options?.consistentRead,
896
+ fields: options?.fields
897
+ });
898
+ const reqOpts = getDataCollection(payload);
899
+ sideEffects?.onSiteCall?.();
900
+ try {
901
+ const result = await httpClient.request(reqOpts);
902
+ sideEffects?.onSuccess?.(result);
903
+ return renameKeysFromRESTResponseToSDKResponse(result.data)?.collection;
904
+ } catch (err) {
905
+ const transformedError = sdkTransformError(
906
+ err,
907
+ {
908
+ spreadPathsToArguments: {},
909
+ explicitPathsToArguments: {
910
+ dataCollectionId: "$[0]",
911
+ consistentRead: "$[1].consistentRead",
912
+ fields: "$[1].fields"
913
+ },
914
+ singleArgumentUnchanged: false
915
+ },
916
+ ["dataCollectionId", "options"]
917
+ );
918
+ sideEffects?.onError?.(err);
919
+ throw transformedError;
920
+ }
921
+ }
922
+ async function listDataCollections2(options) {
923
+ const { httpClient, sideEffects } = arguments[1];
924
+ const payload = renameKeysFromSDKRequestToRESTRequest({
925
+ sort: options?.sort,
926
+ paging: options?.paging,
927
+ consistentRead: options?.consistentRead,
928
+ fields: options?.fields
929
+ });
930
+ const reqOpts = listDataCollections(payload);
931
+ sideEffects?.onSiteCall?.();
932
+ try {
933
+ const result = await httpClient.request(reqOpts);
934
+ sideEffects?.onSuccess?.(result);
935
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
936
+ } catch (err) {
937
+ const transformedError = sdkTransformError(
938
+ err,
939
+ {
940
+ spreadPathsToArguments: {},
941
+ explicitPathsToArguments: {
942
+ sort: "$[0].sort",
943
+ paging: "$[0].paging",
944
+ consistentRead: "$[0].consistentRead",
945
+ fields: "$[0].fields"
946
+ },
947
+ singleArgumentUnchanged: false
948
+ },
949
+ ["options"]
950
+ );
951
+ sideEffects?.onError?.(err);
952
+ throw transformedError;
953
+ }
954
+ }
955
+ async function updateDataCollection2(collection) {
956
+ const { httpClient, sideEffects } = arguments[1];
957
+ const payload = renameKeysFromSDKRequestToRESTRequest({
958
+ collection
959
+ });
960
+ const reqOpts = updateDataCollection(payload);
961
+ sideEffects?.onSiteCall?.();
962
+ try {
963
+ const result = await httpClient.request(reqOpts);
964
+ sideEffects?.onSuccess?.(result);
965
+ return renameKeysFromRESTResponseToSDKResponse(result.data)?.collection;
966
+ } catch (err) {
967
+ const transformedError = sdkTransformError(
968
+ err,
969
+ {
970
+ spreadPathsToArguments: {},
971
+ explicitPathsToArguments: { collection: "$[0]" },
972
+ singleArgumentUnchanged: false
973
+ },
974
+ ["collection"]
975
+ );
976
+ sideEffects?.onError?.(err);
977
+ throw transformedError;
978
+ }
979
+ }
980
+ async function deleteDataCollection2(dataCollectionId) {
981
+ const { httpClient, sideEffects } = arguments[1];
982
+ const payload = renameKeysFromSDKRequestToRESTRequest({
983
+ dataCollectionId
984
+ });
985
+ const reqOpts = deleteDataCollection(payload);
986
+ sideEffects?.onSiteCall?.();
987
+ try {
988
+ const result = await httpClient.request(reqOpts);
989
+ sideEffects?.onSuccess?.(result);
990
+ } catch (err) {
991
+ const transformedError = sdkTransformError(
992
+ err,
993
+ {
994
+ spreadPathsToArguments: {},
995
+ explicitPathsToArguments: { dataCollectionId: "$[0]" },
996
+ singleArgumentUnchanged: false
997
+ },
998
+ ["dataCollectionId"]
999
+ );
1000
+ sideEffects?.onError?.(err);
1001
+ throw transformedError;
1002
+ }
1003
+ }
1004
+ async function restoreDataCollection2(dataCollectionId) {
1005
+ const { httpClient, sideEffects } = arguments[1];
1006
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1007
+ dataCollectionId
1008
+ });
1009
+ const reqOpts = restoreDataCollection(payload);
1010
+ sideEffects?.onSiteCall?.();
1011
+ try {
1012
+ const result = await httpClient.request(reqOpts);
1013
+ sideEffects?.onSuccess?.(result);
1014
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1015
+ } catch (err) {
1016
+ const transformedError = sdkTransformError(
1017
+ err,
1018
+ {
1019
+ spreadPathsToArguments: {},
1020
+ explicitPathsToArguments: { dataCollectionId: "$[0]" },
1021
+ singleArgumentUnchanged: false
1022
+ },
1023
+ ["dataCollectionId"]
1024
+ );
1025
+ sideEffects?.onError?.(err);
1026
+ throw transformedError;
1027
+ }
1028
+ }
1029
+ async function createDataCollectionField2(dataCollectionId, options) {
1030
+ const { httpClient, sideEffects } = arguments[2];
1031
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1032
+ dataCollectionId,
1033
+ field: options?.field
1034
+ });
1035
+ const reqOpts = createDataCollectionField(payload);
1036
+ sideEffects?.onSiteCall?.();
1037
+ try {
1038
+ const result = await httpClient.request(reqOpts);
1039
+ sideEffects?.onSuccess?.(result);
1040
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1041
+ } catch (err) {
1042
+ const transformedError = sdkTransformError(
1043
+ err,
1044
+ {
1045
+ spreadPathsToArguments: {},
1046
+ explicitPathsToArguments: {
1047
+ dataCollectionId: "$[0]",
1048
+ field: "$[1].field"
1049
+ },
1050
+ singleArgumentUnchanged: false
1051
+ },
1052
+ ["dataCollectionId", "options"]
1053
+ );
1054
+ sideEffects?.onError?.(err);
1055
+ throw transformedError;
1056
+ }
1057
+ }
1058
+ async function updateDataCollectionField2(dataCollectionId, options) {
1059
+ const { httpClient, sideEffects } = arguments[2];
1060
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1061
+ dataCollectionId,
1062
+ field: options?.field
1063
+ });
1064
+ const reqOpts = updateDataCollectionField(payload);
1065
+ sideEffects?.onSiteCall?.();
1066
+ try {
1067
+ const result = await httpClient.request(reqOpts);
1068
+ sideEffects?.onSuccess?.(result);
1069
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1070
+ } catch (err) {
1071
+ const transformedError = sdkTransformError(
1072
+ err,
1073
+ {
1074
+ spreadPathsToArguments: {},
1075
+ explicitPathsToArguments: {
1076
+ dataCollectionId: "$[0]",
1077
+ field: "$[1].field"
1078
+ },
1079
+ singleArgumentUnchanged: false
1080
+ },
1081
+ ["dataCollectionId", "options"]
1082
+ );
1083
+ sideEffects?.onError?.(err);
1084
+ throw transformedError;
1085
+ }
1086
+ }
1087
+ async function deleteDataCollectionField2(dataCollectionId, options) {
1088
+ const { httpClient, sideEffects } = arguments[2];
1089
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1090
+ dataCollectionId,
1091
+ fieldKey: options?.fieldKey
1092
+ });
1093
+ const reqOpts = deleteDataCollectionField(payload);
1094
+ sideEffects?.onSiteCall?.();
1095
+ try {
1096
+ const result = await httpClient.request(reqOpts);
1097
+ sideEffects?.onSuccess?.(result);
1098
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1099
+ } catch (err) {
1100
+ const transformedError = sdkTransformError(
1101
+ err,
1102
+ {
1103
+ spreadPathsToArguments: {},
1104
+ explicitPathsToArguments: {
1105
+ dataCollectionId: "$[0]",
1106
+ fieldKey: "$[1].fieldKey"
1107
+ },
1108
+ singleArgumentUnchanged: false
1109
+ },
1110
+ ["dataCollectionId", "options"]
1111
+ );
1112
+ sideEffects?.onError?.(err);
1113
+ throw transformedError;
1114
+ }
1115
+ }
1116
+
1117
+ // src/data-v2-data-collection-collections.public.ts
1118
+ function createDataCollection3(httpClient) {
1119
+ return (collection) => createDataCollection2(
1120
+ collection,
1121
+ // @ts-ignore
1122
+ { httpClient }
1123
+ );
1124
+ }
1125
+ function getDataCollection3(httpClient) {
1126
+ return (dataCollectionId, options) => getDataCollection2(
1127
+ dataCollectionId,
1128
+ options,
1129
+ // @ts-ignore
1130
+ { httpClient }
1131
+ );
1132
+ }
1133
+ function listDataCollections3(httpClient) {
1134
+ return (options) => listDataCollections2(
1135
+ options,
1136
+ // @ts-ignore
1137
+ { httpClient }
1138
+ );
1139
+ }
1140
+ function updateDataCollection3(httpClient) {
1141
+ return (collection) => updateDataCollection2(
1142
+ collection,
1143
+ // @ts-ignore
1144
+ { httpClient }
1145
+ );
1146
+ }
1147
+ function deleteDataCollection3(httpClient) {
1148
+ return (dataCollectionId) => deleteDataCollection2(
1149
+ dataCollectionId,
1150
+ // @ts-ignore
1151
+ { httpClient }
1152
+ );
1153
+ }
1154
+ function restoreDataCollection3(httpClient) {
1155
+ return (dataCollectionId) => restoreDataCollection2(
1156
+ dataCollectionId,
1157
+ // @ts-ignore
1158
+ { httpClient }
1159
+ );
1160
+ }
1161
+ function createDataCollectionField3(httpClient) {
1162
+ return (dataCollectionId, options) => createDataCollectionField2(
1163
+ dataCollectionId,
1164
+ options,
1165
+ // @ts-ignore
1166
+ { httpClient }
1167
+ );
1168
+ }
1169
+ function updateDataCollectionField3(httpClient) {
1170
+ return (dataCollectionId, options) => updateDataCollectionField2(
1171
+ dataCollectionId,
1172
+ options,
1173
+ // @ts-ignore
1174
+ { httpClient }
1175
+ );
1176
+ }
1177
+ function deleteDataCollectionField3(httpClient) {
1178
+ return (dataCollectionId, options) => deleteDataCollectionField2(
1179
+ dataCollectionId,
1180
+ options,
1181
+ // @ts-ignore
1182
+ { httpClient }
1183
+ );
1184
+ }
1185
+
1186
+ // src/data-v2-data-collection-collections.context.ts
1187
+ import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
1188
+ var createDataCollection4 = /* @__PURE__ */ createRESTModule(createDataCollection3);
1189
+ var getDataCollection4 = /* @__PURE__ */ createRESTModule(getDataCollection3);
1190
+ var listDataCollections4 = /* @__PURE__ */ createRESTModule(listDataCollections3);
1191
+ var updateDataCollection4 = /* @__PURE__ */ createRESTModule(updateDataCollection3);
1192
+ var deleteDataCollection4 = /* @__PURE__ */ createRESTModule(deleteDataCollection3);
1193
+ var restoreDataCollection4 = /* @__PURE__ */ createRESTModule(restoreDataCollection3);
1194
+ var createDataCollectionField4 = /* @__PURE__ */ createRESTModule(createDataCollectionField3);
1195
+ var updateDataCollectionField4 = /* @__PURE__ */ createRESTModule(updateDataCollectionField3);
1196
+ var deleteDataCollectionField4 = /* @__PURE__ */ createRESTModule(deleteDataCollectionField3);
1197
+ export {
1198
+ AccessLevel,
1199
+ CollectionOperation,
1200
+ CollectionType,
1201
+ DataOperation,
1202
+ Direction,
1203
+ FieldPluginType,
1204
+ Format,
1205
+ IndexSource,
1206
+ IndexStatus,
1207
+ Order,
1208
+ PagingMode,
1209
+ PluginType,
1210
+ QueryOperator,
1211
+ Role,
1212
+ Segment,
1213
+ SortOrder,
1214
+ Status,
1215
+ Type,
1216
+ WebhookIdentityType,
1217
+ createDataCollection4 as createDataCollection,
1218
+ createDataCollectionField4 as createDataCollectionField,
1219
+ deleteDataCollection4 as deleteDataCollection,
1220
+ deleteDataCollectionField4 as deleteDataCollectionField,
1221
+ getDataCollection4 as getDataCollection,
1222
+ listDataCollections4 as listDataCollections,
1223
+ restoreDataCollection4 as restoreDataCollection,
1224
+ updateDataCollection4 as updateDataCollection,
1225
+ updateDataCollectionField4 as updateDataCollectionField
1226
+ };
1227
+ //# sourceMappingURL=index.mjs.map