@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
@@ -28,7 +28,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
28
28
  });
29
29
  };
30
30
  Object.defineProperty(exports, "__esModule", { value: true });
31
- exports._delete = exports.updateSchedule = exports.update = exports.create = exports.query = exports.list = 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.__debug = void 0;
31
+ exports._delete = exports.updateResourceSchedule = exports.updateResource = exports.createResource = exports.queryResourceCatalog = exports.list = 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.__debug = void 0;
32
32
  const velo_1 = require("@wix/metro-runtime/velo");
33
33
  const ambassadorWixBookingsCatalogV1Resource = __importStar(require("./bookings-catalog-v1-resource.http"));
34
34
  let __verbose = false;
@@ -264,31 +264,21 @@ exports.list = list;
264
264
  /**
265
265
  * Retrieves a list of the resources according to the specified filters and paging.
266
266
  *
267
- * The query parameter is optional. If no query is provided than all non-deleted resources are returned.
268
267
  *
269
- * |Property|Is supported|
270
- * |--|--|
271
- * |filter | supported fields: `resource.id`, `resource.tags`, `resource.status`|
272
- * |paging | supported |
273
- * |fields | supported |
274
- * |fieldsets | **not supported** |
275
- * |sort | **not supported** |
268
+ * The query parameter is optional. If no query is provided, all non-deleted resources are returned.
276
269
  *
270
+ * |Property|Is supported| |--|--| |filter | supported fields: resource.id, resource.tags, resource.status| |paging | supported | |fields | supported | |fieldsets | not supported | |sort | not supported |
277
271
  *
278
- * >**Notes:**
279
- * > + The following objects in the `query` parameter are not supported for this query:
280
- * > - `sort`
281
- * > - `fieldsets`
272
+ * > **Notes:** The following objects in the query parameter are not supported for this query:
273
+ * > - sort
274
+ * > - fieldsets
282
275
  *
283
- * > **Permissions**
284
- * > This endpoint requires the Read Bookings Calendar, Read Bookings - Public Data, Read Bookings - Including Participants or Manage Bookings permission scope.
285
276
  * @public
286
- * @documentationMaturity preview
287
277
  * @permissionScope Read Bookings - Public Data
288
278
  * @permissionScope Read bookings calendar - including participants
289
279
  * @permissionScope Read Bookings Calendar
290
280
  */
291
- function query(options) {
281
+ function queryResourceCatalog(options) {
292
282
  var _a, _b, _c;
293
283
  return __awaiter(this, arguments, void 0, function* () {
294
284
  const requestTransformation = { query: '$[0].query' };
@@ -337,58 +327,38 @@ function query(options) {
337
327
  }
338
328
  });
339
329
  }
340
- exports.query = query;
330
+ exports.queryResourceCatalog = queryResourceCatalog;
341
331
  /**
342
332
  * Creates a resource.
343
- * <!--ONLY:VELO
333
+ *
334
+ *
344
335
  * The `createResource()` function returns a Promise that resolves to the created resource.
345
- * <!--END:ONLY:VELO-->
336
+ * 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.
346
337
  *
347
- * 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.
348
- * 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.
349
- * You can use both individual and recurring sessions to define resource availability. You cannot use availability constraints for resource schedules.
350
338
  *
351
- * <!--ONLY:VELO
352
339
  * When creating a resource using `createResource()`, include the resource's schedule information. Set the schedule information as follows:
353
- * + 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.
354
- * + 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.
355
- * + You can have both default business hours and custom hours for the same resource schedule by combining the steps above.
356
- *
357
- * > **Notes:**
358
- * > + 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.
359
- * > + The Wix Bookings app does not show non-recurring `WORKING_HOURS` sessions in the resource calendar.
360
- * > + You can only add the business resource's schedule as a linked schedule for a resource.
361
- * > + A resource can have one schedule only.
362
- * > + You can have up to 135 active resources and an additional 135 deleted resources.
363
- * > + 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`.
364
- * <!--END:ONLY:VELO-->
365
- *
366
- * <!--ONLY:REST-->
367
- * Use the following steps to create resources:
368
- * - Create the resource using including schedule information.
369
- * - 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.
370
- * - 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.
371
- *
372
- * >**Notes:**
373
- * > + A resource can have one schedule only.
374
- * > + You can have up to 135 active resources and an additional 135 deleted resources.
375
- * > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
376
- *
377
- *
378
- *
379
- * >**Permissions:**
380
- * > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
381
- * <!--END:ONLY:REST-->
340
+ * - 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.
341
+ * - 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.
342
+ *
343
+ * You can have both default business hours and custom hours for the same resource schedule by combining the steps above.
344
+ *
345
+ *
346
+ * > **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.
347
+ *
348
+ *
349
+ * 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.
350
+ *
351
+ *
352
+ * 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.
382
353
  * @param resource - Resource details.
383
354
  * @public
384
- * @documentationMaturity preview
385
355
  * @requiredField options.schedules.availability.start
386
356
  * @requiredField options.schedules.intervals.start
387
357
  * @requiredField resource
388
358
  * @requiredField resource.name
389
359
  * @permissionScope Manage Bookings
390
360
  */
391
- function create(resource, options) {
361
+ function createResource(resource, options) {
392
362
  var _a, _b, _c;
393
363
  return __awaiter(this, arguments, void 0, function* () {
394
364
  const requestTransformation = {
@@ -447,32 +417,17 @@ function create(resource, options) {
447
417
  }
448
418
  });
449
419
  }
450
- exports.create = create;
420
+ exports.createResource = createResource;
451
421
  /**
452
422
  * Updates a resource.
453
- * <!--ONLY:VELO
454
- * The `updateResource()` function returns a Promise that resolves when a resource is updated.
455
- * 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).
456
- *
457
- * >**Notes:**
458
- * > + 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"`.
459
- * > + 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`.
460
- * <!--END:ONLY:VELO-->
461
- * <!--ONLY:REST-->
462
- * Use this endpoint to update all resource information except for the resource's schedule. To update a resource's schedule use
463
- * the [Update Schedule](https://dev.wix.com/api/rest/wix-bookings/resources/update-schedule) endpoint.
464
- *
465
- * >**Notes:**
466
- * > + 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"`.
467
- * > + 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”`.
468
- * > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
469
- *
470
- * >**Permissions:**
471
- * > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
472
- * <!--END:ONLY:REST-->
423
+ *
424
+ *
425
+ * 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).
426
+ *
427
+ *
428
+ * >**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.
473
429
  * @param _id - Resource ID.
474
430
  * @public
475
- * @documentationMaturity preview
476
431
  * @requiredField _id
477
432
  * @requiredField scheduleActions.cancelRequests.scheduleId
478
433
  * @requiredField scheduleActions.createRequests.schedule.availability.start
@@ -481,7 +436,7 @@ exports.create = create;
481
436
  * @requiredField scheduleActions.updateRequests.schedule._id
482
437
  * @permissionScope Manage Bookings
483
438
  */
484
- function update(_id, options) {
439
+ function updateResource(_id, options) {
485
440
  var _a, _b, _c;
486
441
  return __awaiter(this, arguments, void 0, function* () {
487
442
  const requestTransformation = {
@@ -544,67 +499,33 @@ function update(_id, options) {
544
499
  }
545
500
  });
546
501
  }
547
- exports.update = update;
502
+ exports.updateResource = updateResource;
548
503
  /**
549
- * Updates a resource's schedule
550
- * <!--ONLY:VELO
551
- * The `updateResourceSchedule()` function returns a Promise that resolves when a resource's schedule has been updated.
552
- * Use this function to update the bookings resource's schedule. To update other resource details use [`updateResource()`] (wix-bookings-backend/resources/updateresource).
553
- * The following schedule properties can be updated:
554
- * + `availability.start`
555
- * + `availability.linkedSchedules`
556
- * <!--END:ONLY:VELO-->
504
+ * Updates a resource's schedule.
505
+ *
506
+ *
507
+ * 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`
508
+ *
557
509
  *
558
510
  * To update a resource's schedule to remove business hours and add custom hours:
559
- * <!--ONLY:REST-->
560
- * + Update the resource's schedule to remove the business's `scheduleId` from the `availability.linkedSchedules` array.
561
- * + Create a set of recurring sessions of type `"WORKING_HOURS"` to define the resource's new hours.
562
- * <!--END:ONLY:REST-->
563
- * <!--ONLY:VELO
564
- * + Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to remove the business's scheduleId from the `availability.linkedSchedules` array.
565
- * + 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.
566
- * <!--END:ONLY:VELO-->
511
+ * - Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to remove the business's scheduleId from the `availability.linkedSchedules` array.
512
+ * - Use [`createSession()`](Sessions/createsession) to create a set of recurring sessions of type `WORKING_HOURS` to define the resource's new hours.
513
+ *
567
514
  *
568
515
  * To update a resource's schedule to add default business hours, and keep or remove custom hours:
569
- * <!--ONLY:REST-->
570
- * + Update the resource's schedule to add the business resource's `scheduleId` to the `availability.linkedSchedules` array.
571
- * + If you want to remove the custom sessions, delete the resource's sessions of type `"WORKING_HOURS"`.
572
- * 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.
573
- * <!--END:ONLY:REST-->
574
- * <!--ONLY:VELO
575
- * + Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to add the business resource's `scheduleId` to the `availability.linkedSchedules` array.
576
- * + 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.
577
- *
578
- * > **Notes:**
579
- * > + 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.
580
- * > + A resource can have one schedule only.
581
- * > + A resource can have both default business hours and custom hours in its schedule.
582
- * > + 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”`.
583
- * > + 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`.
584
- * @snippet [updateResourceScheduleDefaultToCustom.es6=Update a resource's schedule from business to custom hours]
585
- * Update a resource's schedule from the business's default working hours to 2 custom days per week.
586
- * @snippet [updateResourceScheduleCustomToDefault.es6=Update a resource's schedule from custom to business hours]
587
- * <!--END:ONLY:VELO-->
588
- * <!--ONLY:REST-->
589
- * >**Notes:**
590
- * > + A resource can have one schedule only.
591
- * > + A resource can have both default business hours and custom hours in its schedule.
592
- * > + 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”`.
593
- * > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
594
- *
595
- *
596
- *
597
- * >**Permissions:**
598
- * > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
599
- * <!--END:ONLY:REST-->
516
+ *
517
+ * - Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to add the business resource's `scheduleId` to the `availability.linkedSchedules` array.
518
+ * - 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.
519
+ *
520
+ *
521
+ * > **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.
600
522
  * @param resourceId - Resource id to update.
601
523
  * @public
602
- * @documentationMaturity preview
603
524
  * @requiredField options.schedule._id
604
525
  * @requiredField resourceId
605
526
  * @permissionScope Manage Bookings
606
527
  */
607
- function updateSchedule(resourceId, options) {
528
+ function updateResourceSchedule(resourceId, options) {
608
529
  var _a, _b, _c;
609
530
  return __awaiter(this, arguments, void 0, function* () {
610
531
  const requestTransformation = {
@@ -652,31 +573,19 @@ function updateSchedule(resourceId, options) {
652
573
  }
653
574
  });
654
575
  }
655
- exports.updateSchedule = updateSchedule;
576
+ exports.updateResourceSchedule = updateResourceSchedule;
656
577
  /**
657
578
  * Deletes a resource.
658
- * <!--ONLY:VELO
579
+ *
659
580
  * The `deleteResource()` function returns a Promise that is resolved when a resource is deleted.
660
- * <!--END:ONLY:VELO-->
661
- * Deleting a resource updates its `status` to `"DELETED"`.
581
+ *
582
+ *
583
+ * Deleting a resource updates its status to `DELETED`.
662
584
  *
663
585
  * You cannot delete a resource if it has booked sessions.
664
586
  *
665
- * <!--ONLY:VELO
666
- * >**Notes:**
667
- * > + 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.
668
- * > + You can have up to 135 active resources and an additional 135 deleted resources.
669
- * > + 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`.
670
- * <!--END:ONLY:VELO-->
671
- *
672
- * <!--ONLY:REST-->
673
- * >**Notes:**
674
- * > + 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.
675
- * > + You can have up to 135 active resources and an additional 135 deleted resources.
676
- *
677
- * >**Permissions:**
678
- * > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
679
- * <!--END:ONLY:REST-->
587
+ *
588
+ * >**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.
680
589
  * @param _id - ID of the resource to delete.
681
590
  * @public
682
591
  * @documentationMaturity preview