@wix/bookings 1.0.157 → 1.0.158

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 (35) hide show
  1. package/build/cjs/src/bookings-catalog-v1-resource.http.d.ts +47 -134
  2. package/build/cjs/src/bookings-catalog-v1-resource.http.js +47 -134
  3. package/build/cjs/src/bookings-catalog-v1-resource.http.js.map +1 -1
  4. package/build/cjs/src/bookings-catalog-v1-resource.public.d.ts +6 -6
  5. package/build/cjs/src/bookings-catalog-v1-resource.public.js +13 -13
  6. package/build/cjs/src/bookings-catalog-v1-resource.public.js.map +1 -1
  7. package/build/cjs/src/bookings-catalog-v1-resource.universal.d.ts +44 -139
  8. package/build/cjs/src/bookings-catalog-v1-resource.universal.js +56 -147
  9. package/build/cjs/src/bookings-catalog-v1-resource.universal.js.map +1 -1
  10. package/build/cjs/src/bookings-v2-attendance.http.d.ts +13 -10
  11. package/build/cjs/src/bookings-v2-attendance.http.js +16 -9
  12. package/build/cjs/src/bookings-v2-attendance.http.js.map +1 -1
  13. package/build/cjs/src/bookings-v2-attendance.types.d.ts +13 -5
  14. package/build/cjs/src/bookings-v2-attendance.types.js.map +1 -1
  15. package/build/cjs/src/bookings-v2-attendance.universal.d.ts +25 -14
  16. package/build/cjs/src/bookings-v2-attendance.universal.js +12 -9
  17. package/build/cjs/src/bookings-v2-attendance.universal.js.map +1 -1
  18. package/build/es/src/bookings-catalog-v1-resource.http.d.ts +47 -134
  19. package/build/es/src/bookings-catalog-v1-resource.http.js +47 -134
  20. package/build/es/src/bookings-catalog-v1-resource.http.js.map +1 -1
  21. package/build/es/src/bookings-catalog-v1-resource.public.d.ts +6 -6
  22. package/build/es/src/bookings-catalog-v1-resource.public.js +9 -9
  23. package/build/es/src/bookings-catalog-v1-resource.public.js.map +1 -1
  24. package/build/es/src/bookings-catalog-v1-resource.universal.d.ts +44 -139
  25. package/build/es/src/bookings-catalog-v1-resource.universal.js +51 -142
  26. package/build/es/src/bookings-catalog-v1-resource.universal.js.map +1 -1
  27. package/build/es/src/bookings-v2-attendance.http.d.ts +13 -10
  28. package/build/es/src/bookings-v2-attendance.http.js +16 -9
  29. package/build/es/src/bookings-v2-attendance.http.js.map +1 -1
  30. package/build/es/src/bookings-v2-attendance.types.d.ts +13 -5
  31. package/build/es/src/bookings-v2-attendance.types.js.map +1 -1
  32. package/build/es/src/bookings-v2-attendance.universal.d.ts +25 -14
  33. package/build/es/src/bookings-v2-attendance.universal.js +12 -9
  34. package/build/es/src/bookings-v2-attendance.universal.js.map +1 -1
  35. package/package.json +2 -2
@@ -926,86 +926,56 @@ export interface ListOptions {
926
926
  /**
927
927
  * Retrieves a list of the resources according to the specified filters and paging.
928
928
  *
929
- * The query parameter is optional. If no query is provided than all non-deleted resources are returned.
930
929
  *
931
- * |Property|Is supported|
932
- * |--|--|
933
- * |filter | supported fields: `resource.id`, `resource.tags`, `resource.status`|
934
- * |paging | supported |
935
- * |fields | supported |
936
- * |fieldsets | **not supported** |
937
- * |sort | **not supported** |
930
+ * The query parameter is optional. If no query is provided, all non-deleted resources are returned.
938
931
  *
932
+ * |Property|Is supported| |--|--| |filter | supported fields: resource.id, resource.tags, resource.status| |paging | supported | |fields | supported | |fieldsets | not supported | |sort | not supported |
939
933
  *
940
- * >**Notes:**
941
- * > + The following objects in the `query` parameter are not supported for this query:
942
- * > - `sort`
943
- * > - `fieldsets`
934
+ * > **Notes:** The following objects in the query parameter are not supported for this query:
935
+ * > - sort
936
+ * > - fieldsets
944
937
  *
945
- * > **Permissions**
946
- * > This endpoint requires the Read Bookings Calendar, Read Bookings - Public Data, Read Bookings - Including Participants or Manage Bookings permission scope.
947
938
  * @public
948
- * @documentationMaturity preview
949
939
  * @permissionScope Read Bookings - Public Data
950
940
  * @permissionScope Read bookings calendar - including participants
951
941
  * @permissionScope Read Bookings Calendar
952
942
  */
953
- export declare function query(options?: QueryOptions): Promise<QueryResourcesResponse>;
954
- export interface QueryOptions {
943
+ export declare function queryResourceCatalog(options?: QueryResourceCatalogOptions): Promise<QueryResourcesResponse>;
944
+ export interface QueryResourceCatalogOptions {
955
945
  query?: QueryV2;
956
946
  }
957
947
  /**
958
948
  * Creates a resource.
959
- * <!--ONLY:VELO
949
+ *
950
+ *
960
951
  * The `createResource()` function returns a Promise that resolves to the created resource.
961
- * <!--END:ONLY:VELO-->
952
+ * 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. 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. You can use both individual and recurring sessions to define resource availability. You cannot use availability constraints for resource schedules.
962
953
  *
963
- * 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.
964
- * 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.
965
- * You can use both individual and recurring sessions to define resource availability. You cannot use availability constraints for resource schedules.
966
954
  *
967
- * <!--ONLY:VELO
968
955
  * When creating a resource using `createResource()`, include the resource's schedule information. Set the schedule information as follows:
969
- * + 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.
970
- * + 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.
971
- * + You can have both default business hours and custom hours for the same resource schedule by combining the steps above.
956
+ * - 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.
957
+ * - If the resource has its own custom working hours, create the resource, then create sessions of type `WORKING_HOURS` using the [`createSession()`](Sessions/createsession) function. Use the `scheduleId` returned from `createResource()` when creating the sessions. These session can be single sessions or recurring sessions.
972
958
  *
973
- * > **Notes:**
974
- * > + 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.
975
- * > + The Wix Bookings app does not show non-recurring `WORKING_HOURS` sessions in the resource calendar.
976
- * > + You can only add the business resource's schedule as a linked schedule for a resource.
977
- * > + A resource can have one schedule only.
978
- * > + You can have up to 135 active resources and an additional 135 deleted resources.
979
- * > + 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`.
980
- * <!--END:ONLY:VELO-->
959
+ * You can have both default business hours and custom hours for the same resource schedule by combining the steps above.
981
960
  *
982
- * <!--ONLY:REST-->
983
- * Use the following steps to create resources:
984
- * - Create the resource using including schedule information.
985
- * - 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.
986
- * - 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.
987
961
  *
988
- * >**Notes:**
989
- * > + A resource can have one schedule only.
990
- * > + You can have up to 135 active resources and an additional 135 deleted resources.
991
- * > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
962
+ * > **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.
992
963
  *
993
964
  *
965
+ * The Wix Bookings app does not show non-recurring `WORKING_HOURS` sessions in the resource calendar. You can only add the business resource's schedule as a linked schedule for a resource. A resource can have one schedule only.
994
966
  *
995
- * >**Permissions:**
996
- * > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
997
- * <!--END:ONLY:REST-->
967
+ *
968
+ * You can have up to 135 active resources and an additional 135 deleted resources. Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can create a resource.
998
969
  * @param resource - Resource details.
999
970
  * @public
1000
- * @documentationMaturity preview
1001
971
  * @requiredField options.schedules.availability.start
1002
972
  * @requiredField options.schedules.intervals.start
1003
973
  * @requiredField resource
1004
974
  * @requiredField resource.name
1005
975
  * @permissionScope Manage Bookings
1006
976
  */
1007
- export declare function create(resource: Resource, options?: CreateOptions): Promise<CreateResourceResponse>;
1008
- export interface CreateOptions {
977
+ export declare function createResource(resource: Resource, options?: CreateResourceOptions): Promise<CreateResourceResponse>;
978
+ export interface CreateResourceOptions {
1009
979
  /**
1010
980
  * List of schedules to be assigned for the created resource. Currently only a single schedule is allowed.
1011
981
  * If provided, any schedules in the resource entity will be ignored.
@@ -1014,29 +984,14 @@ export interface CreateOptions {
1014
984
  }
1015
985
  /**
1016
986
  * Updates a resource.
1017
- * <!--ONLY:VELO
1018
- * The `updateResource()` function returns a Promise that resolves when a resource is updated.
1019
- * 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).
1020
987
  *
1021
- * >**Notes:**
1022
- * > + 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"`.
1023
- * > + 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`.
1024
- * <!--END:ONLY:VELO-->
1025
- * <!--ONLY:REST-->
1026
- * Use this endpoint to update all resource information except for the resource's schedule. To update a resource's schedule use
1027
- * the [Update Schedule](https://dev.wix.com/api/rest/wix-bookings/resources/update-schedule) endpoint.
1028
988
  *
1029
- * >**Notes:**
1030
- * > + 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"`.
1031
- * > + 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”`.
1032
- * > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
989
+ * The `updateResource()` function returns a Promise that resolves when a resource is updated. Use this function to update all bookings resource information except for the resource's schedule. To update a resource's schedule use [`updateResourceSchedule()`](resources/updateresourceschedule).
1033
990
  *
1034
- * >**Permissions:**
1035
- * > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
1036
- * <!--END:ONLY:REST-->
991
+ *
992
+ * >**Notes:** 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"`. Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can update a resource.
1037
993
  * @param _id - Resource ID.
1038
994
  * @public
1039
- * @documentationMaturity preview
1040
995
  * @requiredField _id
1041
996
  * @requiredField scheduleActions.cancelRequests.scheduleId
1042
997
  * @requiredField scheduleActions.createRequests.schedule.availability.start
@@ -1045,8 +1000,8 @@ export interface CreateOptions {
1045
1000
  * @requiredField scheduleActions.updateRequests.schedule._id
1046
1001
  * @permissionScope Manage Bookings
1047
1002
  */
1048
- export declare function update(_id: string | null, options?: UpdateOptions): Promise<UpdateResourceResponse>;
1049
- export interface UpdateOptions {
1003
+ export declare function updateResource(_id: string | null, options?: UpdateResourceOptions): Promise<UpdateResourceResponse>;
1004
+ export interface UpdateResourceOptions {
1050
1005
  resource: {
1051
1006
  /**
1052
1007
  * Resource ID.
@@ -1061,17 +1016,13 @@ export interface UpdateOptions {
1061
1016
  phone?: string | null;
1062
1017
  /** Resource description. */
1063
1018
  description?: string | null;
1064
- /**
1065
- * @internal
1066
- * @internal */
1019
+ /** @internal */
1067
1020
  tag?: string | null;
1068
1021
  /** Resource tags. Tags are used to identify, group, and filter the different types of resources. For example, 'staff' or 'room'. */
1069
1022
  tags?: string[] | null;
1070
1023
  /** Resource images. */
1071
1024
  images?: string[];
1072
- /**
1073
- * @internal
1074
- * @internal */
1025
+ /** @internal */
1075
1026
  schedules?: Schedule[];
1076
1027
  /**
1077
1028
  * List of IDs of schedules owned by this resource.
@@ -1103,66 +1054,32 @@ export interface UpdateOptions {
1103
1054
  fieldMask?: string[];
1104
1055
  }
1105
1056
  /**
1106
- * Updates a resource's schedule
1107
- * <!--ONLY:VELO
1108
- * The `updateResourceSchedule()` function returns a Promise that resolves when a resource's schedule has been updated.
1109
- * Use this function to update the bookings resource's schedule. To update other resource details use [`updateResource()`] (wix-bookings-backend/resources/updateresource).
1110
- * The following schedule properties can be updated:
1111
- * + `availability.start`
1112
- * + `availability.linkedSchedules`
1113
- * <!--END:ONLY:VELO-->
1057
+ * Updates a resource's schedule.
1058
+ *
1059
+ *
1060
+ * The `updateResourceSchedule()` function returns a Promise that resolves when a resource's schedule has been updated. Use this function to update the bookings resource's schedule. To update other resource details use [`updateResource()`] (resources/updateresource). The following schedule properties can be updated: + `availability.start` + `availability.linkedSchedules`
1061
+ *
1114
1062
  *
1115
1063
  * To update a resource's schedule to remove business hours and add custom hours:
1116
- * <!--ONLY:REST-->
1117
- * + Update the resource's schedule to remove the business's `scheduleId` from the `availability.linkedSchedules` array.
1118
- * + Create a set of recurring sessions of type `"WORKING_HOURS"` to define the resource's new hours.
1119
- * <!--END:ONLY:REST-->
1120
- * <!--ONLY:VELO
1121
- * + Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to remove the business's scheduleId from the `availability.linkedSchedules` array.
1122
- * + 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.
1123
- * <!--END:ONLY:VELO-->
1064
+ * - Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to remove the business's scheduleId from the `availability.linkedSchedules` array.
1065
+ * - Use [`createSession()`](Sessions/createsession) to create a set of recurring sessions of type `WORKING_HOURS` to define the resource's new hours.
1124
1066
  *
1125
- * To update a resource's schedule to add default business hours, and keep or remove custom hours:
1126
- * <!--ONLY:REST-->
1127
- * + Update the resource's schedule to add the business resource's `scheduleId` to the `availability.linkedSchedules` array.
1128
- * + If you want to remove the custom sessions, delete the resource's sessions of type `"WORKING_HOURS"`.
1129
- * 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.
1130
- * <!--END:ONLY:REST-->
1131
- * <!--ONLY:VELO
1132
- * + Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to add the business resource's `scheduleId` to the `availability.linkedSchedules` array.
1133
- * + 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.
1134
1067
  *
1135
- * > **Notes:**
1136
- * > + 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.
1137
- * > + A resource can have one schedule only.
1138
- * > + A resource can have both default business hours and custom hours in its schedule.
1139
- * > + 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”`.
1140
- * > + 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`.
1141
- * @snippet [updateResourceScheduleDefaultToCustom.es6=Update a resource's schedule from business to custom hours]
1142
- * Update a resource's schedule from the business's default working hours to 2 custom days per week.
1143
- * @snippet [updateResourceScheduleCustomToDefault.es6=Update a resource's schedule from custom to business hours]
1144
- * <!--END:ONLY:VELO-->
1145
- * <!--ONLY:REST-->
1146
- * >**Notes:**
1147
- * > + A resource can have one schedule only.
1148
- * > + A resource can have both default business hours and custom hours in its schedule.
1149
- * > + 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”`.
1150
- * > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
1068
+ * To update a resource's schedule to add default business hours, and keep or remove custom hours:
1151
1069
  *
1070
+ * - Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to add the business resource's `scheduleId` to the `availability.linkedSchedules` array.
1071
+ * - 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.
1152
1072
  *
1153
1073
  *
1154
- * >**Permissions:**
1155
- * > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
1156
- * <!--END:ONLY:REST-->
1074
+ * > **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.
1157
1075
  * @param resourceId - Resource id to update.
1158
1076
  * @public
1159
- * @documentationMaturity preview
1160
1077
  * @requiredField options.schedule._id
1161
1078
  * @requiredField resourceId
1162
1079
  * @permissionScope Manage Bookings
1163
1080
  */
1164
- export declare function updateSchedule(resourceId: string | null, options?: UpdateScheduleOptions): Promise<UpdateScheduleResponse>;
1165
- export interface UpdateScheduleOptions {
1081
+ export declare function updateResourceSchedule(resourceId: string | null, options?: UpdateResourceScheduleOptions): Promise<UpdateScheduleResponse>;
1082
+ export interface UpdateResourceScheduleOptions {
1166
1083
  /** Fieldmask for schedule */
1167
1084
  fieldmask?: string[];
1168
1085
  /** The schedule to update */
@@ -1170,28 +1087,16 @@ export interface UpdateScheduleOptions {
1170
1087
  }
1171
1088
  /**
1172
1089
  * Deletes a resource.
1173
- * <!--ONLY:VELO
1090
+ *
1174
1091
  * The `deleteResource()` function returns a Promise that is resolved when a resource is deleted.
1175
- * <!--END:ONLY:VELO-->
1176
- * Deleting a resource updates its `status` to `"DELETED"`.
1177
1092
  *
1178
- * You cannot delete a resource if it has booked sessions.
1179
1093
  *
1180
- * <!--ONLY:VELO
1181
- * >**Notes:**
1182
- * > + 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.
1183
- * > + You can have up to 135 active resources and an additional 135 deleted resources.
1184
- * > + 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`.
1185
- * <!--END:ONLY:VELO-->
1094
+ * Deleting a resource updates its status to `DELETED`.
1095
+ *
1096
+ * You cannot delete a resource if it has booked sessions.
1186
1097
  *
1187
- * <!--ONLY:REST-->
1188
- * >**Notes:**
1189
- * > + 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.
1190
- * > + You can have up to 135 active resources and an additional 135 deleted resources.
1191
1098
  *
1192
- * >**Permissions:**
1193
- * > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
1194
- * <!--END:ONLY:REST-->
1099
+ * >**Notes:** 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. You can have up to 135 active resources and an additional 135 deleted resources. Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can delete a resource.
1195
1100
  * @param _id - ID of the resource to delete.
1196
1101
  * @public
1197
1102
  * @documentationMaturity preview
@@ -241,31 +241,21 @@ export function list(options) {
241
241
  /**
242
242
  * Retrieves a list of the resources according to the specified filters and paging.
243
243
  *
244
- * The query parameter is optional. If no query is provided than all non-deleted resources are returned.
245
244
  *
246
- * |Property|Is supported|
247
- * |--|--|
248
- * |filter | supported fields: `resource.id`, `resource.tags`, `resource.status`|
249
- * |paging | supported |
250
- * |fields | supported |
251
- * |fieldsets | **not supported** |
252
- * |sort | **not supported** |
245
+ * The query parameter is optional. If no query is provided, all non-deleted resources are returned.
253
246
  *
247
+ * |Property|Is supported| |--|--| |filter | supported fields: resource.id, resource.tags, resource.status| |paging | supported | |fields | supported | |fieldsets | not supported | |sort | not supported |
254
248
  *
255
- * >**Notes:**
256
- * > + The following objects in the `query` parameter are not supported for this query:
257
- * > - `sort`
258
- * > - `fieldsets`
249
+ * > **Notes:** The following objects in the query parameter are not supported for this query:
250
+ * > - sort
251
+ * > - fieldsets
259
252
  *
260
- * > **Permissions**
261
- * > This endpoint requires the Read Bookings Calendar, Read Bookings - Public Data, Read Bookings - Including Participants or Manage Bookings permission scope.
262
253
  * @public
263
- * @documentationMaturity preview
264
254
  * @permissionScope Read Bookings - Public Data
265
255
  * @permissionScope Read bookings calendar - including participants
266
256
  * @permissionScope Read Bookings Calendar
267
257
  */
268
- export function query(options) {
258
+ export function queryResourceCatalog(options) {
269
259
  var _a, _b, _c;
270
260
  return __awaiter(this, arguments, void 0, function* () {
271
261
  const requestTransformation = { query: '$[0].query' };
@@ -316,55 +306,35 @@ export function query(options) {
316
306
  }
317
307
  /**
318
308
  * Creates a resource.
319
- * <!--ONLY:VELO
309
+ *
310
+ *
320
311
  * The `createResource()` function returns a Promise that resolves to the created resource.
321
- * <!--END:ONLY:VELO-->
312
+ * 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. 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. You can use both individual and recurring sessions to define resource availability. You cannot use availability constraints for resource schedules.
322
313
  *
323
- * 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.
324
- * 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.
325
- * You can use both individual and recurring sessions to define resource availability. You cannot use availability constraints for resource schedules.
326
314
  *
327
- * <!--ONLY:VELO
328
315
  * When creating a resource using `createResource()`, include the resource's schedule information. Set the schedule information as follows:
329
- * + 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.
330
- * + 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.
331
- * + You can have both default business hours and custom hours for the same resource schedule by combining the steps above.
332
- *
333
- * > **Notes:**
334
- * > + 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.
335
- * > + The Wix Bookings app does not show non-recurring `WORKING_HOURS` sessions in the resource calendar.
336
- * > + You can only add the business resource's schedule as a linked schedule for a resource.
337
- * > + A resource can have one schedule only.
338
- * > + You can have up to 135 active resources and an additional 135 deleted resources.
339
- * > + 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`.
340
- * <!--END:ONLY:VELO-->
341
- *
342
- * <!--ONLY:REST-->
343
- * Use the following steps to create resources:
344
- * - Create the resource using including schedule information.
345
- * - 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.
346
- * - 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.
347
- *
348
- * >**Notes:**
349
- * > + A resource can have one schedule only.
350
- * > + You can have up to 135 active resources and an additional 135 deleted resources.
351
- * > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
352
- *
353
- *
354
- *
355
- * >**Permissions:**
356
- * > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
357
- * <!--END:ONLY:REST-->
316
+ * - 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.
317
+ * - If the resource has its own custom working hours, create the resource, then create sessions of type `WORKING_HOURS` using the [`createSession()`](Sessions/createsession) function. Use the `scheduleId` returned from `createResource()` when creating the sessions. These session can be single sessions or recurring sessions.
318
+ *
319
+ * You can have both default business hours and custom hours for the same resource schedule by combining the steps above.
320
+ *
321
+ *
322
+ * > **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.
323
+ *
324
+ *
325
+ * The Wix Bookings app does not show non-recurring `WORKING_HOURS` sessions in the resource calendar. You can only add the business resource's schedule as a linked schedule for a resource. A resource can have one schedule only.
326
+ *
327
+ *
328
+ * You can have up to 135 active resources and an additional 135 deleted resources. Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can create a resource.
358
329
  * @param resource - Resource details.
359
330
  * @public
360
- * @documentationMaturity preview
361
331
  * @requiredField options.schedules.availability.start
362
332
  * @requiredField options.schedules.intervals.start
363
333
  * @requiredField resource
364
334
  * @requiredField resource.name
365
335
  * @permissionScope Manage Bookings
366
336
  */
367
- export function create(resource, options) {
337
+ export function createResource(resource, options) {
368
338
  var _a, _b, _c;
369
339
  return __awaiter(this, arguments, void 0, function* () {
370
340
  const requestTransformation = {
@@ -425,29 +395,14 @@ export function create(resource, options) {
425
395
  }
426
396
  /**
427
397
  * Updates a resource.
428
- * <!--ONLY:VELO
429
- * The `updateResource()` function returns a Promise that resolves when a resource is updated.
430
- * 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).
431
- *
432
- * >**Notes:**
433
- * > + 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"`.
434
- * > + 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`.
435
- * <!--END:ONLY:VELO-->
436
- * <!--ONLY:REST-->
437
- * Use this endpoint to update all resource information except for the resource's schedule. To update a resource's schedule use
438
- * the [Update Schedule](https://dev.wix.com/api/rest/wix-bookings/resources/update-schedule) endpoint.
439
- *
440
- * >**Notes:**
441
- * > + 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"`.
442
- * > + 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”`.
443
- * > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
444
- *
445
- * >**Permissions:**
446
- * > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
447
- * <!--END:ONLY:REST-->
398
+ *
399
+ *
400
+ * The `updateResource()` function returns a Promise that resolves when a resource is updated. Use this function to update all bookings resource information except for the resource's schedule. To update a resource's schedule use [`updateResourceSchedule()`](resources/updateresourceschedule).
401
+ *
402
+ *
403
+ * >**Notes:** 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"`. Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can update a resource.
448
404
  * @param _id - Resource ID.
449
405
  * @public
450
- * @documentationMaturity preview
451
406
  * @requiredField _id
452
407
  * @requiredField scheduleActions.cancelRequests.scheduleId
453
408
  * @requiredField scheduleActions.createRequests.schedule.availability.start
@@ -456,7 +411,7 @@ export function create(resource, options) {
456
411
  * @requiredField scheduleActions.updateRequests.schedule._id
457
412
  * @permissionScope Manage Bookings
458
413
  */
459
- export function update(_id, options) {
414
+ export function updateResource(_id, options) {
460
415
  var _a, _b, _c;
461
416
  return __awaiter(this, arguments, void 0, function* () {
462
417
  const requestTransformation = {
@@ -520,65 +475,31 @@ export function update(_id, options) {
520
475
  });
521
476
  }
522
477
  /**
523
- * Updates a resource's schedule
524
- * <!--ONLY:VELO
525
- * The `updateResourceSchedule()` function returns a Promise that resolves when a resource's schedule has been updated.
526
- * Use this function to update the bookings resource's schedule. To update other resource details use [`updateResource()`] (wix-bookings-backend/resources/updateresource).
527
- * The following schedule properties can be updated:
528
- * + `availability.start`
529
- * + `availability.linkedSchedules`
530
- * <!--END:ONLY:VELO-->
478
+ * Updates a resource's schedule.
479
+ *
480
+ *
481
+ * The `updateResourceSchedule()` function returns a Promise that resolves when a resource's schedule has been updated. Use this function to update the bookings resource's schedule. To update other resource details use [`updateResource()`] (resources/updateresource). The following schedule properties can be updated: + `availability.start` + `availability.linkedSchedules`
482
+ *
531
483
  *
532
484
  * To update a resource's schedule to remove business hours and add custom hours:
533
- * <!--ONLY:REST-->
534
- * + Update the resource's schedule to remove the business's `scheduleId` from the `availability.linkedSchedules` array.
535
- * + Create a set of recurring sessions of type `"WORKING_HOURS"` to define the resource's new hours.
536
- * <!--END:ONLY:REST-->
537
- * <!--ONLY:VELO
538
- * + Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to remove the business's scheduleId from the `availability.linkedSchedules` array.
539
- * + 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.
540
- * <!--END:ONLY:VELO-->
485
+ * - Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to remove the business's scheduleId from the `availability.linkedSchedules` array.
486
+ * - Use [`createSession()`](Sessions/createsession) to create a set of recurring sessions of type `WORKING_HOURS` to define the resource's new hours.
487
+ *
541
488
  *
542
489
  * To update a resource's schedule to add default business hours, and keep or remove custom hours:
543
- * <!--ONLY:REST-->
544
- * + Update the resource's schedule to add the business resource's `scheduleId` to the `availability.linkedSchedules` array.
545
- * + If you want to remove the custom sessions, delete the resource's sessions of type `"WORKING_HOURS"`.
546
- * 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.
547
- * <!--END:ONLY:REST-->
548
- * <!--ONLY:VELO
549
- * + Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to add the business resource's `scheduleId` to the `availability.linkedSchedules` array.
550
- * + 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.
551
- *
552
- * > **Notes:**
553
- * > + 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.
554
- * > + A resource can have one schedule only.
555
- * > + A resource can have both default business hours and custom hours in its schedule.
556
- * > + 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”`.
557
- * > + 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`.
558
- * @snippet [updateResourceScheduleDefaultToCustom.es6=Update a resource's schedule from business to custom hours]
559
- * Update a resource's schedule from the business's default working hours to 2 custom days per week.
560
- * @snippet [updateResourceScheduleCustomToDefault.es6=Update a resource's schedule from custom to business hours]
561
- * <!--END:ONLY:VELO-->
562
- * <!--ONLY:REST-->
563
- * >**Notes:**
564
- * > + A resource can have one schedule only.
565
- * > + A resource can have both default business hours and custom hours in its schedule.
566
- * > + 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”`.
567
- * > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
568
- *
569
- *
570
- *
571
- * >**Permissions:**
572
- * > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
573
- * <!--END:ONLY:REST-->
490
+ *
491
+ * - Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to add the business resource's `scheduleId` to the `availability.linkedSchedules` array.
492
+ * - 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.
493
+ *
494
+ *
495
+ * > **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.
574
496
  * @param resourceId - Resource id to update.
575
497
  * @public
576
- * @documentationMaturity preview
577
498
  * @requiredField options.schedule._id
578
499
  * @requiredField resourceId
579
500
  * @permissionScope Manage Bookings
580
501
  */
581
- export function updateSchedule(resourceId, options) {
502
+ export function updateResourceSchedule(resourceId, options) {
582
503
  var _a, _b, _c;
583
504
  return __awaiter(this, arguments, void 0, function* () {
584
505
  const requestTransformation = {
@@ -628,28 +549,16 @@ export function updateSchedule(resourceId, options) {
628
549
  }
629
550
  /**
630
551
  * Deletes a resource.
631
- * <!--ONLY:VELO
552
+ *
632
553
  * The `deleteResource()` function returns a Promise that is resolved when a resource is deleted.
633
- * <!--END:ONLY:VELO-->
634
- * Deleting a resource updates its `status` to `"DELETED"`.
554
+ *
555
+ *
556
+ * Deleting a resource updates its status to `DELETED`.
635
557
  *
636
558
  * You cannot delete a resource if it has booked sessions.
637
559
  *
638
- * <!--ONLY:VELO
639
- * >**Notes:**
640
- * > + 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.
641
- * > + You can have up to 135 active resources and an additional 135 deleted resources.
642
- * > + 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`.
643
- * <!--END:ONLY:VELO-->
644
- *
645
- * <!--ONLY:REST-->
646
- * >**Notes:**
647
- * > + 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.
648
- * > + You can have up to 135 active resources and an additional 135 deleted resources.
649
- *
650
- * >**Permissions:**
651
- * > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
652
- * <!--END:ONLY:REST-->
560
+ *
561
+ * >**Notes:** 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. You can have up to 135 active resources and an additional 135 deleted resources. Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can delete a resource.
653
562
  * @param _id - ID of the resource to delete.
654
563
  * @public
655
564
  * @documentationMaturity preview