@wix/auto_sdk_bookings_multi-service-availability-time-slots 1.0.148 → 1.0.150

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 (25) hide show
  1. package/build/cjs/index.d.ts +8 -4
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/{bookings-availability-v2-time-slot-multi-service-availability-time-slots.universal-bhfKbsfn.d.ts → index.typings.d.ts} +198 -1
  4. package/build/cjs/index.typings.js +325 -0
  5. package/build/cjs/index.typings.js.map +1 -0
  6. package/build/cjs/meta.d.ts +2 -1
  7. package/build/es/index.d.mts +8 -4
  8. package/build/es/index.mjs.map +1 -1
  9. package/build/es/{bookings-availability-v2-time-slot-multi-service-availability-time-slots.universal-bhfKbsfn.d.mts → index.typings.d.mts} +198 -1
  10. package/build/es/index.typings.mjs +299 -0
  11. package/build/es/index.typings.mjs.map +1 -0
  12. package/build/es/meta.d.mts +2 -1
  13. package/build/internal/cjs/index.d.ts +8 -4
  14. package/build/internal/cjs/index.js.map +1 -1
  15. package/build/internal/cjs/{bookings-availability-v2-time-slot-multi-service-availability-time-slots.universal-bhfKbsfn.d.ts → index.typings.d.ts} +198 -1
  16. package/build/internal/cjs/index.typings.js +325 -0
  17. package/build/internal/cjs/index.typings.js.map +1 -0
  18. package/build/internal/cjs/meta.d.ts +2 -1
  19. package/build/internal/es/index.d.mts +8 -4
  20. package/build/internal/es/index.mjs.map +1 -1
  21. package/build/internal/es/{bookings-availability-v2-time-slot-multi-service-availability-time-slots.universal-bhfKbsfn.d.mts → index.typings.d.mts} +198 -1
  22. package/build/internal/es/index.typings.mjs +299 -0
  23. package/build/internal/es/index.typings.mjs.map +1 -0
  24. package/build/internal/es/meta.d.mts +2 -1
  25. package/package.json +3 -3
@@ -1,3 +1,5 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
1
3
  /**
2
4
  * The `TimeSlot` object represents the availability information
3
5
  * for an `Appointment` service's specific slot, including:
@@ -915,6 +917,135 @@ interface GetEventTimeSlotResponse {
915
917
  */
916
918
  timeZone?: string | null;
917
919
  }
920
+ type ListMultiServiceAvailabilityTimeSlotsApplicationErrors = {
921
+ code?: 'NO_IMPLEMENTERS_FOUND';
922
+ description?: string;
923
+ data?: Record<string, any>;
924
+ } | {
925
+ code?: 'MULTIPLE_IMPLEMENTERS_FOUND';
926
+ description?: string;
927
+ data?: Record<string, any>;
928
+ } | {
929
+ code?: 'MISSING_ARGUMENTS';
930
+ description?: string;
931
+ data?: Record<string, any>;
932
+ } | {
933
+ code?: 'INVALID_SERVICES_SIZE';
934
+ description?: string;
935
+ data?: Record<string, any>;
936
+ } | {
937
+ code?: 'UNAUTHORIZED_OPERATION';
938
+ description?: string;
939
+ data?: Record<string, any>;
940
+ };
941
+ type GetMultiServiceAvailabilityTimeSlotApplicationErrors = {
942
+ code?: 'SLOT_NOT_FOUND';
943
+ description?: string;
944
+ data?: Record<string, any>;
945
+ } | {
946
+ code?: 'NO_IMPLEMENTERS_FOUND';
947
+ description?: string;
948
+ data?: Record<string, any>;
949
+ } | {
950
+ code?: 'MULTIPLE_IMPLEMENTERS_FOUND';
951
+ description?: string;
952
+ data?: Record<string, any>;
953
+ } | {
954
+ code?: 'UNAUTHORIZED_OPERATION';
955
+ description?: string;
956
+ data?: Record<string, any>;
957
+ };
958
+ type TimeSlotNonNullablePaths = `location.locationType` | `availableResources` | `nestedTimeSlots` | `nestedTimeSlots.${number}.serviceId` | `nestedTimeSlots.${number}.localStartDate` | `nestedTimeSlots.${number}.localEndDate`;
959
+ /**
960
+ * Retrieves a list of multiService `TimeSlot`s that match the provided filters.
961
+ *
962
+ * <blockquote class="important">
963
+ * <p><strong>Important:</strong><br/>
964
+ * Currently supported only for services of type <code class="grey-background">APPOINTMENT</code>.</p>
965
+ * </blockquote>
966
+ *
967
+ * The request body __must__ include either:
968
+ * + All of the following filters: `service`.`serviceId`, `fromLocalDate`, `toLocalDate`, `location`, and `timeZone`. You may add additional filters as you wish.
969
+ * + A `cursorPaging` with a valid `cursor` from previous response.
970
+ *
971
+ *
972
+ * Each [TimeSlot](https://bo.wix.com/wix-docs/rest/all-apis/wix-service-availability/availability-time-slots/time-slot-object) in response
973
+ * represents the availability of the given sequence of services in a specific order, location, and within a given range of time.
974
+ *
975
+ * Each `TimeSlot`.`NestedTimeSlot` represents a single service from the given list. The order of the `NestedTimeSlots` is the same as the order
976
+ * of the given services in request.
977
+ * The first `NestedTimeSlot` has `localStartDate` within the given `fromLocalDate` and `toLocalDate` exclusive,
978
+ * and each following `NestedTimeSlot` has a `localStartDate` that equals to the previous `NestedTimeSlot`'s `localEndDate`.
979
+ *
980
+ * By default,
981
+ * the response contains at most 1000 results.
982
+ * If there are more than 1000 results, we return a `cursorPagingMetadata` with
983
+ * a cursor for the next page of results, regardless of whether a `cursorPaging`
984
+ * was provided in request.
985
+ *
986
+ * > __Notes:__
987
+ * > + All nested time slots share the same location.
988
+ * > + You can pass up to 8 services in request.
989
+ *
990
+ * ### AvailableResources in response:
991
+ * The `TimeSlot`.`NestedTimeSlot`'s `AvailableResources` contains information about the resources that are available to provide the service
992
+ * within the `NestedTimeSlot` range of time. Each `AvailableResources` contains information about available resources of the same type.
993
+ *
994
+ * <blockquote class="important">
995
+ * <p><strong>Important:</strong><br/>
996
+ * By default,
997
+ * if you don't specify <code class="grey-background">service</code>.<code class="grey-background">includeResourceTypeIds</code>
998
+ * or <code class="grey-background">service</code>.<code class="grey-background">resourceIds</code> filters in request,
999
+ * we return TimeSlots with <code class="grey-background">NestedTimeSlot</code>s with an empty <code class="grey-background">AvailableResources</code>.
1000
+ * <br/><strong>Note:</strong><br/> Not specifying resources filters can be handy in case you want to avoid large response in flows that only
1001
+ * interested of whether the time slots are available. [Finding the next available slot within the next 3 months](https://bo.wix.com/wix-docs/rest/all-apis/service-availability/multi-service-availability-time-slots/sample-flows?localViewerId=inbari#all-apis_service-availability_multi-service-availability-time-slots_sample-flows_find-the-first-date-within-the-next-3-months-that-all-selected-services-are-available-for)
1002
+ * is an example for such flow.
1003
+ * </p>
1004
+ * </blockquote>
1005
+ *
1006
+ *
1007
+ * If you wish to get a list of available resources for a `TimeSlot`.`NestedTimeSlot` you should either:
1008
+ * + provide `service`.`resourceIds` in request.
1009
+ * + provide `service`.`includeResourceTypeIds` in request.
1010
+ *
1011
+ * __Notes:__
1012
+ * + In both cases the returned `TimeSlot`.`NestedTimeSlot` contains __up__ to 10 `AvailableResources` that match the provided filters. Each `AvailableResources` contains __up__ to 10 available `resources` of the same type that match the provided filters.
1013
+ * + If an `AvailableResources` has more available resources which are not listed within it, we return `AvailableResources`.`hasMoreAvailableResources` as true.
1014
+ * + If you wish to get the full available resources list for all `NestedTimeSlot` of a specific `TimeSlot`, you should call [GetMultiServiceAvailabilityTimeSlot](https://bo.wix.com/wix-docs/rest/all-apis/wix-service-availability/multi-service-availability-time-slots/get-multi-service-availability-time-slot).
1015
+ *
1016
+ *
1017
+ * ### Availability VS Bookability
1018
+ * An `available` time slot is not necessarily `bookable`.
1019
+ * The `bookable` field of a `TimeSlot` indicates whether the customer can book all of the of the services within the given time slot,
1020
+ * at a specific period of time.
1021
+ * Read more about [Availability VS Bookability](https://bo.wix.com/wix-docs/rest/all-apis/wix-service-availability/multi-service-availability-time-slots/introduction#all-apis_wix-service-availability_multi-service-availability-time-slots_introduction_availability-vs-bookability).
1022
+ *
1023
+ * By default,
1024
+ * + The response does not contains `unavailable` TimeSlots.For example, if there are no available resources to provide one of the services from `2024-01-30T14:30:00` to `2024-01-30T15:30:00`, we don't return TimeSlots with `NestedTimeSlot`.`localStartDate` within this range for this service.
1025
+ * + The response contains both `bookable` and `un-bookable` TimeSlots.For example, if one of the services has a booking policy which enforces booking the service up to 10 minutes before the session starts, we return TimeSlots with the violating `NestedTimeSlot`.`localStartDate`, with `bookable` as `false`. If you want to list only __bookable__ TimeSlots you should pass `bookable` as `true`.
1026
+ * + If booking one of the `NestedTimeSlot`s violates one of the corresponding service's booking policies, the `TimeSlot` returns with `bookable` as false. There is no indication which service's policy was violated.
1027
+ *
1028
+ * <blockquote class="important">
1029
+ * <p><strong>Important:</strong>
1030
+ * Because of DST, there are edge cases where certain times either do not exist or exist twice for a local time zone.
1031
+ * Read more about <a href="https://bo.wix.com/wix-docs/rest/all-apis/wix-service-availability/multi-service-availability-time-slots/introduction#all-apis_wix-service-availability_multi-service-availability-time-slots_introduction_daylight-saving-time-dst-handling">DST Handling</a></p>
1032
+ * </blockquote>
1033
+ *
1034
+ * ### ListAvailabilityTimeSlots runs with the following defaults:
1035
+ * + `localStartDate` is sorted in `ASC` order.
1036
+ * + `cursorPaging`.`limit` is `1000`.
1037
+ * @public
1038
+ * @documentationMaturity preview
1039
+ * @permissionId BOOKINGS.AVAILABILITY_READ_MULTI_SERVICE_TIME_SLOTS
1040
+ * @applicableIdentity APP
1041
+ * @applicableIdentity VISITOR
1042
+ * @fqn com.wixpress.bookings.availability.v2.MultiServiceAvailabilityTimeSlots.ListMultiServiceAvailabilityTimeSlots
1043
+ */
1044
+ declare function listMultiServiceAvailabilityTimeSlots(options?: ListMultiServiceAvailabilityTimeSlotsOptions): Promise<NonNullablePaths<ListMultiServiceAvailabilityTimeSlotsResponse, {
1045
+ [P in TimeSlotNonNullablePaths]: `timeSlots.${number}.${P}`;
1046
+ }[TimeSlotNonNullablePaths]> & {
1047
+ __applicationErrorsType?: ListMultiServiceAvailabilityTimeSlotsApplicationErrors;
1048
+ }>;
918
1049
  interface ListMultiServiceAvailabilityTimeSlotsOptions {
919
1050
  /**
920
1051
  * Services for which the multiService time slots are being returned for.
@@ -1034,5 +1165,71 @@ interface ListMultiServiceAvailabilityTimeSlotsOptions {
1034
1165
  */
1035
1166
  cursorPaging?: CursorPaging;
1036
1167
  }
1168
+ /**
1169
+ * Retrieves an available multiService `TimeSlot` that match the provided filters.
1170
+ *
1171
+ * Throws `SlotNotFound` if there is no such available time slot.
1172
+ *
1173
+ * <blockquote class="important">
1174
+ * <p><strong>Important:</strong><br/>
1175
+ * Currently supported only for services of type <code class="grey-background">APPOINTMENT</code>.</p>
1176
+ * </blockquote>
1177
+ *
1178
+ * By default,
1179
+ * if you don't provide a `service`.`includeResourceTypeIds` or `service`.`resourceIds` in request,
1180
+ * we return for each `TimeSlot`.`NestedTimeSlot` all `AvailableResources` with all `AvailableResources`.`resources` which are available to provide
1181
+ * the corresponding service within the time slot.
1182
+ *
1183
+ * If you specify `service`.`includeResourceTypeIds` or `service`.`resourceIds` in request,
1184
+ * the returned `TimeSlot`.`NestedTimeSlot` for this service will contain only `AvailableResources` with at least one available resource
1185
+ * which match the given resources filters,
1186
+ * each contains all available resources out of those requested.
1187
+ *
1188
+ * + Notes:
1189
+ * + All nested time slots share the same location.
1190
+ * + You can pass up to 8 services.
1191
+ *
1192
+ * <blockquote class="tip">
1193
+ * <p><strong>Tip:</strong><br/>
1194
+ * Use this API in order to get the availability of a specific <code class="grey-background">TimeSlot</code> out of those returned from <code class="grey-background">ListMultiServiceAvailabilityTimeSlots</code> API.</p>
1195
+ * </blockquote>
1196
+ * @param services - Services for which the multiService TimeSlots are being returned for.
1197
+ * Each service contains its own resources filters within.
1198
+ *
1199
+ * MinSize: 2.
1200
+ * MaxSize: 8.
1201
+ * @param localStartDate - Local start date of the time slot, in ISO-8601 format.
1202
+ * For example, "2024-01-30T13:30:00".
1203
+ * @param localEndDate - Local end date of the time slot, in ISO-8601 format.
1204
+ * For example, "2024-01-30T14:30:00".
1205
+ * @param timeZone - Time zone, in IANA time zone format.
1206
+ * @param location - The location of the time slot.
1207
+ *
1208
+ * You must provide a specific `locationType`.
1209
+ * If locationType is `BUSINESS`, you __must__ also provide a `locationId`.
1210
+ *
1211
+ * <blockquote class="warning">
1212
+ * <p>Supports filtering by location type, or by location ID.
1213
+ * Other fields like <code class="grey-background">name</code> are ignored.</p>
1214
+ * </blockquote>
1215
+ * @public
1216
+ * @documentationMaturity preview
1217
+ * @requiredField localEndDate
1218
+ * @requiredField localStartDate
1219
+ * @requiredField location
1220
+ * @requiredField location.locationType
1221
+ * @requiredField services
1222
+ * @requiredField services.serviceId
1223
+ * @requiredField timeZone
1224
+ * @permissionId BOOKINGS.AVAILABILITY_READ_MULTI_SERVICE_TIME_SLOTS
1225
+ * @applicableIdentity APP
1226
+ * @applicableIdentity VISITOR
1227
+ * @fqn com.wixpress.bookings.availability.v2.MultiServiceAvailabilityTimeSlots.GetMultiServiceAvailabilityTimeSlot
1228
+ */
1229
+ declare function getMultiServiceAvailabilityTimeSlot(services: NonNullablePaths<Service, `serviceId`>[], localStartDate: string, localEndDate: string, timeZone: string, location: NonNullablePaths<Location, `locationType`>): Promise<NonNullablePaths<GetMultiServiceAvailabilityTimeSlotResponse, {
1230
+ [P in TimeSlotNonNullablePaths]: `timeSlot.${P}`;
1231
+ }[TimeSlotNonNullablePaths]> & {
1232
+ __applicationErrorsType?: GetMultiServiceAvailabilityTimeSlotApplicationErrors;
1233
+ }>;
1037
1234
 
1038
- export { type AvailableResources as A, type BookingPolicyViolations as B, type CursorPaging as C, type EventInfo as E, type GetMultiServiceAvailabilityTimeSlotResponse as G, type ListMultiServiceAvailabilityTimeSlotsOptions as L, type NestedTimeSlot as N, type Resource as R, type Service as S, type TimeSlot as T, type V2CustomerChoices as V, type WaitingList as W, type ListMultiServiceAvailabilityTimeSlotsResponse as a, type Location as b, LocationType as c, type NonBookableReasons as d, type ListMultiServiceAvailabilityTimeSlotsRequest as e, type CursorPagingMetadata as f, type Cursors as g, type GetMultiServiceAvailabilityTimeSlotRequest as h, type ListAvailabilityTimeSlotsRequest as i, type CustomerChoices as j, type ResourceType as k, type ListAvailabilityTimeSlotsResponse as l, type GetAvailabilityTimeSlotRequest as m, type GetAvailabilityTimeSlotRequestCustomerChoices as n, type GetAvailabilityTimeSlotResponse as o, type ListEventTimeSlotsRequest as p, type ListEventTimeSlotsResponse as q, type GetEventTimeSlotRequest as r, type GetEventTimeSlotResponse as s };
1235
+ export { type AvailableResources, type BookingPolicyViolations, type CursorPaging, type CursorPagingMetadata, type Cursors, type CustomerChoices, type EventInfo, type GetAvailabilityTimeSlotRequest, type GetAvailabilityTimeSlotRequestCustomerChoices, type GetAvailabilityTimeSlotResponse, type GetEventTimeSlotRequest, type GetEventTimeSlotResponse, type GetMultiServiceAvailabilityTimeSlotApplicationErrors, type GetMultiServiceAvailabilityTimeSlotRequest, type GetMultiServiceAvailabilityTimeSlotResponse, type ListAvailabilityTimeSlotsRequest, type ListAvailabilityTimeSlotsResponse, type ListEventTimeSlotsRequest, type ListEventTimeSlotsResponse, type ListMultiServiceAvailabilityTimeSlotsApplicationErrors, type ListMultiServiceAvailabilityTimeSlotsOptions, type ListMultiServiceAvailabilityTimeSlotsRequest, type ListMultiServiceAvailabilityTimeSlotsResponse, type Location, LocationType, type LocationTypeWithLiterals, type NestedTimeSlot, type NonBookableReasons, type Resource, type ResourceType, type Service, type TimeSlot, type V2CustomerChoices, type WaitingList, getMultiServiceAvailabilityTimeSlot, listMultiServiceAvailabilityTimeSlots };
@@ -0,0 +1,299 @@
1
+ // src/bookings-availability-v2-time-slot-multi-service-availability-time-slots.universal.ts
2
+ import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
3
+ import {
4
+ renameKeysFromSDKRequestToRESTRequest,
5
+ renameKeysFromRESTResponseToSDKResponse
6
+ } from "@wix/sdk-runtime/rename-all-nested-keys";
7
+
8
+ // src/bookings-availability-v2-time-slot-multi-service-availability-time-slots.http.ts
9
+ import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
10
+ import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
11
+ import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
12
+ import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
13
+ function resolveComWixpressBookingsAvailabilityV2MultiServiceAvailabilityTimeSlotsUrl(opts) {
14
+ const domainToMappings = {
15
+ "www.wixapis.com": [
16
+ {
17
+ srcPath: "/_api/service-availability/v2/time-slots",
18
+ destPath: "/v2/time-slots"
19
+ },
20
+ {
21
+ srcPath: "/_api/service-availability/v2/multi-service-time-slots",
22
+ destPath: "/v2/multi-service-time-slots"
23
+ },
24
+ {
25
+ srcPath: "/service-availability/v2/time-slots",
26
+ destPath: "/v2/time-slots"
27
+ },
28
+ {
29
+ srcPath: "/service-availability/v2/multi-service-time-slots",
30
+ destPath: "/v2/multi-service-time-slots"
31
+ }
32
+ ],
33
+ "*.dev.wix-code.com": [
34
+ {
35
+ srcPath: "/_api/service-availability/v2/time-slots",
36
+ destPath: "/v2/time-slots"
37
+ },
38
+ {
39
+ srcPath: "/_api/service-availability/v2/multi-service-time-slots",
40
+ destPath: "/v2/multi-service-time-slots"
41
+ },
42
+ {
43
+ srcPath: "/service-availability/v2/time-slots",
44
+ destPath: "/v2/time-slots"
45
+ },
46
+ {
47
+ srcPath: "/service-availability/v2/multi-service-time-slots",
48
+ destPath: "/v2/multi-service-time-slots"
49
+ }
50
+ ],
51
+ "manage._base_domain_": [
52
+ {
53
+ srcPath: "/_api/service-availability/v2/time-slots",
54
+ destPath: "/v2/time-slots"
55
+ },
56
+ {
57
+ srcPath: "/_api/service-availability/v2/multi-service-time-slots",
58
+ destPath: "/v2/multi-service-time-slots"
59
+ },
60
+ {
61
+ srcPath: "/service-availability/v2/multi-service-time-slots",
62
+ destPath: "/v2/multi-service-time-slots"
63
+ },
64
+ {
65
+ srcPath: "/service-availability/v2/time-slots",
66
+ destPath: "/v2/time-slots"
67
+ }
68
+ ],
69
+ "www._base_domain_": [
70
+ {
71
+ srcPath: "/_api/service-availability/v2/time-slots",
72
+ destPath: "/v2/time-slots"
73
+ },
74
+ {
75
+ srcPath: "/_api/service-availability/v2/multi-service-time-slots",
76
+ destPath: "/v2/multi-service-time-slots"
77
+ }
78
+ ],
79
+ _: [
80
+ {
81
+ srcPath: "/_api/service-availability/v2/time-slots",
82
+ destPath: "/v2/time-slots"
83
+ },
84
+ {
85
+ srcPath: "/_api/service-availability/v2/multi-service-time-slots",
86
+ destPath: "/v2/multi-service-time-slots"
87
+ },
88
+ {
89
+ srcPath: "/_api/service-availability/v2/time-slots/event",
90
+ destPath: "/v2/time-slots/event"
91
+ }
92
+ ],
93
+ "editor._base_domain_": [
94
+ {
95
+ srcPath: "/_api/service-availability/v2/multi-service-time-slots",
96
+ destPath: "/v2/multi-service-time-slots"
97
+ },
98
+ {
99
+ srcPath: "/_api/service-availability/v2/time-slots",
100
+ destPath: "/v2/time-slots"
101
+ },
102
+ {
103
+ srcPath: "/_api/service-availability/v2/time-slots/event",
104
+ destPath: "/v2/time-slots/event"
105
+ }
106
+ ],
107
+ "blocks._base_domain_": [
108
+ {
109
+ srcPath: "/_api/service-availability/v2/multi-service-time-slots",
110
+ destPath: "/v2/multi-service-time-slots"
111
+ },
112
+ {
113
+ srcPath: "/_api/service-availability/v2/time-slots",
114
+ destPath: "/v2/time-slots"
115
+ },
116
+ {
117
+ srcPath: "/_api/service-availability/v2/time-slots/event",
118
+ destPath: "/v2/time-slots/event"
119
+ }
120
+ ],
121
+ "create.editorx": [
122
+ {
123
+ srcPath: "/_api/service-availability/v2/multi-service-time-slots",
124
+ destPath: "/v2/multi-service-time-slots"
125
+ },
126
+ {
127
+ srcPath: "/_api/service-availability/v2/time-slots",
128
+ destPath: "/v2/time-slots"
129
+ },
130
+ {
131
+ srcPath: "/_api/service-availability/v2/time-slots/event",
132
+ destPath: "/v2/time-slots/event"
133
+ }
134
+ ],
135
+ "editor.wixapps.net": [
136
+ {
137
+ srcPath: "/_api/service-availability/v2/time-slots/event",
138
+ destPath: "/v2/time-slots/event"
139
+ }
140
+ ]
141
+ };
142
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
143
+ }
144
+ var PACKAGE_NAME = "@wix/auto_sdk_bookings_multi-service-availability-time-slots";
145
+ function listMultiServiceAvailabilityTimeSlots(payload) {
146
+ function __listMultiServiceAvailabilityTimeSlots({ host }) {
147
+ const serializedData = transformPaths(payload, [
148
+ {
149
+ transformFn: transformSDKTimestampToRESTTimestamp,
150
+ paths: [{ path: "bookingPolicyViolations.earliestBookingDate" }]
151
+ }
152
+ ]);
153
+ const metadata = {
154
+ entityFqdn: "wix.bookings.availability.v2.time_slot",
155
+ method: "POST",
156
+ methodFqn: "com.wixpress.bookings.availability.v2.MultiServiceAvailabilityTimeSlots.ListMultiServiceAvailabilityTimeSlots",
157
+ packageName: PACKAGE_NAME,
158
+ url: resolveComWixpressBookingsAvailabilityV2MultiServiceAvailabilityTimeSlotsUrl(
159
+ {
160
+ protoPath: "/v2/multi-service-time-slots",
161
+ data: serializedData,
162
+ host
163
+ }
164
+ ),
165
+ data: serializedData,
166
+ transformResponse: (payload2) => transformPaths(payload2, [
167
+ {
168
+ transformFn: transformRESTTimestampToSDKTimestamp,
169
+ paths: [
170
+ { path: "timeSlots.bookingPolicyViolations.earliestBookingDate" }
171
+ ]
172
+ }
173
+ ])
174
+ };
175
+ return metadata;
176
+ }
177
+ return __listMultiServiceAvailabilityTimeSlots;
178
+ }
179
+ function getMultiServiceAvailabilityTimeSlot(payload) {
180
+ function __getMultiServiceAvailabilityTimeSlot({ host }) {
181
+ const metadata = {
182
+ entityFqdn: "wix.bookings.availability.v2.time_slot",
183
+ method: "POST",
184
+ methodFqn: "com.wixpress.bookings.availability.v2.MultiServiceAvailabilityTimeSlots.GetMultiServiceAvailabilityTimeSlot",
185
+ packageName: PACKAGE_NAME,
186
+ url: resolveComWixpressBookingsAvailabilityV2MultiServiceAvailabilityTimeSlotsUrl(
187
+ { protoPath: "/v2/multi-service-time-slots/get", data: payload, host }
188
+ ),
189
+ data: payload,
190
+ transformResponse: (payload2) => transformPaths(payload2, [
191
+ {
192
+ transformFn: transformRESTTimestampToSDKTimestamp,
193
+ paths: [
194
+ { path: "timeSlot.bookingPolicyViolations.earliestBookingDate" }
195
+ ]
196
+ }
197
+ ])
198
+ };
199
+ return metadata;
200
+ }
201
+ return __getMultiServiceAvailabilityTimeSlot;
202
+ }
203
+
204
+ // src/bookings-availability-v2-time-slot-multi-service-availability-time-slots.universal.ts
205
+ var LocationType = /* @__PURE__ */ ((LocationType2) => {
206
+ LocationType2["UNKNOWN_LOCATION_TYPE"] = "UNKNOWN_LOCATION_TYPE";
207
+ LocationType2["BUSINESS"] = "BUSINESS";
208
+ LocationType2["CUSTOM"] = "CUSTOM";
209
+ LocationType2["CUSTOMER"] = "CUSTOMER";
210
+ return LocationType2;
211
+ })(LocationType || {});
212
+ async function listMultiServiceAvailabilityTimeSlots2(options) {
213
+ const { httpClient, sideEffects } = arguments[1];
214
+ const payload = renameKeysFromSDKRequestToRESTRequest({
215
+ services: options?.services,
216
+ fromLocalDate: options?.fromLocalDate,
217
+ toLocalDate: options?.toLocalDate,
218
+ timeZone: options?.timeZone,
219
+ location: options?.location,
220
+ bookable: options?.bookable,
221
+ bookingPolicyViolations: options?.bookingPolicyViolations,
222
+ timeSlotsPerDay: options?.timeSlotsPerDay,
223
+ cursorPaging: options?.cursorPaging
224
+ });
225
+ const reqOpts = listMultiServiceAvailabilityTimeSlots(
226
+ payload
227
+ );
228
+ sideEffects?.onSiteCall?.();
229
+ try {
230
+ const result = await httpClient.request(reqOpts);
231
+ sideEffects?.onSuccess?.(result);
232
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
233
+ } catch (err) {
234
+ const transformedError = sdkTransformError(
235
+ err,
236
+ {
237
+ spreadPathsToArguments: {},
238
+ explicitPathsToArguments: {
239
+ services: "$[0].services",
240
+ fromLocalDate: "$[0].fromLocalDate",
241
+ toLocalDate: "$[0].toLocalDate",
242
+ timeZone: "$[0].timeZone",
243
+ location: "$[0].location",
244
+ bookable: "$[0].bookable",
245
+ bookingPolicyViolations: "$[0].bookingPolicyViolations",
246
+ timeSlotsPerDay: "$[0].timeSlotsPerDay",
247
+ cursorPaging: "$[0].cursorPaging"
248
+ },
249
+ singleArgumentUnchanged: false
250
+ },
251
+ ["options"]
252
+ );
253
+ sideEffects?.onError?.(err);
254
+ throw transformedError;
255
+ }
256
+ }
257
+ async function getMultiServiceAvailabilityTimeSlot2(services, localStartDate, localEndDate, timeZone, location) {
258
+ const { httpClient, sideEffects } = arguments[5];
259
+ const payload = renameKeysFromSDKRequestToRESTRequest({
260
+ services,
261
+ localStartDate,
262
+ localEndDate,
263
+ timeZone,
264
+ location
265
+ });
266
+ const reqOpts = getMultiServiceAvailabilityTimeSlot(
267
+ payload
268
+ );
269
+ sideEffects?.onSiteCall?.();
270
+ try {
271
+ const result = await httpClient.request(reqOpts);
272
+ sideEffects?.onSuccess?.(result);
273
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
274
+ } catch (err) {
275
+ const transformedError = sdkTransformError(
276
+ err,
277
+ {
278
+ spreadPathsToArguments: {},
279
+ explicitPathsToArguments: {
280
+ services: "$[0]",
281
+ localStartDate: "$[1]",
282
+ localEndDate: "$[2]",
283
+ timeZone: "$[3]",
284
+ location: "$[4]"
285
+ },
286
+ singleArgumentUnchanged: false
287
+ },
288
+ ["services", "localStartDate", "localEndDate", "timeZone", "location"]
289
+ );
290
+ sideEffects?.onError?.(err);
291
+ throw transformedError;
292
+ }
293
+ }
294
+ export {
295
+ LocationType,
296
+ getMultiServiceAvailabilityTimeSlot2 as getMultiServiceAvailabilityTimeSlot,
297
+ listMultiServiceAvailabilityTimeSlots2 as listMultiServiceAvailabilityTimeSlots
298
+ };
299
+ //# sourceMappingURL=index.typings.mjs.map