@wix/auto_sdk_bookings_resources 1.0.0 → 1.0.2
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-resources-v2-resource-resources.context.d.ts +2 -6
- package/build/cjs/src/bookings-resources-v2-resource-resources.context.js +2 -6
- package/build/cjs/src/bookings-resources-v2-resource-resources.context.js.map +1 -1
- package/build/cjs/src/bookings-resources-v2-resource-resources.http.d.ts +47 -17
- package/build/cjs/src/bookings-resources-v2-resource-resources.http.js +46 -16
- package/build/cjs/src/bookings-resources-v2-resource-resources.http.js.map +1 -1
- package/build/cjs/src/bookings-resources-v2-resource-resources.public.d.ts +47 -23
- package/build/cjs/src/bookings-resources-v2-resource-resources.public.js.map +1 -1
- package/build/cjs/src/bookings-resources-v2-resource-resources.types.d.ts +110 -64
- package/build/cjs/src/bookings-resources-v2-resource-resources.types.js.map +1 -1
- package/build/cjs/src/bookings-resources-v2-resource-resources.universal.d.ts +197 -105
- package/build/cjs/src/bookings-resources-v2-resource-resources.universal.js +46 -22
- package/build/cjs/src/bookings-resources-v2-resource-resources.universal.js.map +1 -1
- package/build/es/src/bookings-resources-v2-resource-resources.context.d.ts +2 -6
- package/build/es/src/bookings-resources-v2-resource-resources.context.js +2 -6
- package/build/es/src/bookings-resources-v2-resource-resources.context.js.map +1 -1
- package/build/es/src/bookings-resources-v2-resource-resources.http.d.ts +47 -17
- package/build/es/src/bookings-resources-v2-resource-resources.http.js +46 -16
- package/build/es/src/bookings-resources-v2-resource-resources.http.js.map +1 -1
- package/build/es/src/bookings-resources-v2-resource-resources.public.d.ts +47 -23
- package/build/es/src/bookings-resources-v2-resource-resources.public.js.map +1 -1
- package/build/es/src/bookings-resources-v2-resource-resources.types.d.ts +110 -64
- package/build/es/src/bookings-resources-v2-resource-resources.types.js.map +1 -1
- package/build/es/src/bookings-resources-v2-resource-resources.universal.d.ts +197 -105
- package/build/es/src/bookings-resources-v2-resource-resources.universal.js +46 -22
- package/build/es/src/bookings-resources-v2-resource-resources.universal.js.map +1 -1
- package/build/internal/cjs/src/bookings-resources-v2-resource-resources.context.d.ts +2 -6
- package/build/internal/cjs/src/bookings-resources-v2-resource-resources.context.js +2 -6
- package/build/internal/cjs/src/bookings-resources-v2-resource-resources.context.js.map +1 -1
- package/build/internal/cjs/src/bookings-resources-v2-resource-resources.http.d.ts +47 -17
- package/build/internal/cjs/src/bookings-resources-v2-resource-resources.http.js +46 -16
- package/build/internal/cjs/src/bookings-resources-v2-resource-resources.http.js.map +1 -1
- package/build/internal/cjs/src/bookings-resources-v2-resource-resources.public.d.ts +47 -23
- package/build/internal/cjs/src/bookings-resources-v2-resource-resources.public.js.map +1 -1
- package/build/internal/cjs/src/bookings-resources-v2-resource-resources.types.d.ts +110 -64
- package/build/internal/cjs/src/bookings-resources-v2-resource-resources.types.js.map +1 -1
- package/build/internal/cjs/src/bookings-resources-v2-resource-resources.universal.d.ts +197 -105
- package/build/internal/cjs/src/bookings-resources-v2-resource-resources.universal.js +46 -22
- package/build/internal/cjs/src/bookings-resources-v2-resource-resources.universal.js.map +1 -1
- package/build/internal/es/src/bookings-resources-v2-resource-resources.context.d.ts +2 -6
- package/build/internal/es/src/bookings-resources-v2-resource-resources.context.js +2 -6
- package/build/internal/es/src/bookings-resources-v2-resource-resources.context.js.map +1 -1
- package/build/internal/es/src/bookings-resources-v2-resource-resources.http.d.ts +47 -17
- package/build/internal/es/src/bookings-resources-v2-resource-resources.http.js +46 -16
- package/build/internal/es/src/bookings-resources-v2-resource-resources.http.js.map +1 -1
- package/build/internal/es/src/bookings-resources-v2-resource-resources.public.d.ts +47 -23
- package/build/internal/es/src/bookings-resources-v2-resource-resources.public.js.map +1 -1
- package/build/internal/es/src/bookings-resources-v2-resource-resources.types.d.ts +110 -64
- package/build/internal/es/src/bookings-resources-v2-resource-resources.types.js.map +1 -1
- package/build/internal/es/src/bookings-resources-v2-resource-resources.universal.d.ts +197 -105
- package/build/internal/es/src/bookings-resources-v2-resource-resources.universal.js +46 -22
- package/build/internal/es/src/bookings-resources-v2-resource-resources.universal.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A resource represents an entity
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* A resource represents an entity, such as a room or a staff member, that can be
|
|
3
|
+
* scheduled for use in a *booking*
|
|
4
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/about-the-bookings-apis)).
|
|
5
|
+
* The availability of a resource is tracked to ensure that it
|
|
6
|
+
* can be allocated at a requested time slot and to prevent double bookings.
|
|
5
7
|
*/
|
|
6
8
|
export interface Resource extends ResourceCompositionDetailsOneOf {
|
|
7
9
|
/**
|
|
@@ -17,35 +19,42 @@ export interface Resource extends ResourceCompositionDetailsOneOf {
|
|
|
17
19
|
*/
|
|
18
20
|
revision?: string | null;
|
|
19
21
|
/**
|
|
20
|
-
*
|
|
22
|
+
* Time in `YYYY-MM-DDThh:mm:ss.sssZ` format the resource was created.
|
|
21
23
|
* @readonly
|
|
22
24
|
*/
|
|
23
25
|
_createdDate?: Date | null;
|
|
24
26
|
/**
|
|
25
|
-
*
|
|
27
|
+
* Time in `YYYY-MM-DDThh:mm:ss.sssZ` format the resource was last updated.
|
|
26
28
|
* @readonly
|
|
27
29
|
*/
|
|
28
30
|
_updatedDate?: Date | null;
|
|
29
31
|
/** Name of the resource. */
|
|
30
32
|
name?: string | null;
|
|
31
33
|
/**
|
|
32
|
-
* ID of the
|
|
34
|
+
* ID of the *resource type*
|
|
35
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/resource-types/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resource-types-v2/introduction)).
|
|
33
36
|
*
|
|
34
37
|
* Once a type has been set it can't be modified. You can create a resource
|
|
35
|
-
* without specifying a type. However,
|
|
38
|
+
* without specifying a type. However, customers can't book such resources.
|
|
36
39
|
*/
|
|
37
40
|
typeId?: string | null;
|
|
38
41
|
/**
|
|
39
|
-
*
|
|
42
|
+
* Information about the *schedule*
|
|
43
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/schedules/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction))
|
|
44
|
+
* specifying the working hours and locations of the resource.
|
|
40
45
|
*
|
|
41
|
-
* Resources without
|
|
42
|
-
*
|
|
46
|
+
* Resources without a working hour schedule are available 24/7 at the locations
|
|
47
|
+
* specified in the field `locationOptions`.
|
|
48
|
+
* When both `workingHoursSchedules` and `locationOptions` are set,
|
|
49
|
+
* `workingHoursSchedules` takes precedence.
|
|
43
50
|
*/
|
|
44
51
|
workingHoursSchedules?: WorkingHoursSchedules;
|
|
45
|
-
/**
|
|
52
|
+
/** Information about the location where the resource is available. */
|
|
46
53
|
locationOptions?: LocationOptions;
|
|
47
54
|
/**
|
|
48
|
-
*
|
|
55
|
+
* Schedule containing the *events*
|
|
56
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/events/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction))
|
|
57
|
+
* for which the resource has been booked.
|
|
49
58
|
* @readonly
|
|
50
59
|
*/
|
|
51
60
|
eventsSchedule?: EventsSchedule;
|
|
@@ -56,13 +65,15 @@ export interface Resource extends ResourceCompositionDetailsOneOf {
|
|
|
56
65
|
export interface ResourceCompositionDetailsOneOf {
|
|
57
66
|
}
|
|
58
67
|
export interface WorkingHoursSchedule {
|
|
59
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* ID of the working hour *schedule*
|
|
70
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/schedules/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction)).
|
|
71
|
+
*/
|
|
60
72
|
scheduleId?: string | null;
|
|
61
73
|
/**
|
|
62
|
-
* Whether
|
|
74
|
+
* Whether the schedule is shared by multiple resources or unique for this resource.
|
|
63
75
|
*
|
|
64
|
-
*
|
|
65
|
-
* Default: `false`.
|
|
76
|
+
* Default: `false`
|
|
66
77
|
* @readonly
|
|
67
78
|
*/
|
|
68
79
|
shared?: boolean | null;
|
|
@@ -71,25 +82,29 @@ export interface SingleResource {
|
|
|
71
82
|
/**
|
|
72
83
|
* Schedule details that specify the working hours and locations of this resource.
|
|
73
84
|
*
|
|
74
|
-
* When this field is
|
|
75
|
-
*
|
|
76
|
-
* `
|
|
85
|
+
* When this field is missing or empty, the resource is assumed to be available
|
|
86
|
+
* around the clock (24/7) at the locations specified in `locationOptions`. When
|
|
87
|
+
* both `workingHoursSchedules` and `locationOptions` are set,
|
|
88
|
+
* `workingHoursSchedules` takes precedence.
|
|
77
89
|
*/
|
|
78
90
|
workingHoursSchedules?: V2WorkingHoursSchedules;
|
|
79
91
|
/**
|
|
80
|
-
*
|
|
92
|
+
* Information about the location where the resource is available.
|
|
81
93
|
*
|
|
82
|
-
* If
|
|
94
|
+
* If you don't specify `locationOptions`, Wix Bookings automatically sets
|
|
95
|
+
* `{"availableInAllLocations": true}`.
|
|
83
96
|
*/
|
|
84
97
|
locationOptions?: LocationOptions;
|
|
85
98
|
/**
|
|
86
|
-
*
|
|
99
|
+
* Schedule containing the *events*
|
|
100
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/events/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction))
|
|
101
|
+
* for which the resource has been booked.
|
|
87
102
|
* @readonly
|
|
88
103
|
*/
|
|
89
104
|
eventsSchedule?: Schedule;
|
|
90
105
|
}
|
|
91
106
|
export interface V2WorkingHoursSchedules {
|
|
92
|
-
/**
|
|
107
|
+
/** Schedules specifying the working hours of the resource. Currently, only a single schedule is supported. */
|
|
93
108
|
values?: Schedule[];
|
|
94
109
|
}
|
|
95
110
|
/** Deprecated and subject to removal */
|
|
@@ -106,39 +121,53 @@ export interface Schedule {
|
|
|
106
121
|
}
|
|
107
122
|
export interface LocationOptions {
|
|
108
123
|
/**
|
|
109
|
-
*
|
|
124
|
+
* Whether the resource is available in all *business locations*
|
|
125
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/about-service-locations#backend-modules_bookings_services_location-types) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-locations#location-types)).
|
|
126
|
+
*
|
|
127
|
+
* - `true`: The resource is available in all business locations.
|
|
128
|
+
* - `false`: The resource is available only in specific locations.
|
|
129
|
+
*
|
|
110
130
|
* Default: `false`
|
|
111
131
|
*/
|
|
112
132
|
availableInAllLocations?: boolean | null;
|
|
113
|
-
/**
|
|
114
|
-
* Details of specific locations. It must be left empty if `availableInAllLocations` is `true`.
|
|
115
|
-
* If supplied then the field `specificLocationOptions.availableInBusinessLocations` must be set to `true`.
|
|
116
|
-
*/
|
|
133
|
+
/** Details of resource availability in specific locations. */
|
|
117
134
|
specificLocationOptions?: SpecificLocation;
|
|
118
135
|
}
|
|
119
136
|
export interface SpecificLocation {
|
|
120
137
|
/**
|
|
121
|
-
*
|
|
138
|
+
* Whether the resource is available in *business locations*
|
|
139
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/about-service-locations#backend-modules_bookings_services_location-types) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-locations#location-types)).
|
|
140
|
+
*
|
|
141
|
+
* - `true`: The resource is available in business locations.
|
|
142
|
+
* - `false`: The resource isn't available in business locations.
|
|
122
143
|
*
|
|
123
144
|
* Default: `false`
|
|
124
145
|
*/
|
|
125
146
|
availableInBusinessLocations?: boolean | null;
|
|
126
147
|
/**
|
|
127
|
-
* Information about business locations
|
|
128
|
-
*
|
|
148
|
+
* Information about the business locations where the resource is available.
|
|
149
|
+
* Not returned, if the resource is available in either all business locations
|
|
150
|
+
* or in no business location.
|
|
151
|
+
* You can specify up to 5 business locations.
|
|
129
152
|
*/
|
|
130
153
|
businessLocations?: BusinessLocation[];
|
|
131
154
|
}
|
|
132
155
|
export interface BusinessLocation {
|
|
133
|
-
/**
|
|
156
|
+
/**
|
|
157
|
+
* ID of the business *location*
|
|
158
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction)).
|
|
159
|
+
*/
|
|
134
160
|
locationId?: string | null;
|
|
135
161
|
}
|
|
136
162
|
export interface WorkingHoursSchedules {
|
|
137
|
-
/** Schedules specifying
|
|
163
|
+
/** Schedules specifying the working hours of the resource. Currently, only a single schedule is supported. */
|
|
138
164
|
values?: WorkingHoursSchedule[];
|
|
139
165
|
}
|
|
140
166
|
export interface EventsSchedule {
|
|
141
|
-
/**
|
|
167
|
+
/**
|
|
168
|
+
* ID of the event *schedule*
|
|
169
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/schedules/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction)).
|
|
170
|
+
*/
|
|
142
171
|
scheduleId?: string | null;
|
|
143
172
|
}
|
|
144
173
|
export declare enum ManagementType {
|
|
@@ -161,13 +190,17 @@ export interface CreateResourceRequest {
|
|
|
161
190
|
resource: Resource;
|
|
162
191
|
}
|
|
163
192
|
export interface CreateResourceResponse {
|
|
164
|
-
/**
|
|
193
|
+
/** Created resource. */
|
|
165
194
|
resource?: Resource;
|
|
166
195
|
}
|
|
167
196
|
export interface BulkCreateResourcesRequest {
|
|
168
197
|
/** Resources to create. */
|
|
169
198
|
resources: Resource[];
|
|
170
|
-
/**
|
|
199
|
+
/**
|
|
200
|
+
* Whether to include the created resources in the response.
|
|
201
|
+
*
|
|
202
|
+
* Default: `false`
|
|
203
|
+
*/
|
|
171
204
|
returnEntity?: boolean;
|
|
172
205
|
}
|
|
173
206
|
export interface BulkCreateResourcesResponse {
|
|
@@ -177,7 +210,7 @@ export interface BulkCreateResourcesResponse {
|
|
|
177
210
|
bulkActionMetadata?: BulkActionMetadata;
|
|
178
211
|
}
|
|
179
212
|
export interface BulkResourceResult {
|
|
180
|
-
/** Item metadata */
|
|
213
|
+
/** Item metadata. */
|
|
181
214
|
itemMetadata?: ItemMetadata;
|
|
182
215
|
/** The resulting resource after the bulk operation. */
|
|
183
216
|
item?: Resource;
|
|
@@ -213,21 +246,21 @@ export interface GetResourceRequest {
|
|
|
213
246
|
resourceId: string;
|
|
214
247
|
}
|
|
215
248
|
export interface GetResourceResponse {
|
|
216
|
-
/**
|
|
249
|
+
/** Retrieved resource. */
|
|
217
250
|
resource?: Resource;
|
|
218
251
|
}
|
|
219
252
|
export interface GetDeletedResourceRequest {
|
|
220
|
-
/** ID of the resource to retrieve. */
|
|
253
|
+
/** ID of the deleted resource to retrieve from the trash bin. */
|
|
221
254
|
resourceId?: string;
|
|
222
255
|
}
|
|
223
256
|
export interface GetDeletedResourceResponse {
|
|
224
|
-
/**
|
|
257
|
+
/** Retrieved resource. */
|
|
225
258
|
resource?: Resource;
|
|
226
259
|
}
|
|
227
260
|
export interface ListDeletedResourcesRequest {
|
|
228
|
-
/**
|
|
261
|
+
/** IDs of the resources to retrieve. */
|
|
229
262
|
resourceIds?: string[];
|
|
230
|
-
/** Paging
|
|
263
|
+
/** Paging details, allowing you specify a limit and a cursor. */
|
|
231
264
|
paging?: CursorPaging;
|
|
232
265
|
}
|
|
233
266
|
export interface CursorPaging {
|
|
@@ -242,9 +275,9 @@ export interface CursorPaging {
|
|
|
242
275
|
cursor?: string | null;
|
|
243
276
|
}
|
|
244
277
|
export interface ListDeletedResourcesResponse {
|
|
245
|
-
/**
|
|
278
|
+
/** Retrieved resources. */
|
|
246
279
|
resources?: Resource[];
|
|
247
|
-
/** Paging metadata */
|
|
280
|
+
/** Paging metadata. */
|
|
248
281
|
pagingMetadata?: CursorPagingMetadata;
|
|
249
282
|
}
|
|
250
283
|
export interface CursorPagingMetadata {
|
|
@@ -267,7 +300,7 @@ export interface Cursors {
|
|
|
267
300
|
prev?: string | null;
|
|
268
301
|
}
|
|
269
302
|
export interface RemoveResourceFromTrashBinRequest {
|
|
270
|
-
/** ID of the resource to
|
|
303
|
+
/** ID of the resource to permanently delete from the trash bin. */
|
|
271
304
|
resourceId?: string;
|
|
272
305
|
}
|
|
273
306
|
export interface RemoveResourceFromTrashBinResponse {
|
|
@@ -277,15 +310,15 @@ export interface RestoreResourceFromTrashBinRequest {
|
|
|
277
310
|
resourceId?: string;
|
|
278
311
|
}
|
|
279
312
|
export interface RestoreResourceFromTrashBinResponse {
|
|
280
|
-
/**
|
|
313
|
+
/** Restored resource. */
|
|
281
314
|
resource?: Resource;
|
|
282
315
|
}
|
|
283
316
|
export interface UpdateResourceRequest {
|
|
284
|
-
/** Resource to
|
|
317
|
+
/** Resource to update. */
|
|
285
318
|
resource: Resource;
|
|
286
319
|
}
|
|
287
320
|
export interface UpdateResourceResponse {
|
|
288
|
-
/**
|
|
321
|
+
/** Updated resource. */
|
|
289
322
|
resource?: Resource;
|
|
290
323
|
}
|
|
291
324
|
export interface DeleteResourceRequest {
|
|
@@ -295,7 +328,7 @@ export interface DeleteResourceRequest {
|
|
|
295
328
|
export interface DeleteResourceResponse {
|
|
296
329
|
}
|
|
297
330
|
export interface BulkDeleteResourcesRequest {
|
|
298
|
-
/**
|
|
331
|
+
/** IDs of the resources to delete. */
|
|
299
332
|
ids: string[];
|
|
300
333
|
}
|
|
301
334
|
export interface BulkDeleteResourcesResponse {
|
|
@@ -305,7 +338,11 @@ export interface BulkDeleteResourcesResponse {
|
|
|
305
338
|
bulkActionMetadata?: BulkActionMetadata;
|
|
306
339
|
}
|
|
307
340
|
export interface SearchResourcesRequest {
|
|
308
|
-
/**
|
|
341
|
+
/**
|
|
342
|
+
* Search condition. Refer to the *supported filters article*
|
|
343
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/resources/supported-filters) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/filtering-and-sorting))
|
|
344
|
+
* for a complete list of supported filters and sorting options.
|
|
345
|
+
*/
|
|
309
346
|
search?: CursorSearch;
|
|
310
347
|
}
|
|
311
348
|
export interface CursorSearch extends CursorSearchPagingMethodOneOf {
|
|
@@ -558,11 +595,11 @@ export declare enum Mode {
|
|
|
558
595
|
AND = "AND"
|
|
559
596
|
}
|
|
560
597
|
export interface SearchResourcesResponse {
|
|
561
|
-
/**
|
|
598
|
+
/** Retrieved resources. */
|
|
562
599
|
resources?: Resource[];
|
|
563
|
-
/** Paging metadata */
|
|
600
|
+
/** Paging metadata. */
|
|
564
601
|
pagingMetadata?: CursorPagingMetadata;
|
|
565
|
-
/** Aggregation results */
|
|
602
|
+
/** Aggregation results. */
|
|
566
603
|
aggregationData?: AggregationData;
|
|
567
604
|
}
|
|
568
605
|
export interface AggregationData {
|
|
@@ -727,7 +764,11 @@ export interface AggregationResultsResultOneOf {
|
|
|
727
764
|
nested?: NestedResults;
|
|
728
765
|
}
|
|
729
766
|
export interface QueryResourcesRequest {
|
|
730
|
-
/**
|
|
767
|
+
/**
|
|
768
|
+
* Query for retrieving resources. Refer to the *supported filters article*
|
|
769
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/resources/supported-filters) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/filtering-and-sorting))
|
|
770
|
+
* for a complete list of supported filters.
|
|
771
|
+
*/
|
|
731
772
|
query?: CursorQuery;
|
|
732
773
|
}
|
|
733
774
|
export interface CursorQuery extends CursorQueryPagingMethodOneOf {
|
|
@@ -754,40 +795,45 @@ export interface CursorQueryPagingMethodOneOf {
|
|
|
754
795
|
cursorPaging?: CursorPaging;
|
|
755
796
|
}
|
|
756
797
|
export interface QueryResourcesResponse {
|
|
757
|
-
/**
|
|
798
|
+
/** Retrieved resources. */
|
|
758
799
|
resources?: Resource[];
|
|
759
|
-
/** Paging metadata */
|
|
800
|
+
/** Paging metadata. */
|
|
760
801
|
pagingMetadata?: CursorPagingMetadata;
|
|
761
802
|
}
|
|
762
803
|
export interface CountResourcesRequest {
|
|
763
|
-
/**
|
|
804
|
+
/**
|
|
805
|
+
* Filter to base the count on. Refer to the *supported filters article*
|
|
806
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/resources/supported-filters) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/filtering-and-sorting))
|
|
807
|
+
* for a complete list of supported filters.
|
|
808
|
+
*/
|
|
764
809
|
filter?: Record<string, any> | null;
|
|
765
810
|
/**
|
|
766
|
-
*
|
|
811
|
+
* Free text to match in searchable fields. Field is deprecated due to decision to use query instead of search for performing the count.
|
|
812
|
+
* @deprecated Free text to match in searchable fields. Field is deprecated due to decision to use query instead of search for performing the count.
|
|
767
813
|
* @targetRemovalDate 2024-05-01
|
|
768
814
|
*/
|
|
769
815
|
search?: SearchDetails;
|
|
770
816
|
}
|
|
771
817
|
export interface CountResourcesResponse {
|
|
772
|
-
/**
|
|
818
|
+
/** Total number of resources matching the filter. */
|
|
773
819
|
count?: number;
|
|
774
820
|
}
|
|
775
821
|
export interface ImportResourceRequest {
|
|
776
|
-
/** Resource to
|
|
822
|
+
/** Resource to import. */
|
|
777
823
|
resource?: Resource;
|
|
778
824
|
}
|
|
779
825
|
export interface ImportResourceResponse {
|
|
780
|
-
/**
|
|
826
|
+
/** Imported resource. */
|
|
781
827
|
resource?: Resource;
|
|
782
828
|
}
|
|
783
829
|
export interface FixResourceSchedulesRequest {
|
|
784
|
-
/**
|
|
830
|
+
/** ID of the resource to fix schedules for. */
|
|
785
831
|
resourceId?: string;
|
|
786
|
-
/**
|
|
832
|
+
/** Working hour schedule that must be set for this resource. */
|
|
787
833
|
workingHoursSchedule?: Schedule;
|
|
788
834
|
}
|
|
789
835
|
export interface FixResourceSchedulesResponse {
|
|
790
|
-
/**
|
|
836
|
+
/** Updated resource. */
|
|
791
837
|
resource?: Resource;
|
|
792
838
|
}
|
|
793
839
|
export interface ReindexTenantRequest {
|
|
@@ -1057,11 +1103,11 @@ export interface ResourceCreatedEnvelope {
|
|
|
1057
1103
|
metadata: EventMetadata;
|
|
1058
1104
|
}
|
|
1059
1105
|
/**
|
|
1060
|
-
* Triggered
|
|
1061
|
-
*
|
|
1062
|
-
* This event has the same structure as [Resource Created](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members-and-resources/resource-v2/create-resource#resource-created).
|
|
1106
|
+
* Triggered when a resource is created.
|
|
1063
1107
|
* @webhook
|
|
1064
1108
|
* @eventType wix.bookings.resources.v2.resource_created
|
|
1109
|
+
* @serviceIdentifier wix.bookings.resources.v2.ResourcesService
|
|
1110
|
+
* @slug created
|
|
1065
1111
|
* @documentationMaturity preview
|
|
1066
1112
|
*/
|
|
1067
1113
|
export declare function onResourceCreated(handler: (event: ResourceCreatedEnvelope) => void | Promise<void>): void;
|
|
@@ -1069,11 +1115,11 @@ export interface ResourceDeletedEnvelope {
|
|
|
1069
1115
|
metadata: EventMetadata;
|
|
1070
1116
|
}
|
|
1071
1117
|
/**
|
|
1072
|
-
* Triggered
|
|
1073
|
-
*
|
|
1074
|
-
* This event has the same structure as [Resource Deleted](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members-and-resources/resource-v2/bulk-delete-resources#resource-deleted).
|
|
1118
|
+
* Triggered when a resource is deleted.
|
|
1075
1119
|
* @webhook
|
|
1076
1120
|
* @eventType wix.bookings.resources.v2.resource_deleted
|
|
1121
|
+
* @serviceIdentifier wix.bookings.resources.v2.ResourcesService
|
|
1122
|
+
* @slug deleted
|
|
1077
1123
|
* @documentationMaturity preview
|
|
1078
1124
|
*/
|
|
1079
1125
|
export declare function onResourceDeleted(handler: (event: ResourceDeletedEnvelope) => void | Promise<void>): void;
|
|
@@ -1085,21 +1131,29 @@ export interface ResourceUpdatedEnvelope {
|
|
|
1085
1131
|
* Triggered when a resource is updated.
|
|
1086
1132
|
* @webhook
|
|
1087
1133
|
* @eventType wix.bookings.resources.v2.resource_updated
|
|
1134
|
+
* @serviceIdentifier wix.bookings.resources.v2.ResourcesService
|
|
1135
|
+
* @slug updated
|
|
1088
1136
|
* @documentationMaturity preview
|
|
1089
1137
|
*/
|
|
1090
1138
|
export declare function onResourceUpdated(handler: (event: ResourceUpdatedEnvelope) => void | Promise<void>): void;
|
|
1091
1139
|
/**
|
|
1092
1140
|
* Creates a new resource.
|
|
1093
1141
|
*
|
|
1094
|
-
* A new events schedule is automatically created specific to this resource. This schedule will contain information
|
|
1095
|
-
* on when the resource is booked in order to prevent double bookings.
|
|
1096
|
-
* See [Schedules API](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/schedule-object) for more information.
|
|
1097
1142
|
*
|
|
1098
|
-
*
|
|
1099
|
-
*
|
|
1100
|
-
*
|
|
1101
|
-
*
|
|
1102
|
-
*
|
|
1143
|
+
* ## Connected schedules
|
|
1144
|
+
*
|
|
1145
|
+
* A new event *schedule*
|
|
1146
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/wix-bookings-integration) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/wix-bookings-integration))
|
|
1147
|
+
* is automatically created for the resource.
|
|
1148
|
+
*
|
|
1149
|
+
* ## Locations
|
|
1150
|
+
*
|
|
1151
|
+
* If you don't specify `locationOptions`, Wix Bookings automatically sets
|
|
1152
|
+
* `locationOptions.availableInAllLocations` to `true`.
|
|
1153
|
+
*
|
|
1154
|
+
* If you specify 1 business location ID in `locationOptions.specificLocationOptions.businessLocations`,
|
|
1155
|
+
* you must specify `locationOptions.specificLocationOptions.availableInBusinessLocations`
|
|
1156
|
+
* as `true`. Currently, you can specify only a single business location.
|
|
1103
1157
|
* @param resource - Resource to create.
|
|
1104
1158
|
* @public
|
|
1105
1159
|
* @documentationMaturity preview
|
|
@@ -1111,12 +1165,17 @@ export declare function onResourceUpdated(handler: (event: ResourceUpdatedEnvelo
|
|
|
1111
1165
|
* @permissionScope Manage Bookings - all permissions
|
|
1112
1166
|
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
1113
1167
|
* @applicableIdentity APP
|
|
1114
|
-
* @returns
|
|
1168
|
+
* @returns Created resource.
|
|
1115
1169
|
* @fqn wix.bookings.resources.v2.ResourcesService.CreateResource
|
|
1116
1170
|
*/
|
|
1117
1171
|
export declare function createResource(resource: Resource): Promise<Resource & ResourceNonNullableFields>;
|
|
1118
1172
|
/**
|
|
1119
|
-
* Creates
|
|
1173
|
+
* Creates up to 50 resources.
|
|
1174
|
+
*
|
|
1175
|
+
*
|
|
1176
|
+
* Refer to *Create Resource*
|
|
1177
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/resources/create-resource) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/create-resource))
|
|
1178
|
+
* for more details.
|
|
1120
1179
|
* @param resources - Resources to create.
|
|
1121
1180
|
* @public
|
|
1122
1181
|
* @documentationMaturity preview
|
|
@@ -1132,11 +1191,15 @@ export declare function createResource(resource: Resource): Promise<Resource & R
|
|
|
1132
1191
|
*/
|
|
1133
1192
|
export declare function bulkCreateResources(resources: Resource[], options?: BulkCreateResourcesOptions): Promise<BulkCreateResourcesResponse & BulkCreateResourcesResponseNonNullableFields>;
|
|
1134
1193
|
export interface BulkCreateResourcesOptions {
|
|
1135
|
-
/**
|
|
1194
|
+
/**
|
|
1195
|
+
* Whether to include the created resources in the response.
|
|
1196
|
+
*
|
|
1197
|
+
* Default: `false`
|
|
1198
|
+
*/
|
|
1136
1199
|
returnEntity?: boolean;
|
|
1137
1200
|
}
|
|
1138
1201
|
/**
|
|
1139
|
-
* Retrieves a resource
|
|
1202
|
+
* Retrieves a resource.
|
|
1140
1203
|
* @param resourceId - ID of the resource to retrieve.
|
|
1141
1204
|
* @public
|
|
1142
1205
|
* @documentationMaturity preview
|
|
@@ -1154,13 +1217,14 @@ export interface BulkCreateResourcesOptions {
|
|
|
1154
1217
|
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
1155
1218
|
* @applicableIdentity APP
|
|
1156
1219
|
* @applicableIdentity VISITOR
|
|
1157
|
-
* @returns
|
|
1220
|
+
* @returns Retrieved resource.
|
|
1158
1221
|
* @fqn wix.bookings.resources.v2.ResourcesService.GetResource
|
|
1159
1222
|
*/
|
|
1160
1223
|
export declare function getResource(resourceId: string): Promise<Resource & ResourceNonNullableFields>;
|
|
1161
1224
|
/**
|
|
1162
1225
|
* Updates a resource.
|
|
1163
1226
|
*
|
|
1227
|
+
*
|
|
1164
1228
|
* Each time the resource is updated, `revision` increments by 1. You must include the current revision of the resource when updating it.
|
|
1165
1229
|
* This ensures you're working with the latest service information and prevents unintended overwrites.
|
|
1166
1230
|
* @param _id - Resource ID.
|
|
@@ -1175,7 +1239,7 @@ export declare function getResource(resourceId: string): Promise<Resource & Reso
|
|
|
1175
1239
|
* @permissionScope Manage Bookings - all permissions
|
|
1176
1240
|
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
1177
1241
|
* @applicableIdentity APP
|
|
1178
|
-
* @returns
|
|
1242
|
+
* @returns Updated resource.
|
|
1179
1243
|
* @fqn wix.bookings.resources.v2.ResourcesService.UpdateResource
|
|
1180
1244
|
*/
|
|
1181
1245
|
export declare function updateResource(_id: string | null, resource: UpdateResource): Promise<Resource & ResourceNonNullableFields>;
|
|
@@ -1193,35 +1257,42 @@ export interface UpdateResource {
|
|
|
1193
1257
|
*/
|
|
1194
1258
|
revision?: string | null;
|
|
1195
1259
|
/**
|
|
1196
|
-
*
|
|
1260
|
+
* Time in `YYYY-MM-DDThh:mm:ss.sssZ` format the resource was created.
|
|
1197
1261
|
* @readonly
|
|
1198
1262
|
*/
|
|
1199
1263
|
_createdDate?: Date | null;
|
|
1200
1264
|
/**
|
|
1201
|
-
*
|
|
1265
|
+
* Time in `YYYY-MM-DDThh:mm:ss.sssZ` format the resource was last updated.
|
|
1202
1266
|
* @readonly
|
|
1203
1267
|
*/
|
|
1204
1268
|
_updatedDate?: Date | null;
|
|
1205
1269
|
/** Name of the resource. */
|
|
1206
1270
|
name?: string | null;
|
|
1207
1271
|
/**
|
|
1208
|
-
* ID of the
|
|
1272
|
+
* ID of the *resource type*
|
|
1273
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/resource-types/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resource-types-v2/introduction)).
|
|
1209
1274
|
*
|
|
1210
1275
|
* Once a type has been set it can't be modified. You can create a resource
|
|
1211
|
-
* without specifying a type. However,
|
|
1276
|
+
* without specifying a type. However, customers can't book such resources.
|
|
1212
1277
|
*/
|
|
1213
1278
|
typeId?: string | null;
|
|
1214
1279
|
/**
|
|
1215
|
-
*
|
|
1280
|
+
* Information about the *schedule*
|
|
1281
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/schedules/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction))
|
|
1282
|
+
* specifying the working hours and locations of the resource.
|
|
1216
1283
|
*
|
|
1217
|
-
* Resources without
|
|
1218
|
-
*
|
|
1284
|
+
* Resources without a working hour schedule are available 24/7 at the locations
|
|
1285
|
+
* specified in the field `locationOptions`.
|
|
1286
|
+
* When both `workingHoursSchedules` and `locationOptions` are set,
|
|
1287
|
+
* `workingHoursSchedules` takes precedence.
|
|
1219
1288
|
*/
|
|
1220
1289
|
workingHoursSchedules?: WorkingHoursSchedules;
|
|
1221
|
-
/**
|
|
1290
|
+
/** Information about the location where the resource is available. */
|
|
1222
1291
|
locationOptions?: LocationOptions;
|
|
1223
1292
|
/**
|
|
1224
|
-
*
|
|
1293
|
+
* Schedule containing the *events*
|
|
1294
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/events/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction))
|
|
1295
|
+
* for which the resource has been booked.
|
|
1225
1296
|
* @readonly
|
|
1226
1297
|
*/
|
|
1227
1298
|
eventsSchedule?: EventsSchedule;
|
|
@@ -1231,7 +1302,11 @@ export interface UpdateResource {
|
|
|
1231
1302
|
/**
|
|
1232
1303
|
* Deletes a resource.
|
|
1233
1304
|
*
|
|
1234
|
-
*
|
|
1305
|
+
*
|
|
1306
|
+
* Deleting a resource cancels its event schedule and all its working hour
|
|
1307
|
+
* schedules that aren't shared with another resource. Learn more about
|
|
1308
|
+
* how Bookings uses the Calendar APIs*
|
|
1309
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/wix-bookings-integration) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/wix-bookings-integration)).
|
|
1235
1310
|
* @param resourceId - ID of the resource to delete.
|
|
1236
1311
|
* @public
|
|
1237
1312
|
* @documentationMaturity preview
|
|
@@ -1247,7 +1322,12 @@ export interface UpdateResource {
|
|
|
1247
1322
|
export declare function deleteResource(resourceId: string): Promise<void>;
|
|
1248
1323
|
/**
|
|
1249
1324
|
* Deletes multiple resources.
|
|
1250
|
-
*
|
|
1325
|
+
*
|
|
1326
|
+
*
|
|
1327
|
+
* Refer to *Delete Resource*
|
|
1328
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/resources/delete-resource) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/delete-resource))
|
|
1329
|
+
* for more details.
|
|
1330
|
+
* @param ids - IDs of the resources to delete.
|
|
1251
1331
|
* @public
|
|
1252
1332
|
* @documentationMaturity preview
|
|
1253
1333
|
* @requiredField ids
|
|
@@ -1263,8 +1343,10 @@ export declare function bulkDeleteResources(ids: string[]): Promise<BulkDeleteRe
|
|
|
1263
1343
|
/**
|
|
1264
1344
|
* Retrieves a list of resources matching the provided search criteria.
|
|
1265
1345
|
*
|
|
1266
|
-
*
|
|
1267
|
-
*
|
|
1346
|
+
*
|
|
1347
|
+
* Refer to the *supported filters article*
|
|
1348
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/resources/supported-filters) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/filtering-and-sorting))
|
|
1349
|
+
* for a complete list of supported filters and sorting options.
|
|
1268
1350
|
* @public
|
|
1269
1351
|
* @documentationMaturity preview
|
|
1270
1352
|
* @permissionId BOOKINGS.RESOURCE_READ
|
|
@@ -1284,7 +1366,11 @@ export declare function bulkDeleteResources(ids: string[]): Promise<BulkDeleteRe
|
|
|
1284
1366
|
*/
|
|
1285
1367
|
export declare function searchResources(options?: SearchResourcesOptions): Promise<SearchResourcesResponse & SearchResourcesResponseNonNullableFields>;
|
|
1286
1368
|
export interface SearchResourcesOptions {
|
|
1287
|
-
/**
|
|
1369
|
+
/**
|
|
1370
|
+
* Search condition. Refer to the *supported filters article*
|
|
1371
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/resources/supported-filters) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/filtering-and-sorting))
|
|
1372
|
+
* for a complete list of supported filters and sorting options.
|
|
1373
|
+
*/
|
|
1288
1374
|
search?: CursorSearch;
|
|
1289
1375
|
}
|
|
1290
1376
|
/**
|
|
@@ -1301,7 +1387,7 @@ export interface SearchResourcesOptions {
|
|
|
1301
1387
|
* + `limit` is `50`.
|
|
1302
1388
|
* + Sorted by `id` in ascending order.
|
|
1303
1389
|
*
|
|
1304
|
-
* The functions that are chained to `queryResources()` are applied in the order they are called. For example, if you apply `ascending("typeId")` and then `ascending("
|
|
1390
|
+
* The functions that are chained to `queryResources()` are applied in the order they are called. For example, if you apply `ascending("typeId")` and then `ascending("name")`, the results are sorted first by the `"typeId"`, and then, if there are multiple results with the same `"typeId"`, the items are sorted by `"name"`.
|
|
1305
1391
|
*
|
|
1306
1392
|
* The following `ResourcesQueryBuilder` functions are supported for the `queryResources()` function. For a full description of the resource object, see the object returned for the [items](https://dev.wix.com/docs/sdk/backend-modules/bookings/resources/resources-query-result/items) property in `ResourcesQueryResult`.
|
|
1307
1393
|
* @public
|
|
@@ -1402,12 +1488,13 @@ export interface ResourcesQueryBuilder {
|
|
|
1402
1488
|
/**
|
|
1403
1489
|
* Counts resources according to given criteria.
|
|
1404
1490
|
*
|
|
1405
|
-
*
|
|
1491
|
+
*
|
|
1492
|
+
* Refer to the *supported filters article*
|
|
1493
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/resources/supported-filters) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/filtering-and-sorting))
|
|
1494
|
+
* for a complete list of supported filters and sorting options.
|
|
1406
1495
|
* @public
|
|
1407
1496
|
* @documentationMaturity preview
|
|
1408
|
-
* @param options - Filter to base the count on. See
|
|
1409
|
-
* [queryResources()](https://dev.wix.com/docs/sdk/backend-modules/bookings/resources/query-resources)
|
|
1410
|
-
* for supported filters.
|
|
1497
|
+
* @param options - Filter to base the count on. See *the supported filters article* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/resources/supported-filters) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/filtering-and-sorting)) for a complete list of filtering options.
|
|
1411
1498
|
* @permissionId BOOKINGS.RESOURCE_READ
|
|
1412
1499
|
* @permissionScope Read Bookings - Public Data
|
|
1413
1500
|
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
|
|
@@ -1425,10 +1512,15 @@ export interface ResourcesQueryBuilder {
|
|
|
1425
1512
|
*/
|
|
1426
1513
|
export declare function countResources(options?: CountResourcesOptions): Promise<CountResourcesResponse & CountResourcesResponseNonNullableFields>;
|
|
1427
1514
|
export interface CountResourcesOptions {
|
|
1428
|
-
/**
|
|
1515
|
+
/**
|
|
1516
|
+
* Filter to base the count on. Refer to the *supported filters article*
|
|
1517
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/resources/supported-filters) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/filtering-and-sorting))
|
|
1518
|
+
* for a complete list of supported filters.
|
|
1519
|
+
*/
|
|
1429
1520
|
filter?: Record<string, any> | null;
|
|
1430
1521
|
/**
|
|
1431
|
-
*
|
|
1522
|
+
* Free text to match in searchable fields. Field is deprecated due to decision to use query instead of search for performing the count.
|
|
1523
|
+
* @deprecated Free text to match in searchable fields. Field is deprecated due to decision to use query instead of search for performing the count.
|
|
1432
1524
|
* @targetRemovalDate 2024-05-01
|
|
1433
1525
|
*/
|
|
1434
1526
|
search?: SearchDetails;
|