@wix/auto_sdk_bookings_bookings 1.0.15 → 1.0.17

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