@wix/bookings 1.0.231 → 1.0.233
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 +26 -69
- package/build/cjs/src/bookings-catalog-v1-resource.http.js +26 -101
- 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 -7
- package/build/cjs/src/bookings-catalog-v1-resource.public.js +13 -19
- package/build/cjs/src/bookings-catalog-v1-resource.public.js.map +1 -1
- package/build/cjs/src/bookings-catalog-v1-resource.types.d.ts +0 -307
- package/build/cjs/src/bookings-catalog-v1-resource.universal.d.ts +34 -176
- package/build/cjs/src/bookings-catalog-v1-resource.universal.js +34 -140
- package/build/cjs/src/bookings-catalog-v1-resource.universal.js.map +1 -1
- package/build/es/src/bookings-catalog-v1-resource.http.d.ts +26 -69
- package/build/es/src/bookings-catalog-v1-resource.http.js +25 -99
- 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 -7
- package/build/es/src/bookings-catalog-v1-resource.public.js +9 -14
- package/build/es/src/bookings-catalog-v1-resource.public.js.map +1 -1
- package/build/es/src/bookings-catalog-v1-resource.types.d.ts +0 -307
- package/build/es/src/bookings-catalog-v1-resource.universal.d.ts +34 -176
- package/build/es/src/bookings-catalog-v1-resource.universal.js +29 -134
- package/build/es/src/bookings-catalog-v1-resource.universal.js.map +1 -1
- package/package.json +2 -2
|
@@ -930,313 +930,6 @@ export interface UnLinkResourceFromOwnerResponse {
|
|
|
930
930
|
/** The updated resource. */
|
|
931
931
|
resource?: Resource;
|
|
932
932
|
}
|
|
933
|
-
export interface ListResourcesResponseNonNullableFields {
|
|
934
|
-
resources: {
|
|
935
|
-
images: {
|
|
936
|
-
id: string;
|
|
937
|
-
url: string;
|
|
938
|
-
height: number;
|
|
939
|
-
width: number;
|
|
940
|
-
}[];
|
|
941
|
-
schedules: {
|
|
942
|
-
id: string;
|
|
943
|
-
intervals: {
|
|
944
|
-
id: string;
|
|
945
|
-
interval?: {
|
|
946
|
-
daysOfWeek: Day;
|
|
947
|
-
duration: number;
|
|
948
|
-
};
|
|
949
|
-
affectedSchedules: {
|
|
950
|
-
scheduleId: string;
|
|
951
|
-
transparency: Transparency;
|
|
952
|
-
scheduleOwnerId: string;
|
|
953
|
-
}[];
|
|
954
|
-
intervalType: RecurringIntervalType;
|
|
955
|
-
}[];
|
|
956
|
-
location?: {
|
|
957
|
-
locationType: LocationType;
|
|
958
|
-
customAddress?: {
|
|
959
|
-
streetAddress?: {
|
|
960
|
-
number: string;
|
|
961
|
-
name: string;
|
|
962
|
-
apt: string;
|
|
963
|
-
};
|
|
964
|
-
subdivisions: {
|
|
965
|
-
code: string;
|
|
966
|
-
name: string;
|
|
967
|
-
}[];
|
|
968
|
-
};
|
|
969
|
-
businessLocation?: {
|
|
970
|
-
name: string;
|
|
971
|
-
default: boolean;
|
|
972
|
-
status: LocationStatus;
|
|
973
|
-
locationType: LocationsLocationType;
|
|
974
|
-
address?: {
|
|
975
|
-
streetAddress?: {
|
|
976
|
-
number: string;
|
|
977
|
-
name: string;
|
|
978
|
-
apt: string;
|
|
979
|
-
};
|
|
980
|
-
};
|
|
981
|
-
businessSchedule?: {
|
|
982
|
-
periods: {
|
|
983
|
-
openDay: DayOfWeek;
|
|
984
|
-
openTime: string;
|
|
985
|
-
closeDay: DayOfWeek;
|
|
986
|
-
closeTime: string;
|
|
987
|
-
}[];
|
|
988
|
-
specialHourPeriod: {
|
|
989
|
-
startDate: string;
|
|
990
|
-
endDate: string;
|
|
991
|
-
isClosed: boolean;
|
|
992
|
-
comment: string;
|
|
993
|
-
}[];
|
|
994
|
-
};
|
|
995
|
-
archived: boolean;
|
|
996
|
-
};
|
|
997
|
-
};
|
|
998
|
-
rate?: {
|
|
999
|
-
labeledPriceOptions?: {
|
|
1000
|
-
amount: string;
|
|
1001
|
-
currency: string;
|
|
1002
|
-
downPayAmount: string;
|
|
1003
|
-
};
|
|
1004
|
-
defaultVariedPrice?: {
|
|
1005
|
-
amount: string;
|
|
1006
|
-
currency: string;
|
|
1007
|
-
downPayAmount: string;
|
|
1008
|
-
};
|
|
1009
|
-
};
|
|
1010
|
-
availability?: {
|
|
1011
|
-
linkedSchedules: {
|
|
1012
|
-
scheduleId: string;
|
|
1013
|
-
transparency: Transparency;
|
|
1014
|
-
scheduleOwnerId: string;
|
|
1015
|
-
}[];
|
|
1016
|
-
constraints?: {
|
|
1017
|
-
slotDurations: number[];
|
|
1018
|
-
timeBetweenSlots: number;
|
|
1019
|
-
};
|
|
1020
|
-
locations: {
|
|
1021
|
-
locationType: LocationType;
|
|
1022
|
-
customAddress?: {
|
|
1023
|
-
streetAddress?: {
|
|
1024
|
-
number: string;
|
|
1025
|
-
name: string;
|
|
1026
|
-
apt: string;
|
|
1027
|
-
};
|
|
1028
|
-
subdivisions: {
|
|
1029
|
-
code: string;
|
|
1030
|
-
name: string;
|
|
1031
|
-
}[];
|
|
1032
|
-
};
|
|
1033
|
-
businessLocation?: {
|
|
1034
|
-
name: string;
|
|
1035
|
-
default: boolean;
|
|
1036
|
-
status: LocationStatus;
|
|
1037
|
-
locationType: LocationsLocationType;
|
|
1038
|
-
address?: {
|
|
1039
|
-
streetAddress?: {
|
|
1040
|
-
number: string;
|
|
1041
|
-
name: string;
|
|
1042
|
-
apt: string;
|
|
1043
|
-
};
|
|
1044
|
-
};
|
|
1045
|
-
businessSchedule?: {
|
|
1046
|
-
periods: {
|
|
1047
|
-
openDay: DayOfWeek;
|
|
1048
|
-
openTime: string;
|
|
1049
|
-
closeDay: DayOfWeek;
|
|
1050
|
-
closeTime: string;
|
|
1051
|
-
}[];
|
|
1052
|
-
specialHourPeriod: {
|
|
1053
|
-
startDate: string;
|
|
1054
|
-
endDate: string;
|
|
1055
|
-
isClosed: boolean;
|
|
1056
|
-
comment: string;
|
|
1057
|
-
}[];
|
|
1058
|
-
};
|
|
1059
|
-
archived: boolean;
|
|
1060
|
-
};
|
|
1061
|
-
}[];
|
|
1062
|
-
};
|
|
1063
|
-
totalNumberOfParticipants: number;
|
|
1064
|
-
participants: {
|
|
1065
|
-
id: string;
|
|
1066
|
-
partySize: number;
|
|
1067
|
-
approvalStatus: ApprovalStatus;
|
|
1068
|
-
inherited: boolean;
|
|
1069
|
-
}[];
|
|
1070
|
-
status: ScheduleStatus;
|
|
1071
|
-
version: number;
|
|
1072
|
-
inheritedFields: string[];
|
|
1073
|
-
conferenceProvider?: {
|
|
1074
|
-
providerId: string;
|
|
1075
|
-
};
|
|
1076
|
-
calendarConference?: {
|
|
1077
|
-
id: string;
|
|
1078
|
-
externalId: string;
|
|
1079
|
-
providerId: string;
|
|
1080
|
-
hostUrl: string;
|
|
1081
|
-
guestUrl: string;
|
|
1082
|
-
conferenceType: ConferenceType;
|
|
1083
|
-
};
|
|
1084
|
-
}[];
|
|
1085
|
-
status: ResourceStatus;
|
|
1086
|
-
businessLocation?: {
|
|
1087
|
-
locationId: string;
|
|
1088
|
-
};
|
|
1089
|
-
eventsSchedule?: {
|
|
1090
|
-
id: string;
|
|
1091
|
-
intervals: {
|
|
1092
|
-
id: string;
|
|
1093
|
-
interval?: {
|
|
1094
|
-
daysOfWeek: Day;
|
|
1095
|
-
duration: number;
|
|
1096
|
-
};
|
|
1097
|
-
affectedSchedules: {
|
|
1098
|
-
scheduleId: string;
|
|
1099
|
-
transparency: Transparency;
|
|
1100
|
-
scheduleOwnerId: string;
|
|
1101
|
-
}[];
|
|
1102
|
-
intervalType: RecurringIntervalType;
|
|
1103
|
-
}[];
|
|
1104
|
-
location?: {
|
|
1105
|
-
locationType: LocationType;
|
|
1106
|
-
customAddress?: {
|
|
1107
|
-
streetAddress?: {
|
|
1108
|
-
number: string;
|
|
1109
|
-
name: string;
|
|
1110
|
-
apt: string;
|
|
1111
|
-
};
|
|
1112
|
-
subdivisions: {
|
|
1113
|
-
code: string;
|
|
1114
|
-
name: string;
|
|
1115
|
-
}[];
|
|
1116
|
-
};
|
|
1117
|
-
businessLocation?: {
|
|
1118
|
-
name: string;
|
|
1119
|
-
default: boolean;
|
|
1120
|
-
status: LocationStatus;
|
|
1121
|
-
locationType: LocationsLocationType;
|
|
1122
|
-
address?: {
|
|
1123
|
-
streetAddress?: {
|
|
1124
|
-
number: string;
|
|
1125
|
-
name: string;
|
|
1126
|
-
apt: string;
|
|
1127
|
-
};
|
|
1128
|
-
};
|
|
1129
|
-
businessSchedule?: {
|
|
1130
|
-
periods: {
|
|
1131
|
-
openDay: DayOfWeek;
|
|
1132
|
-
openTime: string;
|
|
1133
|
-
closeDay: DayOfWeek;
|
|
1134
|
-
closeTime: string;
|
|
1135
|
-
}[];
|
|
1136
|
-
specialHourPeriod: {
|
|
1137
|
-
startDate: string;
|
|
1138
|
-
endDate: string;
|
|
1139
|
-
isClosed: boolean;
|
|
1140
|
-
comment: string;
|
|
1141
|
-
}[];
|
|
1142
|
-
};
|
|
1143
|
-
archived: boolean;
|
|
1144
|
-
};
|
|
1145
|
-
};
|
|
1146
|
-
rate?: {
|
|
1147
|
-
labeledPriceOptions?: {
|
|
1148
|
-
amount: string;
|
|
1149
|
-
currency: string;
|
|
1150
|
-
downPayAmount: string;
|
|
1151
|
-
};
|
|
1152
|
-
defaultVariedPrice?: {
|
|
1153
|
-
amount: string;
|
|
1154
|
-
currency: string;
|
|
1155
|
-
downPayAmount: string;
|
|
1156
|
-
};
|
|
1157
|
-
};
|
|
1158
|
-
availability?: {
|
|
1159
|
-
linkedSchedules: {
|
|
1160
|
-
scheduleId: string;
|
|
1161
|
-
transparency: Transparency;
|
|
1162
|
-
scheduleOwnerId: string;
|
|
1163
|
-
}[];
|
|
1164
|
-
constraints?: {
|
|
1165
|
-
slotDurations: number[];
|
|
1166
|
-
timeBetweenSlots: number;
|
|
1167
|
-
};
|
|
1168
|
-
locations: {
|
|
1169
|
-
locationType: LocationType;
|
|
1170
|
-
customAddress?: {
|
|
1171
|
-
streetAddress?: {
|
|
1172
|
-
number: string;
|
|
1173
|
-
name: string;
|
|
1174
|
-
apt: string;
|
|
1175
|
-
};
|
|
1176
|
-
subdivisions: {
|
|
1177
|
-
code: string;
|
|
1178
|
-
name: string;
|
|
1179
|
-
}[];
|
|
1180
|
-
};
|
|
1181
|
-
businessLocation?: {
|
|
1182
|
-
name: string;
|
|
1183
|
-
default: boolean;
|
|
1184
|
-
status: LocationStatus;
|
|
1185
|
-
locationType: LocationsLocationType;
|
|
1186
|
-
address?: {
|
|
1187
|
-
streetAddress?: {
|
|
1188
|
-
number: string;
|
|
1189
|
-
name: string;
|
|
1190
|
-
apt: string;
|
|
1191
|
-
};
|
|
1192
|
-
};
|
|
1193
|
-
businessSchedule?: {
|
|
1194
|
-
periods: {
|
|
1195
|
-
openDay: DayOfWeek;
|
|
1196
|
-
openTime: string;
|
|
1197
|
-
closeDay: DayOfWeek;
|
|
1198
|
-
closeTime: string;
|
|
1199
|
-
}[];
|
|
1200
|
-
specialHourPeriod: {
|
|
1201
|
-
startDate: string;
|
|
1202
|
-
endDate: string;
|
|
1203
|
-
isClosed: boolean;
|
|
1204
|
-
comment: string;
|
|
1205
|
-
}[];
|
|
1206
|
-
};
|
|
1207
|
-
archived: boolean;
|
|
1208
|
-
};
|
|
1209
|
-
}[];
|
|
1210
|
-
};
|
|
1211
|
-
totalNumberOfParticipants: number;
|
|
1212
|
-
participants: {
|
|
1213
|
-
id: string;
|
|
1214
|
-
partySize: number;
|
|
1215
|
-
approvalStatus: ApprovalStatus;
|
|
1216
|
-
inherited: boolean;
|
|
1217
|
-
}[];
|
|
1218
|
-
status: ScheduleStatus;
|
|
1219
|
-
version: number;
|
|
1220
|
-
inheritedFields: string[];
|
|
1221
|
-
conferenceProvider?: {
|
|
1222
|
-
providerId: string;
|
|
1223
|
-
};
|
|
1224
|
-
calendarConference?: {
|
|
1225
|
-
id: string;
|
|
1226
|
-
externalId: string;
|
|
1227
|
-
providerId: string;
|
|
1228
|
-
hostUrl: string;
|
|
1229
|
-
guestUrl: string;
|
|
1230
|
-
conferenceType: ConferenceType;
|
|
1231
|
-
};
|
|
1232
|
-
};
|
|
1233
|
-
}[];
|
|
1234
|
-
metadata?: {
|
|
1235
|
-
items: number;
|
|
1236
|
-
offset: number;
|
|
1237
|
-
totalCount: number;
|
|
1238
|
-
};
|
|
1239
|
-
}
|
|
1240
933
|
export interface QueryResourcesResponseNonNullableFields {
|
|
1241
934
|
resources: {
|
|
1242
935
|
images: {
|
|
@@ -924,86 +924,6 @@ export interface UnLinkResourceFromOwnerResponse {
|
|
|
924
924
|
/** The updated resource. */
|
|
925
925
|
resource?: Resource;
|
|
926
926
|
}
|
|
927
|
-
export interface ListResourcesResponseNonNullableFields {
|
|
928
|
-
resources: {
|
|
929
|
-
images: string;
|
|
930
|
-
schedules: {
|
|
931
|
-
_id: string;
|
|
932
|
-
intervals: {
|
|
933
|
-
_id: string;
|
|
934
|
-
interval?: {
|
|
935
|
-
daysOfWeek: Day;
|
|
936
|
-
duration: number;
|
|
937
|
-
};
|
|
938
|
-
affectedSchedules: {
|
|
939
|
-
scheduleId: string;
|
|
940
|
-
transparency: Transparency;
|
|
941
|
-
scheduleOwnerId: string;
|
|
942
|
-
}[];
|
|
943
|
-
intervalType: RecurringIntervalType;
|
|
944
|
-
}[];
|
|
945
|
-
location?: {
|
|
946
|
-
locationType: LocationType;
|
|
947
|
-
customAddress?: {
|
|
948
|
-
streetAddress?: {
|
|
949
|
-
number: string;
|
|
950
|
-
name: string;
|
|
951
|
-
apt: string;
|
|
952
|
-
};
|
|
953
|
-
subdivisions: {
|
|
954
|
-
code: string;
|
|
955
|
-
name: string;
|
|
956
|
-
}[];
|
|
957
|
-
};
|
|
958
|
-
};
|
|
959
|
-
rate?: {
|
|
960
|
-
labeledPriceOptions?: {
|
|
961
|
-
amount: string;
|
|
962
|
-
currency: string;
|
|
963
|
-
downPayAmount: string;
|
|
964
|
-
};
|
|
965
|
-
};
|
|
966
|
-
availability?: {
|
|
967
|
-
linkedSchedules: {
|
|
968
|
-
scheduleId: string;
|
|
969
|
-
transparency: Transparency;
|
|
970
|
-
scheduleOwnerId: string;
|
|
971
|
-
}[];
|
|
972
|
-
constraints?: {
|
|
973
|
-
slotDurations: number[];
|
|
974
|
-
timeBetweenSlots: number;
|
|
975
|
-
};
|
|
976
|
-
};
|
|
977
|
-
totalNumberOfParticipants: number;
|
|
978
|
-
participants: {
|
|
979
|
-
_id: string;
|
|
980
|
-
partySize: number;
|
|
981
|
-
approvalStatus: ApprovalStatus;
|
|
982
|
-
inherited: boolean;
|
|
983
|
-
}[];
|
|
984
|
-
status: ScheduleStatus;
|
|
985
|
-
version: number;
|
|
986
|
-
inheritedFields: string[];
|
|
987
|
-
conferenceProvider?: {
|
|
988
|
-
providerId: string;
|
|
989
|
-
};
|
|
990
|
-
calendarConference?: {
|
|
991
|
-
_id: string;
|
|
992
|
-
externalId: string;
|
|
993
|
-
providerId: string;
|
|
994
|
-
hostUrl: string;
|
|
995
|
-
guestUrl: string;
|
|
996
|
-
conferenceType: ConferenceType;
|
|
997
|
-
};
|
|
998
|
-
}[];
|
|
999
|
-
status: ResourceStatus;
|
|
1000
|
-
}[];
|
|
1001
|
-
metadata?: {
|
|
1002
|
-
items: number;
|
|
1003
|
-
offset: number;
|
|
1004
|
-
totalCount: number;
|
|
1005
|
-
};
|
|
1006
|
-
}
|
|
1007
927
|
export interface QueryResourcesResponseNonNullableFields {
|
|
1008
928
|
resources: {
|
|
1009
929
|
images: string;
|
|
@@ -1512,21 +1432,6 @@ export interface UpdateScheduleResponseNonNullableFields {
|
|
|
1512
1432
|
export interface DeleteResourceResponseNonNullableFields {
|
|
1513
1433
|
_id: string;
|
|
1514
1434
|
}
|
|
1515
|
-
/**
|
|
1516
|
-
* @internal
|
|
1517
|
-
* @public
|
|
1518
|
-
* @permissionScope Manage Bookings Services and Settings
|
|
1519
|
-
* @permissionScope Read Bookings - Public Data
|
|
1520
|
-
* @permissionScope Read bookings calendar - including participants
|
|
1521
|
-
* @permissionScope Read Bookings Calendar
|
|
1522
|
-
* @applicableIdentity APP
|
|
1523
|
-
* @applicableIdentity MEMBER
|
|
1524
|
-
* @applicableIdentity VISITOR
|
|
1525
|
-
*/
|
|
1526
|
-
export declare function list(options?: ListOptions): Promise<ListResourcesResponse & ListResourcesResponseNonNullableFields>;
|
|
1527
|
-
export interface ListOptions {
|
|
1528
|
-
query?: Query;
|
|
1529
|
-
}
|
|
1530
1435
|
/**
|
|
1531
1436
|
* Retrieves a list of the resources according to the specified filters and paging.
|
|
1532
1437
|
*
|
|
@@ -1559,54 +1464,33 @@ export interface ListOptions {
|
|
|
1559
1464
|
* @applicableIdentity MEMBER
|
|
1560
1465
|
* @applicableIdentity VISITOR
|
|
1561
1466
|
*/
|
|
1562
|
-
export declare function
|
|
1563
|
-
export interface
|
|
1467
|
+
export declare function queryResources(options?: QueryResourcesOptions): Promise<QueryResourcesResponse & QueryResourcesResponseNonNullableFields>;
|
|
1468
|
+
export interface QueryResourcesOptions {
|
|
1564
1469
|
query?: QueryV2;
|
|
1565
1470
|
}
|
|
1566
1471
|
/**
|
|
1567
1472
|
* Creates a resource.
|
|
1568
|
-
* <!--ONLY:VELO
|
|
1569
|
-
* The `createResource()` function returns a Promise that resolves to the created resource.
|
|
1570
|
-
* <!--END:ONLY:VELO-->
|
|
1571
1473
|
*
|
|
1572
|
-
* 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.
|
|
1573
|
-
* 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.
|
|
1574
|
-
* You can use both individual and recurring sessions to define resource availability. You cannot use availability constraints for resource schedules.
|
|
1575
1474
|
*
|
|
1576
|
-
*
|
|
1577
|
-
*
|
|
1578
|
-
* + 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.
|
|
1579
|
-
* + 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.
|
|
1580
|
-
* + You can have both default business hours and custom hours for the same resource schedule by combining the steps above.
|
|
1581
|
-
*
|
|
1582
|
-
* > **Notes:**
|
|
1583
|
-
* > + 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.
|
|
1584
|
-
* > + The Wix Bookings app does not show non-recurring `WORKING_HOURS` sessions in the resource calendar.
|
|
1585
|
-
* > + You can only add the business resource's schedule as a linked schedule for a resource.
|
|
1586
|
-
* > + A resource can have one schedule only.
|
|
1587
|
-
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
1588
|
-
* > + 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`.
|
|
1589
|
-
* <!--END:ONLY:VELO-->
|
|
1590
|
-
*
|
|
1591
|
-
* <!--ONLY:REST-->
|
|
1592
|
-
* Use the following steps to create resources:
|
|
1593
|
-
* - Create the resource using including schedule information.
|
|
1594
|
-
* - 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.
|
|
1595
|
-
* - 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.
|
|
1475
|
+
* The `createResource()` function returns a Promise that resolves to the created resource.
|
|
1476
|
+
* 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.
|
|
1596
1477
|
*
|
|
1597
|
-
* >**Notes:**
|
|
1598
|
-
* > + A resource can have one schedule only.
|
|
1599
|
-
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
1600
|
-
* > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
|
|
1601
1478
|
*
|
|
1479
|
+
* When creating a resource using `createResource()`, include the resource's schedule information. Set the schedule information as follows:
|
|
1480
|
+
* - 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.
|
|
1481
|
+
* - If the resource has its own custom working hours, create the resource, then create sessions of type `WORKING_HOURS` using the [`createSession()`](wix-bookings-v2/sessions/createsession) function. Use the `scheduleId` returned from `createResource()` when creating the sessions. These session can be single sessions or recurring sessions.
|
|
1482
|
+
* - You can have both default business hours and custom hours for the same resource schedule by combining the steps above.
|
|
1602
1483
|
*
|
|
1603
1484
|
*
|
|
1604
|
-
*
|
|
1605
|
-
*
|
|
1606
|
-
*
|
|
1485
|
+
* > **Notes:**
|
|
1486
|
+
* - 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.
|
|
1487
|
+
* - The Wix Bookings app does not show non-recurring `WORKING_HOURS` sessions in the resource calendar.
|
|
1488
|
+
* - You can only add the business resource's schedule as a linked schedule for a resource.
|
|
1489
|
+
* - A resource can have one schedule only.
|
|
1490
|
+
* - You can have up to 135 active resources and an additional 135 deleted resources.
|
|
1491
|
+
* - Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can create a resource.
|
|
1607
1492
|
* @param resource - Resource details.
|
|
1608
1493
|
* @public
|
|
1609
|
-
* @documentationMaturity preview
|
|
1610
1494
|
* @requiredField options.schedules.availability.start
|
|
1611
1495
|
* @requiredField options.schedules.intervals.start
|
|
1612
1496
|
* @requiredField resource
|
|
@@ -1614,8 +1498,8 @@ export interface QueryOptions {
|
|
|
1614
1498
|
* @permissionScope Manage Bookings
|
|
1615
1499
|
* @applicableIdentity APP
|
|
1616
1500
|
*/
|
|
1617
|
-
export declare function
|
|
1618
|
-
export interface
|
|
1501
|
+
export declare function createResource(resource: Resource, options?: CreateResourceOptions): Promise<CreateResourceResponse & CreateResourceResponseNonNullableFields>;
|
|
1502
|
+
export interface CreateResourceOptions {
|
|
1619
1503
|
/**
|
|
1620
1504
|
* List of schedules to be assigned for the created resource. Currently only a single schedule is allowed.
|
|
1621
1505
|
* If provided, any schedules in the resource entity will be ignored.
|
|
@@ -1624,35 +1508,22 @@ export interface CreateOptions {
|
|
|
1624
1508
|
}
|
|
1625
1509
|
/**
|
|
1626
1510
|
* Updates a resource.
|
|
1627
|
-
* <!--ONLY:VELO
|
|
1628
|
-
* The `updateResource()` function returns a Promise that resolves when a resource is updated.
|
|
1629
|
-
* 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).
|
|
1630
1511
|
*
|
|
1631
|
-
* >**Notes:**
|
|
1632
|
-
* > + 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"`.
|
|
1633
|
-
* > + 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`.
|
|
1634
|
-
* <!--END:ONLY:VELO-->
|
|
1635
|
-
* <!--ONLY:REST-->
|
|
1636
|
-
* Use this endpoint to update all resource information except for the resource's schedule. To update a resource's schedule use
|
|
1637
|
-
* the [Update Schedule](https://dev.wix.com/api/rest/wix-bookings/resources/update-schedule) endpoint.
|
|
1638
1512
|
*
|
|
1639
|
-
*
|
|
1640
|
-
* > + 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"`.
|
|
1641
|
-
* > + 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”`.
|
|
1642
|
-
* > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
|
|
1513
|
+
* 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()`](#updateresourceschedule).
|
|
1643
1514
|
*
|
|
1644
|
-
*
|
|
1645
|
-
*
|
|
1646
|
-
*
|
|
1515
|
+
*
|
|
1516
|
+
* >**Notes:**
|
|
1517
|
+
* - 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"`.
|
|
1518
|
+
* - Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can update a resource.
|
|
1647
1519
|
* @param _id - Resource ID.
|
|
1648
1520
|
* @public
|
|
1649
|
-
* @documentationMaturity preview
|
|
1650
1521
|
* @requiredField _id
|
|
1651
1522
|
* @permissionScope Manage Bookings
|
|
1652
1523
|
* @applicableIdentity APP
|
|
1653
1524
|
*/
|
|
1654
|
-
export declare function
|
|
1655
|
-
export interface
|
|
1525
|
+
export declare function updateResource(_id: string | null, options?: UpdateResourceOptions): Promise<UpdateResourceResponse & UpdateResourceResponseNonNullableFields>;
|
|
1526
|
+
export interface UpdateResourceOptions {
|
|
1656
1527
|
resource: {
|
|
1657
1528
|
/**
|
|
1658
1529
|
* Resource ID.
|
|
@@ -1667,17 +1538,13 @@ export interface UpdateOptions {
|
|
|
1667
1538
|
phone?: string | null;
|
|
1668
1539
|
/** Resource description. */
|
|
1669
1540
|
description?: string | null;
|
|
1670
|
-
/**
|
|
1671
|
-
* @internal
|
|
1672
|
-
* @internal */
|
|
1541
|
+
/** @internal */
|
|
1673
1542
|
tag?: string | null;
|
|
1674
1543
|
/** Resource tags. Tags are used to identify, group, and filter the different types of resources. For example, 'staff' or 'room'. */
|
|
1675
1544
|
tags?: string[] | null;
|
|
1676
1545
|
/** Resource images. */
|
|
1677
1546
|
images?: string[];
|
|
1678
|
-
/**
|
|
1679
|
-
* @internal
|
|
1680
|
-
* @internal */
|
|
1547
|
+
/** @internal */
|
|
1681
1548
|
schedules?: Schedule[];
|
|
1682
1549
|
/**
|
|
1683
1550
|
* List of IDs of schedules owned by this resource.
|
|
@@ -1777,28 +1644,19 @@ export interface UpdateScheduleOptions {
|
|
|
1777
1644
|
}
|
|
1778
1645
|
/**
|
|
1779
1646
|
* Deletes a resource.
|
|
1780
|
-
*
|
|
1647
|
+
*
|
|
1781
1648
|
* The `deleteResource()` function returns a Promise that is resolved when a resource is deleted.
|
|
1782
|
-
*
|
|
1783
|
-
*
|
|
1649
|
+
*
|
|
1650
|
+
*
|
|
1651
|
+
* Deleting a resource updates its status to `DELETED`.
|
|
1784
1652
|
*
|
|
1785
1653
|
* You cannot delete a resource if it has booked sessions.
|
|
1786
1654
|
*
|
|
1787
|
-
* <!--ONLY:VELO
|
|
1788
|
-
* >**Notes:**
|
|
1789
|
-
* > + 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.
|
|
1790
|
-
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
1791
|
-
* > + 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`.
|
|
1792
|
-
* <!--END:ONLY:VELO-->
|
|
1793
1655
|
*
|
|
1794
|
-
* <!--ONLY:REST-->
|
|
1795
1656
|
* >**Notes:**
|
|
1796
|
-
*
|
|
1797
|
-
*
|
|
1798
|
-
*
|
|
1799
|
-
* >**Permissions:**
|
|
1800
|
-
* > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
|
|
1801
|
-
* <!--END:ONLY:REST-->
|
|
1657
|
+
* - 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.
|
|
1658
|
+
* - You can have up to 135 active resources and an additional 135 deleted resources.
|
|
1659
|
+
* - Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can delete a resource.
|
|
1802
1660
|
* @param _id - ID of the resource to delete.
|
|
1803
1661
|
* @public
|
|
1804
1662
|
* @documentationMaturity preview
|
|
@@ -1806,4 +1664,4 @@ export interface UpdateScheduleOptions {
|
|
|
1806
1664
|
* @permissionScope Manage Bookings
|
|
1807
1665
|
* @applicableIdentity APP
|
|
1808
1666
|
*/
|
|
1809
|
-
export declare function
|
|
1667
|
+
export declare function deleteResource(_id: string): Promise<DeleteResourceResponse & DeleteResourceResponseNonNullableFields>;
|