@wix/auto_sdk_bookings_services 1.0.54 → 1.0.55

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