@wix/auto_sdk_bookings_bookings 1.0.107 → 1.0.109

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 (37) hide show
  1. package/build/cjs/index.d.ts +83 -83
  2. package/build/cjs/index.js +211 -211
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +386 -371
  5. package/build/cjs/index.typings.js +193 -193
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +266 -251
  8. package/build/cjs/meta.js +171 -171
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +83 -83
  11. package/build/es/index.mjs +211 -211
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +386 -371
  14. package/build/es/index.typings.mjs +193 -193
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +266 -251
  17. package/build/es/meta.mjs +171 -171
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +83 -83
  20. package/build/internal/cjs/index.js +211 -211
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +378 -385
  23. package/build/internal/cjs/index.typings.js +193 -193
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +266 -251
  26. package/build/internal/cjs/meta.js +171 -171
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +83 -83
  29. package/build/internal/es/index.mjs +211 -211
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +378 -385
  32. package/build/internal/es/index.typings.mjs +193 -193
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +266 -251
  35. package/build/internal/es/meta.mjs +171 -171
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -319,57 +319,6 @@ function resolveComWixpressBookingsBookingsV2BookingsUrl(opts) {
319
319
  };
320
320
  return resolveUrl(Object.assign(opts, { domainToMappings }));
321
321
  }
322
- function resolveComWixpressBookingsConfirmatorV2ConfirmatorUrl(opts) {
323
- const domainToMappings = {
324
- "www.wixapis.com": [
325
- {
326
- srcPath: "/_api/bookings-confirmator/v2/bookings/confirmation",
327
- destPath: "/v2/bookings/confirmation"
328
- },
329
- {
330
- srcPath: "/bookings/v2/confirmation",
331
- destPath: "/v2/confirmation"
332
- },
333
- {
334
- srcPath: "/bookings/v2/bulk/confirmation",
335
- destPath: "/v2/bulk/confirmation"
336
- },
337
- {
338
- srcPath: "/bookings/v2/bulk/bookings/confirmOrDecline",
339
- destPath: "/v2/bulk/bookings/confirmOrDecline"
340
- },
341
- {
342
- srcPath: "/_api/bookings-confirmator/v2/bulk/confirmation",
343
- destPath: "/v2/bulk/confirmation"
344
- },
345
- {
346
- srcPath: "/_api/bookings-confirmator/v2/bulk/bookings/confirmOrDecline",
347
- destPath: "/v2/bulk/bookings/confirmOrDecline"
348
- }
349
- ],
350
- "*.dev.wix-code.com": [
351
- {
352
- srcPath: "/bookings/v2/confirmation",
353
- destPath: "/v2/confirmation"
354
- },
355
- {
356
- srcPath: "/bookings/v2/bulk/bookings",
357
- destPath: "/v2/bulk/bookings"
358
- }
359
- ],
360
- _: [
361
- {
362
- srcPath: "/bookings/v2/confirmation",
363
- destPath: "/v2/confirmation"
364
- },
365
- {
366
- srcPath: "/bookings/v2/bulk/bookings",
367
- destPath: "/v2/bulk/bookings"
368
- }
369
- ]
370
- };
371
- return resolveUrl(Object.assign(opts, { domainToMappings }));
372
- }
373
322
  function resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl(opts) {
374
323
  const domainToMappings = {
375
324
  _: [
@@ -523,7 +472,142 @@ function resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl(opts) {
523
472
  };
524
473
  return resolveUrl(Object.assign(opts, { domainToMappings }));
525
474
  }
475
+ function resolveComWixpressBookingsConfirmatorV2ConfirmatorUrl(opts) {
476
+ const domainToMappings = {
477
+ "www.wixapis.com": [
478
+ {
479
+ srcPath: "/_api/bookings-confirmator/v2/bookings/confirmation",
480
+ destPath: "/v2/bookings/confirmation"
481
+ },
482
+ {
483
+ srcPath: "/bookings/v2/confirmation",
484
+ destPath: "/v2/confirmation"
485
+ },
486
+ {
487
+ srcPath: "/bookings/v2/bulk/confirmation",
488
+ destPath: "/v2/bulk/confirmation"
489
+ },
490
+ {
491
+ srcPath: "/bookings/v2/bulk/bookings/confirmOrDecline",
492
+ destPath: "/v2/bulk/bookings/confirmOrDecline"
493
+ },
494
+ {
495
+ srcPath: "/_api/bookings-confirmator/v2/bulk/confirmation",
496
+ destPath: "/v2/bulk/confirmation"
497
+ },
498
+ {
499
+ srcPath: "/_api/bookings-confirmator/v2/bulk/bookings/confirmOrDecline",
500
+ destPath: "/v2/bulk/bookings/confirmOrDecline"
501
+ }
502
+ ],
503
+ "*.dev.wix-code.com": [
504
+ {
505
+ srcPath: "/bookings/v2/confirmation",
506
+ destPath: "/v2/confirmation"
507
+ },
508
+ {
509
+ srcPath: "/bookings/v2/bulk/bookings",
510
+ destPath: "/v2/bulk/bookings"
511
+ }
512
+ ],
513
+ _: [
514
+ {
515
+ srcPath: "/bookings/v2/confirmation",
516
+ destPath: "/v2/confirmation"
517
+ },
518
+ {
519
+ srcPath: "/bookings/v2/bulk/bookings",
520
+ destPath: "/v2/bulk/bookings"
521
+ }
522
+ ]
523
+ };
524
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
525
+ }
526
526
  var PACKAGE_NAME = "@wix/auto_sdk_bookings_bookings";
527
+ function confirmOrDeclineBooking(payload) {
528
+ function __confirmOrDeclineBooking({ host }) {
529
+ const metadata = {
530
+ entityFqdn: "wix.bookings.v2.booking",
531
+ method: "POST",
532
+ methodFqn: "com.wixpress.bookings.confirmator.v2.Confirmator.ConfirmOrDeclineBooking",
533
+ packageName: PACKAGE_NAME,
534
+ migrationOptions: {
535
+ optInTransformResponse: true
536
+ },
537
+ url: resolveComWixpressBookingsConfirmatorV2ConfirmatorUrl({
538
+ protoPath: "/v2/confirmation/{bookingId}:confirmOrDecline",
539
+ data: payload,
540
+ host
541
+ }),
542
+ data: payload,
543
+ transformResponse: (payload2) => transformPaths(payload2, [
544
+ {
545
+ transformFn: transformRESTTimestampToSDKTimestamp,
546
+ paths: [
547
+ { path: "booking.createdDate" },
548
+ { path: "booking.startDate" },
549
+ { path: "booking.endDate" },
550
+ { path: "booking.updatedDate" },
551
+ { path: "booking.canceledDate" }
552
+ ]
553
+ },
554
+ {
555
+ transformFn: transformRESTFloatToSDKFloat,
556
+ paths: [
557
+ { path: "booking.contactDetails.fullAddress.geocode.latitude" },
558
+ { path: "booking.contactDetails.fullAddress.geocode.longitude" }
559
+ ]
560
+ }
561
+ ])
562
+ };
563
+ return metadata;
564
+ }
565
+ return __confirmOrDeclineBooking;
566
+ }
567
+ function bulkConfirmOrDeclineBooking(payload) {
568
+ function __bulkConfirmOrDeclineBooking({ host }) {
569
+ const metadata = {
570
+ entityFqdn: "wix.bookings.v2.booking",
571
+ method: "POST",
572
+ methodFqn: "com.wixpress.bookings.confirmator.v2.Confirmator.BulkConfirmOrDeclineBooking",
573
+ packageName: PACKAGE_NAME,
574
+ migrationOptions: {
575
+ optInTransformResponse: true
576
+ },
577
+ url: resolveComWixpressBookingsConfirmatorV2ConfirmatorUrl({
578
+ protoPath: "/v2/bulk/bookings/confirmOrDecline",
579
+ data: payload,
580
+ host
581
+ }),
582
+ data: payload,
583
+ transformResponse: (payload2) => transformPaths(payload2, [
584
+ {
585
+ transformFn: transformRESTTimestampToSDKTimestamp,
586
+ paths: [
587
+ { path: "results.item.createdDate" },
588
+ { path: "results.item.startDate" },
589
+ { path: "results.item.endDate" },
590
+ { path: "results.item.updatedDate" },
591
+ { path: "results.item.canceledDate" }
592
+ ]
593
+ },
594
+ {
595
+ transformFn: transformRESTFloatToSDKFloat,
596
+ paths: [
597
+ {
598
+ path: "results.item.contactDetails.fullAddress.geocode.latitude"
599
+ },
600
+ {
601
+ path: "results.item.contactDetails.fullAddress.geocode.longitude"
602
+ }
603
+ ]
604
+ }
605
+ ])
606
+ };
607
+ return metadata;
608
+ }
609
+ return __bulkConfirmOrDeclineBooking;
610
+ }
527
611
  function createMultiServiceBooking(payload) {
528
612
  function __createMultiServiceBooking({ host }) {
529
613
  const serializedData = transformPaths(payload, [
@@ -981,90 +1065,6 @@ function removeBookingsFromMultiServiceBooking(payload) {
981
1065
  }
982
1066
  return __removeBookingsFromMultiServiceBooking;
983
1067
  }
984
- function confirmOrDeclineBooking(payload) {
985
- function __confirmOrDeclineBooking({ host }) {
986
- const metadata = {
987
- entityFqdn: "wix.bookings.v2.booking",
988
- method: "POST",
989
- methodFqn: "com.wixpress.bookings.confirmator.v2.Confirmator.ConfirmOrDeclineBooking",
990
- packageName: PACKAGE_NAME,
991
- migrationOptions: {
992
- optInTransformResponse: true
993
- },
994
- url: resolveComWixpressBookingsConfirmatorV2ConfirmatorUrl({
995
- protoPath: "/v2/confirmation/{bookingId}:confirmOrDecline",
996
- data: payload,
997
- host
998
- }),
999
- data: payload,
1000
- transformResponse: (payload2) => transformPaths(payload2, [
1001
- {
1002
- transformFn: transformRESTTimestampToSDKTimestamp,
1003
- paths: [
1004
- { path: "booking.createdDate" },
1005
- { path: "booking.startDate" },
1006
- { path: "booking.endDate" },
1007
- { path: "booking.updatedDate" },
1008
- { path: "booking.canceledDate" }
1009
- ]
1010
- },
1011
- {
1012
- transformFn: transformRESTFloatToSDKFloat,
1013
- paths: [
1014
- { path: "booking.contactDetails.fullAddress.geocode.latitude" },
1015
- { path: "booking.contactDetails.fullAddress.geocode.longitude" }
1016
- ]
1017
- }
1018
- ])
1019
- };
1020
- return metadata;
1021
- }
1022
- return __confirmOrDeclineBooking;
1023
- }
1024
- function bulkConfirmOrDeclineBooking(payload) {
1025
- function __bulkConfirmOrDeclineBooking({ host }) {
1026
- const metadata = {
1027
- entityFqdn: "wix.bookings.v2.booking",
1028
- method: "POST",
1029
- methodFqn: "com.wixpress.bookings.confirmator.v2.Confirmator.BulkConfirmOrDeclineBooking",
1030
- packageName: PACKAGE_NAME,
1031
- migrationOptions: {
1032
- optInTransformResponse: true
1033
- },
1034
- url: resolveComWixpressBookingsConfirmatorV2ConfirmatorUrl({
1035
- protoPath: "/v2/bulk/bookings/confirmOrDecline",
1036
- data: payload,
1037
- host
1038
- }),
1039
- data: payload,
1040
- transformResponse: (payload2) => transformPaths(payload2, [
1041
- {
1042
- transformFn: transformRESTTimestampToSDKTimestamp,
1043
- paths: [
1044
- { path: "results.item.createdDate" },
1045
- { path: "results.item.startDate" },
1046
- { path: "results.item.endDate" },
1047
- { path: "results.item.updatedDate" },
1048
- { path: "results.item.canceledDate" }
1049
- ]
1050
- },
1051
- {
1052
- transformFn: transformRESTFloatToSDKFloat,
1053
- paths: [
1054
- {
1055
- path: "results.item.contactDetails.fullAddress.geocode.latitude"
1056
- },
1057
- {
1058
- path: "results.item.contactDetails.fullAddress.geocode.longitude"
1059
- }
1060
- ]
1061
- }
1062
- ])
1063
- };
1064
- return metadata;
1065
- }
1066
- return __bulkConfirmOrDeclineBooking;
1067
- }
1068
1068
  function createBooking(payload) {
1069
1069
  function __createBooking({ host }) {
1070
1070
  const serializedData = transformPaths(payload, [
@@ -1756,6 +1756,64 @@ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
1756
1756
  SortOrder2["DESC"] = "DESC";
1757
1757
  return SortOrder2;
1758
1758
  })(SortOrder || {});
1759
+ async function confirmOrDeclineBooking2(bookingId, options) {
1760
+ const { httpClient, sideEffects } = arguments[2];
1761
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1762
+ bookingId,
1763
+ paymentStatus: options?.paymentStatus
1764
+ });
1765
+ const reqOpts = confirmOrDeclineBooking(payload);
1766
+ sideEffects?.onSiteCall?.();
1767
+ try {
1768
+ const result = await httpClient.request(reqOpts);
1769
+ sideEffects?.onSuccess?.(result);
1770
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1771
+ } catch (err) {
1772
+ const transformedError = sdkTransformError(
1773
+ err,
1774
+ {
1775
+ spreadPathsToArguments: {},
1776
+ explicitPathsToArguments: {
1777
+ bookingId: "$[0]",
1778
+ paymentStatus: "$[1].paymentStatus"
1779
+ },
1780
+ singleArgumentUnchanged: false
1781
+ },
1782
+ ["bookingId", "options"]
1783
+ );
1784
+ sideEffects?.onError?.(err);
1785
+ throw transformedError;
1786
+ }
1787
+ }
1788
+ async function bulkConfirmOrDeclineBooking2(details, options) {
1789
+ const { httpClient, sideEffects } = arguments[2];
1790
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1791
+ details,
1792
+ returnEntity: options?.returnEntity
1793
+ });
1794
+ const reqOpts = bulkConfirmOrDeclineBooking(payload);
1795
+ sideEffects?.onSiteCall?.();
1796
+ try {
1797
+ const result = await httpClient.request(reqOpts);
1798
+ sideEffects?.onSuccess?.(result);
1799
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1800
+ } catch (err) {
1801
+ const transformedError = sdkTransformError(
1802
+ err,
1803
+ {
1804
+ spreadPathsToArguments: {},
1805
+ explicitPathsToArguments: {
1806
+ details: "$[0]",
1807
+ returnEntity: "$[1].returnEntity"
1808
+ },
1809
+ singleArgumentUnchanged: false
1810
+ },
1811
+ ["details", "options"]
1812
+ );
1813
+ sideEffects?.onError?.(err);
1814
+ throw transformedError;
1815
+ }
1816
+ }
1759
1817
  async function createMultiServiceBooking2(bookings, options) {
1760
1818
  const { httpClient, sideEffects } = arguments[2];
1761
1819
  const payload = renameKeysFromSDKRequestToRESTRequest({
@@ -2117,64 +2175,6 @@ async function removeBookingsFromMultiServiceBooking2(multiServiceBookingId, opt
2117
2175
  throw transformedError;
2118
2176
  }
2119
2177
  }
2120
- async function confirmOrDeclineBooking2(bookingId, options) {
2121
- const { httpClient, sideEffects } = arguments[2];
2122
- const payload = renameKeysFromSDKRequestToRESTRequest({
2123
- bookingId,
2124
- paymentStatus: options?.paymentStatus
2125
- });
2126
- const reqOpts = confirmOrDeclineBooking(payload);
2127
- sideEffects?.onSiteCall?.();
2128
- try {
2129
- const result = await httpClient.request(reqOpts);
2130
- sideEffects?.onSuccess?.(result);
2131
- return renameKeysFromRESTResponseToSDKResponse(result.data);
2132
- } catch (err) {
2133
- const transformedError = sdkTransformError(
2134
- err,
2135
- {
2136
- spreadPathsToArguments: {},
2137
- explicitPathsToArguments: {
2138
- bookingId: "$[0]",
2139
- paymentStatus: "$[1].paymentStatus"
2140
- },
2141
- singleArgumentUnchanged: false
2142
- },
2143
- ["bookingId", "options"]
2144
- );
2145
- sideEffects?.onError?.(err);
2146
- throw transformedError;
2147
- }
2148
- }
2149
- async function bulkConfirmOrDeclineBooking2(details, options) {
2150
- const { httpClient, sideEffects } = arguments[2];
2151
- const payload = renameKeysFromSDKRequestToRESTRequest({
2152
- details,
2153
- returnEntity: options?.returnEntity
2154
- });
2155
- const reqOpts = bulkConfirmOrDeclineBooking(payload);
2156
- sideEffects?.onSiteCall?.();
2157
- try {
2158
- const result = await httpClient.request(reqOpts);
2159
- sideEffects?.onSuccess?.(result);
2160
- return renameKeysFromRESTResponseToSDKResponse(result.data);
2161
- } catch (err) {
2162
- const transformedError = sdkTransformError(
2163
- err,
2164
- {
2165
- spreadPathsToArguments: {},
2166
- explicitPathsToArguments: {
2167
- details: "$[0]",
2168
- returnEntity: "$[1].returnEntity"
2169
- },
2170
- singleArgumentUnchanged: false
2171
- },
2172
- ["details", "options"]
2173
- );
2174
- sideEffects?.onError?.(err);
2175
- throw transformedError;
2176
- }
2177
- }
2178
2178
  async function createBooking2(booking, options) {
2179
2179
  const { httpClient, sideEffects } = arguments[2];
2180
2180
  const payload = renameKeysFromSDKRequestToRESTRequest({