@wix/auto_sdk_bookings_services 1.0.31 → 1.0.33

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