@wix/bookings 1.0.156 → 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.
- package/build/cjs/src/bookings-catalog-v1-resource.http.d.ts +48 -156
- package/build/cjs/src/bookings-catalog-v1-resource.http.js +48 -156
- package/build/cjs/src/bookings-catalog-v1-resource.http.js.map +1 -1
- package/build/cjs/src/bookings-catalog-v1-resource.public.d.ts +6 -6
- package/build/cjs/src/bookings-catalog-v1-resource.public.js +13 -13
- package/build/cjs/src/bookings-catalog-v1-resource.public.js.map +1 -1
- package/build/cjs/src/bookings-catalog-v1-resource.universal.d.ts +78 -176
- package/build/cjs/src/bookings-catalog-v1-resource.universal.js +57 -168
- package/build/cjs/src/bookings-catalog-v1-resource.universal.js.map +1 -1
- package/build/cjs/src/bookings-v2-attendance.http.d.ts +13 -10
- package/build/cjs/src/bookings-v2-attendance.http.js +20 -9
- package/build/cjs/src/bookings-v2-attendance.http.js.map +1 -1
- package/build/cjs/src/bookings-v2-attendance.types.d.ts +13 -7
- package/build/cjs/src/bookings-v2-attendance.types.js.map +1 -1
- package/build/cjs/src/bookings-v2-attendance.universal.d.ts +25 -16
- package/build/cjs/src/bookings-v2-attendance.universal.js +12 -9
- package/build/cjs/src/bookings-v2-attendance.universal.js.map +1 -1
- package/build/es/src/bookings-catalog-v1-resource.http.d.ts +48 -156
- package/build/es/src/bookings-catalog-v1-resource.http.js +48 -156
- package/build/es/src/bookings-catalog-v1-resource.http.js.map +1 -1
- package/build/es/src/bookings-catalog-v1-resource.public.d.ts +6 -6
- package/build/es/src/bookings-catalog-v1-resource.public.js +9 -9
- package/build/es/src/bookings-catalog-v1-resource.public.js.map +1 -1
- package/build/es/src/bookings-catalog-v1-resource.universal.d.ts +78 -176
- package/build/es/src/bookings-catalog-v1-resource.universal.js +52 -163
- package/build/es/src/bookings-catalog-v1-resource.universal.js.map +1 -1
- package/build/es/src/bookings-v2-attendance.http.d.ts +13 -10
- package/build/es/src/bookings-v2-attendance.http.js +20 -9
- package/build/es/src/bookings-v2-attendance.http.js.map +1 -1
- package/build/es/src/bookings-v2-attendance.types.d.ts +13 -7
- package/build/es/src/bookings-v2-attendance.types.js.map +1 -1
- package/build/es/src/bookings-v2-attendance.universal.d.ts +25 -16
- package/build/es/src/bookings-v2-attendance.universal.js +12 -9
- package/build/es/src/bookings-v2-attendance.universal.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Event = exports.SortOrder = exports.ResourceStatus = exports.ConferenceType = exports.ScheduleStatus = exports.ApprovalStatus = exports.DayOfWeek = exports.LocationsLocationType = exports.LocationStatus = exports.LocationType = exports.RecurringIntervalType = exports.Transparency = exports.Day = exports._delete = exports.
|
|
3
|
+
exports.Event = exports.SortOrder = exports.ResourceStatus = exports.ConferenceType = exports.ScheduleStatus = exports.ApprovalStatus = exports.DayOfWeek = exports.LocationsLocationType = exports.LocationStatus = exports.LocationType = exports.RecurringIntervalType = exports.Transparency = exports.Day = exports._delete = exports.updateResourceSchedule = exports.updateResource = exports.createResource = exports.queryResourceCatalog = exports.list = exports.__metadata = void 0;
|
|
4
4
|
const bookings_catalog_v1_resource_universal_1 = require("./bookings-catalog-v1-resource.universal");
|
|
5
5
|
exports.__metadata = { PACKAGE_NAME: '@wix/bookings' };
|
|
6
6
|
function list(httpClient) {
|
|
@@ -9,30 +9,30 @@ function list(httpClient) {
|
|
|
9
9
|
{ httpClient });
|
|
10
10
|
}
|
|
11
11
|
exports.list = list;
|
|
12
|
-
function
|
|
13
|
-
return (options) => (0, bookings_catalog_v1_resource_universal_1.
|
|
12
|
+
function queryResourceCatalog(httpClient) {
|
|
13
|
+
return (options) => (0, bookings_catalog_v1_resource_universal_1.queryResourceCatalog)(options,
|
|
14
14
|
// @ts-ignore
|
|
15
15
|
{ httpClient });
|
|
16
16
|
}
|
|
17
|
-
exports.
|
|
18
|
-
function
|
|
19
|
-
return (resource, options) => (0, bookings_catalog_v1_resource_universal_1.
|
|
17
|
+
exports.queryResourceCatalog = queryResourceCatalog;
|
|
18
|
+
function createResource(httpClient) {
|
|
19
|
+
return (resource, options) => (0, bookings_catalog_v1_resource_universal_1.createResource)(resource, options,
|
|
20
20
|
// @ts-ignore
|
|
21
21
|
{ httpClient });
|
|
22
22
|
}
|
|
23
|
-
exports.
|
|
24
|
-
function
|
|
25
|
-
return (_id, options) => (0, bookings_catalog_v1_resource_universal_1.
|
|
23
|
+
exports.createResource = createResource;
|
|
24
|
+
function updateResource(httpClient) {
|
|
25
|
+
return (_id, options) => (0, bookings_catalog_v1_resource_universal_1.updateResource)(_id, options,
|
|
26
26
|
// @ts-ignore
|
|
27
27
|
{ httpClient });
|
|
28
28
|
}
|
|
29
|
-
exports.
|
|
30
|
-
function
|
|
31
|
-
return (resourceId, options) => (0, bookings_catalog_v1_resource_universal_1.
|
|
29
|
+
exports.updateResource = updateResource;
|
|
30
|
+
function updateResourceSchedule(httpClient) {
|
|
31
|
+
return (resourceId, options) => (0, bookings_catalog_v1_resource_universal_1.updateResourceSchedule)(resourceId, options,
|
|
32
32
|
// @ts-ignore
|
|
33
33
|
{ httpClient });
|
|
34
34
|
}
|
|
35
|
-
exports.
|
|
35
|
+
exports.updateResourceSchedule = updateResourceSchedule;
|
|
36
36
|
function _delete(httpClient) {
|
|
37
37
|
return (_id) => (0, bookings_catalog_v1_resource_universal_1._delete)(_id,
|
|
38
38
|
// @ts-ignore
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bookings-catalog-v1-resource.public.js","sourceRoot":"","sources":["../../../src/bookings-catalog-v1-resource.public.ts"],"names":[],"mappings":";;;AACA,qGAakD;AAErC,QAAA,UAAU,GAAG,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC;AAE5D,SAAgB,IAAI,CAAC,UAAsB;IACzC,OAAO,CAAC,OAAqB,EAAE,EAAE,CAC/B,IAAA,6CAAa,EACX,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,oBAOC;AAED,SAAgB,
|
|
1
|
+
{"version":3,"file":"bookings-catalog-v1-resource.public.js","sourceRoot":"","sources":["../../../src/bookings-catalog-v1-resource.public.ts"],"names":[],"mappings":";;;AACA,qGAakD;AAErC,QAAA,UAAU,GAAG,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC;AAE5D,SAAgB,IAAI,CAAC,UAAsB;IACzC,OAAO,CAAC,OAAqB,EAAE,EAAE,CAC/B,IAAA,6CAAa,EACX,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,oBAOC;AAED,SAAgB,oBAAoB,CAAC,UAAsB;IACzD,OAAO,CAAC,OAAqC,EAAE,EAAE,CAC/C,IAAA,6DAA6B,EAC3B,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,oDAOC;AAED,SAAgB,cAAc,CAAC,UAAsB;IACnD,OAAO,CAAC,QAAkB,EAAE,OAA+B,EAAE,EAAE,CAC7D,IAAA,uDAAuB,EACrB,QAAQ,EACR,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,wCAQC;AAED,SAAgB,cAAc,CAAC,UAAsB;IACnD,OAAO,CAAC,GAAkB,EAAE,OAA+B,EAAE,EAAE,CAC7D,IAAA,uDAAuB,EACrB,GAAG,EACH,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,wCAQC;AAED,SAAgB,sBAAsB,CAAC,UAAsB;IAC3D,OAAO,CAAC,UAAyB,EAAE,OAAuC,EAAE,EAAE,CAC5E,IAAA,+DAA+B,EAC7B,UAAU,EACV,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,wDAQC;AAED,SAAgB,OAAO,CAAC,UAAsB;IAC5C,OAAO,CAAC,GAAW,EAAE,EAAE,CACrB,IAAA,gDAAgB,EACd,GAAG;IACH,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,0BAOC;AAED,mGAckD;AAbhD,6HAAA,GAAG,OAAA;AACH,sIAAA,YAAY,OAAA;AACZ,+IAAA,qBAAqB,OAAA;AACrB,sIAAA,YAAY,OAAA;AACZ,wIAAA,cAAc,OAAA;AACd,+IAAA,qBAAqB,OAAA;AACrB,mIAAA,SAAS,OAAA;AACT,wIAAA,cAAc,OAAA;AACd,wIAAA,cAAc,OAAA;AACd,wIAAA,cAAc,OAAA;AACd,wIAAA,cAAc,OAAA;AACd,mIAAA,SAAS,OAAA;AACT,+HAAA,KAAK,OAAA"}
|
|
@@ -18,13 +18,17 @@ export interface Resource {
|
|
|
18
18
|
phone?: string | null;
|
|
19
19
|
/** Resource description. */
|
|
20
20
|
description?: string | null;
|
|
21
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
* @internal */
|
|
22
24
|
tag?: string | null;
|
|
23
25
|
/** Resource tags. Tags are used to identify, group, and filter the different types of resources. For example, 'staff' or 'room'. */
|
|
24
26
|
tags?: string[] | null;
|
|
25
27
|
/** Resource images. */
|
|
26
28
|
images?: string[];
|
|
27
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* @internal
|
|
31
|
+
* @internal */
|
|
28
32
|
schedules?: Schedule[];
|
|
29
33
|
/**
|
|
30
34
|
* List of IDs of schedules owned by this resource.
|
|
@@ -63,7 +67,9 @@ export interface Schedule {
|
|
|
63
67
|
* @readonly
|
|
64
68
|
*/
|
|
65
69
|
timeZone?: string | null;
|
|
66
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* @internal
|
|
72
|
+
* @internal */
|
|
67
73
|
intervals?: RecurringInterval[];
|
|
68
74
|
/** Default title for the schedule's sessions. Maximum length: 6000 characters. */
|
|
69
75
|
title?: string | null;
|
|
@@ -79,9 +85,13 @@ export interface Schedule {
|
|
|
79
85
|
* Must be at most `1` for schedule whose availability is affected by another schedule. E.g, appointment schedules of the Wix Bookings app.
|
|
80
86
|
*/
|
|
81
87
|
capacity?: number | null;
|
|
82
|
-
/**
|
|
88
|
+
/**
|
|
89
|
+
* @internal
|
|
90
|
+
* @internal */
|
|
83
91
|
rate?: Rate;
|
|
84
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* @internal
|
|
94
|
+
* @internal */
|
|
85
95
|
availability?: Availability;
|
|
86
96
|
/**
|
|
87
97
|
* Number of participants registered to sessions in this schedule, calculated as the sum of the party sizes.
|
|
@@ -95,7 +105,9 @@ export interface Schedule {
|
|
|
95
105
|
* @readonly
|
|
96
106
|
*/
|
|
97
107
|
participants?: Participant[];
|
|
98
|
-
/**
|
|
108
|
+
/**
|
|
109
|
+
* @internal
|
|
110
|
+
* @internal */
|
|
99
111
|
externalCalendarOverrides?: ExternalCalendarOverrides;
|
|
100
112
|
/**
|
|
101
113
|
* Schedule status.
|
|
@@ -122,12 +134,13 @@ export interface Schedule {
|
|
|
122
134
|
* @readonly
|
|
123
135
|
*/
|
|
124
136
|
inheritedFields?: string[];
|
|
125
|
-
/**
|
|
137
|
+
/**
|
|
138
|
+
* @internal
|
|
139
|
+
* @internal */
|
|
126
140
|
conferenceProvider?: ConferenceProvider;
|
|
127
141
|
/**
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*/
|
|
142
|
+
* @internal
|
|
143
|
+
* @internal */
|
|
131
144
|
calendarConference?: CalendarConference;
|
|
132
145
|
}
|
|
133
146
|
export interface RecurringInterval {
|
|
@@ -495,11 +508,8 @@ export interface AvailabilityConstraints {
|
|
|
495
508
|
*/
|
|
496
509
|
timeBetweenSlots?: number;
|
|
497
510
|
/**
|
|
498
|
-
*
|
|
499
|
-
*
|
|
500
|
-
* Optional. The default is the first duration in slot_durations field.
|
|
501
|
-
* Deprecated. Use the `split_slots_interval.value_in_minutes`.
|
|
502
|
-
*/
|
|
511
|
+
* @internal
|
|
512
|
+
* @internal */
|
|
503
513
|
splitInterval?: number | null;
|
|
504
514
|
/**
|
|
505
515
|
* An object defining the time between available slots' start times. For example, a slot with slots_split_interval=5 can start every 5 minutes. The default is the slot duration.
|
|
@@ -760,9 +770,8 @@ export interface CreateResourceResponse {
|
|
|
760
770
|
}
|
|
761
771
|
export interface ResourceNotification {
|
|
762
772
|
/**
|
|
763
|
-
*
|
|
764
|
-
*
|
|
765
|
-
*/
|
|
773
|
+
* @internal
|
|
774
|
+
* @internal */
|
|
766
775
|
resource?: Resource;
|
|
767
776
|
/** Event type. */
|
|
768
777
|
event?: Event;
|
|
@@ -814,7 +823,9 @@ export interface UpdateScheduleRequest {
|
|
|
814
823
|
fieldMask?: string[];
|
|
815
824
|
/** Optional. Defaults to false. In case of updated intervals' start time, this field indicates whether to align those interval's time exceptions. */
|
|
816
825
|
alignTimeExceptions?: boolean;
|
|
817
|
-
/**
|
|
826
|
+
/**
|
|
827
|
+
* @internal
|
|
828
|
+
* @internal */
|
|
818
829
|
notifyParticipants?: boolean;
|
|
819
830
|
/** Whether to notify participants about the change, and an optional custom message. */
|
|
820
831
|
participantNotification?: ParticipantNotification;
|
|
@@ -836,7 +847,9 @@ export interface CancelScheduleRequest {
|
|
|
836
847
|
from?: Date;
|
|
837
848
|
/** Whether to preserve future sessions with reservations. Defaults to false. */
|
|
838
849
|
preserveFutureSessionsWithParticipants?: boolean;
|
|
839
|
-
/**
|
|
850
|
+
/**
|
|
851
|
+
* @internal
|
|
852
|
+
* @internal */
|
|
840
853
|
notifyParticipants?: boolean;
|
|
841
854
|
/** Whether to notify participants about the change, and an optional custom message. */
|
|
842
855
|
participantNotification?: ParticipantNotification;
|
|
@@ -900,28 +913,8 @@ export interface UnLinkResourceFromOwnerResponse {
|
|
|
900
913
|
resource?: Resource;
|
|
901
914
|
}
|
|
902
915
|
/**
|
|
903
|
-
*
|
|
904
|
-
* >
|
|
905
|
-
* > **This endpoint has been replaced with [Query Resource](https://dev.wix.com/api/rest/wix-bookings/resources/list-resources/query-resource) and will be removed on March 31, 2022.**
|
|
906
|
-
* > **If your app uses this endpoint, we recommend updating your code as soon as possible.**
|
|
907
|
-
*
|
|
908
|
-
* Retrieves a list of the resources according to the provided filters and paging.
|
|
909
|
-
* <!--ONLY:REST-->
|
|
910
|
-
* This query is optional. If no query is provided than all non-deleted resources are returned.
|
|
911
|
-
*
|
|
912
|
-
* |Property|Is supported|
|
|
913
|
-
* |--|--|
|
|
914
|
-
* |filter | supports `resource.id`, `resource.tag`, `resource.status`|
|
|
915
|
-
* |paging | supported |
|
|
916
|
-
* |fields | supported |
|
|
917
|
-
* |fieldsets | **not supported** |
|
|
918
|
-
* |sort| **not supported** |
|
|
919
|
-
*
|
|
920
|
-
* > **Permissions**
|
|
921
|
-
* > This endpoint requires the Read Bookings Calendar, Read Bookings - Public Data, Read Bookings - Including Participants or Manage Bookings permission scope.
|
|
922
|
-
* <!--END:ONLY:REST-->
|
|
916
|
+
* @internal
|
|
923
917
|
* @public
|
|
924
|
-
* @documentationMaturity preview
|
|
925
918
|
* @permissionScope Read Bookings - Public Data
|
|
926
919
|
* @permissionScope Read bookings calendar - including participants
|
|
927
920
|
* @permissionScope Read Bookings Calendar
|
|
@@ -933,86 +926,56 @@ export interface ListOptions {
|
|
|
933
926
|
/**
|
|
934
927
|
* Retrieves a list of the resources according to the specified filters and paging.
|
|
935
928
|
*
|
|
936
|
-
* The query parameter is optional. If no query is provided than all non-deleted resources are returned.
|
|
937
929
|
*
|
|
938
|
-
*
|
|
939
|
-
* |--|--|
|
|
940
|
-
* |filter | supported fields: `resource.id`, `resource.tags`, `resource.status`|
|
|
941
|
-
* |paging | supported |
|
|
942
|
-
* |fields | supported |
|
|
943
|
-
* |fieldsets | **not supported** |
|
|
944
|
-
* |sort | **not supported** |
|
|
930
|
+
* The query parameter is optional. If no query is provided, all non-deleted resources are returned.
|
|
945
931
|
*
|
|
932
|
+
* |Property|Is supported| |--|--| |filter | supported fields: resource.id, resource.tags, resource.status| |paging | supported | |fields | supported | |fieldsets | not supported | |sort | not supported |
|
|
946
933
|
*
|
|
947
|
-
*
|
|
948
|
-
* >
|
|
949
|
-
* >
|
|
950
|
-
* > - `fieldsets`
|
|
934
|
+
* > **Notes:** The following objects in the query parameter are not supported for this query:
|
|
935
|
+
* > - sort
|
|
936
|
+
* > - fieldsets
|
|
951
937
|
*
|
|
952
|
-
* > **Permissions**
|
|
953
|
-
* > This endpoint requires the Read Bookings Calendar, Read Bookings - Public Data, Read Bookings - Including Participants or Manage Bookings permission scope.
|
|
954
938
|
* @public
|
|
955
|
-
* @documentationMaturity preview
|
|
956
939
|
* @permissionScope Read Bookings - Public Data
|
|
957
940
|
* @permissionScope Read bookings calendar - including participants
|
|
958
941
|
* @permissionScope Read Bookings Calendar
|
|
959
942
|
*/
|
|
960
|
-
export declare function
|
|
961
|
-
export interface
|
|
943
|
+
export declare function queryResourceCatalog(options?: QueryResourceCatalogOptions): Promise<QueryResourcesResponse>;
|
|
944
|
+
export interface QueryResourceCatalogOptions {
|
|
962
945
|
query?: QueryV2;
|
|
963
946
|
}
|
|
964
947
|
/**
|
|
965
948
|
* Creates a resource.
|
|
966
|
-
*
|
|
949
|
+
*
|
|
950
|
+
*
|
|
967
951
|
* The `createResource()` function returns a Promise that resolves to the created resource.
|
|
968
|
-
*
|
|
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.
|
|
969
953
|
*
|
|
970
|
-
* 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.
|
|
971
|
-
* 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.
|
|
972
|
-
* You can use both individual and recurring sessions to define resource availability. You cannot use availability constraints for resource schedules.
|
|
973
954
|
*
|
|
974
|
-
* <!--ONLY:VELO
|
|
975
955
|
* When creating a resource using `createResource()`, include the resource's schedule information. Set the schedule information as follows:
|
|
976
|
-
*
|
|
977
|
-
*
|
|
978
|
-
* + 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.
|
|
979
958
|
*
|
|
980
|
-
*
|
|
981
|
-
* > + 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.
|
|
982
|
-
* > + The Wix Bookings app does not show non-recurring `WORKING_HOURS` sessions in the resource calendar.
|
|
983
|
-
* > + You can only add the business resource's schedule as a linked schedule for a resource.
|
|
984
|
-
* > + A resource can have one schedule only.
|
|
985
|
-
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
986
|
-
* > + 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`.
|
|
987
|
-
* <!--END:ONLY:VELO-->
|
|
959
|
+
* You can have both default business hours and custom hours for the same resource schedule by combining the steps above.
|
|
988
960
|
*
|
|
989
|
-
* <!--ONLY:REST-->
|
|
990
|
-
* Use the following steps to create resources:
|
|
991
|
-
* - Create the resource using including schedule information.
|
|
992
|
-
* - 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.
|
|
993
|
-
* - 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.
|
|
994
961
|
*
|
|
995
|
-
*
|
|
996
|
-
* > + A resource can have one schedule only.
|
|
997
|
-
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
998
|
-
* > + 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.
|
|
999
963
|
*
|
|
1000
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.
|
|
1001
966
|
*
|
|
1002
|
-
*
|
|
1003
|
-
*
|
|
1004
|
-
* <!--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.
|
|
1005
969
|
* @param resource - Resource details.
|
|
1006
970
|
* @public
|
|
1007
|
-
* @documentationMaturity preview
|
|
1008
971
|
* @requiredField options.schedules.availability.start
|
|
1009
972
|
* @requiredField options.schedules.intervals.start
|
|
1010
973
|
* @requiredField resource
|
|
1011
974
|
* @requiredField resource.name
|
|
1012
975
|
* @permissionScope Manage Bookings
|
|
1013
976
|
*/
|
|
1014
|
-
export declare function
|
|
1015
|
-
export interface
|
|
977
|
+
export declare function createResource(resource: Resource, options?: CreateResourceOptions): Promise<CreateResourceResponse>;
|
|
978
|
+
export interface CreateResourceOptions {
|
|
1016
979
|
/**
|
|
1017
980
|
* List of schedules to be assigned for the created resource. Currently only a single schedule is allowed.
|
|
1018
981
|
* If provided, any schedules in the resource entity will be ignored.
|
|
@@ -1021,29 +984,14 @@ export interface CreateOptions {
|
|
|
1021
984
|
}
|
|
1022
985
|
/**
|
|
1023
986
|
* Updates a resource.
|
|
1024
|
-
* <!--ONLY:VELO
|
|
1025
|
-
* The `updateResource()` function returns a Promise that resolves when a resource is updated.
|
|
1026
|
-
* Use this function to update all bookings resource information except for the resource's schedule. To update a resource's schedule use [`updateResourceSchedule()`](wix-bookings-backend/resource/updateresourceschedule).
|
|
1027
987
|
*
|
|
1028
|
-
* >**Notes:**
|
|
1029
|
-
* > + When updating a resource you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values `"business"` and `"staff"`.
|
|
1030
|
-
* > + Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can update a resource. You can override the role permissions by setting the `options.suppressAuth` parameter to `true`.
|
|
1031
|
-
* <!--END:ONLY:VELO-->
|
|
1032
|
-
* <!--ONLY:REST-->
|
|
1033
|
-
* Use this endpoint to update all resource information except for the resource's schedule. To update a resource's schedule use
|
|
1034
|
-
* the [Update Schedule](https://dev.wix.com/api/rest/wix-bookings/resources/update-schedule) endpoint.
|
|
1035
988
|
*
|
|
1036
|
-
*
|
|
1037
|
-
* > + When updating a resource you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values `"business"` and `"staff"`.
|
|
1038
|
-
* > + When updating a resource's schedule you cannot change the resource tag used by the Wix Bookings app. Tags used by the app have the values `"INDIVIDUAL"`, `"GROUP"`, and `"COURSE”`.
|
|
1039
|
-
* > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
|
|
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).
|
|
1040
990
|
*
|
|
1041
|
-
*
|
|
1042
|
-
*
|
|
1043
|
-
* <!--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.
|
|
1044
993
|
* @param _id - Resource ID.
|
|
1045
994
|
* @public
|
|
1046
|
-
* @documentationMaturity preview
|
|
1047
995
|
* @requiredField _id
|
|
1048
996
|
* @requiredField scheduleActions.cancelRequests.scheduleId
|
|
1049
997
|
* @requiredField scheduleActions.createRequests.schedule.availability.start
|
|
@@ -1052,8 +1000,8 @@ export interface CreateOptions {
|
|
|
1052
1000
|
* @requiredField scheduleActions.updateRequests.schedule._id
|
|
1053
1001
|
* @permissionScope Manage Bookings
|
|
1054
1002
|
*/
|
|
1055
|
-
export declare function
|
|
1056
|
-
export interface
|
|
1003
|
+
export declare function updateResource(_id: string | null, options?: UpdateResourceOptions): Promise<UpdateResourceResponse>;
|
|
1004
|
+
export interface UpdateResourceOptions {
|
|
1057
1005
|
resource: {
|
|
1058
1006
|
/**
|
|
1059
1007
|
* Resource ID.
|
|
@@ -1068,13 +1016,13 @@ export interface UpdateOptions {
|
|
|
1068
1016
|
phone?: string | null;
|
|
1069
1017
|
/** Resource description. */
|
|
1070
1018
|
description?: string | null;
|
|
1071
|
-
/**
|
|
1019
|
+
/** @internal */
|
|
1072
1020
|
tag?: string | null;
|
|
1073
1021
|
/** Resource tags. Tags are used to identify, group, and filter the different types of resources. For example, 'staff' or 'room'. */
|
|
1074
1022
|
tags?: string[] | null;
|
|
1075
1023
|
/** Resource images. */
|
|
1076
1024
|
images?: string[];
|
|
1077
|
-
/**
|
|
1025
|
+
/** @internal */
|
|
1078
1026
|
schedules?: Schedule[];
|
|
1079
1027
|
/**
|
|
1080
1028
|
* List of IDs of schedules owned by this resource.
|
|
@@ -1106,66 +1054,32 @@ export interface UpdateOptions {
|
|
|
1106
1054
|
fieldMask?: string[];
|
|
1107
1055
|
}
|
|
1108
1056
|
/**
|
|
1109
|
-
* Updates a resource's schedule
|
|
1110
|
-
*
|
|
1111
|
-
*
|
|
1112
|
-
* Use this function to update the bookings resource's schedule. To update other resource details
|
|
1113
|
-
*
|
|
1114
|
-
* + `availability.start`
|
|
1115
|
-
* + `availability.linkedSchedules`
|
|
1116
|
-
* <!--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
|
+
*
|
|
1117
1062
|
*
|
|
1118
1063
|
* To update a resource's schedule to remove business hours and add custom hours:
|
|
1119
|
-
*
|
|
1120
|
-
*
|
|
1121
|
-
* + Create a set of recurring sessions of type `"WORKING_HOURS"` to define the resource's new hours.
|
|
1122
|
-
* <!--END:ONLY:REST-->
|
|
1123
|
-
* <!--ONLY:VELO
|
|
1124
|
-
* + Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to remove the business's scheduleId from the `availability.linkedSchedules` array.
|
|
1125
|
-
* + 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.
|
|
1126
|
-
* <!--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.
|
|
1127
1066
|
*
|
|
1128
|
-
* To update a resource's schedule to add default business hours, and keep or remove custom hours:
|
|
1129
|
-
* <!--ONLY:REST-->
|
|
1130
|
-
* + Update the resource's schedule to add the business resource's `scheduleId` to the `availability.linkedSchedules` array.
|
|
1131
|
-
* + If you want to remove the custom sessions, delete the resource's sessions of type `"WORKING_HOURS"`.
|
|
1132
|
-
* 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.
|
|
1133
|
-
* <!--END:ONLY:REST-->
|
|
1134
|
-
* <!--ONLY:VELO
|
|
1135
|
-
* + Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to add the business resource's `scheduleId` to the `availability.linkedSchedules` array.
|
|
1136
|
-
* + 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.
|
|
1137
1067
|
*
|
|
1138
|
-
*
|
|
1139
|
-
* > + 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.
|
|
1140
|
-
* > + A resource can have one schedule only.
|
|
1141
|
-
* > + A resource can have both default business hours and custom hours in its schedule.
|
|
1142
|
-
* > + 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”`.
|
|
1143
|
-
* > + 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`.
|
|
1144
|
-
* @snippet [updateResourceScheduleDefaultToCustom.es6=Update a resource's schedule from business to custom hours]
|
|
1145
|
-
* Update a resource's schedule from the business's default working hours to 2 custom days per week.
|
|
1146
|
-
* @snippet [updateResourceScheduleCustomToDefault.es6=Update a resource's schedule from custom to business hours]
|
|
1147
|
-
* <!--END:ONLY:VELO-->
|
|
1148
|
-
* <!--ONLY:REST-->
|
|
1149
|
-
* >**Notes:**
|
|
1150
|
-
* > + A resource can have one schedule only.
|
|
1151
|
-
* > + A resource can have both default business hours and custom hours in its schedule.
|
|
1152
|
-
* > + 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”`.
|
|
1153
|
-
* > + 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:
|
|
1154
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.
|
|
1155
1072
|
*
|
|
1156
1073
|
*
|
|
1157
|
-
*
|
|
1158
|
-
* > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
|
|
1159
|
-
* <!--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.
|
|
1160
1075
|
* @param resourceId - Resource id to update.
|
|
1161
1076
|
* @public
|
|
1162
|
-
* @documentationMaturity preview
|
|
1163
1077
|
* @requiredField options.schedule._id
|
|
1164
1078
|
* @requiredField resourceId
|
|
1165
1079
|
* @permissionScope Manage Bookings
|
|
1166
1080
|
*/
|
|
1167
|
-
export declare function
|
|
1168
|
-
export interface
|
|
1081
|
+
export declare function updateResourceSchedule(resourceId: string | null, options?: UpdateResourceScheduleOptions): Promise<UpdateScheduleResponse>;
|
|
1082
|
+
export interface UpdateResourceScheduleOptions {
|
|
1169
1083
|
/** Fieldmask for schedule */
|
|
1170
1084
|
fieldmask?: string[];
|
|
1171
1085
|
/** The schedule to update */
|
|
@@ -1173,28 +1087,16 @@ export interface UpdateScheduleOptions {
|
|
|
1173
1087
|
}
|
|
1174
1088
|
/**
|
|
1175
1089
|
* Deletes a resource.
|
|
1176
|
-
*
|
|
1090
|
+
*
|
|
1177
1091
|
* The `deleteResource()` function returns a Promise that is resolved when a resource is deleted.
|
|
1178
|
-
* <!--END:ONLY:VELO-->
|
|
1179
|
-
* Deleting a resource updates its `status` to `"DELETED"`.
|
|
1180
1092
|
*
|
|
1181
|
-
* You cannot delete a resource if it has booked sessions.
|
|
1182
1093
|
*
|
|
1183
|
-
*
|
|
1184
|
-
*
|
|
1185
|
-
*
|
|
1186
|
-
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
1187
|
-
* > + 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`.
|
|
1188
|
-
* <!--END:ONLY:VELO-->
|
|
1094
|
+
* Deleting a resource updates its status to `DELETED`.
|
|
1095
|
+
*
|
|
1096
|
+
* You cannot delete a resource if it has booked sessions.
|
|
1189
1097
|
*
|
|
1190
|
-
* <!--ONLY:REST-->
|
|
1191
|
-
* >**Notes:**
|
|
1192
|
-
* > + 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.
|
|
1193
|
-
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
1194
1098
|
*
|
|
1195
|
-
* >**
|
|
1196
|
-
* > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
|
|
1197
|
-
* <!--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.
|
|
1198
1100
|
* @param _id - ID of the resource to delete.
|
|
1199
1101
|
* @public
|
|
1200
1102
|
* @documentationMaturity preview
|