@wix/auto_sdk_bookings_bookings 1.0.25 → 1.0.26

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 (129) hide show
  1. package/build/{es/src/bookings-v2-booking-bookings.types.d.ts → bookings-v2-booking-bookings.universal-BEUtU-41.d.mts} +629 -247
  2. package/build/{cjs/src/bookings-v2-booking-bookings.types.d.ts → bookings-v2-booking-bookings.universal-BEUtU-41.d.ts} +629 -247
  3. package/build/{es/src/bookings-v2-booking-bookings.public.d.ts → index.d.mts} +84 -34
  4. package/build/{internal/cjs/src/bookings-v2-booking-bookings.public.d.ts → index.d.ts} +84 -34
  5. package/build/index.js +2387 -0
  6. package/build/index.js.map +1 -0
  7. package/build/index.mjs +2323 -0
  8. package/build/index.mjs.map +1 -0
  9. package/build/internal/{cjs/src/bookings-v2-booking-bookings.types.d.ts → bookings-v2-booking-bookings.universal-BEUtU-41.d.mts} +629 -247
  10. package/build/internal/{es/src/bookings-v2-booking-bookings.types.d.ts → bookings-v2-booking-bookings.universal-BEUtU-41.d.ts} +629 -247
  11. package/build/{cjs/src/bookings-v2-booking-bookings.public.d.ts → internal/index.d.mts} +84 -34
  12. package/build/internal/{es/src/bookings-v2-booking-bookings.public.d.ts → index.d.ts} +84 -34
  13. package/build/internal/index.js +2387 -0
  14. package/build/internal/index.js.map +1 -0
  15. package/build/internal/index.mjs +2323 -0
  16. package/build/internal/index.mjs.map +1 -0
  17. package/build/internal/meta.d.mts +1666 -0
  18. package/build/internal/meta.d.ts +1666 -0
  19. package/build/internal/meta.js +1522 -0
  20. package/build/internal/meta.js.map +1 -0
  21. package/build/internal/meta.mjs +1475 -0
  22. package/build/internal/meta.mjs.map +1 -0
  23. package/build/meta.d.mts +1666 -0
  24. package/build/meta.d.ts +1666 -0
  25. package/build/meta.js +1522 -0
  26. package/build/meta.js.map +1 -0
  27. package/build/meta.mjs +1475 -0
  28. package/build/meta.mjs.map +1 -0
  29. package/package.json +12 -11
  30. package/build/cjs/index.d.ts +0 -1
  31. package/build/cjs/index.js +0 -18
  32. package/build/cjs/index.js.map +0 -1
  33. package/build/cjs/index.typings.d.ts +0 -1
  34. package/build/cjs/index.typings.js +0 -18
  35. package/build/cjs/index.typings.js.map +0 -1
  36. package/build/cjs/meta.d.ts +0 -1
  37. package/build/cjs/meta.js +0 -18
  38. package/build/cjs/meta.js.map +0 -1
  39. package/build/cjs/src/bookings-v2-booking-bookings.context.d.ts +0 -61
  40. package/build/cjs/src/bookings-v2-booking-bookings.context.js +0 -77
  41. package/build/cjs/src/bookings-v2-booking-bookings.context.js.map +0 -1
  42. package/build/cjs/src/bookings-v2-booking-bookings.http.d.ts +0 -510
  43. package/build/cjs/src/bookings-v2-booking-bookings.http.js +0 -1579
  44. package/build/cjs/src/bookings-v2-booking-bookings.http.js.map +0 -1
  45. package/build/cjs/src/bookings-v2-booking-bookings.meta.d.ts +0 -61
  46. package/build/cjs/src/bookings-v2-booking-bookings.meta.js +0 -427
  47. package/build/cjs/src/bookings-v2-booking-bookings.meta.js.map +0 -1
  48. package/build/cjs/src/bookings-v2-booking-bookings.public.js +0 -313
  49. package/build/cjs/src/bookings-v2-booking-bookings.public.js.map +0 -1
  50. package/build/cjs/src/bookings-v2-booking-bookings.types.js +0 -165
  51. package/build/cjs/src/bookings-v2-booking-bookings.types.js.map +0 -1
  52. package/build/cjs/src/bookings-v2-booking-bookings.universal.d.ts +0 -4359
  53. package/build/cjs/src/bookings-v2-booking-bookings.universal.js +0 -1654
  54. package/build/cjs/src/bookings-v2-booking-bookings.universal.js.map +0 -1
  55. package/build/es/index.d.ts +0 -1
  56. package/build/es/index.js +0 -2
  57. package/build/es/index.js.map +0 -1
  58. package/build/es/index.typings.d.ts +0 -1
  59. package/build/es/index.typings.js +0 -2
  60. package/build/es/index.typings.js.map +0 -1
  61. package/build/es/meta.d.ts +0 -1
  62. package/build/es/meta.js +0 -2
  63. package/build/es/meta.js.map +0 -1
  64. package/build/es/src/bookings-v2-booking-bookings.context.d.ts +0 -61
  65. package/build/es/src/bookings-v2-booking-bookings.context.js +0 -61
  66. package/build/es/src/bookings-v2-booking-bookings.context.js.map +0 -1
  67. package/build/es/src/bookings-v2-booking-bookings.http.d.ts +0 -510
  68. package/build/es/src/bookings-v2-booking-bookings.http.js +0 -1555
  69. package/build/es/src/bookings-v2-booking-bookings.http.js.map +0 -1
  70. package/build/es/src/bookings-v2-booking-bookings.meta.d.ts +0 -61
  71. package/build/es/src/bookings-v2-booking-bookings.meta.js +0 -380
  72. package/build/es/src/bookings-v2-booking-bookings.meta.js.map +0 -1
  73. package/build/es/src/bookings-v2-booking-bookings.public.js +0 -276
  74. package/build/es/src/bookings-v2-booking-bookings.public.js.map +0 -1
  75. package/build/es/src/bookings-v2-booking-bookings.types.js +0 -162
  76. package/build/es/src/bookings-v2-booking-bookings.types.js.map +0 -1
  77. package/build/es/src/bookings-v2-booking-bookings.universal.d.ts +0 -4359
  78. package/build/es/src/bookings-v2-booking-bookings.universal.js +0 -1607
  79. package/build/es/src/bookings-v2-booking-bookings.universal.js.map +0 -1
  80. package/build/internal/cjs/index.d.ts +0 -1
  81. package/build/internal/cjs/index.js +0 -18
  82. package/build/internal/cjs/index.js.map +0 -1
  83. package/build/internal/cjs/index.typings.d.ts +0 -1
  84. package/build/internal/cjs/index.typings.js +0 -18
  85. package/build/internal/cjs/index.typings.js.map +0 -1
  86. package/build/internal/cjs/meta.d.ts +0 -1
  87. package/build/internal/cjs/meta.js +0 -18
  88. package/build/internal/cjs/meta.js.map +0 -1
  89. package/build/internal/cjs/src/bookings-v2-booking-bookings.context.d.ts +0 -61
  90. package/build/internal/cjs/src/bookings-v2-booking-bookings.context.js +0 -77
  91. package/build/internal/cjs/src/bookings-v2-booking-bookings.context.js.map +0 -1
  92. package/build/internal/cjs/src/bookings-v2-booking-bookings.http.d.ts +0 -510
  93. package/build/internal/cjs/src/bookings-v2-booking-bookings.http.js +0 -1579
  94. package/build/internal/cjs/src/bookings-v2-booking-bookings.http.js.map +0 -1
  95. package/build/internal/cjs/src/bookings-v2-booking-bookings.meta.d.ts +0 -61
  96. package/build/internal/cjs/src/bookings-v2-booking-bookings.meta.js +0 -427
  97. package/build/internal/cjs/src/bookings-v2-booking-bookings.meta.js.map +0 -1
  98. package/build/internal/cjs/src/bookings-v2-booking-bookings.public.js +0 -313
  99. package/build/internal/cjs/src/bookings-v2-booking-bookings.public.js.map +0 -1
  100. package/build/internal/cjs/src/bookings-v2-booking-bookings.types.js +0 -165
  101. package/build/internal/cjs/src/bookings-v2-booking-bookings.types.js.map +0 -1
  102. package/build/internal/cjs/src/bookings-v2-booking-bookings.universal.d.ts +0 -4359
  103. package/build/internal/cjs/src/bookings-v2-booking-bookings.universal.js +0 -1654
  104. package/build/internal/cjs/src/bookings-v2-booking-bookings.universal.js.map +0 -1
  105. package/build/internal/es/index.d.ts +0 -1
  106. package/build/internal/es/index.js +0 -2
  107. package/build/internal/es/index.js.map +0 -1
  108. package/build/internal/es/index.typings.d.ts +0 -1
  109. package/build/internal/es/index.typings.js +0 -2
  110. package/build/internal/es/index.typings.js.map +0 -1
  111. package/build/internal/es/meta.d.ts +0 -1
  112. package/build/internal/es/meta.js +0 -2
  113. package/build/internal/es/meta.js.map +0 -1
  114. package/build/internal/es/src/bookings-v2-booking-bookings.context.d.ts +0 -61
  115. package/build/internal/es/src/bookings-v2-booking-bookings.context.js +0 -61
  116. package/build/internal/es/src/bookings-v2-booking-bookings.context.js.map +0 -1
  117. package/build/internal/es/src/bookings-v2-booking-bookings.http.d.ts +0 -510
  118. package/build/internal/es/src/bookings-v2-booking-bookings.http.js +0 -1555
  119. package/build/internal/es/src/bookings-v2-booking-bookings.http.js.map +0 -1
  120. package/build/internal/es/src/bookings-v2-booking-bookings.meta.d.ts +0 -61
  121. package/build/internal/es/src/bookings-v2-booking-bookings.meta.js +0 -380
  122. package/build/internal/es/src/bookings-v2-booking-bookings.meta.js.map +0 -1
  123. package/build/internal/es/src/bookings-v2-booking-bookings.public.js +0 -276
  124. package/build/internal/es/src/bookings-v2-booking-bookings.public.js.map +0 -1
  125. package/build/internal/es/src/bookings-v2-booking-bookings.types.js +0 -162
  126. package/build/internal/es/src/bookings-v2-booking-bookings.types.js.map +0 -1
  127. package/build/internal/es/src/bookings-v2-booking-bookings.universal.d.ts +0 -4359
  128. package/build/internal/es/src/bookings-v2-booking-bookings.universal.js +0 -1607
  129. package/build/internal/es/src/bookings-v2-booking-bookings.universal.js.map +0 -1
@@ -1,1654 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.removeBookingsFromMultiServiceBooking = exports.addBookingsToMultiServiceBooking = exports.getMultiServiceBooking = exports.bulkGetMultiServiceBookingAllowedActions = exports.declineMultiServiceBooking = exports.confirmMultiServiceBooking = exports.markMultiServiceBookingAsPending = exports.cancelMultiServiceBooking = exports.getMultiServiceBookingAvailability = exports.rescheduleMultiServiceBooking = exports.createMultiServiceBooking = exports.updateNumberOfParticipants = exports.cancelBooking = exports.declineBooking = exports.updateExtendedFields = exports.confirmBooking = exports.rescheduleBooking = exports.bulkCreateBooking = exports.createBooking = exports.bulkConfirmOrDeclineBooking = exports.confirmOrDeclineBooking = exports.SortOrder = exports.IdentityType = exports.LocationLocationType = exports.WebhookIdentityType = exports.IdentificationDataIdentityType = exports.Actor = exports.Platform = exports.SelectedPaymentOption = exports.PaymentStatus = exports.BookingStatus = exports.ValueType = exports.LocationType = exports.MultiServiceBookingType = void 0;
27
- const transform_error_1 = require("@wix/sdk-runtime/transform-error");
28
- const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
29
- const ambassadorWixBookingsV2Booking = __importStar(require("./bookings-v2-booking-bookings.http.js"));
30
- /**
31
- * A multi-service booking is considered available if all individual bookings are available as returned from List Multi Service Availability Time Slots.
32
- * Currently, `SEPARATE_BOOKINGS` and `PARALLEL_BOOKINGS` are not supported.
33
- * Multi-service booking is available if each of its bookings is available separately.
34
- * For `SEQUENTIAL_BOOKINGS`, see `List Multi Service Availability Time Slots` documentation.
35
- */
36
- var MultiServiceBookingType;
37
- (function (MultiServiceBookingType) {
38
- MultiServiceBookingType["SEQUENTIAL_BOOKINGS"] = "SEQUENTIAL_BOOKINGS";
39
- MultiServiceBookingType["SEPARATE_BOOKINGS"] = "SEPARATE_BOOKINGS";
40
- MultiServiceBookingType["PARALLEL_BOOKINGS"] = "PARALLEL_BOOKINGS";
41
- })(MultiServiceBookingType || (exports.MultiServiceBookingType = MultiServiceBookingType = {}));
42
- var LocationType;
43
- (function (LocationType) {
44
- LocationType["UNDEFINED"] = "UNDEFINED";
45
- LocationType["OWNER_BUSINESS"] = "OWNER_BUSINESS";
46
- LocationType["OWNER_CUSTOM"] = "OWNER_CUSTOM";
47
- LocationType["CUSTOM"] = "CUSTOM";
48
- })(LocationType || (exports.LocationType = LocationType = {}));
49
- var ValueType;
50
- (function (ValueType) {
51
- /** Short text. This is the default value type. */
52
- ValueType["SHORT_TEXT"] = "SHORT_TEXT";
53
- /** Long text. */
54
- ValueType["LONG_TEXT"] = "LONG_TEXT";
55
- /** A text that represents the check box value. If selected the value is `true`, otherwise `false`. */
56
- ValueType["CHECK_BOX"] = "CHECK_BOX";
57
- })(ValueType || (exports.ValueType = ValueType = {}));
58
- /** Booking status. */
59
- var BookingStatus;
60
- (function (BookingStatus) {
61
- /**
62
- * The booking was created, but the customer hasn't completed the related
63
- * eCommerce order yet.
64
- */
65
- BookingStatus["CREATED"] = "CREATED";
66
- /**
67
- * The merchant has confirmed the booking and it appears in the
68
- * business calendar. Merchants can set up their *services*
69
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction))
70
- * to automatically confirm all `PENDING` bookings.
71
- */
72
- BookingStatus["CONFIRMED"] = "CONFIRMED";
73
- /**
74
- * The customer has canceled the booking. Depending on the relevant service's
75
- * _policy snapshot_
76
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/booking-policy-snapshots/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policy-snapshots/introduction))
77
- * they may have to pay a _cancellation fee_
78
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/booking-fees/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/booking-fees/introduction)).
79
- */
80
- BookingStatus["CANCELED"] = "CANCELED";
81
- /**
82
- * The merchant must manually confirm the booking before it appears
83
- * in the business calendar.
84
- */
85
- BookingStatus["PENDING"] = "PENDING";
86
- /** The merchant has declined the booking before the customer was charged. */
87
- BookingStatus["DECLINED"] = "DECLINED";
88
- /**
89
- * The booking is on a waitlist.
90
- * Currently, you can't call Register to Waitlist
91
- * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/waitlist/register-to-waitlist))
92
- * for course or appointment bookings, even though this is supported in live sites.
93
- * You can call Register to Waitlist only for class session bookings.
94
- */
95
- BookingStatus["WAITING_LIST"] = "WAITING_LIST";
96
- })(BookingStatus || (exports.BookingStatus = BookingStatus = {}));
97
- /**
98
- * Payment status.
99
- * Automatically updated when using eCommerce checkout APIs.
100
- */
101
- var PaymentStatus;
102
- (function (PaymentStatus) {
103
- /** Undefined payment status. */
104
- PaymentStatus["UNDEFINED"] = "UNDEFINED";
105
- /** The booking isn't paid. */
106
- PaymentStatus["NOT_PAID"] = "NOT_PAID";
107
- /** The booking is fully paid. */
108
- PaymentStatus["PAID"] = "PAID";
109
- /** The booking is partially paid. */
110
- PaymentStatus["PARTIALLY_PAID"] = "PARTIALLY_PAID";
111
- /** The booking is refunded. */
112
- PaymentStatus["REFUNDED"] = "REFUNDED";
113
- /** The booking is free of charge. */
114
- PaymentStatus["EXEMPT"] = "EXEMPT";
115
- })(PaymentStatus || (exports.PaymentStatus = PaymentStatus = {}));
116
- /**
117
- * Selected payment option.
118
- *
119
- * One of the payment options offered by the service.
120
- * This field is set when the user selects an option during booking.
121
- * If left undefined, the payment option is resolved by the service configuration on checkout.
122
- */
123
- var SelectedPaymentOption;
124
- (function (SelectedPaymentOption) {
125
- /** Undefined payment option. */
126
- SelectedPaymentOption["UNDEFINED"] = "UNDEFINED";
127
- /** Offline payment. */
128
- SelectedPaymentOption["OFFLINE"] = "OFFLINE";
129
- /** Online payment. */
130
- SelectedPaymentOption["ONLINE"] = "ONLINE";
131
- /** Payment using a Wix Pricing Plan. */
132
- SelectedPaymentOption["MEMBERSHIP"] = "MEMBERSHIP";
133
- /**
134
- * Customers can pay only in person with a Wix Pricing Plan, while the Wix user
135
- * must manually redeem the pricing plan in the dashboard.
136
- */
137
- SelectedPaymentOption["MEMBERSHIP_OFFLINE"] = "MEMBERSHIP_OFFLINE";
138
- })(SelectedPaymentOption || (exports.SelectedPaymentOption = SelectedPaymentOption = {}));
139
- var Platform;
140
- (function (Platform) {
141
- Platform["UNDEFINED_PLATFORM"] = "UNDEFINED_PLATFORM";
142
- Platform["WEB"] = "WEB";
143
- Platform["MOBILE_APP"] = "MOBILE_APP";
144
- })(Platform || (exports.Platform = Platform = {}));
145
- var Actor;
146
- (function (Actor) {
147
- Actor["UNDEFINED_ACTOR"] = "UNDEFINED_ACTOR";
148
- Actor["BUSINESS"] = "BUSINESS";
149
- Actor["CUSTOMER"] = "CUSTOMER";
150
- })(Actor || (exports.Actor = Actor = {}));
151
- var IdentificationDataIdentityType;
152
- (function (IdentificationDataIdentityType) {
153
- IdentificationDataIdentityType["UNKNOWN"] = "UNKNOWN";
154
- IdentificationDataIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
155
- IdentificationDataIdentityType["MEMBER"] = "MEMBER";
156
- IdentificationDataIdentityType["WIX_USER"] = "WIX_USER";
157
- IdentificationDataIdentityType["APP"] = "APP";
158
- })(IdentificationDataIdentityType || (exports.IdentificationDataIdentityType = IdentificationDataIdentityType = {}));
159
- var WebhookIdentityType;
160
- (function (WebhookIdentityType) {
161
- WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
162
- WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
163
- WebhookIdentityType["MEMBER"] = "MEMBER";
164
- WebhookIdentityType["WIX_USER"] = "WIX_USER";
165
- WebhookIdentityType["APP"] = "APP";
166
- })(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
167
- var LocationLocationType;
168
- (function (LocationLocationType) {
169
- /** Undefined location type. */
170
- LocationLocationType["UNDEFINED"] = "UNDEFINED";
171
- /** The business address as set in the site’s general settings. */
172
- LocationLocationType["OWNER_BUSINESS"] = "OWNER_BUSINESS";
173
- /** The address set when creating the service. */
174
- LocationLocationType["OWNER_CUSTOM"] = "OWNER_CUSTOM";
175
- /** The address set for the individual session. */
176
- LocationLocationType["CUSTOM"] = "CUSTOM";
177
- })(LocationLocationType || (exports.LocationLocationType = LocationLocationType = {}));
178
- var IdentityType;
179
- (function (IdentityType) {
180
- IdentityType["UNKNOWN"] = "UNKNOWN";
181
- IdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
182
- IdentityType["MEMBER"] = "MEMBER";
183
- IdentityType["WIX_USER"] = "WIX_USER";
184
- IdentityType["APP"] = "APP";
185
- })(IdentityType || (exports.IdentityType = IdentityType = {}));
186
- var SortOrder;
187
- (function (SortOrder) {
188
- SortOrder["ASC"] = "ASC";
189
- SortOrder["DESC"] = "DESC";
190
- })(SortOrder || (exports.SortOrder = SortOrder = {}));
191
- /**
192
- * Updates the booking `status` to `CONFIRMED`, `PENDING`, or `DECLINED` based
193
- * on the `paymentStatus` you provide, double booking conflicts, and whether
194
- * the service requires business approval.
195
- *
196
- * ## eCommerce checkout restriction
197
- *
198
- * Call this method only when using a custom checkout page. Don't
199
- * call it when using a *Wix eCommerce checkout*
200
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)).
201
- * In such cases, Wix automatically updates the booking status based on
202
- * the `paymentStatus` of the corresponding *Wix eCommerce order*
203
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction)).
204
- *
205
- * ## New booking status
206
- *
207
- * The booking `status` is set to `DECLINED` if both of the following conditions
208
- * are met:
209
- * + You provide `UNDEFINED`, `NOT_PAID`, `REFUNDED`, or `EXEMPT` as payment status.
210
- * + There is a double booking conflict.
211
- *
212
- * If only one or none of these conditions is met, `status` is set to `PENDING`
213
- * or `CONFIRMED` depending on whether the service requires business approval.
214
- *
215
- * ## Double bookings
216
- *
217
- * If there is a double booking conflict, but the booking has already been at least
218
- * partially paid, the method still marks the booking as `PENDING` or `CONFIRMED`.
219
- * Then, it also sets `doubleBooked` to `true`.
220
- *
221
- * ## Admin overwrites
222
- *
223
- * There are small but important differences in confirmation behavior if the
224
- * booking was created with special `flowControlSettings`:
225
- * + If the booking's `flowControlSettings.skipAvailabilityValidation` was set to
226
- * `true`, the booking is never declined regardless of double booking conflicts.
227
- * Instead, it's marked `CONFIRMED` or `PENDING`, depending on whether the
228
- * service requires business approval.
229
- * + If the booking's `flowControlSettings.skipBusinessConfirmation` was set to
230
- * `true`, the booking skips `PENDING` status and is marked `CONFIRMED`
231
- * immediately.
232
- * @param bookingId - ID of the booking to confirm or decline.
233
- * @public
234
- * @requiredField bookingId
235
- * @permissionId BOOKINGS.BOOKING_CONFIRM_OR_DECLINE
236
- * @permissionScope Manage Bookings
237
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
238
- * @permissionScope Manage Bookings - all permissions
239
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
240
- * @applicableIdentity APP
241
- * @fqn com.wixpress.bookings.confirmator.v2.Confirmator.ConfirmOrDeclineBooking
242
- */
243
- async function confirmOrDeclineBooking(bookingId, options) {
244
- // @ts-ignore
245
- const { httpClient, sideEffects } = arguments[2];
246
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
247
- bookingId: bookingId,
248
- paymentStatus: options?.paymentStatus,
249
- });
250
- const reqOpts = ambassadorWixBookingsV2Booking.confirmOrDeclineBooking(payload);
251
- sideEffects?.onSiteCall?.();
252
- try {
253
- const result = await httpClient.request(reqOpts);
254
- sideEffects?.onSuccess?.(result);
255
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
256
- }
257
- catch (err) {
258
- const transformedError = (0, transform_error_1.transformError)(err, {
259
- spreadPathsToArguments: {},
260
- explicitPathsToArguments: {
261
- bookingId: '$[0]',
262
- paymentStatus: '$[1].paymentStatus',
263
- },
264
- singleArgumentUnchanged: false,
265
- }, ['bookingId', 'options']);
266
- sideEffects?.onError?.(err);
267
- throw transformedError;
268
- }
269
- }
270
- exports.confirmOrDeclineBooking = confirmOrDeclineBooking;
271
- /**
272
- * Confirms or declines up to 300 bookings.
273
- *
274
- *
275
- * See *Confirm Or Decline Booking*
276
- * ([SDK](https://dev.wix.com/docs/velo/api-reference/wix-bookings-v2/bookings/confirm-or-decline-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/confirm-or-decline-booking))
277
- * for details about when a booking is confirmed or declined.
278
- * @param details - Bookings to confirm or decline.
279
- * @public
280
- * @documentationMaturity preview
281
- * @requiredField details
282
- * @requiredField details.bookingId
283
- * @permissionId BOOKINGS.BOOKING_CONFIRM_OR_DECLINE
284
- * @permissionScope Manage Bookings
285
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
286
- * @permissionScope Manage Bookings - all permissions
287
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
288
- * @applicableIdentity APP
289
- * @fqn com.wixpress.bookings.confirmator.v2.Confirmator.BulkConfirmOrDeclineBooking
290
- */
291
- async function bulkConfirmOrDeclineBooking(details, options) {
292
- // @ts-ignore
293
- const { httpClient, sideEffects } = arguments[2];
294
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
295
- details: details,
296
- returnEntity: options?.returnEntity,
297
- });
298
- const reqOpts = ambassadorWixBookingsV2Booking.bulkConfirmOrDeclineBooking(payload);
299
- sideEffects?.onSiteCall?.();
300
- try {
301
- const result = await httpClient.request(reqOpts);
302
- sideEffects?.onSuccess?.(result);
303
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
304
- }
305
- catch (err) {
306
- const transformedError = (0, transform_error_1.transformError)(err, {
307
- spreadPathsToArguments: {},
308
- explicitPathsToArguments: {
309
- details: '$[0]',
310
- returnEntity: '$[1].returnEntity',
311
- },
312
- singleArgumentUnchanged: false,
313
- }, ['details', 'options']);
314
- sideEffects?.onError?.(err);
315
- throw transformedError;
316
- }
317
- }
318
- exports.bulkConfirmOrDeclineBooking = bulkConfirmOrDeclineBooking;
319
- /**
320
- * Creates a booking.
321
- *
322
- *
323
- * ## Appointment booking
324
- *
325
- * For appointment-based services, specify the relevant `slot` in
326
- * `bookedEntity.slot`. We recommend specifying the complete
327
- * `availabilityEntries.slot` returned in *Query Availability*
328
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/time-slots/availability-calendar/query-availability))
329
- * in your call's request to avoid failed calls due to unavailability.
330
- *
331
- * ## Class session booking
332
- *
333
- * For class services, specify the relevant *event ID*
334
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/events/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction))
335
- * as `bookedEntity.slot.eventId`.
336
- * We recommend retrieving the event ID from *Query Availability's*
337
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/time-slots/availability-calendar/query-availability))
338
- * `availabilityEntries.slot.eventId` to avoid failed calls due to unavailability.
339
- * Specifying an event ID leads to automatic calculations of `slot.startDate`, `slot.endDate`,
340
- * `slot.timezone`, `slot.resource`, and `slot.location`. All manually specified
341
- * values are overridden.
342
- *
343
- * ## Course booking
344
- *
345
- * For course services, specify the course's schedule ID in `bookedEntity.schedule.scheduleId`.
346
- * We recommend following [this sample flow](https://dev.wix.com/docs/rest/business-solutions/bookings/sample-booking-flows#book-a-course)
347
- * to minimize failed calls due to unavailability.
348
- *
349
- * ## Related resources
350
- *
351
- * Specifying a `resource` triggers an availability check, resulting in a failed
352
- * call if the resource is unavailable. Omitting a resource allows Wix Bookings
353
- * to assign a resource belonging to the relevant type randomly when the merchant
354
- * confirms the booking.
355
- *
356
- * ## Participant information
357
- *
358
- * You must specify either `participantsChoices` or `totalParticipants`.
359
- * The call fails if the specified `participantsChoices` aren't among the supported
360
- * _service options and variants_
361
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction)).
362
- *
363
- * ## Notify customers
364
- *
365
- * You can specify a `participantNotification.message` for the customer that's send
366
- * immediately. Ensure `participantNotification.notifyParticipants` is set to `true`
367
- * to send the message.
368
- *
369
- * If you specify `{"sendSmsReminder": true}`, the customer receives an SMS 24 hours
370
- * before the session starts. The phone number is taken from `contactDetails.phone`.
371
- *
372
- * ## Booking status
373
- *
374
- * Bookings default to the `CREATED` status, not affecting the business calendar
375
- * or resource availability. You can specify a different status when the calling
376
- * [identity](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities)
377
- * has `Manage Bookings` permissions.
378
- *
379
- * ## Payment options
380
- *
381
- * The specified `selectedPaymentOption` indicates how the customer intends to
382
- * pay, allowing for later changes to a different method supported by the service.
383
- *
384
- * ## Payment status
385
- *
386
- * A booking is initially created with `{"paymentStatus": "UNDEFINED"}` regardless
387
- * of the payment status specified in Create Booking. If a customer uses an
388
- * _eCommerce checkout_
389
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)),
390
- * Wix Bookings automatically syncs the booking's payment status from
391
- * the corresponding *eCommerce order*
392
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction)).
393
- *
394
- * If a booking doesn't have a corresponding eCommerce order, for example, since
395
- * the customer didn't use the eCommerce checkout, you can update the booking's
396
- * payment status with *Confirm Or Decline Booking*
397
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/confirm-or-decline-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/confirm-or-decline-booking)).
398
- *
399
- * ## Booking form data
400
- *
401
- * When customers sign up for a service, they must fill out the booking form.
402
- * To create a booking with a completed booking form, specify the relevant data in
403
- * `formSubmission`. Ensure the values of the corresponding fields in
404
- * `booking.contactDetails` and `formSubmission` are identical. If these values
405
- * don't match, Create Booking fails. Therefore, we recommend specifying
406
- * only `booking.contactDetails.contactId` when providing `formSubmission`.
407
- *
408
- * ## Admin overwrites
409
- *
410
- * There are small but important differences when you specify special
411
- * `flowControlSettings`:
412
- *
413
- * - `{"skipAvailabilityValidation": true}`: The call succeeds
414
- * regardless of availability. If you don't specify any resource, the call
415
- * succeeds even if no resource of the relevant type is available.
416
- * - `{"skipBusinessConfirmation": true}`: Automatically confirms `PENDING`
417
- * bookings that require manual confirmation.
418
- * - `{"skipSelectedPaymentOptionValidation": true}`: Allows customers to pay
419
- * with payment methods that aren't supported for the service.
420
- *
421
- * When using special `flowControlSettings`, ensure you have sufficient
422
- * permissions. If you encounter failed calls due to insufficient permissions,
423
- * consider the following options:
424
- *
425
- * - **App developers** can use a higher
426
- * [permission](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions),
427
- * such as `MANAGE BOOKINGS - ALL PERMISSIONS`.
428
- * - **Site developers** can utilize
429
- * [elevation](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/authorization/elevation).
430
- *
431
- * Granting additional permissions and using elevation permits method calls that
432
- * would typically fail due to authorization checks. Therefore, you should use
433
- * them intentionally and securely.
434
- * @param booking - The booking to create.
435
- * @public
436
- * @requiredField booking
437
- * @requiredField booking.additionalFields._id
438
- * @requiredField booking.bookedEntity
439
- * @requiredField booking.bookedEntity.item
440
- * @permissionId BOOKINGS.BOOKING_CREATE
441
- * @permissionScope Manage Bookings
442
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
443
- * @permissionScope Manage Bookings - all permissions
444
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
445
- * @applicableIdentity APP
446
- * @applicableIdentity VISITOR
447
- * @fqn com.wixpress.bookings.bookings.v2.Bookings.CreateBooking
448
- */
449
- async function createBooking(booking, options) {
450
- // @ts-ignore
451
- const { httpClient, sideEffects } = arguments[2];
452
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
453
- booking: booking,
454
- participantNotification: options?.participantNotification,
455
- sendSmsReminder: options?.sendSmsReminder,
456
- flowControlSettings: options?.flowControlSettings,
457
- });
458
- const reqOpts = ambassadorWixBookingsV2Booking.createBooking(payload);
459
- sideEffects?.onSiteCall?.();
460
- try {
461
- const result = await httpClient.request(reqOpts);
462
- sideEffects?.onSuccess?.(result);
463
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
464
- }
465
- catch (err) {
466
- const transformedError = (0, transform_error_1.transformError)(err, {
467
- spreadPathsToArguments: {},
468
- explicitPathsToArguments: {
469
- booking: '$[0]',
470
- participantNotification: '$[1].participantNotification',
471
- sendSmsReminder: '$[1].sendSmsReminder',
472
- flowControlSettings: '$[1].flowControlSettings',
473
- },
474
- singleArgumentUnchanged: false,
475
- }, ['booking', 'options']);
476
- sideEffects?.onError?.(err);
477
- throw transformedError;
478
- }
479
- }
480
- exports.createBooking = createBooking;
481
- /**
482
- * Creates up to 8 bookings.
483
- *
484
- *
485
- * See *Create Booking*
486
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/create-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/create-booking))
487
- * for more information.
488
- *
489
- * If any of the specified bookings is missing a required field the entire call
490
- * fails.
491
- *
492
- * If you specify 1 or more unavailable bookings, the call succeeds
493
- * while the unavailable bookings aren't created. Instead, they're counted as
494
- * failures in the returned `bulkActionMetadata`.
495
- * @param createBookingsInfo - Bookings to create.
496
- *
497
- * Max: 8 bookings
498
- * @public
499
- * @requiredField createBookingsInfo
500
- * @requiredField createBookingsInfo.booking
501
- * @requiredField createBookingsInfo.booking.additionalFields._id
502
- * @requiredField createBookingsInfo.booking.bookedEntity
503
- * @requiredField createBookingsInfo.booking.bookedEntity.item
504
- * @permissionId BOOKINGS.BOOKING_CREATE
505
- * @permissionScope Manage Bookings
506
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
507
- * @permissionScope Manage Bookings - all permissions
508
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
509
- * @applicableIdentity APP
510
- * @applicableIdentity VISITOR
511
- * @fqn com.wixpress.bookings.bookings.v2.Bookings.BulkCreateBooking
512
- */
513
- async function bulkCreateBooking(createBookingsInfo, options) {
514
- // @ts-ignore
515
- const { httpClient, sideEffects } = arguments[2];
516
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
517
- createBookingsInfo: createBookingsInfo,
518
- returnFullEntity: options?.returnFullEntity,
519
- });
520
- const reqOpts = ambassadorWixBookingsV2Booking.bulkCreateBooking(payload);
521
- sideEffects?.onSiteCall?.();
522
- try {
523
- const result = await httpClient.request(reqOpts);
524
- sideEffects?.onSuccess?.(result);
525
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
526
- }
527
- catch (err) {
528
- const transformedError = (0, transform_error_1.transformError)(err, {
529
- spreadPathsToArguments: {},
530
- explicitPathsToArguments: {
531
- createBookingsInfo: '$[0]',
532
- returnFullEntity: '$[1].returnFullEntity',
533
- },
534
- singleArgumentUnchanged: false,
535
- }, ['createBookingsInfo', 'options']);
536
- sideEffects?.onError?.(err);
537
- throw transformedError;
538
- }
539
- }
540
- exports.bulkCreateBooking = bulkCreateBooking;
541
- /**
542
- * Reschedules an appointment booking to a different slot or a class booking to
543
- * a different session.
544
- *
545
- *
546
- * ## Course booking limitation
547
- *
548
- * You can't reschedule course bookings.
549
- *
550
- * ## Appointment sessions
551
- *
552
- * For appointments, the old session is removed from the business calendar
553
- * while a new session is added. We recommend calling *Query Availability*
554
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/time-slots/availability-calendar/query-availability))
555
- * first and specifying the entire retrieved `slot`.
556
- *
557
- * ## Class sessions
558
- *
559
- * For classes, the new session must be an existing session belonging to the
560
- * same class. We recommend retrieving `availabilityEntries.slot.eventId`
561
- * from *Query Availability*
562
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/time-slots/availability-calendar/query-availability))
563
- * to avoid failed Reschedule Booking calls due to unavailability. Specify
564
- * only `slot.eventId` instead of the entire `slot` object.
565
- *
566
- * ## Notify customers
567
- *
568
- * You can specify a `participantNotification.message` for the customer. To send
569
- * the message, you must also specify `participantNotification.notifyParticipants`
570
- * as `true`.
571
- *
572
- * ## Admin overwrites
573
- *
574
- * There are small but important differences when you specify special
575
- * `flowControlSettings`:
576
- *
577
- * - `{"ignoreReschedulePolicy": true}`: The call succeeds even if the
578
- * service's `reschedulePolicy` doesn't allow it.
579
- * - `{"skipAvailabilityValidation": true}`: The call succeeds even if
580
- * the specified session, slot, or resource isn't available. If you don't
581
- * specify any resource, the call succeeds even if no resource of the relevant
582
- * type is available.
583
- * - `{"skipBusinessConfirmation": true}`: Any `PENDING` booking is
584
- * automatically confirmed even if the services requires the merchants's
585
- * manual confirmation.
586
- *
587
- * When using special `flowControlSettings`, ensure you have sufficient
588
- * permissions. If you encounter failed calls due to insufficient permissions,
589
- * consider the following options:
590
- *
591
- * - **App developers** can use a higher
592
- * [permission](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions),
593
- * such as `MANAGE BOOKINGS - ALL PERMISSIONS`.
594
- * - **Site developers** can utilize
595
- * [elevation](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/authorization/elevation).
596
- *
597
- * Granting additional permissions and using elevation permits method calls that
598
- * would typically fail due to authorization checks. Therefore, you should use
599
- * them intentionally and securely.
600
- * @param bookingId - ID of the booking to reschedule.
601
- * @param slot - New slot of the booking.
602
- * @public
603
- * @requiredField bookingId
604
- * @requiredField options.revision
605
- * @requiredField slot
606
- * @param options - An object representing the available options for rescheduling a booking.
607
- * @permissionId BOOKINGS.BOOKING_RESCHEDULE
608
- * @permissionScope Manage Bookings
609
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
610
- * @permissionScope Manage Bookings - all permissions
611
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
612
- * @applicableIdentity APP
613
- * @applicableIdentity MEMBER
614
- * @fqn com.wixpress.bookings.bookings.v2.Bookings.RescheduleBooking
615
- */
616
- async function rescheduleBooking(bookingId, slot, options) {
617
- // @ts-ignore
618
- const { httpClient, sideEffects } = arguments[3];
619
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
620
- bookingId: bookingId,
621
- slot: slot,
622
- revision: options?.revision,
623
- participantNotification: options?.participantNotification,
624
- flowControlSettings: options?.flowControlSettings,
625
- totalParticipants: options?.totalParticipants,
626
- participantsChoices: options?.participantsChoices,
627
- });
628
- const reqOpts = ambassadorWixBookingsV2Booking.rescheduleBooking(payload);
629
- sideEffects?.onSiteCall?.();
630
- try {
631
- const result = await httpClient.request(reqOpts);
632
- sideEffects?.onSuccess?.(result);
633
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
634
- }
635
- catch (err) {
636
- const transformedError = (0, transform_error_1.transformError)(err, {
637
- spreadPathsToArguments: {},
638
- explicitPathsToArguments: {
639
- bookingId: '$[0]',
640
- slot: '$[1]',
641
- revision: '$[2].revision',
642
- participantNotification: '$[2].participantNotification',
643
- flowControlSettings: '$[2].flowControlSettings',
644
- totalParticipants: '$[2].totalParticipants',
645
- participantsChoices: '$[2].participantsChoices',
646
- },
647
- singleArgumentUnchanged: false,
648
- }, ['bookingId', 'slot', 'options']);
649
- sideEffects?.onError?.(err);
650
- throw transformedError;
651
- }
652
- }
653
- exports.rescheduleBooking = rescheduleBooking;
654
- /**
655
- * Updates the booking status to `CONFIRMED` and updates the relevant session's
656
- * `participants.approvalStatus` to `APPROVED` without checking whether the relevant
657
- * slot or schedule is still available.
658
- *
659
- * ## eCommerce checkout restriction
660
- *
661
- * Call this method only when using a custom checkout page. Don't
662
- * call it when using a *Wix eCommerce checkout*
663
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)).
664
- * In such cases, Wix automatically updates the booking status based on
665
- * the `paymentStatus` of the corresponding *Wix eCommerce order*
666
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction)).
667
- *
668
- * ## When to call Confirm Or Decline Booking instead
669
- *
670
- * Confirm Booking doesn't check whether a slot or schedule is still available. For
671
- * these checks you can call *Confirm or Decline Booking*
672
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/confirm-or-decline-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/confirm-or-decline-booking)).
673
- *
674
- * ## Original status validation
675
- *
676
- * You can only confirm bookings with a status of `PENDING`, `CREATED`, or
677
- * `WAITING_LIST`.
678
- *
679
- * ## Double bookings
680
- *
681
- * Confirm Booking doesn't check whether a slot or schedule is still available.
682
- * You can specify
683
- *
684
- * ```json
685
- * {
686
- * "flowControlSettings": {
687
- * "checkAvailabilityValidation": true
688
- * },
689
- * "doubleBooked": true
690
- * }
691
- * ```
692
- * to forcefully set the booking's `doubleBooked` flag to `true`, regardless of
693
- * a potential double booking conflict. You must call with `Manage Bookings`
694
- * permissions to do so. For the default flow control settings
695
- * `{"checkAvailabilityValidation": false}`, the specified `doubleBooked` value
696
- * is ignored.
697
- *
698
- * ## Payment status
699
- *
700
- * Also updates the booking's `paymentStatus`, if you specify a new payment
701
- * status.
702
- *
703
- * ## Notify customers
704
- *
705
- * You can specify a `participantNotification.message` for the customer. To send
706
- * the message, you must also specify `participantNotification.notifyParticipants`
707
- * as `true`.
708
- * @param bookingId - ID of the booking to confirm.
709
- * @param revision - Revision number, which increments by 1 each time the booking is updated.
710
- * To prevent conflicting changes, the current revision must be passed when
711
- * updating the booking.
712
- * @public
713
- * @requiredField bookingId
714
- * @requiredField revision
715
- * @param options - An object representing the available options for canceling a booking.
716
- * @permissionId BOOKINGS.BOOKING_CONFIRM
717
- * @permissionScope Manage Bookings
718
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
719
- * @permissionScope Manage Bookings - all permissions
720
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
721
- * @applicableIdentity APP
722
- * @fqn com.wixpress.bookings.bookings.v2.Bookings.ConfirmBooking
723
- */
724
- async function confirmBooking(bookingId, revision, options) {
725
- // @ts-ignore
726
- const { httpClient, sideEffects } = arguments[3];
727
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
728
- bookingId: bookingId,
729
- revision: revision,
730
- participantNotification: options?.participantNotification,
731
- sendSmsReminder: options?.sendSmsReminder,
732
- paymentStatus: options?.paymentStatus,
733
- doubleBooked: options?.doubleBooked,
734
- flowControlSettings: options?.flowControlSettings,
735
- });
736
- const reqOpts = ambassadorWixBookingsV2Booking.bookingsConfirmBooking(payload);
737
- sideEffects?.onSiteCall?.();
738
- try {
739
- const result = await httpClient.request(reqOpts);
740
- sideEffects?.onSuccess?.(result);
741
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
742
- }
743
- catch (err) {
744
- const transformedError = (0, transform_error_1.transformError)(err, {
745
- spreadPathsToArguments: {},
746
- explicitPathsToArguments: {
747
- bookingId: '$[0]',
748
- revision: '$[1]',
749
- participantNotification: '$[2].participantNotification',
750
- sendSmsReminder: '$[2].sendSmsReminder',
751
- paymentStatus: '$[2].paymentStatus',
752
- doubleBooked: '$[2].doubleBooked',
753
- flowControlSettings: '$[2].flowControlSettings',
754
- },
755
- singleArgumentUnchanged: false,
756
- }, ['bookingId', 'revision', 'options']);
757
- sideEffects?.onError?.(err);
758
- throw transformedError;
759
- }
760
- }
761
- exports.confirmBooking = confirmBooking;
762
- /**
763
- * Updates the extended fields for a booking.
764
- *
765
- *
766
- * If you specify an extended field `namespace` that doesn't exist yet, it's
767
- * created.
768
- *
769
- * Learn more about [extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/about-backend-extensions#schema-plugin-extensions).
770
- * @public
771
- * @requiredField _id
772
- * @requiredField namespace
773
- * @requiredField options
774
- * @requiredField options.namespaceData
775
- * @param _id - ID of the booking for which to update extended fields.
776
- * @param namespace - [Namespace](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-reading-and-writing-schema-plugin-fields#namespaces) of the app for which to update extended fields.
777
- * @param options - Options for updating the booking's extended fields.
778
- * @permissionId BOOKINGS.BOOKING_UPDATE_EXTENDED_FIELDS
779
- * @permissionScope Manage Bookings
780
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
781
- * @permissionScope Manage Bookings - all permissions
782
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
783
- * @applicableIdentity APP
784
- * @fqn com.wixpress.bookings.bookings.v2.Bookings.UpdateExtendedFields
785
- */
786
- async function updateExtendedFields(_id, namespace, options) {
787
- // @ts-ignore
788
- const { httpClient, sideEffects } = arguments[3];
789
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
790
- id: _id,
791
- namespace: namespace,
792
- namespaceData: options?.namespaceData,
793
- });
794
- const reqOpts = ambassadorWixBookingsV2Booking.updateExtendedFields(payload);
795
- sideEffects?.onSiteCall?.();
796
- try {
797
- const result = await httpClient.request(reqOpts);
798
- sideEffects?.onSuccess?.(result);
799
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
800
- }
801
- catch (err) {
802
- const transformedError = (0, transform_error_1.transformError)(err, {
803
- spreadPathsToArguments: {},
804
- explicitPathsToArguments: {
805
- id: '$[0]',
806
- namespace: '$[1]',
807
- namespaceData: '$[2].namespaceData',
808
- },
809
- singleArgumentUnchanged: false,
810
- }, ['_id', 'namespace', 'options']);
811
- sideEffects?.onError?.(err);
812
- throw transformedError;
813
- }
814
- }
815
- exports.updateExtendedFields = updateExtendedFields;
816
- /**
817
- * Updates the booking status to `DECLINED` and updates the relevant session's
818
- * `participants.approvalStatus` to `DECLINED` without checking whether the relevant
819
- * slot or schedule is still available.
820
- *
821
- *
822
- * ## eCommerce checkout restriction
823
- *
824
- * Call this method only when using a custom checkout page. Don't
825
- * call it when using a *Wix eCommerce checkout*
826
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)).
827
- * In such cases, Wix automatically updates the booking status based on
828
- * the `paymentStatus` of the corresponding *Wix eCommerce order*
829
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction)).
830
- *
831
- * ## When to call Confirm Or Decline Booking instead
832
- *
833
- * The method doesn't check whether a slot or schedule is still available. For
834
- * these checks you can call *Confirm or Decline Booking*
835
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/confirm-or-decline-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/confirm-or-decline-booking)).
836
- *
837
- * ## Original status validation
838
- *
839
- * You can only decline bookings with a `status` of `PENDING`, `CREATED`, or
840
- * `WAITING_LIST`.
841
- *
842
- * ## Payment status
843
- *
844
- * Also updates the booking's `paymentStatus`, if you specify a new payment
845
- * status.
846
- *
847
- * ## Notify customers
848
- *
849
- * You can specify a `participantNotification.message` for the customer. To send
850
- * the message, you must also specify `participantNotification.notifyParticipants`
851
- * as `true`.
852
- * @param bookingId - ID of the booking to decline.
853
- * @param revision - Revision number, which increments by 1 each time the booking is updated.
854
- *
855
- * To prevent conflicting changes, the current revision must be specified when
856
- * declining the booking.
857
- * @public
858
- * @requiredField bookingId
859
- * @requiredField revision
860
- * @param options - An object representing the available options for declining a booking.
861
- * @permissionId BOOKINGS.BOOKING_DECLINE
862
- * @permissionScope Manage Bookings
863
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
864
- * @permissionScope Manage Bookings - all permissions
865
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
866
- * @applicableIdentity APP
867
- * @fqn com.wixpress.bookings.bookings.v2.Bookings.DeclineBooking
868
- */
869
- async function declineBooking(bookingId, revision, options) {
870
- // @ts-ignore
871
- const { httpClient, sideEffects } = arguments[3];
872
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
873
- bookingId: bookingId,
874
- revision: revision,
875
- participantNotification: options?.participantNotification,
876
- paymentStatus: options?.paymentStatus,
877
- doubleBooked: options?.doubleBooked,
878
- flowControlSettings: options?.flowControlSettings,
879
- });
880
- const reqOpts = ambassadorWixBookingsV2Booking.bookingsDeclineBooking(payload);
881
- sideEffects?.onSiteCall?.();
882
- try {
883
- const result = await httpClient.request(reqOpts);
884
- sideEffects?.onSuccess?.(result);
885
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
886
- }
887
- catch (err) {
888
- const transformedError = (0, transform_error_1.transformError)(err, {
889
- spreadPathsToArguments: {},
890
- explicitPathsToArguments: {
891
- bookingId: '$[0]',
892
- revision: '$[1]',
893
- participantNotification: '$[2].participantNotification',
894
- paymentStatus: '$[2].paymentStatus',
895
- doubleBooked: '$[2].doubleBooked',
896
- flowControlSettings: '$[2].flowControlSettings',
897
- },
898
- singleArgumentUnchanged: false,
899
- }, ['bookingId', 'revision', 'options']);
900
- sideEffects?.onError?.(err);
901
- throw transformedError;
902
- }
903
- }
904
- exports.declineBooking = declineBooking;
905
- /**
906
- * Updates the booking status to `CANCELED`.
907
- *
908
- *
909
- * ## Appointments
910
- *
911
- * For appointments, the corresponding event is removed from the Bookings
912
- * calendar.
913
- *
914
- * ## Class and course bookings
915
- *
916
- * For class or course bookings, the relevant participants are removed
917
- * from the class session or the course. However, the class session or course
918
- * remain on the business calendar.
919
- *
920
- * ## Notify customers
921
- *
922
- * You can specify a `participantNotification.message` for the customer. To send
923
- * the message, you must also specify `participantNotification.notifyParticipants`
924
- * as `true`.
925
- *
926
- * ## Admin overwrites
927
- *
928
- * There are small but important differences when you specify special
929
- * `flowControlSettings`:
930
- *
931
- * - `{"ignoreCancellationPolicy": true}`: The call succeeds even if the
932
- * service's `cancellationPolicy` doesn't allow it.
933
- * - `{"withRefund": true}`: The customer is refunded even if the service's
934
- * `refundPolicy` doesn't allow it.
935
- * - `{"waiveCancellationFee": true}`: The customer doesn't have to pay
936
- * the cancellation fee, even if the service's `cancellationPolicy` requires it.
937
- *
938
- * When using special `flowControlSettings`, ensure you have sufficient
939
- * permissions. If you encounter failed calls due to insufficient permissions,
940
- * consider the following options:
941
- *
942
- * - **App developers** can use a higher
943
- * [permission](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions),
944
- * such as `MANAGE BOOKINGS - ALL PERMISSIONS`.
945
- * - **Site developers** can utilize
946
- * [elevation](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/authorization/elevation).
947
- *
948
- * Granting additional permissions and using elevation permits method calls that
949
- * would typically fail due to authorization checks. Therefore, you should use
950
- * them intentionally and securely.
951
- * @param bookingId - ID of the booking to cancel.
952
- * @public
953
- * @requiredField bookingId
954
- * @requiredField options.revision
955
- * @param options - An object representing the available options for canceling a booking.
956
- * @permissionId BOOKINGS.BOOKING_CANCEL
957
- * @permissionScope Manage Bookings
958
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
959
- * @permissionScope Manage Bookings - all permissions
960
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
961
- * @applicableIdentity APP
962
- * @applicableIdentity MEMBER
963
- * @fqn com.wixpress.bookings.bookings.v2.Bookings.CancelBooking
964
- */
965
- async function cancelBooking(bookingId, options) {
966
- // @ts-ignore
967
- const { httpClient, sideEffects } = arguments[2];
968
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
969
- bookingId: bookingId,
970
- participantNotification: options?.participantNotification,
971
- flowControlSettings: options?.flowControlSettings,
972
- revision: options?.revision,
973
- });
974
- const reqOpts = ambassadorWixBookingsV2Booking.bookingsCancelBooking(payload);
975
- sideEffects?.onSiteCall?.();
976
- try {
977
- const result = await httpClient.request(reqOpts);
978
- sideEffects?.onSuccess?.(result);
979
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
980
- }
981
- catch (err) {
982
- const transformedError = (0, transform_error_1.transformError)(err, {
983
- spreadPathsToArguments: {},
984
- explicitPathsToArguments: {
985
- bookingId: '$[0]',
986
- participantNotification: '$[1].participantNotification',
987
- flowControlSettings: '$[1].flowControlSettings',
988
- revision: '$[1].revision',
989
- },
990
- singleArgumentUnchanged: false,
991
- }, ['bookingId', 'options']);
992
- sideEffects?.onError?.(err);
993
- throw transformedError;
994
- }
995
- }
996
- exports.cancelBooking = cancelBooking;
997
- /**
998
- * Updates the number of participants for a class or course booking and changes
999
- * the `totalNumberOfParticipants` for the relevant sessions.
1000
- *
1001
- *
1002
- * ## Appointment limitation
1003
- *
1004
- * You can't update the number of participants for appointment bookings.
1005
- *
1006
- * ## Participant information
1007
- *
1008
- * You must specify either `participantsChoices` or `totalParticipants`.
1009
- * The call fails if the specified `participantsChoices` aren't among the
1010
- * supported *service options and variants*
1011
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction)).
1012
- * @param bookingId - ID of the booking to update the number of participants for.
1013
- * @public
1014
- * @requiredField bookingId
1015
- * @requiredField options.revision
1016
- * @permissionId BOOKINGS.NUMBER_OF_PARTICIPANTS_UPDATE
1017
- * @permissionScope Manage Bookings
1018
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1019
- * @permissionScope Manage Bookings - all permissions
1020
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1021
- * @applicableIdentity APP
1022
- * @fqn com.wixpress.bookings.bookings.v2.Bookings.UpdateNumberOfParticipants
1023
- */
1024
- async function updateNumberOfParticipants(bookingId, options) {
1025
- // @ts-ignore
1026
- const { httpClient, sideEffects } = arguments[2];
1027
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1028
- bookingId: bookingId,
1029
- revision: options?.revision,
1030
- totalParticipants: options?.totalParticipants,
1031
- participantsChoices: options?.participantsChoices,
1032
- });
1033
- const reqOpts = ambassadorWixBookingsV2Booking.bookingsUpdateNumberOfParticipants(payload);
1034
- sideEffects?.onSiteCall?.();
1035
- try {
1036
- const result = await httpClient.request(reqOpts);
1037
- sideEffects?.onSuccess?.(result);
1038
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1039
- }
1040
- catch (err) {
1041
- const transformedError = (0, transform_error_1.transformError)(err, {
1042
- spreadPathsToArguments: {},
1043
- explicitPathsToArguments: {
1044
- bookingId: '$[0]',
1045
- revision: '$[1].revision',
1046
- totalParticipants: '$[1].totalParticipants',
1047
- participantsChoices: '$[1].participantsChoices',
1048
- },
1049
- singleArgumentUnchanged: false,
1050
- }, ['bookingId', 'options']);
1051
- sideEffects?.onError?.(err);
1052
- throw transformedError;
1053
- }
1054
- }
1055
- exports.updateNumberOfParticipants = updateNumberOfParticipants;
1056
- /**
1057
- * Creates a multi-service booking.
1058
- *
1059
- *
1060
- * See Create Booking for more information.
1061
- * @param bookings - Single-service bookings to combine in a multi-service booking.
1062
- * @public
1063
- * @documentationMaturity preview
1064
- * @requiredField bookings
1065
- * @requiredField bookings.additionalFields._id
1066
- * @requiredField bookings.bookedEntity
1067
- * @requiredField bookings.bookedEntity.item
1068
- * @requiredField bookings.bookedEntity.item.slot
1069
- * @requiredField bookings.bookedEntity.item.slot.endDate
1070
- * @requiredField bookings.bookedEntity.item.slot.location.locationType
1071
- * @requiredField bookings.bookedEntity.item.slot.scheduleId
1072
- * @requiredField bookings.bookedEntity.item.slot.startDate
1073
- * @permissionId MULTI_SERVICE_BOOKINGS.MULTI_SERVICE_BOOKING_CREATE
1074
- * @permissionScope Manage Bookings
1075
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1076
- * @permissionScope Manage Bookings - all permissions
1077
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1078
- * @applicableIdentity APP
1079
- * @applicableIdentity VISITOR
1080
- * @fqn com.wixpress.bookings.bookings.v2.MultiServiceBookings.CreateMultiServiceBooking
1081
- */
1082
- async function createMultiServiceBooking(bookings, options) {
1083
- // @ts-ignore
1084
- const { httpClient, sideEffects } = arguments[2];
1085
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1086
- bookings: bookings,
1087
- participantNotification: options?.participantNotification,
1088
- sendSmsReminder: options?.sendSmsReminder,
1089
- flowControlSettings: options?.flowControlSettings,
1090
- returnFullEntity: options?.returnFullEntity,
1091
- multiServiceBookingType: options?.multiServiceBookingType,
1092
- });
1093
- const reqOpts = ambassadorWixBookingsV2Booking.createMultiServiceBooking(payload);
1094
- sideEffects?.onSiteCall?.();
1095
- try {
1096
- const result = await httpClient.request(reqOpts);
1097
- sideEffects?.onSuccess?.(result);
1098
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1099
- }
1100
- catch (err) {
1101
- const transformedError = (0, transform_error_1.transformError)(err, {
1102
- spreadPathsToArguments: {},
1103
- explicitPathsToArguments: {
1104
- bookings: '$[0]',
1105
- participantNotification: '$[1].participantNotification',
1106
- sendSmsReminder: '$[1].sendSmsReminder',
1107
- flowControlSettings: '$[1].flowControlSettings',
1108
- returnFullEntity: '$[1].returnFullEntity',
1109
- multiServiceBookingType: '$[1].multiServiceBookingType',
1110
- },
1111
- singleArgumentUnchanged: false,
1112
- }, ['bookings', 'options']);
1113
- sideEffects?.onError?.(err);
1114
- throw transformedError;
1115
- }
1116
- }
1117
- exports.createMultiServiceBooking = createMultiServiceBooking;
1118
- /**
1119
- * Reschedules a multi-service booking.
1120
- *
1121
- *
1122
- * The call fails if at least 1 individual booking can't be rescheduled due
1123
- * the service being unavailable or a rescheduling policy violation.
1124
- *
1125
- *
1126
- * See Reschedule Booking for more information.
1127
- * @param multiServiceBookingId - ID of the multi service booking to reschedule.
1128
- * @param rescheduleBookingsInfo - Information about the single-service bookings to reschedule.
1129
- * @public
1130
- * @documentationMaturity preview
1131
- * @requiredField multiServiceBookingId
1132
- * @requiredField rescheduleBookingsInfo
1133
- * @requiredField rescheduleBookingsInfo.bookingId
1134
- * @requiredField rescheduleBookingsInfo.revision
1135
- * @requiredField rescheduleBookingsInfo.slot
1136
- * @permissionId MULTI_SERVICE_BOOKINGS.MULTI_SERVICE_BOOKING_RESCHEDULE
1137
- * @permissionScope Manage Bookings
1138
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1139
- * @permissionScope Manage Bookings - all permissions
1140
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1141
- * @applicableIdentity APP
1142
- * @applicableIdentity MEMBER
1143
- * @fqn com.wixpress.bookings.bookings.v2.MultiServiceBookings.RescheduleMultiServiceBooking
1144
- */
1145
- async function rescheduleMultiServiceBooking(multiServiceBookingId, rescheduleBookingsInfo, options) {
1146
- // @ts-ignore
1147
- const { httpClient, sideEffects } = arguments[3];
1148
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1149
- multiServiceBookingId: multiServiceBookingId,
1150
- rescheduleBookingsInfo: rescheduleBookingsInfo,
1151
- participantNotification: options?.participantNotification,
1152
- flowControlSettings: options?.flowControlSettings,
1153
- returnFullEntity: options?.returnFullEntity,
1154
- });
1155
- const reqOpts = ambassadorWixBookingsV2Booking.rescheduleMultiServiceBooking(payload);
1156
- sideEffects?.onSiteCall?.();
1157
- try {
1158
- const result = await httpClient.request(reqOpts);
1159
- sideEffects?.onSuccess?.(result);
1160
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1161
- }
1162
- catch (err) {
1163
- const transformedError = (0, transform_error_1.transformError)(err, {
1164
- spreadPathsToArguments: {},
1165
- explicitPathsToArguments: {
1166
- multiServiceBookingId: '$[0]',
1167
- rescheduleBookingsInfo: '$[1]',
1168
- participantNotification: '$[2].participantNotification',
1169
- flowControlSettings: '$[2].flowControlSettings',
1170
- returnFullEntity: '$[2].returnFullEntity',
1171
- },
1172
- singleArgumentUnchanged: false,
1173
- }, ['multiServiceBookingId', 'rescheduleBookingsInfo', 'options']);
1174
- sideEffects?.onError?.(err);
1175
- throw transformedError;
1176
- }
1177
- }
1178
- exports.rescheduleMultiServiceBooking = rescheduleMultiServiceBooking;
1179
- /**
1180
- * Retrieves a multi-service booking's availability.
1181
- *
1182
- *
1183
- * Use List Multi Service Availability Time Slots to check availability for a
1184
- * `SEQUENTIAL_BOOKINGS` multi-service booking.
1185
- * @param multiServiceBookingId - ID of the multi-service booking to retrieve.
1186
- * @public
1187
- * @documentationMaturity preview
1188
- * @requiredField multiServiceBookingId
1189
- * @permissionId MULTI_SERVICE_BOOKINGS.MULTI_SERVICE_BOOKING_GET_AVAILABILITY
1190
- * @permissionScope Manage Stores
1191
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1192
- * @permissionScope Read Bookings - Public Data
1193
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
1194
- * @permissionScope Manage Bookings Services and Settings
1195
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1196
- * @permissionScope Manage Bookings
1197
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1198
- * @permissionScope Read Bookings - Including Participants
1199
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1200
- * @permissionScope Read Bookings - all read permissions
1201
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
1202
- * @permissionScope Read Bookings Calendar Availability
1203
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-CALENDAR
1204
- * @permissionScope Manage Bookings - all permissions
1205
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1206
- * @applicableIdentity APP
1207
- * @applicableIdentity VISITOR
1208
- * @fqn com.wixpress.bookings.bookings.v2.MultiServiceBookings.GetMultiServiceBookingAvailability
1209
- */
1210
- async function getMultiServiceBookingAvailability(multiServiceBookingId) {
1211
- // @ts-ignore
1212
- const { httpClient, sideEffects } = arguments[1];
1213
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1214
- multiServiceBookingId: multiServiceBookingId,
1215
- });
1216
- const reqOpts = ambassadorWixBookingsV2Booking.getMultiServiceBookingAvailability(payload);
1217
- sideEffects?.onSiteCall?.();
1218
- try {
1219
- const result = await httpClient.request(reqOpts);
1220
- sideEffects?.onSuccess?.(result);
1221
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1222
- }
1223
- catch (err) {
1224
- const transformedError = (0, transform_error_1.transformError)(err, {
1225
- spreadPathsToArguments: {},
1226
- explicitPathsToArguments: { multiServiceBookingId: '$[0]' },
1227
- singleArgumentUnchanged: false,
1228
- }, ['multiServiceBookingId']);
1229
- sideEffects?.onError?.(err);
1230
- throw transformedError;
1231
- }
1232
- }
1233
- exports.getMultiServiceBookingAvailability = getMultiServiceBookingAvailability;
1234
- /**
1235
- * Cancels a multi-service booking and thus all its individual bookings.
1236
- * @param multiServiceBookingId - ID of the multi-service booking to cancel.
1237
- * @public
1238
- * @documentationMaturity preview
1239
- * @requiredField multiServiceBookingId
1240
- * @permissionId MULTI_SERVICE_BOOKINGS.MULTI_SERVICE_BOOKING_CANCEL
1241
- * @permissionScope Manage Bookings
1242
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1243
- * @permissionScope Manage Bookings - all permissions
1244
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1245
- * @applicableIdentity APP
1246
- * @applicableIdentity MEMBER
1247
- * @fqn com.wixpress.bookings.bookings.v2.MultiServiceBookings.CancelMultiServiceBooking
1248
- */
1249
- async function cancelMultiServiceBooking(multiServiceBookingId, options) {
1250
- // @ts-ignore
1251
- const { httpClient, sideEffects } = arguments[2];
1252
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1253
- multiServiceBookingId: multiServiceBookingId,
1254
- participantNotification: options?.participantNotification,
1255
- flowControlSettings: options?.flowControlSettings,
1256
- returnFullEntity: options?.returnFullEntity,
1257
- });
1258
- const reqOpts = ambassadorWixBookingsV2Booking.cancelMultiServiceBooking(payload);
1259
- sideEffects?.onSiteCall?.();
1260
- try {
1261
- const result = await httpClient.request(reqOpts);
1262
- sideEffects?.onSuccess?.(result);
1263
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1264
- }
1265
- catch (err) {
1266
- const transformedError = (0, transform_error_1.transformError)(err, {
1267
- spreadPathsToArguments: {},
1268
- explicitPathsToArguments: {
1269
- multiServiceBookingId: '$[0]',
1270
- participantNotification: '$[1].participantNotification',
1271
- flowControlSettings: '$[1].flowControlSettings',
1272
- returnFullEntity: '$[1].returnFullEntity',
1273
- },
1274
- singleArgumentUnchanged: false,
1275
- }, ['multiServiceBookingId', 'options']);
1276
- sideEffects?.onError?.(err);
1277
- throw transformedError;
1278
- }
1279
- }
1280
- exports.cancelMultiServiceBooking = cancelMultiServiceBooking;
1281
- /**
1282
- * Updates the status of a multi-service booking to `PENDING`.
1283
- *
1284
- *
1285
- * Also updates the status of each of individual bookings within the multi-service booking to `PENDING`.
1286
- *
1287
- * The call fails if the status for at least a single individual booking can't be updated.
1288
- *
1289
- * See Mark Booking as Pending for more information.
1290
- * @param multiServiceBookingId - ID of the multi-service booking to mark as `PENDING`.
1291
- * @public
1292
- * @documentationMaturity preview
1293
- * @requiredField multiServiceBookingId
1294
- * @permissionId MULTI_SERVICE_BOOKINGS.MULTI_SERVICE_BOOKING_MARK_AS_PENDING
1295
- * @permissionScope Manage Bookings
1296
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1297
- * @permissionScope Manage Bookings - all permissions
1298
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1299
- * @applicableIdentity APP
1300
- * @fqn com.wixpress.bookings.bookings.v2.MultiServiceBookings.MarkMultiServiceBookingAsPending
1301
- */
1302
- async function markMultiServiceBookingAsPending(multiServiceBookingId, options) {
1303
- // @ts-ignore
1304
- const { httpClient, sideEffects } = arguments[2];
1305
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1306
- multiServiceBookingId: multiServiceBookingId,
1307
- markAsPendingBookingsInfo: options?.markAsPendingBookingsInfo,
1308
- participantNotification: options?.participantNotification,
1309
- sendSmsReminder: options?.sendSmsReminder,
1310
- doubleBooked: options?.doubleBooked,
1311
- returnFullEntity: options?.returnFullEntity,
1312
- flowControlSettings: options?.flowControlSettings,
1313
- });
1314
- const reqOpts = ambassadorWixBookingsV2Booking.markMultiServiceBookingAsPending(payload);
1315
- sideEffects?.onSiteCall?.();
1316
- try {
1317
- const result = await httpClient.request(reqOpts);
1318
- sideEffects?.onSuccess?.(result);
1319
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1320
- }
1321
- catch (err) {
1322
- const transformedError = (0, transform_error_1.transformError)(err, {
1323
- spreadPathsToArguments: {},
1324
- explicitPathsToArguments: {
1325
- multiServiceBookingId: '$[0]',
1326
- markAsPendingBookingsInfo: '$[1].markAsPendingBookingsInfo',
1327
- participantNotification: '$[1].participantNotification',
1328
- sendSmsReminder: '$[1].sendSmsReminder',
1329
- doubleBooked: '$[1].doubleBooked',
1330
- returnFullEntity: '$[1].returnFullEntity',
1331
- flowControlSettings: '$[1].flowControlSettings',
1332
- },
1333
- singleArgumentUnchanged: false,
1334
- }, ['multiServiceBookingId', 'options']);
1335
- sideEffects?.onError?.(err);
1336
- throw transformedError;
1337
- }
1338
- }
1339
- exports.markMultiServiceBookingAsPending = markMultiServiceBookingAsPending;
1340
- /**
1341
- * Updates the status of a multi-service booking to `CONFIRMED`.
1342
- *
1343
- *
1344
- * Also updates the status of each of individual bookings within the multi-service booking to `CONFIRMED`.
1345
- *
1346
- * The call fails if the status for at least a single individual booking can't be updated.
1347
- *
1348
- * See Confirm Booking for more information.
1349
- * @param multiServiceBookingId - ID of the multi-service booking to confirm its related bookings.
1350
- * @public
1351
- * @documentationMaturity preview
1352
- * @requiredField multiServiceBookingId
1353
- * @permissionId MULTI_SERVICE_BOOKINGS.MULTI_SERVICE_BOOKING_CONFIRM
1354
- * @permissionScope Manage Bookings
1355
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1356
- * @permissionScope Manage Bookings - all permissions
1357
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1358
- * @applicableIdentity APP
1359
- * @fqn com.wixpress.bookings.bookings.v2.MultiServiceBookings.ConfirmMultiServiceBooking
1360
- */
1361
- async function confirmMultiServiceBooking(multiServiceBookingId, options) {
1362
- // @ts-ignore
1363
- const { httpClient, sideEffects } = arguments[2];
1364
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1365
- multiServiceBookingId: multiServiceBookingId,
1366
- confirmBookingsInfo: options?.confirmBookingsInfo,
1367
- participantNotification: options?.participantNotification,
1368
- sendSmsReminder: options?.sendSmsReminder,
1369
- doubleBooked: options?.doubleBooked,
1370
- returnFullEntity: options?.returnFullEntity,
1371
- flowControlSettings: options?.flowControlSettings,
1372
- });
1373
- const reqOpts = ambassadorWixBookingsV2Booking.confirmMultiServiceBooking(payload);
1374
- sideEffects?.onSiteCall?.();
1375
- try {
1376
- const result = await httpClient.request(reqOpts);
1377
- sideEffects?.onSuccess?.(result);
1378
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1379
- }
1380
- catch (err) {
1381
- const transformedError = (0, transform_error_1.transformError)(err, {
1382
- spreadPathsToArguments: {},
1383
- explicitPathsToArguments: {
1384
- multiServiceBookingId: '$[0]',
1385
- confirmBookingsInfo: '$[1].confirmBookingsInfo',
1386
- participantNotification: '$[1].participantNotification',
1387
- sendSmsReminder: '$[1].sendSmsReminder',
1388
- doubleBooked: '$[1].doubleBooked',
1389
- returnFullEntity: '$[1].returnFullEntity',
1390
- flowControlSettings: '$[1].flowControlSettings',
1391
- },
1392
- singleArgumentUnchanged: false,
1393
- }, ['multiServiceBookingId', 'options']);
1394
- sideEffects?.onError?.(err);
1395
- throw transformedError;
1396
- }
1397
- }
1398
- exports.confirmMultiServiceBooking = confirmMultiServiceBooking;
1399
- /**
1400
- * Updates the status of a multi-service booking to `DECLINED`.
1401
- *
1402
- *
1403
- * Also updates the status of each of individual bookings within the multi-service booking to `DECLINED`.
1404
- *
1405
- * The call fails if the status for at least a single individual booking can't be updated.
1406
- *
1407
- * See Decline Booking for more information.
1408
- * @param multiServiceBookingId - ID of the multi service booking to decline.
1409
- * @public
1410
- * @documentationMaturity preview
1411
- * @requiredField multiServiceBookingId
1412
- * @permissionId MULTI_SERVICE_BOOKINGS.MULTI_SERVICE_BOOKING_DECLINE
1413
- * @permissionScope Manage Bookings
1414
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1415
- * @permissionScope Manage Bookings - all permissions
1416
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1417
- * @applicableIdentity APP
1418
- * @fqn com.wixpress.bookings.bookings.v2.MultiServiceBookings.DeclineMultiServiceBooking
1419
- */
1420
- async function declineMultiServiceBooking(multiServiceBookingId, options) {
1421
- // @ts-ignore
1422
- const { httpClient, sideEffects } = arguments[2];
1423
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1424
- multiServiceBookingId: multiServiceBookingId,
1425
- declineBookingsInfo: options?.declineBookingsInfo,
1426
- participantNotification: options?.participantNotification,
1427
- doubleBooked: options?.doubleBooked,
1428
- returnFullEntity: options?.returnFullEntity,
1429
- flowControlSettings: options?.flowControlSettings,
1430
- });
1431
- const reqOpts = ambassadorWixBookingsV2Booking.declineMultiServiceBooking(payload);
1432
- sideEffects?.onSiteCall?.();
1433
- try {
1434
- const result = await httpClient.request(reqOpts);
1435
- sideEffects?.onSuccess?.(result);
1436
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1437
- }
1438
- catch (err) {
1439
- const transformedError = (0, transform_error_1.transformError)(err, {
1440
- spreadPathsToArguments: {},
1441
- explicitPathsToArguments: {
1442
- multiServiceBookingId: '$[0]',
1443
- declineBookingsInfo: '$[1].declineBookingsInfo',
1444
- participantNotification: '$[1].participantNotification',
1445
- doubleBooked: '$[1].doubleBooked',
1446
- returnFullEntity: '$[1].returnFullEntity',
1447
- flowControlSettings: '$[1].flowControlSettings',
1448
- },
1449
- singleArgumentUnchanged: false,
1450
- }, ['multiServiceBookingId', 'options']);
1451
- sideEffects?.onError?.(err);
1452
- throw transformedError;
1453
- }
1454
- }
1455
- exports.declineMultiServiceBooking = declineMultiServiceBooking;
1456
- /**
1457
- * Retrieves the allowed actions for a list of multi-service bookings.
1458
- * @param multiServiceBookingIds - IDs of the multi-service bookings to retrieve allowed actions for.
1459
- * @public
1460
- * @documentationMaturity preview
1461
- * @requiredField multiServiceBookingIds
1462
- * @permissionId MULTI_SERVICE_BOOKINGS.MULTI_SERVICE_BOOKING_GET_ALLOWED_ACTIONS
1463
- * @permissionScope Read Bookings - Public Data
1464
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
1465
- * @permissionScope Manage Bookings
1466
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1467
- * @permissionScope Read Bookings - Including Participants
1468
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1469
- * @permissionScope Read Bookings - all read permissions
1470
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
1471
- * @permissionScope Manage Bookings - all permissions
1472
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1473
- * @applicableIdentity APP
1474
- * @applicableIdentity VISITOR
1475
- * @fqn com.wixpress.bookings.bookings.v2.MultiServiceBookings.BulkGetMultiServiceBookingAllowedActions
1476
- */
1477
- async function bulkGetMultiServiceBookingAllowedActions(multiServiceBookingIds) {
1478
- // @ts-ignore
1479
- const { httpClient, sideEffects } = arguments[1];
1480
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1481
- multiServiceBookingIds: multiServiceBookingIds,
1482
- });
1483
- const reqOpts = ambassadorWixBookingsV2Booking.bulkGetMultiServiceBookingAllowedActions(payload);
1484
- sideEffects?.onSiteCall?.();
1485
- try {
1486
- const result = await httpClient.request(reqOpts);
1487
- sideEffects?.onSuccess?.(result);
1488
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1489
- }
1490
- catch (err) {
1491
- const transformedError = (0, transform_error_1.transformError)(err, {
1492
- spreadPathsToArguments: {},
1493
- explicitPathsToArguments: { multiServiceBookingIds: '$[0]' },
1494
- singleArgumentUnchanged: false,
1495
- }, ['multiServiceBookingIds']);
1496
- sideEffects?.onError?.(err);
1497
- throw transformedError;
1498
- }
1499
- }
1500
- exports.bulkGetMultiServiceBookingAllowedActions = bulkGetMultiServiceBookingAllowedActions;
1501
- /**
1502
- * Retrieves all single-service bookings belonging to a multi-service booking.
1503
- *
1504
- *
1505
- * If you call as an [identity](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities)
1506
- * who has permissions to read only part of the bookings,
1507
- * only the permitted bookings are retrieved. The returned total number of
1508
- * bookings includes also the bookings for which you don't have permissions.
1509
- * @param multiServiceBookingId - ID of the multi-service booking.
1510
- * @public
1511
- * @documentationMaturity preview
1512
- * @requiredField multiServiceBookingId
1513
- * @permissionId MULTI_SERVICE_BOOKINGS.MULTI_SERVICE_BOOKING_READ
1514
- * @permissionScope Read Bookings - Public Data
1515
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
1516
- * @permissionScope Manage Bookings
1517
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1518
- * @permissionScope Read Bookings - Including Participants
1519
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1520
- * @permissionScope Read Bookings - all read permissions
1521
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
1522
- * @permissionScope Read Bookings Calendar Availability
1523
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-CALENDAR
1524
- * @permissionScope Manage Bookings - all permissions
1525
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1526
- * @applicableIdentity APP
1527
- * @returns Retrieved multi-service booking.
1528
- * @fqn com.wixpress.bookings.bookings.v2.MultiServiceBookings.GetMultiServiceBooking
1529
- */
1530
- async function getMultiServiceBooking(multiServiceBookingId) {
1531
- // @ts-ignore
1532
- const { httpClient, sideEffects } = arguments[1];
1533
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1534
- multiServiceBookingId: multiServiceBookingId,
1535
- });
1536
- const reqOpts = ambassadorWixBookingsV2Booking.getMultiServiceBooking(payload);
1537
- sideEffects?.onSiteCall?.();
1538
- try {
1539
- const result = await httpClient.request(reqOpts);
1540
- sideEffects?.onSuccess?.(result);
1541
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data)
1542
- ?.multiServiceBooking;
1543
- }
1544
- catch (err) {
1545
- const transformedError = (0, transform_error_1.transformError)(err, {
1546
- spreadPathsToArguments: {},
1547
- explicitPathsToArguments: { multiServiceBookingId: '$[0]' },
1548
- singleArgumentUnchanged: false,
1549
- }, ['multiServiceBookingId']);
1550
- sideEffects?.onError?.(err);
1551
- throw transformedError;
1552
- }
1553
- }
1554
- exports.getMultiServiceBooking = getMultiServiceBooking;
1555
- /**
1556
- * Adds a list of single-service bookings to a multi-service booking.
1557
- *
1558
- *
1559
- * The call fails, if at least 1 of the specified booking is already part of a
1560
- * multi-service booking.
1561
- * @param multiServiceBookingId - ID of the multi-service booking.
1562
- * @public
1563
- * @documentationMaturity preview
1564
- * @requiredField multiServiceBookingId
1565
- * @requiredField options.bookings
1566
- * @requiredField options.bookings.bookingId
1567
- * @requiredField options.bookings.revision
1568
- * @permissionId MULTI_SERVICE_BOOKINGS.MULTI_SERVICE_BOOKING_ADD_BOOKINGS
1569
- * @fqn com.wixpress.bookings.bookings.v2.MultiServiceBookings.AddBookingsToMultiServiceBooking
1570
- */
1571
- async function addBookingsToMultiServiceBooking(multiServiceBookingId, options) {
1572
- // @ts-ignore
1573
- const { httpClient, sideEffects } = arguments[2];
1574
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1575
- multiServiceBookingId: multiServiceBookingId,
1576
- bookings: options?.bookings,
1577
- returnFullEntity: options?.returnFullEntity,
1578
- });
1579
- const reqOpts = ambassadorWixBookingsV2Booking.addBookingsToMultiServiceBooking(payload);
1580
- sideEffects?.onSiteCall?.();
1581
- try {
1582
- const result = await httpClient.request(reqOpts);
1583
- sideEffects?.onSuccess?.(result);
1584
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1585
- }
1586
- catch (err) {
1587
- const transformedError = (0, transform_error_1.transformError)(err, {
1588
- spreadPathsToArguments: {},
1589
- explicitPathsToArguments: {
1590
- multiServiceBookingId: '$[0]',
1591
- bookings: '$[1].bookings',
1592
- returnFullEntity: '$[1].returnFullEntity',
1593
- },
1594
- singleArgumentUnchanged: false,
1595
- }, ['multiServiceBookingId', 'options']);
1596
- sideEffects?.onError?.(err);
1597
- throw transformedError;
1598
- }
1599
- }
1600
- exports.addBookingsToMultiServiceBooking = addBookingsToMultiServiceBooking;
1601
- /**
1602
- * Removes single-service bookings from a multi-service booking and returns the
1603
- * removed bookings.
1604
- *
1605
- *
1606
- * If you specify an empty `bookings` array, all single-service bookings for which
1607
- * the call's [identity](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities)
1608
- * has read permissions are removed from the multi-service booking.
1609
- *
1610
- * If the call would create a multi-service booking including only 1 single-service
1611
- * booking, the multi-service booking is also deleted.
1612
- * @param multiServiceBookingId - ID of the multi-service booking.
1613
- * @public
1614
- * @documentationMaturity preview
1615
- * @requiredField multiServiceBookingId
1616
- * @permissionId MULTI_SERVICE_BOOKINGS.MULTI_SERVICE_BOOKING_REMOVE_BOOKINGS
1617
- * @permissionScope Manage Bookings
1618
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1619
- * @permissionScope Manage Bookings - all permissions
1620
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1621
- * @applicableIdentity APP
1622
- * @fqn com.wixpress.bookings.bookings.v2.MultiServiceBookings.RemoveBookingsFromMultiServiceBooking
1623
- */
1624
- async function removeBookingsFromMultiServiceBooking(multiServiceBookingId, options) {
1625
- // @ts-ignore
1626
- const { httpClient, sideEffects } = arguments[2];
1627
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1628
- multiServiceBookingId: multiServiceBookingId,
1629
- bookings: options?.bookings,
1630
- returnFullEntity: options?.returnFullEntity,
1631
- });
1632
- const reqOpts = ambassadorWixBookingsV2Booking.removeBookingsFromMultiServiceBooking(payload);
1633
- sideEffects?.onSiteCall?.();
1634
- try {
1635
- const result = await httpClient.request(reqOpts);
1636
- sideEffects?.onSuccess?.(result);
1637
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1638
- }
1639
- catch (err) {
1640
- const transformedError = (0, transform_error_1.transformError)(err, {
1641
- spreadPathsToArguments: {},
1642
- explicitPathsToArguments: {
1643
- multiServiceBookingId: '$[0]',
1644
- bookings: '$[1].bookings',
1645
- returnFullEntity: '$[1].returnFullEntity',
1646
- },
1647
- singleArgumentUnchanged: false,
1648
- }, ['multiServiceBookingId', 'options']);
1649
- sideEffects?.onError?.(err);
1650
- throw transformedError;
1651
- }
1652
- }
1653
- exports.removeBookingsFromMultiServiceBooking = removeBookingsFromMultiServiceBooking;
1654
- //# sourceMappingURL=bookings-v2-booking-bookings.universal.js.map