@wix/auto_sdk_bookings_services 1.0.254 → 1.0.256

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/build/cjs/{bookings-services-v2-service-services.universal-C4INiLoL.d.ts → bookings-services-v2-service-services.universal-CxQEooHC.d.ts} +145 -70
  2. package/build/cjs/index.d.ts +10 -10
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +2 -2
  5. package/build/cjs/index.typings.js.map +1 -1
  6. package/build/cjs/meta.d.ts +123 -58
  7. package/build/cjs/meta.js +3 -0
  8. package/build/cjs/meta.js.map +1 -1
  9. package/build/cjs/schemas.d.ts +572 -57
  10. package/build/cjs/schemas.js +1459 -340
  11. package/build/cjs/schemas.js.map +1 -1
  12. package/build/es/{bookings-services-v2-service-services.universal-C4INiLoL.d.mts → bookings-services-v2-service-services.universal-CxQEooHC.d.mts} +145 -70
  13. package/build/es/index.d.mts +10 -10
  14. package/build/es/index.mjs.map +1 -1
  15. package/build/es/index.typings.d.mts +2 -2
  16. package/build/es/index.typings.mjs.map +1 -1
  17. package/build/es/meta.d.mts +123 -58
  18. package/build/es/meta.mjs +3 -0
  19. package/build/es/meta.mjs.map +1 -1
  20. package/build/es/schemas.d.mts +572 -57
  21. package/build/es/schemas.mjs +1465 -346
  22. package/build/es/schemas.mjs.map +1 -1
  23. package/build/internal/cjs/{bookings-services-v2-service-services.universal-DoKhtzZp.d.ts → bookings-services-v2-service-services.universal-BqFU1N2_.d.ts} +108 -101
  24. package/build/internal/cjs/index.d.ts +10 -10
  25. package/build/internal/cjs/index.js.map +1 -1
  26. package/build/internal/cjs/index.typings.d.ts +2 -2
  27. package/build/internal/cjs/index.typings.js.map +1 -1
  28. package/build/internal/cjs/meta.d.ts +123 -58
  29. package/build/internal/cjs/meta.js +3 -0
  30. package/build/internal/cjs/meta.js.map +1 -1
  31. package/build/internal/cjs/schemas.d.ts +572 -57
  32. package/build/internal/cjs/schemas.js +1459 -340
  33. package/build/internal/cjs/schemas.js.map +1 -1
  34. package/build/internal/es/{bookings-services-v2-service-services.universal-DoKhtzZp.d.mts → bookings-services-v2-service-services.universal-BqFU1N2_.d.mts} +108 -101
  35. package/build/internal/es/index.d.mts +10 -10
  36. package/build/internal/es/index.mjs.map +1 -1
  37. package/build/internal/es/index.typings.d.mts +2 -2
  38. package/build/internal/es/index.typings.mjs.map +1 -1
  39. package/build/internal/es/meta.d.mts +123 -58
  40. package/build/internal/es/meta.mjs +3 -0
  41. package/build/internal/es/meta.mjs.map +1 -1
  42. package/build/internal/es/schemas.d.mts +572 -57
  43. package/build/internal/es/schemas.mjs +1465 -346
  44. package/build/internal/es/schemas.mjs.map +1 -1
  45. package/package.json +2 -2
@@ -549,15 +549,50 @@ var CreateServiceRequest = z.object({
549
549
  availabilityConstraints: z.object({
550
550
  durations: z.array(
551
551
  z.object({
552
- minutes: z.number().int().describe(
553
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
554
- ).min(1).max(44639).optional()
552
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
555
553
  })
556
554
  ).max(50).optional(),
557
555
  sessionDurations: z.array(z.number().int()).max(50).optional(),
558
556
  timeBetweenSessions: z.number().int().describe(
559
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
560
- ).min(0).max(720).optional()
557
+ "The number of minutes between the end of a session and the start of the next."
558
+ ).min(0).max(720).optional(),
559
+ durationRange: z.intersection(
560
+ z.object({ unitType: z.enum(["HOUR", "DAY"]).optional() }),
561
+ z.xor([
562
+ z.object({
563
+ hourOptions: z.never().optional(),
564
+ dayOptions: z.never().optional()
565
+ }),
566
+ z.object({
567
+ dayOptions: z.never().optional(),
568
+ hourOptions: z.object({
569
+ minDurationInMinutes: z.number().int().describe(
570
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
571
+ ).min(30).max(1440).optional(),
572
+ maxDurationInMinutes: z.number().int().describe(
573
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
574
+ ).min(30).max(1440).optional()
575
+ }).describe(
576
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
577
+ )
578
+ }),
579
+ z.object({
580
+ hourOptions: z.never().optional(),
581
+ dayOptions: z.object({
582
+ minDurationInDays: z.number().int().describe(
583
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
584
+ ).min(1).max(8).optional(),
585
+ maxDurationInDays: z.number().int().describe(
586
+ "Maximum bookable duration in days. The customer can't book for more than this number of days.\n\nMust be greater than or equal to `minDurationInDays`."
587
+ ).min(1).max(8).optional()
588
+ }).describe(
589
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
590
+ )
591
+ })
592
+ ])
593
+ ).describe(
594
+ "Duration range for the service. When set, the customer picks a duration\nwithin the configured min/max range instead of a fixed session duration.\nMutually exclusive with `sessionDurations`. A service uses one or the other.\nCan't be combined with `workingHours`.\n\nUse `durationRange` for services where the customer chooses how long to book,\nsuch as equipment or space rentals. The `unitType` determines whether the range\nis measured in hours or days."
595
+ ).optional()
561
596
  }).describe("Limitations affecting the service availability.").optional()
562
597
  }).describe(
563
598
  "The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction),\nwhich can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction)."
@@ -590,17 +625,27 @@ var CreateServiceRequest = z.object({
590
625
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
591
626
  ).optional(),
592
627
  serviceResources: z.array(
593
- z.object({
594
- resourceType: z.object({
595
- _id: z.string().describe("The type of the resource.").regex(
596
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
597
- "Must be a valid GUID"
598
- ).optional().nullable(),
599
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
600
- }).describe(
601
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
602
- ).optional()
603
- })
628
+ z.intersection(
629
+ z.object({
630
+ resourceType: z.object({
631
+ _id: z.string().describe("The type of the resource.").regex(
632
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
633
+ "Must be a valid GUID"
634
+ ).optional().nullable(),
635
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
636
+ }).describe(
637
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
638
+ ).optional()
639
+ }),
640
+ z.xor([
641
+ z.object({ resourceIds: z.never().optional() }),
642
+ z.object({
643
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
644
+ "IDs of specific [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)\nassigned to this service resource. Each ID must reference a resource within the specified `resourceType`.\n\nWhen set, only these resources are considered for availability and booking.\nWhen not set, all resources of the specified resource type are eligible."
645
+ )
646
+ })
647
+ ])
648
+ )
604
649
  ).max(3).optional(),
605
650
  supportedSlugs: z.array(
606
651
  z.object({
@@ -727,8 +772,18 @@ var CreateServiceRequest = z.object({
727
772
  taxableAddress: z.object({
728
773
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).optional()
729
774
  }).describe("Taxable address used to calculate tax").optional(),
730
- inheritResourceLocations: z.boolean().describe(
731
- "Whether to inherit resource locations for availability resolution."
775
+ primaryResourceType: z.string().describe(
776
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
777
+ that serves as the primary resource for this appointment service. The primary resource type
778
+ determines which resources drive slot assignment and availability resolution.
779
+
780
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
781
+ based on the rooms' schedules rather than staff schedules.
782
+
783
+ Default: The staff resource type.`
784
+ ).regex(
785
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
786
+ "Must be a valid GUID"
732
787
  ).optional().nullable()
733
788
  }).describe("Service to create.")
734
789
  });
@@ -1282,15 +1337,54 @@ var CreateServiceResponse = z.object({
1282
1337
  availabilityConstraints: z.object({
1283
1338
  durations: z.array(
1284
1339
  z.object({
1285
- minutes: z.number().int().describe(
1286
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
1287
- ).min(1).max(44639).optional()
1340
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
1288
1341
  })
1289
1342
  ).max(50).optional(),
1290
1343
  sessionDurations: z.array(z.number().int()).max(50).optional(),
1291
1344
  timeBetweenSessions: z.number().int().describe(
1292
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
1293
- ).min(0).max(720).optional()
1345
+ "The number of minutes between the end of a session and the start of the next."
1346
+ ).min(0).max(720).optional(),
1347
+ durationRange: z.intersection(
1348
+ z.object({
1349
+ unitType: z.enum(["HOUR", "DAY"]).describe(
1350
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
1351
+ ).optional()
1352
+ }),
1353
+ z.xor([
1354
+ z.object({
1355
+ hourOptions: z.never().optional(),
1356
+ dayOptions: z.never().optional()
1357
+ }),
1358
+ z.object({
1359
+ dayOptions: z.never().optional(),
1360
+ hourOptions: z.object({
1361
+ minDurationInMinutes: z.number().int().describe(
1362
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
1363
+ ).min(30).max(1440).optional(),
1364
+ maxDurationInMinutes: z.number().int().describe(
1365
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
1366
+ ).min(30).max(1440).optional()
1367
+ }).describe(
1368
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
1369
+ )
1370
+ }),
1371
+ z.object({
1372
+ hourOptions: z.never().optional(),
1373
+ dayOptions: z.object({
1374
+ minDurationInDays: z.number().int().describe(
1375
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
1376
+ ).min(1).max(8).optional(),
1377
+ maxDurationInDays: z.number().int().describe(
1378
+ "Maximum bookable duration in days. The customer can't book for more than this number of days.\n\nMust be greater than or equal to `minDurationInDays`."
1379
+ ).min(1).max(8).optional()
1380
+ }).describe(
1381
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
1382
+ )
1383
+ })
1384
+ ])
1385
+ ).describe(
1386
+ "Duration range for the service. When set, the customer picks a duration\nwithin the configured min/max range instead of a fixed session duration.\nMutually exclusive with `sessionDurations`. A service uses one or the other.\nCan't be combined with `workingHours`.\n\nUse `durationRange` for services where the customer chooses how long to book,\nsuch as equipment or space rentals. The `unitType` determines whether the range\nis measured in hours or days."
1387
+ ).optional()
1294
1388
  }).describe("Limitations affecting the service availability.").optional()
1295
1389
  }).describe(
1296
1390
  "The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction),\nwhich can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction)."
@@ -1323,17 +1417,27 @@ var CreateServiceResponse = z.object({
1323
1417
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
1324
1418
  ).optional(),
1325
1419
  serviceResources: z.array(
1326
- z.object({
1327
- resourceType: z.object({
1328
- _id: z.string().describe("The type of the resource.").regex(
1329
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1330
- "Must be a valid GUID"
1331
- ).optional().nullable(),
1332
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
1333
- }).describe(
1334
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
1335
- ).optional()
1336
- })
1420
+ z.intersection(
1421
+ z.object({
1422
+ resourceType: z.object({
1423
+ _id: z.string().describe("The type of the resource.").regex(
1424
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1425
+ "Must be a valid GUID"
1426
+ ).optional().nullable(),
1427
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
1428
+ }).describe(
1429
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
1430
+ ).optional()
1431
+ }),
1432
+ z.xor([
1433
+ z.object({ resourceIds: z.never().optional() }),
1434
+ z.object({
1435
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
1436
+ "IDs of specific [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)\nassigned to this service resource. Each ID must reference a resource within the specified `resourceType`.\n\nWhen set, only these resources are considered for availability and booking.\nWhen not set, all resources of the specified resource type are eligible."
1437
+ )
1438
+ })
1439
+ ])
1440
+ )
1337
1441
  ).max(3).optional(),
1338
1442
  supportedSlugs: z.array(
1339
1443
  z.object({
@@ -1456,8 +1560,18 @@ var CreateServiceResponse = z.object({
1456
1560
  taxableAddress: z.object({
1457
1561
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
1458
1562
  }).describe("Taxable address used to calculate tax").optional(),
1459
- inheritResourceLocations: z.boolean().describe(
1460
- "Whether to inherit resource locations for availability resolution."
1563
+ primaryResourceType: z.string().describe(
1564
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
1565
+ that serves as the primary resource for this appointment service. The primary resource type
1566
+ determines which resources drive slot assignment and availability resolution.
1567
+
1568
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
1569
+ based on the rooms' schedules rather than staff schedules.
1570
+
1571
+ Default: The staff resource type.`
1572
+ ).regex(
1573
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1574
+ "Must be a valid GUID"
1461
1575
  ).optional().nullable()
1462
1576
  });
1463
1577
  var BulkCreateServicesRequest = z.object({
@@ -2014,15 +2128,50 @@ var BulkCreateServicesRequest = z.object({
2014
2128
  availabilityConstraints: z.object({
2015
2129
  durations: z.array(
2016
2130
  z.object({
2017
- minutes: z.number().int().describe(
2018
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
2019
- ).min(1).max(44639).optional()
2131
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
2020
2132
  })
2021
2133
  ).max(50).optional(),
2022
2134
  sessionDurations: z.array(z.number().int()).max(50).optional(),
2023
2135
  timeBetweenSessions: z.number().int().describe(
2024
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
2025
- ).min(0).max(720).optional()
2136
+ "The number of minutes between the end of a session and the start of the next."
2137
+ ).min(0).max(720).optional(),
2138
+ durationRange: z.intersection(
2139
+ z.object({ unitType: z.enum(["HOUR", "DAY"]).optional() }),
2140
+ z.xor([
2141
+ z.object({
2142
+ hourOptions: z.never().optional(),
2143
+ dayOptions: z.never().optional()
2144
+ }),
2145
+ z.object({
2146
+ dayOptions: z.never().optional(),
2147
+ hourOptions: z.object({
2148
+ minDurationInMinutes: z.number().int().describe(
2149
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
2150
+ ).min(30).max(1440).optional(),
2151
+ maxDurationInMinutes: z.number().int().describe(
2152
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
2153
+ ).min(30).max(1440).optional()
2154
+ }).describe(
2155
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
2156
+ )
2157
+ }),
2158
+ z.object({
2159
+ hourOptions: z.never().optional(),
2160
+ dayOptions: z.object({
2161
+ minDurationInDays: z.number().int().describe(
2162
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
2163
+ ).min(1).max(8).optional(),
2164
+ maxDurationInDays: z.number().int().describe(
2165
+ "Maximum bookable duration in days. The customer can't book for more than this number of days.\n\nMust be greater than or equal to `minDurationInDays`."
2166
+ ).min(1).max(8).optional()
2167
+ }).describe(
2168
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
2169
+ )
2170
+ })
2171
+ ])
2172
+ ).describe(
2173
+ "Duration range for the service. When set, the customer picks a duration\nwithin the configured min/max range instead of a fixed session duration.\nMutually exclusive with `sessionDurations`. A service uses one or the other.\nCan't be combined with `workingHours`.\n\nUse `durationRange` for services where the customer chooses how long to book,\nsuch as equipment or space rentals. The `unitType` determines whether the range\nis measured in hours or days."
2174
+ ).optional()
2026
2175
  }).describe("Limitations affecting the service availability.").optional()
2027
2176
  }).describe(
2028
2177
  "The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction),\nwhich can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction)."
@@ -2055,17 +2204,27 @@ var BulkCreateServicesRequest = z.object({
2055
2204
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
2056
2205
  ).optional(),
2057
2206
  serviceResources: z.array(
2058
- z.object({
2059
- resourceType: z.object({
2060
- _id: z.string().describe("The type of the resource.").regex(
2061
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2062
- "Must be a valid GUID"
2063
- ).optional().nullable(),
2064
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
2065
- }).describe(
2066
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
2067
- ).optional()
2068
- })
2207
+ z.intersection(
2208
+ z.object({
2209
+ resourceType: z.object({
2210
+ _id: z.string().describe("The type of the resource.").regex(
2211
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2212
+ "Must be a valid GUID"
2213
+ ).optional().nullable(),
2214
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
2215
+ }).describe(
2216
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
2217
+ ).optional()
2218
+ }),
2219
+ z.xor([
2220
+ z.object({ resourceIds: z.never().optional() }),
2221
+ z.object({
2222
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
2223
+ "IDs of specific [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)\nassigned to this service resource. Each ID must reference a resource within the specified `resourceType`.\n\nWhen set, only these resources are considered for availability and booking.\nWhen not set, all resources of the specified resource type are eligible."
2224
+ )
2225
+ })
2226
+ ])
2227
+ )
2069
2228
  ).max(3).optional(),
2070
2229
  supportedSlugs: z.array(
2071
2230
  z.object({
@@ -2192,8 +2351,18 @@ var BulkCreateServicesRequest = z.object({
2192
2351
  taxableAddress: z.object({
2193
2352
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).optional()
2194
2353
  }).describe("Taxable address used to calculate tax").optional(),
2195
- inheritResourceLocations: z.boolean().describe(
2196
- "Whether to inherit resource locations for availability resolution."
2354
+ primaryResourceType: z.string().describe(
2355
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
2356
+ that serves as the primary resource for this appointment service. The primary resource type
2357
+ determines which resources drive slot assignment and availability resolution.
2358
+
2359
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
2360
+ based on the rooms' schedules rather than staff schedules.
2361
+
2362
+ Default: The staff resource type.`
2363
+ ).regex(
2364
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2365
+ "Must be a valid GUID"
2197
2366
  ).optional().nullable()
2198
2367
  })
2199
2368
  ).max(100),
@@ -2793,15 +2962,54 @@ var BulkCreateServicesResponse = z.object({
2793
2962
  availabilityConstraints: z.object({
2794
2963
  durations: z.array(
2795
2964
  z.object({
2796
- minutes: z.number().int().describe(
2797
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
2798
- ).min(1).max(44639).optional()
2965
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
2799
2966
  })
2800
2967
  ).max(50).optional(),
2801
2968
  sessionDurations: z.array(z.number().int()).max(50).optional(),
2802
2969
  timeBetweenSessions: z.number().int().describe(
2803
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
2804
- ).min(0).max(720).optional()
2970
+ "The number of minutes between the end of a session and the start of the next."
2971
+ ).min(0).max(720).optional(),
2972
+ durationRange: z.intersection(
2973
+ z.object({
2974
+ unitType: z.enum(["HOUR", "DAY"]).describe(
2975
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
2976
+ ).optional()
2977
+ }),
2978
+ z.xor([
2979
+ z.object({
2980
+ hourOptions: z.never().optional(),
2981
+ dayOptions: z.never().optional()
2982
+ }),
2983
+ z.object({
2984
+ dayOptions: z.never().optional(),
2985
+ hourOptions: z.object({
2986
+ minDurationInMinutes: z.number().int().describe(
2987
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
2988
+ ).min(30).max(1440).optional(),
2989
+ maxDurationInMinutes: z.number().int().describe(
2990
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
2991
+ ).min(30).max(1440).optional()
2992
+ }).describe(
2993
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
2994
+ )
2995
+ }),
2996
+ z.object({
2997
+ hourOptions: z.never().optional(),
2998
+ dayOptions: z.object({
2999
+ minDurationInDays: z.number().int().describe(
3000
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
3001
+ ).min(1).max(8).optional(),
3002
+ maxDurationInDays: z.number().int().describe(
3003
+ "Maximum bookable duration in days. The customer can't book for more than this number of days.\n\nMust be greater than or equal to `minDurationInDays`."
3004
+ ).min(1).max(8).optional()
3005
+ }).describe(
3006
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
3007
+ )
3008
+ })
3009
+ ])
3010
+ ).describe(
3011
+ "Duration range for the service. When set, the customer picks a duration\nwithin the configured min/max range instead of a fixed session duration.\nMutually exclusive with `sessionDurations`. A service uses one or the other.\nCan't be combined with `workingHours`.\n\nUse `durationRange` for services where the customer chooses how long to book,\nsuch as equipment or space rentals. The `unitType` determines whether the range\nis measured in hours or days."
3012
+ ).optional()
2805
3013
  }).describe("Limitations affecting the service availability.").optional()
2806
3014
  }).describe(
2807
3015
  "The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction),\nwhich can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction)."
@@ -2834,17 +3042,29 @@ var BulkCreateServicesResponse = z.object({
2834
3042
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
2835
3043
  ).optional(),
2836
3044
  serviceResources: z.array(
2837
- z.object({
2838
- resourceType: z.object({
2839
- _id: z.string().describe("The type of the resource.").regex(
2840
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2841
- "Must be a valid GUID"
2842
- ).optional().nullable(),
2843
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
2844
- }).describe(
2845
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
2846
- ).optional()
2847
- })
3045
+ z.intersection(
3046
+ z.object({
3047
+ resourceType: z.object({
3048
+ _id: z.string().describe("The type of the resource.").regex(
3049
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
3050
+ "Must be a valid GUID"
3051
+ ).optional().nullable(),
3052
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
3053
+ }).describe(
3054
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
3055
+ ).optional()
3056
+ }),
3057
+ z.xor([
3058
+ z.object({ resourceIds: z.never().optional() }),
3059
+ z.object({
3060
+ resourceIds: z.object({
3061
+ values: z.array(z.string()).max(100).optional()
3062
+ }).describe(
3063
+ "IDs of specific [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)\nassigned to this service resource. Each ID must reference a resource within the specified `resourceType`.\n\nWhen set, only these resources are considered for availability and booking.\nWhen not set, all resources of the specified resource type are eligible."
3064
+ )
3065
+ })
3066
+ ])
3067
+ )
2848
3068
  ).max(3).optional(),
2849
3069
  supportedSlugs: z.array(
2850
3070
  z.object({
@@ -2971,8 +3191,18 @@ var BulkCreateServicesResponse = z.object({
2971
3191
  taxableAddress: z.object({
2972
3192
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
2973
3193
  }).describe("Taxable address used to calculate tax").optional(),
2974
- inheritResourceLocations: z.boolean().describe(
2975
- "Whether to inherit resource locations for availability resolution."
3194
+ primaryResourceType: z.string().describe(
3195
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
3196
+ that serves as the primary resource for this appointment service. The primary resource type
3197
+ determines which resources drive slot assignment and availability resolution.
3198
+
3199
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
3200
+ based on the rooms' schedules rather than staff schedules.
3201
+
3202
+ Default: The staff resource type.`
3203
+ ).regex(
3204
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
3205
+ "Must be a valid GUID"
2976
3206
  ).optional().nullable()
2977
3207
  }).describe("Updated service.").optional()
2978
3208
  })
@@ -2995,7 +3225,8 @@ var GetServiceRequest = z.object({
2995
3225
  z.enum([
2996
3226
  "STAFF_MEMBER_DETAILS",
2997
3227
  "RESOURCE_TYPE_DETAILS",
2998
- "DISCOUNT_INFO_DETAILS"
3228
+ "DISCOUNT_INFO_DETAILS",
3229
+ "RESOURCE_DETAILS"
2999
3230
  ])
3000
3231
  ).max(5).optional()
3001
3232
  }).optional()
@@ -3550,15 +3781,54 @@ var GetServiceResponse = z.object({
3550
3781
  availabilityConstraints: z.object({
3551
3782
  durations: z.array(
3552
3783
  z.object({
3553
- minutes: z.number().int().describe(
3554
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
3555
- ).min(1).max(44639).optional()
3784
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
3556
3785
  })
3557
3786
  ).max(50).optional(),
3558
3787
  sessionDurations: z.array(z.number().int()).max(50).optional(),
3559
3788
  timeBetweenSessions: z.number().int().describe(
3560
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
3561
- ).min(0).max(720).optional()
3789
+ "The number of minutes between the end of a session and the start of the next."
3790
+ ).min(0).max(720).optional(),
3791
+ durationRange: z.intersection(
3792
+ z.object({
3793
+ unitType: z.enum(["HOUR", "DAY"]).describe(
3794
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
3795
+ ).optional()
3796
+ }),
3797
+ z.xor([
3798
+ z.object({
3799
+ hourOptions: z.never().optional(),
3800
+ dayOptions: z.never().optional()
3801
+ }),
3802
+ z.object({
3803
+ dayOptions: z.never().optional(),
3804
+ hourOptions: z.object({
3805
+ minDurationInMinutes: z.number().int().describe(
3806
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
3807
+ ).min(30).max(1440).optional(),
3808
+ maxDurationInMinutes: z.number().int().describe(
3809
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
3810
+ ).min(30).max(1440).optional()
3811
+ }).describe(
3812
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
3813
+ )
3814
+ }),
3815
+ z.object({
3816
+ hourOptions: z.never().optional(),
3817
+ dayOptions: z.object({
3818
+ minDurationInDays: z.number().int().describe(
3819
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
3820
+ ).min(1).max(8).optional(),
3821
+ maxDurationInDays: z.number().int().describe(
3822
+ "Maximum bookable duration in days. The customer can't book for more than this number of days.\n\nMust be greater than or equal to `minDurationInDays`."
3823
+ ).min(1).max(8).optional()
3824
+ }).describe(
3825
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
3826
+ )
3827
+ })
3828
+ ])
3829
+ ).describe(
3830
+ "Duration range for the service. When set, the customer picks a duration\nwithin the configured min/max range instead of a fixed session duration.\nMutually exclusive with `sessionDurations`. A service uses one or the other.\nCan't be combined with `workingHours`.\n\nUse `durationRange` for services where the customer chooses how long to book,\nsuch as equipment or space rentals. The `unitType` determines whether the range\nis measured in hours or days."
3831
+ ).optional()
3562
3832
  }).describe("Limitations affecting the service availability.").optional()
3563
3833
  }).describe(
3564
3834
  "The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction),\nwhich can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction)."
@@ -3591,17 +3861,27 @@ var GetServiceResponse = z.object({
3591
3861
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
3592
3862
  ).optional(),
3593
3863
  serviceResources: z.array(
3594
- z.object({
3595
- resourceType: z.object({
3596
- _id: z.string().describe("The type of the resource.").regex(
3597
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
3598
- "Must be a valid GUID"
3599
- ).optional().nullable(),
3600
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
3601
- }).describe(
3602
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
3603
- ).optional()
3604
- })
3864
+ z.intersection(
3865
+ z.object({
3866
+ resourceType: z.object({
3867
+ _id: z.string().describe("The type of the resource.").regex(
3868
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
3869
+ "Must be a valid GUID"
3870
+ ).optional().nullable(),
3871
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
3872
+ }).describe(
3873
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
3874
+ ).optional()
3875
+ }),
3876
+ z.xor([
3877
+ z.object({ resourceIds: z.never().optional() }),
3878
+ z.object({
3879
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
3880
+ "IDs of specific [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)\nassigned to this service resource. Each ID must reference a resource within the specified `resourceType`.\n\nWhen set, only these resources are considered for availability and booking.\nWhen not set, all resources of the specified resource type are eligible."
3881
+ )
3882
+ })
3883
+ ])
3884
+ )
3605
3885
  ).max(3).optional(),
3606
3886
  supportedSlugs: z.array(
3607
3887
  z.object({
@@ -3724,8 +4004,18 @@ var GetServiceResponse = z.object({
3724
4004
  taxableAddress: z.object({
3725
4005
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
3726
4006
  }).describe("Taxable address used to calculate tax").optional(),
3727
- inheritResourceLocations: z.boolean().describe(
3728
- "Whether to inherit resource locations for availability resolution."
4007
+ primaryResourceType: z.string().describe(
4008
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
4009
+ that serves as the primary resource for this appointment service. The primary resource type
4010
+ determines which resources drive slot assignment and availability resolution.
4011
+
4012
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
4013
+ based on the rooms' schedules rather than staff schedules.
4014
+
4015
+ Default: The staff resource type.`
4016
+ ).regex(
4017
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
4018
+ "Must be a valid GUID"
3729
4019
  ).optional().nullable()
3730
4020
  });
3731
4021
  var UpdateServiceRequest = z.object({
@@ -4281,15 +4571,50 @@ var UpdateServiceRequest = z.object({
4281
4571
  availabilityConstraints: z.object({
4282
4572
  durations: z.array(
4283
4573
  z.object({
4284
- minutes: z.number().int().describe(
4285
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
4286
- ).min(1).max(44639).optional()
4574
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
4287
4575
  })
4288
4576
  ).max(50).optional(),
4289
4577
  sessionDurations: z.array(z.number().int()).max(50).optional(),
4290
4578
  timeBetweenSessions: z.number().int().describe(
4291
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
4292
- ).min(0).max(720).optional()
4579
+ "The number of minutes between the end of a session and the start of the next."
4580
+ ).min(0).max(720).optional(),
4581
+ durationRange: z.intersection(
4582
+ z.object({ unitType: z.enum(["HOUR", "DAY"]).optional() }),
4583
+ z.xor([
4584
+ z.object({
4585
+ hourOptions: z.never().optional(),
4586
+ dayOptions: z.never().optional()
4587
+ }),
4588
+ z.object({
4589
+ dayOptions: z.never().optional(),
4590
+ hourOptions: z.object({
4591
+ minDurationInMinutes: z.number().int().describe(
4592
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
4593
+ ).min(30).max(1440).optional(),
4594
+ maxDurationInMinutes: z.number().int().describe(
4595
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
4596
+ ).min(30).max(1440).optional()
4597
+ }).describe(
4598
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
4599
+ )
4600
+ }),
4601
+ z.object({
4602
+ hourOptions: z.never().optional(),
4603
+ dayOptions: z.object({
4604
+ minDurationInDays: z.number().int().describe(
4605
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
4606
+ ).min(1).max(8).optional(),
4607
+ maxDurationInDays: z.number().int().describe(
4608
+ "Maximum bookable duration in days. The customer can't book for more than this number of days.\n\nMust be greater than or equal to `minDurationInDays`."
4609
+ ).min(1).max(8).optional()
4610
+ }).describe(
4611
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
4612
+ )
4613
+ })
4614
+ ])
4615
+ ).describe(
4616
+ "Duration range for the service. When set, the customer picks a duration\nwithin the configured min/max range instead of a fixed session duration.\nMutually exclusive with `sessionDurations`. A service uses one or the other.\nCan't be combined with `workingHours`.\n\nUse `durationRange` for services where the customer chooses how long to book,\nsuch as equipment or space rentals. The `unitType` determines whether the range\nis measured in hours or days."
4617
+ ).optional()
4293
4618
  }).describe("Limitations affecting the service availability.").optional()
4294
4619
  }).describe(
4295
4620
  "The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction),\nwhich can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction)."
@@ -4322,17 +4647,27 @@ var UpdateServiceRequest = z.object({
4322
4647
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
4323
4648
  ).optional(),
4324
4649
  serviceResources: z.array(
4325
- z.object({
4326
- resourceType: z.object({
4327
- _id: z.string().describe("The type of the resource.").regex(
4328
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
4329
- "Must be a valid GUID"
4330
- ).optional().nullable(),
4331
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
4332
- }).describe(
4333
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
4334
- ).optional()
4335
- })
4650
+ z.intersection(
4651
+ z.object({
4652
+ resourceType: z.object({
4653
+ _id: z.string().describe("The type of the resource.").regex(
4654
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
4655
+ "Must be a valid GUID"
4656
+ ).optional().nullable(),
4657
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
4658
+ }).describe(
4659
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
4660
+ ).optional()
4661
+ }),
4662
+ z.xor([
4663
+ z.object({ resourceIds: z.never().optional() }),
4664
+ z.object({
4665
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
4666
+ "IDs of specific [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)\nassigned to this service resource. Each ID must reference a resource within the specified `resourceType`.\n\nWhen set, only these resources are considered for availability and booking.\nWhen not set, all resources of the specified resource type are eligible."
4667
+ )
4668
+ })
4669
+ ])
4670
+ )
4336
4671
  ).max(3).optional(),
4337
4672
  supportedSlugs: z.array(
4338
4673
  z.object({
@@ -4459,8 +4794,18 @@ var UpdateServiceRequest = z.object({
4459
4794
  taxableAddress: z.object({
4460
4795
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).optional()
4461
4796
  }).describe("Taxable address used to calculate tax").optional(),
4462
- inheritResourceLocations: z.boolean().describe(
4463
- "Whether to inherit resource locations for availability resolution."
4797
+ primaryResourceType: z.string().describe(
4798
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
4799
+ that serves as the primary resource for this appointment service. The primary resource type
4800
+ determines which resources drive slot assignment and availability resolution.
4801
+
4802
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
4803
+ based on the rooms' schedules rather than staff schedules.
4804
+
4805
+ Default: The staff resource type.`
4806
+ ).regex(
4807
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
4808
+ "Must be a valid GUID"
4464
4809
  ).optional().nullable()
4465
4810
  }).describe("Service to update.")
4466
4811
  });
@@ -5014,15 +5359,54 @@ var UpdateServiceResponse = z.object({
5014
5359
  availabilityConstraints: z.object({
5015
5360
  durations: z.array(
5016
5361
  z.object({
5017
- minutes: z.number().int().describe(
5018
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
5019
- ).min(1).max(44639).optional()
5362
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
5020
5363
  })
5021
5364
  ).max(50).optional(),
5022
5365
  sessionDurations: z.array(z.number().int()).max(50).optional(),
5023
5366
  timeBetweenSessions: z.number().int().describe(
5024
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
5025
- ).min(0).max(720).optional()
5367
+ "The number of minutes between the end of a session and the start of the next."
5368
+ ).min(0).max(720).optional(),
5369
+ durationRange: z.intersection(
5370
+ z.object({
5371
+ unitType: z.enum(["HOUR", "DAY"]).describe(
5372
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
5373
+ ).optional()
5374
+ }),
5375
+ z.xor([
5376
+ z.object({
5377
+ hourOptions: z.never().optional(),
5378
+ dayOptions: z.never().optional()
5379
+ }),
5380
+ z.object({
5381
+ dayOptions: z.never().optional(),
5382
+ hourOptions: z.object({
5383
+ minDurationInMinutes: z.number().int().describe(
5384
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
5385
+ ).min(30).max(1440).optional(),
5386
+ maxDurationInMinutes: z.number().int().describe(
5387
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
5388
+ ).min(30).max(1440).optional()
5389
+ }).describe(
5390
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
5391
+ )
5392
+ }),
5393
+ z.object({
5394
+ hourOptions: z.never().optional(),
5395
+ dayOptions: z.object({
5396
+ minDurationInDays: z.number().int().describe(
5397
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
5398
+ ).min(1).max(8).optional(),
5399
+ maxDurationInDays: z.number().int().describe(
5400
+ "Maximum bookable duration in days. The customer can't book for more than this number of days.\n\nMust be greater than or equal to `minDurationInDays`."
5401
+ ).min(1).max(8).optional()
5402
+ }).describe(
5403
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
5404
+ )
5405
+ })
5406
+ ])
5407
+ ).describe(
5408
+ "Duration range for the service. When set, the customer picks a duration\nwithin the configured min/max range instead of a fixed session duration.\nMutually exclusive with `sessionDurations`. A service uses one or the other.\nCan't be combined with `workingHours`.\n\nUse `durationRange` for services where the customer chooses how long to book,\nsuch as equipment or space rentals. The `unitType` determines whether the range\nis measured in hours or days."
5409
+ ).optional()
5026
5410
  }).describe("Limitations affecting the service availability.").optional()
5027
5411
  }).describe(
5028
5412
  "The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction),\nwhich can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction)."
@@ -5055,17 +5439,27 @@ var UpdateServiceResponse = z.object({
5055
5439
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
5056
5440
  ).optional(),
5057
5441
  serviceResources: z.array(
5058
- z.object({
5059
- resourceType: z.object({
5060
- _id: z.string().describe("The type of the resource.").regex(
5061
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5062
- "Must be a valid GUID"
5063
- ).optional().nullable(),
5064
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
5065
- }).describe(
5066
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
5067
- ).optional()
5068
- })
5442
+ z.intersection(
5443
+ z.object({
5444
+ resourceType: z.object({
5445
+ _id: z.string().describe("The type of the resource.").regex(
5446
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5447
+ "Must be a valid GUID"
5448
+ ).optional().nullable(),
5449
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
5450
+ }).describe(
5451
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
5452
+ ).optional()
5453
+ }),
5454
+ z.xor([
5455
+ z.object({ resourceIds: z.never().optional() }),
5456
+ z.object({
5457
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
5458
+ "IDs of specific [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)\nassigned to this service resource. Each ID must reference a resource within the specified `resourceType`.\n\nWhen set, only these resources are considered for availability and booking.\nWhen not set, all resources of the specified resource type are eligible."
5459
+ )
5460
+ })
5461
+ ])
5462
+ )
5069
5463
  ).max(3).optional(),
5070
5464
  supportedSlugs: z.array(
5071
5465
  z.object({
@@ -5188,8 +5582,18 @@ var UpdateServiceResponse = z.object({
5188
5582
  taxableAddress: z.object({
5189
5583
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
5190
5584
  }).describe("Taxable address used to calculate tax").optional(),
5191
- inheritResourceLocations: z.boolean().describe(
5192
- "Whether to inherit resource locations for availability resolution."
5585
+ primaryResourceType: z.string().describe(
5586
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
5587
+ that serves as the primary resource for this appointment service. The primary resource type
5588
+ determines which resources drive slot assignment and availability resolution.
5589
+
5590
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
5591
+ based on the rooms' schedules rather than staff schedules.
5592
+
5593
+ Default: The staff resource type.`
5594
+ ).regex(
5595
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5596
+ "Must be a valid GUID"
5193
5597
  ).optional().nullable()
5194
5598
  });
5195
5599
  var BulkUpdateServicesRequest = z.object({
@@ -5765,14 +6169,53 @@ var BulkUpdateServicesRequest = z.object({
5765
6169
  durations: z.array(
5766
6170
  z.object({
5767
6171
  minutes: z.number().int().describe(
5768
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
6172
+ "The duration of the service in minutes."
5769
6173
  ).min(1).max(44639).optional()
5770
6174
  })
5771
6175
  ).max(50).optional(),
5772
6176
  sessionDurations: z.array(z.number().int()).max(50).optional(),
5773
6177
  timeBetweenSessions: z.number().int().describe(
5774
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
5775
- ).min(0).max(720).optional()
6178
+ "The number of minutes between the end of a session and the start of the next."
6179
+ ).min(0).max(720).optional(),
6180
+ durationRange: z.intersection(
6181
+ z.object({
6182
+ unitType: z.enum(["HOUR", "DAY"]).optional()
6183
+ }),
6184
+ z.xor([
6185
+ z.object({
6186
+ hourOptions: z.never().optional(),
6187
+ dayOptions: z.never().optional()
6188
+ }),
6189
+ z.object({
6190
+ dayOptions: z.never().optional(),
6191
+ hourOptions: z.object({
6192
+ minDurationInMinutes: z.number().int().describe(
6193
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
6194
+ ).min(30).max(1440).optional(),
6195
+ maxDurationInMinutes: z.number().int().describe(
6196
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
6197
+ ).min(30).max(1440).optional()
6198
+ }).describe(
6199
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
6200
+ )
6201
+ }),
6202
+ z.object({
6203
+ hourOptions: z.never().optional(),
6204
+ dayOptions: z.object({
6205
+ minDurationInDays: z.number().int().describe(
6206
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
6207
+ ).min(1).max(8).optional(),
6208
+ maxDurationInDays: z.number().int().describe(
6209
+ "Maximum bookable duration in days. The customer can't book for more than this number of days.\n\nMust be greater than or equal to `minDurationInDays`."
6210
+ ).min(1).max(8).optional()
6211
+ }).describe(
6212
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
6213
+ )
6214
+ })
6215
+ ])
6216
+ ).describe(
6217
+ "Duration range for the service. When set, the customer picks a duration\nwithin the configured min/max range instead of a fixed session duration.\nMutually exclusive with `sessionDurations`. A service uses one or the other.\nCan't be combined with `workingHours`.\n\nUse `durationRange` for services where the customer chooses how long to book,\nsuch as equipment or space rentals. The `unitType` determines whether the range\nis measured in hours or days."
6218
+ ).optional()
5776
6219
  }).describe(
5777
6220
  "Limitations affecting the service availability."
5778
6221
  ).optional()
@@ -5807,17 +6250,29 @@ var BulkUpdateServicesRequest = z.object({
5807
6250
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
5808
6251
  ).optional(),
5809
6252
  serviceResources: z.array(
5810
- z.object({
5811
- resourceType: z.object({
5812
- _id: z.string().describe("The type of the resource.").regex(
5813
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5814
- "Must be a valid GUID"
5815
- ).optional().nullable(),
5816
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
5817
- }).describe(
5818
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
5819
- ).optional()
5820
- })
6253
+ z.intersection(
6254
+ z.object({
6255
+ resourceType: z.object({
6256
+ _id: z.string().describe("The type of the resource.").regex(
6257
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
6258
+ "Must be a valid GUID"
6259
+ ).optional().nullable(),
6260
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
6261
+ }).describe(
6262
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
6263
+ ).optional()
6264
+ }),
6265
+ z.xor([
6266
+ z.object({ resourceIds: z.never().optional() }),
6267
+ z.object({
6268
+ resourceIds: z.object({
6269
+ values: z.array(z.string()).max(100).optional()
6270
+ }).describe(
6271
+ "IDs of specific [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)\nassigned to this service resource. Each ID must reference a resource within the specified `resourceType`.\n\nWhen set, only these resources are considered for availability and booking.\nWhen not set, all resources of the specified resource type are eligible."
6272
+ )
6273
+ })
6274
+ ])
6275
+ )
5821
6276
  ).max(3).optional(),
5822
6277
  supportedSlugs: z.array(
5823
6278
  z.object({
@@ -5944,8 +6399,18 @@ var BulkUpdateServicesRequest = z.object({
5944
6399
  taxableAddress: z.object({
5945
6400
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).optional()
5946
6401
  }).describe("Taxable address used to calculate tax").optional(),
5947
- inheritResourceLocations: z.boolean().describe(
5948
- "Whether to inherit resource locations for availability resolution."
6402
+ primaryResourceType: z.string().describe(
6403
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
6404
+ that serves as the primary resource for this appointment service. The primary resource type
6405
+ determines which resources drive slot assignment and availability resolution.
6406
+
6407
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
6408
+ based on the rooms' schedules rather than staff schedules.
6409
+
6410
+ Default: The staff resource type.`
6411
+ ).regex(
6412
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
6413
+ "Must be a valid GUID"
5949
6414
  ).optional().nullable()
5950
6415
  }).describe("Service to update."),
5951
6416
  mask: z.array(z.string()).optional()
@@ -6548,15 +7013,54 @@ var BulkUpdateServicesResponse = z.object({
6548
7013
  availabilityConstraints: z.object({
6549
7014
  durations: z.array(
6550
7015
  z.object({
6551
- minutes: z.number().int().describe(
6552
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
6553
- ).min(1).max(44639).optional()
7016
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
6554
7017
  })
6555
7018
  ).max(50).optional(),
6556
7019
  sessionDurations: z.array(z.number().int()).max(50).optional(),
6557
7020
  timeBetweenSessions: z.number().int().describe(
6558
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
6559
- ).min(0).max(720).optional()
7021
+ "The number of minutes between the end of a session and the start of the next."
7022
+ ).min(0).max(720).optional(),
7023
+ durationRange: z.intersection(
7024
+ z.object({
7025
+ unitType: z.enum(["HOUR", "DAY"]).describe(
7026
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
7027
+ ).optional()
7028
+ }),
7029
+ z.xor([
7030
+ z.object({
7031
+ hourOptions: z.never().optional(),
7032
+ dayOptions: z.never().optional()
7033
+ }),
7034
+ z.object({
7035
+ dayOptions: z.never().optional(),
7036
+ hourOptions: z.object({
7037
+ minDurationInMinutes: z.number().int().describe(
7038
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
7039
+ ).min(30).max(1440).optional(),
7040
+ maxDurationInMinutes: z.number().int().describe(
7041
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
7042
+ ).min(30).max(1440).optional()
7043
+ }).describe(
7044
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
7045
+ )
7046
+ }),
7047
+ z.object({
7048
+ hourOptions: z.never().optional(),
7049
+ dayOptions: z.object({
7050
+ minDurationInDays: z.number().int().describe(
7051
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
7052
+ ).min(1).max(8).optional(),
7053
+ maxDurationInDays: z.number().int().describe(
7054
+ "Maximum bookable duration in days. The customer can't book for more than this number of days.\n\nMust be greater than or equal to `minDurationInDays`."
7055
+ ).min(1).max(8).optional()
7056
+ }).describe(
7057
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
7058
+ )
7059
+ })
7060
+ ])
7061
+ ).describe(
7062
+ "Duration range for the service. When set, the customer picks a duration\nwithin the configured min/max range instead of a fixed session duration.\nMutually exclusive with `sessionDurations`. A service uses one or the other.\nCan't be combined with `workingHours`.\n\nUse `durationRange` for services where the customer chooses how long to book,\nsuch as equipment or space rentals. The `unitType` determines whether the range\nis measured in hours or days."
7063
+ ).optional()
6560
7064
  }).describe("Limitations affecting the service availability.").optional()
6561
7065
  }).describe(
6562
7066
  "The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction),\nwhich can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction)."
@@ -6583,23 +7087,35 @@ var BulkUpdateServicesResponse = z.object({
6583
7087
  })
6584
7088
  ])
6585
7089
  ).describe("Main media associated with the service.").optional()
6586
- })
6587
- ).max(220).optional()
6588
- }).describe(
6589
- "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
6590
- ).optional(),
6591
- serviceResources: z.array(
6592
- z.object({
6593
- resourceType: z.object({
6594
- _id: z.string().describe("The type of the resource.").regex(
6595
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
6596
- "Must be a valid GUID"
6597
- ).optional().nullable(),
6598
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
6599
- }).describe(
6600
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
6601
- ).optional()
6602
- })
7090
+ })
7091
+ ).max(220).optional()
7092
+ }).describe(
7093
+ "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
7094
+ ).optional(),
7095
+ serviceResources: z.array(
7096
+ z.intersection(
7097
+ z.object({
7098
+ resourceType: z.object({
7099
+ _id: z.string().describe("The type of the resource.").regex(
7100
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
7101
+ "Must be a valid GUID"
7102
+ ).optional().nullable(),
7103
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
7104
+ }).describe(
7105
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
7106
+ ).optional()
7107
+ }),
7108
+ z.xor([
7109
+ z.object({ resourceIds: z.never().optional() }),
7110
+ z.object({
7111
+ resourceIds: z.object({
7112
+ values: z.array(z.string()).max(100).optional()
7113
+ }).describe(
7114
+ "IDs of specific [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)\nassigned to this service resource. Each ID must reference a resource within the specified `resourceType`.\n\nWhen set, only these resources are considered for availability and booking.\nWhen not set, all resources of the specified resource type are eligible."
7115
+ )
7116
+ })
7117
+ ])
7118
+ )
6603
7119
  ).max(3).optional(),
6604
7120
  supportedSlugs: z.array(
6605
7121
  z.object({
@@ -6726,8 +7242,18 @@ var BulkUpdateServicesResponse = z.object({
6726
7242
  taxableAddress: z.object({
6727
7243
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
6728
7244
  }).describe("Taxable address used to calculate tax").optional(),
6729
- inheritResourceLocations: z.boolean().describe(
6730
- "Whether to inherit resource locations for availability resolution."
7245
+ primaryResourceType: z.string().describe(
7246
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
7247
+ that serves as the primary resource for this appointment service. The primary resource type
7248
+ determines which resources drive slot assignment and availability resolution.
7249
+
7250
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
7251
+ based on the rooms' schedules rather than staff schedules.
7252
+
7253
+ Default: The staff resource type.`
7254
+ ).regex(
7255
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
7256
+ "Must be a valid GUID"
6731
7257
  ).optional().nullable()
6732
7258
  }).describe("Updated service.").optional()
6733
7259
  })
@@ -7295,15 +7821,50 @@ var BulkUpdateServicesByFilterRequest = z.object({
7295
7821
  availabilityConstraints: z.object({
7296
7822
  durations: z.array(
7297
7823
  z.object({
7298
- minutes: z.number().int().describe(
7299
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
7300
- ).min(1).max(44639).optional()
7824
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
7301
7825
  })
7302
7826
  ).max(50).optional(),
7303
7827
  sessionDurations: z.array(z.number().int()).max(50).optional(),
7304
7828
  timeBetweenSessions: z.number().int().describe(
7305
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
7306
- ).min(0).max(720).optional()
7829
+ "The number of minutes between the end of a session and the start of the next."
7830
+ ).min(0).max(720).optional(),
7831
+ durationRange: z.intersection(
7832
+ z.object({ unitType: z.enum(["HOUR", "DAY"]).optional() }),
7833
+ z.xor([
7834
+ z.object({
7835
+ hourOptions: z.never().optional(),
7836
+ dayOptions: z.never().optional()
7837
+ }),
7838
+ z.object({
7839
+ dayOptions: z.never().optional(),
7840
+ hourOptions: z.object({
7841
+ minDurationInMinutes: z.number().int().describe(
7842
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
7843
+ ).min(30).max(1440).optional(),
7844
+ maxDurationInMinutes: z.number().int().describe(
7845
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
7846
+ ).min(30).max(1440).optional()
7847
+ }).describe(
7848
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
7849
+ )
7850
+ }),
7851
+ z.object({
7852
+ hourOptions: z.never().optional(),
7853
+ dayOptions: z.object({
7854
+ minDurationInDays: z.number().int().describe(
7855
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
7856
+ ).min(1).max(8).optional(),
7857
+ maxDurationInDays: z.number().int().describe(
7858
+ "Maximum bookable duration in days. The customer can't book for more than this number of days.\n\nMust be greater than or equal to `minDurationInDays`."
7859
+ ).min(1).max(8).optional()
7860
+ }).describe(
7861
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
7862
+ )
7863
+ })
7864
+ ])
7865
+ ).describe(
7866
+ "Duration range for the service. When set, the customer picks a duration\nwithin the configured min/max range instead of a fixed session duration.\nMutually exclusive with `sessionDurations`. A service uses one or the other.\nCan't be combined with `workingHours`.\n\nUse `durationRange` for services where the customer chooses how long to book,\nsuch as equipment or space rentals. The `unitType` determines whether the range\nis measured in hours or days."
7867
+ ).optional()
7307
7868
  }).describe("Limitations affecting the service availability.").optional()
7308
7869
  }).describe(
7309
7870
  "The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction),\nwhich can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction)."
@@ -7336,17 +7897,27 @@ var BulkUpdateServicesByFilterRequest = z.object({
7336
7897
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
7337
7898
  ).optional(),
7338
7899
  serviceResources: z.array(
7339
- z.object({
7340
- resourceType: z.object({
7341
- _id: z.string().describe("The type of the resource.").regex(
7342
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
7343
- "Must be a valid GUID"
7344
- ).optional().nullable(),
7345
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
7346
- }).describe(
7347
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
7348
- ).optional()
7349
- })
7900
+ z.intersection(
7901
+ z.object({
7902
+ resourceType: z.object({
7903
+ _id: z.string().describe("The type of the resource.").regex(
7904
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
7905
+ "Must be a valid GUID"
7906
+ ).optional().nullable(),
7907
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
7908
+ }).describe(
7909
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
7910
+ ).optional()
7911
+ }),
7912
+ z.xor([
7913
+ z.object({ resourceIds: z.never().optional() }),
7914
+ z.object({
7915
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
7916
+ "IDs of specific [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)\nassigned to this service resource. Each ID must reference a resource within the specified `resourceType`.\n\nWhen set, only these resources are considered for availability and booking.\nWhen not set, all resources of the specified resource type are eligible."
7917
+ )
7918
+ })
7919
+ ])
7920
+ )
7350
7921
  ).max(3).optional(),
7351
7922
  supportedSlugs: z.array(
7352
7923
  z.object({
@@ -7473,8 +8044,18 @@ var BulkUpdateServicesByFilterRequest = z.object({
7473
8044
  taxableAddress: z.object({
7474
8045
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).optional()
7475
8046
  }).describe("Taxable address used to calculate tax").optional(),
7476
- inheritResourceLocations: z.boolean().describe(
7477
- "Whether to inherit resource locations for availability resolution."
8047
+ primaryResourceType: z.string().describe(
8048
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
8049
+ that serves as the primary resource for this appointment service. The primary resource type
8050
+ determines which resources drive slot assignment and availability resolution.
8051
+
8052
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
8053
+ based on the rooms' schedules rather than staff schedules.
8054
+
8055
+ Default: The staff resource type.`
8056
+ ).regex(
8057
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
8058
+ "Must be a valid GUID"
7478
8059
  ).optional().nullable()
7479
8060
  }).describe("Service to update.")
7480
8061
  })
@@ -8121,15 +8702,54 @@ var BulkDeleteServicesResponse = z.object({
8121
8702
  availabilityConstraints: z.object({
8122
8703
  durations: z.array(
8123
8704
  z.object({
8124
- minutes: z.number().int().describe(
8125
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
8126
- ).min(1).max(44639).optional()
8705
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
8127
8706
  })
8128
8707
  ).max(50).optional(),
8129
8708
  sessionDurations: z.array(z.number().int()).max(50).optional(),
8130
8709
  timeBetweenSessions: z.number().int().describe(
8131
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
8132
- ).min(0).max(720).optional()
8710
+ "The number of minutes between the end of a session and the start of the next."
8711
+ ).min(0).max(720).optional(),
8712
+ durationRange: z.intersection(
8713
+ z.object({
8714
+ unitType: z.enum(["HOUR", "DAY"]).describe(
8715
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
8716
+ ).optional()
8717
+ }),
8718
+ z.xor([
8719
+ z.object({
8720
+ hourOptions: z.never().optional(),
8721
+ dayOptions: z.never().optional()
8722
+ }),
8723
+ z.object({
8724
+ dayOptions: z.never().optional(),
8725
+ hourOptions: z.object({
8726
+ minDurationInMinutes: z.number().int().describe(
8727
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
8728
+ ).min(30).max(1440).optional(),
8729
+ maxDurationInMinutes: z.number().int().describe(
8730
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
8731
+ ).min(30).max(1440).optional()
8732
+ }).describe(
8733
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
8734
+ )
8735
+ }),
8736
+ z.object({
8737
+ hourOptions: z.never().optional(),
8738
+ dayOptions: z.object({
8739
+ minDurationInDays: z.number().int().describe(
8740
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
8741
+ ).min(1).max(8).optional(),
8742
+ maxDurationInDays: z.number().int().describe(
8743
+ "Maximum bookable duration in days. The customer can't book for more than this number of days.\n\nMust be greater than or equal to `minDurationInDays`."
8744
+ ).min(1).max(8).optional()
8745
+ }).describe(
8746
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
8747
+ )
8748
+ })
8749
+ ])
8750
+ ).describe(
8751
+ "Duration range for the service. When set, the customer picks a duration\nwithin the configured min/max range instead of a fixed session duration.\nMutually exclusive with `sessionDurations`. A service uses one or the other.\nCan't be combined with `workingHours`.\n\nUse `durationRange` for services where the customer chooses how long to book,\nsuch as equipment or space rentals. The `unitType` determines whether the range\nis measured in hours or days."
8752
+ ).optional()
8133
8753
  }).describe("Limitations affecting the service availability.").optional()
8134
8754
  }).describe(
8135
8755
  "The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction),\nwhich can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction)."
@@ -8162,17 +8782,29 @@ var BulkDeleteServicesResponse = z.object({
8162
8782
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
8163
8783
  ).optional(),
8164
8784
  serviceResources: z.array(
8165
- z.object({
8166
- resourceType: z.object({
8167
- _id: z.string().describe("The type of the resource.").regex(
8168
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
8169
- "Must be a valid GUID"
8170
- ).optional().nullable(),
8171
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
8172
- }).describe(
8173
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
8174
- ).optional()
8175
- })
8785
+ z.intersection(
8786
+ z.object({
8787
+ resourceType: z.object({
8788
+ _id: z.string().describe("The type of the resource.").regex(
8789
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
8790
+ "Must be a valid GUID"
8791
+ ).optional().nullable(),
8792
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
8793
+ }).describe(
8794
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
8795
+ ).optional()
8796
+ }),
8797
+ z.xor([
8798
+ z.object({ resourceIds: z.never().optional() }),
8799
+ z.object({
8800
+ resourceIds: z.object({
8801
+ values: z.array(z.string()).max(100).optional()
8802
+ }).describe(
8803
+ "IDs of specific [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)\nassigned to this service resource. Each ID must reference a resource within the specified `resourceType`.\n\nWhen set, only these resources are considered for availability and booking.\nWhen not set, all resources of the specified resource type are eligible."
8804
+ )
8805
+ })
8806
+ ])
8807
+ )
8176
8808
  ).max(3).optional(),
8177
8809
  supportedSlugs: z.array(
8178
8810
  z.object({
@@ -8299,8 +8931,18 @@ var BulkDeleteServicesResponse = z.object({
8299
8931
  taxableAddress: z.object({
8300
8932
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
8301
8933
  }).describe("Taxable address used to calculate tax").optional(),
8302
- inheritResourceLocations: z.boolean().describe(
8303
- "Whether to inherit resource locations for availability resolution."
8934
+ primaryResourceType: z.string().describe(
8935
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
8936
+ that serves as the primary resource for this appointment service. The primary resource type
8937
+ determines which resources drive slot assignment and availability resolution.
8938
+
8939
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
8940
+ based on the rooms' schedules rather than staff schedules.
8941
+
8942
+ Default: The staff resource type.`
8943
+ ).regex(
8944
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
8945
+ "Must be a valid GUID"
8304
8946
  ).optional().nullable()
8305
8947
  }).describe("Updated service.").optional()
8306
8948
  })
@@ -8674,7 +9316,8 @@ var QueryServicesRequest = z.object({
8674
9316
  z.enum([
8675
9317
  "STAFF_MEMBER_DETAILS",
8676
9318
  "RESOURCE_TYPE_DETAILS",
8677
- "DISCOUNT_INFO_DETAILS"
9319
+ "DISCOUNT_INFO_DETAILS",
9320
+ "RESOURCE_DETAILS"
8678
9321
  ])
8679
9322
  ).max(5).optional()
8680
9323
  }).optional()
@@ -9239,15 +9882,54 @@ var QueryServicesResponse = z.object({
9239
9882
  availabilityConstraints: z.object({
9240
9883
  durations: z.array(
9241
9884
  z.object({
9242
- minutes: z.number().int().describe(
9243
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
9244
- ).min(1).max(44639).optional()
9885
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
9245
9886
  })
9246
9887
  ).max(50).optional(),
9247
9888
  sessionDurations: z.array(z.number().int()).max(50).optional(),
9248
9889
  timeBetweenSessions: z.number().int().describe(
9249
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
9250
- ).min(0).max(720).optional()
9890
+ "The number of minutes between the end of a session and the start of the next."
9891
+ ).min(0).max(720).optional(),
9892
+ durationRange: z.intersection(
9893
+ z.object({
9894
+ unitType: z.enum(["HOUR", "DAY"]).describe(
9895
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
9896
+ ).optional()
9897
+ }),
9898
+ z.xor([
9899
+ z.object({
9900
+ hourOptions: z.never().optional(),
9901
+ dayOptions: z.never().optional()
9902
+ }),
9903
+ z.object({
9904
+ dayOptions: z.never().optional(),
9905
+ hourOptions: z.object({
9906
+ minDurationInMinutes: z.number().int().describe(
9907
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
9908
+ ).min(30).max(1440).optional(),
9909
+ maxDurationInMinutes: z.number().int().describe(
9910
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
9911
+ ).min(30).max(1440).optional()
9912
+ }).describe(
9913
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
9914
+ )
9915
+ }),
9916
+ z.object({
9917
+ hourOptions: z.never().optional(),
9918
+ dayOptions: z.object({
9919
+ minDurationInDays: z.number().int().describe(
9920
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
9921
+ ).min(1).max(8).optional(),
9922
+ maxDurationInDays: z.number().int().describe(
9923
+ "Maximum bookable duration in days. The customer can't book for more than this number of days.\n\nMust be greater than or equal to `minDurationInDays`."
9924
+ ).min(1).max(8).optional()
9925
+ }).describe(
9926
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
9927
+ )
9928
+ })
9929
+ ])
9930
+ ).describe(
9931
+ "Duration range for the service. When set, the customer picks a duration\nwithin the configured min/max range instead of a fixed session duration.\nMutually exclusive with `sessionDurations`. A service uses one or the other.\nCan't be combined with `workingHours`.\n\nUse `durationRange` for services where the customer chooses how long to book,\nsuch as equipment or space rentals. The `unitType` determines whether the range\nis measured in hours or days."
9932
+ ).optional()
9251
9933
  }).describe("Limitations affecting the service availability.").optional()
9252
9934
  }).describe(
9253
9935
  "The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction),\nwhich can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction)."
@@ -9280,17 +9962,27 @@ var QueryServicesResponse = z.object({
9280
9962
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
9281
9963
  ).optional(),
9282
9964
  serviceResources: z.array(
9283
- z.object({
9284
- resourceType: z.object({
9285
- _id: z.string().describe("The type of the resource.").regex(
9286
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
9287
- "Must be a valid GUID"
9288
- ).optional().nullable(),
9289
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
9290
- }).describe(
9291
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
9292
- ).optional()
9293
- })
9965
+ z.intersection(
9966
+ z.object({
9967
+ resourceType: z.object({
9968
+ _id: z.string().describe("The type of the resource.").regex(
9969
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
9970
+ "Must be a valid GUID"
9971
+ ).optional().nullable(),
9972
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
9973
+ }).describe(
9974
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
9975
+ ).optional()
9976
+ }),
9977
+ z.xor([
9978
+ z.object({ resourceIds: z.never().optional() }),
9979
+ z.object({
9980
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
9981
+ "IDs of specific [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)\nassigned to this service resource. Each ID must reference a resource within the specified `resourceType`.\n\nWhen set, only these resources are considered for availability and booking.\nWhen not set, all resources of the specified resource type are eligible."
9982
+ )
9983
+ })
9984
+ ])
9985
+ )
9294
9986
  ).max(3).optional(),
9295
9987
  supportedSlugs: z.array(
9296
9988
  z.object({
@@ -9417,8 +10109,18 @@ var QueryServicesResponse = z.object({
9417
10109
  taxableAddress: z.object({
9418
10110
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
9419
10111
  }).describe("Taxable address used to calculate tax").optional(),
9420
- inheritResourceLocations: z.boolean().describe(
9421
- "Whether to inherit resource locations for availability resolution."
10112
+ primaryResourceType: z.string().describe(
10113
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
10114
+ that serves as the primary resource for this appointment service. The primary resource type
10115
+ determines which resources drive slot assignment and availability resolution.
10116
+
10117
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
10118
+ based on the rooms' schedules rather than staff schedules.
10119
+
10120
+ Default: The staff resource type.`
10121
+ ).regex(
10122
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
10123
+ "Must be a valid GUID"
9422
10124
  ).optional().nullable()
9423
10125
  })
9424
10126
  ).optional(),
@@ -10396,15 +11098,54 @@ var SearchServicesResponse = z.object({
10396
11098
  availabilityConstraints: z.object({
10397
11099
  durations: z.array(
10398
11100
  z.object({
10399
- minutes: z.number().int().describe(
10400
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
10401
- ).min(1).max(44639).optional()
11101
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
10402
11102
  })
10403
11103
  ).max(50).optional(),
10404
11104
  sessionDurations: z.array(z.number().int()).max(50).optional(),
10405
11105
  timeBetweenSessions: z.number().int().describe(
10406
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
10407
- ).min(0).max(720).optional()
11106
+ "The number of minutes between the end of a session and the start of the next."
11107
+ ).min(0).max(720).optional(),
11108
+ durationRange: z.intersection(
11109
+ z.object({
11110
+ unitType: z.enum(["HOUR", "DAY"]).describe(
11111
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
11112
+ ).optional()
11113
+ }),
11114
+ z.xor([
11115
+ z.object({
11116
+ hourOptions: z.never().optional(),
11117
+ dayOptions: z.never().optional()
11118
+ }),
11119
+ z.object({
11120
+ dayOptions: z.never().optional(),
11121
+ hourOptions: z.object({
11122
+ minDurationInMinutes: z.number().int().describe(
11123
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
11124
+ ).min(30).max(1440).optional(),
11125
+ maxDurationInMinutes: z.number().int().describe(
11126
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
11127
+ ).min(30).max(1440).optional()
11128
+ }).describe(
11129
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
11130
+ )
11131
+ }),
11132
+ z.object({
11133
+ hourOptions: z.never().optional(),
11134
+ dayOptions: z.object({
11135
+ minDurationInDays: z.number().int().describe(
11136
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
11137
+ ).min(1).max(8).optional(),
11138
+ maxDurationInDays: z.number().int().describe(
11139
+ "Maximum bookable duration in days. The customer can't book for more than this number of days.\n\nMust be greater than or equal to `minDurationInDays`."
11140
+ ).min(1).max(8).optional()
11141
+ }).describe(
11142
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
11143
+ )
11144
+ })
11145
+ ])
11146
+ ).describe(
11147
+ "Duration range for the service. When set, the customer picks a duration\nwithin the configured min/max range instead of a fixed session duration.\nMutually exclusive with `sessionDurations`. A service uses one or the other.\nCan't be combined with `workingHours`.\n\nUse `durationRange` for services where the customer chooses how long to book,\nsuch as equipment or space rentals. The `unitType` determines whether the range\nis measured in hours or days."
11148
+ ).optional()
10408
11149
  }).describe("Limitations affecting the service availability.").optional()
10409
11150
  }).describe(
10410
11151
  "The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction),\nwhich can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction)."
@@ -10437,17 +11178,27 @@ var SearchServicesResponse = z.object({
10437
11178
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
10438
11179
  ).optional(),
10439
11180
  serviceResources: z.array(
10440
- z.object({
10441
- resourceType: z.object({
10442
- _id: z.string().describe("The type of the resource.").regex(
10443
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
10444
- "Must be a valid GUID"
10445
- ).optional().nullable(),
10446
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
10447
- }).describe(
10448
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
10449
- ).optional()
10450
- })
11181
+ z.intersection(
11182
+ z.object({
11183
+ resourceType: z.object({
11184
+ _id: z.string().describe("The type of the resource.").regex(
11185
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
11186
+ "Must be a valid GUID"
11187
+ ).optional().nullable(),
11188
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
11189
+ }).describe(
11190
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
11191
+ ).optional()
11192
+ }),
11193
+ z.xor([
11194
+ z.object({ resourceIds: z.never().optional() }),
11195
+ z.object({
11196
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
11197
+ "IDs of specific [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)\nassigned to this service resource. Each ID must reference a resource within the specified `resourceType`.\n\nWhen set, only these resources are considered for availability and booking.\nWhen not set, all resources of the specified resource type are eligible."
11198
+ )
11199
+ })
11200
+ ])
11201
+ )
10451
11202
  ).max(3).optional(),
10452
11203
  supportedSlugs: z.array(
10453
11204
  z.object({
@@ -10574,8 +11325,18 @@ var SearchServicesResponse = z.object({
10574
11325
  taxableAddress: z.object({
10575
11326
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
10576
11327
  }).describe("Taxable address used to calculate tax").optional(),
10577
- inheritResourceLocations: z.boolean().describe(
10578
- "Whether to inherit resource locations for availability resolution."
11328
+ primaryResourceType: z.string().describe(
11329
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
11330
+ that serves as the primary resource for this appointment service. The primary resource type
11331
+ determines which resources drive slot assignment and availability resolution.
11332
+
11333
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
11334
+ based on the rooms' schedules rather than staff schedules.
11335
+
11336
+ Default: The staff resource type.`
11337
+ ).regex(
11338
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
11339
+ "Must be a valid GUID"
10579
11340
  ).optional().nullable()
10580
11341
  })
10581
11342
  ).optional(),
@@ -11637,14 +12398,55 @@ var QueryPoliciesResponse = z.object({
11637
12398
  durations: z.array(
11638
12399
  z.object({
11639
12400
  minutes: z.number().int().describe(
11640
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
12401
+ "The duration of the service in minutes."
11641
12402
  ).min(1).max(44639).optional()
11642
12403
  })
11643
12404
  ).max(50).optional(),
11644
12405
  sessionDurations: z.array(z.number().int()).max(50).optional(),
11645
12406
  timeBetweenSessions: z.number().int().describe(
11646
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
11647
- ).min(0).max(720).optional()
12407
+ "The number of minutes between the end of a session and the start of the next."
12408
+ ).min(0).max(720).optional(),
12409
+ durationRange: z.intersection(
12410
+ z.object({
12411
+ unitType: z.enum(["HOUR", "DAY"]).describe(
12412
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
12413
+ ).optional()
12414
+ }),
12415
+ z.xor([
12416
+ z.object({
12417
+ hourOptions: z.never().optional(),
12418
+ dayOptions: z.never().optional()
12419
+ }),
12420
+ z.object({
12421
+ dayOptions: z.never().optional(),
12422
+ hourOptions: z.object({
12423
+ minDurationInMinutes: z.number().int().describe(
12424
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
12425
+ ).min(30).max(1440).optional(),
12426
+ maxDurationInMinutes: z.number().int().describe(
12427
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
12428
+ ).min(30).max(1440).optional()
12429
+ }).describe(
12430
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
12431
+ )
12432
+ }),
12433
+ z.object({
12434
+ hourOptions: z.never().optional(),
12435
+ dayOptions: z.object({
12436
+ minDurationInDays: z.number().int().describe(
12437
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
12438
+ ).min(1).max(8).optional(),
12439
+ maxDurationInDays: z.number().int().describe(
12440
+ "Maximum bookable duration in days. The customer can't book for more than this number of days.\n\nMust be greater than or equal to `minDurationInDays`."
12441
+ ).min(1).max(8).optional()
12442
+ }).describe(
12443
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
12444
+ )
12445
+ })
12446
+ ])
12447
+ ).describe(
12448
+ "Duration range for the service. When set, the customer picks a duration\nwithin the configured min/max range instead of a fixed session duration.\nMutually exclusive with `sessionDurations`. A service uses one or the other.\nCan't be combined with `workingHours`.\n\nUse `durationRange` for services where the customer chooses how long to book,\nsuch as equipment or space rentals. The `unitType` determines whether the range\nis measured in hours or days."
12449
+ ).optional()
11648
12450
  }).describe("Limitations affecting the service availability.").optional()
11649
12451
  }).describe(
11650
12452
  "The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction),\nwhich can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction)."
@@ -11677,17 +12479,29 @@ var QueryPoliciesResponse = z.object({
11677
12479
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
11678
12480
  ).optional(),
11679
12481
  serviceResources: z.array(
11680
- z.object({
11681
- resourceType: z.object({
11682
- _id: z.string().describe("The type of the resource.").regex(
11683
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
11684
- "Must be a valid GUID"
11685
- ).optional().nullable(),
11686
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
11687
- }).describe(
11688
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
11689
- ).optional()
11690
- })
12482
+ z.intersection(
12483
+ z.object({
12484
+ resourceType: z.object({
12485
+ _id: z.string().describe("The type of the resource.").regex(
12486
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
12487
+ "Must be a valid GUID"
12488
+ ).optional().nullable(),
12489
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
12490
+ }).describe(
12491
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
12492
+ ).optional()
12493
+ }),
12494
+ z.xor([
12495
+ z.object({ resourceIds: z.never().optional() }),
12496
+ z.object({
12497
+ resourceIds: z.object({
12498
+ values: z.array(z.string()).max(100).optional()
12499
+ }).describe(
12500
+ "IDs of specific [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)\nassigned to this service resource. Each ID must reference a resource within the specified `resourceType`.\n\nWhen set, only these resources are considered for availability and booking.\nWhen not set, all resources of the specified resource type are eligible."
12501
+ )
12502
+ })
12503
+ ])
12504
+ )
11691
12505
  ).max(3).optional(),
11692
12506
  supportedSlugs: z.array(
11693
12507
  z.object({
@@ -11814,8 +12628,18 @@ var QueryPoliciesResponse = z.object({
11814
12628
  taxableAddress: z.object({
11815
12629
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
11816
12630
  }).describe("Taxable address used to calculate tax").optional(),
11817
- inheritResourceLocations: z.boolean().describe(
11818
- "Whether to inherit resource locations for availability resolution."
12631
+ primaryResourceType: z.string().describe(
12632
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
12633
+ that serves as the primary resource for this appointment service. The primary resource type
12634
+ determines which resources drive slot assignment and availability resolution.
12635
+
12636
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
12637
+ based on the rooms' schedules rather than staff schedules.
12638
+
12639
+ Default: The staff resource type.`
12640
+ ).regex(
12641
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
12642
+ "Must be a valid GUID"
11819
12643
  ).optional().nullable()
11820
12644
  })
11821
12645
  ).max(5).optional(),
@@ -12802,15 +13626,54 @@ var SetServiceLocationsResponse = z.object({
12802
13626
  availabilityConstraints: z.object({
12803
13627
  durations: z.array(
12804
13628
  z.object({
12805
- minutes: z.number().int().describe(
12806
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
12807
- ).min(1).max(44639).optional()
13629
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
12808
13630
  })
12809
13631
  ).max(50).optional(),
12810
13632
  sessionDurations: z.array(z.number().int()).max(50).optional(),
12811
13633
  timeBetweenSessions: z.number().int().describe(
12812
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
12813
- ).min(0).max(720).optional()
13634
+ "The number of minutes between the end of a session and the start of the next."
13635
+ ).min(0).max(720).optional(),
13636
+ durationRange: z.intersection(
13637
+ z.object({
13638
+ unitType: z.enum(["HOUR", "DAY"]).describe(
13639
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
13640
+ ).optional()
13641
+ }),
13642
+ z.xor([
13643
+ z.object({
13644
+ hourOptions: z.never().optional(),
13645
+ dayOptions: z.never().optional()
13646
+ }),
13647
+ z.object({
13648
+ dayOptions: z.never().optional(),
13649
+ hourOptions: z.object({
13650
+ minDurationInMinutes: z.number().int().describe(
13651
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
13652
+ ).min(30).max(1440).optional(),
13653
+ maxDurationInMinutes: z.number().int().describe(
13654
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
13655
+ ).min(30).max(1440).optional()
13656
+ }).describe(
13657
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
13658
+ )
13659
+ }),
13660
+ z.object({
13661
+ hourOptions: z.never().optional(),
13662
+ dayOptions: z.object({
13663
+ minDurationInDays: z.number().int().describe(
13664
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
13665
+ ).min(1).max(8).optional(),
13666
+ maxDurationInDays: z.number().int().describe(
13667
+ "Maximum bookable duration in days. The customer can't book for more than this number of days.\n\nMust be greater than or equal to `minDurationInDays`."
13668
+ ).min(1).max(8).optional()
13669
+ }).describe(
13670
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
13671
+ )
13672
+ })
13673
+ ])
13674
+ ).describe(
13675
+ "Duration range for the service. When set, the customer picks a duration\nwithin the configured min/max range instead of a fixed session duration.\nMutually exclusive with `sessionDurations`. A service uses one or the other.\nCan't be combined with `workingHours`.\n\nUse `durationRange` for services where the customer chooses how long to book,\nsuch as equipment or space rentals. The `unitType` determines whether the range\nis measured in hours or days."
13676
+ ).optional()
12814
13677
  }).describe("Limitations affecting the service availability.").optional()
12815
13678
  }).describe(
12816
13679
  "The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction),\nwhich can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction)."
@@ -12843,17 +13706,27 @@ var SetServiceLocationsResponse = z.object({
12843
13706
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
12844
13707
  ).optional(),
12845
13708
  serviceResources: z.array(
12846
- z.object({
12847
- resourceType: z.object({
12848
- _id: z.string().describe("The type of the resource.").regex(
12849
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
12850
- "Must be a valid GUID"
12851
- ).optional().nullable(),
12852
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
12853
- }).describe(
12854
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
12855
- ).optional()
12856
- })
13709
+ z.intersection(
13710
+ z.object({
13711
+ resourceType: z.object({
13712
+ _id: z.string().describe("The type of the resource.").regex(
13713
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
13714
+ "Must be a valid GUID"
13715
+ ).optional().nullable(),
13716
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
13717
+ }).describe(
13718
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
13719
+ ).optional()
13720
+ }),
13721
+ z.xor([
13722
+ z.object({ resourceIds: z.never().optional() }),
13723
+ z.object({
13724
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
13725
+ "IDs of specific [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)\nassigned to this service resource. Each ID must reference a resource within the specified `resourceType`.\n\nWhen set, only these resources are considered for availability and booking.\nWhen not set, all resources of the specified resource type are eligible."
13726
+ )
13727
+ })
13728
+ ])
13729
+ )
12857
13730
  ).max(3).optional(),
12858
13731
  supportedSlugs: z.array(
12859
13732
  z.object({
@@ -12980,8 +13853,18 @@ var SetServiceLocationsResponse = z.object({
12980
13853
  taxableAddress: z.object({
12981
13854
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
12982
13855
  }).describe("Taxable address used to calculate tax").optional(),
12983
- inheritResourceLocations: z.boolean().describe(
12984
- "Whether to inherit resource locations for availability resolution."
13856
+ primaryResourceType: z.string().describe(
13857
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
13858
+ that serves as the primary resource for this appointment service. The primary resource type
13859
+ determines which resources drive slot assignment and availability resolution.
13860
+
13861
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
13862
+ based on the rooms' schedules rather than staff schedules.
13863
+
13864
+ Default: The staff resource type.`
13865
+ ).regex(
13866
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
13867
+ "Must be a valid GUID"
12985
13868
  ).optional().nullable()
12986
13869
  }).describe("The updated service with the newly set locations.").optional()
12987
13870
  });
@@ -13547,15 +14430,54 @@ var EnablePricingPlansForServiceResponse = z.object({
13547
14430
  availabilityConstraints: z.object({
13548
14431
  durations: z.array(
13549
14432
  z.object({
13550
- minutes: z.number().int().describe(
13551
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
13552
- ).min(1).max(44639).optional()
14433
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
13553
14434
  })
13554
14435
  ).max(50).optional(),
13555
14436
  sessionDurations: z.array(z.number().int()).max(50).optional(),
13556
14437
  timeBetweenSessions: z.number().int().describe(
13557
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
13558
- ).min(0).max(720).optional()
14438
+ "The number of minutes between the end of a session and the start of the next."
14439
+ ).min(0).max(720).optional(),
14440
+ durationRange: z.intersection(
14441
+ z.object({
14442
+ unitType: z.enum(["HOUR", "DAY"]).describe(
14443
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
14444
+ ).optional()
14445
+ }),
14446
+ z.xor([
14447
+ z.object({
14448
+ hourOptions: z.never().optional(),
14449
+ dayOptions: z.never().optional()
14450
+ }),
14451
+ z.object({
14452
+ dayOptions: z.never().optional(),
14453
+ hourOptions: z.object({
14454
+ minDurationInMinutes: z.number().int().describe(
14455
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
14456
+ ).min(30).max(1440).optional(),
14457
+ maxDurationInMinutes: z.number().int().describe(
14458
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
14459
+ ).min(30).max(1440).optional()
14460
+ }).describe(
14461
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
14462
+ )
14463
+ }),
14464
+ z.object({
14465
+ hourOptions: z.never().optional(),
14466
+ dayOptions: z.object({
14467
+ minDurationInDays: z.number().int().describe(
14468
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
14469
+ ).min(1).max(8).optional(),
14470
+ maxDurationInDays: z.number().int().describe(
14471
+ "Maximum bookable duration in days. The customer can't book for more than this number of days.\n\nMust be greater than or equal to `minDurationInDays`."
14472
+ ).min(1).max(8).optional()
14473
+ }).describe(
14474
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
14475
+ )
14476
+ })
14477
+ ])
14478
+ ).describe(
14479
+ "Duration range for the service. When set, the customer picks a duration\nwithin the configured min/max range instead of a fixed session duration.\nMutually exclusive with `sessionDurations`. A service uses one or the other.\nCan't be combined with `workingHours`.\n\nUse `durationRange` for services where the customer chooses how long to book,\nsuch as equipment or space rentals. The `unitType` determines whether the range\nis measured in hours or days."
14480
+ ).optional()
13559
14481
  }).describe("Limitations affecting the service availability.").optional()
13560
14482
  }).describe(
13561
14483
  "The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction),\nwhich can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction)."
@@ -13588,17 +14510,27 @@ var EnablePricingPlansForServiceResponse = z.object({
13588
14510
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
13589
14511
  ).optional(),
13590
14512
  serviceResources: z.array(
13591
- z.object({
13592
- resourceType: z.object({
13593
- _id: z.string().describe("The type of the resource.").regex(
13594
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
13595
- "Must be a valid GUID"
13596
- ).optional().nullable(),
13597
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
13598
- }).describe(
13599
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
13600
- ).optional()
13601
- })
14513
+ z.intersection(
14514
+ z.object({
14515
+ resourceType: z.object({
14516
+ _id: z.string().describe("The type of the resource.").regex(
14517
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
14518
+ "Must be a valid GUID"
14519
+ ).optional().nullable(),
14520
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
14521
+ }).describe(
14522
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
14523
+ ).optional()
14524
+ }),
14525
+ z.xor([
14526
+ z.object({ resourceIds: z.never().optional() }),
14527
+ z.object({
14528
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
14529
+ "IDs of specific [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)\nassigned to this service resource. Each ID must reference a resource within the specified `resourceType`.\n\nWhen set, only these resources are considered for availability and booking.\nWhen not set, all resources of the specified resource type are eligible."
14530
+ )
14531
+ })
14532
+ ])
14533
+ )
13602
14534
  ).max(3).optional(),
13603
14535
  supportedSlugs: z.array(
13604
14536
  z.object({
@@ -13725,8 +14657,18 @@ var EnablePricingPlansForServiceResponse = z.object({
13725
14657
  taxableAddress: z.object({
13726
14658
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
13727
14659
  }).describe("Taxable address used to calculate tax").optional(),
13728
- inheritResourceLocations: z.boolean().describe(
13729
- "Whether to inherit resource locations for availability resolution."
14660
+ primaryResourceType: z.string().describe(
14661
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
14662
+ that serves as the primary resource for this appointment service. The primary resource type
14663
+ determines which resources drive slot assignment and availability resolution.
14664
+
14665
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
14666
+ based on the rooms' schedules rather than staff schedules.
14667
+
14668
+ Default: The staff resource type.`
14669
+ ).regex(
14670
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
14671
+ "Must be a valid GUID"
13730
14672
  ).optional().nullable()
13731
14673
  }).describe("Updated service.").optional()
13732
14674
  });
@@ -14292,15 +15234,54 @@ var DisablePricingPlansForServiceResponse = z.object({
14292
15234
  availabilityConstraints: z.object({
14293
15235
  durations: z.array(
14294
15236
  z.object({
14295
- minutes: z.number().int().describe(
14296
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
14297
- ).min(1).max(44639).optional()
15237
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
14298
15238
  })
14299
15239
  ).max(50).optional(),
14300
15240
  sessionDurations: z.array(z.number().int()).max(50).optional(),
14301
15241
  timeBetweenSessions: z.number().int().describe(
14302
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
14303
- ).min(0).max(720).optional()
15242
+ "The number of minutes between the end of a session and the start of the next."
15243
+ ).min(0).max(720).optional(),
15244
+ durationRange: z.intersection(
15245
+ z.object({
15246
+ unitType: z.enum(["HOUR", "DAY"]).describe(
15247
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
15248
+ ).optional()
15249
+ }),
15250
+ z.xor([
15251
+ z.object({
15252
+ hourOptions: z.never().optional(),
15253
+ dayOptions: z.never().optional()
15254
+ }),
15255
+ z.object({
15256
+ dayOptions: z.never().optional(),
15257
+ hourOptions: z.object({
15258
+ minDurationInMinutes: z.number().int().describe(
15259
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
15260
+ ).min(30).max(1440).optional(),
15261
+ maxDurationInMinutes: z.number().int().describe(
15262
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
15263
+ ).min(30).max(1440).optional()
15264
+ }).describe(
15265
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
15266
+ )
15267
+ }),
15268
+ z.object({
15269
+ hourOptions: z.never().optional(),
15270
+ dayOptions: z.object({
15271
+ minDurationInDays: z.number().int().describe(
15272
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
15273
+ ).min(1).max(8).optional(),
15274
+ maxDurationInDays: z.number().int().describe(
15275
+ "Maximum bookable duration in days. The customer can't book for more than this number of days.\n\nMust be greater than or equal to `minDurationInDays`."
15276
+ ).min(1).max(8).optional()
15277
+ }).describe(
15278
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
15279
+ )
15280
+ })
15281
+ ])
15282
+ ).describe(
15283
+ "Duration range for the service. When set, the customer picks a duration\nwithin the configured min/max range instead of a fixed session duration.\nMutually exclusive with `sessionDurations`. A service uses one or the other.\nCan't be combined with `workingHours`.\n\nUse `durationRange` for services where the customer chooses how long to book,\nsuch as equipment or space rentals. The `unitType` determines whether the range\nis measured in hours or days."
15284
+ ).optional()
14304
15285
  }).describe("Limitations affecting the service availability.").optional()
14305
15286
  }).describe(
14306
15287
  "The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction),\nwhich can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction)."
@@ -14333,17 +15314,27 @@ var DisablePricingPlansForServiceResponse = z.object({
14333
15314
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
14334
15315
  ).optional(),
14335
15316
  serviceResources: z.array(
14336
- z.object({
14337
- resourceType: z.object({
14338
- _id: z.string().describe("The type of the resource.").regex(
14339
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
14340
- "Must be a valid GUID"
14341
- ).optional().nullable(),
14342
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
14343
- }).describe(
14344
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
14345
- ).optional()
14346
- })
15317
+ z.intersection(
15318
+ z.object({
15319
+ resourceType: z.object({
15320
+ _id: z.string().describe("The type of the resource.").regex(
15321
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
15322
+ "Must be a valid GUID"
15323
+ ).optional().nullable(),
15324
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
15325
+ }).describe(
15326
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
15327
+ ).optional()
15328
+ }),
15329
+ z.xor([
15330
+ z.object({ resourceIds: z.never().optional() }),
15331
+ z.object({
15332
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
15333
+ "IDs of specific [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)\nassigned to this service resource. Each ID must reference a resource within the specified `resourceType`.\n\nWhen set, only these resources are considered for availability and booking.\nWhen not set, all resources of the specified resource type are eligible."
15334
+ )
15335
+ })
15336
+ ])
15337
+ )
14347
15338
  ).max(3).optional(),
14348
15339
  supportedSlugs: z.array(
14349
15340
  z.object({
@@ -14470,8 +15461,18 @@ var DisablePricingPlansForServiceResponse = z.object({
14470
15461
  taxableAddress: z.object({
14471
15462
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
14472
15463
  }).describe("Taxable address used to calculate tax").optional(),
14473
- inheritResourceLocations: z.boolean().describe(
14474
- "Whether to inherit resource locations for availability resolution."
15464
+ primaryResourceType: z.string().describe(
15465
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
15466
+ that serves as the primary resource for this appointment service. The primary resource type
15467
+ determines which resources drive slot assignment and availability resolution.
15468
+
15469
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
15470
+ based on the rooms' schedules rather than staff schedules.
15471
+
15472
+ Default: The staff resource type.`
15473
+ ).regex(
15474
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
15475
+ "Must be a valid GUID"
14475
15476
  ).optional().nullable()
14476
15477
  }).describe("Updated service.").optional()
14477
15478
  });
@@ -15048,15 +16049,54 @@ var SetCustomSlugResponse = z.object({
15048
16049
  availabilityConstraints: z.object({
15049
16050
  durations: z.array(
15050
16051
  z.object({
15051
- minutes: z.number().int().describe(
15052
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
15053
- ).min(1).max(44639).optional()
16052
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
15054
16053
  })
15055
16054
  ).max(50).optional(),
15056
16055
  sessionDurations: z.array(z.number().int()).max(50).optional(),
15057
16056
  timeBetweenSessions: z.number().int().describe(
15058
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
15059
- ).min(0).max(720).optional()
16057
+ "The number of minutes between the end of a session and the start of the next."
16058
+ ).min(0).max(720).optional(),
16059
+ durationRange: z.intersection(
16060
+ z.object({
16061
+ unitType: z.enum(["HOUR", "DAY"]).describe(
16062
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
16063
+ ).optional()
16064
+ }),
16065
+ z.xor([
16066
+ z.object({
16067
+ hourOptions: z.never().optional(),
16068
+ dayOptions: z.never().optional()
16069
+ }),
16070
+ z.object({
16071
+ dayOptions: z.never().optional(),
16072
+ hourOptions: z.object({
16073
+ minDurationInMinutes: z.number().int().describe(
16074
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
16075
+ ).min(30).max(1440).optional(),
16076
+ maxDurationInMinutes: z.number().int().describe(
16077
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
16078
+ ).min(30).max(1440).optional()
16079
+ }).describe(
16080
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
16081
+ )
16082
+ }),
16083
+ z.object({
16084
+ hourOptions: z.never().optional(),
16085
+ dayOptions: z.object({
16086
+ minDurationInDays: z.number().int().describe(
16087
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
16088
+ ).min(1).max(8).optional(),
16089
+ maxDurationInDays: z.number().int().describe(
16090
+ "Maximum bookable duration in days. The customer can't book for more than this number of days.\n\nMust be greater than or equal to `minDurationInDays`."
16091
+ ).min(1).max(8).optional()
16092
+ }).describe(
16093
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
16094
+ )
16095
+ })
16096
+ ])
16097
+ ).describe(
16098
+ "Duration range for the service. When set, the customer picks a duration\nwithin the configured min/max range instead of a fixed session duration.\nMutually exclusive with `sessionDurations`. A service uses one or the other.\nCan't be combined with `workingHours`.\n\nUse `durationRange` for services where the customer chooses how long to book,\nsuch as equipment or space rentals. The `unitType` determines whether the range\nis measured in hours or days."
16099
+ ).optional()
15060
16100
  }).describe("Limitations affecting the service availability.").optional()
15061
16101
  }).describe(
15062
16102
  "The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction),\nwhich can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction)."
@@ -15089,17 +16129,27 @@ var SetCustomSlugResponse = z.object({
15089
16129
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
15090
16130
  ).optional(),
15091
16131
  serviceResources: z.array(
15092
- z.object({
15093
- resourceType: z.object({
15094
- _id: z.string().describe("The type of the resource.").regex(
15095
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
15096
- "Must be a valid GUID"
15097
- ).optional().nullable(),
15098
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
15099
- }).describe(
15100
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
15101
- ).optional()
15102
- })
16132
+ z.intersection(
16133
+ z.object({
16134
+ resourceType: z.object({
16135
+ _id: z.string().describe("The type of the resource.").regex(
16136
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
16137
+ "Must be a valid GUID"
16138
+ ).optional().nullable(),
16139
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
16140
+ }).describe(
16141
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
16142
+ ).optional()
16143
+ }),
16144
+ z.xor([
16145
+ z.object({ resourceIds: z.never().optional() }),
16146
+ z.object({
16147
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
16148
+ "IDs of specific [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)\nassigned to this service resource. Each ID must reference a resource within the specified `resourceType`.\n\nWhen set, only these resources are considered for availability and booking.\nWhen not set, all resources of the specified resource type are eligible."
16149
+ )
16150
+ })
16151
+ ])
16152
+ )
15103
16153
  ).max(3).optional(),
15104
16154
  supportedSlugs: z.array(
15105
16155
  z.object({
@@ -15226,8 +16276,18 @@ var SetCustomSlugResponse = z.object({
15226
16276
  taxableAddress: z.object({
15227
16277
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
15228
16278
  }).describe("Taxable address used to calculate tax").optional(),
15229
- inheritResourceLocations: z.boolean().describe(
15230
- "Whether to inherit resource locations for availability resolution."
16279
+ primaryResourceType: z.string().describe(
16280
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
16281
+ that serves as the primary resource for this appointment service. The primary resource type
16282
+ determines which resources drive slot assignment and availability resolution.
16283
+
16284
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
16285
+ based on the rooms' schedules rather than staff schedules.
16286
+
16287
+ Default: The staff resource type.`
16288
+ ).regex(
16289
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
16290
+ "Must be a valid GUID"
15231
16291
  ).optional().nullable()
15232
16292
  }).describe("Updated service.").optional()
15233
16293
  });
@@ -15806,15 +16866,54 @@ var CloneServiceResponse = z.object({
15806
16866
  availabilityConstraints: z.object({
15807
16867
  durations: z.array(
15808
16868
  z.object({
15809
- minutes: z.number().int().describe(
15810
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
15811
- ).min(1).max(44639).optional()
16869
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
15812
16870
  })
15813
16871
  ).max(50).optional(),
15814
16872
  sessionDurations: z.array(z.number().int()).max(50).optional(),
15815
16873
  timeBetweenSessions: z.number().int().describe(
15816
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
15817
- ).min(0).max(720).optional()
16874
+ "The number of minutes between the end of a session and the start of the next."
16875
+ ).min(0).max(720).optional(),
16876
+ durationRange: z.intersection(
16877
+ z.object({
16878
+ unitType: z.enum(["HOUR", "DAY"]).describe(
16879
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
16880
+ ).optional()
16881
+ }),
16882
+ z.xor([
16883
+ z.object({
16884
+ hourOptions: z.never().optional(),
16885
+ dayOptions: z.never().optional()
16886
+ }),
16887
+ z.object({
16888
+ dayOptions: z.never().optional(),
16889
+ hourOptions: z.object({
16890
+ minDurationInMinutes: z.number().int().describe(
16891
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
16892
+ ).min(30).max(1440).optional(),
16893
+ maxDurationInMinutes: z.number().int().describe(
16894
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
16895
+ ).min(30).max(1440).optional()
16896
+ }).describe(
16897
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
16898
+ )
16899
+ }),
16900
+ z.object({
16901
+ hourOptions: z.never().optional(),
16902
+ dayOptions: z.object({
16903
+ minDurationInDays: z.number().int().describe(
16904
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
16905
+ ).min(1).max(8).optional(),
16906
+ maxDurationInDays: z.number().int().describe(
16907
+ "Maximum bookable duration in days. The customer can't book for more than this number of days.\n\nMust be greater than or equal to `minDurationInDays`."
16908
+ ).min(1).max(8).optional()
16909
+ }).describe(
16910
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
16911
+ )
16912
+ })
16913
+ ])
16914
+ ).describe(
16915
+ "Duration range for the service. When set, the customer picks a duration\nwithin the configured min/max range instead of a fixed session duration.\nMutually exclusive with `sessionDurations`. A service uses one or the other.\nCan't be combined with `workingHours`.\n\nUse `durationRange` for services where the customer chooses how long to book,\nsuch as equipment or space rentals. The `unitType` determines whether the range\nis measured in hours or days."
16916
+ ).optional()
15818
16917
  }).describe("Limitations affecting the service availability.").optional()
15819
16918
  }).describe(
15820
16919
  "The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction),\nwhich can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction)."
@@ -15847,17 +16946,27 @@ var CloneServiceResponse = z.object({
15847
16946
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
15848
16947
  ).optional(),
15849
16948
  serviceResources: z.array(
15850
- z.object({
15851
- resourceType: z.object({
15852
- _id: z.string().describe("The type of the resource.").regex(
15853
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
15854
- "Must be a valid GUID"
15855
- ).optional().nullable(),
15856
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
15857
- }).describe(
15858
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
15859
- ).optional()
15860
- })
16949
+ z.intersection(
16950
+ z.object({
16951
+ resourceType: z.object({
16952
+ _id: z.string().describe("The type of the resource.").regex(
16953
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
16954
+ "Must be a valid GUID"
16955
+ ).optional().nullable(),
16956
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
16957
+ }).describe(
16958
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
16959
+ ).optional()
16960
+ }),
16961
+ z.xor([
16962
+ z.object({ resourceIds: z.never().optional() }),
16963
+ z.object({
16964
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
16965
+ "IDs of specific [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)\nassigned to this service resource. Each ID must reference a resource within the specified `resourceType`.\n\nWhen set, only these resources are considered for availability and booking.\nWhen not set, all resources of the specified resource type are eligible."
16966
+ )
16967
+ })
16968
+ ])
16969
+ )
15861
16970
  ).max(3).optional(),
15862
16971
  supportedSlugs: z.array(
15863
16972
  z.object({
@@ -15984,8 +17093,18 @@ var CloneServiceResponse = z.object({
15984
17093
  taxableAddress: z.object({
15985
17094
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
15986
17095
  }).describe("Taxable address used to calculate tax").optional(),
15987
- inheritResourceLocations: z.boolean().describe(
15988
- "Whether to inherit resource locations for availability resolution."
17096
+ primaryResourceType: z.string().describe(
17097
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
17098
+ that serves as the primary resource for this appointment service. The primary resource type
17099
+ determines which resources drive slot assignment and availability resolution.
17100
+
17101
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
17102
+ based on the rooms' schedules rather than staff schedules.
17103
+
17104
+ Default: The staff resource type.`
17105
+ ).regex(
17106
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
17107
+ "Must be a valid GUID"
15989
17108
  ).optional().nullable()
15990
17109
  }).describe("Cloned service.").optional(),
15991
17110
  errors: z.array(z.enum(["OPTIONS_AND_VARIANTS", "FORM"])).optional()