@wix/data 1.0.60 → 1.0.62

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 (75) hide show
  1. package/build/cjs/index.js +5 -1
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/index.typings.js +5 -1
  4. package/build/cjs/index.typings.js.map +1 -1
  5. package/build/cjs/meta.js +5 -1
  6. package/build/cjs/meta.js.map +1 -1
  7. package/build/cjs/src/data-v1-external-database-connection.http.js +14 -54
  8. package/build/cjs/src/data-v1-external-database-connection.http.js.map +1 -1
  9. package/build/cjs/src/data-v1-external-database-connection.meta.d.ts +1 -1
  10. package/build/cjs/src/data-v1-external-database-connection.meta.js +5 -1
  11. package/build/cjs/src/data-v1-external-database-connection.meta.js.map +1 -1
  12. package/build/cjs/src/data-v1-external-database-connection.public.d.ts +1 -1
  13. package/build/cjs/src/data-v1-external-database-connection.types.js +4 -4
  14. package/build/cjs/src/data-v1-external-database-connection.types.js.map +1 -1
  15. package/build/cjs/src/data-v1-external-database-connection.universal.js +53 -149
  16. package/build/cjs/src/data-v1-external-database-connection.universal.js.map +1 -1
  17. package/build/cjs/src/data-v2-data-collection.http.js +10 -29
  18. package/build/cjs/src/data-v2-data-collection.http.js.map +1 -1
  19. package/build/cjs/src/data-v2-data-collection.meta.d.ts +1 -1
  20. package/build/cjs/src/data-v2-data-collection.meta.js +5 -1
  21. package/build/cjs/src/data-v2-data-collection.meta.js.map +1 -1
  22. package/build/cjs/src/data-v2-data-collection.public.d.ts +1 -1
  23. package/build/cjs/src/data-v2-data-collection.types.js +13 -13
  24. package/build/cjs/src/data-v2-data-collection.types.js.map +1 -1
  25. package/build/cjs/src/data-v2-data-collection.universal.js +43 -48
  26. package/build/cjs/src/data-v2-data-collection.universal.js.map +1 -1
  27. package/build/cjs/src/data-v2-data-item.http.js +46 -190
  28. package/build/cjs/src/data-v2-data-item.http.js.map +1 -1
  29. package/build/cjs/src/data-v2-data-item.meta.d.ts +1 -1
  30. package/build/cjs/src/data-v2-data-item.meta.js +5 -1
  31. package/build/cjs/src/data-v2-data-item.meta.js.map +1 -1
  32. package/build/cjs/src/data-v2-data-item.public.d.ts +13 -13
  33. package/build/cjs/src/data-v2-data-item.public.js.map +1 -1
  34. package/build/cjs/src/data-v2-data-item.types.js +4 -4
  35. package/build/cjs/src/data-v2-data-item.types.js.map +1 -1
  36. package/build/cjs/src/data-v2-data-item.universal.d.ts +15 -15
  37. package/build/cjs/src/data-v2-data-item.universal.js +354 -669
  38. package/build/cjs/src/data-v2-data-item.universal.js.map +1 -1
  39. package/build/cjs/src/data-v2-index.http.js +10 -28
  40. package/build/cjs/src/data-v2-index.http.js.map +1 -1
  41. package/build/cjs/src/data-v2-index.meta.d.ts +1 -1
  42. package/build/cjs/src/data-v2-index.meta.js +5 -1
  43. package/build/cjs/src/data-v2-index.meta.js.map +1 -1
  44. package/build/cjs/src/data-v2-index.public.d.ts +1 -1
  45. package/build/cjs/src/data-v2-index.types.js +3 -3
  46. package/build/cjs/src/data-v2-index.types.js.map +1 -1
  47. package/build/cjs/src/data-v2-index.universal.js +43 -93
  48. package/build/cjs/src/data-v2-index.universal.js.map +1 -1
  49. package/build/es/src/data-v1-external-database-connection.http.js +14 -54
  50. package/build/es/src/data-v1-external-database-connection.http.js.map +1 -1
  51. package/build/es/src/data-v1-external-database-connection.meta.d.ts +1 -1
  52. package/build/es/src/data-v1-external-database-connection.public.d.ts +1 -1
  53. package/build/es/src/data-v1-external-database-connection.universal.js +44 -144
  54. package/build/es/src/data-v1-external-database-connection.universal.js.map +1 -1
  55. package/build/es/src/data-v2-data-collection.http.js +10 -29
  56. package/build/es/src/data-v2-data-collection.http.js.map +1 -1
  57. package/build/es/src/data-v2-data-collection.meta.d.ts +1 -1
  58. package/build/es/src/data-v2-data-collection.public.d.ts +1 -1
  59. package/build/es/src/data-v2-data-collection.universal.js +25 -34
  60. package/build/es/src/data-v2-data-collection.universal.js.map +1 -1
  61. package/build/es/src/data-v2-data-item.http.js +46 -190
  62. package/build/es/src/data-v2-data-item.http.js.map +1 -1
  63. package/build/es/src/data-v2-data-item.meta.d.ts +1 -1
  64. package/build/es/src/data-v2-data-item.public.d.ts +13 -13
  65. package/build/es/src/data-v2-data-item.public.js.map +1 -1
  66. package/build/es/src/data-v2-data-item.universal.d.ts +15 -15
  67. package/build/es/src/data-v2-data-item.universal.js +346 -665
  68. package/build/es/src/data-v2-data-item.universal.js.map +1 -1
  69. package/build/es/src/data-v2-index.http.js +10 -28
  70. package/build/es/src/data-v2-index.http.js.map +1 -1
  71. package/build/es/src/data-v2-index.meta.d.ts +1 -1
  72. package/build/es/src/data-v2-index.public.d.ts +1 -1
  73. package/build/es/src/data-v2-index.universal.js +35 -89
  74. package/build/es/src/data-v2-index.universal.js.map +1 -1
  75. package/package.json +8 -8
@@ -1,48 +1,5 @@
1
1
  import { toURLSearchParams } from '@wix/metro-runtime';
2
- import { serializer } from '@wix/metro-runtime/ambassador';
3
2
  import { resolveUrl } from '@wix/metro-runtime';
4
- const _aggregateDataItemsRequest = {};
5
- const _aggregateDataItemsResponse = {};
6
- const _bulkInsertDataItemReferencesRequest = {};
7
- const _bulkInsertDataItemReferencesResponse = {};
8
- const _bulkInsertDataItemsRequest = {};
9
- const _bulkInsertDataItemsResponse = {};
10
- const _bulkRemoveDataItemReferencesRequest = {};
11
- const _bulkRemoveDataItemReferencesResponse = {};
12
- const _bulkRemoveDataItemsRequest = {};
13
- const _bulkRemoveDataItemsResponse = {};
14
- const _bulkSaveDataItemsRequest = {};
15
- const _bulkSaveDataItemsResponse = {};
16
- const _bulkUpdateDataItemsRequest = {};
17
- const _bulkUpdateDataItemsResponse = {};
18
- const _countDataItemsRequest = {};
19
- const _countDataItemsResponse = {};
20
- const _getDataItemRequest = {};
21
- const _getDataItemResponse = {};
22
- const _insertDataItemReferenceRequest = {};
23
- const _insertDataItemReferenceResponse = {};
24
- const _insertDataItemRequest = {};
25
- const _insertDataItemResponse = {};
26
- const _isReferencedDataItemRequest = {};
27
- const _isReferencedDataItemResponse = {};
28
- const _queryDataItemsRequest = {};
29
- const _queryDataItemsResponse = {};
30
- const _queryDistinctValuesRequest = {};
31
- const _queryDistinctValuesResponse = {};
32
- const _queryReferencedDataItemsRequest = {};
33
- const _queryReferencedDataItemsResponse = {};
34
- const _removeDataItemReferenceRequest = {};
35
- const _removeDataItemReferenceResponse = {};
36
- const _removeDataItemRequest = {};
37
- const _removeDataItemResponse = {};
38
- const _replaceDataItemReferencesRequest = {};
39
- const _replaceDataItemReferencesResponse = {};
40
- const _saveDataItemRequest = {};
41
- const _saveDataItemResponse = {};
42
- const _truncateDataItemsRequest = {};
43
- const _truncateDataItemsResponse = {};
44
- const _updateDataItemRequest = {};
45
- const _updateDataItemResponse = {};
46
3
  function resolveComWixpressCloudDataApiDataDataItemServiceUrl(opts) {
47
4
  const domainToMappings = {
48
5
  'api._api_base_domain_': [
@@ -122,6 +79,10 @@ function resolveComWixpressCloudDataApiDataDataItemServiceUrl(opts) {
122
79
  srcPath: '/[a-z0-9-_/]+/_api/cloud-data',
123
80
  destPath: '',
124
81
  },
82
+ {
83
+ srcPath: '/_api/cloud-data/v2',
84
+ destPath: '/v2',
85
+ },
125
86
  ],
126
87
  'manage._base_domain_': [
127
88
  {
@@ -332,25 +293,20 @@ function resolveComWixpressCloudDataApiDataDataItemServiceUrl(opts) {
332
293
  * If `options.dataItem.data` is empty, a new item is created with no data fields.
333
294
  */
334
295
  export function insertDataItem(payload) {
335
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_insertDataItemRequest, {});
336
- const { fromJSON: fromRes } = serializer(_insertDataItemResponse, {});
337
296
  function __insertDataItem({ host }) {
338
- const serializedData = toReq(payload);
339
297
  const metadata = {
340
298
  entityFqdn: 'wix.data.v2.data_item',
341
299
  method: 'POST',
342
300
  methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.InsertDataItem',
343
301
  url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
344
302
  protoPath: '/v2/items',
345
- data: serializedData,
303
+ data: payload,
346
304
  host,
347
305
  }),
348
- data: serializedData,
349
- transformResponse: fromRes,
306
+ data: payload,
350
307
  };
351
308
  return metadata;
352
309
  }
353
- __insertDataItem.fromReq = fromReq;
354
310
  return __insertDataItem;
355
311
  }
356
312
  /**
@@ -370,25 +326,20 @@ export function insertDataItem(payload) {
370
326
  * > If the existing item has fields with values and those fields aren't included in the updated item, their values are lost.
371
327
  */
372
328
  export function updateDataItem(payload) {
373
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_updateDataItemRequest, {});
374
- const { fromJSON: fromRes } = serializer(_updateDataItemResponse, {});
375
329
  function __updateDataItem({ host }) {
376
- const serializedData = toReq(payload);
377
330
  const metadata = {
378
331
  entityFqdn: 'wix.data.v2.data_item',
379
332
  method: 'PUT',
380
333
  methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.UpdateDataItem',
381
334
  url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
382
335
  protoPath: '/v2/items/{dataItem.id}',
383
- data: serializedData,
336
+ data: payload,
384
337
  host,
385
338
  }),
386
- data: serializedData,
387
- transformResponse: fromRes,
339
+ data: payload,
388
340
  };
389
341
  return metadata;
390
342
  }
391
- __updateDataItem.fromReq = fromReq;
392
343
  return __updateDataItem;
393
344
  }
394
345
  /**
@@ -407,25 +358,20 @@ export function updateDataItem(payload) {
407
358
  * > This means that the item's previous fields and values are lost.
408
359
  */
409
360
  export function saveDataItem(payload) {
410
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_saveDataItemRequest, {});
411
- const { fromJSON: fromRes } = serializer(_saveDataItemResponse, {});
412
361
  function __saveDataItem({ host }) {
413
- const serializedData = toReq(payload);
414
362
  const metadata = {
415
363
  entityFqdn: 'wix.data.v2.data_item',
416
364
  method: 'POST',
417
365
  methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.SaveDataItem',
418
366
  url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
419
367
  protoPath: '/v2/items/save',
420
- data: serializedData,
368
+ data: payload,
421
369
  host,
422
370
  }),
423
- data: serializedData,
424
- transformResponse: fromRes,
371
+ data: payload,
425
372
  };
426
373
  return metadata;
427
374
  }
428
- __saveDataItem.fromReq = fromReq;
429
375
  return __saveDataItem;
430
376
  }
431
377
  /**
@@ -435,25 +381,20 @@ export function saveDataItem(payload) {
435
381
  * > **Note**: When calling `getDataItem()` following an update to your collection, the data retrieved may not contain the most recent changes. If you need the most up-to-date data, set `options.consistentRead` to `true`.
436
382
  */
437
383
  export function getDataItem(payload) {
438
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_getDataItemRequest, {});
439
- const { fromJSON: fromRes } = serializer(_getDataItemResponse, {});
440
384
  function __getDataItem({ host }) {
441
- const serializedData = toReq(payload);
442
385
  const metadata = {
443
386
  entityFqdn: 'wix.data.v2.data_item',
444
387
  method: 'GET',
445
388
  methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.GetDataItem',
446
389
  url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
447
390
  protoPath: '/v2/items/{dataItemId}',
448
- data: serializedData,
391
+ data: payload,
449
392
  host,
450
393
  }),
451
- params: toURLSearchParams(serializedData),
452
- transformResponse: fromRes,
394
+ params: toURLSearchParams(payload),
453
395
  };
454
396
  return metadata;
455
397
  }
456
- __getDataItem.fromReq = fromReq;
457
398
  return __getDataItem;
458
399
  }
459
400
  /**
@@ -466,25 +407,20 @@ export function getDataItem(payload) {
466
407
  * > Once an item has been removed from a collection, it can't be restored.
467
408
  */
468
409
  export function removeDataItem(payload) {
469
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_removeDataItemRequest, {});
470
- const { fromJSON: fromRes } = serializer(_removeDataItemResponse, {});
471
410
  function __removeDataItem({ host }) {
472
- const serializedData = toReq(payload);
473
411
  const metadata = {
474
412
  entityFqdn: 'wix.data.v2.data_item',
475
413
  method: 'DELETE',
476
414
  methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.RemoveDataItem',
477
415
  url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
478
416
  protoPath: '/v2/items/{dataItemId}',
479
- data: serializedData,
417
+ data: payload,
480
418
  host,
481
419
  }),
482
- params: toURLSearchParams(serializedData),
483
- transformResponse: fromRes,
420
+ params: toURLSearchParams(payload),
484
421
  };
485
422
  return metadata;
486
423
  }
487
- __removeDataItem.fromReq = fromReq;
488
424
  return __removeDataItem;
489
425
  }
490
426
  /**
@@ -497,25 +433,20 @@ export function removeDataItem(payload) {
497
433
  * > Once items have been removed from a collection, they can't be restored.
498
434
  */
499
435
  export function truncateDataItems(payload) {
500
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_truncateDataItemsRequest, {});
501
- const { fromJSON: fromRes } = serializer(_truncateDataItemsResponse, {});
502
436
  function __truncateDataItems({ host }) {
503
- const serializedData = toReq(payload);
504
437
  const metadata = {
505
438
  entityFqdn: 'wix.data.v2.data_item',
506
439
  method: 'POST',
507
440
  methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.TruncateDataItems',
508
441
  url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
509
442
  protoPath: '/v2/items/truncate',
510
- data: serializedData,
443
+ data: payload,
511
444
  host,
512
445
  }),
513
- data: serializedData,
514
- transformResponse: fromRes,
446
+ data: payload,
515
447
  };
516
448
  return metadata;
517
449
  }
518
- __truncateDataItems.fromReq = fromReq;
519
450
  return __truncateDataItems;
520
451
  }
521
452
  /**
@@ -542,25 +473,20 @@ export function truncateDataItems(payload) {
542
473
  *
543
474
  */
544
475
  export function queryDataItems(payload) {
545
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_queryDataItemsRequest, {});
546
- const { fromJSON: fromRes } = serializer(_queryDataItemsResponse, {});
547
476
  function __queryDataItems({ host }) {
548
- const serializedData = toReq(payload);
549
477
  const metadata = {
550
478
  entityFqdn: 'wix.data.v2.data_item',
551
479
  method: 'POST',
552
480
  methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.QueryDataItems',
553
481
  url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
554
482
  protoPath: '/v2/items/query',
555
- data: serializedData,
483
+ data: payload,
556
484
  host,
557
485
  }),
558
- data: serializedData,
559
- transformResponse: fromRes,
486
+ data: payload,
560
487
  };
561
488
  return metadata;
562
489
  }
563
- __queryDataItems.fromReq = fromReq;
564
490
  return __queryDataItems;
565
491
  }
566
492
  /**
@@ -571,25 +497,20 @@ export function queryDataItems(payload) {
571
497
  * You can also add paging, filtering, and sorting preferences to your aggregation to retrieve exactly what you need.
572
498
  */
573
499
  export function aggregateDataItems(payload) {
574
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_aggregateDataItemsRequest, {});
575
- const { fromJSON: fromRes } = serializer(_aggregateDataItemsResponse, {});
576
500
  function __aggregateDataItems({ host }) {
577
- const serializedData = toReq(payload);
578
501
  const metadata = {
579
502
  entityFqdn: 'wix.data.v2.data_item',
580
503
  method: 'POST',
581
504
  methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.AggregateDataItems',
582
505
  url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
583
506
  protoPath: '/v2/items/aggregate',
584
- data: serializedData,
507
+ data: payload,
585
508
  host,
586
509
  }),
587
- data: serializedData,
588
- transformResponse: fromRes,
510
+ data: payload,
589
511
  };
590
512
  return metadata;
591
513
  }
592
- __aggregateDataItems.fromReq = fromReq;
593
514
  return __aggregateDataItems;
594
515
  }
595
516
  /**
@@ -598,25 +519,20 @@ export function aggregateDataItems(payload) {
598
519
  * > **Note**: When calling `countDataItems()` following an update to your collection, the result returned may not reflect the most recent changes. If you need the most up-to-date data, set `options.consistentRead` to `true`.
599
520
  */
600
521
  export function countDataItems(payload) {
601
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_countDataItemsRequest, {});
602
- const { fromJSON: fromRes } = serializer(_countDataItemsResponse, {});
603
522
  function __countDataItems({ host }) {
604
- const serializedData = toReq(payload);
605
523
  const metadata = {
606
524
  entityFqdn: 'wix.data.v2.data_item',
607
525
  method: 'POST',
608
526
  methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.CountDataItems',
609
527
  url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
610
528
  protoPath: '/v2/items/count',
611
- data: serializedData,
529
+ data: payload,
612
530
  host,
613
531
  }),
614
- data: serializedData,
615
- transformResponse: fromRes,
532
+ data: payload,
616
533
  };
617
534
  return metadata;
618
535
  }
619
- __countDataItems.fromReq = fromReq;
620
536
  return __countDataItems;
621
537
  }
622
538
  /**
@@ -633,25 +549,20 @@ export function countDataItems(payload) {
633
549
  * > **Note**: When calling `queryDistinctValues()` following an update to your collection, the data retrieved may not reflect the most recent changes. If you need the most up-to-date data, set `options.consistentRead` to `true`.
634
550
  */
635
551
  export function queryDistinctValues(payload) {
636
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_queryDistinctValuesRequest, {});
637
- const { fromJSON: fromRes } = serializer(_queryDistinctValuesResponse, {});
638
552
  function __queryDistinctValues({ host }) {
639
- const serializedData = toReq(payload);
640
553
  const metadata = {
641
554
  entityFqdn: 'wix.data.v2.data_item',
642
555
  method: 'POST',
643
556
  methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.QueryDistinctValues',
644
557
  url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
645
558
  protoPath: '/v2/items/query-distinct-values',
646
- data: serializedData,
559
+ data: payload,
647
560
  host,
648
561
  }),
649
- data: serializedData,
650
- transformResponse: fromRes,
562
+ data: payload,
651
563
  };
652
564
  return metadata;
653
565
  }
654
- __queryDistinctValues.fromReq = fromReq;
655
566
  return __queryDistinctValues;
656
567
  }
657
568
  /**
@@ -662,25 +573,20 @@ export function queryDistinctValues(payload) {
662
573
  * You can optionally provide your own ID when inserting the item. If you specify an ID that already exists in the collection, the insertion will fail.
663
574
  */
664
575
  export function bulkInsertDataItems(payload) {
665
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_bulkInsertDataItemsRequest, {});
666
- const { fromJSON: fromRes } = serializer(_bulkInsertDataItemsResponse, {});
667
576
  function __bulkInsertDataItems({ host }) {
668
- const serializedData = toReq(payload);
669
577
  const metadata = {
670
578
  entityFqdn: 'wix.data.v2.data_item',
671
579
  method: 'POST',
672
580
  methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.BulkInsertDataItems',
673
581
  url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
674
582
  protoPath: '/v2/bulk/items/insert',
675
- data: serializedData,
583
+ data: payload,
676
584
  host,
677
585
  }),
678
- data: serializedData,
679
- transformResponse: fromRes,
586
+ data: payload,
680
587
  };
681
588
  return metadata;
682
589
  }
683
- __bulkInsertDataItems.fromReq = fromReq;
684
590
  return __bulkInsertDataItems;
685
591
  }
686
592
  /**
@@ -699,25 +605,20 @@ export function bulkInsertDataItems(payload) {
699
605
  * > aren't included in the updated item, their values are lost.
700
606
  */
701
607
  export function bulkUpdateDataItems(payload) {
702
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_bulkUpdateDataItemsRequest, {});
703
- const { fromJSON: fromRes } = serializer(_bulkUpdateDataItemsResponse, {});
704
608
  function __bulkUpdateDataItems({ host }) {
705
- const serializedData = toReq(payload);
706
609
  const metadata = {
707
610
  entityFqdn: 'wix.data.v2.data_item',
708
611
  method: 'POST',
709
612
  methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.BulkUpdateDataItems',
710
613
  url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
711
614
  protoPath: '/v2/bulk/items/update',
712
- data: serializedData,
615
+ data: payload,
713
616
  host,
714
617
  }),
715
- data: serializedData,
716
- transformResponse: fromRes,
618
+ data: payload,
717
619
  };
718
620
  return metadata;
719
621
  }
720
- __bulkUpdateDataItems.fromReq = fromReq;
721
622
  return __bulkUpdateDataItems;
722
623
  }
723
624
  /**
@@ -736,25 +637,20 @@ export function bulkUpdateDataItems(payload) {
736
637
  * > This means that all of the item's previous fields and values are lost.
737
638
  */
738
639
  export function bulkSaveDataItems(payload) {
739
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_bulkSaveDataItemsRequest, {});
740
- const { fromJSON: fromRes } = serializer(_bulkSaveDataItemsResponse, {});
741
640
  function __bulkSaveDataItems({ host }) {
742
- const serializedData = toReq(payload);
743
641
  const metadata = {
744
642
  entityFqdn: 'wix.data.v2.data_item',
745
643
  method: 'POST',
746
644
  methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.BulkSaveDataItems',
747
645
  url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
748
646
  protoPath: '/v2/bulk/items/save',
749
- data: serializedData,
647
+ data: payload,
750
648
  host,
751
649
  }),
752
- data: serializedData,
753
- transformResponse: fromRes,
650
+ data: payload,
754
651
  };
755
652
  return metadata;
756
653
  }
757
- __bulkSaveDataItems.fromReq = fromReq;
758
654
  return __bulkSaveDataItems;
759
655
  }
760
656
  /**
@@ -766,25 +662,20 @@ export function bulkSaveDataItems(payload) {
766
662
  * > **Note:** Once an item has been removed from a collection, it can't be restored.
767
663
  */
768
664
  export function bulkRemoveDataItems(payload) {
769
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_bulkRemoveDataItemsRequest, {});
770
- const { fromJSON: fromRes } = serializer(_bulkRemoveDataItemsResponse, {});
771
665
  function __bulkRemoveDataItems({ host }) {
772
- const serializedData = toReq(payload);
773
666
  const metadata = {
774
667
  entityFqdn: 'wix.data.v2.data_item',
775
668
  method: 'POST',
776
669
  methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.BulkRemoveDataItems',
777
670
  url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
778
671
  protoPath: '/v2/bulk/items/remove',
779
- data: serializedData,
672
+ data: payload,
780
673
  host,
781
674
  }),
782
- data: serializedData,
783
- transformResponse: fromRes,
675
+ data: payload,
784
676
  };
785
677
  return metadata;
786
678
  }
787
- __bulkRemoveDataItems.fromReq = fromReq;
788
679
  return __bulkRemoveDataItems;
789
680
  }
790
681
  /**
@@ -801,25 +692,20 @@ export function bulkRemoveDataItems(payload) {
801
692
  * > **Note**: When calling `queryReferencedDataItems()` following an update to your collection, the data retrieved may not contain the most recent changes. If you need the most up-to-date data, set `options.consistentRead` to `true`.
802
693
  */
803
694
  export function queryReferencedDataItems(payload) {
804
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_queryReferencedDataItemsRequest, {});
805
- const { fromJSON: fromRes } = serializer(_queryReferencedDataItemsResponse, {});
806
695
  function __queryReferencedDataItems({ host }) {
807
- const serializedData = toReq(payload);
808
696
  const metadata = {
809
697
  entityFqdn: 'wix.data.v2.data_item',
810
698
  method: 'POST',
811
699
  methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.QueryReferencedDataItems',
812
700
  url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
813
701
  protoPath: '/v2/items/query-referenced',
814
- data: serializedData,
702
+ data: payload,
815
703
  host,
816
704
  }),
817
- data: serializedData,
818
- transformResponse: fromRes,
705
+ data: payload,
819
706
  };
820
707
  return metadata;
821
708
  }
822
- __queryReferencedDataItems.fromReq = fromReq;
823
709
  return __queryReferencedDataItems;
824
710
  }
825
711
  /**
@@ -828,25 +714,20 @@ export function queryReferencedDataItems(payload) {
828
714
  * > **Note**: When calling `isReferencedDataItem()` following an update to your collection, the result returned may not reflect the most recent changes. If you need the most up-to-date data, set `options.consistentRead` to `true`.
829
715
  */
830
716
  export function isReferencedDataItem(payload) {
831
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_isReferencedDataItemRequest, {});
832
- const { fromJSON: fromRes } = serializer(_isReferencedDataItemResponse, {});
833
717
  function __isReferencedDataItem({ host }) {
834
- const serializedData = toReq(payload);
835
718
  const metadata = {
836
719
  entityFqdn: 'wix.data.v2.data_item',
837
720
  method: 'POST',
838
721
  methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.IsReferencedDataItem',
839
722
  url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
840
723
  protoPath: '/v2/items/is-referenced',
841
- data: serializedData,
724
+ data: payload,
842
725
  host,
843
726
  }),
844
- data: serializedData,
845
- transformResponse: fromRes,
727
+ data: payload,
846
728
  };
847
729
  return metadata;
848
730
  }
849
- __isReferencedDataItem.fromReq = fromReq;
850
731
  return __isReferencedDataItem;
851
732
  }
852
733
  /**
@@ -856,48 +737,38 @@ export function isReferencedDataItem(payload) {
856
737
  * A reference in `options.dataItemReference` specifies a referring item's ID, the field in which to insert the reference, and the ID of the referenced item.
857
738
  */
858
739
  export function insertDataItemReference(payload) {
859
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_insertDataItemReferenceRequest, {});
860
- const { fromJSON: fromRes } = serializer(_insertDataItemReferenceResponse, {});
861
740
  function __insertDataItemReference({ host }) {
862
- const serializedData = toReq(payload);
863
741
  const metadata = {
864
742
  entityFqdn: 'wix.data.v2.data_item',
865
743
  method: 'POST',
866
744
  methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.InsertDataItemReference',
867
745
  url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
868
746
  protoPath: '/v2/items/insert-reference',
869
- data: serializedData,
747
+ data: payload,
870
748
  host,
871
749
  }),
872
- data: serializedData,
873
- transformResponse: fromRes,
750
+ data: payload,
874
751
  };
875
752
  return metadata;
876
753
  }
877
- __insertDataItemReference.fromReq = fromReq;
878
754
  return __insertDataItemReference;
879
755
  }
880
756
  /** Removes the specified reference from the specified field. */
881
757
  export function removeDataItemReference(payload) {
882
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_removeDataItemReferenceRequest, {});
883
- const { fromJSON: fromRes } = serializer(_removeDataItemReferenceResponse, {});
884
758
  function __removeDataItemReference({ host }) {
885
- const serializedData = toReq(payload);
886
759
  const metadata = {
887
760
  entityFqdn: 'wix.data.v2.data_item',
888
761
  method: 'POST',
889
762
  methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.RemoveDataItemReference',
890
763
  url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
891
764
  protoPath: '/v2/items/remove-reference',
892
- data: serializedData,
765
+ data: payload,
893
766
  host,
894
767
  }),
895
- data: serializedData,
896
- transformResponse: fromRes,
768
+ data: payload,
897
769
  };
898
770
  return metadata;
899
771
  }
900
- __removeDataItemReference.fromReq = fromReq;
901
772
  return __removeDataItemReference;
902
773
  }
903
774
  /**
@@ -908,48 +779,38 @@ export function removeDataItemReference(payload) {
908
779
  * Each new reference in `options.dataItemReferences` specifies a referring item's ID, the field in which to insert the reference, and the ID of the referenced item.
909
780
  */
910
781
  export function bulkInsertDataItemReferences(payload) {
911
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_bulkInsertDataItemReferencesRequest, {});
912
- const { fromJSON: fromRes } = serializer(_bulkInsertDataItemReferencesResponse, {});
913
782
  function __bulkInsertDataItemReferences({ host }) {
914
- const serializedData = toReq(payload);
915
783
  const metadata = {
916
784
  entityFqdn: 'wix.data.v2.data_item',
917
785
  method: 'POST',
918
786
  methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.BulkInsertDataItemReferences',
919
787
  url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
920
788
  protoPath: '/v2/bulk/items/insert-references',
921
- data: serializedData,
789
+ data: payload,
922
790
  host,
923
791
  }),
924
- data: serializedData,
925
- transformResponse: fromRes,
792
+ data: payload,
926
793
  };
927
794
  return metadata;
928
795
  }
929
- __bulkInsertDataItemReferences.fromReq = fromReq;
930
796
  return __bulkInsertDataItemReferences;
931
797
  }
932
798
  /** Removes one or more references. */
933
799
  export function bulkRemoveDataItemReferences(payload) {
934
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_bulkRemoveDataItemReferencesRequest, {});
935
- const { fromJSON: fromRes } = serializer(_bulkRemoveDataItemReferencesResponse, {});
936
800
  function __bulkRemoveDataItemReferences({ host }) {
937
- const serializedData = toReq(payload);
938
801
  const metadata = {
939
802
  entityFqdn: 'wix.data.v2.data_item',
940
803
  method: 'POST',
941
804
  methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.BulkRemoveDataItemReferences',
942
805
  url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
943
806
  protoPath: '/v2/bulk/items/remove-references',
944
- data: serializedData,
807
+ data: payload,
945
808
  host,
946
809
  }),
947
- data: serializedData,
948
- transformResponse: fromRes,
810
+ data: payload,
949
811
  };
950
812
  return metadata;
951
813
  }
952
- __bulkRemoveDataItemReferences.fromReq = fromReq;
953
814
  return __bulkRemoveDataItemReferences;
954
815
  }
955
816
  /**
@@ -962,25 +823,20 @@ export function bulkRemoveDataItemReferences(payload) {
962
823
  * > **Note:** If you pass an empty array in `options.newReferencedItemIds`, all existing references are removed.
963
824
  */
964
825
  export function replaceDataItemReferences(payload) {
965
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_replaceDataItemReferencesRequest, {});
966
- const { fromJSON: fromRes } = serializer(_replaceDataItemReferencesResponse, {});
967
826
  function __replaceDataItemReferences({ host }) {
968
- const serializedData = toReq(payload);
969
827
  const metadata = {
970
828
  entityFqdn: 'wix.data.v2.data_item',
971
829
  method: 'POST',
972
830
  methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.ReplaceDataItemReferences',
973
831
  url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
974
832
  protoPath: '/v2/items/replace-references',
975
- data: serializedData,
833
+ data: payload,
976
834
  host,
977
835
  }),
978
- data: serializedData,
979
- transformResponse: fromRes,
836
+ data: payload,
980
837
  };
981
838
  return metadata;
982
839
  }
983
- __replaceDataItemReferences.fromReq = fromReq;
984
840
  return __replaceDataItemReferences;
985
841
  }
986
842
  //# sourceMappingURL=data-v2-data-item.http.js.map