@wix/bookings 1.0.174 → 1.0.176
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/src/bookings-availability-v1-slot-availability.types.d.ts +0 -1
- package/build/cjs/src/bookings-availability-v1-slot-availability.types.js.map +1 -1
- package/build/cjs/src/bookings-availability-v1-slot-availability.universal.d.ts +0 -2
- package/build/cjs/src/bookings-availability-v1-slot-availability.universal.js +0 -1
- package/build/cjs/src/bookings-availability-v1-slot-availability.universal.js.map +1 -1
- package/build/cjs/src/bookings-catalog-v1-resource.http.d.ts +125 -44
- package/build/cjs/src/bookings-catalog-v1-resource.http.js +125 -44
- package/build/cjs/src/bookings-catalog-v1-resource.http.js.map +1 -1
- package/build/cjs/src/bookings-catalog-v1-resource.public.d.ts +6 -6
- package/build/cjs/src/bookings-catalog-v1-resource.public.js +13 -13
- package/build/cjs/src/bookings-catalog-v1-resource.public.js.map +1 -1
- package/build/cjs/src/bookings-catalog-v1-resource.universal.d.ts +140 -57
- package/build/cjs/src/bookings-catalog-v1-resource.universal.js +135 -56
- package/build/cjs/src/bookings-catalog-v1-resource.universal.js.map +1 -1
- package/build/es/src/bookings-availability-v1-slot-availability.types.d.ts +0 -1
- package/build/es/src/bookings-availability-v1-slot-availability.types.js.map +1 -1
- package/build/es/src/bookings-availability-v1-slot-availability.universal.d.ts +0 -2
- package/build/es/src/bookings-availability-v1-slot-availability.universal.js +0 -1
- package/build/es/src/bookings-availability-v1-slot-availability.universal.js.map +1 -1
- package/build/es/src/bookings-catalog-v1-resource.http.d.ts +125 -44
- package/build/es/src/bookings-catalog-v1-resource.http.js +125 -44
- package/build/es/src/bookings-catalog-v1-resource.http.js.map +1 -1
- package/build/es/src/bookings-catalog-v1-resource.public.d.ts +6 -6
- package/build/es/src/bookings-catalog-v1-resource.public.js +9 -9
- package/build/es/src/bookings-catalog-v1-resource.public.js.map +1 -1
- package/build/es/src/bookings-catalog-v1-resource.universal.d.ts +140 -57
- package/build/es/src/bookings-catalog-v1-resource.universal.js +130 -51
- package/build/es/src/bookings-catalog-v1-resource.universal.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Event = exports.SortOrder = exports.ResourceStatus = exports.ConferenceType = exports.ScheduleStatus = exports.ApprovalStatus = exports.DayOfWeek = exports.LocationsLocationType = exports.LocationStatus = exports.LocationType = exports.RecurringIntervalType = exports.Transparency = exports.Day = exports._delete = exports.
|
|
3
|
+
exports.Event = exports.SortOrder = exports.ResourceStatus = exports.ConferenceType = exports.ScheduleStatus = exports.ApprovalStatus = exports.DayOfWeek = exports.LocationsLocationType = exports.LocationStatus = exports.LocationType = exports.RecurringIntervalType = exports.Transparency = exports.Day = exports._delete = exports.updateSchedule = exports.update = exports.create = exports.query = exports.list = exports.__metadata = void 0;
|
|
4
4
|
const bookings_catalog_v1_resource_universal_1 = require("./bookings-catalog-v1-resource.universal");
|
|
5
5
|
exports.__metadata = { PACKAGE_NAME: '@wix/bookings' };
|
|
6
6
|
function list(httpClient) {
|
|
@@ -9,30 +9,30 @@ function list(httpClient) {
|
|
|
9
9
|
{ httpClient });
|
|
10
10
|
}
|
|
11
11
|
exports.list = list;
|
|
12
|
-
function
|
|
13
|
-
return (options) => (0, bookings_catalog_v1_resource_universal_1.
|
|
12
|
+
function query(httpClient) {
|
|
13
|
+
return (options) => (0, bookings_catalog_v1_resource_universal_1.query)(options,
|
|
14
14
|
// @ts-ignore
|
|
15
15
|
{ httpClient });
|
|
16
16
|
}
|
|
17
|
-
exports.
|
|
18
|
-
function
|
|
19
|
-
return (resource, options) => (0, bookings_catalog_v1_resource_universal_1.
|
|
17
|
+
exports.query = query;
|
|
18
|
+
function create(httpClient) {
|
|
19
|
+
return (resource, options) => (0, bookings_catalog_v1_resource_universal_1.create)(resource, options,
|
|
20
20
|
// @ts-ignore
|
|
21
21
|
{ httpClient });
|
|
22
22
|
}
|
|
23
|
-
exports.
|
|
24
|
-
function
|
|
25
|
-
return (_id, options) => (0, bookings_catalog_v1_resource_universal_1.
|
|
23
|
+
exports.create = create;
|
|
24
|
+
function update(httpClient) {
|
|
25
|
+
return (_id, options) => (0, bookings_catalog_v1_resource_universal_1.update)(_id, options,
|
|
26
26
|
// @ts-ignore
|
|
27
27
|
{ httpClient });
|
|
28
28
|
}
|
|
29
|
-
exports.
|
|
30
|
-
function
|
|
31
|
-
return (resourceId, options) => (0, bookings_catalog_v1_resource_universal_1.
|
|
29
|
+
exports.update = update;
|
|
30
|
+
function updateSchedule(httpClient) {
|
|
31
|
+
return (resourceId, options) => (0, bookings_catalog_v1_resource_universal_1.updateSchedule)(resourceId, options,
|
|
32
32
|
// @ts-ignore
|
|
33
33
|
{ httpClient });
|
|
34
34
|
}
|
|
35
|
-
exports.
|
|
35
|
+
exports.updateSchedule = updateSchedule;
|
|
36
36
|
function _delete(httpClient) {
|
|
37
37
|
return (_id) => (0, bookings_catalog_v1_resource_universal_1._delete)(_id,
|
|
38
38
|
// @ts-ignore
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bookings-catalog-v1-resource.public.js","sourceRoot":"","sources":["../../../src/bookings-catalog-v1-resource.public.ts"],"names":[],"mappings":";;;AACA,qGAakD;AAErC,QAAA,UAAU,GAAG,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC;AAE5D,SAAgB,IAAI,CAAC,UAAsB;IACzC,OAAO,CAAC,OAAqB,EAAE,EAAE,CAC/B,IAAA,6CAAa,EACX,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,oBAOC;AAED,SAAgB,
|
|
1
|
+
{"version":3,"file":"bookings-catalog-v1-resource.public.js","sourceRoot":"","sources":["../../../src/bookings-catalog-v1-resource.public.ts"],"names":[],"mappings":";;;AACA,qGAakD;AAErC,QAAA,UAAU,GAAG,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC;AAE5D,SAAgB,IAAI,CAAC,UAAsB;IACzC,OAAO,CAAC,OAAqB,EAAE,EAAE,CAC/B,IAAA,6CAAa,EACX,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,oBAOC;AAED,SAAgB,KAAK,CAAC,UAAsB;IAC1C,OAAO,CAAC,OAAsB,EAAE,EAAE,CAChC,IAAA,8CAAc,EACZ,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,sBAOC;AAED,SAAgB,MAAM,CAAC,UAAsB;IAC3C,OAAO,CAAC,QAAkB,EAAE,OAAuB,EAAE,EAAE,CACrD,IAAA,+CAAe,EACb,QAAQ,EACR,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,wBAQC;AAED,SAAgB,MAAM,CAAC,UAAsB;IAC3C,OAAO,CAAC,GAAkB,EAAE,OAAuB,EAAE,EAAE,CACrD,IAAA,+CAAe,EACb,GAAG,EACH,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,wBAQC;AAED,SAAgB,cAAc,CAAC,UAAsB;IACnD,OAAO,CAAC,UAAyB,EAAE,OAA+B,EAAE,EAAE,CACpE,IAAA,uDAAuB,EACrB,UAAU,EACV,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,wCAQC;AAED,SAAgB,OAAO,CAAC,UAAsB;IAC5C,OAAO,CAAC,GAAW,EAAE,EAAE,CACrB,IAAA,gDAAgB,EACd,GAAG;IACH,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,0BAOC;AAED,mGAckD;AAbhD,6HAAA,GAAG,OAAA;AACH,sIAAA,YAAY,OAAA;AACZ,+IAAA,qBAAqB,OAAA;AACrB,sIAAA,YAAY,OAAA;AACZ,wIAAA,cAAc,OAAA;AACd,+IAAA,qBAAqB,OAAA;AACrB,mIAAA,SAAS,OAAA;AACT,wIAAA,cAAc,OAAA;AACd,wIAAA,cAAc,OAAA;AACd,wIAAA,cAAc,OAAA;AACd,wIAAA,cAAc,OAAA;AACd,mIAAA,SAAS,OAAA;AACT,+HAAA,KAAK,OAAA"}
|
|
@@ -929,14 +929,26 @@ export interface ListOptions {
|
|
|
929
929
|
/**
|
|
930
930
|
* Retrieves a list of the resources according to the specified filters and paging.
|
|
931
931
|
*
|
|
932
|
+
* The query parameter is optional. If no query is provided than all non-deleted resources are returned.
|
|
932
933
|
*
|
|
933
|
-
*
|
|
934
|
+
* |Property|Is supported|
|
|
935
|
+
* |--|--|
|
|
936
|
+
* |filter | supported fields: `resource.id`, `resource.tags`, `resource.status`|
|
|
937
|
+
* |paging | supported |
|
|
938
|
+
* |fields | supported |
|
|
939
|
+
* |fieldsets | **not supported** |
|
|
940
|
+
* |sort | **not supported** |
|
|
934
941
|
*
|
|
935
|
-
* > **Notes:** The following objects in the query parameter are not supported for this query:
|
|
936
|
-
* > - sort
|
|
937
|
-
* > - fieldsets
|
|
938
942
|
*
|
|
943
|
+
* >**Notes:**
|
|
944
|
+
* > + The following objects in the `query` parameter are not supported for this query:
|
|
945
|
+
* > - `sort`
|
|
946
|
+
* > - `fieldsets`
|
|
947
|
+
*
|
|
948
|
+
* > **Permissions**
|
|
949
|
+
* > This endpoint requires the Read Bookings Calendar, Read Bookings - Public Data, Read Bookings - Including Participants or Manage Bookings permission scope.
|
|
939
950
|
* @public
|
|
951
|
+
* @documentationMaturity preview
|
|
940
952
|
* @permissionScope Read Bookings - Public Data
|
|
941
953
|
* @permissionScope Read bookings calendar - including participants
|
|
942
954
|
* @permissionScope Read Bookings Calendar
|
|
@@ -944,35 +956,54 @@ export interface ListOptions {
|
|
|
944
956
|
* @applicableIdentity MEMBER
|
|
945
957
|
* @applicableIdentity VISITOR
|
|
946
958
|
*/
|
|
947
|
-
export declare function
|
|
948
|
-
export interface
|
|
959
|
+
export declare function query(options?: QueryOptions): Promise<QueryResourcesResponse>;
|
|
960
|
+
export interface QueryOptions {
|
|
949
961
|
query?: QueryV2;
|
|
950
962
|
}
|
|
951
963
|
/**
|
|
952
964
|
* Creates a resource.
|
|
953
|
-
*
|
|
954
|
-
*
|
|
965
|
+
* <!--ONLY:VELO
|
|
955
966
|
* The `createResource()` function returns a Promise that resolves to the created resource.
|
|
956
|
-
*
|
|
967
|
+
* <!--END:ONLY:VELO-->
|
|
957
968
|
*
|
|
969
|
+
* Bookings resources are created with a schedule. The schedule and its sessions determine the resource's availability. Note that the schedule must contain a start date in the `availability.start` property.
|
|
970
|
+
* For resources that are available during the business's default hours, add the business's schedule as a linked schedule in the resource's schedule. For resources that have their own hours, create sessions with type `"WORKING_HOURS"` using the resource's schedule.
|
|
971
|
+
* You can use both individual and recurring sessions to define resource availability. You cannot use availability constraints for resource schedules.
|
|
958
972
|
*
|
|
973
|
+
* <!--ONLY:VELO
|
|
959
974
|
* When creating a resource using `createResource()`, include the resource's schedule information. Set the schedule information as follows:
|
|
960
|
-
*
|
|
961
|
-
*
|
|
962
|
-
*
|
|
963
|
-
*
|
|
975
|
+
* + If the resource uses the default business hours, get the business resource's schedule ID and include it in the `scheduleInfo.availability.linkedSchedules` array in the `scheduleInfo` parameter. The default hours can bee found in the Dashboard under **Settings** in the **Bookings** section, on the **Appointment hours** page.
|
|
976
|
+
* + If the resource has its own custom working hours, create the resource, then create sessions of type `"WORKING_HOURS"` using the [`createSession()`](wix-bookings-backend.Sessions/createsession) function. Use the `scheduleId` returned from `createResource()` when creating the sessions. These session can be single sessions or recurring sessions.
|
|
977
|
+
* + You can have both default business hours and custom hours for the same resource schedule by combining the steps above.
|
|
964
978
|
*
|
|
965
979
|
* > **Notes:**
|
|
966
|
-
*
|
|
967
|
-
*
|
|
968
|
-
*
|
|
969
|
-
*
|
|
970
|
-
*
|
|
971
|
-
*
|
|
980
|
+
* > + The Wix Bookings app does not show both default business hours and custom hours on the **Staff** page in the dashboard. If you've set up both custom and default business hours, only the default business hours will appear in the app, although both are working.
|
|
981
|
+
* > + The Wix Bookings app does not show non-recurring `WORKING_HOURS` sessions in the resource calendar.
|
|
982
|
+
* > + You can only add the business resource's schedule as a linked schedule for a resource.
|
|
983
|
+
* > + A resource can have one schedule only.
|
|
984
|
+
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
985
|
+
* > + Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can create a resource. You can override the role permissions by setting the `options.suppressAuth` parameter to `true`.
|
|
986
|
+
* <!--END:ONLY:VELO-->
|
|
987
|
+
*
|
|
988
|
+
* <!--ONLY:REST-->
|
|
989
|
+
* Use the following steps to create resources:
|
|
990
|
+
* - Create the resource using including schedule information.
|
|
991
|
+
* - If the resource uses the default business hours, get the business resource's schedule ID and include it in the `scheduleInfo.availability.linkedSchedules` array in the in the schedule parameters.
|
|
992
|
+
* - If the resource has its own custom working hours, create sessions of type `"WORKING_HOURS"`. Use the `scheduleId` of the new resource when creating the sessions. These session can be single sessions or recurring sessions. You can have both business hours and custom hours for the same resource schedule.
|
|
993
|
+
*
|
|
994
|
+
* >**Notes:**
|
|
995
|
+
* > + A resource can have one schedule only.
|
|
996
|
+
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
997
|
+
* > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
|
|
998
|
+
*
|
|
972
999
|
*
|
|
973
|
-
*
|
|
1000
|
+
*
|
|
1001
|
+
* >**Permissions:**
|
|
1002
|
+
* > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
|
|
1003
|
+
* <!--END:ONLY:REST-->
|
|
974
1004
|
* @param resource - Resource details.
|
|
975
1005
|
* @public
|
|
1006
|
+
* @documentationMaturity preview
|
|
976
1007
|
* @requiredField options.schedules.availability.start
|
|
977
1008
|
* @requiredField options.schedules.intervals.start
|
|
978
1009
|
* @requiredField resource
|
|
@@ -980,8 +1011,8 @@ export interface QueryResourceCatalogOptions {
|
|
|
980
1011
|
* @permissionScope Manage Bookings
|
|
981
1012
|
* @applicableIdentity APP
|
|
982
1013
|
*/
|
|
983
|
-
export declare function
|
|
984
|
-
export interface
|
|
1014
|
+
export declare function create(resource: Resource, options?: CreateOptions): Promise<CreateResourceResponse>;
|
|
1015
|
+
export interface CreateOptions {
|
|
985
1016
|
/**
|
|
986
1017
|
* List of schedules to be assigned for the created resource. Currently only a single schedule is allowed.
|
|
987
1018
|
* If provided, any schedules in the resource entity will be ignored.
|
|
@@ -990,18 +1021,29 @@ export interface CreateResourceOptions {
|
|
|
990
1021
|
}
|
|
991
1022
|
/**
|
|
992
1023
|
* Updates a resource.
|
|
1024
|
+
* <!--ONLY:VELO
|
|
1025
|
+
* The `updateResource()` function returns a Promise that resolves when a resource is updated.
|
|
1026
|
+
* Use this function to update all bookings resource information except for the resource's schedule. To update a resource's schedule use [`updateResourceSchedule()`](wix-bookings-backend/resource/updateresourceschedule).
|
|
993
1027
|
*
|
|
994
|
-
*
|
|
995
|
-
*
|
|
996
|
-
*
|
|
1028
|
+
* >**Notes:**
|
|
1029
|
+
* > + When updating a resource you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values `"business"` and `"staff"`.
|
|
1030
|
+
* > + Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can update a resource. You can override the role permissions by setting the `options.suppressAuth` parameter to `true`.
|
|
1031
|
+
* <!--END:ONLY:VELO-->
|
|
1032
|
+
* <!--ONLY:REST-->
|
|
1033
|
+
* Use this endpoint to update all resource information except for the resource's schedule. To update a resource's schedule use
|
|
1034
|
+
* the [Update Schedule](https://dev.wix.com/api/rest/wix-bookings/resources/update-schedule) endpoint.
|
|
997
1035
|
*
|
|
998
1036
|
* >**Notes:**
|
|
999
|
-
*
|
|
1000
|
-
*
|
|
1037
|
+
* > + When updating a resource you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values `"business"` and `"staff"`.
|
|
1038
|
+
* > + When updating a resource's schedule you cannot change the resource tag used by the Wix Bookings app. Tags used by the app have the values `"INDIVIDUAL"`, `"GROUP"`, and `"COURSE”`.
|
|
1039
|
+
* > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
|
|
1001
1040
|
*
|
|
1002
|
-
*
|
|
1041
|
+
* >**Permissions:**
|
|
1042
|
+
* > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
|
|
1043
|
+
* <!--END:ONLY:REST-->
|
|
1003
1044
|
* @param _id - Resource ID.
|
|
1004
1045
|
* @public
|
|
1046
|
+
* @documentationMaturity preview
|
|
1005
1047
|
* @requiredField _id
|
|
1006
1048
|
* @requiredField scheduleActions.cancelRequests.scheduleId
|
|
1007
1049
|
* @requiredField scheduleActions.createRequests.schedule.availability.start
|
|
@@ -1011,8 +1053,8 @@ export interface CreateResourceOptions {
|
|
|
1011
1053
|
* @permissionScope Manage Bookings
|
|
1012
1054
|
* @applicableIdentity APP
|
|
1013
1055
|
*/
|
|
1014
|
-
export declare function
|
|
1015
|
-
export interface
|
|
1056
|
+
export declare function update(_id: string | null, options?: UpdateOptions): Promise<UpdateResourceResponse>;
|
|
1057
|
+
export interface UpdateOptions {
|
|
1016
1058
|
resource: {
|
|
1017
1059
|
/**
|
|
1018
1060
|
* Resource ID.
|
|
@@ -1027,13 +1069,17 @@ export interface UpdateResourceOptions {
|
|
|
1027
1069
|
phone?: string | null;
|
|
1028
1070
|
/** Resource description. */
|
|
1029
1071
|
description?: string | null;
|
|
1030
|
-
/**
|
|
1072
|
+
/**
|
|
1073
|
+
* @internal
|
|
1074
|
+
* @internal */
|
|
1031
1075
|
tag?: string | null;
|
|
1032
1076
|
/** Resource tags. Tags are used to identify, group, and filter the different types of resources. For example, 'staff' or 'room'. */
|
|
1033
1077
|
tags?: string[] | null;
|
|
1034
1078
|
/** Resource images. */
|
|
1035
1079
|
images?: string[];
|
|
1036
|
-
/**
|
|
1080
|
+
/**
|
|
1081
|
+
* @internal
|
|
1082
|
+
* @internal */
|
|
1037
1083
|
schedules?: Schedule[];
|
|
1038
1084
|
/**
|
|
1039
1085
|
* List of IDs of schedules owned by this resource.
|
|
@@ -1065,39 +1111,67 @@ export interface UpdateResourceOptions {
|
|
|
1065
1111
|
fieldMask?: string[];
|
|
1066
1112
|
}
|
|
1067
1113
|
/**
|
|
1068
|
-
* Updates a resource's schedule
|
|
1069
|
-
*
|
|
1070
|
-
*
|
|
1071
|
-
*
|
|
1072
|
-
*
|
|
1073
|
-
*
|
|
1074
|
-
*
|
|
1075
|
-
*
|
|
1076
|
-
*
|
|
1114
|
+
* Updates a resource's schedule
|
|
1115
|
+
* <!--ONLY:VELO
|
|
1116
|
+
* The `updateResourceSchedule()` function returns a Promise that resolves when a resource's schedule has been updated.
|
|
1117
|
+
* Use this function to update the bookings resource's schedule. To update other resource details use [`updateResource()`] (wix-bookings-backend/resources/updateresource).
|
|
1118
|
+
* The following schedule properties can be updated:
|
|
1119
|
+
* + `availability.start`
|
|
1120
|
+
* + `availability.linkedSchedules`
|
|
1121
|
+
* <!--END:ONLY:VELO-->
|
|
1077
1122
|
*
|
|
1078
1123
|
* To update a resource's schedule to remove business hours and add custom hours:
|
|
1079
|
-
*
|
|
1080
|
-
*
|
|
1081
|
-
*
|
|
1124
|
+
* <!--ONLY:REST-->
|
|
1125
|
+
* + Update the resource's schedule to remove the business's `scheduleId` from the `availability.linkedSchedules` array.
|
|
1126
|
+
* + Create a set of recurring sessions of type `"WORKING_HOURS"` to define the resource's new hours.
|
|
1127
|
+
* <!--END:ONLY:REST-->
|
|
1128
|
+
* <!--ONLY:VELO
|
|
1129
|
+
* + Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to remove the business's scheduleId from the `availability.linkedSchedules` array.
|
|
1130
|
+
* + Use [`createSession()`](wix-bookings-backend.Sessions/createsession) to create a set of recurring sessions of type `"WORKING_HOURS"` to define the resource's new hours.
|
|
1131
|
+
* <!--END:ONLY:VELO-->
|
|
1082
1132
|
*
|
|
1083
1133
|
* To update a resource's schedule to add default business hours, and keep or remove custom hours:
|
|
1134
|
+
* <!--ONLY:REST-->
|
|
1135
|
+
* + Update the resource's schedule to add the business resource's `scheduleId` to the `availability.linkedSchedules` array.
|
|
1136
|
+
* + If you want to remove the custom sessions, delete the resource's sessions of type `"WORKING_HOURS"`.
|
|
1137
|
+
* You do not have to delete exiting custom sessions. Custom session that are not deleted will continue to be included in availability calculations and can still be booked.
|
|
1138
|
+
* <!--END:ONLY:REST-->
|
|
1139
|
+
* <!--ONLY:VELO
|
|
1140
|
+
* + Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to add the business resource's `scheduleId` to the `availability.linkedSchedules` array.
|
|
1141
|
+
* + If you want to remove the custom sessions, use [`deleteSession()`](wix-bookings-backend.Sessions/deletesession) to delete the resource's sessions of type `"WORKING_HOURS"`. You do not have to delete exiting custom sessions. You can have both default working hours and custom hours for the same schedule. Custom sessions that are not deleted will continue to be included in availability calculations and can still be booked.
|
|
1084
1142
|
*
|
|
1085
|
-
*
|
|
1086
|
-
*
|
|
1143
|
+
* > **Notes:**
|
|
1144
|
+
* > + The Wix Bookings app does not show both default business hours and custom hours on the **Staff** page in the dashboard. If you've set up both custom and default business hours, only the default business hours will appear in the app, although both are working.
|
|
1145
|
+
* > + A resource can have one schedule only.
|
|
1146
|
+
* > + A resource can have both default business hours and custom hours in its schedule.
|
|
1147
|
+
* > + When updating a resource's schedule you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values `"INDIVIDUAL"`, `"GROUP"`, and `"COURSE”`.
|
|
1148
|
+
* > + Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can update a resource schedule. You can override the role permissions by setting the `options.suppressAuth` parameter to `true`.
|
|
1149
|
+
* @snippet [updateResourceScheduleDefaultToCustom.es6=Update a resource's schedule from business to custom hours]
|
|
1150
|
+
* Update a resource's schedule from the business's default working hours to 2 custom days per week.
|
|
1151
|
+
* @snippet [updateResourceScheduleCustomToDefault.es6=Update a resource's schedule from custom to business hours]
|
|
1152
|
+
* <!--END:ONLY:VELO-->
|
|
1153
|
+
* <!--ONLY:REST-->
|
|
1154
|
+
* >**Notes:**
|
|
1155
|
+
* > + A resource can have one schedule only.
|
|
1156
|
+
* > + A resource can have both default business hours and custom hours in its schedule.
|
|
1157
|
+
* > + When updating a resource's schedule you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values `"INDIVIDUAL"`, `"GROUP"`, and `"COURSE”`.
|
|
1158
|
+
* > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
|
|
1087
1159
|
*
|
|
1088
1160
|
*
|
|
1089
|
-
* > **Notes:** The Wix Bookings app does not show both default business hours and custom hours on the **Staff** page in the dashboard. If you've set up both custom and default business hours, only the default business hours will appear in the app, although both are working. A resource can have one schedule only. A resource can have both default business hours and custom hours in its schedule. When updating a resource's schedule you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values `INDIVIDUAL`, `GROUP`, and `COURSE`. Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can update a resource schedule.
|
|
1090
1161
|
*
|
|
1091
|
-
*
|
|
1162
|
+
* >**Permissions:**
|
|
1163
|
+
* > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
|
|
1164
|
+
* <!--END:ONLY:REST-->
|
|
1092
1165
|
* @param resourceId - Resource id to update.
|
|
1093
1166
|
* @public
|
|
1167
|
+
* @documentationMaturity preview
|
|
1094
1168
|
* @requiredField options.schedule._id
|
|
1095
1169
|
* @requiredField resourceId
|
|
1096
1170
|
* @permissionScope Manage Bookings
|
|
1097
1171
|
* @applicableIdentity APP
|
|
1098
1172
|
*/
|
|
1099
|
-
export declare function
|
|
1100
|
-
export interface
|
|
1173
|
+
export declare function updateSchedule(resourceId: string | null, options?: UpdateScheduleOptions): Promise<UpdateScheduleResponse>;
|
|
1174
|
+
export interface UpdateScheduleOptions {
|
|
1101
1175
|
/** Fieldmask for schedule */
|
|
1102
1176
|
fieldmask?: string[];
|
|
1103
1177
|
/** The schedule to update */
|
|
@@ -1105,19 +1179,28 @@ export interface UpdateResourceScheduleOptions {
|
|
|
1105
1179
|
}
|
|
1106
1180
|
/**
|
|
1107
1181
|
* Deletes a resource.
|
|
1108
|
-
*
|
|
1182
|
+
* <!--ONLY:VELO
|
|
1109
1183
|
* The `deleteResource()` function returns a Promise that is resolved when a resource is deleted.
|
|
1110
|
-
*
|
|
1111
|
-
*
|
|
1112
|
-
* Deleting a resource updates its status to `DELETED`.
|
|
1184
|
+
* <!--END:ONLY:VELO-->
|
|
1185
|
+
* Deleting a resource updates its `status` to `"DELETED"`.
|
|
1113
1186
|
*
|
|
1114
1187
|
* You cannot delete a resource if it has booked sessions.
|
|
1115
1188
|
*
|
|
1189
|
+
* <!--ONLY:VELO
|
|
1190
|
+
* >**Notes:**
|
|
1191
|
+
* > + The Bookings app automatically creates a resource with a name and tag of value `"business"``. This resource is used for the business's schedule and working hours and cannot be deleted.
|
|
1192
|
+
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
1193
|
+
* > + Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can delete a resource. You can override the role permissions by setting the `options.suppressAuth` parameter to `true`.
|
|
1194
|
+
* <!--END:ONLY:VELO-->
|
|
1116
1195
|
*
|
|
1196
|
+
* <!--ONLY:REST-->
|
|
1117
1197
|
* >**Notes:**
|
|
1118
|
-
*
|
|
1119
|
-
*
|
|
1120
|
-
*
|
|
1198
|
+
* > + The Bookings app creates a resource with `"business"` in name and tag values. This resource is used for the business's schedule and working hours and cannot be deleted.
|
|
1199
|
+
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
1200
|
+
*
|
|
1201
|
+
* >**Permissions:**
|
|
1202
|
+
* > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
|
|
1203
|
+
* <!--END:ONLY:REST-->
|
|
1121
1204
|
* @param _id - ID of the resource to delete.
|
|
1122
1205
|
* @public
|
|
1123
1206
|
* @documentationMaturity preview
|