@wix/auto_sdk_bookings_services 1.0.0

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 (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/bookings-services-v2-service-services.context.d.ts +41 -0
  11. package/build/cjs/src/bookings-services-v2-service-services.context.js +85 -0
  12. package/build/cjs/src/bookings-services-v2-service-services.context.js.map +1 -0
  13. package/build/cjs/src/bookings-services-v2-service-services.http.d.ts +482 -0
  14. package/build/cjs/src/bookings-services-v2-service-services.http.js +1790 -0
  15. package/build/cjs/src/bookings-services-v2-service-services.http.js.map +1 -0
  16. package/build/cjs/src/bookings-services-v2-service-services.meta.d.ts +47 -0
  17. package/build/cjs/src/bookings-services-v2-service-services.meta.js +427 -0
  18. package/build/cjs/src/bookings-services-v2-service-services.meta.js.map +1 -0
  19. package/build/cjs/src/bookings-services-v2-service-services.public.d.ts +584 -0
  20. package/build/cjs/src/bookings-services-v2-service-services.public.js +307 -0
  21. package/build/cjs/src/bookings-services-v2-service-services.public.js.map +1 -0
  22. package/build/cjs/src/bookings-services-v2-service-services.types.d.ts +4056 -0
  23. package/build/cjs/src/bookings-services-v2-service-services.types.js +386 -0
  24. package/build/cjs/src/bookings-services-v2-service-services.types.js.map +1 -0
  25. package/build/cjs/src/bookings-services-v2-service-services.universal.d.ts +5180 -0
  26. package/build/cjs/src/bookings-services-v2-service-services.universal.js +2282 -0
  27. package/build/cjs/src/bookings-services-v2-service-services.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/bookings-services-v2-service-services.context.d.ts +41 -0
  39. package/build/es/src/bookings-services-v2-service-services.context.js +41 -0
  40. package/build/es/src/bookings-services-v2-service-services.context.js.map +1 -0
  41. package/build/es/src/bookings-services-v2-service-services.http.d.ts +482 -0
  42. package/build/es/src/bookings-services-v2-service-services.http.js +1766 -0
  43. package/build/es/src/bookings-services-v2-service-services.http.js.map +1 -0
  44. package/build/es/src/bookings-services-v2-service-services.meta.d.ts +47 -0
  45. package/build/es/src/bookings-services-v2-service-services.meta.js +380 -0
  46. package/build/es/src/bookings-services-v2-service-services.meta.js.map +1 -0
  47. package/build/es/src/bookings-services-v2-service-services.public.d.ts +584 -0
  48. package/build/es/src/bookings-services-v2-service-services.public.js +242 -0
  49. package/build/es/src/bookings-services-v2-service-services.public.js.map +1 -0
  50. package/build/es/src/bookings-services-v2-service-services.types.d.ts +4056 -0
  51. package/build/es/src/bookings-services-v2-service-services.types.js +383 -0
  52. package/build/es/src/bookings-services-v2-service-services.types.js.map +1 -0
  53. package/build/es/src/bookings-services-v2-service-services.universal.d.ts +5180 -0
  54. package/build/es/src/bookings-services-v2-service-services.universal.js +2234 -0
  55. package/build/es/src/bookings-services-v2-service-services.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/bookings-services-v2-service-services.context.d.ts +41 -0
  66. package/build/internal/cjs/src/bookings-services-v2-service-services.context.js +85 -0
  67. package/build/internal/cjs/src/bookings-services-v2-service-services.context.js.map +1 -0
  68. package/build/internal/cjs/src/bookings-services-v2-service-services.http.d.ts +482 -0
  69. package/build/internal/cjs/src/bookings-services-v2-service-services.http.js +1790 -0
  70. package/build/internal/cjs/src/bookings-services-v2-service-services.http.js.map +1 -0
  71. package/build/internal/cjs/src/bookings-services-v2-service-services.meta.d.ts +47 -0
  72. package/build/internal/cjs/src/bookings-services-v2-service-services.meta.js +427 -0
  73. package/build/internal/cjs/src/bookings-services-v2-service-services.meta.js.map +1 -0
  74. package/build/internal/cjs/src/bookings-services-v2-service-services.public.d.ts +584 -0
  75. package/build/internal/cjs/src/bookings-services-v2-service-services.public.js +307 -0
  76. package/build/internal/cjs/src/bookings-services-v2-service-services.public.js.map +1 -0
  77. package/build/internal/cjs/src/bookings-services-v2-service-services.types.d.ts +4056 -0
  78. package/build/internal/cjs/src/bookings-services-v2-service-services.types.js +386 -0
  79. package/build/internal/cjs/src/bookings-services-v2-service-services.types.js.map +1 -0
  80. package/build/internal/cjs/src/bookings-services-v2-service-services.universal.d.ts +5180 -0
  81. package/build/internal/cjs/src/bookings-services-v2-service-services.universal.js +2282 -0
  82. package/build/internal/cjs/src/bookings-services-v2-service-services.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/bookings-services-v2-service-services.context.d.ts +41 -0
  93. package/build/internal/es/src/bookings-services-v2-service-services.context.js +41 -0
  94. package/build/internal/es/src/bookings-services-v2-service-services.context.js.map +1 -0
  95. package/build/internal/es/src/bookings-services-v2-service-services.http.d.ts +482 -0
  96. package/build/internal/es/src/bookings-services-v2-service-services.http.js +1766 -0
  97. package/build/internal/es/src/bookings-services-v2-service-services.http.js.map +1 -0
  98. package/build/internal/es/src/bookings-services-v2-service-services.meta.d.ts +47 -0
  99. package/build/internal/es/src/bookings-services-v2-service-services.meta.js +380 -0
  100. package/build/internal/es/src/bookings-services-v2-service-services.meta.js.map +1 -0
  101. package/build/internal/es/src/bookings-services-v2-service-services.public.d.ts +584 -0
  102. package/build/internal/es/src/bookings-services-v2-service-services.public.js +242 -0
  103. package/build/internal/es/src/bookings-services-v2-service-services.public.js.map +1 -0
  104. package/build/internal/es/src/bookings-services-v2-service-services.types.d.ts +4056 -0
  105. package/build/internal/es/src/bookings-services-v2-service-services.types.js +383 -0
  106. package/build/internal/es/src/bookings-services-v2-service-services.types.js.map +1 -0
  107. package/build/internal/es/src/bookings-services-v2-service-services.universal.d.ts +5180 -0
  108. package/build/internal/es/src/bookings-services-v2-service-services.universal.js +2234 -0
  109. package/build/internal/es/src/bookings-services-v2-service-services.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,2234 @@
1
+ import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
2
+ import { queryBuilder } from '@wix/sdk-runtime/query-builder';
3
+ import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
4
+ import * as ambassadorWixBookingsServicesV2Service from './bookings-services-v2-service-services.http.js';
5
+ // @ts-ignore
6
+ import { transformSDKAddressToRESTAddress } from '@wix/sdk-runtime/transformations/address';
7
+ import { transformRESTAddressToSDKAddress } from '@wix/sdk-runtime/transformations/address';
8
+ import { transformSDKImageToRESTImage } from '@wix/sdk-runtime/transformations/image';
9
+ import { transformRESTImageToSDKImage } from '@wix/sdk-runtime/transformations/image';
10
+ import { transformSDKPageURLV2ToRESTPageURLV2 } from '@wix/sdk-runtime/transformations/page-url-v2';
11
+ import { transformRESTPageURLV2ToSDKPageURLV2 } from '@wix/sdk-runtime/transformations/page-url-v2';
12
+ import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
13
+ export var ServiceType;
14
+ (function (ServiceType) {
15
+ /** Appointment-based service. */
16
+ ServiceType["APPOINTMENT"] = "APPOINTMENT";
17
+ /** Class service. */
18
+ ServiceType["CLASS"] = "CLASS";
19
+ /** Course service. */
20
+ ServiceType["COURSE"] = "COURSE";
21
+ })(ServiceType || (ServiceType = {}));
22
+ export var RateType;
23
+ (function (RateType) {
24
+ /** Unknown rate type. */
25
+ RateType["UNKNOWN_RATE_TYPE"] = "UNKNOWN_RATE_TYPE";
26
+ /** The service has a fixed price. */
27
+ RateType["FIXED"] = "FIXED";
28
+ /** The service has a custom price, expressed as a price description. */
29
+ RateType["CUSTOM"] = "CUSTOM";
30
+ /** This service is offered with a set of different prices based on different terms. */
31
+ RateType["VARIED"] = "VARIED";
32
+ /** This service is offered free of charge. */
33
+ RateType["NO_FEE"] = "NO_FEE";
34
+ })(RateType || (RateType = {}));
35
+ export var LocationTypeEnumLocationType;
36
+ (function (LocationTypeEnumLocationType) {
37
+ LocationTypeEnumLocationType["UNKNOWN_LOCATION_TYPE"] = "UNKNOWN_LOCATION_TYPE";
38
+ /**
39
+ * Location set by the business that is not a standard business location
40
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction)).
41
+ */
42
+ LocationTypeEnumLocationType["CUSTOM"] = "CUSTOM";
43
+ /**
44
+ * Business location
45
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction)).
46
+ */
47
+ LocationTypeEnumLocationType["BUSINESS"] = "BUSINESS";
48
+ /**
49
+ * The customer specifies any address when booking. Available only for
50
+ * appointment-based services.
51
+ */
52
+ LocationTypeEnumLocationType["CUSTOMER"] = "CUSTOMER";
53
+ })(LocationTypeEnumLocationType || (LocationTypeEnumLocationType = {}));
54
+ export var V2RequestedFields;
55
+ (function (V2RequestedFields) {
56
+ /** Unknown requested field. */
57
+ V2RequestedFields["UNKNOWN_REQUESTED_FIELD"] = "UNKNOWN_REQUESTED_FIELD";
58
+ /** When passed, `service.staff_members` is returned. */
59
+ V2RequestedFields["STAFF_MEMBER_DETAILS"] = "STAFF_MEMBER_DETAILS";
60
+ /** When passed, `service.service_resources.resource_type.name` is returned. */
61
+ V2RequestedFields["RESOURCE_TYPE_DETAILS"] = "RESOURCE_TYPE_DETAILS";
62
+ })(V2RequestedFields || (V2RequestedFields = {}));
63
+ export var SortOrder;
64
+ (function (SortOrder) {
65
+ SortOrder["ASC"] = "ASC";
66
+ SortOrder["DESC"] = "DESC";
67
+ })(SortOrder || (SortOrder = {}));
68
+ export var SortType;
69
+ (function (SortType) {
70
+ SortType["COUNT"] = "COUNT";
71
+ SortType["VALUE"] = "VALUE";
72
+ })(SortType || (SortType = {}));
73
+ export var SortDirection;
74
+ (function (SortDirection) {
75
+ SortDirection["DESC"] = "DESC";
76
+ SortDirection["ASC"] = "ASC";
77
+ })(SortDirection || (SortDirection = {}));
78
+ export var MissingValues;
79
+ (function (MissingValues) {
80
+ MissingValues["EXCLUDE"] = "EXCLUDE";
81
+ MissingValues["INCLUDE"] = "INCLUDE";
82
+ })(MissingValues || (MissingValues = {}));
83
+ export var ScalarType;
84
+ (function (ScalarType) {
85
+ ScalarType["UNKNOWN_SCALAR_TYPE"] = "UNKNOWN_SCALAR_TYPE";
86
+ ScalarType["COUNT_DISTINCT"] = "COUNT_DISTINCT";
87
+ ScalarType["MIN"] = "MIN";
88
+ ScalarType["MAX"] = "MAX";
89
+ })(ScalarType || (ScalarType = {}));
90
+ export var NestedAggregationType;
91
+ (function (NestedAggregationType) {
92
+ NestedAggregationType["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
93
+ NestedAggregationType["VALUE"] = "VALUE";
94
+ NestedAggregationType["RANGE"] = "RANGE";
95
+ NestedAggregationType["SCALAR"] = "SCALAR";
96
+ NestedAggregationType["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
97
+ })(NestedAggregationType || (NestedAggregationType = {}));
98
+ export var DateHistogramAggregationInterval;
99
+ (function (DateHistogramAggregationInterval) {
100
+ /** Unknown interval. */
101
+ DateHistogramAggregationInterval["UNKNOWN_INTERVAL"] = "UNKNOWN_INTERVAL";
102
+ /** Yearly interval. */
103
+ DateHistogramAggregationInterval["YEAR"] = "YEAR";
104
+ /** Monthly interval. */
105
+ DateHistogramAggregationInterval["MONTH"] = "MONTH";
106
+ /** Weekly interval. */
107
+ DateHistogramAggregationInterval["WEEK"] = "WEEK";
108
+ /** Daily interval. */
109
+ DateHistogramAggregationInterval["DAY"] = "DAY";
110
+ /** Hourly interval. */
111
+ DateHistogramAggregationInterval["HOUR"] = "HOUR";
112
+ /** Minute interval. */
113
+ DateHistogramAggregationInterval["MINUTE"] = "MINUTE";
114
+ /** Second interval. */
115
+ DateHistogramAggregationInterval["SECOND"] = "SECOND";
116
+ })(DateHistogramAggregationInterval || (DateHistogramAggregationInterval = {}));
117
+ export var AggregationType;
118
+ (function (AggregationType) {
119
+ AggregationType["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
120
+ AggregationType["VALUE"] = "VALUE";
121
+ AggregationType["RANGE"] = "RANGE";
122
+ AggregationType["SCALAR"] = "SCALAR";
123
+ AggregationType["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
124
+ AggregationType["NESTED"] = "NESTED";
125
+ })(AggregationType || (AggregationType = {}));
126
+ export var Mode;
127
+ (function (Mode) {
128
+ /** Any */
129
+ Mode["OR"] = "OR";
130
+ /** All */
131
+ Mode["AND"] = "AND";
132
+ })(Mode || (Mode = {}));
133
+ export var RequestedFields;
134
+ (function (RequestedFields) {
135
+ /** Unknown requested conditional field. */
136
+ RequestedFields["UNKNOWN_REQUESTED_FIELD"] = "UNKNOWN_REQUESTED_FIELD";
137
+ /** Whether to return the site's default booking form. */
138
+ RequestedFields["DEFAULT_BOOKING_FORM"] = "DEFAULT_BOOKING_FORM";
139
+ })(RequestedFields || (RequestedFields = {}));
140
+ export var Action;
141
+ (function (Action) {
142
+ Action["UNKNOWN_ACTION_TYPE"] = "UNKNOWN_ACTION_TYPE";
143
+ /** Retain all future sessions at their current location. This is the default. */
144
+ Action["KEEP_AT_CURRENT_LOCATION"] = "KEEP_AT_CURRENT_LOCATION";
145
+ /** Move future events to a new location. */
146
+ Action["MOVE_TO_LOCATION"] = "MOVE_TO_LOCATION";
147
+ /**
148
+ * Cancel all future events at the removed location.
149
+ * Currently not supported.
150
+ */
151
+ Action["DELETE"] = "DELETE";
152
+ })(Action || (Action = {}));
153
+ export var InvalidSlugError;
154
+ (function (InvalidSlugError) {
155
+ /** Unknown slug error. */
156
+ InvalidSlugError["UNKNOWN_SLUG_ERROR"] = "UNKNOWN_SLUG_ERROR";
157
+ /** Slug contains illegal characters. */
158
+ InvalidSlugError["SLUG_CONTAINS_ILLEGAL_CHARACTERS"] = "SLUG_CONTAINS_ILLEGAL_CHARACTERS";
159
+ /** Slug is already associated with another service. */
160
+ InvalidSlugError["SLUG_ALREADY_EXISTS"] = "SLUG_ALREADY_EXISTS";
161
+ })(InvalidSlugError || (InvalidSlugError = {}));
162
+ export var CloneErrors;
163
+ (function (CloneErrors) {
164
+ /**
165
+ * Failed to clone the original service's *options and variants*
166
+ * ([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)).
167
+ */
168
+ CloneErrors["OPTIONS_AND_VARIANTS"] = "OPTIONS_AND_VARIANTS";
169
+ /** Failed to clone the original service's *booking form*. */
170
+ CloneErrors["FORM"] = "FORM";
171
+ })(CloneErrors || (CloneErrors = {}));
172
+ export var CategoryStatus;
173
+ (function (CategoryStatus) {
174
+ /** The category was created. */
175
+ CategoryStatus["CREATED"] = "CREATED";
176
+ /** The category was deleted. */
177
+ CategoryStatus["DELETED"] = "DELETED";
178
+ })(CategoryStatus || (CategoryStatus = {}));
179
+ export var CategoryNotificationEvent;
180
+ (function (CategoryNotificationEvent) {
181
+ CategoryNotificationEvent["Updated"] = "Updated";
182
+ CategoryNotificationEvent["Deleted"] = "Deleted";
183
+ CategoryNotificationEvent["Created"] = "Created";
184
+ })(CategoryNotificationEvent || (CategoryNotificationEvent = {}));
185
+ export var Day;
186
+ (function (Day) {
187
+ /** Undefined. */
188
+ Day["UNDEFINED"] = "UNDEFINED";
189
+ /** Monday. */
190
+ Day["MON"] = "MON";
191
+ /** Tuesday. */
192
+ Day["TUE"] = "TUE";
193
+ /** Wednesday. */
194
+ Day["WED"] = "WED";
195
+ /** Thursday. */
196
+ Day["THU"] = "THU";
197
+ /** Friday. */
198
+ Day["FRI"] = "FRI";
199
+ /** Saturday. */
200
+ Day["SAT"] = "SAT";
201
+ /** Sunday. */
202
+ Day["SUN"] = "SUN";
203
+ })(Day || (Day = {}));
204
+ export var Transparency;
205
+ (function (Transparency) {
206
+ Transparency["UNDEFINED"] = "UNDEFINED";
207
+ /** The schedule can have available slots during the linked schedule's sessions. */
208
+ Transparency["FREE"] = "FREE";
209
+ /** The schedule can't have available slots during the linked schedule's sessions. */
210
+ Transparency["BUSY"] = "BUSY";
211
+ })(Transparency || (Transparency = {}));
212
+ export var RecurringIntervalType;
213
+ (function (RecurringIntervalType) {
214
+ /** The default value. Sessions for this interval will be of type EVENT. */
215
+ RecurringIntervalType["UNDEFINED"] = "UNDEFINED";
216
+ /** A recurring interval of events. */
217
+ RecurringIntervalType["EVENT"] = "EVENT";
218
+ /** Deprecated. */
219
+ RecurringIntervalType["TIME_AVAILABILITY"] = "TIME_AVAILABILITY";
220
+ /** A recurring interval for availability. */
221
+ RecurringIntervalType["AVAILABILITY"] = "AVAILABILITY";
222
+ })(RecurringIntervalType || (RecurringIntervalType = {}));
223
+ export var LocationType;
224
+ (function (LocationType) {
225
+ LocationType["UNDEFINED"] = "UNDEFINED";
226
+ LocationType["OWNER_BUSINESS"] = "OWNER_BUSINESS";
227
+ LocationType["OWNER_CUSTOM"] = "OWNER_CUSTOM";
228
+ LocationType["CUSTOM"] = "CUSTOM";
229
+ })(LocationType || (LocationType = {}));
230
+ /** For future use */
231
+ export var LocationStatus;
232
+ (function (LocationStatus) {
233
+ LocationStatus["ACTIVE"] = "ACTIVE";
234
+ LocationStatus["INACTIVE"] = "INACTIVE";
235
+ })(LocationStatus || (LocationStatus = {}));
236
+ /** For future use */
237
+ export var LocationsLocationType;
238
+ (function (LocationsLocationType) {
239
+ LocationsLocationType["UNKNOWN"] = "UNKNOWN";
240
+ LocationsLocationType["BRANCH"] = "BRANCH";
241
+ LocationsLocationType["OFFICES"] = "OFFICES";
242
+ LocationsLocationType["RECEPTION"] = "RECEPTION";
243
+ LocationsLocationType["HEADQUARTERS"] = "HEADQUARTERS";
244
+ LocationsLocationType["INVENTORY"] = "INVENTORY";
245
+ })(LocationsLocationType || (LocationsLocationType = {}));
246
+ /** Enumerates the days of the week. */
247
+ export var DayOfWeek;
248
+ (function (DayOfWeek) {
249
+ DayOfWeek["MONDAY"] = "MONDAY";
250
+ DayOfWeek["TUESDAY"] = "TUESDAY";
251
+ DayOfWeek["WEDNESDAY"] = "WEDNESDAY";
252
+ DayOfWeek["THURSDAY"] = "THURSDAY";
253
+ DayOfWeek["FRIDAY"] = "FRIDAY";
254
+ DayOfWeek["SATURDAY"] = "SATURDAY";
255
+ DayOfWeek["SUNDAY"] = "SUNDAY";
256
+ })(DayOfWeek || (DayOfWeek = {}));
257
+ export var ApprovalStatus;
258
+ (function (ApprovalStatus) {
259
+ /** Default. */
260
+ ApprovalStatus["UNDEFINED"] = "UNDEFINED";
261
+ /** Pending business approval. */
262
+ ApprovalStatus["PENDING"] = "PENDING";
263
+ /** Approved by the business. */
264
+ ApprovalStatus["APPROVED"] = "APPROVED";
265
+ /** Declined by the business. */
266
+ ApprovalStatus["DECLINED"] = "DECLINED";
267
+ })(ApprovalStatus || (ApprovalStatus = {}));
268
+ export var ScheduleStatus;
269
+ (function (ScheduleStatus) {
270
+ /** Undefined schedule status. */
271
+ ScheduleStatus["UNDEFINED"] = "UNDEFINED";
272
+ /** The schedule was created. */
273
+ ScheduleStatus["CREATED"] = "CREATED";
274
+ /** The schedule was cancelled. */
275
+ ScheduleStatus["CANCELLED"] = "CANCELLED";
276
+ })(ScheduleStatus || (ScheduleStatus = {}));
277
+ export var ConferenceType;
278
+ (function (ConferenceType) {
279
+ /** Undefined conference type. */
280
+ ConferenceType["UNDEFINED"] = "UNDEFINED";
281
+ /** API-generated online meeting. */
282
+ ConferenceType["ONLINE_MEETING_PROVIDER"] = "ONLINE_MEETING_PROVIDER";
283
+ /** User-defined meeting. */
284
+ ConferenceType["CUSTOM"] = "CUSTOM";
285
+ })(ConferenceType || (ConferenceType = {}));
286
+ export var CalendarType;
287
+ (function (CalendarType) {
288
+ CalendarType["UNDEFINED"] = "UNDEFINED";
289
+ CalendarType["GOOGLE"] = "GOOGLE";
290
+ CalendarType["I_CAL"] = "I_CAL";
291
+ /** Use `MICROSOFT` instead. */
292
+ CalendarType["OUTLOOK"] = "OUTLOOK";
293
+ /** Use `MICROSOFT` instead. */
294
+ CalendarType["OFFICE_365"] = "OFFICE_365";
295
+ CalendarType["MICROSOFT"] = "MICROSOFT";
296
+ CalendarType["OTHER"] = "OTHER";
297
+ })(CalendarType || (CalendarType = {}));
298
+ export var Status;
299
+ (function (Status) {
300
+ /** Undefined status. */
301
+ Status["UNDEFINED"] = "UNDEFINED";
302
+ /** Session is confirmed. Default status. */
303
+ Status["CONFIRMED"] = "CONFIRMED";
304
+ /**
305
+ * Session is cancelled.
306
+ * A cancelled session can be the cancellation of a recurring session that should no longer be displayed or a deleted single session.
307
+ * The ListSessions returns cancelled sessions only if 'includeDelete' flag is set to true.
308
+ */
309
+ Status["CANCELLED"] = "CANCELLED";
310
+ })(Status || (Status = {}));
311
+ export var SessionType;
312
+ (function (SessionType) {
313
+ SessionType["UNDEFINED"] = "UNDEFINED";
314
+ /**
315
+ * Creates an event on the calendar for the owner of the schedule that the session belongs to.
316
+ * Default type.
317
+ */
318
+ SessionType["EVENT"] = "EVENT";
319
+ /** Represents a resource's available working hours. */
320
+ SessionType["WORKING_HOURS"] = "WORKING_HOURS";
321
+ /** Deprecated. Please use WORKING_HOURS. */
322
+ SessionType["TIME_AVAILABILITY"] = "TIME_AVAILABILITY";
323
+ /** Deprecated. Represents a resource's available hours. Please use WORKING_HOURS. */
324
+ SessionType["AVAILABILITY"] = "AVAILABILITY";
325
+ })(SessionType || (SessionType = {}));
326
+ export var ResourceStatus;
327
+ (function (ResourceStatus) {
328
+ /** Undefined resource status. */
329
+ ResourceStatus["UNDEFINED"] = "UNDEFINED";
330
+ /** The resource was created. */
331
+ ResourceStatus["CREATED"] = "CREATED";
332
+ /** The resource was deleted. */
333
+ ResourceStatus["DELETED"] = "DELETED";
334
+ /** The resource was updated. */
335
+ ResourceStatus["UPDATED"] = "UPDATED";
336
+ })(ResourceStatus || (ResourceStatus = {}));
337
+ export var ResourceNotificationEvent;
338
+ (function (ResourceNotificationEvent) {
339
+ /** Undefined resource event. */
340
+ ResourceNotificationEvent["UNDEFINED"] = "UNDEFINED";
341
+ /** The resource was updated. */
342
+ ResourceNotificationEvent["Updated"] = "Updated";
343
+ /** The resource was deleted. */
344
+ ResourceNotificationEvent["Deleted"] = "Deleted";
345
+ /** The resource was created. */
346
+ ResourceNotificationEvent["Created"] = "Created";
347
+ /** The schedule was updated. */
348
+ ResourceNotificationEvent["Schedule_Updated"] = "Schedule_Updated";
349
+ })(ResourceNotificationEvent || (ResourceNotificationEvent = {}));
350
+ export var BenefitType;
351
+ (function (BenefitType) {
352
+ /** Should never be used */
353
+ BenefitType["UNDEFINED"] = "UNDEFINED";
354
+ /** Limited benefit type */
355
+ BenefitType["LIMITED"] = "LIMITED";
356
+ /** Unlimited benefit type */
357
+ BenefitType["UNLIMITED"] = "UNLIMITED";
358
+ })(BenefitType || (BenefitType = {}));
359
+ export var Event;
360
+ (function (Event) {
361
+ Event["Updated"] = "Updated";
362
+ Event["Deleted"] = "Deleted";
363
+ Event["Created"] = "Created";
364
+ })(Event || (Event = {}));
365
+ export var CrudType;
366
+ (function (CrudType) {
367
+ CrudType["INVALID_CRUD_TYPE"] = "INVALID_CRUD_TYPE";
368
+ CrudType["CREATE"] = "CREATE";
369
+ CrudType["UPDATE"] = "UPDATE";
370
+ CrudType["DELETE"] = "DELETE";
371
+ /** Unfortunately this action is used by hibernate save in wix-war */
372
+ CrudType["CREATE_OR_UPDATE"] = "CREATE_OR_UPDATE";
373
+ })(CrudType || (CrudType = {}));
374
+ /** Where the extra text should be displayed: before, after or instead of the actual address. */
375
+ export var PlacementType;
376
+ (function (PlacementType) {
377
+ PlacementType["BEFORE"] = "BEFORE";
378
+ PlacementType["AFTER"] = "AFTER";
379
+ PlacementType["REPLACE"] = "REPLACE";
380
+ })(PlacementType || (PlacementType = {}));
381
+ export var ResolutionMethod;
382
+ (function (ResolutionMethod) {
383
+ ResolutionMethod["QUERY_PARAM"] = "QUERY_PARAM";
384
+ ResolutionMethod["SUBDOMAIN"] = "SUBDOMAIN";
385
+ ResolutionMethod["SUBDIRECTORY"] = "SUBDIRECTORY";
386
+ })(ResolutionMethod || (ResolutionMethod = {}));
387
+ export var WebhookIdentityType;
388
+ (function (WebhookIdentityType) {
389
+ WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
390
+ WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
391
+ WebhookIdentityType["MEMBER"] = "MEMBER";
392
+ WebhookIdentityType["WIX_USER"] = "WIX_USER";
393
+ WebhookIdentityType["APP"] = "APP";
394
+ })(WebhookIdentityType || (WebhookIdentityType = {}));
395
+ /**
396
+ * Creates a service.
397
+ *
398
+ *
399
+ * ## Required fields
400
+ *
401
+ * When creating a service you must specify the following fields:
402
+ * - `type`
403
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/about-service-types) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-types)):
404
+ * Whether it's an appointment-based service, class, or course.
405
+ * - `name`: Service name that's displayed to customers.
406
+ * - `onlineBooking`:
407
+ * Settings determining whether customers can book online, whether the business
408
+ * must manually confirm bookings, and whether customers can request to book an
409
+ * appointment time slot that already has a booking request awaiting business
410
+ * confirmation.
411
+ * - `payment`
412
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/about-service-payments) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-payments)):
413
+ * How customers can pay when signing up for the service.
414
+ *
415
+ * ### Session durations
416
+ *
417
+ * Depending on which type of service you're creating, you may also need to specify
418
+ * supported session durations.
419
+ *
420
+ * __Classes and courses__
421
+ *
422
+ * Don't specify `schedule.availabilityConstraints.sessionDurations`.
423
+ *
424
+ * __Appointment-based services without varied pricing based on session length__
425
+ *
426
+ * Specify the single supported session duration in the
427
+ * `schedule.availabilityConstraints.sessionDurations` array.
428
+ *
429
+ * __Appointment-based services with varied pricing based on session length__
430
+ *
431
+ * - Specify all supported session durations in `schedule.availabilityConstraints.sessionDurations`.
432
+ * - Note that Wix Bookings doesn't display these values to customers and
433
+ * ignores them in pricing and availability calculations. Instead session
434
+ * durations are retrieved from the relevant service variants
435
+ * ([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)).
436
+ * - It is mandatory to specify `schedule.availabilityConstraints.sessionDurations`,
437
+ * even though these values are ignored.
438
+ * @param service - Service to create.
439
+ * @public
440
+ * @requiredField service
441
+ * @permissionId BOOKINGS.SERVICES_CREATE
442
+ * @permissionScope Manage Bookings
443
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
444
+ * @permissionScope Manage Bookings - all permissions
445
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
446
+ * @applicableIdentity APP
447
+ * @returns Created service.
448
+ * @fqn wix.bookings.services.v2.ServicesService.CreateService
449
+ */
450
+ export async function createService(service) {
451
+ // @ts-ignore
452
+ const { httpClient, sideEffects } = arguments[1];
453
+ const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({ service: service }), [
454
+ {
455
+ transformFn: transformSDKImageToRESTImage,
456
+ paths: [
457
+ { path: 'service.media.items.image' },
458
+ { path: 'service.media.mainMedia.image' },
459
+ { path: 'service.media.coverMedia.image' },
460
+ { path: 'service.staffMembers.mainMedia.image' },
461
+ { path: 'service.staffMemberDetails.staffMembers.mainMedia.image' },
462
+ ],
463
+ },
464
+ {
465
+ transformFn: transformSDKAddressToRESTAddress,
466
+ paths: [
467
+ { path: 'service.locations.calculatedAddress' },
468
+ { path: 'service.locations.business.address' },
469
+ { path: 'service.locations.custom.address' },
470
+ ],
471
+ },
472
+ {
473
+ transformFn: transformSDKPageURLV2ToRESTPageURLV2,
474
+ paths: [
475
+ { path: 'service.urls.servicePage' },
476
+ { path: 'service.urls.bookingPage' },
477
+ { path: 'service.urls.calendarPage' },
478
+ ],
479
+ },
480
+ ]);
481
+ const reqOpts = ambassadorWixBookingsServicesV2Service.createService(payload);
482
+ sideEffects?.onSiteCall?.();
483
+ try {
484
+ const result = await httpClient.request(reqOpts);
485
+ sideEffects?.onSuccess?.(result);
486
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
487
+ {
488
+ transformFn: transformRESTImageToSDKImage,
489
+ paths: [
490
+ { path: 'service.media.items.image' },
491
+ { path: 'service.media.mainMedia.image' },
492
+ { path: 'service.media.coverMedia.image' },
493
+ { path: 'service.staffMembers.mainMedia.image' },
494
+ { path: 'service.staffMemberDetails.staffMembers.mainMedia.image' },
495
+ ],
496
+ },
497
+ {
498
+ transformFn: transformRESTAddressToSDKAddress,
499
+ paths: [
500
+ { path: 'service.locations.calculatedAddress' },
501
+ { path: 'service.locations.business.address' },
502
+ { path: 'service.locations.custom.address' },
503
+ ],
504
+ },
505
+ {
506
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
507
+ paths: [
508
+ { path: 'service.urls.servicePage' },
509
+ { path: 'service.urls.bookingPage' },
510
+ { path: 'service.urls.calendarPage' },
511
+ ],
512
+ },
513
+ ]))?.service;
514
+ }
515
+ catch (err) {
516
+ const transformedError = sdkTransformError(err, {
517
+ spreadPathsToArguments: {},
518
+ explicitPathsToArguments: { service: '$[0]' },
519
+ singleArgumentUnchanged: false,
520
+ }, ['service']);
521
+ sideEffects?.onError?.(err);
522
+ throw transformedError;
523
+ }
524
+ }
525
+ /**
526
+ * Retrieves a service.
527
+ * @param serviceId - ID of the service to retrieve.
528
+ * @public
529
+ * @requiredField serviceId
530
+ * @permissionId BOOKINGS.SERVICES_READ
531
+ * @permissionScope Read Bookings - Public Data
532
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
533
+ * @permissionScope Manage Bookings Services and Settings
534
+ * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
535
+ * @permissionScope Manage Bookings
536
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
537
+ * @permissionScope Read Bookings - Including Participants
538
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
539
+ * @permissionScope Read Bookings - all read permissions
540
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
541
+ * @permissionScope Manage Bookings - all permissions
542
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
543
+ * @applicableIdentity APP
544
+ * @applicableIdentity VISITOR
545
+ * @returns Retrieved service.
546
+ * @fqn wix.bookings.services.v2.ServicesService.GetService
547
+ */
548
+ export async function getService(serviceId) {
549
+ // @ts-ignore
550
+ const { httpClient, sideEffects } = arguments[1];
551
+ const payload = renameKeysFromSDKRequestToRESTRequest({
552
+ serviceId: serviceId,
553
+ });
554
+ const reqOpts = ambassadorWixBookingsServicesV2Service.getService(payload);
555
+ sideEffects?.onSiteCall?.();
556
+ try {
557
+ const result = await httpClient.request(reqOpts);
558
+ sideEffects?.onSuccess?.(result);
559
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
560
+ {
561
+ transformFn: transformRESTImageToSDKImage,
562
+ paths: [
563
+ { path: 'service.media.items.image' },
564
+ { path: 'service.media.mainMedia.image' },
565
+ { path: 'service.media.coverMedia.image' },
566
+ { path: 'service.staffMembers.mainMedia.image' },
567
+ { path: 'service.staffMemberDetails.staffMembers.mainMedia.image' },
568
+ ],
569
+ },
570
+ {
571
+ transformFn: transformRESTAddressToSDKAddress,
572
+ paths: [
573
+ { path: 'service.locations.calculatedAddress' },
574
+ { path: 'service.locations.business.address' },
575
+ { path: 'service.locations.custom.address' },
576
+ ],
577
+ },
578
+ {
579
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
580
+ paths: [
581
+ { path: 'service.urls.servicePage' },
582
+ { path: 'service.urls.bookingPage' },
583
+ { path: 'service.urls.calendarPage' },
584
+ ],
585
+ },
586
+ ]))?.service;
587
+ }
588
+ catch (err) {
589
+ const transformedError = sdkTransformError(err, {
590
+ spreadPathsToArguments: {},
591
+ explicitPathsToArguments: { serviceId: '$[0]' },
592
+ singleArgumentUnchanged: false,
593
+ }, ['serviceId']);
594
+ sideEffects?.onError?.(err);
595
+ throw transformedError;
596
+ }
597
+ }
598
+ /**
599
+ * Updates a service.
600
+ *
601
+ *
602
+ * Each time the service is updated, `revision` increments by 1. You must
603
+ * include the number of the existing revision when updating the service.
604
+ * This ensures you're working with the latest service information and
605
+ * prevents unintended overwrites.
606
+ *
607
+ * ## Session durations
608
+ *
609
+ * Specify `schedule.availabilityConstraints.sessionDurations`
610
+ * only if you want to update it for appointment-based services without varied
611
+ * pricing based on session length. Don't specify `schedule.availabilityConstraints.sessionDurations`
612
+ * for all other appointment-based services, classes, or courses. See Create Service
613
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/create-service#session-durations) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/create-service#session-durations))
614
+ * for more details.
615
+ * @param _id - Service ID.
616
+ * @public
617
+ * @requiredField _id
618
+ * @requiredField service
619
+ * @requiredField service.revision
620
+ * @permissionId BOOKINGS.SERVICES_UPDATE
621
+ * @permissionScope Manage Bookings
622
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
623
+ * @permissionScope Manage Bookings - all permissions
624
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
625
+ * @applicableIdentity APP
626
+ * @returns Updated service.
627
+ * @fqn wix.bookings.services.v2.ServicesService.UpdateService
628
+ */
629
+ export async function updateService(_id, service) {
630
+ // @ts-ignore
631
+ const { httpClient, sideEffects } = arguments[2];
632
+ const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({ service: { ...service, id: _id } }), [
633
+ {
634
+ transformFn: transformSDKImageToRESTImage,
635
+ paths: [
636
+ { path: 'service.media.items.image' },
637
+ { path: 'service.media.mainMedia.image' },
638
+ { path: 'service.media.coverMedia.image' },
639
+ { path: 'service.staffMembers.mainMedia.image' },
640
+ { path: 'service.staffMemberDetails.staffMembers.mainMedia.image' },
641
+ ],
642
+ },
643
+ {
644
+ transformFn: transformSDKAddressToRESTAddress,
645
+ paths: [
646
+ { path: 'service.locations.calculatedAddress' },
647
+ { path: 'service.locations.business.address' },
648
+ { path: 'service.locations.custom.address' },
649
+ ],
650
+ },
651
+ {
652
+ transformFn: transformSDKPageURLV2ToRESTPageURLV2,
653
+ paths: [
654
+ { path: 'service.urls.servicePage' },
655
+ { path: 'service.urls.bookingPage' },
656
+ { path: 'service.urls.calendarPage' },
657
+ ],
658
+ },
659
+ ]);
660
+ const reqOpts = ambassadorWixBookingsServicesV2Service.updateService(payload);
661
+ sideEffects?.onSiteCall?.();
662
+ try {
663
+ const result = await httpClient.request(reqOpts);
664
+ sideEffects?.onSuccess?.(result);
665
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
666
+ {
667
+ transformFn: transformRESTImageToSDKImage,
668
+ paths: [
669
+ { path: 'service.media.items.image' },
670
+ { path: 'service.media.mainMedia.image' },
671
+ { path: 'service.media.coverMedia.image' },
672
+ { path: 'service.staffMembers.mainMedia.image' },
673
+ { path: 'service.staffMemberDetails.staffMembers.mainMedia.image' },
674
+ ],
675
+ },
676
+ {
677
+ transformFn: transformRESTAddressToSDKAddress,
678
+ paths: [
679
+ { path: 'service.locations.calculatedAddress' },
680
+ { path: 'service.locations.business.address' },
681
+ { path: 'service.locations.custom.address' },
682
+ ],
683
+ },
684
+ {
685
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
686
+ paths: [
687
+ { path: 'service.urls.servicePage' },
688
+ { path: 'service.urls.bookingPage' },
689
+ { path: 'service.urls.calendarPage' },
690
+ ],
691
+ },
692
+ ]))?.service;
693
+ }
694
+ catch (err) {
695
+ const transformedError = sdkTransformError(err, {
696
+ spreadPathsToArguments: { service: '$[1]' },
697
+ explicitPathsToArguments: { 'service.id': '$[0]' },
698
+ singleArgumentUnchanged: false,
699
+ }, ['_id', 'service']);
700
+ sideEffects?.onError?.(err);
701
+ throw transformedError;
702
+ }
703
+ }
704
+ /**
705
+ * Updates multiple services.
706
+ *
707
+ *
708
+ * See Update Service
709
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/update-service) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/update-service))
710
+ * for more details.
711
+ *
712
+ * The call succeeds even if one or more individual services can't be updated.
713
+ * Information about failures is returned in `bulkActionMetadata`.
714
+ * @public
715
+ * @requiredField options.services.service
716
+ * @requiredField options.services.service._id
717
+ * @requiredField options.services.service.revision
718
+ * @permissionId BOOKINGS.SERVICES_UPDATE
719
+ * @permissionScope Manage Bookings
720
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
721
+ * @permissionScope Manage Bookings - all permissions
722
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
723
+ * @applicableIdentity APP
724
+ * @fqn wix.bookings.services.v2.ServicesService.BulkUpdateServices
725
+ */
726
+ export async function bulkUpdateServices(options) {
727
+ // @ts-ignore
728
+ const { httpClient, sideEffects } = arguments[1];
729
+ const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
730
+ services: options?.services,
731
+ returnEntity: options?.returnEntity,
732
+ }), [
733
+ {
734
+ transformFn: transformSDKImageToRESTImage,
735
+ paths: [
736
+ { path: 'services.service.media.items.image' },
737
+ { path: 'services.service.media.mainMedia.image' },
738
+ { path: 'services.service.media.coverMedia.image' },
739
+ { path: 'services.service.staffMembers.mainMedia.image' },
740
+ {
741
+ path: 'services.service.staffMemberDetails.staffMembers.mainMedia.image',
742
+ },
743
+ ],
744
+ },
745
+ {
746
+ transformFn: transformSDKAddressToRESTAddress,
747
+ paths: [
748
+ { path: 'services.service.locations.calculatedAddress' },
749
+ { path: 'services.service.locations.business.address' },
750
+ { path: 'services.service.locations.custom.address' },
751
+ ],
752
+ },
753
+ {
754
+ transformFn: transformSDKPageURLV2ToRESTPageURLV2,
755
+ paths: [
756
+ { path: 'services.service.urls.servicePage' },
757
+ { path: 'services.service.urls.bookingPage' },
758
+ { path: 'services.service.urls.calendarPage' },
759
+ ],
760
+ },
761
+ ]);
762
+ const reqOpts = ambassadorWixBookingsServicesV2Service.bulkUpdateServices(payload);
763
+ sideEffects?.onSiteCall?.();
764
+ try {
765
+ const result = await httpClient.request(reqOpts);
766
+ sideEffects?.onSuccess?.(result);
767
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
768
+ {
769
+ transformFn: transformRESTImageToSDKImage,
770
+ paths: [
771
+ { path: 'results.item.media.items.image' },
772
+ { path: 'results.item.media.mainMedia.image' },
773
+ { path: 'results.item.media.coverMedia.image' },
774
+ { path: 'results.item.staffMembers.mainMedia.image' },
775
+ {
776
+ path: 'results.item.staffMemberDetails.staffMembers.mainMedia.image',
777
+ },
778
+ ],
779
+ },
780
+ {
781
+ transformFn: transformRESTAddressToSDKAddress,
782
+ paths: [
783
+ { path: 'results.item.locations.calculatedAddress' },
784
+ { path: 'results.item.locations.business.address' },
785
+ { path: 'results.item.locations.custom.address' },
786
+ ],
787
+ },
788
+ {
789
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
790
+ paths: [
791
+ { path: 'results.item.urls.servicePage' },
792
+ { path: 'results.item.urls.bookingPage' },
793
+ { path: 'results.item.urls.calendarPage' },
794
+ ],
795
+ },
796
+ ]));
797
+ }
798
+ catch (err) {
799
+ const transformedError = sdkTransformError(err, {
800
+ spreadPathsToArguments: {},
801
+ explicitPathsToArguments: {
802
+ services: '$[0].services',
803
+ returnEntity: '$[0].returnEntity',
804
+ },
805
+ singleArgumentUnchanged: false,
806
+ }, ['options']);
807
+ sideEffects?.onError?.(err);
808
+ throw transformedError;
809
+ }
810
+ }
811
+ /**
812
+ * Updates multiple services by filter.
813
+ *
814
+ *
815
+ * Refer to the supported filters article
816
+ * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/filtering-and-sorting#filtering))
817
+ * for more details.
818
+ *
819
+ * See Update Service
820
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/update-service) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/update-service))
821
+ * for more details about updating a service.
822
+ *
823
+ * The call succeeds even if one or more individual services can't be updated.
824
+ * Information about failures is returned in `bulkActionMetadata`.
825
+ * @param filter - Filter to identify the services to update.
826
+ * @public
827
+ * @requiredField filter
828
+ * @requiredField options
829
+ * @requiredField options.service
830
+ * @permissionId BOOKINGS.SERVICES_UPDATE
831
+ * @permissionScope Manage Bookings
832
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
833
+ * @permissionScope Manage Bookings - all permissions
834
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
835
+ * @applicableIdentity APP
836
+ * @fqn wix.bookings.services.v2.ServicesService.BulkUpdateServicesByFilter
837
+ */
838
+ export async function bulkUpdateServicesByFilter(filter, options) {
839
+ // @ts-ignore
840
+ const { httpClient, sideEffects } = arguments[2];
841
+ const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
842
+ filter: filter,
843
+ service: options?.service,
844
+ }), [
845
+ {
846
+ transformFn: transformSDKImageToRESTImage,
847
+ paths: [
848
+ { path: 'service.media.items.image' },
849
+ { path: 'service.media.mainMedia.image' },
850
+ { path: 'service.media.coverMedia.image' },
851
+ { path: 'service.staffMembers.mainMedia.image' },
852
+ { path: 'service.staffMemberDetails.staffMembers.mainMedia.image' },
853
+ ],
854
+ },
855
+ {
856
+ transformFn: transformSDKAddressToRESTAddress,
857
+ paths: [
858
+ { path: 'service.locations.calculatedAddress' },
859
+ { path: 'service.locations.business.address' },
860
+ { path: 'service.locations.custom.address' },
861
+ ],
862
+ },
863
+ {
864
+ transformFn: transformSDKPageURLV2ToRESTPageURLV2,
865
+ paths: [
866
+ { path: 'service.urls.servicePage' },
867
+ { path: 'service.urls.bookingPage' },
868
+ { path: 'service.urls.calendarPage' },
869
+ ],
870
+ },
871
+ ]);
872
+ const reqOpts = ambassadorWixBookingsServicesV2Service.bulkUpdateServicesByFilter(payload);
873
+ sideEffects?.onSiteCall?.();
874
+ try {
875
+ const result = await httpClient.request(reqOpts);
876
+ sideEffects?.onSuccess?.(result);
877
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
878
+ }
879
+ catch (err) {
880
+ const transformedError = sdkTransformError(err, {
881
+ spreadPathsToArguments: {},
882
+ explicitPathsToArguments: { filter: '$[0]', service: '$[1].service' },
883
+ singleArgumentUnchanged: false,
884
+ }, ['filter', 'options']);
885
+ sideEffects?.onError?.(err);
886
+ throw transformedError;
887
+ }
888
+ }
889
+ /**
890
+ * Deletes a service.
891
+ *
892
+ *
893
+ * Specify `{"preserveFutureSessionsWithParticipants": true}` to retain all
894
+ * future sessions for the service. By default, all future sessions are canceled.
895
+ * @param serviceId - ID of the service to delete.
896
+ * @public
897
+ * @requiredField serviceId
898
+ * @param options - Allows you to configure how to handle the deleted service's future sessions and how to notify the sessions participants.
899
+ * @permissionId BOOKINGS.SERVICES_DELETE
900
+ * @permissionScope Manage Bookings
901
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
902
+ * @permissionScope Manage Bookings - all permissions
903
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
904
+ * @applicableIdentity APP
905
+ * @fqn wix.bookings.services.v2.ServicesService.DeleteService
906
+ */
907
+ export async function deleteService(serviceId, options) {
908
+ // @ts-ignore
909
+ const { httpClient, sideEffects } = arguments[2];
910
+ const payload = renameKeysFromSDKRequestToRESTRequest({
911
+ serviceId: serviceId,
912
+ preserveFutureSessionsWithParticipants: options?.preserveFutureSessionsWithParticipants,
913
+ participantNotification: options?.participantNotification,
914
+ });
915
+ const reqOpts = ambassadorWixBookingsServicesV2Service.deleteService(payload);
916
+ sideEffects?.onSiteCall?.();
917
+ try {
918
+ const result = await httpClient.request(reqOpts);
919
+ sideEffects?.onSuccess?.(result);
920
+ }
921
+ catch (err) {
922
+ const transformedError = sdkTransformError(err, {
923
+ spreadPathsToArguments: {},
924
+ explicitPathsToArguments: {
925
+ serviceId: '$[0]',
926
+ preserveFutureSessionsWithParticipants: '$[1].preserveFutureSessionsWithParticipants',
927
+ participantNotification: '$[1].participantNotification',
928
+ },
929
+ singleArgumentUnchanged: false,
930
+ }, ['serviceId', 'options']);
931
+ sideEffects?.onError?.(err);
932
+ throw transformedError;
933
+ }
934
+ }
935
+ /**
936
+ * Deletes multiple services.
937
+ *
938
+ *
939
+ * See Delete Service
940
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/delete-service) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/delete-service))
941
+ * for more details about deleting a service.
942
+ *
943
+ * The call succeeds even if one or more individual services can't be deleted.
944
+ * Information about failures is returned in `bulkActionMetadata`.
945
+ * @param ids - IDs of the services to delete.
946
+ * @public
947
+ * @requiredField ids
948
+ * @permissionId BOOKINGS.SERVICES_DELETE
949
+ * @permissionScope Manage Bookings
950
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
951
+ * @permissionScope Manage Bookings - all permissions
952
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
953
+ * @applicableIdentity APP
954
+ * @fqn wix.bookings.services.v2.ServicesService.BulkDeleteServices
955
+ */
956
+ export async function bulkDeleteServices(ids, options) {
957
+ // @ts-ignore
958
+ const { httpClient, sideEffects } = arguments[2];
959
+ const payload = renameKeysFromSDKRequestToRESTRequest({
960
+ ids: ids,
961
+ preserveFutureSessionsWithParticipants: options?.preserveFutureSessionsWithParticipants,
962
+ participantNotification: options?.participantNotification,
963
+ });
964
+ const reqOpts = ambassadorWixBookingsServicesV2Service.bulkDeleteServices(payload);
965
+ sideEffects?.onSiteCall?.();
966
+ try {
967
+ const result = await httpClient.request(reqOpts);
968
+ sideEffects?.onSuccess?.(result);
969
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
970
+ {
971
+ transformFn: transformRESTImageToSDKImage,
972
+ paths: [
973
+ { path: 'results.item.media.items.image' },
974
+ { path: 'results.item.media.mainMedia.image' },
975
+ { path: 'results.item.media.coverMedia.image' },
976
+ { path: 'results.item.staffMembers.mainMedia.image' },
977
+ {
978
+ path: 'results.item.staffMemberDetails.staffMembers.mainMedia.image',
979
+ },
980
+ ],
981
+ },
982
+ {
983
+ transformFn: transformRESTAddressToSDKAddress,
984
+ paths: [
985
+ { path: 'results.item.locations.calculatedAddress' },
986
+ { path: 'results.item.locations.business.address' },
987
+ { path: 'results.item.locations.custom.address' },
988
+ ],
989
+ },
990
+ {
991
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
992
+ paths: [
993
+ { path: 'results.item.urls.servicePage' },
994
+ { path: 'results.item.urls.bookingPage' },
995
+ { path: 'results.item.urls.calendarPage' },
996
+ ],
997
+ },
998
+ ]));
999
+ }
1000
+ catch (err) {
1001
+ const transformedError = sdkTransformError(err, {
1002
+ spreadPathsToArguments: {},
1003
+ explicitPathsToArguments: {
1004
+ ids: '$[0]',
1005
+ preserveFutureSessionsWithParticipants: '$[1].preserveFutureSessionsWithParticipants',
1006
+ participantNotification: '$[1].participantNotification',
1007
+ },
1008
+ singleArgumentUnchanged: false,
1009
+ }, ['ids', 'options']);
1010
+ sideEffects?.onError?.(err);
1011
+ throw transformedError;
1012
+ }
1013
+ }
1014
+ /**
1015
+ * Deletes multiple services by filter.
1016
+ *
1017
+ *
1018
+ * See Delete Service
1019
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/delete-service) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/delete-service))
1020
+ * for more details about deleting a service.
1021
+ *
1022
+ * The call succeeds even if one or more individual services can't be deleted.
1023
+ * Information about failures is returned in `bulkActionMetadata`.
1024
+ *
1025
+ * Refer to the supported filters article
1026
+ * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/filtering-and-sorting#filtering))
1027
+ * for more details.
1028
+ *
1029
+ * To learn about working with filters in general, see
1030
+ * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).
1031
+ * @param filter - Filter to identify the services that need to be deleted.
1032
+ * @public
1033
+ * @requiredField filter
1034
+ * @permissionId BOOKINGS.SERVICES_DELETE
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
+ * @applicableIdentity APP
1040
+ * @fqn wix.bookings.services.v2.ServicesService.BulkDeleteServicesByFilter
1041
+ */
1042
+ export async function bulkDeleteServicesByFilter(filter, options) {
1043
+ // @ts-ignore
1044
+ const { httpClient, sideEffects } = arguments[2];
1045
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1046
+ filter: filter,
1047
+ preserveFutureSessionsWithParticipants: options?.preserveFutureSessionsWithParticipants,
1048
+ participantNotification: options?.participantNotification,
1049
+ });
1050
+ const reqOpts = ambassadorWixBookingsServicesV2Service.bulkDeleteServicesByFilter(payload);
1051
+ sideEffects?.onSiteCall?.();
1052
+ try {
1053
+ const result = await httpClient.request(reqOpts);
1054
+ sideEffects?.onSuccess?.(result);
1055
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1056
+ }
1057
+ catch (err) {
1058
+ const transformedError = sdkTransformError(err, {
1059
+ spreadPathsToArguments: {},
1060
+ explicitPathsToArguments: {
1061
+ filter: '$[0]',
1062
+ preserveFutureSessionsWithParticipants: '$[1].preserveFutureSessionsWithParticipants',
1063
+ participantNotification: '$[1].participantNotification',
1064
+ },
1065
+ singleArgumentUnchanged: false,
1066
+ }, ['filter', 'options']);
1067
+ sideEffects?.onError?.(err);
1068
+ throw transformedError;
1069
+ }
1070
+ }
1071
+ /**
1072
+ * Retrieves a list of up to 100 services, given the provided paging, filtering, and sorting.
1073
+ * `queryServices()` runs with these defaults, which you can override:
1074
+ * + `paging.limit` is `100`.
1075
+ * + `paging.offset` is `0`.
1076
+ *
1077
+ *
1078
+ * >**Notes:**
1079
+ * > + Use UTC format when filtering with dates.
1080
+ * > + Only 1 use of each filter in the same query is supported. If a filter is defined more than once in a query, only the first occurrence is processed.
1081
+ * @public
1082
+ * @permissionScope Read Bookings - Public Data
1083
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
1084
+ * @permissionScope Manage Bookings Services and Settings
1085
+ * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1086
+ * @permissionScope Manage Bookings
1087
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1088
+ * @permissionScope Read Bookings - Including Participants
1089
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1090
+ * @permissionScope Read Bookings - all read permissions
1091
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
1092
+ * @permissionScope Manage Bookings - all permissions
1093
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1094
+ * @permissionId BOOKINGS.SERVICES_READ
1095
+ * @applicableIdentity APP
1096
+ * @applicableIdentity VISITOR
1097
+ * @fqn wix.bookings.services.v2.ServicesService.QueryServices
1098
+ */
1099
+ export function queryServices(options) {
1100
+ // @ts-ignore
1101
+ const { httpClient, sideEffects } = arguments[1];
1102
+ return queryBuilder({
1103
+ func: async (payload) => {
1104
+ const reqOpts = ambassadorWixBookingsServicesV2Service.queryServices({
1105
+ ...payload,
1106
+ ...(options ?? {}),
1107
+ });
1108
+ sideEffects?.onSiteCall?.();
1109
+ try {
1110
+ const result = await httpClient.request(reqOpts);
1111
+ sideEffects?.onSuccess?.(result);
1112
+ return result;
1113
+ }
1114
+ catch (err) {
1115
+ sideEffects?.onError?.(err);
1116
+ throw err;
1117
+ }
1118
+ },
1119
+ requestTransformer: (query) => {
1120
+ const args = [query, options];
1121
+ return renameKeysFromSDKRequestToRESTRequest({
1122
+ ...args?.[1],
1123
+ query: args?.[0],
1124
+ });
1125
+ },
1126
+ responseTransformer: ({ data }) => {
1127
+ const transformedData = renameKeysFromRESTResponseToSDKResponse(transformPaths(data, [
1128
+ {
1129
+ transformFn: transformRESTImageToSDKImage,
1130
+ paths: [
1131
+ { path: 'services.media.items.image' },
1132
+ { path: 'services.media.mainMedia.image' },
1133
+ { path: 'services.media.coverMedia.image' },
1134
+ { path: 'services.staffMembers.mainMedia.image' },
1135
+ {
1136
+ path: 'services.staffMemberDetails.staffMembers.mainMedia.image',
1137
+ },
1138
+ ],
1139
+ },
1140
+ {
1141
+ transformFn: transformRESTAddressToSDKAddress,
1142
+ paths: [
1143
+ { path: 'services.locations.calculatedAddress' },
1144
+ { path: 'services.locations.business.address' },
1145
+ { path: 'services.locations.custom.address' },
1146
+ ],
1147
+ },
1148
+ {
1149
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1150
+ paths: [
1151
+ { path: 'services.urls.servicePage' },
1152
+ { path: 'services.urls.bookingPage' },
1153
+ { path: 'services.urls.calendarPage' },
1154
+ ],
1155
+ },
1156
+ ]));
1157
+ return {
1158
+ items: transformedData?.services,
1159
+ pagingMetadata: transformedData?.pagingMetadata,
1160
+ };
1161
+ },
1162
+ errorTransformer: (err) => {
1163
+ const transformedError = sdkTransformError(err, {
1164
+ spreadPathsToArguments: {},
1165
+ explicitPathsToArguments: { query: '$[0]' },
1166
+ singleArgumentUnchanged: false,
1167
+ });
1168
+ throw transformedError;
1169
+ },
1170
+ pagingMethod: 'OFFSET',
1171
+ transformationPaths: {},
1172
+ });
1173
+ }
1174
+ /**
1175
+ * Retrieves a list of up to 100 services, given the provided filtering, paging,
1176
+ * and sorting.
1177
+ *
1178
+ *
1179
+ * ## Defaults
1180
+ *
1181
+ * Search Services has the following default settings, which you can override:
1182
+ * + Sorted by `createdDate` in ascending order.
1183
+ * + `paging.limit` set to `100`.
1184
+ * + `paging.offset` set to `0`.
1185
+ *
1186
+ * ## Filters
1187
+ *
1188
+ * When using filters for dates, you must use
1189
+ * [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).
1190
+ *
1191
+ * Refer to the supported filters article
1192
+ * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/filtering-and-sorting))
1193
+ * for a complete list of supported filters and sorting options.
1194
+ *
1195
+ * ## See also
1196
+ *
1197
+ * To learn about working with *Search* methods, see
1198
+ * API Query Language
1199
+ * ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/api-query-language) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language))
1200
+ * and Sorting and Paging
1201
+ * ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/api-query-language#the-sort-array) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging)).
1202
+ * @param search - WQL, search or aggregation expression.
1203
+ * @public
1204
+ * @documentationMaturity preview
1205
+ * @requiredField search
1206
+ * @permissionId BOOKINGS.SERVICES_READ
1207
+ * @permissionScope Read Bookings - Public Data
1208
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
1209
+ * @permissionScope Manage Bookings Services and Settings
1210
+ * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1211
+ * @permissionScope Manage Bookings
1212
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1213
+ * @permissionScope Read Bookings - Including Participants
1214
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1215
+ * @permissionScope Read Bookings - all read permissions
1216
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
1217
+ * @permissionScope Manage Bookings - all permissions
1218
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1219
+ * @applicableIdentity APP
1220
+ * @applicableIdentity VISITOR
1221
+ * @fqn wix.bookings.services.v2.ServicesService.SearchServices
1222
+ */
1223
+ export async function searchServices(search) {
1224
+ // @ts-ignore
1225
+ const { httpClient, sideEffects } = arguments[1];
1226
+ const payload = renameKeysFromSDKRequestToRESTRequest({ search: search });
1227
+ const reqOpts = ambassadorWixBookingsServicesV2Service.searchServices(payload);
1228
+ sideEffects?.onSiteCall?.();
1229
+ try {
1230
+ const result = await httpClient.request(reqOpts);
1231
+ sideEffects?.onSuccess?.(result);
1232
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1233
+ {
1234
+ transformFn: transformRESTImageToSDKImage,
1235
+ paths: [
1236
+ { path: 'services.media.items.image' },
1237
+ { path: 'services.media.mainMedia.image' },
1238
+ { path: 'services.media.coverMedia.image' },
1239
+ { path: 'services.staffMembers.mainMedia.image' },
1240
+ {
1241
+ path: 'services.staffMemberDetails.staffMembers.mainMedia.image',
1242
+ },
1243
+ ],
1244
+ },
1245
+ {
1246
+ transformFn: transformRESTAddressToSDKAddress,
1247
+ paths: [
1248
+ { path: 'services.locations.calculatedAddress' },
1249
+ { path: 'services.locations.business.address' },
1250
+ { path: 'services.locations.custom.address' },
1251
+ ],
1252
+ },
1253
+ {
1254
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1255
+ paths: [
1256
+ { path: 'services.urls.servicePage' },
1257
+ { path: 'services.urls.bookingPage' },
1258
+ { path: 'services.urls.calendarPage' },
1259
+ ],
1260
+ },
1261
+ ]));
1262
+ }
1263
+ catch (err) {
1264
+ const transformedError = sdkTransformError(err, {
1265
+ spreadPathsToArguments: {},
1266
+ explicitPathsToArguments: { search: '$[0]' },
1267
+ singleArgumentUnchanged: false,
1268
+ }, ['search']);
1269
+ sideEffects?.onError?.(err);
1270
+ throw transformedError;
1271
+ }
1272
+ }
1273
+ /**
1274
+ * Retrieves a list of up to 100 booking policies
1275
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/booking-policies/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policies/introduction)),
1276
+ * and information about the services that are connected to them,
1277
+ * given the provided filtering, paging, and sorting.
1278
+ *
1279
+ * ## Defaults
1280
+ *
1281
+ * Query Policies has the following default settings, which you can override:
1282
+ *
1283
+ * + Sorted by `id` in ascending order.
1284
+ * + `cursorPaging.limit` set to `100`.
1285
+ *
1286
+ * ## Filters
1287
+ *
1288
+ * For a complete list of supported filters, refer to **Booking Policies API: Supported Filters**
1289
+ * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policies/supported-filters)).
1290
+ *
1291
+ * When using date filters, you must use
1292
+ * [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).
1293
+ *
1294
+ * ## Returned services
1295
+ *
1296
+ * If a booking policy is connected to more than 5 services, only a subset of
1297
+ * those services is returned. The `bookingPolicies.totalServiceCount` values
1298
+ * indicate the total number of services linked to each policy. You can call Search Services
1299
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/search-services) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/search-services))
1300
+ * and specify the relevant policy ID in the filter to retrieve all services
1301
+ * connected to the booking policy.
1302
+ *
1303
+ * ## See also
1304
+ *
1305
+ * To learn about working with *Query* endpoints, see
1306
+ * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)
1307
+ * and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
1308
+ * @param query - Information about filters, paging, and sorting. See the article about
1309
+ * booking policy filters
1310
+ * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policies/supported-filters))
1311
+ * for all supported filters and sorting options.
1312
+ * @public
1313
+ * @documentationMaturity preview
1314
+ * @requiredField query
1315
+ * @permissionId BOOKINGS.BOOKING_POLICY_READ
1316
+ * @permissionId BOOKINGS.SERVICES_READ
1317
+ * @permissionScope Read Bookings - Public Data
1318
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
1319
+ * @permissionScope Manage Bookings Services and Settings
1320
+ * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1321
+ * @permissionScope Manage Bookings
1322
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1323
+ * @permissionScope Read Bookings - Including Participants
1324
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1325
+ * @permissionScope Read Bookings - all read permissions
1326
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
1327
+ * @permissionScope Manage Bookings - all permissions
1328
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1329
+ * @permissionScope Read Bookings - Public Data
1330
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
1331
+ * @permissionScope Manage Bookings Services and Settings
1332
+ * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1333
+ * @permissionScope Manage Bookings
1334
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1335
+ * @permissionScope Read Bookings - Including Participants
1336
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1337
+ * @permissionScope Read Bookings - all read permissions
1338
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
1339
+ * @permissionScope Manage Bookings - all permissions
1340
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1341
+ * @applicableIdentity APP
1342
+ * @applicableIdentity VISITOR
1343
+ * @fqn wix.bookings.services.v2.ServicesService.QueryPolicies
1344
+ */
1345
+ export async function queryPolicies(query) {
1346
+ // @ts-ignore
1347
+ const { httpClient, sideEffects } = arguments[1];
1348
+ const payload = renameKeysFromSDKRequestToRESTRequest({ query: query });
1349
+ const reqOpts = ambassadorWixBookingsServicesV2Service.queryPolicies(payload);
1350
+ sideEffects?.onSiteCall?.();
1351
+ try {
1352
+ const result = await httpClient.request(reqOpts);
1353
+ sideEffects?.onSuccess?.(result);
1354
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1355
+ {
1356
+ transformFn: transformRESTImageToSDKImage,
1357
+ paths: [
1358
+ { path: 'bookingPolicies.services.media.items.image' },
1359
+ { path: 'bookingPolicies.services.media.mainMedia.image' },
1360
+ { path: 'bookingPolicies.services.media.coverMedia.image' },
1361
+ { path: 'bookingPolicies.services.staffMembers.mainMedia.image' },
1362
+ {
1363
+ path: 'bookingPolicies.services.staffMemberDetails.staffMembers.mainMedia.image',
1364
+ },
1365
+ { path: 'bookingPolicies.connectedServices.media.items.image' },
1366
+ { path: 'bookingPolicies.connectedServices.media.mainMedia.image' },
1367
+ {
1368
+ path: 'bookingPolicies.connectedServices.media.coverMedia.image',
1369
+ },
1370
+ {
1371
+ path: 'bookingPolicies.connectedServices.staffMembers.mainMedia.image',
1372
+ },
1373
+ {
1374
+ path: 'bookingPolicies.connectedServices.staffMemberDetails.staffMembers.mainMedia.image',
1375
+ },
1376
+ ],
1377
+ },
1378
+ {
1379
+ transformFn: transformRESTAddressToSDKAddress,
1380
+ paths: [
1381
+ { path: 'bookingPolicies.services.locations.calculatedAddress' },
1382
+ { path: 'bookingPolicies.services.locations.business.address' },
1383
+ { path: 'bookingPolicies.services.locations.custom.address' },
1384
+ {
1385
+ path: 'bookingPolicies.connectedServices.locations.calculatedAddress',
1386
+ },
1387
+ {
1388
+ path: 'bookingPolicies.connectedServices.locations.business.address',
1389
+ },
1390
+ {
1391
+ path: 'bookingPolicies.connectedServices.locations.custom.address',
1392
+ },
1393
+ ],
1394
+ },
1395
+ {
1396
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1397
+ paths: [
1398
+ { path: 'bookingPolicies.services.urls.servicePage' },
1399
+ { path: 'bookingPolicies.services.urls.bookingPage' },
1400
+ { path: 'bookingPolicies.services.urls.calendarPage' },
1401
+ { path: 'bookingPolicies.connectedServices.urls.servicePage' },
1402
+ { path: 'bookingPolicies.connectedServices.urls.bookingPage' },
1403
+ { path: 'bookingPolicies.connectedServices.urls.calendarPage' },
1404
+ ],
1405
+ },
1406
+ ]));
1407
+ }
1408
+ catch (err) {
1409
+ const transformedError = sdkTransformError(err, {
1410
+ spreadPathsToArguments: {},
1411
+ explicitPathsToArguments: { query: '$[0]' },
1412
+ singleArgumentUnchanged: false,
1413
+ }, ['query']);
1414
+ sideEffects?.onError?.(err);
1415
+ throw transformedError;
1416
+ }
1417
+ }
1418
+ /**
1419
+ * Retrieves a list of up to 100 booking forms
1420
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/forms/forms/introduction) | [REST](https://dev.wix.com/docs/rest/crm/forms/forms/introduction)),
1421
+ * and information about the services that are connected to them,
1422
+ * given the provided filtering, paging, and sorting.
1423
+ *
1424
+ *
1425
+ * ## Defaults
1426
+ *
1427
+ * Query Booking Forms has the following default settings, which you can override:
1428
+ *
1429
+ * + Sorted by `id` in ascending order.
1430
+ * + `cursorPaging.limit` set to `100`.
1431
+ *
1432
+ * ## Filters
1433
+ *
1434
+ * For a complete list of supported filters, refer to **Forms API: Supported Filters**
1435
+ * ([REST](https://dev.wix.com/docs/rest/crm/forms/forms/introduction/supported-filters)).
1436
+ *
1437
+ * When using date filters, you must use
1438
+ * [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).
1439
+ *
1440
+ * ## Returned services
1441
+ *
1442
+ * If a booking policy is connected to more than 5 services, only a subset of
1443
+ * these service IDs and names is returned. The `bookingForms.totalServiceCount`
1444
+ * values indicate the total number of services linked to each form. You can call Query Services
1445
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/query-services) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/query-services))
1446
+ * and specify the relevant form ID in the filter to retrieve all services
1447
+ * connected to the booking form.
1448
+ *
1449
+ * ## Default booking forms
1450
+ *
1451
+ * By default, all Wix Bookings services use a standard booking form. To retrieve
1452
+ * a site's default booking form with Query Booking Forms, specify
1453
+ * `{"conditionalFields": ["DEFAULT_BOOKING_FORM"]}`.
1454
+ *
1455
+ * ## See also
1456
+ *
1457
+ * To learn about working with *Query* endpoints, see
1458
+ * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)
1459
+ * and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
1460
+ * @param query - Information about filters, paging, and sorting. See the article about
1461
+ * form filters ([REST](https://dev.wix.com/docs/rest/crm/forms/forms/introduction/supported-filters))
1462
+ * for all supported filters and sorting options.
1463
+ * @public
1464
+ * @requiredField query
1465
+ * @permissionId BOOKINGS.SERVICE_BOOKING_FORMS_READ
1466
+ * @permissionId BOOKINGS.SERVICES_READ
1467
+ * @permissionScope Manage Bookings
1468
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1469
+ * @permissionScope Manage Bookings - all permissions
1470
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1471
+ * @permissionScope Read Bookings - Public Data
1472
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
1473
+ * @permissionScope Manage Bookings Services and Settings
1474
+ * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1475
+ * @permissionScope Manage Bookings
1476
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1477
+ * @permissionScope Read Bookings - Including Participants
1478
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1479
+ * @permissionScope Read Bookings - all read permissions
1480
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
1481
+ * @permissionScope Manage Bookings - all permissions
1482
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1483
+ * @applicableIdentity APP
1484
+ * @applicableIdentity VISITOR
1485
+ * @fqn wix.bookings.services.v2.ServicesService.QueryBookingForms
1486
+ */
1487
+ export async function queryBookingForms(query, options) {
1488
+ // @ts-ignore
1489
+ const { httpClient, sideEffects } = arguments[2];
1490
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1491
+ query: query,
1492
+ conditionalFields: options?.conditionalFields,
1493
+ });
1494
+ const reqOpts = ambassadorWixBookingsServicesV2Service.queryBookingForms(payload);
1495
+ sideEffects?.onSiteCall?.();
1496
+ try {
1497
+ const result = await httpClient.request(reqOpts);
1498
+ sideEffects?.onSuccess?.(result);
1499
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1500
+ }
1501
+ catch (err) {
1502
+ const transformedError = sdkTransformError(err, {
1503
+ spreadPathsToArguments: {},
1504
+ explicitPathsToArguments: {
1505
+ query: '$[0]',
1506
+ conditionalFields: '$[1].conditionalFields',
1507
+ },
1508
+ singleArgumentUnchanged: false,
1509
+ }, ['query', 'options']);
1510
+ sideEffects?.onError?.(err);
1511
+ throw transformedError;
1512
+ }
1513
+ }
1514
+ /**
1515
+ * Counts how many services match the given filter.
1516
+ *
1517
+ *
1518
+ * Refer to the supported filters article
1519
+ * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/filtering-and-sorting#filtering))
1520
+ * for more details.
1521
+ *
1522
+ * To learn about working with filters in general, see
1523
+ * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters)
1524
+ * @public
1525
+ * @permissionId BOOKINGS.SERVICES_COUNT
1526
+ * @permissionScope Read Bookings - Public Data
1527
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
1528
+ * @permissionScope Manage Bookings Services and Settings
1529
+ * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1530
+ * @permissionScope Manage Bookings
1531
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1532
+ * @permissionScope Read Bookings - Including Participants
1533
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1534
+ * @permissionScope Read Bookings - all read permissions
1535
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
1536
+ * @permissionScope Manage Bookings - all permissions
1537
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1538
+ * @applicableIdentity APP
1539
+ * @applicableIdentity VISITOR
1540
+ * @fqn wix.bookings.services.v2.ServicesService.CountServices
1541
+ */
1542
+ export async function countServices(options) {
1543
+ // @ts-ignore
1544
+ const { httpClient, sideEffects } = arguments[1];
1545
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1546
+ filter: options?.filter,
1547
+ });
1548
+ const reqOpts = ambassadorWixBookingsServicesV2Service.countServices(payload);
1549
+ sideEffects?.onSiteCall?.();
1550
+ try {
1551
+ const result = await httpClient.request(reqOpts);
1552
+ sideEffects?.onSuccess?.(result);
1553
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1554
+ }
1555
+ catch (err) {
1556
+ const transformedError = sdkTransformError(err, {
1557
+ spreadPathsToArguments: {},
1558
+ explicitPathsToArguments: { filter: '$[0].filter' },
1559
+ singleArgumentUnchanged: false,
1560
+ }, ['options']);
1561
+ sideEffects?.onError?.(err);
1562
+ throw transformedError;
1563
+ }
1564
+ }
1565
+ /**
1566
+ * Retrieves 3 separate lists of business, custom, and customer locations
1567
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction)),
1568
+ * given the provided filtering, and whether each location is connected to at
1569
+ * least one of the site's services.
1570
+ *
1571
+ *
1572
+ * ## Defaults
1573
+ *
1574
+ * Query Locations has the following default setting, which you can't override:
1575
+ * Sorted by `id` in ascending order.
1576
+ *
1577
+ * ## Filters
1578
+ *
1579
+ * For a complete list of supported filters, refer to the supported filters article
1580
+ * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/filtering-and-sorting#filtering)).
1581
+ *
1582
+ * When using date filters, you must use
1583
+ * [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).
1584
+ *
1585
+ * ## See also
1586
+ *
1587
+ * To learn about working with *Query* endpoints, see
1588
+ * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)
1589
+ * and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
1590
+ * @public
1591
+ * @documentationMaturity preview
1592
+ * @permissionId BOOKINGS.SERVICES_READ
1593
+ * @permissionScope Read Bookings - Public Data
1594
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
1595
+ * @permissionScope Manage Bookings Services and Settings
1596
+ * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1597
+ * @permissionScope Manage Bookings
1598
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1599
+ * @permissionScope Read Bookings - Including Participants
1600
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1601
+ * @permissionScope Read Bookings - all read permissions
1602
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
1603
+ * @permissionScope Manage Bookings - all permissions
1604
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1605
+ * @applicableIdentity APP
1606
+ * @applicableIdentity VISITOR
1607
+ * @fqn wix.bookings.services.v2.ServicesService.QueryLocations
1608
+ */
1609
+ export async function queryLocations(options) {
1610
+ // @ts-ignore
1611
+ const { httpClient, sideEffects } = arguments[1];
1612
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1613
+ filter: options?.filter,
1614
+ });
1615
+ const reqOpts = ambassadorWixBookingsServicesV2Service.queryLocations(payload);
1616
+ sideEffects?.onSiteCall?.();
1617
+ try {
1618
+ const result = await httpClient.request(reqOpts);
1619
+ sideEffects?.onSuccess?.(result);
1620
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1621
+ {
1622
+ transformFn: transformRESTAddressToSDKAddress,
1623
+ paths: [
1624
+ { path: 'businessLocations.locations.calculatedAddress' },
1625
+ { path: 'businessLocations.locations.business.address' },
1626
+ { path: 'businessLocations.locations.custom.address' },
1627
+ ],
1628
+ },
1629
+ ]));
1630
+ }
1631
+ catch (err) {
1632
+ const transformedError = sdkTransformError(err, {
1633
+ spreadPathsToArguments: {},
1634
+ explicitPathsToArguments: { filter: '$[0].filter' },
1635
+ singleArgumentUnchanged: false,
1636
+ }, ['options']);
1637
+ sideEffects?.onError?.(err);
1638
+ throw transformedError;
1639
+ }
1640
+ }
1641
+ /**
1642
+ * Retrieves a list of service categories
1643
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/categories/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/categories-v2/introduction)),
1644
+ * given the provided filtering.
1645
+ *
1646
+ *
1647
+ * ## Defaults
1648
+ *
1649
+ * Query Categories has the following default setting, which you can't override:
1650
+ * Sorted by `id` in ascending order.
1651
+ *
1652
+ * ## Filters
1653
+ *
1654
+ * For a complete list of supported filters, refer to the supported filters article
1655
+ * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/filtering-and-sorting#filtering)).
1656
+ *
1657
+ * When using date filters, you must use
1658
+ * [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).
1659
+ *
1660
+ * ## See also
1661
+ *
1662
+ * To learn about working with *Query* endpoints, see
1663
+ * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)
1664
+ * and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
1665
+ * @public
1666
+ * @documentationMaturity preview
1667
+ * @permissionId BOOKINGS.SERVICES_READ
1668
+ * @permissionScope Read Bookings - Public Data
1669
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
1670
+ * @permissionScope Manage Bookings Services and Settings
1671
+ * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1672
+ * @permissionScope Manage Bookings
1673
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1674
+ * @permissionScope Read Bookings - Including Participants
1675
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1676
+ * @permissionScope Read Bookings - all read permissions
1677
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
1678
+ * @permissionScope Manage Bookings - all permissions
1679
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1680
+ * @applicableIdentity APP
1681
+ * @applicableIdentity VISITOR
1682
+ * @fqn wix.bookings.services.v2.ServicesService.QueryCategories
1683
+ */
1684
+ export async function queryCategories(options) {
1685
+ // @ts-ignore
1686
+ const { httpClient, sideEffects } = arguments[1];
1687
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1688
+ filter: options?.filter,
1689
+ });
1690
+ const reqOpts = ambassadorWixBookingsServicesV2Service.queryCategories(payload);
1691
+ sideEffects?.onSiteCall?.();
1692
+ try {
1693
+ const result = await httpClient.request(reqOpts);
1694
+ sideEffects?.onSuccess?.(result);
1695
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1696
+ }
1697
+ catch (err) {
1698
+ const transformedError = sdkTransformError(err, {
1699
+ spreadPathsToArguments: {},
1700
+ explicitPathsToArguments: { filter: '$[0].filter' },
1701
+ singleArgumentUnchanged: false,
1702
+ }, ['options']);
1703
+ sideEffects?.onError?.(err);
1704
+ throw transformedError;
1705
+ }
1706
+ }
1707
+ /**
1708
+ * Replaces the list of the locations
1709
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))
1710
+ * where the business offers the service.
1711
+ *
1712
+ *
1713
+ * ## Consequences for customers
1714
+ *
1715
+ * Removing a service location may impact existing sessions and their
1716
+ * participants. If you remove at least one service location, you must
1717
+ * specify `removedLocationSessionsAction` to indicate what happens to all
1718
+ * future sessions scheduled at this location.
1719
+ *
1720
+ * - **Keep existing location**: If you want to retain future sessions at their
1721
+ * originally scheduled location, specify
1722
+ * `{"removedLocationSessionsAction.action": "KEEP_AT_CURRENT_LOCATION"}`.
1723
+ * This ensures nothing changes for the customer, but the business must be
1724
+ * able to provide access to the removed location in the future.
1725
+ * - **Update location**: If you want to update the location for future sessions
1726
+ * scheduled at the removed location, specify
1727
+ * `{"removedLocationSessionsAction.action": "MOVE_TO_LOCATION"}` and
1728
+ * `moveToLocationOptions.newLocation`.
1729
+ *
1730
+ * You can't mix and match to keep some sessions at the previous location while
1731
+ * moving other sessions to an updated location.
1732
+ *
1733
+ * Past session details aren't changed, no matter which option you choose for
1734
+ * future sessions.
1735
+ *
1736
+ * Future sessions scheduled for a location defined by the customer are also not
1737
+ * updated.
1738
+ *
1739
+ * ## Specify location details
1740
+ *
1741
+ * Depending on whether the new or updated location is a business or custom location,
1742
+ * you need to specify different fields.
1743
+ *
1744
+ * - **Business location**: Specify the relevant location ID
1745
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))
1746
+ * in `locations.business.id`.
1747
+ * - **Custom location**: Specify the complete address object as
1748
+ * `locations.custom.address`.
1749
+ *
1750
+ * ## Participant notifications
1751
+ *
1752
+ * You can specify a `participantNotification.message` that's immediately send
1753
+ * to all customers who had booked at a changed location. Ensure
1754
+ * `participantNotification.notifyParticipants` is set to `true` to send the
1755
+ * message.
1756
+ * @param serviceId - ID of the service.
1757
+ * @param locations - List of locations replacing existing service locations. Omitting an existing location removes it from the service. Specify `removedLocationSessionsAction` to determine the handling of future sessions scheduled at that location.
1758
+ * @public
1759
+ * @documentationMaturity preview
1760
+ * @requiredField locations
1761
+ * @requiredField serviceId
1762
+ * @permissionId BOOKINGS.SERVICES_LOCATIONS_SET
1763
+ * @permissionScope Manage Bookings
1764
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1765
+ * @permissionScope Manage Bookings - all permissions
1766
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1767
+ * @applicableIdentity APP
1768
+ * @fqn wix.bookings.services.v2.ServicesService.SetServiceLocations
1769
+ */
1770
+ export async function setServiceLocations(serviceId, locations, options) {
1771
+ // @ts-ignore
1772
+ const { httpClient, sideEffects } = arguments[3];
1773
+ const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
1774
+ serviceId: serviceId,
1775
+ locations: locations,
1776
+ removedLocationSessionsAction: options?.removedLocationSessionsAction,
1777
+ participantNotification: options?.participantNotification,
1778
+ }), [
1779
+ {
1780
+ transformFn: transformSDKAddressToRESTAddress,
1781
+ paths: [
1782
+ { path: 'locations.calculatedAddress' },
1783
+ { path: 'locations.business.address' },
1784
+ { path: 'locations.custom.address' },
1785
+ {
1786
+ path: 'removedLocationSessionsAction.moveToLocationOptions.newLocation.calculatedAddress',
1787
+ },
1788
+ {
1789
+ path: 'removedLocationSessionsAction.moveToLocationOptions.newLocation.business.address',
1790
+ },
1791
+ {
1792
+ path: 'removedLocationSessionsAction.moveToLocationOptions.newLocation.custom.address',
1793
+ },
1794
+ ],
1795
+ },
1796
+ ]);
1797
+ const reqOpts = ambassadorWixBookingsServicesV2Service.setServiceLocations(payload);
1798
+ sideEffects?.onSiteCall?.();
1799
+ try {
1800
+ const result = await httpClient.request(reqOpts);
1801
+ sideEffects?.onSuccess?.(result);
1802
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1803
+ {
1804
+ transformFn: transformRESTImageToSDKImage,
1805
+ paths: [
1806
+ { path: 'service.media.items.image' },
1807
+ { path: 'service.media.mainMedia.image' },
1808
+ { path: 'service.media.coverMedia.image' },
1809
+ { path: 'service.staffMembers.mainMedia.image' },
1810
+ { path: 'service.staffMemberDetails.staffMembers.mainMedia.image' },
1811
+ ],
1812
+ },
1813
+ {
1814
+ transformFn: transformRESTAddressToSDKAddress,
1815
+ paths: [
1816
+ { path: 'service.locations.calculatedAddress' },
1817
+ { path: 'service.locations.business.address' },
1818
+ { path: 'service.locations.custom.address' },
1819
+ ],
1820
+ },
1821
+ {
1822
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1823
+ paths: [
1824
+ { path: 'service.urls.servicePage' },
1825
+ { path: 'service.urls.bookingPage' },
1826
+ { path: 'service.urls.calendarPage' },
1827
+ ],
1828
+ },
1829
+ ]));
1830
+ }
1831
+ catch (err) {
1832
+ const transformedError = sdkTransformError(err, {
1833
+ spreadPathsToArguments: {},
1834
+ explicitPathsToArguments: {
1835
+ serviceId: '$[0]',
1836
+ locations: '$[1]',
1837
+ removedLocationSessionsAction: '$[2].removedLocationSessionsAction',
1838
+ participantNotification: '$[2].participantNotification',
1839
+ },
1840
+ singleArgumentUnchanged: false,
1841
+ }, ['serviceId', 'locations', 'options']);
1842
+ sideEffects?.onError?.(err);
1843
+ throw transformedError;
1844
+ }
1845
+ }
1846
+ /**
1847
+ * Adds a list of pricing plans ID
1848
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/plans/introduction) | [REST](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans/plan-object))
1849
+ * to a service's `payment.pricingPlanIds` array.
1850
+ *
1851
+ *
1852
+ * The call doesn't validate whether the service's `payment.options.pricingPlan`
1853
+ * is set to `true`. If it's set to `false`, customers aren't able to pay
1854
+ * for their bookings using pricing plans. You can call Update Service
1855
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/update-service) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/update-service))
1856
+ * to change a service's supported payment methods.
1857
+ * @param serviceId - ID of the service to update.
1858
+ * @param pricingPlanIds - IDs of the pricing plans
1859
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/plans/introduction) | [REST](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans/plan-object))
1860
+ * to add to the service's `payment.pricingPlanIds` array.
1861
+ * @public
1862
+ * @requiredField pricingPlanIds
1863
+ * @requiredField serviceId
1864
+ * @permissionId BOOKINGS.SERVICES_PRICING_PLANS_ADD
1865
+ * @permissionScope Manage Bookings
1866
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1867
+ * @permissionScope Manage Bookings - all permissions
1868
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1869
+ * @applicableIdentity APP
1870
+ * @fqn wix.bookings.services.v2.ServicesService.EnablePricingPlansForService
1871
+ */
1872
+ export async function enablePricingPlansForService(serviceId, pricingPlanIds) {
1873
+ // @ts-ignore
1874
+ const { httpClient, sideEffects } = arguments[2];
1875
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1876
+ serviceId: serviceId,
1877
+ pricingPlanIds: pricingPlanIds,
1878
+ });
1879
+ const reqOpts = ambassadorWixBookingsServicesV2Service.enablePricingPlansForService(payload);
1880
+ sideEffects?.onSiteCall?.();
1881
+ try {
1882
+ const result = await httpClient.request(reqOpts);
1883
+ sideEffects?.onSuccess?.(result);
1884
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1885
+ {
1886
+ transformFn: transformRESTImageToSDKImage,
1887
+ paths: [
1888
+ { path: 'service.media.items.image' },
1889
+ { path: 'service.media.mainMedia.image' },
1890
+ { path: 'service.media.coverMedia.image' },
1891
+ { path: 'service.staffMembers.mainMedia.image' },
1892
+ { path: 'service.staffMemberDetails.staffMembers.mainMedia.image' },
1893
+ ],
1894
+ },
1895
+ {
1896
+ transformFn: transformRESTAddressToSDKAddress,
1897
+ paths: [
1898
+ { path: 'service.locations.calculatedAddress' },
1899
+ { path: 'service.locations.business.address' },
1900
+ { path: 'service.locations.custom.address' },
1901
+ ],
1902
+ },
1903
+ {
1904
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1905
+ paths: [
1906
+ { path: 'service.urls.servicePage' },
1907
+ { path: 'service.urls.bookingPage' },
1908
+ { path: 'service.urls.calendarPage' },
1909
+ ],
1910
+ },
1911
+ ]));
1912
+ }
1913
+ catch (err) {
1914
+ const transformedError = sdkTransformError(err, {
1915
+ spreadPathsToArguments: {},
1916
+ explicitPathsToArguments: { serviceId: '$[0]', pricingPlanIds: '$[1]' },
1917
+ singleArgumentUnchanged: false,
1918
+ }, ['serviceId', 'pricingPlanIds']);
1919
+ sideEffects?.onError?.(err);
1920
+ throw transformedError;
1921
+ }
1922
+ }
1923
+ /**
1924
+ * Removes a list of pricing plans ID
1925
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/plans/introduction) | [REST](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans/plan-object))
1926
+ * from a service's `payment.pricingPlanIds` array.
1927
+ *
1928
+ *
1929
+ * If you remove all pricing plan IDs from `payment.pricingPlanIds` and the
1930
+ * service supports only payments by pricing plan, customers will no longer be
1931
+ * able to book the service, as they will have no payment options available.
1932
+ * @param serviceId - ID of the service to update.
1933
+ * @public
1934
+ * @requiredField serviceId
1935
+ * @permissionId BOOKINGS.SERVICES_PRICING_PLANS_REMOVE
1936
+ * @permissionScope Manage Bookings
1937
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1938
+ * @permissionScope Manage Bookings - all permissions
1939
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1940
+ * @applicableIdentity APP
1941
+ * @fqn wix.bookings.services.v2.ServicesService.DisablePricingPlansForService
1942
+ */
1943
+ export async function disablePricingPlansForService(serviceId, options) {
1944
+ // @ts-ignore
1945
+ const { httpClient, sideEffects } = arguments[2];
1946
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1947
+ serviceId: serviceId,
1948
+ pricingPlanIds: options?.pricingPlanIds,
1949
+ });
1950
+ const reqOpts = ambassadorWixBookingsServicesV2Service.disablePricingPlansForService(payload);
1951
+ sideEffects?.onSiteCall?.();
1952
+ try {
1953
+ const result = await httpClient.request(reqOpts);
1954
+ sideEffects?.onSuccess?.(result);
1955
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1956
+ {
1957
+ transformFn: transformRESTImageToSDKImage,
1958
+ paths: [
1959
+ { path: 'service.media.items.image' },
1960
+ { path: 'service.media.mainMedia.image' },
1961
+ { path: 'service.media.coverMedia.image' },
1962
+ { path: 'service.staffMembers.mainMedia.image' },
1963
+ { path: 'service.staffMemberDetails.staffMembers.mainMedia.image' },
1964
+ ],
1965
+ },
1966
+ {
1967
+ transformFn: transformRESTAddressToSDKAddress,
1968
+ paths: [
1969
+ { path: 'service.locations.calculatedAddress' },
1970
+ { path: 'service.locations.business.address' },
1971
+ { path: 'service.locations.custom.address' },
1972
+ ],
1973
+ },
1974
+ {
1975
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1976
+ paths: [
1977
+ { path: 'service.urls.servicePage' },
1978
+ { path: 'service.urls.bookingPage' },
1979
+ { path: 'service.urls.calendarPage' },
1980
+ ],
1981
+ },
1982
+ ]));
1983
+ }
1984
+ catch (err) {
1985
+ const transformedError = sdkTransformError(err, {
1986
+ spreadPathsToArguments: {},
1987
+ explicitPathsToArguments: {
1988
+ serviceId: '$[0]',
1989
+ pricingPlanIds: '$[1].pricingPlanIds',
1990
+ },
1991
+ singleArgumentUnchanged: false,
1992
+ }, ['serviceId', 'options']);
1993
+ sideEffects?.onError?.(err);
1994
+ throw transformedError;
1995
+ }
1996
+ }
1997
+ /**
1998
+ * Sets a new active slug for the service.
1999
+ *
2000
+ *
2001
+ * The call fails if at least one of these conditions is met:
2002
+ * - The slug doesn't adheres to the supported format.
2003
+ * - Another service is currently using the slug.
2004
+ * - Another service has used the slug in the past.
2005
+ * @param serviceId - ID of the service for which to update the active slug.
2006
+ * @public
2007
+ * @requiredField serviceId
2008
+ * @permissionId BOOKINGS.SERVICES_CUSTOM_SLUGS_SET
2009
+ * @permissionScope Manage Bookings
2010
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
2011
+ * @permissionScope Manage Bookings - all permissions
2012
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
2013
+ * @applicableIdentity APP
2014
+ * @fqn wix.bookings.services.v2.ServicesService.SetCustomSlug
2015
+ */
2016
+ export async function setCustomSlug(serviceId, options) {
2017
+ // @ts-ignore
2018
+ const { httpClient, sideEffects } = arguments[2];
2019
+ const payload = renameKeysFromSDKRequestToRESTRequest({
2020
+ serviceId: serviceId,
2021
+ slug: options?.slug,
2022
+ });
2023
+ const reqOpts = ambassadorWixBookingsServicesV2Service.setCustomSlug(payload);
2024
+ sideEffects?.onSiteCall?.();
2025
+ try {
2026
+ const result = await httpClient.request(reqOpts);
2027
+ sideEffects?.onSuccess?.(result);
2028
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
2029
+ {
2030
+ transformFn: transformRESTImageToSDKImage,
2031
+ paths: [
2032
+ { path: 'service.media.items.image' },
2033
+ { path: 'service.media.mainMedia.image' },
2034
+ { path: 'service.media.coverMedia.image' },
2035
+ { path: 'service.staffMembers.mainMedia.image' },
2036
+ { path: 'service.staffMemberDetails.staffMembers.mainMedia.image' },
2037
+ ],
2038
+ },
2039
+ {
2040
+ transformFn: transformRESTAddressToSDKAddress,
2041
+ paths: [
2042
+ { path: 'service.locations.calculatedAddress' },
2043
+ { path: 'service.locations.business.address' },
2044
+ { path: 'service.locations.custom.address' },
2045
+ ],
2046
+ },
2047
+ {
2048
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
2049
+ paths: [
2050
+ { path: 'service.urls.servicePage' },
2051
+ { path: 'service.urls.bookingPage' },
2052
+ { path: 'service.urls.calendarPage' },
2053
+ ],
2054
+ },
2055
+ ]));
2056
+ }
2057
+ catch (err) {
2058
+ const transformedError = sdkTransformError(err, {
2059
+ spreadPathsToArguments: {},
2060
+ explicitPathsToArguments: { serviceId: '$[0]', slug: '$[1].slug' },
2061
+ singleArgumentUnchanged: false,
2062
+ }, ['serviceId', 'options']);
2063
+ sideEffects?.onError?.(err);
2064
+ throw transformedError;
2065
+ }
2066
+ }
2067
+ /**
2068
+ * Checks whether a custom slug is validate for the service.
2069
+ *
2070
+ *
2071
+ * The checks include:
2072
+ * - The slug adheres to the supported format.
2073
+ * - No other service is currently using the slug.
2074
+ * - No other service has used the slug in the past.
2075
+ *
2076
+ * The call fails if at least one of the checks fails.
2077
+ * @param serviceId - IO of the service to check custom slug validity for.
2078
+ * @public
2079
+ * @requiredField serviceId
2080
+ * @permissionId BOOKINGS.SERVICES_CUSTOM_SLUGS_SET
2081
+ * @permissionScope Manage Bookings
2082
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
2083
+ * @permissionScope Manage Bookings - all permissions
2084
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
2085
+ * @applicableIdentity APP
2086
+ * @fqn wix.bookings.services.v2.ServicesService.ValidateSlug
2087
+ */
2088
+ export async function validateSlug(serviceId, options) {
2089
+ // @ts-ignore
2090
+ const { httpClient, sideEffects } = arguments[2];
2091
+ const payload = renameKeysFromSDKRequestToRESTRequest({
2092
+ serviceId: serviceId,
2093
+ slug: options?.slug,
2094
+ });
2095
+ const reqOpts = ambassadorWixBookingsServicesV2Service.validateSlug(payload);
2096
+ sideEffects?.onSiteCall?.();
2097
+ try {
2098
+ const result = await httpClient.request(reqOpts);
2099
+ sideEffects?.onSuccess?.(result);
2100
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
2101
+ }
2102
+ catch (err) {
2103
+ const transformedError = sdkTransformError(err, {
2104
+ spreadPathsToArguments: {},
2105
+ explicitPathsToArguments: { serviceId: '$[0]', slug: '$[1].slug' },
2106
+ singleArgumentUnchanged: false,
2107
+ }, ['serviceId', 'options']);
2108
+ sideEffects?.onError?.(err);
2109
+ throw transformedError;
2110
+ }
2111
+ }
2112
+ /**
2113
+ * Clones a service.
2114
+ *
2115
+ *
2116
+ * ## Connected entities
2117
+ *
2118
+ * By default, not all entities connected to the service are cloned.
2119
+ *
2120
+ * ### Schedule
2121
+ *
2122
+ * Wix Bookings automatically creates a new active *schedule*
2123
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/schedules/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction))
2124
+ * for the cloned service. If Wix Bookings can't create this schedule, the
2125
+ * Clone Service* call fails.
2126
+ *
2127
+ * - __For appointment-based services__: Future appointments aren't added to the
2128
+ * cloned service's schedule. Use the *Events API*
2129
+ * ([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))
2130
+ * to add them as needed.
2131
+ * - __For classes and courses__: Future one-time events aren't added to the
2132
+ * cloned service's schedule, while future recurring events are added
2133
+ * asynchronously. The *Clone Service* call always succeeds, whether or not
2134
+ * recurring events are added.
2135
+ * If the response includes `RECURRING_EVENTS` in the `errors` array, it means the
2136
+ * cloned service doesn't have future recurring events, even though the original
2137
+ * service does. You can either delete the cloned service and try again or use
2138
+ * the *Events API*
2139
+ * ([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))
2140
+ * to add missing events to the schedule.
2141
+ *
2142
+ * Wix Bookings never adds past events to the cloned service's schedule.
2143
+ *
2144
+ * ### Service options and variants
2145
+ *
2146
+ * If the original service has variants
2147
+ * ([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)),
2148
+ * they're cloned asynchronously. The *Clone Service* call always succeeds,
2149
+ * regardless of whether variants were cloned.
2150
+ *
2151
+ * If the response includes `OPTIONS_AND_VARIANTS` in the `errors` array, the cloned
2152
+ * service doesn't have variants, even though the original service does. You can
2153
+ * delete the cloned service and call *Clone Service* again, or use the
2154
+ * Service Options And Variants API*
2155
+ * ([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))
2156
+ * to add variants.
2157
+ *
2158
+ * ### Booking form
2159
+ *
2160
+ * The original service's booking form isn't cloned, whether it's
2161
+ * the default or a custom booking form.
2162
+ *
2163
+ * ### Pricing plans
2164
+ *
2165
+ * If the original service's accepts payments via pricing plans
2166
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/plans/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/pricing-plans/pricing-plans/plans/introduction)),
2167
+ * the cloned service's `payment.options.pricingPlan` is also set to `true`. To
2168
+ * accept specific pricing plans, call *Enable Pricing Plans For Service*
2169
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/enable-pricing-plans-for-service) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/enable-pricing-plans-for-service)),
2170
+ * after cloning the service. If the original service accepts only
2171
+ * pricing plan payments and you don't call *Enable Pricing Plans For Service*
2172
+ * after cloning the service, customers will be unable to book the service.
2173
+ * @param sourceServiceId - ID of the service to clone.
2174
+ * @public
2175
+ * @requiredField sourceServiceId
2176
+ * @permissionId BOOKINGS.SERVICES_CREATE
2177
+ * @permissionScope Manage Bookings
2178
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
2179
+ * @permissionScope Manage Bookings - all permissions
2180
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
2181
+ * @applicableIdentity APP
2182
+ * @fqn wix.bookings.services.v2.ServicesService.CloneService
2183
+ */
2184
+ export async function cloneService(sourceServiceId) {
2185
+ // @ts-ignore
2186
+ const { httpClient, sideEffects } = arguments[1];
2187
+ const payload = renameKeysFromSDKRequestToRESTRequest({
2188
+ sourceServiceId: sourceServiceId,
2189
+ });
2190
+ const reqOpts = ambassadorWixBookingsServicesV2Service.cloneService(payload);
2191
+ sideEffects?.onSiteCall?.();
2192
+ try {
2193
+ const result = await httpClient.request(reqOpts);
2194
+ sideEffects?.onSuccess?.(result);
2195
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
2196
+ {
2197
+ transformFn: transformRESTImageToSDKImage,
2198
+ paths: [
2199
+ { path: 'service.media.items.image' },
2200
+ { path: 'service.media.mainMedia.image' },
2201
+ { path: 'service.media.coverMedia.image' },
2202
+ { path: 'service.staffMembers.mainMedia.image' },
2203
+ { path: 'service.staffMemberDetails.staffMembers.mainMedia.image' },
2204
+ ],
2205
+ },
2206
+ {
2207
+ transformFn: transformRESTAddressToSDKAddress,
2208
+ paths: [
2209
+ { path: 'service.locations.calculatedAddress' },
2210
+ { path: 'service.locations.business.address' },
2211
+ { path: 'service.locations.custom.address' },
2212
+ ],
2213
+ },
2214
+ {
2215
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
2216
+ paths: [
2217
+ { path: 'service.urls.servicePage' },
2218
+ { path: 'service.urls.bookingPage' },
2219
+ { path: 'service.urls.calendarPage' },
2220
+ ],
2221
+ },
2222
+ ]));
2223
+ }
2224
+ catch (err) {
2225
+ const transformedError = sdkTransformError(err, {
2226
+ spreadPathsToArguments: {},
2227
+ explicitPathsToArguments: { sourceServiceId: '$[0]' },
2228
+ singleArgumentUnchanged: false,
2229
+ }, ['sourceServiceId']);
2230
+ sideEffects?.onError?.(err);
2231
+ throw transformedError;
2232
+ }
2233
+ }
2234
+ //# sourceMappingURL=bookings-services-v2-service-services.universal.js.map