@wix/auto_sdk_bookings_services 1.0.32 → 1.0.34

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