@wix/auto_sdk_bookings_services 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/bookings-services-v2-service-services.context.d.ts +41 -0
  11. package/build/cjs/src/bookings-services-v2-service-services.context.js +85 -0
  12. package/build/cjs/src/bookings-services-v2-service-services.context.js.map +1 -0
  13. package/build/cjs/src/bookings-services-v2-service-services.http.d.ts +482 -0
  14. package/build/cjs/src/bookings-services-v2-service-services.http.js +1790 -0
  15. package/build/cjs/src/bookings-services-v2-service-services.http.js.map +1 -0
  16. package/build/cjs/src/bookings-services-v2-service-services.meta.d.ts +47 -0
  17. package/build/cjs/src/bookings-services-v2-service-services.meta.js +427 -0
  18. package/build/cjs/src/bookings-services-v2-service-services.meta.js.map +1 -0
  19. package/build/cjs/src/bookings-services-v2-service-services.public.d.ts +584 -0
  20. package/build/cjs/src/bookings-services-v2-service-services.public.js +307 -0
  21. package/build/cjs/src/bookings-services-v2-service-services.public.js.map +1 -0
  22. package/build/cjs/src/bookings-services-v2-service-services.types.d.ts +4056 -0
  23. package/build/cjs/src/bookings-services-v2-service-services.types.js +386 -0
  24. package/build/cjs/src/bookings-services-v2-service-services.types.js.map +1 -0
  25. package/build/cjs/src/bookings-services-v2-service-services.universal.d.ts +5180 -0
  26. package/build/cjs/src/bookings-services-v2-service-services.universal.js +2282 -0
  27. package/build/cjs/src/bookings-services-v2-service-services.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/bookings-services-v2-service-services.context.d.ts +41 -0
  39. package/build/es/src/bookings-services-v2-service-services.context.js +41 -0
  40. package/build/es/src/bookings-services-v2-service-services.context.js.map +1 -0
  41. package/build/es/src/bookings-services-v2-service-services.http.d.ts +482 -0
  42. package/build/es/src/bookings-services-v2-service-services.http.js +1766 -0
  43. package/build/es/src/bookings-services-v2-service-services.http.js.map +1 -0
  44. package/build/es/src/bookings-services-v2-service-services.meta.d.ts +47 -0
  45. package/build/es/src/bookings-services-v2-service-services.meta.js +380 -0
  46. package/build/es/src/bookings-services-v2-service-services.meta.js.map +1 -0
  47. package/build/es/src/bookings-services-v2-service-services.public.d.ts +584 -0
  48. package/build/es/src/bookings-services-v2-service-services.public.js +242 -0
  49. package/build/es/src/bookings-services-v2-service-services.public.js.map +1 -0
  50. package/build/es/src/bookings-services-v2-service-services.types.d.ts +4056 -0
  51. package/build/es/src/bookings-services-v2-service-services.types.js +383 -0
  52. package/build/es/src/bookings-services-v2-service-services.types.js.map +1 -0
  53. package/build/es/src/bookings-services-v2-service-services.universal.d.ts +5180 -0
  54. package/build/es/src/bookings-services-v2-service-services.universal.js +2234 -0
  55. package/build/es/src/bookings-services-v2-service-services.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/bookings-services-v2-service-services.context.d.ts +41 -0
  66. package/build/internal/cjs/src/bookings-services-v2-service-services.context.js +85 -0
  67. package/build/internal/cjs/src/bookings-services-v2-service-services.context.js.map +1 -0
  68. package/build/internal/cjs/src/bookings-services-v2-service-services.http.d.ts +482 -0
  69. package/build/internal/cjs/src/bookings-services-v2-service-services.http.js +1790 -0
  70. package/build/internal/cjs/src/bookings-services-v2-service-services.http.js.map +1 -0
  71. package/build/internal/cjs/src/bookings-services-v2-service-services.meta.d.ts +47 -0
  72. package/build/internal/cjs/src/bookings-services-v2-service-services.meta.js +427 -0
  73. package/build/internal/cjs/src/bookings-services-v2-service-services.meta.js.map +1 -0
  74. package/build/internal/cjs/src/bookings-services-v2-service-services.public.d.ts +584 -0
  75. package/build/internal/cjs/src/bookings-services-v2-service-services.public.js +307 -0
  76. package/build/internal/cjs/src/bookings-services-v2-service-services.public.js.map +1 -0
  77. package/build/internal/cjs/src/bookings-services-v2-service-services.types.d.ts +4056 -0
  78. package/build/internal/cjs/src/bookings-services-v2-service-services.types.js +386 -0
  79. package/build/internal/cjs/src/bookings-services-v2-service-services.types.js.map +1 -0
  80. package/build/internal/cjs/src/bookings-services-v2-service-services.universal.d.ts +5180 -0
  81. package/build/internal/cjs/src/bookings-services-v2-service-services.universal.js +2282 -0
  82. package/build/internal/cjs/src/bookings-services-v2-service-services.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/bookings-services-v2-service-services.context.d.ts +41 -0
  93. package/build/internal/es/src/bookings-services-v2-service-services.context.js +41 -0
  94. package/build/internal/es/src/bookings-services-v2-service-services.context.js.map +1 -0
  95. package/build/internal/es/src/bookings-services-v2-service-services.http.d.ts +482 -0
  96. package/build/internal/es/src/bookings-services-v2-service-services.http.js +1766 -0
  97. package/build/internal/es/src/bookings-services-v2-service-services.http.js.map +1 -0
  98. package/build/internal/es/src/bookings-services-v2-service-services.meta.d.ts +47 -0
  99. package/build/internal/es/src/bookings-services-v2-service-services.meta.js +380 -0
  100. package/build/internal/es/src/bookings-services-v2-service-services.meta.js.map +1 -0
  101. package/build/internal/es/src/bookings-services-v2-service-services.public.d.ts +584 -0
  102. package/build/internal/es/src/bookings-services-v2-service-services.public.js +242 -0
  103. package/build/internal/es/src/bookings-services-v2-service-services.public.js.map +1 -0
  104. package/build/internal/es/src/bookings-services-v2-service-services.types.d.ts +4056 -0
  105. package/build/internal/es/src/bookings-services-v2-service-services.types.js +383 -0
  106. package/build/internal/es/src/bookings-services-v2-service-services.types.js.map +1 -0
  107. package/build/internal/es/src/bookings-services-v2-service-services.universal.d.ts +5180 -0
  108. package/build/internal/es/src/bookings-services-v2-service-services.universal.js +2234 -0
  109. package/build/internal/es/src/bookings-services-v2-service-services.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,1790 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cloneService = exports.validateSlug = exports.setCustomSlug = exports.disablePricingPlansForService = exports.enablePricingPlansForService = exports.setServiceLocations = exports.queryCategories = exports.queryLocations = exports.countServices = exports.queryBookingForms = exports.queryPolicies = exports.searchServices = exports.queryServices = exports.bulkDeleteServicesByFilter = exports.bulkDeleteServices = exports.deleteService = exports.bulkUpdateServicesByFilter = exports.bulkUpdateServices = exports.updateService = exports.getService = exports.createService = void 0;
4
+ const rest_modules_1 = require("@wix/sdk-runtime/rest-modules");
5
+ const float_1 = require("@wix/sdk-runtime/transformations/float");
6
+ const float_2 = require("@wix/sdk-runtime/transformations/float");
7
+ const timestamp_1 = require("@wix/sdk-runtime/transformations/timestamp");
8
+ const timestamp_2 = require("@wix/sdk-runtime/transformations/timestamp");
9
+ const field_mask_1 = require("@wix/sdk-runtime/transformations/field-mask");
10
+ const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
11
+ const rest_modules_2 = require("@wix/sdk-runtime/rest-modules");
12
+ function resolveWixBookingsServicesV2ServicesServiceUrl(opts) {
13
+ const domainToMappings = {
14
+ '*.dev.wix-code.com': [
15
+ {
16
+ srcPath: '/_api/services-2',
17
+ destPath: '',
18
+ },
19
+ {
20
+ srcPath: '/_api/bookings/v2/services',
21
+ destPath: '/v2/services',
22
+ },
23
+ ],
24
+ 'www.wixapis.com': [
25
+ {
26
+ srcPath: '/_api/bookings/v2/services',
27
+ destPath: '/v2/services',
28
+ },
29
+ {
30
+ srcPath: '/bookings/v2/services',
31
+ destPath: '/v2/services',
32
+ },
33
+ {
34
+ srcPath: '/bookings/v2/bulk/services',
35
+ destPath: '/v2/bulk/services',
36
+ },
37
+ ],
38
+ 'manage._base_domain_': [
39
+ {
40
+ srcPath: '/_api/bookings/v2/services',
41
+ destPath: '/v2/services',
42
+ },
43
+ {
44
+ srcPath: '/_api/bookings/v2/bulk/services',
45
+ destPath: '/v2/bulk/services',
46
+ },
47
+ ],
48
+ 'editor._base_domain_': [
49
+ {
50
+ srcPath: '/_api/bookings/v2/services',
51
+ destPath: '/v2/services',
52
+ },
53
+ {
54
+ srcPath: '/_api/bookings/v2/bulk/services',
55
+ destPath: '/v2/bulk/services',
56
+ },
57
+ ],
58
+ 'blocks._base_domain_': [
59
+ {
60
+ srcPath: '/_api/bookings/v2/services',
61
+ destPath: '/v2/services',
62
+ },
63
+ {
64
+ srcPath: '/_api/bookings/v2/bulk/services',
65
+ destPath: '/v2/bulk/services',
66
+ },
67
+ ],
68
+ 'create.editorx': [
69
+ {
70
+ srcPath: '/_api/bookings/v2/services',
71
+ destPath: '/v2/services',
72
+ },
73
+ {
74
+ srcPath: '/_api/bookings/v2/bulk/services',
75
+ destPath: '/v2/bulk/services',
76
+ },
77
+ ],
78
+ _: [
79
+ {
80
+ srcPath: '/_api/bookings/v2/services',
81
+ destPath: '/v2/services',
82
+ },
83
+ ],
84
+ 'www._base_domain_': [
85
+ {
86
+ srcPath: '/_api/bookings/v2/services',
87
+ destPath: '/v2/services',
88
+ },
89
+ ],
90
+ 'bo._base_domain_': [
91
+ {
92
+ srcPath: '/_api/bookings/v2/services',
93
+ destPath: '/v2/services',
94
+ },
95
+ ],
96
+ 'wixbo.ai': [
97
+ {
98
+ srcPath: '/_api/bookings/v2/services',
99
+ destPath: '/v2/services',
100
+ },
101
+ ],
102
+ 'wix-bo.com': [
103
+ {
104
+ srcPath: '/_api/bookings/v2/services',
105
+ destPath: '/v2/services',
106
+ },
107
+ ],
108
+ 'editor.wixapps.net': [
109
+ {
110
+ srcPath: '/_api/bookings/v2/services',
111
+ destPath: '/v2/services',
112
+ },
113
+ ],
114
+ 'api._api_base_domain_': [
115
+ {
116
+ srcPath: '/services-2',
117
+ destPath: '',
118
+ },
119
+ ],
120
+ };
121
+ return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
122
+ }
123
+ const PACKAGE_NAME = '@wix/auto_sdk_bookings_services';
124
+ /**
125
+ * Creates a service.
126
+ *
127
+ *
128
+ * ## Required fields
129
+ *
130
+ * When creating a service you must specify the following fields:
131
+ * - `type`
132
+ * ([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)):
133
+ * Whether it's an appointment-based service, class, or course.
134
+ * - `name`: Service name that's displayed to customers.
135
+ * - `onlineBooking`:
136
+ * Settings determining whether customers can book online, whether the business
137
+ * must manually confirm bookings, and whether customers can request to book an
138
+ * appointment time slot that already has a booking request awaiting business
139
+ * confirmation.
140
+ * - `payment`
141
+ * ([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)):
142
+ * How customers can pay when signing up for the service.
143
+ *
144
+ * ### Session durations
145
+ *
146
+ * Depending on which type of service you're creating, you may also need to specify
147
+ * supported session durations.
148
+ *
149
+ * __Classes and courses__
150
+ *
151
+ * Don't specify `schedule.availabilityConstraints.sessionDurations`.
152
+ *
153
+ * __Appointment-based services without varied pricing based on session length__
154
+ *
155
+ * Specify the single supported session duration in the
156
+ * `schedule.availabilityConstraints.sessionDurations` array.
157
+ *
158
+ * __Appointment-based services with varied pricing based on session length__
159
+ *
160
+ * - Specify all supported session durations in `schedule.availabilityConstraints.sessionDurations`.
161
+ * - Note that Wix Bookings doesn't display these values to customers and
162
+ * ignores them in pricing and availability calculations. Instead session
163
+ * durations are retrieved from the relevant service variants
164
+ * ([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)).
165
+ * - It is mandatory to specify `schedule.availabilityConstraints.sessionDurations`,
166
+ * even though these values are ignored.
167
+ */
168
+ function createService(payload) {
169
+ function __createService({ host }) {
170
+ const serializedData = (0, transform_paths_1.transformPaths)(payload, [
171
+ {
172
+ transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
173
+ paths: [
174
+ { path: 'service.createdDate' },
175
+ { path: 'service.updatedDate' },
176
+ { path: 'service.media.items.image.urlExpirationDate' },
177
+ { path: 'service.media.mainMedia.image.urlExpirationDate' },
178
+ { path: 'service.media.coverMedia.image.urlExpirationDate' },
179
+ { path: 'service.bookingPolicy.createdDate' },
180
+ { path: 'service.bookingPolicy.updatedDate' },
181
+ { path: 'service.schedule.firstSessionStart' },
182
+ { path: 'service.schedule.lastSessionEnd' },
183
+ { path: 'service.staffMembers.mainMedia.image.urlExpirationDate' },
184
+ {
185
+ path: 'service.staffMemberDetails.staffMembers.mainMedia.image.urlExpirationDate',
186
+ },
187
+ { path: 'service.supportedSlugs.createdDate' },
188
+ { path: 'service.mainSlug.createdDate' },
189
+ ],
190
+ },
191
+ {
192
+ transformFn: float_1.transformSDKFloatToRESTFloat,
193
+ paths: [
194
+ { path: 'service.locations.business.address.geocode.latitude' },
195
+ { path: 'service.locations.business.address.geocode.longitude' },
196
+ { path: 'service.locations.custom.address.geocode.latitude' },
197
+ { path: 'service.locations.custom.address.geocode.longitude' },
198
+ { path: 'service.locations.calculatedAddress.geocode.latitude' },
199
+ { path: 'service.locations.calculatedAddress.geocode.longitude' },
200
+ ],
201
+ },
202
+ ]);
203
+ const metadata = {
204
+ entityFqdn: 'wix.bookings.services.v2.service',
205
+ method: 'POST',
206
+ methodFqn: 'wix.bookings.services.v2.ServicesService.CreateService',
207
+ packageName: PACKAGE_NAME,
208
+ url: resolveWixBookingsServicesV2ServicesServiceUrl({
209
+ protoPath: '/v2/services',
210
+ data: serializedData,
211
+ host,
212
+ }),
213
+ data: serializedData,
214
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
215
+ {
216
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
217
+ paths: [
218
+ { path: 'service.createdDate' },
219
+ { path: 'service.updatedDate' },
220
+ { path: 'service.media.items.image.urlExpirationDate' },
221
+ { path: 'service.media.mainMedia.image.urlExpirationDate' },
222
+ { path: 'service.media.coverMedia.image.urlExpirationDate' },
223
+ { path: 'service.bookingPolicy.createdDate' },
224
+ { path: 'service.bookingPolicy.updatedDate' },
225
+ { path: 'service.schedule.firstSessionStart' },
226
+ { path: 'service.schedule.lastSessionEnd' },
227
+ {
228
+ path: 'service.staffMembers.mainMedia.image.urlExpirationDate',
229
+ },
230
+ {
231
+ path: 'service.staffMemberDetails.staffMembers.mainMedia.image.urlExpirationDate',
232
+ },
233
+ { path: 'service.supportedSlugs.createdDate' },
234
+ { path: 'service.mainSlug.createdDate' },
235
+ ],
236
+ },
237
+ {
238
+ transformFn: float_2.transformRESTFloatToSDKFloat,
239
+ paths: [
240
+ { path: 'service.locations.business.address.geocode.latitude' },
241
+ { path: 'service.locations.business.address.geocode.longitude' },
242
+ { path: 'service.locations.custom.address.geocode.latitude' },
243
+ { path: 'service.locations.custom.address.geocode.longitude' },
244
+ { path: 'service.locations.calculatedAddress.geocode.latitude' },
245
+ { path: 'service.locations.calculatedAddress.geocode.longitude' },
246
+ ],
247
+ },
248
+ ]),
249
+ };
250
+ return metadata;
251
+ }
252
+ return __createService;
253
+ }
254
+ exports.createService = createService;
255
+ /** Retrieves a service. */
256
+ function getService(payload) {
257
+ function __getService({ host }) {
258
+ const metadata = {
259
+ entityFqdn: 'wix.bookings.services.v2.service',
260
+ method: 'GET',
261
+ methodFqn: 'wix.bookings.services.v2.ServicesService.GetService',
262
+ packageName: PACKAGE_NAME,
263
+ url: resolveWixBookingsServicesV2ServicesServiceUrl({
264
+ protoPath: '/v2/services/{serviceId}',
265
+ data: payload,
266
+ host,
267
+ }),
268
+ params: (0, rest_modules_1.toURLSearchParams)(payload),
269
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
270
+ {
271
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
272
+ paths: [
273
+ { path: 'service.createdDate' },
274
+ { path: 'service.updatedDate' },
275
+ { path: 'service.media.items.image.urlExpirationDate' },
276
+ { path: 'service.media.mainMedia.image.urlExpirationDate' },
277
+ { path: 'service.media.coverMedia.image.urlExpirationDate' },
278
+ { path: 'service.bookingPolicy.createdDate' },
279
+ { path: 'service.bookingPolicy.updatedDate' },
280
+ { path: 'service.schedule.firstSessionStart' },
281
+ { path: 'service.schedule.lastSessionEnd' },
282
+ {
283
+ path: 'service.staffMembers.mainMedia.image.urlExpirationDate',
284
+ },
285
+ {
286
+ path: 'service.staffMemberDetails.staffMembers.mainMedia.image.urlExpirationDate',
287
+ },
288
+ { path: 'service.supportedSlugs.createdDate' },
289
+ { path: 'service.mainSlug.createdDate' },
290
+ ],
291
+ },
292
+ {
293
+ transformFn: float_2.transformRESTFloatToSDKFloat,
294
+ paths: [
295
+ { path: 'service.locations.business.address.geocode.latitude' },
296
+ { path: 'service.locations.business.address.geocode.longitude' },
297
+ { path: 'service.locations.custom.address.geocode.latitude' },
298
+ { path: 'service.locations.custom.address.geocode.longitude' },
299
+ { path: 'service.locations.calculatedAddress.geocode.latitude' },
300
+ { path: 'service.locations.calculatedAddress.geocode.longitude' },
301
+ ],
302
+ },
303
+ ]),
304
+ };
305
+ return metadata;
306
+ }
307
+ return __getService;
308
+ }
309
+ exports.getService = getService;
310
+ /**
311
+ * Updates a service.
312
+ *
313
+ *
314
+ * Each time the service is updated, `revision` increments by 1. You must
315
+ * include the number of the existing revision when updating the service.
316
+ * This ensures you're working with the latest service information and
317
+ * prevents unintended overwrites.
318
+ *
319
+ * ## Session durations
320
+ *
321
+ * Specify `schedule.availabilityConstraints.sessionDurations`
322
+ * only if you want to update it for appointment-based services without varied
323
+ * pricing based on session length. Don't specify `schedule.availabilityConstraints.sessionDurations`
324
+ * for all other appointment-based services, classes, or courses. See Create Service
325
+ * ([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))
326
+ * for more details.
327
+ */
328
+ function updateService(payload) {
329
+ function __updateService({ host }) {
330
+ const serializedData = (0, transform_paths_1.transformPaths)(payload, [
331
+ {
332
+ transformFn: field_mask_1.transformSDKFieldMaskToRESTFieldMask,
333
+ paths: [{ path: 'mask' }],
334
+ },
335
+ {
336
+ transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
337
+ paths: [
338
+ { path: 'service.createdDate' },
339
+ { path: 'service.updatedDate' },
340
+ { path: 'service.media.items.image.urlExpirationDate' },
341
+ { path: 'service.media.mainMedia.image.urlExpirationDate' },
342
+ { path: 'service.media.coverMedia.image.urlExpirationDate' },
343
+ { path: 'service.bookingPolicy.createdDate' },
344
+ { path: 'service.bookingPolicy.updatedDate' },
345
+ { path: 'service.schedule.firstSessionStart' },
346
+ { path: 'service.schedule.lastSessionEnd' },
347
+ { path: 'service.staffMembers.mainMedia.image.urlExpirationDate' },
348
+ {
349
+ path: 'service.staffMemberDetails.staffMembers.mainMedia.image.urlExpirationDate',
350
+ },
351
+ { path: 'service.supportedSlugs.createdDate' },
352
+ { path: 'service.mainSlug.createdDate' },
353
+ ],
354
+ },
355
+ {
356
+ transformFn: float_1.transformSDKFloatToRESTFloat,
357
+ paths: [
358
+ { path: 'service.locations.business.address.geocode.latitude' },
359
+ { path: 'service.locations.business.address.geocode.longitude' },
360
+ { path: 'service.locations.custom.address.geocode.latitude' },
361
+ { path: 'service.locations.custom.address.geocode.longitude' },
362
+ { path: 'service.locations.calculatedAddress.geocode.latitude' },
363
+ { path: 'service.locations.calculatedAddress.geocode.longitude' },
364
+ ],
365
+ },
366
+ ]);
367
+ const metadata = {
368
+ entityFqdn: 'wix.bookings.services.v2.service',
369
+ method: 'PATCH',
370
+ methodFqn: 'wix.bookings.services.v2.ServicesService.UpdateService',
371
+ packageName: PACKAGE_NAME,
372
+ url: resolveWixBookingsServicesV2ServicesServiceUrl({
373
+ protoPath: '/v2/services/{service.id}',
374
+ data: serializedData,
375
+ host,
376
+ }),
377
+ data: serializedData,
378
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
379
+ {
380
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
381
+ paths: [
382
+ { path: 'service.createdDate' },
383
+ { path: 'service.updatedDate' },
384
+ { path: 'service.media.items.image.urlExpirationDate' },
385
+ { path: 'service.media.mainMedia.image.urlExpirationDate' },
386
+ { path: 'service.media.coverMedia.image.urlExpirationDate' },
387
+ { path: 'service.bookingPolicy.createdDate' },
388
+ { path: 'service.bookingPolicy.updatedDate' },
389
+ { path: 'service.schedule.firstSessionStart' },
390
+ { path: 'service.schedule.lastSessionEnd' },
391
+ {
392
+ path: 'service.staffMembers.mainMedia.image.urlExpirationDate',
393
+ },
394
+ {
395
+ path: 'service.staffMemberDetails.staffMembers.mainMedia.image.urlExpirationDate',
396
+ },
397
+ { path: 'service.supportedSlugs.createdDate' },
398
+ { path: 'service.mainSlug.createdDate' },
399
+ ],
400
+ },
401
+ {
402
+ transformFn: float_2.transformRESTFloatToSDKFloat,
403
+ paths: [
404
+ { path: 'service.locations.business.address.geocode.latitude' },
405
+ { path: 'service.locations.business.address.geocode.longitude' },
406
+ { path: 'service.locations.custom.address.geocode.latitude' },
407
+ { path: 'service.locations.custom.address.geocode.longitude' },
408
+ { path: 'service.locations.calculatedAddress.geocode.latitude' },
409
+ { path: 'service.locations.calculatedAddress.geocode.longitude' },
410
+ ],
411
+ },
412
+ ]),
413
+ };
414
+ return metadata;
415
+ }
416
+ return __updateService;
417
+ }
418
+ exports.updateService = updateService;
419
+ /**
420
+ * Updates multiple services.
421
+ *
422
+ *
423
+ * See Update Service
424
+ * ([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))
425
+ * for more details.
426
+ *
427
+ * The call succeeds even if one or more individual services can't be updated.
428
+ * Information about failures is returned in `bulkActionMetadata`.
429
+ */
430
+ function bulkUpdateServices(payload) {
431
+ function __bulkUpdateServices({ host }) {
432
+ const serializedData = (0, transform_paths_1.transformPaths)(payload, [
433
+ {
434
+ transformFn: field_mask_1.transformSDKFieldMaskToRESTFieldMask,
435
+ paths: [{ path: 'services.mask' }],
436
+ },
437
+ {
438
+ transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
439
+ paths: [
440
+ { path: 'services.service.createdDate' },
441
+ { path: 'services.service.updatedDate' },
442
+ { path: 'services.service.media.items.image.urlExpirationDate' },
443
+ { path: 'services.service.media.mainMedia.image.urlExpirationDate' },
444
+ { path: 'services.service.media.coverMedia.image.urlExpirationDate' },
445
+ { path: 'services.service.bookingPolicy.createdDate' },
446
+ { path: 'services.service.bookingPolicy.updatedDate' },
447
+ { path: 'services.service.schedule.firstSessionStart' },
448
+ { path: 'services.service.schedule.lastSessionEnd' },
449
+ {
450
+ path: 'services.service.staffMembers.mainMedia.image.urlExpirationDate',
451
+ },
452
+ {
453
+ path: 'services.service.staffMemberDetails.staffMembers.mainMedia.image.urlExpirationDate',
454
+ },
455
+ { path: 'services.service.supportedSlugs.createdDate' },
456
+ { path: 'services.service.mainSlug.createdDate' },
457
+ ],
458
+ },
459
+ {
460
+ transformFn: float_1.transformSDKFloatToRESTFloat,
461
+ paths: [
462
+ {
463
+ path: 'services.service.locations.business.address.geocode.latitude',
464
+ },
465
+ {
466
+ path: 'services.service.locations.business.address.geocode.longitude',
467
+ },
468
+ {
469
+ path: 'services.service.locations.custom.address.geocode.latitude',
470
+ },
471
+ {
472
+ path: 'services.service.locations.custom.address.geocode.longitude',
473
+ },
474
+ {
475
+ path: 'services.service.locations.calculatedAddress.geocode.latitude',
476
+ },
477
+ {
478
+ path: 'services.service.locations.calculatedAddress.geocode.longitude',
479
+ },
480
+ ],
481
+ },
482
+ ]);
483
+ const metadata = {
484
+ entityFqdn: 'wix.bookings.services.v2.service',
485
+ method: 'POST',
486
+ methodFqn: 'wix.bookings.services.v2.ServicesService.BulkUpdateServices',
487
+ packageName: PACKAGE_NAME,
488
+ url: resolveWixBookingsServicesV2ServicesServiceUrl({
489
+ protoPath: '/v2/bulk/services/update',
490
+ data: serializedData,
491
+ host,
492
+ }),
493
+ data: serializedData,
494
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
495
+ {
496
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
497
+ paths: [
498
+ { path: 'results.item.createdDate' },
499
+ { path: 'results.item.updatedDate' },
500
+ { path: 'results.item.media.items.image.urlExpirationDate' },
501
+ { path: 'results.item.media.mainMedia.image.urlExpirationDate' },
502
+ { path: 'results.item.media.coverMedia.image.urlExpirationDate' },
503
+ { path: 'results.item.bookingPolicy.createdDate' },
504
+ { path: 'results.item.bookingPolicy.updatedDate' },
505
+ { path: 'results.item.schedule.firstSessionStart' },
506
+ { path: 'results.item.schedule.lastSessionEnd' },
507
+ {
508
+ path: 'results.item.staffMembers.mainMedia.image.urlExpirationDate',
509
+ },
510
+ {
511
+ path: 'results.item.staffMemberDetails.staffMembers.mainMedia.image.urlExpirationDate',
512
+ },
513
+ { path: 'results.item.supportedSlugs.createdDate' },
514
+ { path: 'results.item.mainSlug.createdDate' },
515
+ ],
516
+ },
517
+ {
518
+ transformFn: float_2.transformRESTFloatToSDKFloat,
519
+ paths: [
520
+ {
521
+ path: 'results.item.locations.business.address.geocode.latitude',
522
+ },
523
+ {
524
+ path: 'results.item.locations.business.address.geocode.longitude',
525
+ },
526
+ {
527
+ path: 'results.item.locations.custom.address.geocode.latitude',
528
+ },
529
+ {
530
+ path: 'results.item.locations.custom.address.geocode.longitude',
531
+ },
532
+ {
533
+ path: 'results.item.locations.calculatedAddress.geocode.latitude',
534
+ },
535
+ {
536
+ path: 'results.item.locations.calculatedAddress.geocode.longitude',
537
+ },
538
+ ],
539
+ },
540
+ ]),
541
+ };
542
+ return metadata;
543
+ }
544
+ return __bulkUpdateServices;
545
+ }
546
+ exports.bulkUpdateServices = bulkUpdateServices;
547
+ /**
548
+ * Updates multiple services by filter.
549
+ *
550
+ *
551
+ * Refer to the supported filters article
552
+ * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/filtering-and-sorting#filtering))
553
+ * for more details.
554
+ *
555
+ * See Update Service
556
+ * ([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))
557
+ * for more details about updating a service.
558
+ *
559
+ * The call succeeds even if one or more individual services can't be updated.
560
+ * Information about failures is returned in `bulkActionMetadata`.
561
+ */
562
+ function bulkUpdateServicesByFilter(payload) {
563
+ function __bulkUpdateServicesByFilter({ host }) {
564
+ const serializedData = (0, transform_paths_1.transformPaths)(payload, [
565
+ {
566
+ transformFn: field_mask_1.transformSDKFieldMaskToRESTFieldMask,
567
+ paths: [{ path: 'mask' }],
568
+ },
569
+ {
570
+ transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
571
+ paths: [
572
+ { path: 'service.createdDate' },
573
+ { path: 'service.updatedDate' },
574
+ { path: 'service.media.items.image.urlExpirationDate' },
575
+ { path: 'service.media.mainMedia.image.urlExpirationDate' },
576
+ { path: 'service.media.coverMedia.image.urlExpirationDate' },
577
+ { path: 'service.bookingPolicy.createdDate' },
578
+ { path: 'service.bookingPolicy.updatedDate' },
579
+ { path: 'service.schedule.firstSessionStart' },
580
+ { path: 'service.schedule.lastSessionEnd' },
581
+ { path: 'service.staffMembers.mainMedia.image.urlExpirationDate' },
582
+ {
583
+ path: 'service.staffMemberDetails.staffMembers.mainMedia.image.urlExpirationDate',
584
+ },
585
+ { path: 'service.supportedSlugs.createdDate' },
586
+ { path: 'service.mainSlug.createdDate' },
587
+ ],
588
+ },
589
+ {
590
+ transformFn: float_1.transformSDKFloatToRESTFloat,
591
+ paths: [
592
+ { path: 'service.locations.business.address.geocode.latitude' },
593
+ { path: 'service.locations.business.address.geocode.longitude' },
594
+ { path: 'service.locations.custom.address.geocode.latitude' },
595
+ { path: 'service.locations.custom.address.geocode.longitude' },
596
+ { path: 'service.locations.calculatedAddress.geocode.latitude' },
597
+ { path: 'service.locations.calculatedAddress.geocode.longitude' },
598
+ ],
599
+ },
600
+ ]);
601
+ const metadata = {
602
+ entityFqdn: 'wix.bookings.services.v2.service',
603
+ method: 'POST',
604
+ methodFqn: 'wix.bookings.services.v2.ServicesService.BulkUpdateServicesByFilter',
605
+ packageName: PACKAGE_NAME,
606
+ url: resolveWixBookingsServicesV2ServicesServiceUrl({
607
+ protoPath: '/v2/bulk/services/update-by-filter',
608
+ data: serializedData,
609
+ host,
610
+ }),
611
+ data: serializedData,
612
+ };
613
+ return metadata;
614
+ }
615
+ return __bulkUpdateServicesByFilter;
616
+ }
617
+ exports.bulkUpdateServicesByFilter = bulkUpdateServicesByFilter;
618
+ /**
619
+ * Deletes a service.
620
+ *
621
+ *
622
+ * Specify `{"preserveFutureSessionsWithParticipants": true}` to retain all
623
+ * future sessions for the service. By default, all future sessions are canceled.
624
+ */
625
+ function deleteService(payload) {
626
+ function __deleteService({ host }) {
627
+ const metadata = {
628
+ entityFqdn: 'wix.bookings.services.v2.service',
629
+ method: 'DELETE',
630
+ methodFqn: 'wix.bookings.services.v2.ServicesService.DeleteService',
631
+ packageName: PACKAGE_NAME,
632
+ url: resolveWixBookingsServicesV2ServicesServiceUrl({
633
+ protoPath: '/v2/services/{serviceId}',
634
+ data: payload,
635
+ host,
636
+ }),
637
+ params: (0, rest_modules_1.toURLSearchParams)(payload),
638
+ };
639
+ return metadata;
640
+ }
641
+ return __deleteService;
642
+ }
643
+ exports.deleteService = deleteService;
644
+ /**
645
+ * Deletes multiple services.
646
+ *
647
+ *
648
+ * See Delete Service
649
+ * ([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))
650
+ * for more details about deleting a service.
651
+ *
652
+ * The call succeeds even if one or more individual services can't be deleted.
653
+ * Information about failures is returned in `bulkActionMetadata`.
654
+ */
655
+ function bulkDeleteServices(payload) {
656
+ function __bulkDeleteServices({ host }) {
657
+ const metadata = {
658
+ entityFqdn: 'wix.bookings.services.v2.service',
659
+ method: 'POST',
660
+ methodFqn: 'wix.bookings.services.v2.ServicesService.BulkDeleteServices',
661
+ packageName: PACKAGE_NAME,
662
+ url: resolveWixBookingsServicesV2ServicesServiceUrl({
663
+ protoPath: '/v2/bulk/services/delete',
664
+ data: payload,
665
+ host,
666
+ }),
667
+ data: payload,
668
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
669
+ {
670
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
671
+ paths: [
672
+ { path: 'results.item.createdDate' },
673
+ { path: 'results.item.updatedDate' },
674
+ { path: 'results.item.media.items.image.urlExpirationDate' },
675
+ { path: 'results.item.media.mainMedia.image.urlExpirationDate' },
676
+ { path: 'results.item.media.coverMedia.image.urlExpirationDate' },
677
+ { path: 'results.item.bookingPolicy.createdDate' },
678
+ { path: 'results.item.bookingPolicy.updatedDate' },
679
+ { path: 'results.item.schedule.firstSessionStart' },
680
+ { path: 'results.item.schedule.lastSessionEnd' },
681
+ {
682
+ path: 'results.item.staffMembers.mainMedia.image.urlExpirationDate',
683
+ },
684
+ {
685
+ path: 'results.item.staffMemberDetails.staffMembers.mainMedia.image.urlExpirationDate',
686
+ },
687
+ { path: 'results.item.supportedSlugs.createdDate' },
688
+ { path: 'results.item.mainSlug.createdDate' },
689
+ ],
690
+ },
691
+ {
692
+ transformFn: float_2.transformRESTFloatToSDKFloat,
693
+ paths: [
694
+ {
695
+ path: 'results.item.locations.business.address.geocode.latitude',
696
+ },
697
+ {
698
+ path: 'results.item.locations.business.address.geocode.longitude',
699
+ },
700
+ {
701
+ path: 'results.item.locations.custom.address.geocode.latitude',
702
+ },
703
+ {
704
+ path: 'results.item.locations.custom.address.geocode.longitude',
705
+ },
706
+ {
707
+ path: 'results.item.locations.calculatedAddress.geocode.latitude',
708
+ },
709
+ {
710
+ path: 'results.item.locations.calculatedAddress.geocode.longitude',
711
+ },
712
+ ],
713
+ },
714
+ ]),
715
+ };
716
+ return metadata;
717
+ }
718
+ return __bulkDeleteServices;
719
+ }
720
+ exports.bulkDeleteServices = bulkDeleteServices;
721
+ /**
722
+ * Deletes multiple services by filter.
723
+ *
724
+ *
725
+ * See Delete Service
726
+ * ([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))
727
+ * for more details about deleting a service.
728
+ *
729
+ * The call succeeds even if one or more individual services can't be deleted.
730
+ * Information about failures is returned in `bulkActionMetadata`.
731
+ *
732
+ * Refer to the supported filters article
733
+ * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/filtering-and-sorting#filtering))
734
+ * for more details.
735
+ *
736
+ * To learn about working with filters in general, see
737
+ * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).
738
+ */
739
+ function bulkDeleteServicesByFilter(payload) {
740
+ function __bulkDeleteServicesByFilter({ host }) {
741
+ const metadata = {
742
+ entityFqdn: 'wix.bookings.services.v2.service',
743
+ method: 'POST',
744
+ methodFqn: 'wix.bookings.services.v2.ServicesService.BulkDeleteServicesByFilter',
745
+ packageName: PACKAGE_NAME,
746
+ url: resolveWixBookingsServicesV2ServicesServiceUrl({
747
+ protoPath: '/v2/bulk/services/delete-by-filter',
748
+ data: payload,
749
+ host,
750
+ }),
751
+ data: payload,
752
+ };
753
+ return metadata;
754
+ }
755
+ return __bulkDeleteServicesByFilter;
756
+ }
757
+ exports.bulkDeleteServicesByFilter = bulkDeleteServicesByFilter;
758
+ /**
759
+ * Retrieves a list of up to 100 services, given the provided paging, filtering, and sorting.
760
+ * `queryServices()` runs with these defaults, which you can override:
761
+ * + `paging.limit` is `100`.
762
+ * + `paging.offset` is `0`.
763
+ *
764
+ *
765
+ * >**Notes:**
766
+ * > + Use UTC format when filtering with dates.
767
+ * > + Only 1 use of each filter in the same query is supported. If a filter is defined more than once in a query, only the first occurrence is processed.
768
+ */
769
+ function queryServices(payload) {
770
+ function __queryServices({ host }) {
771
+ const metadata = {
772
+ entityFqdn: 'wix.bookings.services.v2.service',
773
+ method: 'POST',
774
+ methodFqn: 'wix.bookings.services.v2.ServicesService.QueryServices',
775
+ packageName: PACKAGE_NAME,
776
+ url: resolveWixBookingsServicesV2ServicesServiceUrl({
777
+ protoPath: '/v2/services/query',
778
+ data: payload,
779
+ host,
780
+ }),
781
+ data: payload,
782
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
783
+ {
784
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
785
+ paths: [
786
+ { path: 'services.createdDate' },
787
+ { path: 'services.updatedDate' },
788
+ { path: 'services.media.items.image.urlExpirationDate' },
789
+ { path: 'services.media.mainMedia.image.urlExpirationDate' },
790
+ { path: 'services.media.coverMedia.image.urlExpirationDate' },
791
+ { path: 'services.bookingPolicy.createdDate' },
792
+ { path: 'services.bookingPolicy.updatedDate' },
793
+ { path: 'services.schedule.firstSessionStart' },
794
+ { path: 'services.schedule.lastSessionEnd' },
795
+ {
796
+ path: 'services.staffMembers.mainMedia.image.urlExpirationDate',
797
+ },
798
+ {
799
+ path: 'services.staffMemberDetails.staffMembers.mainMedia.image.urlExpirationDate',
800
+ },
801
+ { path: 'services.supportedSlugs.createdDate' },
802
+ { path: 'services.mainSlug.createdDate' },
803
+ ],
804
+ },
805
+ {
806
+ transformFn: float_2.transformRESTFloatToSDKFloat,
807
+ paths: [
808
+ { path: 'services.locations.business.address.geocode.latitude' },
809
+ { path: 'services.locations.business.address.geocode.longitude' },
810
+ { path: 'services.locations.custom.address.geocode.latitude' },
811
+ { path: 'services.locations.custom.address.geocode.longitude' },
812
+ { path: 'services.locations.calculatedAddress.geocode.latitude' },
813
+ {
814
+ path: 'services.locations.calculatedAddress.geocode.longitude',
815
+ },
816
+ ],
817
+ },
818
+ ]),
819
+ };
820
+ return metadata;
821
+ }
822
+ return __queryServices;
823
+ }
824
+ exports.queryServices = queryServices;
825
+ /**
826
+ * Retrieves a list of up to 100 services, given the provided filtering, paging,
827
+ * and sorting.
828
+ *
829
+ *
830
+ * ## Defaults
831
+ *
832
+ * Search Services has the following default settings, which you can override:
833
+ * + Sorted by `createdDate` in ascending order.
834
+ * + `paging.limit` set to `100`.
835
+ * + `paging.offset` set to `0`.
836
+ *
837
+ * ## Filters
838
+ *
839
+ * When using filters for dates, you must use
840
+ * [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).
841
+ *
842
+ * Refer to the supported filters article
843
+ * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/filtering-and-sorting))
844
+ * for a complete list of supported filters and sorting options.
845
+ *
846
+ * ## See also
847
+ *
848
+ * To learn about working with *Search* methods, see
849
+ * API Query Language
850
+ * ([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))
851
+ * and Sorting and Paging
852
+ * ([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)).
853
+ */
854
+ function searchServices(payload) {
855
+ function __searchServices({ host }) {
856
+ const serializedData = (0, transform_paths_1.transformPaths)(payload, [
857
+ {
858
+ transformFn: float_1.transformSDKFloatToRESTFloat,
859
+ paths: [
860
+ { path: 'search.aggregations.range.buckets.from' },
861
+ { path: 'search.aggregations.range.buckets.to' },
862
+ {
863
+ path: 'search.aggregations.nested.nestedAggregations.range.buckets.from',
864
+ },
865
+ {
866
+ path: 'search.aggregations.nested.nestedAggregations.range.buckets.to',
867
+ },
868
+ ],
869
+ },
870
+ ]);
871
+ const metadata = {
872
+ entityFqdn: 'wix.bookings.services.v2.service',
873
+ method: 'POST',
874
+ methodFqn: 'wix.bookings.services.v2.ServicesService.SearchServices',
875
+ packageName: PACKAGE_NAME,
876
+ url: resolveWixBookingsServicesV2ServicesServiceUrl({
877
+ protoPath: '/v2/services/search',
878
+ data: serializedData,
879
+ host,
880
+ }),
881
+ data: serializedData,
882
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
883
+ {
884
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
885
+ paths: [
886
+ { path: 'services.createdDate' },
887
+ { path: 'services.updatedDate' },
888
+ { path: 'services.media.items.image.urlExpirationDate' },
889
+ { path: 'services.media.mainMedia.image.urlExpirationDate' },
890
+ { path: 'services.media.coverMedia.image.urlExpirationDate' },
891
+ { path: 'services.bookingPolicy.createdDate' },
892
+ { path: 'services.bookingPolicy.updatedDate' },
893
+ { path: 'services.schedule.firstSessionStart' },
894
+ { path: 'services.schedule.lastSessionEnd' },
895
+ {
896
+ path: 'services.staffMembers.mainMedia.image.urlExpirationDate',
897
+ },
898
+ {
899
+ path: 'services.staffMemberDetails.staffMembers.mainMedia.image.urlExpirationDate',
900
+ },
901
+ { path: 'services.supportedSlugs.createdDate' },
902
+ { path: 'services.mainSlug.createdDate' },
903
+ ],
904
+ },
905
+ {
906
+ transformFn: float_2.transformRESTFloatToSDKFloat,
907
+ paths: [
908
+ { path: 'services.locations.business.address.geocode.latitude' },
909
+ { path: 'services.locations.business.address.geocode.longitude' },
910
+ { path: 'services.locations.custom.address.geocode.latitude' },
911
+ { path: 'services.locations.custom.address.geocode.longitude' },
912
+ { path: 'services.locations.calculatedAddress.geocode.latitude' },
913
+ {
914
+ path: 'services.locations.calculatedAddress.geocode.longitude',
915
+ },
916
+ { path: 'aggregationData.results.ranges.results.from' },
917
+ { path: 'aggregationData.results.ranges.results.to' },
918
+ {
919
+ path: 'aggregationData.results.groupedByValue.results.nestedResults.ranges.results.from',
920
+ },
921
+ {
922
+ path: 'aggregationData.results.groupedByValue.results.nestedResults.ranges.results.to',
923
+ },
924
+ {
925
+ path: 'aggregationData.results.nested.results.results.range.from',
926
+ },
927
+ {
928
+ path: 'aggregationData.results.nested.results.results.range.to',
929
+ },
930
+ { path: 'aggregationData.results.scalar.value' },
931
+ {
932
+ path: 'aggregationData.results.groupedByValue.results.nestedResults.scalar.value',
933
+ },
934
+ {
935
+ path: 'aggregationData.results.nested.results.results.scalar.value',
936
+ },
937
+ ],
938
+ },
939
+ ]),
940
+ };
941
+ return metadata;
942
+ }
943
+ return __searchServices;
944
+ }
945
+ exports.searchServices = searchServices;
946
+ /**
947
+ * Retrieves a list of up to 100 booking policies
948
+ * ([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)),
949
+ * and information about the services that are connected to them,
950
+ * given the provided filtering, paging, and sorting.
951
+ *
952
+ * ## Defaults
953
+ *
954
+ * Query Policies has the following default settings, which you can override:
955
+ *
956
+ * + Sorted by `id` in ascending order.
957
+ * + `cursorPaging.limit` set to `100`.
958
+ *
959
+ * ## Filters
960
+ *
961
+ * For a complete list of supported filters, refer to **Booking Policies API: Supported Filters**
962
+ * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policies/supported-filters)).
963
+ *
964
+ * When using date filters, you must use
965
+ * [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).
966
+ *
967
+ * ## Returned services
968
+ *
969
+ * If a booking policy is connected to more than 5 services, only a subset of
970
+ * those services is returned. The `bookingPolicies.totalServiceCount` values
971
+ * indicate the total number of services linked to each policy. You can call Search Services
972
+ * ([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))
973
+ * and specify the relevant policy ID in the filter to retrieve all services
974
+ * connected to the booking policy.
975
+ *
976
+ * ## See also
977
+ *
978
+ * To learn about working with *Query* endpoints, see
979
+ * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)
980
+ * and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
981
+ */
982
+ function queryPolicies(payload) {
983
+ function __queryPolicies({ host }) {
984
+ const metadata = {
985
+ entityFqdn: 'wix.bookings.services.v2.service',
986
+ method: 'POST',
987
+ methodFqn: 'wix.bookings.services.v2.ServicesService.QueryPolicies',
988
+ packageName: PACKAGE_NAME,
989
+ url: resolveWixBookingsServicesV2ServicesServiceUrl({
990
+ protoPath: '/v2/services/policies/query',
991
+ data: payload,
992
+ host,
993
+ }),
994
+ data: payload,
995
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
996
+ {
997
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
998
+ paths: [
999
+ { path: 'bookingPolicies.bookingPolicy.createdDate' },
1000
+ { path: 'bookingPolicies.bookingPolicy.updatedDate' },
1001
+ { path: 'bookingPolicies.services.createdDate' },
1002
+ { path: 'bookingPolicies.services.updatedDate' },
1003
+ {
1004
+ path: 'bookingPolicies.services.media.items.image.urlExpirationDate',
1005
+ },
1006
+ {
1007
+ path: 'bookingPolicies.services.media.mainMedia.image.urlExpirationDate',
1008
+ },
1009
+ {
1010
+ path: 'bookingPolicies.services.media.coverMedia.image.urlExpirationDate',
1011
+ },
1012
+ { path: 'bookingPolicies.services.bookingPolicy.createdDate' },
1013
+ { path: 'bookingPolicies.services.bookingPolicy.updatedDate' },
1014
+ { path: 'bookingPolicies.services.schedule.firstSessionStart' },
1015
+ { path: 'bookingPolicies.services.schedule.lastSessionEnd' },
1016
+ {
1017
+ path: 'bookingPolicies.services.staffMembers.mainMedia.image.urlExpirationDate',
1018
+ },
1019
+ {
1020
+ path: 'bookingPolicies.services.staffMemberDetails.staffMembers.mainMedia.image.urlExpirationDate',
1021
+ },
1022
+ { path: 'bookingPolicies.services.supportedSlugs.createdDate' },
1023
+ { path: 'bookingPolicies.services.mainSlug.createdDate' },
1024
+ { path: 'bookingPolicies.connectedServices.createdDate' },
1025
+ { path: 'bookingPolicies.connectedServices.updatedDate' },
1026
+ {
1027
+ path: 'bookingPolicies.connectedServices.media.items.image.urlExpirationDate',
1028
+ },
1029
+ {
1030
+ path: 'bookingPolicies.connectedServices.media.mainMedia.image.urlExpirationDate',
1031
+ },
1032
+ {
1033
+ path: 'bookingPolicies.connectedServices.media.coverMedia.image.urlExpirationDate',
1034
+ },
1035
+ {
1036
+ path: 'bookingPolicies.connectedServices.bookingPolicy.createdDate',
1037
+ },
1038
+ {
1039
+ path: 'bookingPolicies.connectedServices.bookingPolicy.updatedDate',
1040
+ },
1041
+ {
1042
+ path: 'bookingPolicies.connectedServices.schedule.firstSessionStart',
1043
+ },
1044
+ {
1045
+ path: 'bookingPolicies.connectedServices.schedule.lastSessionEnd',
1046
+ },
1047
+ {
1048
+ path: 'bookingPolicies.connectedServices.staffMembers.mainMedia.image.urlExpirationDate',
1049
+ },
1050
+ {
1051
+ path: 'bookingPolicies.connectedServices.staffMemberDetails.staffMembers.mainMedia.image.urlExpirationDate',
1052
+ },
1053
+ {
1054
+ path: 'bookingPolicies.connectedServices.supportedSlugs.createdDate',
1055
+ },
1056
+ {
1057
+ path: 'bookingPolicies.connectedServices.mainSlug.createdDate',
1058
+ },
1059
+ ],
1060
+ },
1061
+ {
1062
+ transformFn: float_2.transformRESTFloatToSDKFloat,
1063
+ paths: [
1064
+ {
1065
+ path: 'bookingPolicies.services.locations.business.address.geocode.latitude',
1066
+ },
1067
+ {
1068
+ path: 'bookingPolicies.services.locations.business.address.geocode.longitude',
1069
+ },
1070
+ {
1071
+ path: 'bookingPolicies.services.locations.custom.address.geocode.latitude',
1072
+ },
1073
+ {
1074
+ path: 'bookingPolicies.services.locations.custom.address.geocode.longitude',
1075
+ },
1076
+ {
1077
+ path: 'bookingPolicies.services.locations.calculatedAddress.geocode.latitude',
1078
+ },
1079
+ {
1080
+ path: 'bookingPolicies.services.locations.calculatedAddress.geocode.longitude',
1081
+ },
1082
+ {
1083
+ path: 'bookingPolicies.connectedServices.locations.business.address.geocode.latitude',
1084
+ },
1085
+ {
1086
+ path: 'bookingPolicies.connectedServices.locations.business.address.geocode.longitude',
1087
+ },
1088
+ {
1089
+ path: 'bookingPolicies.connectedServices.locations.custom.address.geocode.latitude',
1090
+ },
1091
+ {
1092
+ path: 'bookingPolicies.connectedServices.locations.custom.address.geocode.longitude',
1093
+ },
1094
+ {
1095
+ path: 'bookingPolicies.connectedServices.locations.calculatedAddress.geocode.latitude',
1096
+ },
1097
+ {
1098
+ path: 'bookingPolicies.connectedServices.locations.calculatedAddress.geocode.longitude',
1099
+ },
1100
+ ],
1101
+ },
1102
+ ]),
1103
+ };
1104
+ return metadata;
1105
+ }
1106
+ return __queryPolicies;
1107
+ }
1108
+ exports.queryPolicies = queryPolicies;
1109
+ /**
1110
+ * Retrieves a list of up to 100 booking forms
1111
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/forms/forms/introduction) | [REST](https://dev.wix.com/docs/rest/crm/forms/forms/introduction)),
1112
+ * and information about the services that are connected to them,
1113
+ * given the provided filtering, paging, and sorting.
1114
+ *
1115
+ *
1116
+ * ## Defaults
1117
+ *
1118
+ * Query Booking Forms has the following default settings, which you can override:
1119
+ *
1120
+ * + Sorted by `id` in ascending order.
1121
+ * + `cursorPaging.limit` set to `100`.
1122
+ *
1123
+ * ## Filters
1124
+ *
1125
+ * For a complete list of supported filters, refer to **Forms API: Supported Filters**
1126
+ * ([REST](https://dev.wix.com/docs/rest/crm/forms/forms/introduction/supported-filters)).
1127
+ *
1128
+ * When using date filters, you must use
1129
+ * [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).
1130
+ *
1131
+ * ## Returned services
1132
+ *
1133
+ * If a booking policy is connected to more than 5 services, only a subset of
1134
+ * these service IDs and names is returned. The `bookingForms.totalServiceCount`
1135
+ * values indicate the total number of services linked to each form. You can call Query Services
1136
+ * ([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))
1137
+ * and specify the relevant form ID in the filter to retrieve all services
1138
+ * connected to the booking form.
1139
+ *
1140
+ * ## Default booking forms
1141
+ *
1142
+ * By default, all Wix Bookings services use a standard booking form. To retrieve
1143
+ * a site's default booking form with Query Booking Forms, specify
1144
+ * `{"conditionalFields": ["DEFAULT_BOOKING_FORM"]}`.
1145
+ *
1146
+ * ## See also
1147
+ *
1148
+ * To learn about working with *Query* endpoints, see
1149
+ * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)
1150
+ * and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
1151
+ */
1152
+ function queryBookingForms(payload) {
1153
+ function __queryBookingForms({ host }) {
1154
+ const metadata = {
1155
+ entityFqdn: 'wix.bookings.services.v2.service',
1156
+ method: 'POST',
1157
+ methodFqn: 'wix.bookings.services.v2.ServicesService.QueryBookingForms',
1158
+ packageName: PACKAGE_NAME,
1159
+ url: resolveWixBookingsServicesV2ServicesServiceUrl({
1160
+ protoPath: '/v2/services/booking-forms/query',
1161
+ data: payload,
1162
+ host,
1163
+ }),
1164
+ data: payload,
1165
+ };
1166
+ return metadata;
1167
+ }
1168
+ return __queryBookingForms;
1169
+ }
1170
+ exports.queryBookingForms = queryBookingForms;
1171
+ /**
1172
+ * Counts how many services match the given filter.
1173
+ *
1174
+ *
1175
+ * Refer to the supported filters article
1176
+ * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/filtering-and-sorting#filtering))
1177
+ * for more details.
1178
+ *
1179
+ * To learn about working with filters in general, see
1180
+ * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters)
1181
+ */
1182
+ function countServices(payload) {
1183
+ function __countServices({ host }) {
1184
+ const metadata = {
1185
+ entityFqdn: 'wix.bookings.services.v2.service',
1186
+ method: 'POST',
1187
+ methodFqn: 'wix.bookings.services.v2.ServicesService.CountServices',
1188
+ packageName: PACKAGE_NAME,
1189
+ url: resolveWixBookingsServicesV2ServicesServiceUrl({
1190
+ protoPath: '/v2/services/count',
1191
+ data: payload,
1192
+ host,
1193
+ }),
1194
+ data: payload,
1195
+ };
1196
+ return metadata;
1197
+ }
1198
+ return __countServices;
1199
+ }
1200
+ exports.countServices = countServices;
1201
+ /**
1202
+ * Retrieves 3 separate lists of business, custom, and customer locations
1203
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction)),
1204
+ * given the provided filtering, and whether each location is connected to at
1205
+ * least one of the site's services.
1206
+ *
1207
+ *
1208
+ * ## Defaults
1209
+ *
1210
+ * Query Locations has the following default setting, which you can't override:
1211
+ * Sorted by `id` in ascending order.
1212
+ *
1213
+ * ## Filters
1214
+ *
1215
+ * For a complete list of supported filters, refer to the supported filters article
1216
+ * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/filtering-and-sorting#filtering)).
1217
+ *
1218
+ * When using date filters, you must use
1219
+ * [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).
1220
+ *
1221
+ * ## See also
1222
+ *
1223
+ * To learn about working with *Query* endpoints, see
1224
+ * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)
1225
+ * and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
1226
+ */
1227
+ function queryLocations(payload) {
1228
+ function __queryLocations({ host }) {
1229
+ const metadata = {
1230
+ entityFqdn: 'wix.bookings.services.v2.service',
1231
+ method: 'POST',
1232
+ methodFqn: 'wix.bookings.services.v2.ServicesService.QueryLocations',
1233
+ packageName: PACKAGE_NAME,
1234
+ url: resolveWixBookingsServicesV2ServicesServiceUrl({
1235
+ protoPath: '/v2/services/locations/query',
1236
+ data: payload,
1237
+ host,
1238
+ }),
1239
+ data: payload,
1240
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1241
+ {
1242
+ transformFn: float_2.transformRESTFloatToSDKFloat,
1243
+ paths: [
1244
+ {
1245
+ path: 'businessLocations.locations.business.address.geocode.latitude',
1246
+ },
1247
+ {
1248
+ path: 'businessLocations.locations.business.address.geocode.longitude',
1249
+ },
1250
+ {
1251
+ path: 'businessLocations.locations.custom.address.geocode.latitude',
1252
+ },
1253
+ {
1254
+ path: 'businessLocations.locations.custom.address.geocode.longitude',
1255
+ },
1256
+ {
1257
+ path: 'businessLocations.locations.calculatedAddress.geocode.latitude',
1258
+ },
1259
+ {
1260
+ path: 'businessLocations.locations.calculatedAddress.geocode.longitude',
1261
+ },
1262
+ ],
1263
+ },
1264
+ ]),
1265
+ };
1266
+ return metadata;
1267
+ }
1268
+ return __queryLocations;
1269
+ }
1270
+ exports.queryLocations = queryLocations;
1271
+ /**
1272
+ * Retrieves a list of service categories
1273
+ * ([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)),
1274
+ * given the provided filtering.
1275
+ *
1276
+ *
1277
+ * ## Defaults
1278
+ *
1279
+ * Query Categories has the following default setting, which you can't override:
1280
+ * Sorted by `id` in ascending order.
1281
+ *
1282
+ * ## Filters
1283
+ *
1284
+ * For a complete list of supported filters, refer to the supported filters article
1285
+ * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/filtering-and-sorting#filtering)).
1286
+ *
1287
+ * When using date filters, you must use
1288
+ * [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).
1289
+ *
1290
+ * ## See also
1291
+ *
1292
+ * To learn about working with *Query* endpoints, see
1293
+ * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)
1294
+ * and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
1295
+ */
1296
+ function queryCategories(payload) {
1297
+ function __queryCategories({ host }) {
1298
+ const metadata = {
1299
+ entityFqdn: 'wix.bookings.services.v2.service',
1300
+ method: 'POST',
1301
+ methodFqn: 'wix.bookings.services.v2.ServicesService.QueryCategories',
1302
+ packageName: PACKAGE_NAME,
1303
+ url: resolveWixBookingsServicesV2ServicesServiceUrl({
1304
+ protoPath: '/v2/services/categories/query',
1305
+ data: payload,
1306
+ host,
1307
+ }),
1308
+ data: payload,
1309
+ };
1310
+ return metadata;
1311
+ }
1312
+ return __queryCategories;
1313
+ }
1314
+ exports.queryCategories = queryCategories;
1315
+ /**
1316
+ * Replaces the list of the locations
1317
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))
1318
+ * where the business offers the service.
1319
+ *
1320
+ *
1321
+ * ## Consequences for customers
1322
+ *
1323
+ * Removing a service location may impact existing sessions and their
1324
+ * participants. If you remove at least one service location, you must
1325
+ * specify `removedLocationSessionsAction` to indicate what happens to all
1326
+ * future sessions scheduled at this location.
1327
+ *
1328
+ * - **Keep existing location**: If you want to retain future sessions at their
1329
+ * originally scheduled location, specify
1330
+ * `{"removedLocationSessionsAction.action": "KEEP_AT_CURRENT_LOCATION"}`.
1331
+ * This ensures nothing changes for the customer, but the business must be
1332
+ * able to provide access to the removed location in the future.
1333
+ * - **Update location**: If you want to update the location for future sessions
1334
+ * scheduled at the removed location, specify
1335
+ * `{"removedLocationSessionsAction.action": "MOVE_TO_LOCATION"}` and
1336
+ * `moveToLocationOptions.newLocation`.
1337
+ *
1338
+ * You can't mix and match to keep some sessions at the previous location while
1339
+ * moving other sessions to an updated location.
1340
+ *
1341
+ * Past session details aren't changed, no matter which option you choose for
1342
+ * future sessions.
1343
+ *
1344
+ * Future sessions scheduled for a location defined by the customer are also not
1345
+ * updated.
1346
+ *
1347
+ * ## Specify location details
1348
+ *
1349
+ * Depending on whether the new or updated location is a business or custom location,
1350
+ * you need to specify different fields.
1351
+ *
1352
+ * - **Business location**: Specify the relevant location ID
1353
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))
1354
+ * in `locations.business.id`.
1355
+ * - **Custom location**: Specify the complete address object as
1356
+ * `locations.custom.address`.
1357
+ *
1358
+ * ## Participant notifications
1359
+ *
1360
+ * You can specify a `participantNotification.message` that's immediately send
1361
+ * to all customers who had booked at a changed location. Ensure
1362
+ * `participantNotification.notifyParticipants` is set to `true` to send the
1363
+ * message.
1364
+ */
1365
+ function setServiceLocations(payload) {
1366
+ function __setServiceLocations({ host }) {
1367
+ const serializedData = (0, transform_paths_1.transformPaths)(payload, [
1368
+ {
1369
+ transformFn: float_1.transformSDKFloatToRESTFloat,
1370
+ paths: [
1371
+ { path: 'locations.business.address.geocode.latitude' },
1372
+ { path: 'locations.business.address.geocode.longitude' },
1373
+ { path: 'locations.custom.address.geocode.latitude' },
1374
+ { path: 'locations.custom.address.geocode.longitude' },
1375
+ { path: 'locations.calculatedAddress.geocode.latitude' },
1376
+ { path: 'locations.calculatedAddress.geocode.longitude' },
1377
+ {
1378
+ path: 'removedLocationSessionsAction.moveToLocationOptions.newLocation.business.address.geocode.latitude',
1379
+ },
1380
+ {
1381
+ path: 'removedLocationSessionsAction.moveToLocationOptions.newLocation.business.address.geocode.longitude',
1382
+ },
1383
+ {
1384
+ path: 'removedLocationSessionsAction.moveToLocationOptions.newLocation.custom.address.geocode.latitude',
1385
+ },
1386
+ {
1387
+ path: 'removedLocationSessionsAction.moveToLocationOptions.newLocation.custom.address.geocode.longitude',
1388
+ },
1389
+ {
1390
+ path: 'removedLocationSessionsAction.moveToLocationOptions.newLocation.calculatedAddress.geocode.latitude',
1391
+ },
1392
+ {
1393
+ path: 'removedLocationSessionsAction.moveToLocationOptions.newLocation.calculatedAddress.geocode.longitude',
1394
+ },
1395
+ ],
1396
+ },
1397
+ ]);
1398
+ const metadata = {
1399
+ entityFqdn: 'wix.bookings.services.v2.service',
1400
+ method: 'POST',
1401
+ methodFqn: 'wix.bookings.services.v2.ServicesService.SetServiceLocations',
1402
+ packageName: PACKAGE_NAME,
1403
+ url: resolveWixBookingsServicesV2ServicesServiceUrl({
1404
+ protoPath: '/v2/services/{serviceId}/locations',
1405
+ data: serializedData,
1406
+ host,
1407
+ }),
1408
+ data: serializedData,
1409
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1410
+ {
1411
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1412
+ paths: [
1413
+ { path: 'service.createdDate' },
1414
+ { path: 'service.updatedDate' },
1415
+ { path: 'service.media.items.image.urlExpirationDate' },
1416
+ { path: 'service.media.mainMedia.image.urlExpirationDate' },
1417
+ { path: 'service.media.coverMedia.image.urlExpirationDate' },
1418
+ { path: 'service.bookingPolicy.createdDate' },
1419
+ { path: 'service.bookingPolicy.updatedDate' },
1420
+ { path: 'service.schedule.firstSessionStart' },
1421
+ { path: 'service.schedule.lastSessionEnd' },
1422
+ {
1423
+ path: 'service.staffMembers.mainMedia.image.urlExpirationDate',
1424
+ },
1425
+ {
1426
+ path: 'service.staffMemberDetails.staffMembers.mainMedia.image.urlExpirationDate',
1427
+ },
1428
+ { path: 'service.supportedSlugs.createdDate' },
1429
+ { path: 'service.mainSlug.createdDate' },
1430
+ ],
1431
+ },
1432
+ {
1433
+ transformFn: float_2.transformRESTFloatToSDKFloat,
1434
+ paths: [
1435
+ { path: 'service.locations.business.address.geocode.latitude' },
1436
+ { path: 'service.locations.business.address.geocode.longitude' },
1437
+ { path: 'service.locations.custom.address.geocode.latitude' },
1438
+ { path: 'service.locations.custom.address.geocode.longitude' },
1439
+ { path: 'service.locations.calculatedAddress.geocode.latitude' },
1440
+ { path: 'service.locations.calculatedAddress.geocode.longitude' },
1441
+ ],
1442
+ },
1443
+ ]),
1444
+ };
1445
+ return metadata;
1446
+ }
1447
+ return __setServiceLocations;
1448
+ }
1449
+ exports.setServiceLocations = setServiceLocations;
1450
+ /**
1451
+ * Adds a list of pricing plans ID
1452
+ * ([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))
1453
+ * to a service's `payment.pricingPlanIds` array.
1454
+ *
1455
+ *
1456
+ * The call doesn't validate whether the service's `payment.options.pricingPlan`
1457
+ * is set to `true`. If it's set to `false`, customers aren't able to pay
1458
+ * for their bookings using pricing plans. You can call Update Service
1459
+ * ([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))
1460
+ * to change a service's supported payment methods.
1461
+ */
1462
+ function enablePricingPlansForService(payload) {
1463
+ function __enablePricingPlansForService({ host }) {
1464
+ const metadata = {
1465
+ entityFqdn: 'wix.bookings.services.v2.service',
1466
+ method: 'POST',
1467
+ methodFqn: 'wix.bookings.services.v2.ServicesService.EnablePricingPlansForService',
1468
+ packageName: PACKAGE_NAME,
1469
+ url: resolveWixBookingsServicesV2ServicesServiceUrl({
1470
+ protoPath: '/v2/services/{serviceId}/pricing-plans/add',
1471
+ data: payload,
1472
+ host,
1473
+ }),
1474
+ data: payload,
1475
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1476
+ {
1477
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1478
+ paths: [
1479
+ { path: 'service.createdDate' },
1480
+ { path: 'service.updatedDate' },
1481
+ { path: 'service.media.items.image.urlExpirationDate' },
1482
+ { path: 'service.media.mainMedia.image.urlExpirationDate' },
1483
+ { path: 'service.media.coverMedia.image.urlExpirationDate' },
1484
+ { path: 'service.bookingPolicy.createdDate' },
1485
+ { path: 'service.bookingPolicy.updatedDate' },
1486
+ { path: 'service.schedule.firstSessionStart' },
1487
+ { path: 'service.schedule.lastSessionEnd' },
1488
+ {
1489
+ path: 'service.staffMembers.mainMedia.image.urlExpirationDate',
1490
+ },
1491
+ {
1492
+ path: 'service.staffMemberDetails.staffMembers.mainMedia.image.urlExpirationDate',
1493
+ },
1494
+ { path: 'service.supportedSlugs.createdDate' },
1495
+ { path: 'service.mainSlug.createdDate' },
1496
+ ],
1497
+ },
1498
+ {
1499
+ transformFn: float_2.transformRESTFloatToSDKFloat,
1500
+ paths: [
1501
+ { path: 'service.locations.business.address.geocode.latitude' },
1502
+ { path: 'service.locations.business.address.geocode.longitude' },
1503
+ { path: 'service.locations.custom.address.geocode.latitude' },
1504
+ { path: 'service.locations.custom.address.geocode.longitude' },
1505
+ { path: 'service.locations.calculatedAddress.geocode.latitude' },
1506
+ { path: 'service.locations.calculatedAddress.geocode.longitude' },
1507
+ ],
1508
+ },
1509
+ ]),
1510
+ };
1511
+ return metadata;
1512
+ }
1513
+ return __enablePricingPlansForService;
1514
+ }
1515
+ exports.enablePricingPlansForService = enablePricingPlansForService;
1516
+ /**
1517
+ * Removes a list of pricing plans ID
1518
+ * ([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))
1519
+ * from a service's `payment.pricingPlanIds` array.
1520
+ *
1521
+ *
1522
+ * If you remove all pricing plan IDs from `payment.pricingPlanIds` and the
1523
+ * service supports only payments by pricing plan, customers will no longer be
1524
+ * able to book the service, as they will have no payment options available.
1525
+ */
1526
+ function disablePricingPlansForService(payload) {
1527
+ function __disablePricingPlansForService({ host }) {
1528
+ const metadata = {
1529
+ entityFqdn: 'wix.bookings.services.v2.service',
1530
+ method: 'POST',
1531
+ methodFqn: 'wix.bookings.services.v2.ServicesService.DisablePricingPlansForService',
1532
+ packageName: PACKAGE_NAME,
1533
+ url: resolveWixBookingsServicesV2ServicesServiceUrl({
1534
+ protoPath: '/v2/services/{serviceId}/pricing-plans/remove',
1535
+ data: payload,
1536
+ host,
1537
+ }),
1538
+ data: payload,
1539
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1540
+ {
1541
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1542
+ paths: [
1543
+ { path: 'service.createdDate' },
1544
+ { path: 'service.updatedDate' },
1545
+ { path: 'service.media.items.image.urlExpirationDate' },
1546
+ { path: 'service.media.mainMedia.image.urlExpirationDate' },
1547
+ { path: 'service.media.coverMedia.image.urlExpirationDate' },
1548
+ { path: 'service.bookingPolicy.createdDate' },
1549
+ { path: 'service.bookingPolicy.updatedDate' },
1550
+ { path: 'service.schedule.firstSessionStart' },
1551
+ { path: 'service.schedule.lastSessionEnd' },
1552
+ {
1553
+ path: 'service.staffMembers.mainMedia.image.urlExpirationDate',
1554
+ },
1555
+ {
1556
+ path: 'service.staffMemberDetails.staffMembers.mainMedia.image.urlExpirationDate',
1557
+ },
1558
+ { path: 'service.supportedSlugs.createdDate' },
1559
+ { path: 'service.mainSlug.createdDate' },
1560
+ ],
1561
+ },
1562
+ {
1563
+ transformFn: float_2.transformRESTFloatToSDKFloat,
1564
+ paths: [
1565
+ { path: 'service.locations.business.address.geocode.latitude' },
1566
+ { path: 'service.locations.business.address.geocode.longitude' },
1567
+ { path: 'service.locations.custom.address.geocode.latitude' },
1568
+ { path: 'service.locations.custom.address.geocode.longitude' },
1569
+ { path: 'service.locations.calculatedAddress.geocode.latitude' },
1570
+ { path: 'service.locations.calculatedAddress.geocode.longitude' },
1571
+ ],
1572
+ },
1573
+ ]),
1574
+ };
1575
+ return metadata;
1576
+ }
1577
+ return __disablePricingPlansForService;
1578
+ }
1579
+ exports.disablePricingPlansForService = disablePricingPlansForService;
1580
+ /**
1581
+ * Sets a new active slug for the service.
1582
+ *
1583
+ *
1584
+ * The call fails if at least one of these conditions is met:
1585
+ * - The slug doesn't adheres to the supported format.
1586
+ * - Another service is currently using the slug.
1587
+ * - Another service has used the slug in the past.
1588
+ */
1589
+ function setCustomSlug(payload) {
1590
+ function __setCustomSlug({ host }) {
1591
+ const metadata = {
1592
+ entityFqdn: 'wix.bookings.services.v2.service',
1593
+ method: 'POST',
1594
+ methodFqn: 'wix.bookings.services.v2.ServicesService.SetCustomSlug',
1595
+ packageName: PACKAGE_NAME,
1596
+ url: resolveWixBookingsServicesV2ServicesServiceUrl({
1597
+ protoPath: '/v2/services/{serviceId}/slugs/custom',
1598
+ data: payload,
1599
+ host,
1600
+ }),
1601
+ data: payload,
1602
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1603
+ {
1604
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1605
+ paths: [
1606
+ { path: 'slug.createdDate' },
1607
+ { path: 'service.createdDate' },
1608
+ { path: 'service.updatedDate' },
1609
+ { path: 'service.media.items.image.urlExpirationDate' },
1610
+ { path: 'service.media.mainMedia.image.urlExpirationDate' },
1611
+ { path: 'service.media.coverMedia.image.urlExpirationDate' },
1612
+ { path: 'service.bookingPolicy.createdDate' },
1613
+ { path: 'service.bookingPolicy.updatedDate' },
1614
+ { path: 'service.schedule.firstSessionStart' },
1615
+ { path: 'service.schedule.lastSessionEnd' },
1616
+ {
1617
+ path: 'service.staffMembers.mainMedia.image.urlExpirationDate',
1618
+ },
1619
+ {
1620
+ path: 'service.staffMemberDetails.staffMembers.mainMedia.image.urlExpirationDate',
1621
+ },
1622
+ { path: 'service.supportedSlugs.createdDate' },
1623
+ { path: 'service.mainSlug.createdDate' },
1624
+ ],
1625
+ },
1626
+ {
1627
+ transformFn: float_2.transformRESTFloatToSDKFloat,
1628
+ paths: [
1629
+ { path: 'service.locations.business.address.geocode.latitude' },
1630
+ { path: 'service.locations.business.address.geocode.longitude' },
1631
+ { path: 'service.locations.custom.address.geocode.latitude' },
1632
+ { path: 'service.locations.custom.address.geocode.longitude' },
1633
+ { path: 'service.locations.calculatedAddress.geocode.latitude' },
1634
+ { path: 'service.locations.calculatedAddress.geocode.longitude' },
1635
+ ],
1636
+ },
1637
+ ]),
1638
+ };
1639
+ return metadata;
1640
+ }
1641
+ return __setCustomSlug;
1642
+ }
1643
+ exports.setCustomSlug = setCustomSlug;
1644
+ /**
1645
+ * Checks whether a custom slug is validate for the service.
1646
+ *
1647
+ *
1648
+ * The checks include:
1649
+ * - The slug adheres to the supported format.
1650
+ * - No other service is currently using the slug.
1651
+ * - No other service has used the slug in the past.
1652
+ *
1653
+ * The call fails if at least one of the checks fails.
1654
+ */
1655
+ function validateSlug(payload) {
1656
+ function __validateSlug({ host }) {
1657
+ const metadata = {
1658
+ entityFqdn: 'wix.bookings.services.v2.service',
1659
+ method: 'POST',
1660
+ methodFqn: 'wix.bookings.services.v2.ServicesService.ValidateSlug',
1661
+ packageName: PACKAGE_NAME,
1662
+ url: resolveWixBookingsServicesV2ServicesServiceUrl({
1663
+ protoPath: '/v2/services/slugs/validate',
1664
+ data: payload,
1665
+ host,
1666
+ }),
1667
+ data: payload,
1668
+ };
1669
+ return metadata;
1670
+ }
1671
+ return __validateSlug;
1672
+ }
1673
+ exports.validateSlug = validateSlug;
1674
+ /**
1675
+ * Clones a service.
1676
+ *
1677
+ *
1678
+ * ## Connected entities
1679
+ *
1680
+ * By default, not all entities connected to the service are cloned.
1681
+ *
1682
+ * ### Schedule
1683
+ *
1684
+ * Wix Bookings automatically creates a new active *schedule*
1685
+ * ([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))
1686
+ * for the cloned service. If Wix Bookings can't create this schedule, the
1687
+ * Clone Service* call fails.
1688
+ *
1689
+ * - __For appointment-based services__: Future appointments aren't added to the
1690
+ * cloned service's schedule. Use the *Events API*
1691
+ * ([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))
1692
+ * to add them as needed.
1693
+ * - __For classes and courses__: Future one-time events aren't added to the
1694
+ * cloned service's schedule, while future recurring events are added
1695
+ * asynchronously. The *Clone Service* call always succeeds, whether or not
1696
+ * recurring events are added.
1697
+ * If the response includes `RECURRING_EVENTS` in the `errors` array, it means the
1698
+ * cloned service doesn't have future recurring events, even though the original
1699
+ * service does. You can either delete the cloned service and try again or use
1700
+ * the *Events API*
1701
+ * ([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))
1702
+ * to add missing events to the schedule.
1703
+ *
1704
+ * Wix Bookings never adds past events to the cloned service's schedule.
1705
+ *
1706
+ * ### Service options and variants
1707
+ *
1708
+ * If the original service has variants
1709
+ * ([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)),
1710
+ * they're cloned asynchronously. The *Clone Service* call always succeeds,
1711
+ * regardless of whether variants were cloned.
1712
+ *
1713
+ * If the response includes `OPTIONS_AND_VARIANTS` in the `errors` array, the cloned
1714
+ * service doesn't have variants, even though the original service does. You can
1715
+ * delete the cloned service and call *Clone Service* again, or use the
1716
+ * Service Options And Variants API*
1717
+ * ([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))
1718
+ * to add variants.
1719
+ *
1720
+ * ### Booking form
1721
+ *
1722
+ * The original service's booking form isn't cloned, whether it's
1723
+ * the default or a custom booking form.
1724
+ *
1725
+ * ### Pricing plans
1726
+ *
1727
+ * If the original service's accepts payments via pricing plans
1728
+ * ([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)),
1729
+ * the cloned service's `payment.options.pricingPlan` is also set to `true`. To
1730
+ * accept specific pricing plans, call *Enable Pricing Plans For Service*
1731
+ * ([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)),
1732
+ * after cloning the service. If the original service accepts only
1733
+ * pricing plan payments and you don't call *Enable Pricing Plans For Service*
1734
+ * after cloning the service, customers will be unable to book the service.
1735
+ */
1736
+ function cloneService(payload) {
1737
+ function __cloneService({ host }) {
1738
+ const metadata = {
1739
+ entityFqdn: 'wix.bookings.services.v2.service',
1740
+ method: 'POST',
1741
+ methodFqn: 'wix.bookings.services.v2.ServicesService.CloneService',
1742
+ packageName: PACKAGE_NAME,
1743
+ url: resolveWixBookingsServicesV2ServicesServiceUrl({
1744
+ protoPath: '/v2/services/clone',
1745
+ data: payload,
1746
+ host,
1747
+ }),
1748
+ data: payload,
1749
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1750
+ {
1751
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1752
+ paths: [
1753
+ { path: 'service.createdDate' },
1754
+ { path: 'service.updatedDate' },
1755
+ { path: 'service.media.items.image.urlExpirationDate' },
1756
+ { path: 'service.media.mainMedia.image.urlExpirationDate' },
1757
+ { path: 'service.media.coverMedia.image.urlExpirationDate' },
1758
+ { path: 'service.bookingPolicy.createdDate' },
1759
+ { path: 'service.bookingPolicy.updatedDate' },
1760
+ { path: 'service.schedule.firstSessionStart' },
1761
+ { path: 'service.schedule.lastSessionEnd' },
1762
+ {
1763
+ path: 'service.staffMembers.mainMedia.image.urlExpirationDate',
1764
+ },
1765
+ {
1766
+ path: 'service.staffMemberDetails.staffMembers.mainMedia.image.urlExpirationDate',
1767
+ },
1768
+ { path: 'service.supportedSlugs.createdDate' },
1769
+ { path: 'service.mainSlug.createdDate' },
1770
+ ],
1771
+ },
1772
+ {
1773
+ transformFn: float_2.transformRESTFloatToSDKFloat,
1774
+ paths: [
1775
+ { path: 'service.locations.business.address.geocode.latitude' },
1776
+ { path: 'service.locations.business.address.geocode.longitude' },
1777
+ { path: 'service.locations.custom.address.geocode.latitude' },
1778
+ { path: 'service.locations.custom.address.geocode.longitude' },
1779
+ { path: 'service.locations.calculatedAddress.geocode.latitude' },
1780
+ { path: 'service.locations.calculatedAddress.geocode.longitude' },
1781
+ ],
1782
+ },
1783
+ ]),
1784
+ };
1785
+ return metadata;
1786
+ }
1787
+ return __cloneService;
1788
+ }
1789
+ exports.cloneService = cloneService;
1790
+ //# sourceMappingURL=bookings-services-v2-service-services.http.js.map