@wix/auto_sdk_bookings_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.
- package/build/cjs/index.d.ts +8 -4
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/{bookings-availability-v2-time-slot-availability-time-slots.universal-DKziuf2q.d.ts → index.typings.d.ts} +194 -1
- package/build/cjs/index.typings.js +342 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +2 -1
- package/build/es/index.d.mts +8 -4
- package/build/es/index.mjs.map +1 -1
- package/build/es/{bookings-availability-v2-time-slot-availability-time-slots.universal-DKziuf2q.d.mts → index.typings.d.mts} +194 -1
- package/build/es/index.typings.mjs +316 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +2 -1
- package/build/internal/cjs/index.d.ts +8 -4
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/{bookings-availability-v2-time-slot-availability-time-slots.universal-DKziuf2q.d.ts → index.typings.d.ts} +194 -1
- package/build/internal/cjs/index.typings.js +342 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +2 -1
- package/build/internal/es/index.d.mts +8 -4
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/{bookings-availability-v2-time-slot-availability-time-slots.universal-DKziuf2q.d.mts → index.typings.d.mts} +194 -1
- package/build/internal/es/index.typings.mjs +316 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +2 -1
- 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,139 @@ interface GetEventTimeSlotResponse {
|
|
|
915
917
|
*/
|
|
916
918
|
timeZone?: string | null;
|
|
917
919
|
}
|
|
920
|
+
type ListAvailabilityTimeSlotsApplicationErrors = {
|
|
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?: 'UNAUTHORIZED_OPERATION';
|
|
934
|
+
description?: string;
|
|
935
|
+
data?: Record<string, any>;
|
|
936
|
+
} | {
|
|
937
|
+
code?: 'SERVICE_NOT_FOUND';
|
|
938
|
+
description?: string;
|
|
939
|
+
data?: Record<string, any>;
|
|
940
|
+
};
|
|
941
|
+
type GetAvailabilityTimeSlotApplicationErrors = {
|
|
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 `TimeSlot`s that match the provided filters.
|
|
961
|
+
*
|
|
962
|
+
* <blockquote class="important">
|
|
963
|
+
* <p><strong>Important:</strong>
|
|
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: `serviceId`, `fromLocalDate`, `toLocalDate`, and `timeZone`.
|
|
969
|
+
* You may add additional filters as you wish.
|
|
970
|
+
* + A `cursorPaging` with a valid `cursor` from previous response.
|
|
971
|
+
*
|
|
972
|
+
*
|
|
973
|
+
* Each [TimeSlot](https://bo.wix.com/wix-docs/rest/all-apis/wix-service-availability/availability-time-slots/time-slot-object) in response
|
|
974
|
+
* represents the availability of the service in a specific location,
|
|
975
|
+
* and has a `localStartDate` within the range of the provided `fromLocalDate` and `toLocalDate` exclusive.
|
|
976
|
+
* The `localEndDate` of a `TimeSlot` is calculated as the sum of the `TimeSlot`'s `localStartDate` and the duration of the service.
|
|
977
|
+
*
|
|
978
|
+
* By default,
|
|
979
|
+
* the response contains at most 1000 results.
|
|
980
|
+
* If there are more than 1000 results, we return a `cursorPagingMetadata` with
|
|
981
|
+
* a cursor for the next page of results, regardless of whether a `cursorPaging`
|
|
982
|
+
* was provided in request.
|
|
983
|
+
*
|
|
984
|
+
* ### AvailableResources in response
|
|
985
|
+
* The `TimeSlot`'s `AvailableResources` contains information about the resources that are available to provide the service
|
|
986
|
+
* within the time slot. Each `AvailableResources` contains information about available resources of the same type.
|
|
987
|
+
*
|
|
988
|
+
* <blockquote class="important">
|
|
989
|
+
* <p><strong>Important:</strong><br/>
|
|
990
|
+
* By default,
|
|
991
|
+
* if you don't specify <code class="grey-background">includeResourceTypeIds</code>
|
|
992
|
+
* or <code class="grey-background">resourceIds</code> filters in request,
|
|
993
|
+
* we return TimeSlots with an empty <code class="grey-background">AvailableResources</code>.
|
|
994
|
+
* <br/><strong>Note:</strong><br/> Not specifying resources filters can be handy in case you want to avoid large response in flows that only
|
|
995
|
+
* 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/availability-time-slots/sample-flows?localViewerId=inbari#all-apis_service-availability_availability-time-slots_sample-flows_find-the-first-date-within-the-next-3-months-that-the-selected-service-is-available-for)
|
|
996
|
+
* is an example for such flow.
|
|
997
|
+
* </p>
|
|
998
|
+
* </blockquote>
|
|
999
|
+
*
|
|
1000
|
+
* If you wish to get a list of available resources for each `TimeSlot` you should either:
|
|
1001
|
+
* + provide `resourceIds` in request.
|
|
1002
|
+
* + provide `includeResourceTypeIds` in request.
|
|
1003
|
+
*
|
|
1004
|
+
* __Notes:__
|
|
1005
|
+
* + In both cases the returned TimeSlots contains __up__ to 10 `AvailableResources` that match the provided filters.
|
|
1006
|
+
* Each `AvailableResources` contains __up__ to 10 available `resources` of the same type that match the provided filters.
|
|
1007
|
+
* + If an `AvailableResources` has more available resources which are not listed within it,
|
|
1008
|
+
* we return `AvailableResources`.`hasMoreAvailableResources` as true.
|
|
1009
|
+
* > __Note:__
|
|
1010
|
+
* > If you wish to get the full available resources list for a specific `TimeSlot`,
|
|
1011
|
+
* > you should call [GetAvailabilityTimeSlot](https://bo.wix.com/wix-docs/rest/all-apis/wix-service-availability/service-availability-time-slots/get-availability-time-slot).
|
|
1012
|
+
*
|
|
1013
|
+
*
|
|
1014
|
+
* ### Availability VS Bookability
|
|
1015
|
+
* An `available` time slot is not necessarily `bookable`.
|
|
1016
|
+
* The `bookable` field of a `TimeSlot` indicates whether a customer can book the service within the given time slot,
|
|
1017
|
+
* at a specific period of time.
|
|
1018
|
+
* Read more about [Availability VS Bookability](https://bo.wix.com/wix-docs/rest/all-apis/wix-service-availability/service-availability-time-slots/introduction#all-apis_wix-service-availability_service-availability-time-slots_introduction_availability-vs-bookability).
|
|
1019
|
+
*
|
|
1020
|
+
* By default,
|
|
1021
|
+
* + The response does not contains `unavailable` TimeSlots.
|
|
1022
|
+
* For example,
|
|
1023
|
+
* if there are no available resources to provide the service from `2024-01-30T14:30:00` to `2024-01-30T15:30:00`,
|
|
1024
|
+
* we don't return TimeSlots with `localStartDate` within this range.
|
|
1025
|
+
* + The response contains both `bookable` and `un-bookable` TimeSlots.
|
|
1026
|
+
* For example,
|
|
1027
|
+
* if the service has a booking policy which enforces booking the service up to 10 minutes before the session starts,
|
|
1028
|
+
* we return TimeSlots with the violating `localStartDate` with `bookable` as false.
|
|
1029
|
+
* If you wish to list only available __bookable__ TimeSlots you should pass `bookable` filter as true.
|
|
1030
|
+
*
|
|
1031
|
+
* <blockquote class="important">
|
|
1032
|
+
* <p><strong>Important:</strong>
|
|
1033
|
+
* Because of DST, there are edge cases where certain times either do not exist or exist twice for a local time zone.
|
|
1034
|
+
* Read more about <a href="https://bo.wix.com/wix-docs/rest/all-apis/service-availability/availability-time-slots/introduction?localViewerId=inbari#all-apis_service-availability_availability-time-slots_introduction_daylight-saving-time-dst-handling">DST Handling</a></p>
|
|
1035
|
+
* </blockquote>
|
|
1036
|
+
*
|
|
1037
|
+
*
|
|
1038
|
+
* ### ListAvailabilityTimeSlots runs with the following defaults
|
|
1039
|
+
* + `localStartDate` is sorted in `ASC` order
|
|
1040
|
+
* + `cursorPaging`.`limit` is `1000`
|
|
1041
|
+
* @public
|
|
1042
|
+
* @documentationMaturity preview
|
|
1043
|
+
* @permissionId BOOKINGS.AVAILABILITY_READ_TIME_SLOTS
|
|
1044
|
+
* @applicableIdentity APP
|
|
1045
|
+
* @applicableIdentity VISITOR
|
|
1046
|
+
* @fqn com.wixpress.bookings.availability.v2.AvailabilityTimeSlots.ListAvailabilityTimeSlots
|
|
1047
|
+
*/
|
|
1048
|
+
declare function listAvailabilityTimeSlots(options?: ListAvailabilityTimeSlotsOptions): Promise<NonNullablePaths<ListAvailabilityTimeSlotsResponse, {
|
|
1049
|
+
[P in TimeSlotNonNullablePaths]: `timeSlots.${number}.${P}`;
|
|
1050
|
+
}[TimeSlotNonNullablePaths]> & {
|
|
1051
|
+
__applicationErrorsType?: ListAvailabilityTimeSlotsApplicationErrors;
|
|
1052
|
+
}>;
|
|
918
1053
|
interface ListAvailabilityTimeSlotsOptions {
|
|
919
1054
|
/**
|
|
920
1055
|
* Service ID for which the time slots are being returned for.
|
|
@@ -1056,6 +1191,64 @@ interface ListAvailabilityTimeSlotsOptions {
|
|
|
1056
1191
|
*/
|
|
1057
1192
|
resourceTypes?: ResourceType[];
|
|
1058
1193
|
}
|
|
1194
|
+
/**
|
|
1195
|
+
* Retrieves an available `TimeSlot` that match the provided filters.
|
|
1196
|
+
*
|
|
1197
|
+
* Throws `SlotNotFound` if there is no such available time slot.
|
|
1198
|
+
*
|
|
1199
|
+
* <blockquote class="important">
|
|
1200
|
+
* <p><strong>Important:</strong><br/>
|
|
1201
|
+
* Currently supported only for services of type <code class="grey-background">APPOINTMENT</code>.</p>
|
|
1202
|
+
* </blockquote>
|
|
1203
|
+
*
|
|
1204
|
+
* By default,
|
|
1205
|
+
* if you don't provide `includeResourceTypeIds` or `resourceIds` in request,
|
|
1206
|
+
* we return all `AvailableResources` with all `AvailableResources`.`resources` which are available to provide
|
|
1207
|
+
* the service within the time slot.
|
|
1208
|
+
*
|
|
1209
|
+
* If you specify `includeResourceTypeIds` or `resourceIds` in request,
|
|
1210
|
+
* the returned `TimeSlot` will contain only `AvailableResources` with at least one available resource
|
|
1211
|
+
* which match the given resources filters,
|
|
1212
|
+
* each contains all available resources out of those requested.
|
|
1213
|
+
*
|
|
1214
|
+
*
|
|
1215
|
+
* <blockquote class="tip">
|
|
1216
|
+
* <p><strong>Tip:</strong><br/>
|
|
1217
|
+
* 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">ListAvailabilityTimeSlots</code> API.</p>
|
|
1218
|
+
* </blockquote>
|
|
1219
|
+
* @param serviceId - Service ID of the time slot.
|
|
1220
|
+
* Currently supported only for services of type `APPOINTMENT`.
|
|
1221
|
+
* @param localStartDate - Local start date of the time slot, in ISO-8601 format.
|
|
1222
|
+
* For example, "2024-01-30T13:30:00".
|
|
1223
|
+
* @param localEndDate - Local end date of the time slot, in ISO-8601 format.
|
|
1224
|
+
* For example, "2024-01-30T14:30:00".
|
|
1225
|
+
* @param timeZone - Time zone, in IANA time zone format.
|
|
1226
|
+
* @param location - The location of the time slot.
|
|
1227
|
+
*
|
|
1228
|
+
* You must provide a specific `locationType`.
|
|
1229
|
+
* If locationType is `BUSINESS`, you __must__ also provide a `locationId`.
|
|
1230
|
+
*
|
|
1231
|
+
* <blockquote class="warning">
|
|
1232
|
+
* <p>Supports filtering by location type, or by location ID.
|
|
1233
|
+
* Other fields like <code class="grey-background">name</code> are ignored.</p>
|
|
1234
|
+
* </blockquote>
|
|
1235
|
+
* @public
|
|
1236
|
+
* @documentationMaturity preview
|
|
1237
|
+
* @requiredField localEndDate
|
|
1238
|
+
* @requiredField localStartDate
|
|
1239
|
+
* @requiredField location
|
|
1240
|
+
* @requiredField serviceId
|
|
1241
|
+
* @requiredField timeZone
|
|
1242
|
+
* @permissionId BOOKINGS.AVAILABILITY_READ_TIME_SLOTS
|
|
1243
|
+
* @applicableIdentity APP
|
|
1244
|
+
* @applicableIdentity VISITOR
|
|
1245
|
+
* @fqn com.wixpress.bookings.availability.v2.AvailabilityTimeSlots.GetAvailabilityTimeSlot
|
|
1246
|
+
*/
|
|
1247
|
+
declare function getAvailabilityTimeSlot(serviceId: string, localStartDate: string, localEndDate: string, timeZone: string, location: Location, options?: GetAvailabilityTimeSlotOptions): Promise<NonNullablePaths<GetAvailabilityTimeSlotResponse, {
|
|
1248
|
+
[P in TimeSlotNonNullablePaths]: `timeSlot.${P}`;
|
|
1249
|
+
}[TimeSlotNonNullablePaths]> & {
|
|
1250
|
+
__applicationErrorsType?: GetAvailabilityTimeSlotApplicationErrors;
|
|
1251
|
+
}>;
|
|
1059
1252
|
interface GetAvailabilityTimeSlotOptions {
|
|
1060
1253
|
/**
|
|
1061
1254
|
* Resources to include in response.
|
|
@@ -1078,4 +1271,4 @@ interface GetAvailabilityTimeSlotOptions {
|
|
|
1078
1271
|
includeResourceTypeIds?: string[];
|
|
1079
1272
|
}
|
|
1080
1273
|
|
|
1081
|
-
export { type AvailableResources
|
|
1274
|
+
export { type AvailableResources, type BookingPolicyViolations, type CursorPaging, type CursorPagingMetadata, type Cursors, type CustomerChoices, type EventInfo, type GetAvailabilityTimeSlotApplicationErrors, type GetAvailabilityTimeSlotOptions, type GetAvailabilityTimeSlotRequest, type GetAvailabilityTimeSlotRequestCustomerChoices, type GetAvailabilityTimeSlotResponse, type GetEventTimeSlotRequest, type GetEventTimeSlotResponse, type GetMultiServiceAvailabilityTimeSlotRequest, type GetMultiServiceAvailabilityTimeSlotResponse, type ListAvailabilityTimeSlotsApplicationErrors, type ListAvailabilityTimeSlotsOptions, type ListAvailabilityTimeSlotsRequest, type ListAvailabilityTimeSlotsResponse, type ListEventTimeSlotsRequest, type ListEventTimeSlotsResponse, 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, getAvailabilityTimeSlot, listAvailabilityTimeSlots };
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// index.typings.ts
|
|
21
|
+
var index_typings_exports = {};
|
|
22
|
+
__export(index_typings_exports, {
|
|
23
|
+
LocationType: () => LocationType,
|
|
24
|
+
getAvailabilityTimeSlot: () => getAvailabilityTimeSlot2,
|
|
25
|
+
listAvailabilityTimeSlots: () => listAvailabilityTimeSlots2
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(index_typings_exports);
|
|
28
|
+
|
|
29
|
+
// src/bookings-availability-v2-time-slot-availability-time-slots.universal.ts
|
|
30
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
31
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
32
|
+
|
|
33
|
+
// src/bookings-availability-v2-time-slot-availability-time-slots.http.ts
|
|
34
|
+
var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
|
|
35
|
+
var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
36
|
+
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
37
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
38
|
+
function resolveComWixpressBookingsAvailabilityV2AvailabilityTimeSlotsUrl(opts) {
|
|
39
|
+
const domainToMappings = {
|
|
40
|
+
"www.wixapis.com": [
|
|
41
|
+
{
|
|
42
|
+
srcPath: "/_api/service-availability/v2/time-slots",
|
|
43
|
+
destPath: "/v2/time-slots"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
srcPath: "/_api/service-availability/v2/multi-service-time-slots",
|
|
47
|
+
destPath: "/v2/multi-service-time-slots"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
srcPath: "/service-availability/v2/time-slots",
|
|
51
|
+
destPath: "/v2/time-slots"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
srcPath: "/service-availability/v2/multi-service-time-slots",
|
|
55
|
+
destPath: "/v2/multi-service-time-slots"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"*.dev.wix-code.com": [
|
|
59
|
+
{
|
|
60
|
+
srcPath: "/_api/service-availability/v2/time-slots",
|
|
61
|
+
destPath: "/v2/time-slots"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
srcPath: "/_api/service-availability/v2/multi-service-time-slots",
|
|
65
|
+
destPath: "/v2/multi-service-time-slots"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
srcPath: "/service-availability/v2/time-slots",
|
|
69
|
+
destPath: "/v2/time-slots"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
srcPath: "/service-availability/v2/multi-service-time-slots",
|
|
73
|
+
destPath: "/v2/multi-service-time-slots"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"manage._base_domain_": [
|
|
77
|
+
{
|
|
78
|
+
srcPath: "/_api/service-availability/v2/time-slots",
|
|
79
|
+
destPath: "/v2/time-slots"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
srcPath: "/_api/service-availability/v2/multi-service-time-slots",
|
|
83
|
+
destPath: "/v2/multi-service-time-slots"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
srcPath: "/service-availability/v2/multi-service-time-slots",
|
|
87
|
+
destPath: "/v2/multi-service-time-slots"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
srcPath: "/service-availability/v2/time-slots",
|
|
91
|
+
destPath: "/v2/time-slots"
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"www._base_domain_": [
|
|
95
|
+
{
|
|
96
|
+
srcPath: "/_api/service-availability/v2/time-slots",
|
|
97
|
+
destPath: "/v2/time-slots"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
srcPath: "/_api/service-availability/v2/multi-service-time-slots",
|
|
101
|
+
destPath: "/v2/multi-service-time-slots"
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
_: [
|
|
105
|
+
{
|
|
106
|
+
srcPath: "/_api/service-availability/v2/time-slots",
|
|
107
|
+
destPath: "/v2/time-slots"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
srcPath: "/_api/service-availability/v2/multi-service-time-slots",
|
|
111
|
+
destPath: "/v2/multi-service-time-slots"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
srcPath: "/_api/service-availability/v2/time-slots/event",
|
|
115
|
+
destPath: "/v2/time-slots/event"
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
"editor._base_domain_": [
|
|
119
|
+
{
|
|
120
|
+
srcPath: "/_api/service-availability/v2/multi-service-time-slots",
|
|
121
|
+
destPath: "/v2/multi-service-time-slots"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
srcPath: "/_api/service-availability/v2/time-slots",
|
|
125
|
+
destPath: "/v2/time-slots"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
srcPath: "/_api/service-availability/v2/time-slots/event",
|
|
129
|
+
destPath: "/v2/time-slots/event"
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
"blocks._base_domain_": [
|
|
133
|
+
{
|
|
134
|
+
srcPath: "/_api/service-availability/v2/multi-service-time-slots",
|
|
135
|
+
destPath: "/v2/multi-service-time-slots"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
srcPath: "/_api/service-availability/v2/time-slots",
|
|
139
|
+
destPath: "/v2/time-slots"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
srcPath: "/_api/service-availability/v2/time-slots/event",
|
|
143
|
+
destPath: "/v2/time-slots/event"
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
"create.editorx": [
|
|
147
|
+
{
|
|
148
|
+
srcPath: "/_api/service-availability/v2/multi-service-time-slots",
|
|
149
|
+
destPath: "/v2/multi-service-time-slots"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
srcPath: "/_api/service-availability/v2/time-slots",
|
|
153
|
+
destPath: "/v2/time-slots"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
srcPath: "/_api/service-availability/v2/time-slots/event",
|
|
157
|
+
destPath: "/v2/time-slots/event"
|
|
158
|
+
}
|
|
159
|
+
],
|
|
160
|
+
"editor.wixapps.net": [
|
|
161
|
+
{
|
|
162
|
+
srcPath: "/_api/service-availability/v2/time-slots/event",
|
|
163
|
+
destPath: "/v2/time-slots/event"
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
};
|
|
167
|
+
return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
168
|
+
}
|
|
169
|
+
var PACKAGE_NAME = "@wix/auto_sdk_bookings_availability-time-slots";
|
|
170
|
+
function listAvailabilityTimeSlots(payload) {
|
|
171
|
+
function __listAvailabilityTimeSlots({ host }) {
|
|
172
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
173
|
+
{
|
|
174
|
+
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
175
|
+
paths: [{ path: "bookingPolicyViolations.earliestBookingDate" }]
|
|
176
|
+
}
|
|
177
|
+
]);
|
|
178
|
+
const metadata = {
|
|
179
|
+
entityFqdn: "wix.bookings.availability.v2.time_slot",
|
|
180
|
+
method: "POST",
|
|
181
|
+
methodFqn: "com.wixpress.bookings.availability.v2.AvailabilityTimeSlots.ListAvailabilityTimeSlots",
|
|
182
|
+
packageName: PACKAGE_NAME,
|
|
183
|
+
url: resolveComWixpressBookingsAvailabilityV2AvailabilityTimeSlotsUrl({
|
|
184
|
+
protoPath: "/v2/time-slots",
|
|
185
|
+
data: serializedData,
|
|
186
|
+
host
|
|
187
|
+
}),
|
|
188
|
+
data: serializedData,
|
|
189
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
190
|
+
{
|
|
191
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
192
|
+
paths: [
|
|
193
|
+
{ path: "timeSlots.bookingPolicyViolations.earliestBookingDate" }
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
])
|
|
197
|
+
};
|
|
198
|
+
return metadata;
|
|
199
|
+
}
|
|
200
|
+
return __listAvailabilityTimeSlots;
|
|
201
|
+
}
|
|
202
|
+
function getAvailabilityTimeSlot(payload) {
|
|
203
|
+
function __getAvailabilityTimeSlot({ host }) {
|
|
204
|
+
const metadata = {
|
|
205
|
+
entityFqdn: "wix.bookings.availability.v2.time_slot",
|
|
206
|
+
method: "POST",
|
|
207
|
+
methodFqn: "com.wixpress.bookings.availability.v2.AvailabilityTimeSlots.GetAvailabilityTimeSlot",
|
|
208
|
+
packageName: PACKAGE_NAME,
|
|
209
|
+
url: resolveComWixpressBookingsAvailabilityV2AvailabilityTimeSlotsUrl({
|
|
210
|
+
protoPath: "/v2/time-slots/get",
|
|
211
|
+
data: payload,
|
|
212
|
+
host
|
|
213
|
+
}),
|
|
214
|
+
data: payload,
|
|
215
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
216
|
+
{
|
|
217
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
218
|
+
paths: [
|
|
219
|
+
{ path: "timeSlot.bookingPolicyViolations.earliestBookingDate" }
|
|
220
|
+
]
|
|
221
|
+
}
|
|
222
|
+
])
|
|
223
|
+
};
|
|
224
|
+
return metadata;
|
|
225
|
+
}
|
|
226
|
+
return __getAvailabilityTimeSlot;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// src/bookings-availability-v2-time-slot-availability-time-slots.universal.ts
|
|
230
|
+
var LocationType = /* @__PURE__ */ ((LocationType2) => {
|
|
231
|
+
LocationType2["UNKNOWN_LOCATION_TYPE"] = "UNKNOWN_LOCATION_TYPE";
|
|
232
|
+
LocationType2["BUSINESS"] = "BUSINESS";
|
|
233
|
+
LocationType2["CUSTOM"] = "CUSTOM";
|
|
234
|
+
LocationType2["CUSTOMER"] = "CUSTOMER";
|
|
235
|
+
return LocationType2;
|
|
236
|
+
})(LocationType || {});
|
|
237
|
+
async function listAvailabilityTimeSlots2(options) {
|
|
238
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
239
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
240
|
+
serviceId: options?.serviceId,
|
|
241
|
+
fromLocalDate: options?.fromLocalDate,
|
|
242
|
+
toLocalDate: options?.toLocalDate,
|
|
243
|
+
timeZone: options?.timeZone,
|
|
244
|
+
locations: options?.locations,
|
|
245
|
+
resourceIds: options?.resourceIds,
|
|
246
|
+
includeResourceTypeIds: options?.includeResourceTypeIds,
|
|
247
|
+
bookable: options?.bookable,
|
|
248
|
+
bookingPolicyViolations: options?.bookingPolicyViolations,
|
|
249
|
+
timeSlotsPerDay: options?.timeSlotsPerDay,
|
|
250
|
+
cursorPaging: options?.cursorPaging,
|
|
251
|
+
resourceTypes: options?.resourceTypes
|
|
252
|
+
});
|
|
253
|
+
const reqOpts = listAvailabilityTimeSlots(
|
|
254
|
+
payload
|
|
255
|
+
);
|
|
256
|
+
sideEffects?.onSiteCall?.();
|
|
257
|
+
try {
|
|
258
|
+
const result = await httpClient.request(reqOpts);
|
|
259
|
+
sideEffects?.onSuccess?.(result);
|
|
260
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
261
|
+
} catch (err) {
|
|
262
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
263
|
+
err,
|
|
264
|
+
{
|
|
265
|
+
spreadPathsToArguments: {},
|
|
266
|
+
explicitPathsToArguments: {
|
|
267
|
+
serviceId: "$[0].serviceId",
|
|
268
|
+
fromLocalDate: "$[0].fromLocalDate",
|
|
269
|
+
toLocalDate: "$[0].toLocalDate",
|
|
270
|
+
timeZone: "$[0].timeZone",
|
|
271
|
+
locations: "$[0].locations",
|
|
272
|
+
resourceIds: "$[0].resourceIds",
|
|
273
|
+
includeResourceTypeIds: "$[0].includeResourceTypeIds",
|
|
274
|
+
bookable: "$[0].bookable",
|
|
275
|
+
bookingPolicyViolations: "$[0].bookingPolicyViolations",
|
|
276
|
+
timeSlotsPerDay: "$[0].timeSlotsPerDay",
|
|
277
|
+
cursorPaging: "$[0].cursorPaging",
|
|
278
|
+
resourceTypes: "$[0].resourceTypes"
|
|
279
|
+
},
|
|
280
|
+
singleArgumentUnchanged: false
|
|
281
|
+
},
|
|
282
|
+
["options"]
|
|
283
|
+
);
|
|
284
|
+
sideEffects?.onError?.(err);
|
|
285
|
+
throw transformedError;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
async function getAvailabilityTimeSlot2(serviceId, localStartDate, localEndDate, timeZone, location, options) {
|
|
289
|
+
const { httpClient, sideEffects } = arguments[6];
|
|
290
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
291
|
+
serviceId,
|
|
292
|
+
localStartDate,
|
|
293
|
+
localEndDate,
|
|
294
|
+
timeZone,
|
|
295
|
+
location,
|
|
296
|
+
resourceIds: options?.resourceIds,
|
|
297
|
+
includeResourceTypeIds: options?.includeResourceTypeIds
|
|
298
|
+
});
|
|
299
|
+
const reqOpts = getAvailabilityTimeSlot(
|
|
300
|
+
payload
|
|
301
|
+
);
|
|
302
|
+
sideEffects?.onSiteCall?.();
|
|
303
|
+
try {
|
|
304
|
+
const result = await httpClient.request(reqOpts);
|
|
305
|
+
sideEffects?.onSuccess?.(result);
|
|
306
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
307
|
+
} catch (err) {
|
|
308
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
309
|
+
err,
|
|
310
|
+
{
|
|
311
|
+
spreadPathsToArguments: {},
|
|
312
|
+
explicitPathsToArguments: {
|
|
313
|
+
serviceId: "$[0]",
|
|
314
|
+
localStartDate: "$[1]",
|
|
315
|
+
localEndDate: "$[2]",
|
|
316
|
+
timeZone: "$[3]",
|
|
317
|
+
location: "$[4]",
|
|
318
|
+
resourceIds: "$[5].resourceIds",
|
|
319
|
+
includeResourceTypeIds: "$[5].includeResourceTypeIds"
|
|
320
|
+
},
|
|
321
|
+
singleArgumentUnchanged: false
|
|
322
|
+
},
|
|
323
|
+
[
|
|
324
|
+
"serviceId",
|
|
325
|
+
"localStartDate",
|
|
326
|
+
"localEndDate",
|
|
327
|
+
"timeZone",
|
|
328
|
+
"location",
|
|
329
|
+
"options"
|
|
330
|
+
]
|
|
331
|
+
);
|
|
332
|
+
sideEffects?.onError?.(err);
|
|
333
|
+
throw transformedError;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
337
|
+
0 && (module.exports = {
|
|
338
|
+
LocationType,
|
|
339
|
+
getAvailabilityTimeSlot,
|
|
340
|
+
listAvailabilityTimeSlots
|
|
341
|
+
});
|
|
342
|
+
//# sourceMappingURL=index.typings.js.map
|