@wix/auto_sdk_bookings_services 1.0.31 → 1.0.33

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 -5286
  53. package/build/cjs/src/bookings-services-v2-service-services.universal.js +0 -2298
  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 -5286
  79. package/build/es/src/bookings-services-v2-service-services.universal.js +0 -2250
  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 -5286
  104. package/build/internal/cjs/src/bookings-services-v2-service-services.universal.js +0 -2298
  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 -5286
  129. package/build/internal/es/src/bookings-services-v2-service-services.universal.js +0 -2250
  130. package/build/internal/es/src/bookings-services-v2-service-services.universal.js.map +0 -1
@@ -1,2250 +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
- * @permissionScope Picasso private app mega scope
410
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
411
- * @applicableIdentity APP
412
- * @returns Created service.
413
- * @fqn wix.bookings.services.v2.ServicesService.CreateService
414
- */
415
- export async function createService(service) {
416
- // @ts-ignore
417
- const { httpClient, sideEffects } = arguments[1];
418
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({ service: service }), [
419
- {
420
- transformFn: transformSDKImageToRESTImage,
421
- paths: [
422
- { path: 'service.media.items.image' },
423
- { path: 'service.media.mainMedia.image' },
424
- { path: 'service.media.coverMedia.image' },
425
- { path: 'service.staffMembers.mainMedia.image' },
426
- { path: 'service.staffMemberDetails.staffMembers.mainMedia.image' },
427
- ],
428
- },
429
- {
430
- transformFn: transformSDKAddressToRESTAddress,
431
- paths: [
432
- { path: 'service.locations.calculatedAddress' },
433
- { path: 'service.locations.business.address' },
434
- { path: 'service.locations.custom.address' },
435
- ],
436
- },
437
- {
438
- transformFn: transformSDKPageURLV2ToRESTPageURLV2,
439
- paths: [
440
- { path: 'service.urls.servicePage' },
441
- { path: 'service.urls.bookingPage' },
442
- { path: 'service.urls.calendarPage' },
443
- ],
444
- },
445
- ]);
446
- const reqOpts = ambassadorWixBookingsServicesV2Service.createService(payload);
447
- sideEffects?.onSiteCall?.();
448
- try {
449
- const result = await httpClient.request(reqOpts);
450
- sideEffects?.onSuccess?.(result);
451
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
452
- {
453
- transformFn: transformRESTImageToSDKImage,
454
- paths: [
455
- { path: 'service.media.items.image' },
456
- { path: 'service.media.mainMedia.image' },
457
- { path: 'service.media.coverMedia.image' },
458
- { path: 'service.staffMembers.mainMedia.image' },
459
- { path: 'service.staffMemberDetails.staffMembers.mainMedia.image' },
460
- ],
461
- },
462
- {
463
- transformFn: transformRESTAddressToSDKAddress,
464
- paths: [
465
- { path: 'service.locations.calculatedAddress' },
466
- { path: 'service.locations.business.address' },
467
- { path: 'service.locations.custom.address' },
468
- ],
469
- },
470
- {
471
- transformFn: transformRESTPageURLV2ToSDKPageURLV2,
472
- paths: [
473
- { path: 'service.urls.servicePage' },
474
- { path: 'service.urls.bookingPage' },
475
- { path: 'service.urls.calendarPage' },
476
- ],
477
- },
478
- ]))?.service;
479
- }
480
- catch (err) {
481
- const transformedError = sdkTransformError(err, {
482
- spreadPathsToArguments: {},
483
- explicitPathsToArguments: { service: '$[0]' },
484
- singleArgumentUnchanged: false,
485
- }, ['service']);
486
- sideEffects?.onError?.(err);
487
- throw transformedError;
488
- }
489
- }
490
- /**
491
- * Retrieves a service.
492
- * @param serviceId - ID of the service to retrieve.
493
- * @public
494
- * @requiredField serviceId
495
- * @permissionId BOOKINGS.SERVICES_READ
496
- * @permissionScope Read Bookings - Public Data
497
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
498
- * @permissionScope Manage Bookings Services and Settings
499
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
500
- * @permissionScope Manage Bookings
501
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
502
- * @permissionScope Read Bookings - Including Participants
503
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
504
- * @permissionScope Read Bookings - all read permissions
505
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
506
- * @permissionScope Manage Bookings - all permissions
507
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
508
- * @permissionScope Picasso private app mega scope
509
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
510
- * @applicableIdentity APP
511
- * @applicableIdentity VISITOR
512
- * @returns Retrieved service.
513
- * @fqn wix.bookings.services.v2.ServicesService.GetService
514
- */
515
- export async function getService(serviceId) {
516
- // @ts-ignore
517
- const { httpClient, sideEffects } = arguments[1];
518
- const payload = renameKeysFromSDKRequestToRESTRequest({
519
- serviceId: serviceId,
520
- });
521
- const reqOpts = ambassadorWixBookingsServicesV2Service.getService(payload);
522
- sideEffects?.onSiteCall?.();
523
- try {
524
- const result = await httpClient.request(reqOpts);
525
- sideEffects?.onSuccess?.(result);
526
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
527
- {
528
- transformFn: transformRESTImageToSDKImage,
529
- paths: [
530
- { path: 'service.media.items.image' },
531
- { path: 'service.media.mainMedia.image' },
532
- { path: 'service.media.coverMedia.image' },
533
- { path: 'service.staffMembers.mainMedia.image' },
534
- { path: 'service.staffMemberDetails.staffMembers.mainMedia.image' },
535
- ],
536
- },
537
- {
538
- transformFn: transformRESTAddressToSDKAddress,
539
- paths: [
540
- { path: 'service.locations.calculatedAddress' },
541
- { path: 'service.locations.business.address' },
542
- { path: 'service.locations.custom.address' },
543
- ],
544
- },
545
- {
546
- transformFn: transformRESTPageURLV2ToSDKPageURLV2,
547
- paths: [
548
- { path: 'service.urls.servicePage' },
549
- { path: 'service.urls.bookingPage' },
550
- { path: 'service.urls.calendarPage' },
551
- ],
552
- },
553
- ]))?.service;
554
- }
555
- catch (err) {
556
- const transformedError = sdkTransformError(err, {
557
- spreadPathsToArguments: {},
558
- explicitPathsToArguments: { serviceId: '$[0]' },
559
- singleArgumentUnchanged: false,
560
- }, ['serviceId']);
561
- sideEffects?.onError?.(err);
562
- throw transformedError;
563
- }
564
- }
565
- /**
566
- * Updates a service.
567
- *
568
- *
569
- * Each time the service is updated, `revision` increments by 1. You must
570
- * include the number of the existing revision when updating the service.
571
- * This ensures you're working with the latest service information and
572
- * prevents unintended overwrites.
573
- *
574
- * ## Session durations
575
- *
576
- * Specify `schedule.availabilityConstraints.sessionDurations`
577
- * only if you want to update it for appointment-based services without varied
578
- * pricing based on session length. Don't specify `schedule.availabilityConstraints.sessionDurations`
579
- * for all other appointment-based services, classes, or courses. See *Create Service*
580
- * ([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))
581
- * for more details.
582
- * @param _id - Service ID.
583
- * @public
584
- * @requiredField _id
585
- * @requiredField service
586
- * @requiredField service.revision
587
- * @permissionId BOOKINGS.SERVICES_UPDATE
588
- * @permissionScope Manage Bookings
589
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
590
- * @permissionScope Manage Bookings - all permissions
591
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
592
- * @permissionScope Picasso private app mega scope
593
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
594
- * @applicableIdentity APP
595
- * @returns Updated service.
596
- * @fqn wix.bookings.services.v2.ServicesService.UpdateService
597
- */
598
- export async function updateService(_id, service) {
599
- // @ts-ignore
600
- const { httpClient, sideEffects } = arguments[2];
601
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({ service: { ...service, id: _id } }), [
602
- {
603
- transformFn: transformSDKImageToRESTImage,
604
- paths: [
605
- { path: 'service.media.items.image' },
606
- { path: 'service.media.mainMedia.image' },
607
- { path: 'service.media.coverMedia.image' },
608
- { path: 'service.staffMembers.mainMedia.image' },
609
- { path: 'service.staffMemberDetails.staffMembers.mainMedia.image' },
610
- ],
611
- },
612
- {
613
- transformFn: transformSDKAddressToRESTAddress,
614
- paths: [
615
- { path: 'service.locations.calculatedAddress' },
616
- { path: 'service.locations.business.address' },
617
- { path: 'service.locations.custom.address' },
618
- ],
619
- },
620
- {
621
- transformFn: transformSDKPageURLV2ToRESTPageURLV2,
622
- paths: [
623
- { path: 'service.urls.servicePage' },
624
- { path: 'service.urls.bookingPage' },
625
- { path: 'service.urls.calendarPage' },
626
- ],
627
- },
628
- ]);
629
- const reqOpts = ambassadorWixBookingsServicesV2Service.updateService(payload);
630
- sideEffects?.onSiteCall?.();
631
- try {
632
- const result = await httpClient.request(reqOpts);
633
- sideEffects?.onSuccess?.(result);
634
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
635
- {
636
- transformFn: transformRESTImageToSDKImage,
637
- paths: [
638
- { path: 'service.media.items.image' },
639
- { path: 'service.media.mainMedia.image' },
640
- { path: 'service.media.coverMedia.image' },
641
- { path: 'service.staffMembers.mainMedia.image' },
642
- { path: 'service.staffMemberDetails.staffMembers.mainMedia.image' },
643
- ],
644
- },
645
- {
646
- transformFn: transformRESTAddressToSDKAddress,
647
- paths: [
648
- { path: 'service.locations.calculatedAddress' },
649
- { path: 'service.locations.business.address' },
650
- { path: 'service.locations.custom.address' },
651
- ],
652
- },
653
- {
654
- transformFn: transformRESTPageURLV2ToSDKPageURLV2,
655
- paths: [
656
- { path: 'service.urls.servicePage' },
657
- { path: 'service.urls.bookingPage' },
658
- { path: 'service.urls.calendarPage' },
659
- ],
660
- },
661
- ]))?.service;
662
- }
663
- catch (err) {
664
- const transformedError = sdkTransformError(err, {
665
- spreadPathsToArguments: { service: '$[1]' },
666
- explicitPathsToArguments: { 'service.id': '$[0]' },
667
- singleArgumentUnchanged: false,
668
- }, ['_id', 'service']);
669
- sideEffects?.onError?.(err);
670
- throw transformedError;
671
- }
672
- }
673
- /**
674
- * Updates up to 100 services.
675
- *
676
- *
677
- * See *Update Service*
678
- * ([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))
679
- * for more details.
680
- *
681
- * The call succeeds even if one or more individual services can't be updated.
682
- * Information about failures is returned in `bulkActionMetadata`.
683
- * @public
684
- * @requiredField options.services.service
685
- * @requiredField options.services.service._id
686
- * @requiredField options.services.service.revision
687
- * @permissionId BOOKINGS.SERVICES_UPDATE
688
- * @permissionScope Manage Bookings
689
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
690
- * @permissionScope Manage Bookings - all permissions
691
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
692
- * @permissionScope Picasso private app mega scope
693
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
694
- * @applicableIdentity APP
695
- * @fqn wix.bookings.services.v2.ServicesService.BulkUpdateServices
696
- */
697
- export async function bulkUpdateServices(options) {
698
- // @ts-ignore
699
- const { httpClient, sideEffects } = arguments[1];
700
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
701
- services: options?.services,
702
- returnEntity: options?.returnEntity,
703
- }), [
704
- {
705
- transformFn: transformSDKImageToRESTImage,
706
- paths: [
707
- { path: 'services.service.media.items.image' },
708
- { path: 'services.service.media.mainMedia.image' },
709
- { path: 'services.service.media.coverMedia.image' },
710
- { path: 'services.service.staffMembers.mainMedia.image' },
711
- {
712
- path: 'services.service.staffMemberDetails.staffMembers.mainMedia.image',
713
- },
714
- ],
715
- },
716
- {
717
- transformFn: transformSDKAddressToRESTAddress,
718
- paths: [
719
- { path: 'services.service.locations.calculatedAddress' },
720
- { path: 'services.service.locations.business.address' },
721
- { path: 'services.service.locations.custom.address' },
722
- ],
723
- },
724
- {
725
- transformFn: transformSDKPageURLV2ToRESTPageURLV2,
726
- paths: [
727
- { path: 'services.service.urls.servicePage' },
728
- { path: 'services.service.urls.bookingPage' },
729
- { path: 'services.service.urls.calendarPage' },
730
- ],
731
- },
732
- ]);
733
- const reqOpts = ambassadorWixBookingsServicesV2Service.bulkUpdateServices(payload);
734
- sideEffects?.onSiteCall?.();
735
- try {
736
- const result = await httpClient.request(reqOpts);
737
- sideEffects?.onSuccess?.(result);
738
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
739
- {
740
- transformFn: transformRESTImageToSDKImage,
741
- paths: [
742
- { path: 'results.item.media.items.image' },
743
- { path: 'results.item.media.mainMedia.image' },
744
- { path: 'results.item.media.coverMedia.image' },
745
- { path: 'results.item.staffMembers.mainMedia.image' },
746
- {
747
- path: 'results.item.staffMemberDetails.staffMembers.mainMedia.image',
748
- },
749
- ],
750
- },
751
- {
752
- transformFn: transformRESTAddressToSDKAddress,
753
- paths: [
754
- { path: 'results.item.locations.calculatedAddress' },
755
- { path: 'results.item.locations.business.address' },
756
- { path: 'results.item.locations.custom.address' },
757
- ],
758
- },
759
- {
760
- transformFn: transformRESTPageURLV2ToSDKPageURLV2,
761
- paths: [
762
- { path: 'results.item.urls.servicePage' },
763
- { path: 'results.item.urls.bookingPage' },
764
- { path: 'results.item.urls.calendarPage' },
765
- ],
766
- },
767
- ]));
768
- }
769
- catch (err) {
770
- const transformedError = sdkTransformError(err, {
771
- spreadPathsToArguments: {},
772
- explicitPathsToArguments: {
773
- services: '$[0].services',
774
- returnEntity: '$[0].returnEntity',
775
- },
776
- singleArgumentUnchanged: false,
777
- }, ['options']);
778
- sideEffects?.onError?.(err);
779
- throw transformedError;
780
- }
781
- }
782
- /**
783
- * Updates multiple services by filter.
784
- *
785
- *
786
- * Refer to the supported filters article
787
- * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/filtering-and-sorting#filtering))
788
- * for more details.
789
- *
790
- * See *Update Service*
791
- * ([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))
792
- * for more details about updating a service.
793
- *
794
- * The call succeeds even if one or more individual services can't be updated.
795
- * Information about failures is returned in `bulkActionMetadata`.
796
- * @param filter - Filter to identify the services to update.
797
- * @public
798
- * @requiredField filter
799
- * @requiredField options
800
- * @requiredField options.service
801
- * @permissionId BOOKINGS.SERVICES_UPDATE
802
- * @permissionScope Manage Bookings
803
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
804
- * @permissionScope Manage Bookings - all permissions
805
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
806
- * @permissionScope Picasso private app mega scope
807
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
808
- * @applicableIdentity APP
809
- * @fqn wix.bookings.services.v2.ServicesService.BulkUpdateServicesByFilter
810
- */
811
- export async function bulkUpdateServicesByFilter(filter, options) {
812
- // @ts-ignore
813
- const { httpClient, sideEffects } = arguments[2];
814
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
815
- filter: filter,
816
- service: options?.service,
817
- }), [
818
- {
819
- transformFn: transformSDKImageToRESTImage,
820
- paths: [
821
- { path: 'service.media.items.image' },
822
- { path: 'service.media.mainMedia.image' },
823
- { path: 'service.media.coverMedia.image' },
824
- { path: 'service.staffMembers.mainMedia.image' },
825
- { path: 'service.staffMemberDetails.staffMembers.mainMedia.image' },
826
- ],
827
- },
828
- {
829
- transformFn: transformSDKAddressToRESTAddress,
830
- paths: [
831
- { path: 'service.locations.calculatedAddress' },
832
- { path: 'service.locations.business.address' },
833
- { path: 'service.locations.custom.address' },
834
- ],
835
- },
836
- {
837
- transformFn: transformSDKPageURLV2ToRESTPageURLV2,
838
- paths: [
839
- { path: 'service.urls.servicePage' },
840
- { path: 'service.urls.bookingPage' },
841
- { path: 'service.urls.calendarPage' },
842
- ],
843
- },
844
- ]);
845
- const reqOpts = ambassadorWixBookingsServicesV2Service.bulkUpdateServicesByFilter(payload);
846
- sideEffects?.onSiteCall?.();
847
- try {
848
- const result = await httpClient.request(reqOpts);
849
- sideEffects?.onSuccess?.(result);
850
- return renameKeysFromRESTResponseToSDKResponse(result.data);
851
- }
852
- catch (err) {
853
- const transformedError = sdkTransformError(err, {
854
- spreadPathsToArguments: {},
855
- explicitPathsToArguments: { filter: '$[0]', service: '$[1].service' },
856
- singleArgumentUnchanged: false,
857
- }, ['filter', 'options']);
858
- sideEffects?.onError?.(err);
859
- throw transformedError;
860
- }
861
- }
862
- /**
863
- * Deletes a service.
864
- *
865
- *
866
- * Specify `{"preserveFutureSessionsWithParticipants": true}` to retain all
867
- * future sessions for the service. By default, all future sessions are canceled.
868
- * @param serviceId - ID of the service to delete.
869
- * @public
870
- * @requiredField serviceId
871
- * @param options - Allows you to configure how to handle the deleted service's future sessions and how to notify the sessions participants.
872
- * @permissionId BOOKINGS.SERVICES_DELETE
873
- * @permissionScope Manage Bookings
874
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
875
- * @permissionScope Manage Bookings - all permissions
876
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
877
- * @permissionScope Picasso private app mega scope
878
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
879
- * @applicableIdentity APP
880
- * @fqn wix.bookings.services.v2.ServicesService.DeleteService
881
- */
882
- export async function deleteService(serviceId, options) {
883
- // @ts-ignore
884
- const { httpClient, sideEffects } = arguments[2];
885
- const payload = renameKeysFromSDKRequestToRESTRequest({
886
- serviceId: serviceId,
887
- preserveFutureSessionsWithParticipants: options?.preserveFutureSessionsWithParticipants,
888
- participantNotification: options?.participantNotification,
889
- });
890
- const reqOpts = ambassadorWixBookingsServicesV2Service.deleteService(payload);
891
- sideEffects?.onSiteCall?.();
892
- try {
893
- const result = await httpClient.request(reqOpts);
894
- sideEffects?.onSuccess?.(result);
895
- }
896
- catch (err) {
897
- const transformedError = sdkTransformError(err, {
898
- spreadPathsToArguments: {},
899
- explicitPathsToArguments: {
900
- serviceId: '$[0]',
901
- preserveFutureSessionsWithParticipants: '$[1].preserveFutureSessionsWithParticipants',
902
- participantNotification: '$[1].participantNotification',
903
- },
904
- singleArgumentUnchanged: false,
905
- }, ['serviceId', 'options']);
906
- sideEffects?.onError?.(err);
907
- throw transformedError;
908
- }
909
- }
910
- /**
911
- * Deletes multiple services.
912
- *
913
- *
914
- * See *Delete Service*
915
- * ([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))
916
- * for more details about deleting a service.
917
- *
918
- * The call succeeds even if one or more individual services can't be deleted.
919
- * Information about failures is returned in `bulkActionMetadata`.
920
- * @param ids - IDs of the services to delete.
921
- * @public
922
- * @requiredField ids
923
- * @permissionId BOOKINGS.SERVICES_DELETE
924
- * @permissionScope Manage Bookings
925
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
926
- * @permissionScope Manage Bookings - all permissions
927
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
928
- * @permissionScope Picasso private app mega scope
929
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
930
- * @applicableIdentity APP
931
- * @fqn wix.bookings.services.v2.ServicesService.BulkDeleteServices
932
- */
933
- export async function bulkDeleteServices(ids, options) {
934
- // @ts-ignore
935
- const { httpClient, sideEffects } = arguments[2];
936
- const payload = renameKeysFromSDKRequestToRESTRequest({
937
- ids: ids,
938
- preserveFutureSessionsWithParticipants: options?.preserveFutureSessionsWithParticipants,
939
- participantNotification: options?.participantNotification,
940
- });
941
- const reqOpts = ambassadorWixBookingsServicesV2Service.bulkDeleteServices(payload);
942
- sideEffects?.onSiteCall?.();
943
- try {
944
- const result = await httpClient.request(reqOpts);
945
- sideEffects?.onSuccess?.(result);
946
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
947
- {
948
- transformFn: transformRESTImageToSDKImage,
949
- paths: [
950
- { path: 'results.item.media.items.image' },
951
- { path: 'results.item.media.mainMedia.image' },
952
- { path: 'results.item.media.coverMedia.image' },
953
- { path: 'results.item.staffMembers.mainMedia.image' },
954
- {
955
- path: 'results.item.staffMemberDetails.staffMembers.mainMedia.image',
956
- },
957
- ],
958
- },
959
- {
960
- transformFn: transformRESTAddressToSDKAddress,
961
- paths: [
962
- { path: 'results.item.locations.calculatedAddress' },
963
- { path: 'results.item.locations.business.address' },
964
- { path: 'results.item.locations.custom.address' },
965
- ],
966
- },
967
- {
968
- transformFn: transformRESTPageURLV2ToSDKPageURLV2,
969
- paths: [
970
- { path: 'results.item.urls.servicePage' },
971
- { path: 'results.item.urls.bookingPage' },
972
- { path: 'results.item.urls.calendarPage' },
973
- ],
974
- },
975
- ]));
976
- }
977
- catch (err) {
978
- const transformedError = sdkTransformError(err, {
979
- spreadPathsToArguments: {},
980
- explicitPathsToArguments: {
981
- ids: '$[0]',
982
- preserveFutureSessionsWithParticipants: '$[1].preserveFutureSessionsWithParticipants',
983
- participantNotification: '$[1].participantNotification',
984
- },
985
- singleArgumentUnchanged: false,
986
- }, ['ids', 'options']);
987
- sideEffects?.onError?.(err);
988
- throw transformedError;
989
- }
990
- }
991
- /**
992
- * Deletes multiple services by filter.
993
- *
994
- *
995
- * See *Delete Service*
996
- * ([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))
997
- * for more details about deleting a service.
998
- *
999
- * The call succeeds even if one or more individual services can't be deleted.
1000
- * Information about failures is returned in `bulkActionMetadata`.
1001
- *
1002
- * Refer to the supported filters article
1003
- * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/filtering-and-sorting#filtering))
1004
- * for more details.
1005
- *
1006
- * To learn about working with filters in general, see
1007
- * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).
1008
- * @param filter - Filter to identify the services that need to be deleted.
1009
- * @public
1010
- * @requiredField filter
1011
- * @permissionId BOOKINGS.SERVICES_DELETE
1012
- * @permissionScope Manage Bookings
1013
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1014
- * @permissionScope Manage Bookings - all permissions
1015
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1016
- * @permissionScope Picasso private app mega scope
1017
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1018
- * @applicableIdentity APP
1019
- * @fqn wix.bookings.services.v2.ServicesService.BulkDeleteServicesByFilter
1020
- */
1021
- export async function bulkDeleteServicesByFilter(filter, options) {
1022
- // @ts-ignore
1023
- const { httpClient, sideEffects } = arguments[2];
1024
- const payload = renameKeysFromSDKRequestToRESTRequest({
1025
- filter: filter,
1026
- preserveFutureSessionsWithParticipants: options?.preserveFutureSessionsWithParticipants,
1027
- participantNotification: options?.participantNotification,
1028
- });
1029
- const reqOpts = ambassadorWixBookingsServicesV2Service.bulkDeleteServicesByFilter(payload);
1030
- sideEffects?.onSiteCall?.();
1031
- try {
1032
- const result = await httpClient.request(reqOpts);
1033
- sideEffects?.onSuccess?.(result);
1034
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1035
- }
1036
- catch (err) {
1037
- const transformedError = sdkTransformError(err, {
1038
- spreadPathsToArguments: {},
1039
- explicitPathsToArguments: {
1040
- filter: '$[0]',
1041
- preserveFutureSessionsWithParticipants: '$[1].preserveFutureSessionsWithParticipants',
1042
- participantNotification: '$[1].participantNotification',
1043
- },
1044
- singleArgumentUnchanged: false,
1045
- }, ['filter', 'options']);
1046
- sideEffects?.onError?.(err);
1047
- throw transformedError;
1048
- }
1049
- }
1050
- /**
1051
- * Creates a query to retrieve a list of `service` objects.
1052
- *
1053
- * The `queryServices()` function builds a query to retrieve a list of `service` objects and returns a `ServicesQueryBuilder` object.
1054
- *
1055
- * 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.
1056
- *
1057
- * 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.
1058
- *
1059
- * `queryServices()` runs with the following `ServicesQueryBuilder` defaults that you can override:
1060
- *
1061
- * + `limit` is `100`.
1062
- * + Sorted by `createdDate` in ascending order.
1063
- *
1064
- * 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`.
1065
- *
1066
- * 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`.
1067
- * @public
1068
- * @permissionScope Read Bookings - Public Data
1069
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
1070
- * @permissionScope Manage Bookings Services and Settings
1071
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1072
- * @permissionScope Manage Bookings
1073
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1074
- * @permissionScope Read Bookings - Including Participants
1075
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1076
- * @permissionScope Read Bookings - all read permissions
1077
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
1078
- * @permissionScope Manage Bookings - all permissions
1079
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1080
- * @permissionScope Picasso private app mega scope
1081
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1082
- * @permissionId BOOKINGS.SERVICES_READ
1083
- * @applicableIdentity APP
1084
- * @applicableIdentity VISITOR
1085
- * @fqn wix.bookings.services.v2.ServicesService.QueryServices
1086
- */
1087
- export function queryServices(options) {
1088
- // @ts-ignore
1089
- const { httpClient, sideEffects } = arguments[1];
1090
- return queryBuilder({
1091
- func: async (payload) => {
1092
- const reqOpts = ambassadorWixBookingsServicesV2Service.queryServices({
1093
- ...payload,
1094
- ...(options ?? {}),
1095
- });
1096
- sideEffects?.onSiteCall?.();
1097
- try {
1098
- const result = await httpClient.request(reqOpts);
1099
- sideEffects?.onSuccess?.(result);
1100
- return result;
1101
- }
1102
- catch (err) {
1103
- sideEffects?.onError?.(err);
1104
- throw err;
1105
- }
1106
- },
1107
- requestTransformer: (query) => {
1108
- const args = [query, options];
1109
- return renameKeysFromSDKRequestToRESTRequest({
1110
- ...args?.[1],
1111
- query: args?.[0],
1112
- });
1113
- },
1114
- responseTransformer: ({ data }) => {
1115
- const transformedData = renameKeysFromRESTResponseToSDKResponse(transformPaths(data, [
1116
- {
1117
- transformFn: transformRESTImageToSDKImage,
1118
- paths: [
1119
- { path: 'services.media.items.image' },
1120
- { path: 'services.media.mainMedia.image' },
1121
- { path: 'services.media.coverMedia.image' },
1122
- { path: 'services.staffMembers.mainMedia.image' },
1123
- {
1124
- path: 'services.staffMemberDetails.staffMembers.mainMedia.image',
1125
- },
1126
- ],
1127
- },
1128
- {
1129
- transformFn: transformRESTAddressToSDKAddress,
1130
- paths: [
1131
- { path: 'services.locations.calculatedAddress' },
1132
- { path: 'services.locations.business.address' },
1133
- { path: 'services.locations.custom.address' },
1134
- ],
1135
- },
1136
- {
1137
- transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1138
- paths: [
1139
- { path: 'services.urls.servicePage' },
1140
- { path: 'services.urls.bookingPage' },
1141
- { path: 'services.urls.calendarPage' },
1142
- ],
1143
- },
1144
- ]));
1145
- return {
1146
- items: transformedData?.services,
1147
- pagingMetadata: transformedData?.pagingMetadata,
1148
- };
1149
- },
1150
- errorTransformer: (err) => {
1151
- const transformedError = sdkTransformError(err, {
1152
- spreadPathsToArguments: {},
1153
- explicitPathsToArguments: { query: '$[0]' },
1154
- singleArgumentUnchanged: false,
1155
- });
1156
- throw transformedError;
1157
- },
1158
- pagingMethod: 'OFFSET',
1159
- transformationPaths: {},
1160
- });
1161
- }
1162
- /**
1163
- * Retrieves a list of up to 100 services, given the provided filtering, paging,
1164
- * and sorting.
1165
- *
1166
- *
1167
- * ## Defaults
1168
- *
1169
- * Search Services has the following default settings, which you can override:
1170
- * + Sorted by `createdDate` in ascending order.
1171
- * + `paging.limit` set to `100`.
1172
- * + `paging.offset` set to `0`.
1173
- *
1174
- * ## Filters
1175
- *
1176
- * When using filters for dates, you must use
1177
- * [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).
1178
- *
1179
- * Refer to the supported filters article
1180
- * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/filtering-and-sorting))
1181
- * for a complete list of supported filters and sorting options.
1182
- *
1183
- * ## See also
1184
- *
1185
- * To learn about working with *Search* methods, see
1186
- * _API Query Language_
1187
- * ([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))
1188
- * and *Sorting and Paging*
1189
- * ([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)).
1190
- * @param search - WQL, search or aggregation expression.
1191
- * @public
1192
- * @documentationMaturity preview
1193
- * @requiredField search
1194
- * @permissionId BOOKINGS.SERVICES_READ
1195
- * @permissionScope Read Bookings - Public Data
1196
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
1197
- * @permissionScope Manage Bookings Services and Settings
1198
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1199
- * @permissionScope Manage Bookings
1200
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1201
- * @permissionScope Read Bookings - Including Participants
1202
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1203
- * @permissionScope Read Bookings - all read permissions
1204
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
1205
- * @permissionScope Manage Bookings - all permissions
1206
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1207
- * @permissionScope Picasso private app mega scope
1208
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1209
- * @applicableIdentity APP
1210
- * @applicableIdentity VISITOR
1211
- * @fqn wix.bookings.services.v2.ServicesService.SearchServices
1212
- */
1213
- export async function searchServices(search) {
1214
- // @ts-ignore
1215
- const { httpClient, sideEffects } = arguments[1];
1216
- const payload = renameKeysFromSDKRequestToRESTRequest({ search: search });
1217
- const reqOpts = ambassadorWixBookingsServicesV2Service.searchServices(payload);
1218
- sideEffects?.onSiteCall?.();
1219
- try {
1220
- const result = await httpClient.request(reqOpts);
1221
- sideEffects?.onSuccess?.(result);
1222
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1223
- {
1224
- transformFn: transformRESTImageToSDKImage,
1225
- paths: [
1226
- { path: 'services.media.items.image' },
1227
- { path: 'services.media.mainMedia.image' },
1228
- { path: 'services.media.coverMedia.image' },
1229
- { path: 'services.staffMembers.mainMedia.image' },
1230
- {
1231
- path: 'services.staffMemberDetails.staffMembers.mainMedia.image',
1232
- },
1233
- ],
1234
- },
1235
- {
1236
- transformFn: transformRESTAddressToSDKAddress,
1237
- paths: [
1238
- { path: 'services.locations.calculatedAddress' },
1239
- { path: 'services.locations.business.address' },
1240
- { path: 'services.locations.custom.address' },
1241
- ],
1242
- },
1243
- {
1244
- transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1245
- paths: [
1246
- { path: 'services.urls.servicePage' },
1247
- { path: 'services.urls.bookingPage' },
1248
- { path: 'services.urls.calendarPage' },
1249
- ],
1250
- },
1251
- ]));
1252
- }
1253
- catch (err) {
1254
- const transformedError = sdkTransformError(err, {
1255
- spreadPathsToArguments: {},
1256
- explicitPathsToArguments: { search: '$[0]' },
1257
- singleArgumentUnchanged: false,
1258
- }, ['search']);
1259
- sideEffects?.onError?.(err);
1260
- throw transformedError;
1261
- }
1262
- }
1263
- /**
1264
- * Retrieves a list of up to 100 *booking policies*
1265
- * ([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)),
1266
- * and information about the services that are connected to them,
1267
- * given the provided filtering, paging, and sorting.
1268
- *
1269
- * ## Defaults
1270
- *
1271
- * Query Policies has the following default settings, which you can override:
1272
- *
1273
- * + Sorted by `id` in ascending order.
1274
- * + `cursorPaging.limit` set to `100`.
1275
- *
1276
- * ## Filters
1277
- *
1278
- * For a complete list of supported filters, refer to **Booking Policies API: Supported Filters**
1279
- * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policies/supported-filters)).
1280
- *
1281
- * When using date filters, you must use
1282
- * [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).
1283
- *
1284
- * ## Returned services
1285
- *
1286
- * If a booking policy is connected to more than 5 services, only a subset of
1287
- * those services is returned. The `bookingPolicies.totalServiceCount` values
1288
- * indicate the total number of services linked to each policy. You can call *Search Services*
1289
- * ([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))
1290
- * and specify the relevant policy ID in the filter to retrieve all services
1291
- * connected to the booking policy.
1292
- *
1293
- * ## See also
1294
- *
1295
- * To learn about working with *Query* endpoints, see
1296
- * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)
1297
- * and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
1298
- * @param query - Information about filters, paging, and sorting. See the article about
1299
- * booking policy filters
1300
- * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policies/supported-filters))
1301
- * for all supported filters and sorting options.
1302
- * @public
1303
- * @documentationMaturity preview
1304
- * @requiredField query
1305
- * @permissionId BOOKINGS.BOOKING_POLICY_READ
1306
- * @permissionId BOOKINGS.SERVICES_READ
1307
- * @permissionScope Read Bookings - Public Data
1308
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
1309
- * @permissionScope Manage Bookings Services and Settings
1310
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1311
- * @permissionScope Manage Bookings
1312
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1313
- * @permissionScope Read Bookings - Including Participants
1314
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1315
- * @permissionScope Read Bookings - all read permissions
1316
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
1317
- * @permissionScope Manage Bookings - all permissions
1318
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1319
- * @permissionScope Picasso private app mega scope
1320
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1321
- * @permissionScope Read Bookings - Public Data
1322
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
1323
- * @permissionScope Manage Bookings Services and Settings
1324
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1325
- * @permissionScope Manage Bookings
1326
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1327
- * @permissionScope Read Bookings - Including Participants
1328
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1329
- * @permissionScope Read Bookings - all read permissions
1330
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
1331
- * @permissionScope Manage Bookings - all permissions
1332
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1333
- * @permissionScope Picasso private app mega scope
1334
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1335
- * @applicableIdentity APP
1336
- * @applicableIdentity VISITOR
1337
- * @fqn wix.bookings.services.v2.ServicesService.QueryPolicies
1338
- */
1339
- export async function queryPolicies(query) {
1340
- // @ts-ignore
1341
- const { httpClient, sideEffects } = arguments[1];
1342
- const payload = renameKeysFromSDKRequestToRESTRequest({ query: query });
1343
- const reqOpts = ambassadorWixBookingsServicesV2Service.queryPolicies(payload);
1344
- sideEffects?.onSiteCall?.();
1345
- try {
1346
- const result = await httpClient.request(reqOpts);
1347
- sideEffects?.onSuccess?.(result);
1348
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1349
- {
1350
- transformFn: transformRESTImageToSDKImage,
1351
- paths: [
1352
- { path: 'bookingPolicies.services.media.items.image' },
1353
- { path: 'bookingPolicies.services.media.mainMedia.image' },
1354
- { path: 'bookingPolicies.services.media.coverMedia.image' },
1355
- { path: 'bookingPolicies.services.staffMembers.mainMedia.image' },
1356
- {
1357
- path: 'bookingPolicies.services.staffMemberDetails.staffMembers.mainMedia.image',
1358
- },
1359
- { path: 'bookingPolicies.connectedServices.media.items.image' },
1360
- { path: 'bookingPolicies.connectedServices.media.mainMedia.image' },
1361
- {
1362
- path: 'bookingPolicies.connectedServices.media.coverMedia.image',
1363
- },
1364
- {
1365
- path: 'bookingPolicies.connectedServices.staffMembers.mainMedia.image',
1366
- },
1367
- {
1368
- path: 'bookingPolicies.connectedServices.staffMemberDetails.staffMembers.mainMedia.image',
1369
- },
1370
- ],
1371
- },
1372
- {
1373
- transformFn: transformRESTAddressToSDKAddress,
1374
- paths: [
1375
- { path: 'bookingPolicies.services.locations.calculatedAddress' },
1376
- { path: 'bookingPolicies.services.locations.business.address' },
1377
- { path: 'bookingPolicies.services.locations.custom.address' },
1378
- {
1379
- path: 'bookingPolicies.connectedServices.locations.calculatedAddress',
1380
- },
1381
- {
1382
- path: 'bookingPolicies.connectedServices.locations.business.address',
1383
- },
1384
- {
1385
- path: 'bookingPolicies.connectedServices.locations.custom.address',
1386
- },
1387
- ],
1388
- },
1389
- {
1390
- transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1391
- paths: [
1392
- { path: 'bookingPolicies.services.urls.servicePage' },
1393
- { path: 'bookingPolicies.services.urls.bookingPage' },
1394
- { path: 'bookingPolicies.services.urls.calendarPage' },
1395
- { path: 'bookingPolicies.connectedServices.urls.servicePage' },
1396
- { path: 'bookingPolicies.connectedServices.urls.bookingPage' },
1397
- { path: 'bookingPolicies.connectedServices.urls.calendarPage' },
1398
- ],
1399
- },
1400
- ]));
1401
- }
1402
- catch (err) {
1403
- const transformedError = sdkTransformError(err, {
1404
- spreadPathsToArguments: {},
1405
- explicitPathsToArguments: { query: '$[0]' },
1406
- singleArgumentUnchanged: false,
1407
- }, ['query']);
1408
- sideEffects?.onError?.(err);
1409
- throw transformedError;
1410
- }
1411
- }
1412
- /**
1413
- * Retrieves a list of up to 100 *booking forms*
1414
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/forms/forms/introduction) | [REST](https://dev.wix.com/docs/rest/crm/forms/forms/introduction)),
1415
- * and information about the services that are connected to them,
1416
- * given the provided filtering, paging, and sorting.
1417
- *
1418
- *
1419
- * ## Defaults
1420
- *
1421
- * Query Booking Forms has the following default settings, which you can override:
1422
- *
1423
- * + Sorted by `id` in ascending order.
1424
- * + `cursorPaging.limit` set to `100`.
1425
- *
1426
- * ## Filters
1427
- *
1428
- * For a complete list of supported filters, refer to **Forms API: Supported Filters**
1429
- * ([REST](https://dev.wix.com/docs/rest/crm/forms/forms/introduction/supported-filters)).
1430
- *
1431
- * When using date filters, you must use
1432
- * [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).
1433
- *
1434
- * ## Returned services
1435
- *
1436
- * If a booking policy is connected to more than 5 services, only a subset of
1437
- * these service IDs and names is returned. The `bookingForms.totalServiceCount`
1438
- * values indicate the total number of services linked to each form. You can call *Query Services*
1439
- * ([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))
1440
- * and specify the relevant form ID in the filter to retrieve all services
1441
- * connected to the booking form.
1442
- *
1443
- * ## Default booking forms
1444
- *
1445
- * By default, all Wix Bookings services use a standard booking form. To retrieve
1446
- * a site's default booking form with Query Booking Forms, specify
1447
- * `{"conditionalFields": ["DEFAULT_BOOKING_FORM"]}`.
1448
- *
1449
- * ## See also
1450
- *
1451
- * To learn about working with *Query* endpoints, see
1452
- * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)
1453
- * and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
1454
- * @param query - Information about filters, paging, and sorting. See the article about
1455
- * form filters ([REST](https://dev.wix.com/docs/rest/crm/forms/forms/introduction/supported-filters))
1456
- * for all supported filters and sorting options.
1457
- * @public
1458
- * @requiredField query
1459
- * @permissionId BOOKINGS.SERVICE_BOOKING_FORMS_READ
1460
- * @permissionId BOOKINGS.SERVICES_READ
1461
- * @permissionScope Manage Bookings
1462
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1463
- * @permissionScope Manage Bookings - all permissions
1464
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1465
- * @permissionScope Picasso private app mega scope
1466
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1467
- * @permissionScope Read Bookings - Public Data
1468
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
1469
- * @permissionScope Manage Bookings Services and Settings
1470
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1471
- * @permissionScope Manage Bookings
1472
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1473
- * @permissionScope Read Bookings - Including Participants
1474
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1475
- * @permissionScope Read Bookings - all read permissions
1476
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
1477
- * @permissionScope Manage Bookings - all permissions
1478
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1479
- * @permissionScope Picasso private app mega scope
1480
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1481
- * @applicableIdentity APP
1482
- * @applicableIdentity VISITOR
1483
- * @fqn wix.bookings.services.v2.ServicesService.QueryBookingForms
1484
- */
1485
- export async function queryBookingForms(query, options) {
1486
- // @ts-ignore
1487
- const { httpClient, sideEffects } = arguments[2];
1488
- const payload = renameKeysFromSDKRequestToRESTRequest({
1489
- query: query,
1490
- conditionalFields: options?.conditionalFields,
1491
- });
1492
- const reqOpts = ambassadorWixBookingsServicesV2Service.queryBookingForms(payload);
1493
- sideEffects?.onSiteCall?.();
1494
- try {
1495
- const result = await httpClient.request(reqOpts);
1496
- sideEffects?.onSuccess?.(result);
1497
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1498
- }
1499
- catch (err) {
1500
- const transformedError = sdkTransformError(err, {
1501
- spreadPathsToArguments: {},
1502
- explicitPathsToArguments: {
1503
- query: '$[0]',
1504
- conditionalFields: '$[1].conditionalFields',
1505
- },
1506
- singleArgumentUnchanged: false,
1507
- }, ['query', 'options']);
1508
- sideEffects?.onError?.(err);
1509
- throw transformedError;
1510
- }
1511
- }
1512
- /**
1513
- * Counts how many services match the given filter.
1514
- *
1515
- *
1516
- * Refer to the supported filters article
1517
- * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/filtering-and-sorting#filtering))
1518
- * for more details.
1519
- *
1520
- * To learn about working with filters in general, see
1521
- * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters)
1522
- * @public
1523
- * @permissionId BOOKINGS.SERVICES_COUNT
1524
- * @permissionScope Read Bookings - Public Data
1525
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
1526
- * @permissionScope Manage Bookings Services and Settings
1527
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1528
- * @permissionScope Manage Bookings
1529
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1530
- * @permissionScope Read Bookings - Including Participants
1531
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1532
- * @permissionScope Read Bookings - all read permissions
1533
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
1534
- * @permissionScope Manage Bookings - all permissions
1535
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1536
- * @permissionScope Picasso private app mega scope
1537
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1538
- * @applicableIdentity APP
1539
- * @applicableIdentity VISITOR
1540
- * @fqn wix.bookings.services.v2.ServicesService.CountServices
1541
- */
1542
- export async function countServices(options) {
1543
- // @ts-ignore
1544
- const { httpClient, sideEffects } = arguments[1];
1545
- const payload = renameKeysFromSDKRequestToRESTRequest({
1546
- filter: options?.filter,
1547
- });
1548
- const reqOpts = ambassadorWixBookingsServicesV2Service.countServices(payload);
1549
- sideEffects?.onSiteCall?.();
1550
- try {
1551
- const result = await httpClient.request(reqOpts);
1552
- sideEffects?.onSuccess?.(result);
1553
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1554
- }
1555
- catch (err) {
1556
- const transformedError = sdkTransformError(err, {
1557
- spreadPathsToArguments: {},
1558
- explicitPathsToArguments: { filter: '$[0].filter' },
1559
- singleArgumentUnchanged: false,
1560
- }, ['options']);
1561
- sideEffects?.onError?.(err);
1562
- throw transformedError;
1563
- }
1564
- }
1565
- /**
1566
- * Retrieves 3 separate lists of business, custom, and customer *locations*
1567
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction)),
1568
- * given the provided filtering, and whether each location is connected to at
1569
- * least one of the site's services.
1570
- *
1571
- *
1572
- * ## Defaults
1573
- *
1574
- * Query Locations has the following default setting, which you can't override:
1575
- * Sorted by `id` in ascending order.
1576
- *
1577
- * ## Filters
1578
- *
1579
- * For a complete list of supported filters, refer to the `location` object
1580
- * ([REST](https://dev.wix.com/docs/rest/business-management/locations/location-object)).
1581
- *
1582
- * When using date filters, you must use
1583
- * [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).
1584
- *
1585
- * ## See also
1586
- *
1587
- * To learn about working with *Query* endpoints, see
1588
- * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)
1589
- * and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
1590
- * @public
1591
- * @documentationMaturity preview
1592
- * @permissionId BOOKINGS.SERVICES_READ
1593
- * @permissionScope Read Bookings - Public Data
1594
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
1595
- * @permissionScope Manage Bookings Services and Settings
1596
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1597
- * @permissionScope Manage Bookings
1598
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1599
- * @permissionScope Read Bookings - Including Participants
1600
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1601
- * @permissionScope Read Bookings - all read permissions
1602
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
1603
- * @permissionScope Manage Bookings - all permissions
1604
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1605
- * @permissionScope Picasso private app mega scope
1606
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1607
- * @applicableIdentity APP
1608
- * @applicableIdentity VISITOR
1609
- * @fqn wix.bookings.services.v2.ServicesService.QueryLocations
1610
- */
1611
- export async function queryLocations(options) {
1612
- // @ts-ignore
1613
- const { httpClient, sideEffects } = arguments[1];
1614
- const payload = renameKeysFromSDKRequestToRESTRequest({
1615
- filter: options?.filter,
1616
- });
1617
- const reqOpts = ambassadorWixBookingsServicesV2Service.queryLocations(payload);
1618
- sideEffects?.onSiteCall?.();
1619
- try {
1620
- const result = await httpClient.request(reqOpts);
1621
- sideEffects?.onSuccess?.(result);
1622
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1623
- {
1624
- transformFn: transformRESTAddressToSDKAddress,
1625
- paths: [
1626
- { path: 'businessLocations.locations.calculatedAddress' },
1627
- { path: 'businessLocations.locations.business.address' },
1628
- { path: 'businessLocations.locations.custom.address' },
1629
- ],
1630
- },
1631
- ]));
1632
- }
1633
- catch (err) {
1634
- const transformedError = sdkTransformError(err, {
1635
- spreadPathsToArguments: {},
1636
- explicitPathsToArguments: { filter: '$[0].filter' },
1637
- singleArgumentUnchanged: false,
1638
- }, ['options']);
1639
- sideEffects?.onError?.(err);
1640
- throw transformedError;
1641
- }
1642
- }
1643
- /**
1644
- * Retrieves a list of service *categories*
1645
- * ([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)),
1646
- * given the provided filtering.
1647
- *
1648
- *
1649
- * ## Defaults
1650
- *
1651
- * Query Categories has the following default setting, which you can't override:
1652
- * Sorted by `id` in ascending order.
1653
- *
1654
- * ## Filters
1655
- *
1656
- * For a complete list of supported filters, refer to the supported filters article
1657
- * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/filtering-and-sorting#filtering)).
1658
- *
1659
- * When using date filters, you must use
1660
- * [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).
1661
- *
1662
- * ## See also
1663
- *
1664
- * To learn about working with *Query* endpoints, see
1665
- * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)
1666
- * and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
1667
- * @public
1668
- * @documentationMaturity preview
1669
- * @permissionId BOOKINGS.SERVICES_READ
1670
- * @permissionScope Read Bookings - Public Data
1671
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
1672
- * @permissionScope Manage Bookings Services and Settings
1673
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1674
- * @permissionScope Manage Bookings
1675
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1676
- * @permissionScope Read Bookings - Including Participants
1677
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1678
- * @permissionScope Read Bookings - all read permissions
1679
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
1680
- * @permissionScope Manage Bookings - all permissions
1681
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1682
- * @permissionScope Picasso private app mega scope
1683
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1684
- * @applicableIdentity APP
1685
- * @applicableIdentity VISITOR
1686
- * @fqn wix.bookings.services.v2.ServicesService.QueryCategories
1687
- */
1688
- export async function queryCategories(options) {
1689
- // @ts-ignore
1690
- const { httpClient, sideEffects } = arguments[1];
1691
- const payload = renameKeysFromSDKRequestToRESTRequest({
1692
- filter: options?.filter,
1693
- });
1694
- const reqOpts = ambassadorWixBookingsServicesV2Service.queryCategories(payload);
1695
- sideEffects?.onSiteCall?.();
1696
- try {
1697
- const result = await httpClient.request(reqOpts);
1698
- sideEffects?.onSuccess?.(result);
1699
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1700
- }
1701
- catch (err) {
1702
- const transformedError = sdkTransformError(err, {
1703
- spreadPathsToArguments: {},
1704
- explicitPathsToArguments: { filter: '$[0].filter' },
1705
- singleArgumentUnchanged: false,
1706
- }, ['options']);
1707
- sideEffects?.onError?.(err);
1708
- throw transformedError;
1709
- }
1710
- }
1711
- /**
1712
- * Replaces the list of the *locations*
1713
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))
1714
- * where the business offers the service.
1715
- *
1716
- *
1717
- * ## Consequences for customers
1718
- *
1719
- * Removing a service location may impact existing sessions and their
1720
- * participants. If you remove at least one service location, you must
1721
- * specify `removedLocationSessionsAction` to indicate what happens to all
1722
- * future sessions scheduled at this location.
1723
- *
1724
- * - **Keep existing location**: If you want to retain future sessions at their
1725
- * originally scheduled location, specify
1726
- * `{"removedLocationSessionsAction.action": "KEEP_AT_CURRENT_LOCATION"}`.
1727
- * This ensures nothing changes for the customer, but the business must be
1728
- * able to provide access to the removed location in the future.
1729
- * - **Update location**: If you want to update the location for future sessions
1730
- * scheduled at the removed location, specify
1731
- * `{"removedLocationSessionsAction.action": "MOVE_TO_LOCATION"}` and
1732
- * `moveToLocationOptions.newLocation`.
1733
- *
1734
- * You can't mix and match to keep some sessions at the previous location while
1735
- * moving other sessions to an updated location.
1736
- *
1737
- * Past session details aren't changed, no matter which option you choose for
1738
- * future sessions.
1739
- *
1740
- * Future sessions scheduled for a location defined by the customer are also not
1741
- * updated.
1742
- *
1743
- * ## Specify location details
1744
- *
1745
- * Depending on whether the new or updated location is a business or custom location,
1746
- * you need to specify different fields.
1747
- *
1748
- * - **Business location**: Specify the relevant *location ID*
1749
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))
1750
- * in `locations.business.id`.
1751
- * - **Custom location**: Specify the complete address object as
1752
- * `locations.custom.address`.
1753
- *
1754
- * ## Participant notifications
1755
- *
1756
- * You can specify a `participantNotification.message` that's immediately send
1757
- * to all customers who had booked at a changed location. Ensure
1758
- * `participantNotification.notifyParticipants` is set to `true` to send the
1759
- * message.
1760
- * @param serviceId - ID of the service.
1761
- * @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.
1762
- * @public
1763
- * @documentationMaturity preview
1764
- * @requiredField locations
1765
- * @requiredField serviceId
1766
- * @permissionId BOOKINGS.SERVICES_LOCATIONS_SET
1767
- * @permissionScope Manage Bookings
1768
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1769
- * @permissionScope Manage Bookings - all permissions
1770
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1771
- * @permissionScope Picasso private app mega scope
1772
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1773
- * @applicableIdentity APP
1774
- * @fqn wix.bookings.services.v2.ServicesService.SetServiceLocations
1775
- */
1776
- export async function setServiceLocations(serviceId, locations, options) {
1777
- // @ts-ignore
1778
- const { httpClient, sideEffects } = arguments[3];
1779
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
1780
- serviceId: serviceId,
1781
- locations: locations,
1782
- removedLocationSessionsAction: options?.removedLocationSessionsAction,
1783
- participantNotification: options?.participantNotification,
1784
- }), [
1785
- {
1786
- transformFn: transformSDKAddressToRESTAddress,
1787
- paths: [
1788
- { path: 'locations.calculatedAddress' },
1789
- { path: 'locations.business.address' },
1790
- { path: 'locations.custom.address' },
1791
- {
1792
- path: 'removedLocationSessionsAction.moveToLocationOptions.newLocation.calculatedAddress',
1793
- },
1794
- {
1795
- path: 'removedLocationSessionsAction.moveToLocationOptions.newLocation.business.address',
1796
- },
1797
- {
1798
- path: 'removedLocationSessionsAction.moveToLocationOptions.newLocation.custom.address',
1799
- },
1800
- ],
1801
- },
1802
- ]);
1803
- const reqOpts = ambassadorWixBookingsServicesV2Service.setServiceLocations(payload);
1804
- sideEffects?.onSiteCall?.();
1805
- try {
1806
- const result = await httpClient.request(reqOpts);
1807
- sideEffects?.onSuccess?.(result);
1808
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1809
- {
1810
- transformFn: transformRESTImageToSDKImage,
1811
- paths: [
1812
- { path: 'service.media.items.image' },
1813
- { path: 'service.media.mainMedia.image' },
1814
- { path: 'service.media.coverMedia.image' },
1815
- { path: 'service.staffMembers.mainMedia.image' },
1816
- { path: 'service.staffMemberDetails.staffMembers.mainMedia.image' },
1817
- ],
1818
- },
1819
- {
1820
- transformFn: transformRESTAddressToSDKAddress,
1821
- paths: [
1822
- { path: 'service.locations.calculatedAddress' },
1823
- { path: 'service.locations.business.address' },
1824
- { path: 'service.locations.custom.address' },
1825
- ],
1826
- },
1827
- {
1828
- transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1829
- paths: [
1830
- { path: 'service.urls.servicePage' },
1831
- { path: 'service.urls.bookingPage' },
1832
- { path: 'service.urls.calendarPage' },
1833
- ],
1834
- },
1835
- ]));
1836
- }
1837
- catch (err) {
1838
- const transformedError = sdkTransformError(err, {
1839
- spreadPathsToArguments: {},
1840
- explicitPathsToArguments: {
1841
- serviceId: '$[0]',
1842
- locations: '$[1]',
1843
- removedLocationSessionsAction: '$[2].removedLocationSessionsAction',
1844
- participantNotification: '$[2].participantNotification',
1845
- },
1846
- singleArgumentUnchanged: false,
1847
- }, ['serviceId', 'locations', 'options']);
1848
- sideEffects?.onError?.(err);
1849
- throw transformedError;
1850
- }
1851
- }
1852
- /**
1853
- * Adds a list of *pricing plan IDs*
1854
- * ([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))
1855
- * to a service's `payment.pricingPlanIds` array.
1856
- *
1857
- *
1858
- * The call doesn't validate whether the service's `payment.options.pricingPlan`
1859
- * is set to `true`. If it's set to `false`, customers aren't able to pay
1860
- * for their bookings using pricing plans. You can call *Update Service*
1861
- * ([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))
1862
- * to change a service's supported payment methods.
1863
- * @param serviceId - ID of the service to update.
1864
- * @param pricingPlanIds - IDs of the *pricing plans*
1865
- * ([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))
1866
- * to add to the service's `payment.pricingPlanIds` array.
1867
- * @public
1868
- * @requiredField pricingPlanIds
1869
- * @requiredField serviceId
1870
- * @permissionId BOOKINGS.SERVICES_PRICING_PLANS_ADD
1871
- * @permissionScope Manage Bookings
1872
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1873
- * @permissionScope Manage Bookings - all permissions
1874
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1875
- * @permissionScope Picasso private app mega scope
1876
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1877
- * @applicableIdentity APP
1878
- * @fqn wix.bookings.services.v2.ServicesService.EnablePricingPlansForService
1879
- */
1880
- export async function enablePricingPlansForService(serviceId, pricingPlanIds) {
1881
- // @ts-ignore
1882
- const { httpClient, sideEffects } = arguments[2];
1883
- const payload = renameKeysFromSDKRequestToRESTRequest({
1884
- serviceId: serviceId,
1885
- pricingPlanIds: pricingPlanIds,
1886
- });
1887
- const reqOpts = ambassadorWixBookingsServicesV2Service.enablePricingPlansForService(payload);
1888
- sideEffects?.onSiteCall?.();
1889
- try {
1890
- const result = await httpClient.request(reqOpts);
1891
- sideEffects?.onSuccess?.(result);
1892
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1893
- {
1894
- transformFn: transformRESTImageToSDKImage,
1895
- paths: [
1896
- { path: 'service.media.items.image' },
1897
- { path: 'service.media.mainMedia.image' },
1898
- { path: 'service.media.coverMedia.image' },
1899
- { path: 'service.staffMembers.mainMedia.image' },
1900
- { path: 'service.staffMemberDetails.staffMembers.mainMedia.image' },
1901
- ],
1902
- },
1903
- {
1904
- transformFn: transformRESTAddressToSDKAddress,
1905
- paths: [
1906
- { path: 'service.locations.calculatedAddress' },
1907
- { path: 'service.locations.business.address' },
1908
- { path: 'service.locations.custom.address' },
1909
- ],
1910
- },
1911
- {
1912
- transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1913
- paths: [
1914
- { path: 'service.urls.servicePage' },
1915
- { path: 'service.urls.bookingPage' },
1916
- { path: 'service.urls.calendarPage' },
1917
- ],
1918
- },
1919
- ]));
1920
- }
1921
- catch (err) {
1922
- const transformedError = sdkTransformError(err, {
1923
- spreadPathsToArguments: {},
1924
- explicitPathsToArguments: { serviceId: '$[0]', pricingPlanIds: '$[1]' },
1925
- singleArgumentUnchanged: false,
1926
- }, ['serviceId', 'pricingPlanIds']);
1927
- sideEffects?.onError?.(err);
1928
- throw transformedError;
1929
- }
1930
- }
1931
- /**
1932
- * Removes a list of *pricing plan IDs*
1933
- * ([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))
1934
- * from a service's `payment.pricingPlanIds` array.
1935
- *
1936
- *
1937
- * If you remove all pricing plan IDs from `payment.pricingPlanIds` and the
1938
- * service supports only payments by pricing plan, customers will no longer be
1939
- * able to book the service, as they will have no payment options available.
1940
- * @param serviceId - ID of the service to update.
1941
- * @public
1942
- * @requiredField serviceId
1943
- * @permissionId BOOKINGS.SERVICES_PRICING_PLANS_REMOVE
1944
- * @permissionScope Manage Bookings
1945
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1946
- * @permissionScope Manage Bookings - all permissions
1947
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1948
- * @permissionScope Picasso private app mega scope
1949
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1950
- * @applicableIdentity APP
1951
- * @fqn wix.bookings.services.v2.ServicesService.DisablePricingPlansForService
1952
- */
1953
- export async function disablePricingPlansForService(serviceId, options) {
1954
- // @ts-ignore
1955
- const { httpClient, sideEffects } = arguments[2];
1956
- const payload = renameKeysFromSDKRequestToRESTRequest({
1957
- serviceId: serviceId,
1958
- pricingPlanIds: options?.pricingPlanIds,
1959
- });
1960
- const reqOpts = ambassadorWixBookingsServicesV2Service.disablePricingPlansForService(payload);
1961
- sideEffects?.onSiteCall?.();
1962
- try {
1963
- const result = await httpClient.request(reqOpts);
1964
- sideEffects?.onSuccess?.(result);
1965
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1966
- {
1967
- transformFn: transformRESTImageToSDKImage,
1968
- paths: [
1969
- { path: 'service.media.items.image' },
1970
- { path: 'service.media.mainMedia.image' },
1971
- { path: 'service.media.coverMedia.image' },
1972
- { path: 'service.staffMembers.mainMedia.image' },
1973
- { path: 'service.staffMemberDetails.staffMembers.mainMedia.image' },
1974
- ],
1975
- },
1976
- {
1977
- transformFn: transformRESTAddressToSDKAddress,
1978
- paths: [
1979
- { path: 'service.locations.calculatedAddress' },
1980
- { path: 'service.locations.business.address' },
1981
- { path: 'service.locations.custom.address' },
1982
- ],
1983
- },
1984
- {
1985
- transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1986
- paths: [
1987
- { path: 'service.urls.servicePage' },
1988
- { path: 'service.urls.bookingPage' },
1989
- { path: 'service.urls.calendarPage' },
1990
- ],
1991
- },
1992
- ]));
1993
- }
1994
- catch (err) {
1995
- const transformedError = sdkTransformError(err, {
1996
- spreadPathsToArguments: {},
1997
- explicitPathsToArguments: {
1998
- serviceId: '$[0]',
1999
- pricingPlanIds: '$[1].pricingPlanIds',
2000
- },
2001
- singleArgumentUnchanged: false,
2002
- }, ['serviceId', 'options']);
2003
- sideEffects?.onError?.(err);
2004
- throw transformedError;
2005
- }
2006
- }
2007
- /**
2008
- * Sets a new active slug for the service.
2009
- *
2010
- *
2011
- * The call fails if at least one of these conditions is met:
2012
- * - The slug doesn't adheres to the supported format.
2013
- * - Another service is currently using the slug.
2014
- * - Another service has used the slug in the past.
2015
- * @param serviceId - ID of the service for which to update the active slug.
2016
- * @public
2017
- * @requiredField serviceId
2018
- * @permissionId BOOKINGS.SERVICES_CUSTOM_SLUGS_SET
2019
- * @permissionScope Manage Bookings
2020
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
2021
- * @permissionScope Manage Bookings - all permissions
2022
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
2023
- * @permissionScope Picasso private app mega scope
2024
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
2025
- * @applicableIdentity APP
2026
- * @fqn wix.bookings.services.v2.ServicesService.SetCustomSlug
2027
- */
2028
- export async function setCustomSlug(serviceId, options) {
2029
- // @ts-ignore
2030
- const { httpClient, sideEffects } = arguments[2];
2031
- const payload = renameKeysFromSDKRequestToRESTRequest({
2032
- serviceId: serviceId,
2033
- slug: options?.slug,
2034
- });
2035
- const reqOpts = ambassadorWixBookingsServicesV2Service.setCustomSlug(payload);
2036
- sideEffects?.onSiteCall?.();
2037
- try {
2038
- const result = await httpClient.request(reqOpts);
2039
- sideEffects?.onSuccess?.(result);
2040
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
2041
- {
2042
- transformFn: transformRESTImageToSDKImage,
2043
- paths: [
2044
- { path: 'service.media.items.image' },
2045
- { path: 'service.media.mainMedia.image' },
2046
- { path: 'service.media.coverMedia.image' },
2047
- { path: 'service.staffMembers.mainMedia.image' },
2048
- { path: 'service.staffMemberDetails.staffMembers.mainMedia.image' },
2049
- ],
2050
- },
2051
- {
2052
- transformFn: transformRESTAddressToSDKAddress,
2053
- paths: [
2054
- { path: 'service.locations.calculatedAddress' },
2055
- { path: 'service.locations.business.address' },
2056
- { path: 'service.locations.custom.address' },
2057
- ],
2058
- },
2059
- {
2060
- transformFn: transformRESTPageURLV2ToSDKPageURLV2,
2061
- paths: [
2062
- { path: 'service.urls.servicePage' },
2063
- { path: 'service.urls.bookingPage' },
2064
- { path: 'service.urls.calendarPage' },
2065
- ],
2066
- },
2067
- ]));
2068
- }
2069
- catch (err) {
2070
- const transformedError = sdkTransformError(err, {
2071
- spreadPathsToArguments: {},
2072
- explicitPathsToArguments: { serviceId: '$[0]', slug: '$[1].slug' },
2073
- singleArgumentUnchanged: false,
2074
- }, ['serviceId', 'options']);
2075
- sideEffects?.onError?.(err);
2076
- throw transformedError;
2077
- }
2078
- }
2079
- /**
2080
- * Checks whether a custom slug is validate for the service.
2081
- *
2082
- *
2083
- * The checks include:
2084
- * - The slug adheres to the supported format.
2085
- * - No other service is currently using the slug.
2086
- * - No other service has used the slug in the past.
2087
- *
2088
- * The call fails if at least one of the checks fails.
2089
- * @param serviceId - IO of the service to check custom slug validity for.
2090
- * @public
2091
- * @requiredField serviceId
2092
- * @permissionId BOOKINGS.SERVICES_CUSTOM_SLUGS_SET
2093
- * @permissionScope Manage Bookings
2094
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
2095
- * @permissionScope Manage Bookings - all permissions
2096
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
2097
- * @permissionScope Picasso private app mega scope
2098
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
2099
- * @applicableIdentity APP
2100
- * @fqn wix.bookings.services.v2.ServicesService.ValidateSlug
2101
- */
2102
- export async function validateSlug(serviceId, options) {
2103
- // @ts-ignore
2104
- const { httpClient, sideEffects } = arguments[2];
2105
- const payload = renameKeysFromSDKRequestToRESTRequest({
2106
- serviceId: serviceId,
2107
- slug: options?.slug,
2108
- });
2109
- const reqOpts = ambassadorWixBookingsServicesV2Service.validateSlug(payload);
2110
- sideEffects?.onSiteCall?.();
2111
- try {
2112
- const result = await httpClient.request(reqOpts);
2113
- sideEffects?.onSuccess?.(result);
2114
- return renameKeysFromRESTResponseToSDKResponse(result.data);
2115
- }
2116
- catch (err) {
2117
- const transformedError = sdkTransformError(err, {
2118
- spreadPathsToArguments: {},
2119
- explicitPathsToArguments: { serviceId: '$[0]', slug: '$[1].slug' },
2120
- singleArgumentUnchanged: false,
2121
- }, ['serviceId', 'options']);
2122
- sideEffects?.onError?.(err);
2123
- throw transformedError;
2124
- }
2125
- }
2126
- /**
2127
- * Clones a service.
2128
- *
2129
- *
2130
- * ## Connected entities
2131
- *
2132
- * By default, not all entities connected to the service are cloned.
2133
- *
2134
- * ### Schedule
2135
- *
2136
- * Wix Bookings automatically creates a new active *schedule*
2137
- * ([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))
2138
- * for the cloned service. If Wix Bookings can't create this schedule, the
2139
- * Clone Service* call fails.
2140
- *
2141
- * - __For appointment-based services__: Future appointments aren't added to the
2142
- * cloned service's schedule. Use the *Events API*
2143
- * ([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))
2144
- * to add them as needed.
2145
- * - __For classes and courses__: Future one-time events aren't added to the
2146
- * cloned service's schedule, while future recurring events are added
2147
- * asynchronously. The *Clone Service* call always succeeds, whether or not
2148
- * recurring events are added.
2149
- * If the response includes `RECURRING_EVENTS` in the `errors` array, it means the
2150
- * cloned service doesn't have future recurring events, even though the original
2151
- * service does. You can either delete the cloned service and try again or use
2152
- * the *Events API*
2153
- * ([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))
2154
- * to add missing events to the schedule.
2155
- *
2156
- * Wix Bookings never adds past events to the cloned service's schedule.
2157
- *
2158
- * ### Service options and variants
2159
- *
2160
- * If the original service has *variants*
2161
- * ([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)),
2162
- * they're cloned asynchronously. The *Clone Service* call always succeeds,
2163
- * regardless of whether variants were cloned.
2164
- *
2165
- * If the response includes `OPTIONS_AND_VARIANTS` in the `errors` array, the cloned
2166
- * service doesn't have variants, even though the original service does. You can
2167
- * delete the cloned service and call *Clone Service* again, or use the
2168
- * _Service Options And Variants API_
2169
- * ([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))
2170
- * to add variants.
2171
- *
2172
- * ### Booking form
2173
- *
2174
- * The original service's booking form isn't cloned, whether it's
2175
- * the default or a custom booking form.
2176
- *
2177
- * ### Pricing plans
2178
- *
2179
- * If the original service's accepts payments via *pricing plans*
2180
- * ([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)),
2181
- * the cloned service's `payment.options.pricingPlan` is also set to `true`. To
2182
- * accept specific pricing plans, call *Enable Pricing Plans For Service*
2183
- * ([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)),
2184
- * after cloning the service. If the original service accepts only
2185
- * pricing plan payments and you don't call *Enable Pricing Plans For Service*
2186
- * after cloning the service, customers will be unable to book the service.
2187
- * @param sourceServiceId - ID of the service to clone.
2188
- * @public
2189
- * @requiredField sourceServiceId
2190
- * @permissionId BOOKINGS.SERVICES_CREATE
2191
- * @permissionScope Manage Bookings
2192
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
2193
- * @permissionScope Manage Bookings - all permissions
2194
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
2195
- * @permissionScope Picasso private app mega scope
2196
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
2197
- * @applicableIdentity APP
2198
- * @fqn wix.bookings.services.v2.ServicesService.CloneService
2199
- */
2200
- export async function cloneService(sourceServiceId) {
2201
- // @ts-ignore
2202
- const { httpClient, sideEffects } = arguments[1];
2203
- const payload = renameKeysFromSDKRequestToRESTRequest({
2204
- sourceServiceId: sourceServiceId,
2205
- });
2206
- const reqOpts = ambassadorWixBookingsServicesV2Service.cloneService(payload);
2207
- sideEffects?.onSiteCall?.();
2208
- try {
2209
- const result = await httpClient.request(reqOpts);
2210
- sideEffects?.onSuccess?.(result);
2211
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
2212
- {
2213
- transformFn: transformRESTImageToSDKImage,
2214
- paths: [
2215
- { path: 'service.media.items.image' },
2216
- { path: 'service.media.mainMedia.image' },
2217
- { path: 'service.media.coverMedia.image' },
2218
- { path: 'service.staffMembers.mainMedia.image' },
2219
- { path: 'service.staffMemberDetails.staffMembers.mainMedia.image' },
2220
- ],
2221
- },
2222
- {
2223
- transformFn: transformRESTAddressToSDKAddress,
2224
- paths: [
2225
- { path: 'service.locations.calculatedAddress' },
2226
- { path: 'service.locations.business.address' },
2227
- { path: 'service.locations.custom.address' },
2228
- ],
2229
- },
2230
- {
2231
- transformFn: transformRESTPageURLV2ToSDKPageURLV2,
2232
- paths: [
2233
- { path: 'service.urls.servicePage' },
2234
- { path: 'service.urls.bookingPage' },
2235
- { path: 'service.urls.calendarPage' },
2236
- ],
2237
- },
2238
- ]));
2239
- }
2240
- catch (err) {
2241
- const transformedError = sdkTransformError(err, {
2242
- spreadPathsToArguments: {},
2243
- explicitPathsToArguments: { sourceServiceId: '$[0]' },
2244
- singleArgumentUnchanged: false,
2245
- }, ['sourceServiceId']);
2246
- sideEffects?.onError?.(err);
2247
- throw transformedError;
2248
- }
2249
- }
2250
- //# sourceMappingURL=bookings-services-v2-service-services.universal.js.map