@wix/data 1.0.62 → 1.0.63

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 (39) hide show
  1. package/build/cjs/src/data-v1-external-database-connection.http.js +54 -14
  2. package/build/cjs/src/data-v1-external-database-connection.http.js.map +1 -1
  3. package/build/cjs/src/data-v1-external-database-connection.universal.js +144 -44
  4. package/build/cjs/src/data-v1-external-database-connection.universal.js.map +1 -1
  5. package/build/cjs/src/data-v2-data-collection.http.js +29 -10
  6. package/build/cjs/src/data-v2-data-collection.http.js.map +1 -1
  7. package/build/cjs/src/data-v2-data-collection.universal.js +34 -25
  8. package/build/cjs/src/data-v2-data-collection.universal.js.map +1 -1
  9. package/build/cjs/src/data-v2-data-item.http.js +190 -46
  10. package/build/cjs/src/data-v2-data-item.http.js.map +1 -1
  11. package/build/cjs/src/data-v2-data-item.public.d.ts +13 -13
  12. package/build/cjs/src/data-v2-data-item.public.js.map +1 -1
  13. package/build/cjs/src/data-v2-data-item.universal.d.ts +15 -15
  14. package/build/cjs/src/data-v2-data-item.universal.js +664 -345
  15. package/build/cjs/src/data-v2-data-item.universal.js.map +1 -1
  16. package/build/cjs/src/data-v2-index.http.js +28 -10
  17. package/build/cjs/src/data-v2-index.http.js.map +1 -1
  18. package/build/cjs/src/data-v2-index.universal.js +89 -35
  19. package/build/cjs/src/data-v2-index.universal.js.map +1 -1
  20. package/build/es/src/data-v1-external-database-connection.http.js +54 -14
  21. package/build/es/src/data-v1-external-database-connection.http.js.map +1 -1
  22. package/build/es/src/data-v1-external-database-connection.universal.js +144 -44
  23. package/build/es/src/data-v1-external-database-connection.universal.js.map +1 -1
  24. package/build/es/src/data-v2-data-collection.http.js +29 -10
  25. package/build/es/src/data-v2-data-collection.http.js.map +1 -1
  26. package/build/es/src/data-v2-data-collection.universal.js +34 -25
  27. package/build/es/src/data-v2-data-collection.universal.js.map +1 -1
  28. package/build/es/src/data-v2-data-item.http.js +190 -46
  29. package/build/es/src/data-v2-data-item.http.js.map +1 -1
  30. package/build/es/src/data-v2-data-item.public.d.ts +13 -13
  31. package/build/es/src/data-v2-data-item.public.js.map +1 -1
  32. package/build/es/src/data-v2-data-item.universal.d.ts +15 -15
  33. package/build/es/src/data-v2-data-item.universal.js +665 -346
  34. package/build/es/src/data-v2-data-item.universal.js.map +1 -1
  35. package/build/es/src/data-v2-index.http.js +28 -10
  36. package/build/es/src/data-v2-index.http.js.map +1 -1
  37. package/build/es/src/data-v2-index.universal.js +89 -35
  38. package/build/es/src/data-v2-index.universal.js.map +1 -1
  39. package/package.json +2 -2
@@ -34,9 +34,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
35
  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 = exports.BulkActionType = exports.SortOrder = exports.Action = exports.Environment = exports.__debug = void 0;
36
36
  const velo_1 = require("@wix/metro-runtime/velo");
37
- const sdk_runtime_1 = require("@wix/sdk-runtime");
38
37
  const ambassadorWixDataV2DataItem = __importStar(require("./data-v2-data-item.http"));
39
38
  // @ts-ignore
39
+ const motion_edm_autogen_query_wrapper_1 = require("@wix/motion-edm-autogen-query-wrapper");
40
40
  let __verbose = false;
41
41
  function __log(...args) {
42
42
  __verbose && console.log(...args);
@@ -51,6 +51,7 @@ exports.__debug = {
51
51
  },
52
52
  };
53
53
  const _toVeloEntity = '$';
54
+ const _fromVeloEntity = '$';
54
55
  var Environment;
55
56
  (function (Environment) {
56
57
  Environment["LIVE"] = "LIVE";
@@ -74,6 +75,48 @@ var BulkActionType;
74
75
  BulkActionType["UPDATE"] = "UPDATE";
75
76
  BulkActionType["DELETE"] = "DELETE";
76
77
  })(BulkActionType || (exports.BulkActionType = BulkActionType = {}));
78
+ const _aggregateDataItemsRequest = {};
79
+ const _aggregateDataItemsResponse = {};
80
+ const _bulkInsertDataItemReferencesRequest = {};
81
+ const _bulkInsertDataItemReferencesResponse = {};
82
+ const _bulkInsertDataItemsRequest = {};
83
+ const _bulkInsertDataItemsResponse = {};
84
+ const _bulkRemoveDataItemReferencesRequest = {};
85
+ const _bulkRemoveDataItemReferencesResponse = {};
86
+ const _bulkRemoveDataItemsRequest = {};
87
+ const _bulkRemoveDataItemsResponse = {};
88
+ const _bulkSaveDataItemsRequest = {};
89
+ const _bulkSaveDataItemsResponse = {};
90
+ const _bulkUpdateDataItemsRequest = {};
91
+ const _bulkUpdateDataItemsResponse = {};
92
+ const _countDataItemsRequest = {};
93
+ const _countDataItemsResponse = {};
94
+ const _getDataItemRequest = {};
95
+ const _getDataItemResponse = {};
96
+ const _insertDataItemReferenceRequest = {};
97
+ const _insertDataItemReferenceResponse = {};
98
+ const _insertDataItemRequest = {};
99
+ const _insertDataItemResponse = {};
100
+ const _isReferencedDataItemRequest = {};
101
+ const _isReferencedDataItemResponse = {};
102
+ const _queryDataItemsRequest = {};
103
+ const _queryDataItemsResponse = {};
104
+ const _queryDistinctValuesRequest = {};
105
+ const _queryDistinctValuesResponse = {};
106
+ const _queryReferencedDataItemsRequest = {};
107
+ const _queryReferencedDataItemsResponse = {};
108
+ const _removeDataItemReferenceRequest = {};
109
+ const _removeDataItemReferenceResponse = {};
110
+ const _removeDataItemRequest = {};
111
+ const _removeDataItemResponse = {};
112
+ const _replaceDataItemReferencesRequest = {};
113
+ const _replaceDataItemReferencesResponse = {};
114
+ const _saveDataItemRequest = {};
115
+ const _saveDataItemResponse = {};
116
+ const _truncateDataItemsRequest = {};
117
+ const _truncateDataItemsResponse = {};
118
+ const _updateDataItemRequest = {};
119
+ const _updateDataItemResponse = {};
77
120
  /**
78
121
  * Adds an item to a collection.
79
122
  *
@@ -98,31 +141,44 @@ var BulkActionType;
98
141
  function insertDataItem(options) {
99
142
  var _a, _b, _c;
100
143
  return __awaiter(this, arguments, void 0, function* () {
144
+ const requestTransformation = {
145
+ dataCollectionId: '$[0].dataCollectionId',
146
+ dataItem: '$[0].dataItem',
147
+ };
148
+ const responseTransformation = '$';
101
149
  // @ts-ignore
102
150
  const { httpClient, sideEffects } = arguments[1];
103
- const payload = (0, sdk_runtime_1.renameKeysFromSDKRequestToRESTRequest)({
104
- dataCollectionId: options === null || options === void 0 ? void 0 : options.dataCollectionId,
105
- dataItem: options === null || options === void 0 ? void 0 : options.dataItem,
106
- }, ['dataItem.data']);
151
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
152
+ rootSchema: _insertDataItemRequest,
153
+ depSchemas: {},
154
+ fqdnTransformation: {
155
+ paths: [...['dataItem']],
156
+ transformation: _fromVeloEntity,
157
+ },
158
+ customTransformation: requestTransformation,
159
+ });
160
+ const { fromJSON } = (0, velo_1.serializer)({
161
+ rootSchema: _insertDataItemResponse,
162
+ depSchemas: {},
163
+ fqdnTransformation: {
164
+ paths: [...['dataItem']],
165
+ transformation: _toVeloEntity,
166
+ },
167
+ customTransformation: responseTransformation,
168
+ });
169
+ const payload = toAmbassadorRequest([options], ['dataItem.data']);
107
170
  const reqOpts = ambassadorWixDataV2DataItem.insertDataItem(payload);
108
171
  __log(`"InsertDataItem" sending request with: ${__inspect(reqOpts)}`);
109
172
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
110
173
  try {
111
174
  const result = yield httpClient.request(reqOpts);
112
175
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
113
- return (0, sdk_runtime_1.renameKeysFromRESTResponseToSDKResponse)(result.data, [
114
- 'dataItem.data',
115
- ]);
176
+ return fromJSON(result.data, ['dataItem.data']);
116
177
  }
117
178
  catch (err) {
118
- const transformedError = (0, sdk_runtime_1.transformError)(err, {
119
- spreadPathsToArguments: {},
120
- explicitPathsToArguments: {
121
- dataCollectionId: '$[0].dataCollectionId',
122
- dataItem: '$[0].dataItem',
123
- },
124
- singleArgumentUnchanged: false,
125
- }, ['options']);
179
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
180
+ 'options',
181
+ ]);
126
182
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
127
183
  throw transformedError;
128
184
  }
@@ -158,31 +214,45 @@ exports.insertDataItem = insertDataItem;
158
214
  function updateDataItem(_id, options) {
159
215
  var _a, _b, _c;
160
216
  return __awaiter(this, arguments, void 0, function* () {
217
+ const requestTransformation = {
218
+ dataItem: { '*': '$[1].dataItem', id: '$[0]' },
219
+ dataCollectionId: '$[1].dataCollectionId',
220
+ };
221
+ const responseTransformation = '$';
161
222
  // @ts-ignore
162
223
  const { httpClient, sideEffects } = arguments[2];
163
- const payload = (0, sdk_runtime_1.renameKeysFromSDKRequestToRESTRequest)({
164
- dataItem: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.dataItem), { id: _id }),
165
- dataCollectionId: options === null || options === void 0 ? void 0 : options.dataCollectionId,
166
- }, ['dataItem.data']);
224
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
225
+ rootSchema: _updateDataItemRequest,
226
+ depSchemas: {},
227
+ fqdnTransformation: {
228
+ paths: [...['dataItem']],
229
+ transformation: _fromVeloEntity,
230
+ },
231
+ customTransformation: requestTransformation,
232
+ });
233
+ const { fromJSON } = (0, velo_1.serializer)({
234
+ rootSchema: _updateDataItemResponse,
235
+ depSchemas: {},
236
+ fqdnTransformation: {
237
+ paths: [...['dataItem']],
238
+ transformation: _toVeloEntity,
239
+ },
240
+ customTransformation: responseTransformation,
241
+ });
242
+ const payload = toAmbassadorRequest([_id, options], ['dataItem.data']);
167
243
  const reqOpts = ambassadorWixDataV2DataItem.updateDataItem(payload);
168
244
  __log(`"UpdateDataItem" sending request with: ${__inspect(reqOpts)}`);
169
245
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
170
246
  try {
171
247
  const result = yield httpClient.request(reqOpts);
172
248
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
173
- return (0, sdk_runtime_1.renameKeysFromRESTResponseToSDKResponse)(result.data, [
174
- 'dataItem.data',
175
- ]);
249
+ return fromJSON(result.data, ['dataItem.data']);
176
250
  }
177
251
  catch (err) {
178
- const transformedError = (0, sdk_runtime_1.transformError)(err, {
179
- spreadPathsToArguments: { dataItem: '$[1].dataItem' },
180
- explicitPathsToArguments: {
181
- 'dataItem.id': '$[0]',
182
- dataCollectionId: '$[1].dataCollectionId',
183
- },
184
- singleArgumentUnchanged: false,
185
- }, ['_id', 'options']);
252
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
253
+ '_id',
254
+ 'options',
255
+ ]);
186
256
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
187
257
  throw transformedError;
188
258
  }
@@ -215,31 +285,44 @@ exports.updateDataItem = updateDataItem;
215
285
  function saveDataItem(options) {
216
286
  var _a, _b, _c;
217
287
  return __awaiter(this, arguments, void 0, function* () {
288
+ const requestTransformation = {
289
+ dataCollectionId: '$[0].dataCollectionId',
290
+ dataItem: '$[0].dataItem',
291
+ };
292
+ const responseTransformation = '$';
218
293
  // @ts-ignore
219
294
  const { httpClient, sideEffects } = arguments[1];
220
- const payload = (0, sdk_runtime_1.renameKeysFromSDKRequestToRESTRequest)({
221
- dataCollectionId: options === null || options === void 0 ? void 0 : options.dataCollectionId,
222
- dataItem: options === null || options === void 0 ? void 0 : options.dataItem,
223
- }, ['dataItem.data']);
295
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
296
+ rootSchema: _saveDataItemRequest,
297
+ depSchemas: {},
298
+ fqdnTransformation: {
299
+ paths: [...['dataItem']],
300
+ transformation: _fromVeloEntity,
301
+ },
302
+ customTransformation: requestTransformation,
303
+ });
304
+ const { fromJSON } = (0, velo_1.serializer)({
305
+ rootSchema: _saveDataItemResponse,
306
+ depSchemas: {},
307
+ fqdnTransformation: {
308
+ paths: [...['dataItem']],
309
+ transformation: _toVeloEntity,
310
+ },
311
+ customTransformation: responseTransformation,
312
+ });
313
+ const payload = toAmbassadorRequest([options], ['dataItem.data']);
224
314
  const reqOpts = ambassadorWixDataV2DataItem.saveDataItem(payload);
225
315
  __log(`"SaveDataItem" sending request with: ${__inspect(reqOpts)}`);
226
316
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
227
317
  try {
228
318
  const result = yield httpClient.request(reqOpts);
229
319
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
230
- return (0, sdk_runtime_1.renameKeysFromRESTResponseToSDKResponse)(result.data, [
231
- 'dataItem.data',
232
- ]);
320
+ return fromJSON(result.data, ['dataItem.data']);
233
321
  }
234
322
  catch (err) {
235
- const transformedError = (0, sdk_runtime_1.transformError)(err, {
236
- spreadPathsToArguments: {},
237
- explicitPathsToArguments: {
238
- dataCollectionId: '$[0].dataCollectionId',
239
- dataItem: '$[0].dataItem',
240
- },
241
- singleArgumentUnchanged: false,
242
- }, ['options']);
323
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
324
+ 'options',
325
+ ]);
243
326
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
244
327
  throw transformedError;
245
328
  }
@@ -262,36 +345,49 @@ exports.saveDataItem = saveDataItem;
262
345
  * @returns Retrieved item.
263
346
  */
264
347
  function getDataItem(dataItemId, options) {
265
- var _a, _b, _c, _d;
348
+ var _a, _b, _c;
266
349
  return __awaiter(this, arguments, void 0, function* () {
350
+ const requestTransformation = {
351
+ dataItemId: '$[0]',
352
+ dataCollectionId: '$[1].dataCollectionId',
353
+ consistentRead: '$[1].consistentRead',
354
+ };
355
+ const responseTransformation = '$.dataItem';
267
356
  // @ts-ignore
268
357
  const { httpClient, sideEffects } = arguments[2];
269
- const payload = (0, sdk_runtime_1.renameKeysFromSDKRequestToRESTRequest)({
270
- dataItemId: dataItemId,
271
- dataCollectionId: options === null || options === void 0 ? void 0 : options.dataCollectionId,
272
- consistentRead: options === null || options === void 0 ? void 0 : options.consistentRead,
273
- }, []);
358
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
359
+ rootSchema: _getDataItemRequest,
360
+ depSchemas: {},
361
+ fqdnTransformation: {
362
+ paths: [],
363
+ transformation: _fromVeloEntity,
364
+ },
365
+ customTransformation: requestTransformation,
366
+ });
367
+ const { fromJSON } = (0, velo_1.serializer)({
368
+ rootSchema: _getDataItemResponse,
369
+ depSchemas: {},
370
+ fqdnTransformation: {
371
+ paths: [...['dataItem']],
372
+ transformation: _toVeloEntity,
373
+ },
374
+ customTransformation: responseTransformation,
375
+ });
376
+ const payload = toAmbassadorRequest([dataItemId, options], []);
274
377
  const reqOpts = ambassadorWixDataV2DataItem.getDataItem(payload);
275
378
  __log(`"GetDataItem" sending request with: ${__inspect(reqOpts)}`);
276
379
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
277
380
  try {
278
381
  const result = yield httpClient.request(reqOpts);
279
382
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
280
- return (0, sdk_runtime_1.renameKeysFromRESTResponseToSDKResponse)((_c = result.data) === null || _c === void 0 ? void 0 : _c.dataItem, [
281
- 'dataItem.data',
282
- ]);
383
+ return fromJSON(result.data, ['dataItem.data']);
283
384
  }
284
385
  catch (err) {
285
- const transformedError = (0, sdk_runtime_1.transformError)(err, {
286
- spreadPathsToArguments: {},
287
- explicitPathsToArguments: {
288
- dataItemId: '$[0]',
289
- dataCollectionId: '$[1].dataCollectionId',
290
- consistentRead: '$[1].consistentRead',
291
- },
292
- singleArgumentUnchanged: false,
293
- }, ['dataItemId', 'options']);
294
- (_d = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _d === void 0 ? void 0 : _d.call(sideEffects, err);
386
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
387
+ 'dataItemId',
388
+ 'options',
389
+ ]);
390
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
295
391
  throw transformedError;
296
392
  }
297
393
  });
@@ -318,28 +414,45 @@ exports.getDataItem = getDataItem;
318
414
  function removeDataItem(dataItemId, options) {
319
415
  var _a, _b, _c;
320
416
  return __awaiter(this, arguments, void 0, function* () {
417
+ const requestTransformation = {
418
+ dataItemId: '$[0]',
419
+ dataCollectionId: '$[1].dataCollectionId',
420
+ };
421
+ const responseTransformation = '$';
321
422
  // @ts-ignore
322
423
  const { httpClient, sideEffects } = arguments[2];
323
- const payload = (0, sdk_runtime_1.renameKeysFromSDKRequestToRESTRequest)({ dataItemId: dataItemId, dataCollectionId: options === null || options === void 0 ? void 0 : options.dataCollectionId }, []);
424
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
425
+ rootSchema: _removeDataItemRequest,
426
+ depSchemas: {},
427
+ fqdnTransformation: {
428
+ paths: [],
429
+ transformation: _fromVeloEntity,
430
+ },
431
+ customTransformation: requestTransformation,
432
+ });
433
+ const { fromJSON } = (0, velo_1.serializer)({
434
+ rootSchema: _removeDataItemResponse,
435
+ depSchemas: {},
436
+ fqdnTransformation: {
437
+ paths: [...['dataItem']],
438
+ transformation: _toVeloEntity,
439
+ },
440
+ customTransformation: responseTransformation,
441
+ });
442
+ const payload = toAmbassadorRequest([dataItemId, options], []);
324
443
  const reqOpts = ambassadorWixDataV2DataItem.removeDataItem(payload);
325
444
  __log(`"RemoveDataItem" sending request with: ${__inspect(reqOpts)}`);
326
445
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
327
446
  try {
328
447
  const result = yield httpClient.request(reqOpts);
329
448
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
330
- return (0, sdk_runtime_1.renameKeysFromRESTResponseToSDKResponse)(result.data, [
331
- 'dataItem.data',
332
- ]);
449
+ return fromJSON(result.data, ['dataItem.data']);
333
450
  }
334
451
  catch (err) {
335
- const transformedError = (0, sdk_runtime_1.transformError)(err, {
336
- spreadPathsToArguments: {},
337
- explicitPathsToArguments: {
338
- dataItemId: '$[0]',
339
- dataCollectionId: '$[1].dataCollectionId',
340
- },
341
- singleArgumentUnchanged: false,
342
- }, ['dataItemId', 'options']);
452
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
453
+ 'dataItemId',
454
+ 'options',
455
+ ]);
343
456
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
344
457
  throw transformedError;
345
458
  }
@@ -365,22 +478,41 @@ exports.removeDataItem = removeDataItem;
365
478
  function truncateDataItems(options) {
366
479
  var _a, _b, _c;
367
480
  return __awaiter(this, arguments, void 0, function* () {
481
+ const requestTransformation = { dataCollectionId: '$[0].dataCollectionId' };
482
+ const responseTransformation = '$';
368
483
  // @ts-ignore
369
484
  const { httpClient, sideEffects } = arguments[1];
370
- const payload = (0, sdk_runtime_1.renameKeysFromSDKRequestToRESTRequest)({ dataCollectionId: options === null || options === void 0 ? void 0 : options.dataCollectionId }, []);
485
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
486
+ rootSchema: _truncateDataItemsRequest,
487
+ depSchemas: {},
488
+ fqdnTransformation: {
489
+ paths: [],
490
+ transformation: _fromVeloEntity,
491
+ },
492
+ customTransformation: requestTransformation,
493
+ });
494
+ const { fromJSON } = (0, velo_1.serializer)({
495
+ rootSchema: _truncateDataItemsResponse,
496
+ depSchemas: {},
497
+ fqdnTransformation: {
498
+ paths: [],
499
+ transformation: _toVeloEntity,
500
+ },
501
+ customTransformation: responseTransformation,
502
+ });
503
+ const payload = toAmbassadorRequest([options], []);
371
504
  const reqOpts = ambassadorWixDataV2DataItem.truncateDataItems(payload);
372
505
  __log(`"TruncateDataItems" sending request with: ${__inspect(reqOpts)}`);
373
506
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
374
507
  try {
375
508
  const result = yield httpClient.request(reqOpts);
376
509
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
510
+ return fromJSON(result.data, []);
377
511
  }
378
512
  catch (err) {
379
- const transformedError = (0, sdk_runtime_1.transformError)(err, {
380
- spreadPathsToArguments: {},
381
- explicitPathsToArguments: { dataCollectionId: '$[0].dataCollectionId' },
382
- singleArgumentUnchanged: false,
383
- }, ['options']);
513
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
514
+ 'options',
515
+ ]);
384
516
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
385
517
  throw transformedError;
386
518
  }
@@ -417,9 +549,32 @@ exports.truncateDataItems = truncateDataItems;
417
549
  * @applicableIdentity APP
418
550
  */
419
551
  function queryDataItems(options) {
552
+ const requestTransformation = { '*': '$[1]', query: '$[0]' };
553
+ const responseTransformation = {
554
+ items: '$.dataItems',
555
+ pagingMetadata: '$.pagingMetadata',
556
+ };
420
557
  // @ts-ignore
421
558
  const { httpClient, sideEffects } = arguments[1];
422
- return (0, sdk_runtime_1.queryBuilder)({
559
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
560
+ rootSchema: _queryDataItemsRequest,
561
+ depSchemas: {},
562
+ fqdnTransformation: {
563
+ paths: [],
564
+ transformation: _fromVeloEntity,
565
+ },
566
+ customTransformation: requestTransformation,
567
+ });
568
+ const { fromJSON } = (0, velo_1.serializer)({
569
+ rootSchema: _queryDataItemsResponse,
570
+ depSchemas: {},
571
+ fqdnTransformation: {
572
+ paths: [...['Array#dataItems']],
573
+ transformation: _toVeloEntity,
574
+ },
575
+ customTransformation: responseTransformation,
576
+ });
577
+ return (0, motion_edm_autogen_query_wrapper_1.wrapWithQueryBuilder)({
423
578
  func: (payload) => __awaiter(this, void 0, void 0, function* () {
424
579
  var _a, _b, _c;
425
580
  const reqOpts = ambassadorWixDataV2DataItem.queryDataItems(Object.assign(Object.assign({}, payload), options));
@@ -434,22 +589,15 @@ function queryDataItems(options) {
434
589
  throw err;
435
590
  }
436
591
  }),
437
- requestTransformer: (query) => {
438
- const args = [query, options];
439
- return (0, sdk_runtime_1.renameKeysFromSDKRequestToRESTRequest)(Object.assign(Object.assign({}, args === null || args === void 0 ? void 0 : args[1]), { query: args === null || args === void 0 ? void 0 : args[0] }), []);
440
- },
441
- responseTransformer: ({ data }) => (0, sdk_runtime_1.renameKeysFromRESTResponseToSDKResponse)({ items: data === null || data === void 0 ? void 0 : data.dataItems, pagingMetadata: data === null || data === void 0 ? void 0 : data.pagingMetadata }, ['dataItems.data']),
592
+ requestTransformer: (...args) => toAmbassadorRequest(args, []),
593
+ responseTransformer: ({ data }) => fromJSON(data, ['dataItems.data']),
442
594
  errorTransformer: (err) => {
443
- const transformedError = (0, sdk_runtime_1.transformError)(err, {
444
- spreadPathsToArguments: {},
445
- explicitPathsToArguments: { query: '$[0]' },
446
- singleArgumentUnchanged: false,
447
- });
595
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation);
448
596
  throw transformedError;
449
597
  },
450
598
  pagingMethod: 'OFFSET',
451
599
  transformationPaths: (0, velo_1.resolveQueryFieldsTransformationPaths)(_toVeloEntity),
452
- });
600
+ })({ cursorWithEmptyFilterAndSort: true });
453
601
  }
454
602
  exports.queryDataItems = queryDataItems;
455
603
  /**
@@ -468,43 +616,51 @@ exports.queryDataItems = queryDataItems;
468
616
  function aggregateDataItems(options) {
469
617
  var _a, _b, _c;
470
618
  return __awaiter(this, arguments, void 0, function* () {
619
+ const requestTransformation = {
620
+ dataCollectionId: '$[0].dataCollectionId',
621
+ initialFilter: '$[0].initialFilter',
622
+ aggregation: '$[0].aggregation',
623
+ finalFilter: '$[0].finalFilter',
624
+ paging: '$[0].paging',
625
+ cursorPaging: '$[0].cursorPaging',
626
+ sort: '$[0].sort',
627
+ returnTotalCount: '$[0].returnTotalCount',
628
+ consistentRead: '$[0].consistentRead',
629
+ };
630
+ const responseTransformation = '$';
471
631
  // @ts-ignore
472
632
  const { httpClient, sideEffects } = arguments[1];
473
- const payload = (0, sdk_runtime_1.renameKeysFromSDKRequestToRESTRequest)({
474
- dataCollectionId: options === null || options === void 0 ? void 0 : options.dataCollectionId,
475
- initialFilter: options === null || options === void 0 ? void 0 : options.initialFilter,
476
- aggregation: options === null || options === void 0 ? void 0 : options.aggregation,
477
- finalFilter: options === null || options === void 0 ? void 0 : options.finalFilter,
478
- paging: options === null || options === void 0 ? void 0 : options.paging,
479
- cursorPaging: options === null || options === void 0 ? void 0 : options.cursorPaging,
480
- sort: options === null || options === void 0 ? void 0 : options.sort,
481
- returnTotalCount: options === null || options === void 0 ? void 0 : options.returnTotalCount,
482
- consistentRead: options === null || options === void 0 ? void 0 : options.consistentRead,
483
- }, []);
633
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
634
+ rootSchema: _aggregateDataItemsRequest,
635
+ depSchemas: {},
636
+ fqdnTransformation: {
637
+ paths: [],
638
+ transformation: _fromVeloEntity,
639
+ },
640
+ customTransformation: requestTransformation,
641
+ });
642
+ const { fromJSON } = (0, velo_1.serializer)({
643
+ rootSchema: _aggregateDataItemsResponse,
644
+ depSchemas: {},
645
+ fqdnTransformation: {
646
+ paths: [],
647
+ transformation: _toVeloEntity,
648
+ },
649
+ customTransformation: responseTransformation,
650
+ });
651
+ const payload = toAmbassadorRequest([options], []);
484
652
  const reqOpts = ambassadorWixDataV2DataItem.aggregateDataItems(payload);
485
653
  __log(`"AggregateDataItems" sending request with: ${__inspect(reqOpts)}`);
486
654
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
487
655
  try {
488
656
  const result = yield httpClient.request(reqOpts);
489
657
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
490
- return (0, sdk_runtime_1.renameKeysFromRESTResponseToSDKResponse)(result.data, []);
658
+ return fromJSON(result.data, []);
491
659
  }
492
660
  catch (err) {
493
- const transformedError = (0, sdk_runtime_1.transformError)(err, {
494
- spreadPathsToArguments: {},
495
- explicitPathsToArguments: {
496
- dataCollectionId: '$[0].dataCollectionId',
497
- initialFilter: '$[0].initialFilter',
498
- aggregation: '$[0].aggregation',
499
- finalFilter: '$[0].finalFilter',
500
- paging: '$[0].paging',
501
- cursorPaging: '$[0].cursorPaging',
502
- sort: '$[0].sort',
503
- returnTotalCount: '$[0].returnTotalCount',
504
- consistentRead: '$[0].consistentRead',
505
- },
506
- singleArgumentUnchanged: false,
507
- }, ['options']);
661
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
662
+ 'options',
663
+ ]);
508
664
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
509
665
  throw transformedError;
510
666
  }
@@ -525,31 +681,45 @@ exports.aggregateDataItems = aggregateDataItems;
525
681
  function countDataItems(options) {
526
682
  var _a, _b, _c;
527
683
  return __awaiter(this, arguments, void 0, function* () {
684
+ const requestTransformation = {
685
+ dataCollectionId: '$[0].dataCollectionId',
686
+ filter: '$[0].filter',
687
+ consistentRead: '$[0].consistentRead',
688
+ };
689
+ const responseTransformation = '$';
528
690
  // @ts-ignore
529
691
  const { httpClient, sideEffects } = arguments[1];
530
- const payload = (0, sdk_runtime_1.renameKeysFromSDKRequestToRESTRequest)({
531
- dataCollectionId: options === null || options === void 0 ? void 0 : options.dataCollectionId,
532
- filter: options === null || options === void 0 ? void 0 : options.filter,
533
- consistentRead: options === null || options === void 0 ? void 0 : options.consistentRead,
534
- }, []);
692
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
693
+ rootSchema: _countDataItemsRequest,
694
+ depSchemas: {},
695
+ fqdnTransformation: {
696
+ paths: [],
697
+ transformation: _fromVeloEntity,
698
+ },
699
+ customTransformation: requestTransformation,
700
+ });
701
+ const { fromJSON } = (0, velo_1.serializer)({
702
+ rootSchema: _countDataItemsResponse,
703
+ depSchemas: {},
704
+ fqdnTransformation: {
705
+ paths: [],
706
+ transformation: _toVeloEntity,
707
+ },
708
+ customTransformation: responseTransformation,
709
+ });
710
+ const payload = toAmbassadorRequest([options], []);
535
711
  const reqOpts = ambassadorWixDataV2DataItem.countDataItems(payload);
536
712
  __log(`"CountDataItems" sending request with: ${__inspect(reqOpts)}`);
537
713
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
538
714
  try {
539
715
  const result = yield httpClient.request(reqOpts);
540
716
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
541
- return (0, sdk_runtime_1.renameKeysFromRESTResponseToSDKResponse)(result.data, []);
717
+ return fromJSON(result.data, []);
542
718
  }
543
719
  catch (err) {
544
- const transformedError = (0, sdk_runtime_1.transformError)(err, {
545
- spreadPathsToArguments: {},
546
- explicitPathsToArguments: {
547
- dataCollectionId: '$[0].dataCollectionId',
548
- filter: '$[0].filter',
549
- consistentRead: '$[0].consistentRead',
550
- },
551
- singleArgumentUnchanged: false,
552
- }, ['options']);
720
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
721
+ 'options',
722
+ ]);
553
723
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
554
724
  throw transformedError;
555
725
  }
@@ -578,41 +748,50 @@ exports.countDataItems = countDataItems;
578
748
  function queryDistinctValues(options) {
579
749
  var _a, _b, _c;
580
750
  return __awaiter(this, arguments, void 0, function* () {
751
+ const requestTransformation = {
752
+ dataCollectionId: '$[0].dataCollectionId',
753
+ fieldName: '$[0].fieldName',
754
+ filter: '$[0].filter',
755
+ order: '$[0].order',
756
+ paging: '$[0].paging',
757
+ cursorPaging: '$[0].cursorPaging',
758
+ returnTotalCount: '$[0].returnTotalCount',
759
+ consistentRead: '$[0].consistentRead',
760
+ };
761
+ const responseTransformation = '$';
581
762
  // @ts-ignore
582
763
  const { httpClient, sideEffects } = arguments[1];
583
- const payload = (0, sdk_runtime_1.renameKeysFromSDKRequestToRESTRequest)({
584
- dataCollectionId: options === null || options === void 0 ? void 0 : options.dataCollectionId,
585
- fieldName: options === null || options === void 0 ? void 0 : options.fieldName,
586
- filter: options === null || options === void 0 ? void 0 : options.filter,
587
- order: options === null || options === void 0 ? void 0 : options.order,
588
- paging: options === null || options === void 0 ? void 0 : options.paging,
589
- cursorPaging: options === null || options === void 0 ? void 0 : options.cursorPaging,
590
- returnTotalCount: options === null || options === void 0 ? void 0 : options.returnTotalCount,
591
- consistentRead: options === null || options === void 0 ? void 0 : options.consistentRead,
592
- }, []);
764
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
765
+ rootSchema: _queryDistinctValuesRequest,
766
+ depSchemas: {},
767
+ fqdnTransformation: {
768
+ paths: [],
769
+ transformation: _fromVeloEntity,
770
+ },
771
+ customTransformation: requestTransformation,
772
+ });
773
+ const { fromJSON } = (0, velo_1.serializer)({
774
+ rootSchema: _queryDistinctValuesResponse,
775
+ depSchemas: {},
776
+ fqdnTransformation: {
777
+ paths: [],
778
+ transformation: _toVeloEntity,
779
+ },
780
+ customTransformation: responseTransformation,
781
+ });
782
+ const payload = toAmbassadorRequest([options], []);
593
783
  const reqOpts = ambassadorWixDataV2DataItem.queryDistinctValues(payload);
594
784
  __log(`"QueryDistinctValues" sending request with: ${__inspect(reqOpts)}`);
595
785
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
596
786
  try {
597
787
  const result = yield httpClient.request(reqOpts);
598
788
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
599
- return (0, sdk_runtime_1.renameKeysFromRESTResponseToSDKResponse)(result.data, []);
789
+ return fromJSON(result.data, []);
600
790
  }
601
791
  catch (err) {
602
- const transformedError = (0, sdk_runtime_1.transformError)(err, {
603
- spreadPathsToArguments: {},
604
- explicitPathsToArguments: {
605
- dataCollectionId: '$[0].dataCollectionId',
606
- fieldName: '$[0].fieldName',
607
- filter: '$[0].filter',
608
- order: '$[0].order',
609
- paging: '$[0].paging',
610
- cursorPaging: '$[0].cursorPaging',
611
- returnTotalCount: '$[0].returnTotalCount',
612
- consistentRead: '$[0].consistentRead',
613
- },
614
- singleArgumentUnchanged: false,
615
- }, ['options']);
792
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
793
+ 'options',
794
+ ]);
616
795
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
617
796
  throw transformedError;
618
797
  }
@@ -636,33 +815,45 @@ exports.queryDistinctValues = queryDistinctValues;
636
815
  function bulkInsertDataItems(options) {
637
816
  var _a, _b, _c;
638
817
  return __awaiter(this, arguments, void 0, function* () {
818
+ const requestTransformation = {
819
+ dataCollectionId: '$[0].dataCollectionId',
820
+ dataItems: '$[0].dataItems',
821
+ returnEntity: '$[0].returnEntity',
822
+ };
823
+ const responseTransformation = '$';
639
824
  // @ts-ignore
640
825
  const { httpClient, sideEffects } = arguments[1];
641
- const payload = (0, sdk_runtime_1.renameKeysFromSDKRequestToRESTRequest)({
642
- dataCollectionId: options === null || options === void 0 ? void 0 : options.dataCollectionId,
643
- dataItems: options === null || options === void 0 ? void 0 : options.dataItems,
644
- returnEntity: options === null || options === void 0 ? void 0 : options.returnEntity,
645
- }, ['dataItems.data']);
826
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
827
+ rootSchema: _bulkInsertDataItemsRequest,
828
+ depSchemas: {},
829
+ fqdnTransformation: {
830
+ paths: [...['Array#dataItems']],
831
+ transformation: _fromVeloEntity,
832
+ },
833
+ customTransformation: requestTransformation,
834
+ });
835
+ const { fromJSON } = (0, velo_1.serializer)({
836
+ rootSchema: _bulkInsertDataItemsResponse,
837
+ depSchemas: {},
838
+ fqdnTransformation: {
839
+ paths: [...['Array#results.dataItem']],
840
+ transformation: _toVeloEntity,
841
+ },
842
+ customTransformation: responseTransformation,
843
+ });
844
+ const payload = toAmbassadorRequest([options], ['dataItems.data']);
646
845
  const reqOpts = ambassadorWixDataV2DataItem.bulkInsertDataItems(payload);
647
846
  __log(`"BulkInsertDataItems" sending request with: ${__inspect(reqOpts)}`);
648
847
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
649
848
  try {
650
849
  const result = yield httpClient.request(reqOpts);
651
850
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
652
- return (0, sdk_runtime_1.renameKeysFromRESTResponseToSDKResponse)(result.data, [
653
- 'results.dataItem.data',
654
- ]);
851
+ return fromJSON(result.data, ['results.dataItem.data']);
655
852
  }
656
853
  catch (err) {
657
- const transformedError = (0, sdk_runtime_1.transformError)(err, {
658
- spreadPathsToArguments: {},
659
- explicitPathsToArguments: {
660
- dataCollectionId: '$[0].dataCollectionId',
661
- dataItems: '$[0].dataItems',
662
- returnEntity: '$[0].returnEntity',
663
- },
664
- singleArgumentUnchanged: false,
665
- }, ['options']);
854
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
855
+ 'options',
856
+ ]);
666
857
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
667
858
  throw transformedError;
668
859
  }
@@ -694,33 +885,45 @@ exports.bulkInsertDataItems = bulkInsertDataItems;
694
885
  function bulkUpdateDataItems(options) {
695
886
  var _a, _b, _c;
696
887
  return __awaiter(this, arguments, void 0, function* () {
888
+ const requestTransformation = {
889
+ dataCollectionId: '$[0].dataCollectionId',
890
+ dataItems: '$[0].dataItems',
891
+ returnEntity: '$[0].returnEntity',
892
+ };
893
+ const responseTransformation = '$';
697
894
  // @ts-ignore
698
895
  const { httpClient, sideEffects } = arguments[1];
699
- const payload = (0, sdk_runtime_1.renameKeysFromSDKRequestToRESTRequest)({
700
- dataCollectionId: options === null || options === void 0 ? void 0 : options.dataCollectionId,
701
- dataItems: options === null || options === void 0 ? void 0 : options.dataItems,
702
- returnEntity: options === null || options === void 0 ? void 0 : options.returnEntity,
703
- }, ['dataItems.data']);
896
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
897
+ rootSchema: _bulkUpdateDataItemsRequest,
898
+ depSchemas: {},
899
+ fqdnTransformation: {
900
+ paths: [...['Array#dataItems']],
901
+ transformation: _fromVeloEntity,
902
+ },
903
+ customTransformation: requestTransformation,
904
+ });
905
+ const { fromJSON } = (0, velo_1.serializer)({
906
+ rootSchema: _bulkUpdateDataItemsResponse,
907
+ depSchemas: {},
908
+ fqdnTransformation: {
909
+ paths: [...['Array#results.dataItem']],
910
+ transformation: _toVeloEntity,
911
+ },
912
+ customTransformation: responseTransformation,
913
+ });
914
+ const payload = toAmbassadorRequest([options], ['dataItems.data']);
704
915
  const reqOpts = ambassadorWixDataV2DataItem.bulkUpdateDataItems(payload);
705
916
  __log(`"BulkUpdateDataItems" sending request with: ${__inspect(reqOpts)}`);
706
917
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
707
918
  try {
708
919
  const result = yield httpClient.request(reqOpts);
709
920
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
710
- return (0, sdk_runtime_1.renameKeysFromRESTResponseToSDKResponse)(result.data, [
711
- 'results.dataItem.data',
712
- ]);
921
+ return fromJSON(result.data, ['results.dataItem.data']);
713
922
  }
714
923
  catch (err) {
715
- const transformedError = (0, sdk_runtime_1.transformError)(err, {
716
- spreadPathsToArguments: {},
717
- explicitPathsToArguments: {
718
- dataCollectionId: '$[0].dataCollectionId',
719
- dataItems: '$[0].dataItems',
720
- returnEntity: '$[0].returnEntity',
721
- },
722
- singleArgumentUnchanged: false,
723
- }, ['options']);
924
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
925
+ 'options',
926
+ ]);
724
927
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
725
928
  throw transformedError;
726
929
  }
@@ -752,33 +955,45 @@ exports.bulkUpdateDataItems = bulkUpdateDataItems;
752
955
  function bulkSaveDataItems(options) {
753
956
  var _a, _b, _c;
754
957
  return __awaiter(this, arguments, void 0, function* () {
958
+ const requestTransformation = {
959
+ dataCollectionId: '$[0].dataCollectionId',
960
+ dataItems: '$[0].dataItems',
961
+ returnEntity: '$[0].returnEntity',
962
+ };
963
+ const responseTransformation = '$';
755
964
  // @ts-ignore
756
965
  const { httpClient, sideEffects } = arguments[1];
757
- const payload = (0, sdk_runtime_1.renameKeysFromSDKRequestToRESTRequest)({
758
- dataCollectionId: options === null || options === void 0 ? void 0 : options.dataCollectionId,
759
- dataItems: options === null || options === void 0 ? void 0 : options.dataItems,
760
- returnEntity: options === null || options === void 0 ? void 0 : options.returnEntity,
761
- }, ['dataItems.data']);
966
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
967
+ rootSchema: _bulkSaveDataItemsRequest,
968
+ depSchemas: {},
969
+ fqdnTransformation: {
970
+ paths: [...['Array#dataItems']],
971
+ transformation: _fromVeloEntity,
972
+ },
973
+ customTransformation: requestTransformation,
974
+ });
975
+ const { fromJSON } = (0, velo_1.serializer)({
976
+ rootSchema: _bulkSaveDataItemsResponse,
977
+ depSchemas: {},
978
+ fqdnTransformation: {
979
+ paths: [...['Array#results.dataItem']],
980
+ transformation: _toVeloEntity,
981
+ },
982
+ customTransformation: responseTransformation,
983
+ });
984
+ const payload = toAmbassadorRequest([options], ['dataItems.data']);
762
985
  const reqOpts = ambassadorWixDataV2DataItem.bulkSaveDataItems(payload);
763
986
  __log(`"BulkSaveDataItems" sending request with: ${__inspect(reqOpts)}`);
764
987
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
765
988
  try {
766
989
  const result = yield httpClient.request(reqOpts);
767
990
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
768
- return (0, sdk_runtime_1.renameKeysFromRESTResponseToSDKResponse)(result.data, [
769
- 'results.dataItem.data',
770
- ]);
991
+ return fromJSON(result.data, ['results.dataItem.data']);
771
992
  }
772
993
  catch (err) {
773
- const transformedError = (0, sdk_runtime_1.transformError)(err, {
774
- spreadPathsToArguments: {},
775
- explicitPathsToArguments: {
776
- dataCollectionId: '$[0].dataCollectionId',
777
- dataItems: '$[0].dataItems',
778
- returnEntity: '$[0].returnEntity',
779
- },
780
- singleArgumentUnchanged: false,
781
- }, ['options']);
994
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
995
+ 'options',
996
+ ]);
782
997
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
783
998
  throw transformedError;
784
999
  }
@@ -804,31 +1019,44 @@ exports.bulkSaveDataItems = bulkSaveDataItems;
804
1019
  function bulkRemoveDataItems(options) {
805
1020
  var _a, _b, _c;
806
1021
  return __awaiter(this, arguments, void 0, function* () {
1022
+ const requestTransformation = {
1023
+ dataCollectionId: '$[0].dataCollectionId',
1024
+ dataItemIds: '$[0].dataItemIds',
1025
+ };
1026
+ const responseTransformation = '$';
807
1027
  // @ts-ignore
808
1028
  const { httpClient, sideEffects } = arguments[1];
809
- const payload = (0, sdk_runtime_1.renameKeysFromSDKRequestToRESTRequest)({
810
- dataCollectionId: options === null || options === void 0 ? void 0 : options.dataCollectionId,
811
- dataItemIds: options === null || options === void 0 ? void 0 : options.dataItemIds,
812
- }, []);
1029
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
1030
+ rootSchema: _bulkRemoveDataItemsRequest,
1031
+ depSchemas: {},
1032
+ fqdnTransformation: {
1033
+ paths: [],
1034
+ transformation: _fromVeloEntity,
1035
+ },
1036
+ customTransformation: requestTransformation,
1037
+ });
1038
+ const { fromJSON } = (0, velo_1.serializer)({
1039
+ rootSchema: _bulkRemoveDataItemsResponse,
1040
+ depSchemas: {},
1041
+ fqdnTransformation: {
1042
+ paths: [...['Array#results.dataItem']],
1043
+ transformation: _toVeloEntity,
1044
+ },
1045
+ customTransformation: responseTransformation,
1046
+ });
1047
+ const payload = toAmbassadorRequest([options], []);
813
1048
  const reqOpts = ambassadorWixDataV2DataItem.bulkRemoveDataItems(payload);
814
1049
  __log(`"BulkRemoveDataItems" sending request with: ${__inspect(reqOpts)}`);
815
1050
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
816
1051
  try {
817
1052
  const result = yield httpClient.request(reqOpts);
818
1053
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
819
- return (0, sdk_runtime_1.renameKeysFromRESTResponseToSDKResponse)(result.data, [
820
- 'results.dataItem.data',
821
- ]);
1054
+ return fromJSON(result.data, ['results.dataItem.data']);
822
1055
  }
823
1056
  catch (err) {
824
- const transformedError = (0, sdk_runtime_1.transformError)(err, {
825
- spreadPathsToArguments: {},
826
- explicitPathsToArguments: {
827
- dataCollectionId: '$[0].dataCollectionId',
828
- dataItemIds: '$[0].dataItemIds',
829
- },
830
- singleArgumentUnchanged: false,
831
- }, ['options']);
1057
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1058
+ 'options',
1059
+ ]);
832
1060
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
833
1061
  throw transformedError;
834
1062
  }
@@ -857,43 +1085,50 @@ exports.bulkRemoveDataItems = bulkRemoveDataItems;
857
1085
  function queryReferencedDataItems(options) {
858
1086
  var _a, _b, _c;
859
1087
  return __awaiter(this, arguments, void 0, function* () {
1088
+ const requestTransformation = {
1089
+ dataCollectionId: '$[0].dataCollectionId',
1090
+ referringItemId: '$[0].referringItemId',
1091
+ referringItemFieldName: '$[0].referringItemFieldName',
1092
+ order: '$[0].order',
1093
+ paging: '$[0].paging',
1094
+ cursorPaging: '$[0].cursorPaging',
1095
+ returnTotalCount: '$[0].returnTotalCount',
1096
+ consistentRead: '$[0].consistentRead',
1097
+ };
1098
+ const responseTransformation = '$';
860
1099
  // @ts-ignore
861
1100
  const { httpClient, sideEffects } = arguments[1];
862
- const payload = (0, sdk_runtime_1.renameKeysFromSDKRequestToRESTRequest)({
863
- dataCollectionId: options === null || options === void 0 ? void 0 : options.dataCollectionId,
864
- referringItemId: options === null || options === void 0 ? void 0 : options.referringItemId,
865
- referringItemFieldName: options === null || options === void 0 ? void 0 : options.referringItemFieldName,
866
- order: options === null || options === void 0 ? void 0 : options.order,
867
- paging: options === null || options === void 0 ? void 0 : options.paging,
868
- cursorPaging: options === null || options === void 0 ? void 0 : options.cursorPaging,
869
- returnTotalCount: options === null || options === void 0 ? void 0 : options.returnTotalCount,
870
- consistentRead: options === null || options === void 0 ? void 0 : options.consistentRead,
871
- }, []);
1101
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
1102
+ rootSchema: _queryReferencedDataItemsRequest,
1103
+ depSchemas: {},
1104
+ fqdnTransformation: {
1105
+ paths: [],
1106
+ transformation: _fromVeloEntity,
1107
+ },
1108
+ customTransformation: requestTransformation,
1109
+ });
1110
+ const { fromJSON } = (0, velo_1.serializer)({
1111
+ rootSchema: _queryReferencedDataItemsResponse,
1112
+ depSchemas: {},
1113
+ fqdnTransformation: {
1114
+ paths: [...['Array#results.dataItem']],
1115
+ transformation: _toVeloEntity,
1116
+ },
1117
+ customTransformation: responseTransformation,
1118
+ });
1119
+ const payload = toAmbassadorRequest([options], []);
872
1120
  const reqOpts = ambassadorWixDataV2DataItem.queryReferencedDataItems(payload);
873
1121
  __log(`"QueryReferencedDataItems" sending request with: ${__inspect(reqOpts)}`);
874
1122
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
875
1123
  try {
876
1124
  const result = yield httpClient.request(reqOpts);
877
1125
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
878
- return (0, sdk_runtime_1.renameKeysFromRESTResponseToSDKResponse)(result.data, [
879
- 'results.dataItem.data',
880
- ]);
1126
+ return fromJSON(result.data, ['results.dataItem.data']);
881
1127
  }
882
1128
  catch (err) {
883
- const transformedError = (0, sdk_runtime_1.transformError)(err, {
884
- spreadPathsToArguments: {},
885
- explicitPathsToArguments: {
886
- dataCollectionId: '$[0].dataCollectionId',
887
- referringItemId: '$[0].referringItemId',
888
- referringItemFieldName: '$[0].referringItemFieldName',
889
- order: '$[0].order',
890
- paging: '$[0].paging',
891
- cursorPaging: '$[0].cursorPaging',
892
- returnTotalCount: '$[0].returnTotalCount',
893
- consistentRead: '$[0].consistentRead',
894
- },
895
- singleArgumentUnchanged: false,
896
- }, ['options']);
1129
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1130
+ 'options',
1131
+ ]);
897
1132
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
898
1133
  throw transformedError;
899
1134
  }
@@ -917,35 +1152,47 @@ exports.queryReferencedDataItems = queryReferencedDataItems;
917
1152
  function isReferencedDataItem(options) {
918
1153
  var _a, _b, _c;
919
1154
  return __awaiter(this, arguments, void 0, function* () {
1155
+ const requestTransformation = {
1156
+ dataCollectionId: '$[0].dataCollectionId',
1157
+ referringItemFieldName: '$[0].referringItemFieldName',
1158
+ referringItemId: '$[0].referringItemId',
1159
+ referencedItemId: '$[0].referencedItemId',
1160
+ consistentRead: '$[0].consistentRead',
1161
+ };
1162
+ const responseTransformation = '$';
920
1163
  // @ts-ignore
921
1164
  const { httpClient, sideEffects } = arguments[1];
922
- const payload = (0, sdk_runtime_1.renameKeysFromSDKRequestToRESTRequest)({
923
- dataCollectionId: options === null || options === void 0 ? void 0 : options.dataCollectionId,
924
- referringItemFieldName: options === null || options === void 0 ? void 0 : options.referringItemFieldName,
925
- referringItemId: options === null || options === void 0 ? void 0 : options.referringItemId,
926
- referencedItemId: options === null || options === void 0 ? void 0 : options.referencedItemId,
927
- consistentRead: options === null || options === void 0 ? void 0 : options.consistentRead,
928
- }, []);
1165
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
1166
+ rootSchema: _isReferencedDataItemRequest,
1167
+ depSchemas: {},
1168
+ fqdnTransformation: {
1169
+ paths: [],
1170
+ transformation: _fromVeloEntity,
1171
+ },
1172
+ customTransformation: requestTransformation,
1173
+ });
1174
+ const { fromJSON } = (0, velo_1.serializer)({
1175
+ rootSchema: _isReferencedDataItemResponse,
1176
+ depSchemas: {},
1177
+ fqdnTransformation: {
1178
+ paths: [],
1179
+ transformation: _toVeloEntity,
1180
+ },
1181
+ customTransformation: responseTransformation,
1182
+ });
1183
+ const payload = toAmbassadorRequest([options], []);
929
1184
  const reqOpts = ambassadorWixDataV2DataItem.isReferencedDataItem(payload);
930
1185
  __log(`"IsReferencedDataItem" sending request with: ${__inspect(reqOpts)}`);
931
1186
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
932
1187
  try {
933
1188
  const result = yield httpClient.request(reqOpts);
934
1189
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
935
- return (0, sdk_runtime_1.renameKeysFromRESTResponseToSDKResponse)(result.data, []);
1190
+ return fromJSON(result.data, []);
936
1191
  }
937
1192
  catch (err) {
938
- const transformedError = (0, sdk_runtime_1.transformError)(err, {
939
- spreadPathsToArguments: {},
940
- explicitPathsToArguments: {
941
- dataCollectionId: '$[0].dataCollectionId',
942
- referringItemFieldName: '$[0].referringItemFieldName',
943
- referringItemId: '$[0].referringItemId',
944
- referencedItemId: '$[0].referencedItemId',
945
- consistentRead: '$[0].consistentRead',
946
- },
947
- singleArgumentUnchanged: false,
948
- }, ['options']);
1193
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1194
+ 'options',
1195
+ ]);
949
1196
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
950
1197
  throw transformedError;
951
1198
  }
@@ -970,29 +1217,44 @@ exports.isReferencedDataItem = isReferencedDataItem;
970
1217
  function insertDataItemReference(options) {
971
1218
  var _a, _b, _c;
972
1219
  return __awaiter(this, arguments, void 0, function* () {
1220
+ const requestTransformation = {
1221
+ dataCollectionId: '$[0].dataCollectionId',
1222
+ dataItemReference: '$[0].dataItemReference',
1223
+ };
1224
+ const responseTransformation = '$';
973
1225
  // @ts-ignore
974
1226
  const { httpClient, sideEffects } = arguments[1];
975
- const payload = (0, sdk_runtime_1.renameKeysFromSDKRequestToRESTRequest)({
976
- dataCollectionId: options === null || options === void 0 ? void 0 : options.dataCollectionId,
977
- dataItemReference: options === null || options === void 0 ? void 0 : options.dataItemReference,
978
- }, []);
1227
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
1228
+ rootSchema: _insertDataItemReferenceRequest,
1229
+ depSchemas: {},
1230
+ fqdnTransformation: {
1231
+ paths: [],
1232
+ transformation: _fromVeloEntity,
1233
+ },
1234
+ customTransformation: requestTransformation,
1235
+ });
1236
+ const { fromJSON } = (0, velo_1.serializer)({
1237
+ rootSchema: _insertDataItemReferenceResponse,
1238
+ depSchemas: {},
1239
+ fqdnTransformation: {
1240
+ paths: [],
1241
+ transformation: _toVeloEntity,
1242
+ },
1243
+ customTransformation: responseTransformation,
1244
+ });
1245
+ const payload = toAmbassadorRequest([options], []);
979
1246
  const reqOpts = ambassadorWixDataV2DataItem.insertDataItemReference(payload);
980
1247
  __log(`"InsertDataItemReference" sending request with: ${__inspect(reqOpts)}`);
981
1248
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
982
1249
  try {
983
1250
  const result = yield httpClient.request(reqOpts);
984
1251
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
985
- return (0, sdk_runtime_1.renameKeysFromRESTResponseToSDKResponse)(result.data, []);
1252
+ return fromJSON(result.data, []);
986
1253
  }
987
1254
  catch (err) {
988
- const transformedError = (0, sdk_runtime_1.transformError)(err, {
989
- spreadPathsToArguments: {},
990
- explicitPathsToArguments: {
991
- dataCollectionId: '$[0].dataCollectionId',
992
- dataItemReference: '$[0].dataItemReference',
993
- },
994
- singleArgumentUnchanged: false,
995
- }, ['options']);
1255
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1256
+ 'options',
1257
+ ]);
996
1258
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
997
1259
  throw transformedError;
998
1260
  }
@@ -1016,29 +1278,44 @@ exports.insertDataItemReference = insertDataItemReference;
1016
1278
  function removeDataItemReference(options) {
1017
1279
  var _a, _b, _c;
1018
1280
  return __awaiter(this, arguments, void 0, function* () {
1281
+ const requestTransformation = {
1282
+ dataCollectionId: '$[0].dataCollectionId',
1283
+ dataItemReference: '$[0].dataItemReference',
1284
+ };
1285
+ const responseTransformation = '$';
1019
1286
  // @ts-ignore
1020
1287
  const { httpClient, sideEffects } = arguments[1];
1021
- const payload = (0, sdk_runtime_1.renameKeysFromSDKRequestToRESTRequest)({
1022
- dataCollectionId: options === null || options === void 0 ? void 0 : options.dataCollectionId,
1023
- dataItemReference: options === null || options === void 0 ? void 0 : options.dataItemReference,
1024
- }, []);
1288
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
1289
+ rootSchema: _removeDataItemReferenceRequest,
1290
+ depSchemas: {},
1291
+ fqdnTransformation: {
1292
+ paths: [],
1293
+ transformation: _fromVeloEntity,
1294
+ },
1295
+ customTransformation: requestTransformation,
1296
+ });
1297
+ const { fromJSON } = (0, velo_1.serializer)({
1298
+ rootSchema: _removeDataItemReferenceResponse,
1299
+ depSchemas: {},
1300
+ fqdnTransformation: {
1301
+ paths: [],
1302
+ transformation: _toVeloEntity,
1303
+ },
1304
+ customTransformation: responseTransformation,
1305
+ });
1306
+ const payload = toAmbassadorRequest([options], []);
1025
1307
  const reqOpts = ambassadorWixDataV2DataItem.removeDataItemReference(payload);
1026
1308
  __log(`"RemoveDataItemReference" sending request with: ${__inspect(reqOpts)}`);
1027
1309
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1028
1310
  try {
1029
1311
  const result = yield httpClient.request(reqOpts);
1030
1312
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1031
- return (0, sdk_runtime_1.renameKeysFromRESTResponseToSDKResponse)(result.data, []);
1313
+ return fromJSON(result.data, []);
1032
1314
  }
1033
1315
  catch (err) {
1034
- const transformedError = (0, sdk_runtime_1.transformError)(err, {
1035
- spreadPathsToArguments: {},
1036
- explicitPathsToArguments: {
1037
- dataCollectionId: '$[0].dataCollectionId',
1038
- dataItemReference: '$[0].dataItemReference',
1039
- },
1040
- singleArgumentUnchanged: false,
1041
- }, ['options']);
1316
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1317
+ 'options',
1318
+ ]);
1042
1319
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1043
1320
  throw transformedError;
1044
1321
  }
@@ -1065,31 +1342,45 @@ exports.removeDataItemReference = removeDataItemReference;
1065
1342
  function bulkInsertDataItemReferences(options) {
1066
1343
  var _a, _b, _c;
1067
1344
  return __awaiter(this, arguments, void 0, function* () {
1345
+ const requestTransformation = {
1346
+ dataCollectionId: '$[0].dataCollectionId',
1347
+ dataItemReferences: '$[0].dataItemReferences',
1348
+ returnEntity: '$[0].returnEntity',
1349
+ };
1350
+ const responseTransformation = '$';
1068
1351
  // @ts-ignore
1069
1352
  const { httpClient, sideEffects } = arguments[1];
1070
- const payload = (0, sdk_runtime_1.renameKeysFromSDKRequestToRESTRequest)({
1071
- dataCollectionId: options === null || options === void 0 ? void 0 : options.dataCollectionId,
1072
- dataItemReferences: options === null || options === void 0 ? void 0 : options.dataItemReferences,
1073
- returnEntity: options === null || options === void 0 ? void 0 : options.returnEntity,
1074
- }, []);
1353
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
1354
+ rootSchema: _bulkInsertDataItemReferencesRequest,
1355
+ depSchemas: {},
1356
+ fqdnTransformation: {
1357
+ paths: [],
1358
+ transformation: _fromVeloEntity,
1359
+ },
1360
+ customTransformation: requestTransformation,
1361
+ });
1362
+ const { fromJSON } = (0, velo_1.serializer)({
1363
+ rootSchema: _bulkInsertDataItemReferencesResponse,
1364
+ depSchemas: {},
1365
+ fqdnTransformation: {
1366
+ paths: [],
1367
+ transformation: _toVeloEntity,
1368
+ },
1369
+ customTransformation: responseTransformation,
1370
+ });
1371
+ const payload = toAmbassadorRequest([options], []);
1075
1372
  const reqOpts = ambassadorWixDataV2DataItem.bulkInsertDataItemReferences(payload);
1076
1373
  __log(`"BulkInsertDataItemReferences" sending request with: ${__inspect(reqOpts)}`);
1077
1374
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1078
1375
  try {
1079
1376
  const result = yield httpClient.request(reqOpts);
1080
1377
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1081
- return (0, sdk_runtime_1.renameKeysFromRESTResponseToSDKResponse)(result.data, []);
1378
+ return fromJSON(result.data, []);
1082
1379
  }
1083
1380
  catch (err) {
1084
- const transformedError = (0, sdk_runtime_1.transformError)(err, {
1085
- spreadPathsToArguments: {},
1086
- explicitPathsToArguments: {
1087
- dataCollectionId: '$[0].dataCollectionId',
1088
- dataItemReferences: '$[0].dataItemReferences',
1089
- returnEntity: '$[0].returnEntity',
1090
- },
1091
- singleArgumentUnchanged: false,
1092
- }, ['options']);
1381
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1382
+ 'options',
1383
+ ]);
1093
1384
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1094
1385
  throw transformedError;
1095
1386
  }
@@ -1113,29 +1404,44 @@ exports.bulkInsertDataItemReferences = bulkInsertDataItemReferences;
1113
1404
  function bulkRemoveDataItemReferences(options) {
1114
1405
  var _a, _b, _c;
1115
1406
  return __awaiter(this, arguments, void 0, function* () {
1407
+ const requestTransformation = {
1408
+ dataCollectionId: '$[0].dataCollectionId',
1409
+ dataItemReferences: '$[0].dataItemReferences',
1410
+ };
1411
+ const responseTransformation = '$';
1116
1412
  // @ts-ignore
1117
1413
  const { httpClient, sideEffects } = arguments[1];
1118
- const payload = (0, sdk_runtime_1.renameKeysFromSDKRequestToRESTRequest)({
1119
- dataCollectionId: options === null || options === void 0 ? void 0 : options.dataCollectionId,
1120
- dataItemReferences: options === null || options === void 0 ? void 0 : options.dataItemReferences,
1121
- }, []);
1414
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
1415
+ rootSchema: _bulkRemoveDataItemReferencesRequest,
1416
+ depSchemas: {},
1417
+ fqdnTransformation: {
1418
+ paths: [],
1419
+ transformation: _fromVeloEntity,
1420
+ },
1421
+ customTransformation: requestTransformation,
1422
+ });
1423
+ const { fromJSON } = (0, velo_1.serializer)({
1424
+ rootSchema: _bulkRemoveDataItemReferencesResponse,
1425
+ depSchemas: {},
1426
+ fqdnTransformation: {
1427
+ paths: [],
1428
+ transformation: _toVeloEntity,
1429
+ },
1430
+ customTransformation: responseTransformation,
1431
+ });
1432
+ const payload = toAmbassadorRequest([options], []);
1122
1433
  const reqOpts = ambassadorWixDataV2DataItem.bulkRemoveDataItemReferences(payload);
1123
1434
  __log(`"BulkRemoveDataItemReferences" sending request with: ${__inspect(reqOpts)}`);
1124
1435
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1125
1436
  try {
1126
1437
  const result = yield httpClient.request(reqOpts);
1127
1438
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1128
- return (0, sdk_runtime_1.renameKeysFromRESTResponseToSDKResponse)(result.data, []);
1439
+ return fromJSON(result.data, []);
1129
1440
  }
1130
1441
  catch (err) {
1131
- const transformedError = (0, sdk_runtime_1.transformError)(err, {
1132
- spreadPathsToArguments: {},
1133
- explicitPathsToArguments: {
1134
- dataCollectionId: '$[0].dataCollectionId',
1135
- dataItemReferences: '$[0].dataItemReferences',
1136
- },
1137
- singleArgumentUnchanged: false,
1138
- }, ['options']);
1442
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1443
+ 'options',
1444
+ ]);
1139
1445
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1140
1446
  throw transformedError;
1141
1447
  }
@@ -1162,33 +1468,46 @@ exports.bulkRemoveDataItemReferences = bulkRemoveDataItemReferences;
1162
1468
  function replaceDataItemReferences(options) {
1163
1469
  var _a, _b, _c;
1164
1470
  return __awaiter(this, arguments, void 0, function* () {
1471
+ const requestTransformation = {
1472
+ dataCollectionId: '$[0].dataCollectionId',
1473
+ referringItemFieldName: '$[0].referringItemFieldName',
1474
+ referringItemId: '$[0].referringItemId',
1475
+ newReferencedItemIds: '$[0].newReferencedItemIds',
1476
+ };
1477
+ const responseTransformation = '$';
1165
1478
  // @ts-ignore
1166
1479
  const { httpClient, sideEffects } = arguments[1];
1167
- const payload = (0, sdk_runtime_1.renameKeysFromSDKRequestToRESTRequest)({
1168
- dataCollectionId: options === null || options === void 0 ? void 0 : options.dataCollectionId,
1169
- referringItemFieldName: options === null || options === void 0 ? void 0 : options.referringItemFieldName,
1170
- referringItemId: options === null || options === void 0 ? void 0 : options.referringItemId,
1171
- newReferencedItemIds: options === null || options === void 0 ? void 0 : options.newReferencedItemIds,
1172
- }, []);
1480
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
1481
+ rootSchema: _replaceDataItemReferencesRequest,
1482
+ depSchemas: {},
1483
+ fqdnTransformation: {
1484
+ paths: [],
1485
+ transformation: _fromVeloEntity,
1486
+ },
1487
+ customTransformation: requestTransformation,
1488
+ });
1489
+ const { fromJSON } = (0, velo_1.serializer)({
1490
+ rootSchema: _replaceDataItemReferencesResponse,
1491
+ depSchemas: {},
1492
+ fqdnTransformation: {
1493
+ paths: [],
1494
+ transformation: _toVeloEntity,
1495
+ },
1496
+ customTransformation: responseTransformation,
1497
+ });
1498
+ const payload = toAmbassadorRequest([options], []);
1173
1499
  const reqOpts = ambassadorWixDataV2DataItem.replaceDataItemReferences(payload);
1174
1500
  __log(`"ReplaceDataItemReferences" sending request with: ${__inspect(reqOpts)}`);
1175
1501
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1176
1502
  try {
1177
1503
  const result = yield httpClient.request(reqOpts);
1178
1504
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1179
- return (0, sdk_runtime_1.renameKeysFromRESTResponseToSDKResponse)(result.data, []);
1505
+ return fromJSON(result.data, []);
1180
1506
  }
1181
1507
  catch (err) {
1182
- const transformedError = (0, sdk_runtime_1.transformError)(err, {
1183
- spreadPathsToArguments: {},
1184
- explicitPathsToArguments: {
1185
- dataCollectionId: '$[0].dataCollectionId',
1186
- referringItemFieldName: '$[0].referringItemFieldName',
1187
- referringItemId: '$[0].referringItemId',
1188
- newReferencedItemIds: '$[0].newReferencedItemIds',
1189
- },
1190
- singleArgumentUnchanged: false,
1191
- }, ['options']);
1508
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1509
+ 'options',
1510
+ ]);
1192
1511
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1193
1512
  throw transformedError;
1194
1513
  }