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