@wix/auto_sdk_bookings_services 1.0.54 → 1.0.56

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