@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
@@ -638,15 +638,50 @@ var CreateServiceRequest = z.object({
638
638
  availabilityConstraints: z.object({
639
639
  durations: z.array(
640
640
  z.object({
641
- minutes: z.number().int().describe(
642
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
643
- ).min(1).max(44639).optional()
641
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
644
642
  })
645
643
  ).max(50).optional(),
646
644
  sessionDurations: z.array(z.number().int()).max(50).optional(),
647
645
  timeBetweenSessions: z.number().int().describe(
648
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
649
- ).min(0).max(720).optional()
646
+ "The number of minutes between the end of a session and the start of the next."
647
+ ).min(0).max(720).optional(),
648
+ durationRange: z.intersection(
649
+ z.object({ unitType: z.enum(["HOUR", "DAY"]).optional() }),
650
+ z.xor([
651
+ z.object({
652
+ hourOptions: z.never().optional(),
653
+ dayOptions: z.never().optional()
654
+ }),
655
+ z.object({
656
+ dayOptions: z.never().optional(),
657
+ hourOptions: z.object({
658
+ minDurationInMinutes: z.number().int().describe(
659
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
660
+ ).min(30).max(1440).optional(),
661
+ maxDurationInMinutes: z.number().int().describe(
662
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
663
+ ).min(30).max(1440).optional()
664
+ }).describe(
665
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
666
+ )
667
+ }),
668
+ z.object({
669
+ hourOptions: z.never().optional(),
670
+ dayOptions: z.object({
671
+ minDurationInDays: z.number().int().describe(
672
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
673
+ ).min(1).max(8).optional(),
674
+ maxDurationInDays: z.number().int().describe(
675
+ "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`."
676
+ ).min(1).max(8).optional()
677
+ }).describe(
678
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
679
+ )
680
+ })
681
+ ])
682
+ ).describe(
683
+ "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."
684
+ ).optional()
650
685
  }).describe("Limitations affecting the service availability.").optional()
651
686
  }).describe(
652
687
  "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)."
@@ -679,17 +714,27 @@ var CreateServiceRequest = z.object({
679
714
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
680
715
  ).optional(),
681
716
  serviceResources: z.array(
682
- z.object({
683
- resourceType: z.object({
684
- _id: z.string().describe("The type of the resource.").regex(
685
- /^[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}$/,
686
- "Must be a valid GUID"
687
- ).optional().nullable(),
688
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
689
- }).describe(
690
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
691
- ).optional()
692
- })
717
+ z.intersection(
718
+ z.object({
719
+ resourceType: z.object({
720
+ _id: z.string().describe("The type of the resource.").regex(
721
+ /^[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}$/,
722
+ "Must be a valid GUID"
723
+ ).optional().nullable(),
724
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
725
+ }).describe(
726
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
727
+ ).optional()
728
+ }),
729
+ z.xor([
730
+ z.object({ resourceIds: z.never().optional() }),
731
+ z.object({
732
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
733
+ "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."
734
+ )
735
+ })
736
+ ])
737
+ )
693
738
  ).max(3).optional(),
694
739
  supportedSlugs: z.array(
695
740
  z.object({
@@ -816,8 +861,18 @@ var CreateServiceRequest = z.object({
816
861
  taxableAddress: z.object({
817
862
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).optional()
818
863
  }).describe("Taxable address used to calculate tax").optional(),
819
- inheritResourceLocations: z.boolean().describe(
820
- "Whether to inherit resource locations for availability resolution."
864
+ primaryResourceType: z.string().describe(
865
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
866
+ that serves as the primary resource for this appointment service. The primary resource type
867
+ determines which resources drive slot assignment and availability resolution.
868
+
869
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
870
+ based on the rooms' schedules rather than staff schedules.
871
+
872
+ Default: The staff resource type.`
873
+ ).regex(
874
+ /^[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}$/,
875
+ "Must be a valid GUID"
821
876
  ).optional().nullable()
822
877
  }).describe("Service to create.")
823
878
  });
@@ -1371,15 +1426,54 @@ var CreateServiceResponse = z.object({
1371
1426
  availabilityConstraints: z.object({
1372
1427
  durations: z.array(
1373
1428
  z.object({
1374
- minutes: z.number().int().describe(
1375
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
1376
- ).min(1).max(44639).optional()
1429
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
1377
1430
  })
1378
1431
  ).max(50).optional(),
1379
1432
  sessionDurations: z.array(z.number().int()).max(50).optional(),
1380
1433
  timeBetweenSessions: z.number().int().describe(
1381
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
1382
- ).min(0).max(720).optional()
1434
+ "The number of minutes between the end of a session and the start of the next."
1435
+ ).min(0).max(720).optional(),
1436
+ durationRange: z.intersection(
1437
+ z.object({
1438
+ unitType: z.enum(["HOUR", "DAY"]).describe(
1439
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
1440
+ ).optional()
1441
+ }),
1442
+ z.xor([
1443
+ z.object({
1444
+ hourOptions: z.never().optional(),
1445
+ dayOptions: z.never().optional()
1446
+ }),
1447
+ z.object({
1448
+ dayOptions: z.never().optional(),
1449
+ hourOptions: z.object({
1450
+ minDurationInMinutes: z.number().int().describe(
1451
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
1452
+ ).min(30).max(1440).optional(),
1453
+ maxDurationInMinutes: z.number().int().describe(
1454
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
1455
+ ).min(30).max(1440).optional()
1456
+ }).describe(
1457
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
1458
+ )
1459
+ }),
1460
+ z.object({
1461
+ hourOptions: z.never().optional(),
1462
+ dayOptions: z.object({
1463
+ minDurationInDays: z.number().int().describe(
1464
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
1465
+ ).min(1).max(8).optional(),
1466
+ maxDurationInDays: z.number().int().describe(
1467
+ "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`."
1468
+ ).min(1).max(8).optional()
1469
+ }).describe(
1470
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
1471
+ )
1472
+ })
1473
+ ])
1474
+ ).describe(
1475
+ "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."
1476
+ ).optional()
1383
1477
  }).describe("Limitations affecting the service availability.").optional()
1384
1478
  }).describe(
1385
1479
  "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)."
@@ -1412,17 +1506,27 @@ var CreateServiceResponse = z.object({
1412
1506
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
1413
1507
  ).optional(),
1414
1508
  serviceResources: z.array(
1415
- z.object({
1416
- resourceType: z.object({
1417
- _id: z.string().describe("The type of the resource.").regex(
1418
- /^[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}$/,
1419
- "Must be a valid GUID"
1420
- ).optional().nullable(),
1421
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
1422
- }).describe(
1423
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
1424
- ).optional()
1425
- })
1509
+ z.intersection(
1510
+ z.object({
1511
+ resourceType: z.object({
1512
+ _id: z.string().describe("The type of the resource.").regex(
1513
+ /^[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}$/,
1514
+ "Must be a valid GUID"
1515
+ ).optional().nullable(),
1516
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
1517
+ }).describe(
1518
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
1519
+ ).optional()
1520
+ }),
1521
+ z.xor([
1522
+ z.object({ resourceIds: z.never().optional() }),
1523
+ z.object({
1524
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
1525
+ "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."
1526
+ )
1527
+ })
1528
+ ])
1529
+ )
1426
1530
  ).max(3).optional(),
1427
1531
  supportedSlugs: z.array(
1428
1532
  z.object({
@@ -1545,8 +1649,18 @@ var CreateServiceResponse = z.object({
1545
1649
  taxableAddress: z.object({
1546
1650
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
1547
1651
  }).describe("Taxable address used to calculate tax").optional(),
1548
- inheritResourceLocations: z.boolean().describe(
1549
- "Whether to inherit resource locations for availability resolution."
1652
+ primaryResourceType: z.string().describe(
1653
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
1654
+ that serves as the primary resource for this appointment service. The primary resource type
1655
+ determines which resources drive slot assignment and availability resolution.
1656
+
1657
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
1658
+ based on the rooms' schedules rather than staff schedules.
1659
+
1660
+ Default: The staff resource type.`
1661
+ ).regex(
1662
+ /^[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}$/,
1663
+ "Must be a valid GUID"
1550
1664
  ).optional().nullable()
1551
1665
  });
1552
1666
  var BulkCreateServicesRequest = z.object({
@@ -2103,15 +2217,50 @@ var BulkCreateServicesRequest = z.object({
2103
2217
  availabilityConstraints: z.object({
2104
2218
  durations: z.array(
2105
2219
  z.object({
2106
- minutes: z.number().int().describe(
2107
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
2108
- ).min(1).max(44639).optional()
2220
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
2109
2221
  })
2110
2222
  ).max(50).optional(),
2111
2223
  sessionDurations: z.array(z.number().int()).max(50).optional(),
2112
2224
  timeBetweenSessions: z.number().int().describe(
2113
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
2114
- ).min(0).max(720).optional()
2225
+ "The number of minutes between the end of a session and the start of the next."
2226
+ ).min(0).max(720).optional(),
2227
+ durationRange: z.intersection(
2228
+ z.object({ unitType: z.enum(["HOUR", "DAY"]).optional() }),
2229
+ z.xor([
2230
+ z.object({
2231
+ hourOptions: z.never().optional(),
2232
+ dayOptions: z.never().optional()
2233
+ }),
2234
+ z.object({
2235
+ dayOptions: z.never().optional(),
2236
+ hourOptions: z.object({
2237
+ minDurationInMinutes: z.number().int().describe(
2238
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
2239
+ ).min(30).max(1440).optional(),
2240
+ maxDurationInMinutes: z.number().int().describe(
2241
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
2242
+ ).min(30).max(1440).optional()
2243
+ }).describe(
2244
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
2245
+ )
2246
+ }),
2247
+ z.object({
2248
+ hourOptions: z.never().optional(),
2249
+ dayOptions: z.object({
2250
+ minDurationInDays: z.number().int().describe(
2251
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
2252
+ ).min(1).max(8).optional(),
2253
+ maxDurationInDays: z.number().int().describe(
2254
+ "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`."
2255
+ ).min(1).max(8).optional()
2256
+ }).describe(
2257
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
2258
+ )
2259
+ })
2260
+ ])
2261
+ ).describe(
2262
+ "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."
2263
+ ).optional()
2115
2264
  }).describe("Limitations affecting the service availability.").optional()
2116
2265
  }).describe(
2117
2266
  "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)."
@@ -2144,17 +2293,27 @@ var BulkCreateServicesRequest = z.object({
2144
2293
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
2145
2294
  ).optional(),
2146
2295
  serviceResources: z.array(
2147
- z.object({
2148
- resourceType: z.object({
2149
- _id: z.string().describe("The type of the resource.").regex(
2150
- /^[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}$/,
2151
- "Must be a valid GUID"
2152
- ).optional().nullable(),
2153
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
2154
- }).describe(
2155
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
2156
- ).optional()
2157
- })
2296
+ z.intersection(
2297
+ z.object({
2298
+ resourceType: z.object({
2299
+ _id: z.string().describe("The type of the resource.").regex(
2300
+ /^[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}$/,
2301
+ "Must be a valid GUID"
2302
+ ).optional().nullable(),
2303
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
2304
+ }).describe(
2305
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
2306
+ ).optional()
2307
+ }),
2308
+ z.xor([
2309
+ z.object({ resourceIds: z.never().optional() }),
2310
+ z.object({
2311
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
2312
+ "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."
2313
+ )
2314
+ })
2315
+ ])
2316
+ )
2158
2317
  ).max(3).optional(),
2159
2318
  supportedSlugs: z.array(
2160
2319
  z.object({
@@ -2281,8 +2440,18 @@ var BulkCreateServicesRequest = z.object({
2281
2440
  taxableAddress: z.object({
2282
2441
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).optional()
2283
2442
  }).describe("Taxable address used to calculate tax").optional(),
2284
- inheritResourceLocations: z.boolean().describe(
2285
- "Whether to inherit resource locations for availability resolution."
2443
+ primaryResourceType: z.string().describe(
2444
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
2445
+ that serves as the primary resource for this appointment service. The primary resource type
2446
+ determines which resources drive slot assignment and availability resolution.
2447
+
2448
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
2449
+ based on the rooms' schedules rather than staff schedules.
2450
+
2451
+ Default: The staff resource type.`
2452
+ ).regex(
2453
+ /^[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}$/,
2454
+ "Must be a valid GUID"
2286
2455
  ).optional().nullable()
2287
2456
  })
2288
2457
  ).max(100),
@@ -2882,15 +3051,54 @@ var BulkCreateServicesResponse = z.object({
2882
3051
  availabilityConstraints: z.object({
2883
3052
  durations: z.array(
2884
3053
  z.object({
2885
- minutes: z.number().int().describe(
2886
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
2887
- ).min(1).max(44639).optional()
3054
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
2888
3055
  })
2889
3056
  ).max(50).optional(),
2890
3057
  sessionDurations: z.array(z.number().int()).max(50).optional(),
2891
3058
  timeBetweenSessions: z.number().int().describe(
2892
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
2893
- ).min(0).max(720).optional()
3059
+ "The number of minutes between the end of a session and the start of the next."
3060
+ ).min(0).max(720).optional(),
3061
+ durationRange: z.intersection(
3062
+ z.object({
3063
+ unitType: z.enum(["HOUR", "DAY"]).describe(
3064
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
3065
+ ).optional()
3066
+ }),
3067
+ z.xor([
3068
+ z.object({
3069
+ hourOptions: z.never().optional(),
3070
+ dayOptions: z.never().optional()
3071
+ }),
3072
+ z.object({
3073
+ dayOptions: z.never().optional(),
3074
+ hourOptions: z.object({
3075
+ minDurationInMinutes: z.number().int().describe(
3076
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
3077
+ ).min(30).max(1440).optional(),
3078
+ maxDurationInMinutes: z.number().int().describe(
3079
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
3080
+ ).min(30).max(1440).optional()
3081
+ }).describe(
3082
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
3083
+ )
3084
+ }),
3085
+ z.object({
3086
+ hourOptions: z.never().optional(),
3087
+ dayOptions: z.object({
3088
+ minDurationInDays: z.number().int().describe(
3089
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
3090
+ ).min(1).max(8).optional(),
3091
+ maxDurationInDays: z.number().int().describe(
3092
+ "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`."
3093
+ ).min(1).max(8).optional()
3094
+ }).describe(
3095
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
3096
+ )
3097
+ })
3098
+ ])
3099
+ ).describe(
3100
+ "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."
3101
+ ).optional()
2894
3102
  }).describe("Limitations affecting the service availability.").optional()
2895
3103
  }).describe(
2896
3104
  "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)."
@@ -2923,17 +3131,29 @@ var BulkCreateServicesResponse = z.object({
2923
3131
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
2924
3132
  ).optional(),
2925
3133
  serviceResources: z.array(
2926
- z.object({
2927
- resourceType: z.object({
2928
- _id: z.string().describe("The type of the resource.").regex(
2929
- /^[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}$/,
2930
- "Must be a valid GUID"
2931
- ).optional().nullable(),
2932
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
2933
- }).describe(
2934
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
2935
- ).optional()
2936
- })
3134
+ z.intersection(
3135
+ z.object({
3136
+ resourceType: z.object({
3137
+ _id: z.string().describe("The type of the resource.").regex(
3138
+ /^[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}$/,
3139
+ "Must be a valid GUID"
3140
+ ).optional().nullable(),
3141
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
3142
+ }).describe(
3143
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
3144
+ ).optional()
3145
+ }),
3146
+ z.xor([
3147
+ z.object({ resourceIds: z.never().optional() }),
3148
+ z.object({
3149
+ resourceIds: z.object({
3150
+ values: z.array(z.string()).max(100).optional()
3151
+ }).describe(
3152
+ "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."
3153
+ )
3154
+ })
3155
+ ])
3156
+ )
2937
3157
  ).max(3).optional(),
2938
3158
  supportedSlugs: z.array(
2939
3159
  z.object({
@@ -3060,8 +3280,18 @@ var BulkCreateServicesResponse = z.object({
3060
3280
  taxableAddress: z.object({
3061
3281
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
3062
3282
  }).describe("Taxable address used to calculate tax").optional(),
3063
- inheritResourceLocations: z.boolean().describe(
3064
- "Whether to inherit resource locations for availability resolution."
3283
+ primaryResourceType: z.string().describe(
3284
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
3285
+ that serves as the primary resource for this appointment service. The primary resource type
3286
+ determines which resources drive slot assignment and availability resolution.
3287
+
3288
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
3289
+ based on the rooms' schedules rather than staff schedules.
3290
+
3291
+ Default: The staff resource type.`
3292
+ ).regex(
3293
+ /^[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}$/,
3294
+ "Must be a valid GUID"
3065
3295
  ).optional().nullable()
3066
3296
  }).describe("Updated service.").optional()
3067
3297
  })
@@ -3084,7 +3314,8 @@ var GetServiceRequest = z.object({
3084
3314
  z.enum([
3085
3315
  "STAFF_MEMBER_DETAILS",
3086
3316
  "RESOURCE_TYPE_DETAILS",
3087
- "DISCOUNT_INFO_DETAILS"
3317
+ "DISCOUNT_INFO_DETAILS",
3318
+ "RESOURCE_DETAILS"
3088
3319
  ])
3089
3320
  ).max(5).optional()
3090
3321
  }).optional()
@@ -3639,15 +3870,54 @@ var GetServiceResponse = z.object({
3639
3870
  availabilityConstraints: z.object({
3640
3871
  durations: z.array(
3641
3872
  z.object({
3642
- minutes: z.number().int().describe(
3643
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
3644
- ).min(1).max(44639).optional()
3873
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
3645
3874
  })
3646
3875
  ).max(50).optional(),
3647
3876
  sessionDurations: z.array(z.number().int()).max(50).optional(),
3648
3877
  timeBetweenSessions: z.number().int().describe(
3649
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
3650
- ).min(0).max(720).optional()
3878
+ "The number of minutes between the end of a session and the start of the next."
3879
+ ).min(0).max(720).optional(),
3880
+ durationRange: z.intersection(
3881
+ z.object({
3882
+ unitType: z.enum(["HOUR", "DAY"]).describe(
3883
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
3884
+ ).optional()
3885
+ }),
3886
+ z.xor([
3887
+ z.object({
3888
+ hourOptions: z.never().optional(),
3889
+ dayOptions: z.never().optional()
3890
+ }),
3891
+ z.object({
3892
+ dayOptions: z.never().optional(),
3893
+ hourOptions: z.object({
3894
+ minDurationInMinutes: z.number().int().describe(
3895
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
3896
+ ).min(30).max(1440).optional(),
3897
+ maxDurationInMinutes: z.number().int().describe(
3898
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
3899
+ ).min(30).max(1440).optional()
3900
+ }).describe(
3901
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
3902
+ )
3903
+ }),
3904
+ z.object({
3905
+ hourOptions: z.never().optional(),
3906
+ dayOptions: z.object({
3907
+ minDurationInDays: z.number().int().describe(
3908
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
3909
+ ).min(1).max(8).optional(),
3910
+ maxDurationInDays: z.number().int().describe(
3911
+ "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`."
3912
+ ).min(1).max(8).optional()
3913
+ }).describe(
3914
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
3915
+ )
3916
+ })
3917
+ ])
3918
+ ).describe(
3919
+ "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."
3920
+ ).optional()
3651
3921
  }).describe("Limitations affecting the service availability.").optional()
3652
3922
  }).describe(
3653
3923
  "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)."
@@ -3680,17 +3950,27 @@ var GetServiceResponse = z.object({
3680
3950
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
3681
3951
  ).optional(),
3682
3952
  serviceResources: z.array(
3683
- z.object({
3684
- resourceType: z.object({
3685
- _id: z.string().describe("The type of the resource.").regex(
3686
- /^[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}$/,
3687
- "Must be a valid GUID"
3688
- ).optional().nullable(),
3689
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
3690
- }).describe(
3691
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
3692
- ).optional()
3693
- })
3953
+ z.intersection(
3954
+ z.object({
3955
+ resourceType: z.object({
3956
+ _id: z.string().describe("The type of the resource.").regex(
3957
+ /^[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}$/,
3958
+ "Must be a valid GUID"
3959
+ ).optional().nullable(),
3960
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
3961
+ }).describe(
3962
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
3963
+ ).optional()
3964
+ }),
3965
+ z.xor([
3966
+ z.object({ resourceIds: z.never().optional() }),
3967
+ z.object({
3968
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
3969
+ "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."
3970
+ )
3971
+ })
3972
+ ])
3973
+ )
3694
3974
  ).max(3).optional(),
3695
3975
  supportedSlugs: z.array(
3696
3976
  z.object({
@@ -3813,8 +4093,18 @@ var GetServiceResponse = z.object({
3813
4093
  taxableAddress: z.object({
3814
4094
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
3815
4095
  }).describe("Taxable address used to calculate tax").optional(),
3816
- inheritResourceLocations: z.boolean().describe(
3817
- "Whether to inherit resource locations for availability resolution."
4096
+ primaryResourceType: z.string().describe(
4097
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
4098
+ that serves as the primary resource for this appointment service. The primary resource type
4099
+ determines which resources drive slot assignment and availability resolution.
4100
+
4101
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
4102
+ based on the rooms' schedules rather than staff schedules.
4103
+
4104
+ Default: The staff resource type.`
4105
+ ).regex(
4106
+ /^[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}$/,
4107
+ "Must be a valid GUID"
3818
4108
  ).optional().nullable()
3819
4109
  });
3820
4110
  var UpdateServiceRequest = z.object({
@@ -4370,15 +4660,50 @@ var UpdateServiceRequest = z.object({
4370
4660
  availabilityConstraints: z.object({
4371
4661
  durations: z.array(
4372
4662
  z.object({
4373
- minutes: z.number().int().describe(
4374
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
4375
- ).min(1).max(44639).optional()
4663
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
4376
4664
  })
4377
4665
  ).max(50).optional(),
4378
4666
  sessionDurations: z.array(z.number().int()).max(50).optional(),
4379
4667
  timeBetweenSessions: z.number().int().describe(
4380
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
4381
- ).min(0).max(720).optional()
4668
+ "The number of minutes between the end of a session and the start of the next."
4669
+ ).min(0).max(720).optional(),
4670
+ durationRange: z.intersection(
4671
+ z.object({ unitType: z.enum(["HOUR", "DAY"]).optional() }),
4672
+ z.xor([
4673
+ z.object({
4674
+ hourOptions: z.never().optional(),
4675
+ dayOptions: z.never().optional()
4676
+ }),
4677
+ z.object({
4678
+ dayOptions: z.never().optional(),
4679
+ hourOptions: z.object({
4680
+ minDurationInMinutes: z.number().int().describe(
4681
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
4682
+ ).min(30).max(1440).optional(),
4683
+ maxDurationInMinutes: z.number().int().describe(
4684
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
4685
+ ).min(30).max(1440).optional()
4686
+ }).describe(
4687
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
4688
+ )
4689
+ }),
4690
+ z.object({
4691
+ hourOptions: z.never().optional(),
4692
+ dayOptions: z.object({
4693
+ minDurationInDays: z.number().int().describe(
4694
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
4695
+ ).min(1).max(8).optional(),
4696
+ maxDurationInDays: z.number().int().describe(
4697
+ "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`."
4698
+ ).min(1).max(8).optional()
4699
+ }).describe(
4700
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
4701
+ )
4702
+ })
4703
+ ])
4704
+ ).describe(
4705
+ "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."
4706
+ ).optional()
4382
4707
  }).describe("Limitations affecting the service availability.").optional()
4383
4708
  }).describe(
4384
4709
  "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)."
@@ -4411,17 +4736,27 @@ var UpdateServiceRequest = z.object({
4411
4736
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
4412
4737
  ).optional(),
4413
4738
  serviceResources: z.array(
4414
- z.object({
4415
- resourceType: z.object({
4416
- _id: z.string().describe("The type of the resource.").regex(
4417
- /^[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}$/,
4418
- "Must be a valid GUID"
4419
- ).optional().nullable(),
4420
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
4421
- }).describe(
4422
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
4423
- ).optional()
4424
- })
4739
+ z.intersection(
4740
+ z.object({
4741
+ resourceType: z.object({
4742
+ _id: z.string().describe("The type of the resource.").regex(
4743
+ /^[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}$/,
4744
+ "Must be a valid GUID"
4745
+ ).optional().nullable(),
4746
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
4747
+ }).describe(
4748
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
4749
+ ).optional()
4750
+ }),
4751
+ z.xor([
4752
+ z.object({ resourceIds: z.never().optional() }),
4753
+ z.object({
4754
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
4755
+ "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."
4756
+ )
4757
+ })
4758
+ ])
4759
+ )
4425
4760
  ).max(3).optional(),
4426
4761
  supportedSlugs: z.array(
4427
4762
  z.object({
@@ -4548,8 +4883,18 @@ var UpdateServiceRequest = z.object({
4548
4883
  taxableAddress: z.object({
4549
4884
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).optional()
4550
4885
  }).describe("Taxable address used to calculate tax").optional(),
4551
- inheritResourceLocations: z.boolean().describe(
4552
- "Whether to inherit resource locations for availability resolution."
4886
+ primaryResourceType: z.string().describe(
4887
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
4888
+ that serves as the primary resource for this appointment service. The primary resource type
4889
+ determines which resources drive slot assignment and availability resolution.
4890
+
4891
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
4892
+ based on the rooms' schedules rather than staff schedules.
4893
+
4894
+ Default: The staff resource type.`
4895
+ ).regex(
4896
+ /^[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}$/,
4897
+ "Must be a valid GUID"
4553
4898
  ).optional().nullable()
4554
4899
  }).describe("Service to update.")
4555
4900
  });
@@ -5103,15 +5448,54 @@ var UpdateServiceResponse = z.object({
5103
5448
  availabilityConstraints: z.object({
5104
5449
  durations: z.array(
5105
5450
  z.object({
5106
- minutes: z.number().int().describe(
5107
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
5108
- ).min(1).max(44639).optional()
5451
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
5109
5452
  })
5110
5453
  ).max(50).optional(),
5111
5454
  sessionDurations: z.array(z.number().int()).max(50).optional(),
5112
5455
  timeBetweenSessions: z.number().int().describe(
5113
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
5114
- ).min(0).max(720).optional()
5456
+ "The number of minutes between the end of a session and the start of the next."
5457
+ ).min(0).max(720).optional(),
5458
+ durationRange: z.intersection(
5459
+ z.object({
5460
+ unitType: z.enum(["HOUR", "DAY"]).describe(
5461
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
5462
+ ).optional()
5463
+ }),
5464
+ z.xor([
5465
+ z.object({
5466
+ hourOptions: z.never().optional(),
5467
+ dayOptions: z.never().optional()
5468
+ }),
5469
+ z.object({
5470
+ dayOptions: z.never().optional(),
5471
+ hourOptions: z.object({
5472
+ minDurationInMinutes: z.number().int().describe(
5473
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
5474
+ ).min(30).max(1440).optional(),
5475
+ maxDurationInMinutes: z.number().int().describe(
5476
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
5477
+ ).min(30).max(1440).optional()
5478
+ }).describe(
5479
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
5480
+ )
5481
+ }),
5482
+ z.object({
5483
+ hourOptions: z.never().optional(),
5484
+ dayOptions: z.object({
5485
+ minDurationInDays: z.number().int().describe(
5486
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
5487
+ ).min(1).max(8).optional(),
5488
+ maxDurationInDays: z.number().int().describe(
5489
+ "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`."
5490
+ ).min(1).max(8).optional()
5491
+ }).describe(
5492
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
5493
+ )
5494
+ })
5495
+ ])
5496
+ ).describe(
5497
+ "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."
5498
+ ).optional()
5115
5499
  }).describe("Limitations affecting the service availability.").optional()
5116
5500
  }).describe(
5117
5501
  "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)."
@@ -5144,17 +5528,27 @@ var UpdateServiceResponse = z.object({
5144
5528
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
5145
5529
  ).optional(),
5146
5530
  serviceResources: z.array(
5147
- z.object({
5148
- resourceType: z.object({
5149
- _id: z.string().describe("The type of the resource.").regex(
5150
- /^[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}$/,
5151
- "Must be a valid GUID"
5152
- ).optional().nullable(),
5153
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
5154
- }).describe(
5155
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
5156
- ).optional()
5157
- })
5531
+ z.intersection(
5532
+ z.object({
5533
+ resourceType: z.object({
5534
+ _id: z.string().describe("The type of the resource.").regex(
5535
+ /^[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}$/,
5536
+ "Must be a valid GUID"
5537
+ ).optional().nullable(),
5538
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
5539
+ }).describe(
5540
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
5541
+ ).optional()
5542
+ }),
5543
+ z.xor([
5544
+ z.object({ resourceIds: z.never().optional() }),
5545
+ z.object({
5546
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
5547
+ "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."
5548
+ )
5549
+ })
5550
+ ])
5551
+ )
5158
5552
  ).max(3).optional(),
5159
5553
  supportedSlugs: z.array(
5160
5554
  z.object({
@@ -5277,8 +5671,18 @@ var UpdateServiceResponse = z.object({
5277
5671
  taxableAddress: z.object({
5278
5672
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
5279
5673
  }).describe("Taxable address used to calculate tax").optional(),
5280
- inheritResourceLocations: z.boolean().describe(
5281
- "Whether to inherit resource locations for availability resolution."
5674
+ primaryResourceType: z.string().describe(
5675
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
5676
+ that serves as the primary resource for this appointment service. The primary resource type
5677
+ determines which resources drive slot assignment and availability resolution.
5678
+
5679
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
5680
+ based on the rooms' schedules rather than staff schedules.
5681
+
5682
+ Default: The staff resource type.`
5683
+ ).regex(
5684
+ /^[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}$/,
5685
+ "Must be a valid GUID"
5282
5686
  ).optional().nullable()
5283
5687
  });
5284
5688
  var BulkUpdateServicesRequest = z.object({
@@ -5854,14 +6258,53 @@ var BulkUpdateServicesRequest = z.object({
5854
6258
  durations: z.array(
5855
6259
  z.object({
5856
6260
  minutes: z.number().int().describe(
5857
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
6261
+ "The duration of the service in minutes."
5858
6262
  ).min(1).max(44639).optional()
5859
6263
  })
5860
6264
  ).max(50).optional(),
5861
6265
  sessionDurations: z.array(z.number().int()).max(50).optional(),
5862
6266
  timeBetweenSessions: z.number().int().describe(
5863
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
5864
- ).min(0).max(720).optional()
6267
+ "The number of minutes between the end of a session and the start of the next."
6268
+ ).min(0).max(720).optional(),
6269
+ durationRange: z.intersection(
6270
+ z.object({
6271
+ unitType: z.enum(["HOUR", "DAY"]).optional()
6272
+ }),
6273
+ z.xor([
6274
+ z.object({
6275
+ hourOptions: z.never().optional(),
6276
+ dayOptions: z.never().optional()
6277
+ }),
6278
+ z.object({
6279
+ dayOptions: z.never().optional(),
6280
+ hourOptions: z.object({
6281
+ minDurationInMinutes: z.number().int().describe(
6282
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
6283
+ ).min(30).max(1440).optional(),
6284
+ maxDurationInMinutes: z.number().int().describe(
6285
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
6286
+ ).min(30).max(1440).optional()
6287
+ }).describe(
6288
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
6289
+ )
6290
+ }),
6291
+ z.object({
6292
+ hourOptions: z.never().optional(),
6293
+ dayOptions: z.object({
6294
+ minDurationInDays: z.number().int().describe(
6295
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
6296
+ ).min(1).max(8).optional(),
6297
+ maxDurationInDays: z.number().int().describe(
6298
+ "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`."
6299
+ ).min(1).max(8).optional()
6300
+ }).describe(
6301
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
6302
+ )
6303
+ })
6304
+ ])
6305
+ ).describe(
6306
+ "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."
6307
+ ).optional()
5865
6308
  }).describe(
5866
6309
  "Limitations affecting the service availability."
5867
6310
  ).optional()
@@ -5896,17 +6339,29 @@ var BulkUpdateServicesRequest = z.object({
5896
6339
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
5897
6340
  ).optional(),
5898
6341
  serviceResources: z.array(
5899
- z.object({
5900
- resourceType: z.object({
5901
- _id: z.string().describe("The type of the resource.").regex(
5902
- /^[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}$/,
5903
- "Must be a valid GUID"
5904
- ).optional().nullable(),
5905
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
5906
- }).describe(
5907
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
5908
- ).optional()
5909
- })
6342
+ z.intersection(
6343
+ z.object({
6344
+ resourceType: z.object({
6345
+ _id: z.string().describe("The type of the resource.").regex(
6346
+ /^[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}$/,
6347
+ "Must be a valid GUID"
6348
+ ).optional().nullable(),
6349
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
6350
+ }).describe(
6351
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
6352
+ ).optional()
6353
+ }),
6354
+ z.xor([
6355
+ z.object({ resourceIds: z.never().optional() }),
6356
+ z.object({
6357
+ resourceIds: z.object({
6358
+ values: z.array(z.string()).max(100).optional()
6359
+ }).describe(
6360
+ "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."
6361
+ )
6362
+ })
6363
+ ])
6364
+ )
5910
6365
  ).max(3).optional(),
5911
6366
  supportedSlugs: z.array(
5912
6367
  z.object({
@@ -6033,8 +6488,18 @@ var BulkUpdateServicesRequest = z.object({
6033
6488
  taxableAddress: z.object({
6034
6489
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).optional()
6035
6490
  }).describe("Taxable address used to calculate tax").optional(),
6036
- inheritResourceLocations: z.boolean().describe(
6037
- "Whether to inherit resource locations for availability resolution."
6491
+ primaryResourceType: z.string().describe(
6492
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
6493
+ that serves as the primary resource for this appointment service. The primary resource type
6494
+ determines which resources drive slot assignment and availability resolution.
6495
+
6496
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
6497
+ based on the rooms' schedules rather than staff schedules.
6498
+
6499
+ Default: The staff resource type.`
6500
+ ).regex(
6501
+ /^[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}$/,
6502
+ "Must be a valid GUID"
6038
6503
  ).optional().nullable()
6039
6504
  }).describe("Service to update."),
6040
6505
  mask: z.array(z.string()).optional()
@@ -6637,15 +7102,54 @@ var BulkUpdateServicesResponse = z.object({
6637
7102
  availabilityConstraints: z.object({
6638
7103
  durations: z.array(
6639
7104
  z.object({
6640
- minutes: z.number().int().describe(
6641
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
6642
- ).min(1).max(44639).optional()
7105
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
6643
7106
  })
6644
7107
  ).max(50).optional(),
6645
7108
  sessionDurations: z.array(z.number().int()).max(50).optional(),
6646
7109
  timeBetweenSessions: z.number().int().describe(
6647
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
6648
- ).min(0).max(720).optional()
7110
+ "The number of minutes between the end of a session and the start of the next."
7111
+ ).min(0).max(720).optional(),
7112
+ durationRange: z.intersection(
7113
+ z.object({
7114
+ unitType: z.enum(["HOUR", "DAY"]).describe(
7115
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
7116
+ ).optional()
7117
+ }),
7118
+ z.xor([
7119
+ z.object({
7120
+ hourOptions: z.never().optional(),
7121
+ dayOptions: z.never().optional()
7122
+ }),
7123
+ z.object({
7124
+ dayOptions: z.never().optional(),
7125
+ hourOptions: z.object({
7126
+ minDurationInMinutes: z.number().int().describe(
7127
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
7128
+ ).min(30).max(1440).optional(),
7129
+ maxDurationInMinutes: z.number().int().describe(
7130
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
7131
+ ).min(30).max(1440).optional()
7132
+ }).describe(
7133
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
7134
+ )
7135
+ }),
7136
+ z.object({
7137
+ hourOptions: z.never().optional(),
7138
+ dayOptions: z.object({
7139
+ minDurationInDays: z.number().int().describe(
7140
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
7141
+ ).min(1).max(8).optional(),
7142
+ maxDurationInDays: z.number().int().describe(
7143
+ "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`."
7144
+ ).min(1).max(8).optional()
7145
+ }).describe(
7146
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
7147
+ )
7148
+ })
7149
+ ])
7150
+ ).describe(
7151
+ "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."
7152
+ ).optional()
6649
7153
  }).describe("Limitations affecting the service availability.").optional()
6650
7154
  }).describe(
6651
7155
  "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)."
@@ -6678,17 +7182,29 @@ var BulkUpdateServicesResponse = z.object({
6678
7182
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
6679
7183
  ).optional(),
6680
7184
  serviceResources: z.array(
6681
- z.object({
6682
- resourceType: z.object({
6683
- _id: z.string().describe("The type of the resource.").regex(
6684
- /^[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}$/,
6685
- "Must be a valid GUID"
6686
- ).optional().nullable(),
6687
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
6688
- }).describe(
6689
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
6690
- ).optional()
6691
- })
7185
+ z.intersection(
7186
+ z.object({
7187
+ resourceType: z.object({
7188
+ _id: z.string().describe("The type of the resource.").regex(
7189
+ /^[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}$/,
7190
+ "Must be a valid GUID"
7191
+ ).optional().nullable(),
7192
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
7193
+ }).describe(
7194
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
7195
+ ).optional()
7196
+ }),
7197
+ z.xor([
7198
+ z.object({ resourceIds: z.never().optional() }),
7199
+ z.object({
7200
+ resourceIds: z.object({
7201
+ values: z.array(z.string()).max(100).optional()
7202
+ }).describe(
7203
+ "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."
7204
+ )
7205
+ })
7206
+ ])
7207
+ )
6692
7208
  ).max(3).optional(),
6693
7209
  supportedSlugs: z.array(
6694
7210
  z.object({
@@ -6815,8 +7331,18 @@ var BulkUpdateServicesResponse = z.object({
6815
7331
  taxableAddress: z.object({
6816
7332
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
6817
7333
  }).describe("Taxable address used to calculate tax").optional(),
6818
- inheritResourceLocations: z.boolean().describe(
6819
- "Whether to inherit resource locations for availability resolution."
7334
+ primaryResourceType: z.string().describe(
7335
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
7336
+ that serves as the primary resource for this appointment service. The primary resource type
7337
+ determines which resources drive slot assignment and availability resolution.
7338
+
7339
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
7340
+ based on the rooms' schedules rather than staff schedules.
7341
+
7342
+ Default: The staff resource type.`
7343
+ ).regex(
7344
+ /^[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}$/,
7345
+ "Must be a valid GUID"
6820
7346
  ).optional().nullable()
6821
7347
  }).describe("Updated service.").optional()
6822
7348
  })
@@ -7384,15 +7910,50 @@ var BulkUpdateServicesByFilterRequest = z.object({
7384
7910
  availabilityConstraints: z.object({
7385
7911
  durations: z.array(
7386
7912
  z.object({
7387
- minutes: z.number().int().describe(
7388
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
7389
- ).min(1).max(44639).optional()
7913
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
7390
7914
  })
7391
7915
  ).max(50).optional(),
7392
7916
  sessionDurations: z.array(z.number().int()).max(50).optional(),
7393
7917
  timeBetweenSessions: z.number().int().describe(
7394
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
7395
- ).min(0).max(720).optional()
7918
+ "The number of minutes between the end of a session and the start of the next."
7919
+ ).min(0).max(720).optional(),
7920
+ durationRange: z.intersection(
7921
+ z.object({ unitType: z.enum(["HOUR", "DAY"]).optional() }),
7922
+ z.xor([
7923
+ z.object({
7924
+ hourOptions: z.never().optional(),
7925
+ dayOptions: z.never().optional()
7926
+ }),
7927
+ z.object({
7928
+ dayOptions: z.never().optional(),
7929
+ hourOptions: z.object({
7930
+ minDurationInMinutes: z.number().int().describe(
7931
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
7932
+ ).min(30).max(1440).optional(),
7933
+ maxDurationInMinutes: z.number().int().describe(
7934
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
7935
+ ).min(30).max(1440).optional()
7936
+ }).describe(
7937
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
7938
+ )
7939
+ }),
7940
+ z.object({
7941
+ hourOptions: z.never().optional(),
7942
+ dayOptions: z.object({
7943
+ minDurationInDays: z.number().int().describe(
7944
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
7945
+ ).min(1).max(8).optional(),
7946
+ maxDurationInDays: z.number().int().describe(
7947
+ "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`."
7948
+ ).min(1).max(8).optional()
7949
+ }).describe(
7950
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
7951
+ )
7952
+ })
7953
+ ])
7954
+ ).describe(
7955
+ "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."
7956
+ ).optional()
7396
7957
  }).describe("Limitations affecting the service availability.").optional()
7397
7958
  }).describe(
7398
7959
  "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)."
@@ -7425,17 +7986,27 @@ var BulkUpdateServicesByFilterRequest = z.object({
7425
7986
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
7426
7987
  ).optional(),
7427
7988
  serviceResources: z.array(
7428
- z.object({
7429
- resourceType: z.object({
7430
- _id: z.string().describe("The type of the resource.").regex(
7431
- /^[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}$/,
7432
- "Must be a valid GUID"
7433
- ).optional().nullable(),
7434
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
7435
- }).describe(
7436
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
7437
- ).optional()
7438
- })
7989
+ z.intersection(
7990
+ z.object({
7991
+ resourceType: z.object({
7992
+ _id: z.string().describe("The type of the resource.").regex(
7993
+ /^[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}$/,
7994
+ "Must be a valid GUID"
7995
+ ).optional().nullable(),
7996
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
7997
+ }).describe(
7998
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
7999
+ ).optional()
8000
+ }),
8001
+ z.xor([
8002
+ z.object({ resourceIds: z.never().optional() }),
8003
+ z.object({
8004
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
8005
+ "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."
8006
+ )
8007
+ })
8008
+ ])
8009
+ )
7439
8010
  ).max(3).optional(),
7440
8011
  supportedSlugs: z.array(
7441
8012
  z.object({
@@ -7562,8 +8133,18 @@ var BulkUpdateServicesByFilterRequest = z.object({
7562
8133
  taxableAddress: z.object({
7563
8134
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).optional()
7564
8135
  }).describe("Taxable address used to calculate tax").optional(),
7565
- inheritResourceLocations: z.boolean().describe(
7566
- "Whether to inherit resource locations for availability resolution."
8136
+ primaryResourceType: z.string().describe(
8137
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
8138
+ that serves as the primary resource for this appointment service. The primary resource type
8139
+ determines which resources drive slot assignment and availability resolution.
8140
+
8141
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
8142
+ based on the rooms' schedules rather than staff schedules.
8143
+
8144
+ Default: The staff resource type.`
8145
+ ).regex(
8146
+ /^[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}$/,
8147
+ "Must be a valid GUID"
7567
8148
  ).optional().nullable()
7568
8149
  }).describe("Service to update.")
7569
8150
  })
@@ -8210,15 +8791,54 @@ var BulkDeleteServicesResponse = z.object({
8210
8791
  availabilityConstraints: z.object({
8211
8792
  durations: z.array(
8212
8793
  z.object({
8213
- minutes: z.number().int().describe(
8214
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
8215
- ).min(1).max(44639).optional()
8794
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
8216
8795
  })
8217
8796
  ).max(50).optional(),
8218
8797
  sessionDurations: z.array(z.number().int()).max(50).optional(),
8219
8798
  timeBetweenSessions: z.number().int().describe(
8220
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
8221
- ).min(0).max(720).optional()
8799
+ "The number of minutes between the end of a session and the start of the next."
8800
+ ).min(0).max(720).optional(),
8801
+ durationRange: z.intersection(
8802
+ z.object({
8803
+ unitType: z.enum(["HOUR", "DAY"]).describe(
8804
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
8805
+ ).optional()
8806
+ }),
8807
+ z.xor([
8808
+ z.object({
8809
+ hourOptions: z.never().optional(),
8810
+ dayOptions: z.never().optional()
8811
+ }),
8812
+ z.object({
8813
+ dayOptions: z.never().optional(),
8814
+ hourOptions: z.object({
8815
+ minDurationInMinutes: z.number().int().describe(
8816
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
8817
+ ).min(30).max(1440).optional(),
8818
+ maxDurationInMinutes: z.number().int().describe(
8819
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
8820
+ ).min(30).max(1440).optional()
8821
+ }).describe(
8822
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
8823
+ )
8824
+ }),
8825
+ z.object({
8826
+ hourOptions: z.never().optional(),
8827
+ dayOptions: z.object({
8828
+ minDurationInDays: z.number().int().describe(
8829
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
8830
+ ).min(1).max(8).optional(),
8831
+ maxDurationInDays: z.number().int().describe(
8832
+ "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`."
8833
+ ).min(1).max(8).optional()
8834
+ }).describe(
8835
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
8836
+ )
8837
+ })
8838
+ ])
8839
+ ).describe(
8840
+ "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."
8841
+ ).optional()
8222
8842
  }).describe("Limitations affecting the service availability.").optional()
8223
8843
  }).describe(
8224
8844
  "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)."
@@ -8251,17 +8871,29 @@ var BulkDeleteServicesResponse = z.object({
8251
8871
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
8252
8872
  ).optional(),
8253
8873
  serviceResources: z.array(
8254
- z.object({
8255
- resourceType: z.object({
8256
- _id: z.string().describe("The type of the resource.").regex(
8257
- /^[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}$/,
8258
- "Must be a valid GUID"
8259
- ).optional().nullable(),
8260
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
8261
- }).describe(
8262
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
8263
- ).optional()
8264
- })
8874
+ z.intersection(
8875
+ z.object({
8876
+ resourceType: z.object({
8877
+ _id: z.string().describe("The type of the resource.").regex(
8878
+ /^[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}$/,
8879
+ "Must be a valid GUID"
8880
+ ).optional().nullable(),
8881
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
8882
+ }).describe(
8883
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
8884
+ ).optional()
8885
+ }),
8886
+ z.xor([
8887
+ z.object({ resourceIds: z.never().optional() }),
8888
+ z.object({
8889
+ resourceIds: z.object({
8890
+ values: z.array(z.string()).max(100).optional()
8891
+ }).describe(
8892
+ "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."
8893
+ )
8894
+ })
8895
+ ])
8896
+ )
8265
8897
  ).max(3).optional(),
8266
8898
  supportedSlugs: z.array(
8267
8899
  z.object({
@@ -8388,8 +9020,18 @@ var BulkDeleteServicesResponse = z.object({
8388
9020
  taxableAddress: z.object({
8389
9021
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
8390
9022
  }).describe("Taxable address used to calculate tax").optional(),
8391
- inheritResourceLocations: z.boolean().describe(
8392
- "Whether to inherit resource locations for availability resolution."
9023
+ primaryResourceType: z.string().describe(
9024
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
9025
+ that serves as the primary resource for this appointment service. The primary resource type
9026
+ determines which resources drive slot assignment and availability resolution.
9027
+
9028
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
9029
+ based on the rooms' schedules rather than staff schedules.
9030
+
9031
+ Default: The staff resource type.`
9032
+ ).regex(
9033
+ /^[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}$/,
9034
+ "Must be a valid GUID"
8393
9035
  ).optional().nullable()
8394
9036
  }).describe("Updated service.").optional()
8395
9037
  })
@@ -8763,7 +9405,8 @@ var QueryServicesRequest = z.object({
8763
9405
  z.enum([
8764
9406
  "STAFF_MEMBER_DETAILS",
8765
9407
  "RESOURCE_TYPE_DETAILS",
8766
- "DISCOUNT_INFO_DETAILS"
9408
+ "DISCOUNT_INFO_DETAILS",
9409
+ "RESOURCE_DETAILS"
8767
9410
  ])
8768
9411
  ).max(5).optional()
8769
9412
  }).optional()
@@ -9328,15 +9971,54 @@ var QueryServicesResponse = z.object({
9328
9971
  availabilityConstraints: z.object({
9329
9972
  durations: z.array(
9330
9973
  z.object({
9331
- minutes: z.number().int().describe(
9332
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
9333
- ).min(1).max(44639).optional()
9974
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
9334
9975
  })
9335
9976
  ).max(50).optional(),
9336
9977
  sessionDurations: z.array(z.number().int()).max(50).optional(),
9337
9978
  timeBetweenSessions: z.number().int().describe(
9338
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
9339
- ).min(0).max(720).optional()
9979
+ "The number of minutes between the end of a session and the start of the next."
9980
+ ).min(0).max(720).optional(),
9981
+ durationRange: z.intersection(
9982
+ z.object({
9983
+ unitType: z.enum(["HOUR", "DAY"]).describe(
9984
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
9985
+ ).optional()
9986
+ }),
9987
+ z.xor([
9988
+ z.object({
9989
+ hourOptions: z.never().optional(),
9990
+ dayOptions: z.never().optional()
9991
+ }),
9992
+ z.object({
9993
+ dayOptions: z.never().optional(),
9994
+ hourOptions: z.object({
9995
+ minDurationInMinutes: z.number().int().describe(
9996
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
9997
+ ).min(30).max(1440).optional(),
9998
+ maxDurationInMinutes: z.number().int().describe(
9999
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
10000
+ ).min(30).max(1440).optional()
10001
+ }).describe(
10002
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
10003
+ )
10004
+ }),
10005
+ z.object({
10006
+ hourOptions: z.never().optional(),
10007
+ dayOptions: z.object({
10008
+ minDurationInDays: z.number().int().describe(
10009
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
10010
+ ).min(1).max(8).optional(),
10011
+ maxDurationInDays: z.number().int().describe(
10012
+ "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`."
10013
+ ).min(1).max(8).optional()
10014
+ }).describe(
10015
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
10016
+ )
10017
+ })
10018
+ ])
10019
+ ).describe(
10020
+ "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."
10021
+ ).optional()
9340
10022
  }).describe("Limitations affecting the service availability.").optional()
9341
10023
  }).describe(
9342
10024
  "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)."
@@ -9369,17 +10051,27 @@ var QueryServicesResponse = z.object({
9369
10051
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
9370
10052
  ).optional(),
9371
10053
  serviceResources: z.array(
9372
- z.object({
9373
- resourceType: z.object({
9374
- _id: z.string().describe("The type of the resource.").regex(
9375
- /^[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}$/,
9376
- "Must be a valid GUID"
9377
- ).optional().nullable(),
9378
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
9379
- }).describe(
9380
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
9381
- ).optional()
9382
- })
10054
+ z.intersection(
10055
+ z.object({
10056
+ resourceType: z.object({
10057
+ _id: z.string().describe("The type of the resource.").regex(
10058
+ /^[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}$/,
10059
+ "Must be a valid GUID"
10060
+ ).optional().nullable(),
10061
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
10062
+ }).describe(
10063
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
10064
+ ).optional()
10065
+ }),
10066
+ z.xor([
10067
+ z.object({ resourceIds: z.never().optional() }),
10068
+ z.object({
10069
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
10070
+ "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."
10071
+ )
10072
+ })
10073
+ ])
10074
+ )
9383
10075
  ).max(3).optional(),
9384
10076
  supportedSlugs: z.array(
9385
10077
  z.object({
@@ -9506,8 +10198,18 @@ var QueryServicesResponse = z.object({
9506
10198
  taxableAddress: z.object({
9507
10199
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
9508
10200
  }).describe("Taxable address used to calculate tax").optional(),
9509
- inheritResourceLocations: z.boolean().describe(
9510
- "Whether to inherit resource locations for availability resolution."
10201
+ primaryResourceType: z.string().describe(
10202
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
10203
+ that serves as the primary resource for this appointment service. The primary resource type
10204
+ determines which resources drive slot assignment and availability resolution.
10205
+
10206
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
10207
+ based on the rooms' schedules rather than staff schedules.
10208
+
10209
+ Default: The staff resource type.`
10210
+ ).regex(
10211
+ /^[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}$/,
10212
+ "Must be a valid GUID"
9511
10213
  ).optional().nullable()
9512
10214
  })
9513
10215
  ).optional(),
@@ -10485,15 +11187,54 @@ var SearchServicesResponse = z.object({
10485
11187
  availabilityConstraints: z.object({
10486
11188
  durations: z.array(
10487
11189
  z.object({
10488
- minutes: z.number().int().describe(
10489
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
10490
- ).min(1).max(44639).optional()
11190
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
10491
11191
  })
10492
11192
  ).max(50).optional(),
10493
11193
  sessionDurations: z.array(z.number().int()).max(50).optional(),
10494
11194
  timeBetweenSessions: z.number().int().describe(
10495
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
10496
- ).min(0).max(720).optional()
11195
+ "The number of minutes between the end of a session and the start of the next."
11196
+ ).min(0).max(720).optional(),
11197
+ durationRange: z.intersection(
11198
+ z.object({
11199
+ unitType: z.enum(["HOUR", "DAY"]).describe(
11200
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
11201
+ ).optional()
11202
+ }),
11203
+ z.xor([
11204
+ z.object({
11205
+ hourOptions: z.never().optional(),
11206
+ dayOptions: z.never().optional()
11207
+ }),
11208
+ z.object({
11209
+ dayOptions: z.never().optional(),
11210
+ hourOptions: z.object({
11211
+ minDurationInMinutes: z.number().int().describe(
11212
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
11213
+ ).min(30).max(1440).optional(),
11214
+ maxDurationInMinutes: z.number().int().describe(
11215
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
11216
+ ).min(30).max(1440).optional()
11217
+ }).describe(
11218
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
11219
+ )
11220
+ }),
11221
+ z.object({
11222
+ hourOptions: z.never().optional(),
11223
+ dayOptions: z.object({
11224
+ minDurationInDays: z.number().int().describe(
11225
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
11226
+ ).min(1).max(8).optional(),
11227
+ maxDurationInDays: z.number().int().describe(
11228
+ "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`."
11229
+ ).min(1).max(8).optional()
11230
+ }).describe(
11231
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
11232
+ )
11233
+ })
11234
+ ])
11235
+ ).describe(
11236
+ "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."
11237
+ ).optional()
10497
11238
  }).describe("Limitations affecting the service availability.").optional()
10498
11239
  }).describe(
10499
11240
  "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)."
@@ -10526,17 +11267,27 @@ var SearchServicesResponse = z.object({
10526
11267
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
10527
11268
  ).optional(),
10528
11269
  serviceResources: z.array(
10529
- z.object({
10530
- resourceType: z.object({
10531
- _id: z.string().describe("The type of the resource.").regex(
10532
- /^[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}$/,
10533
- "Must be a valid GUID"
10534
- ).optional().nullable(),
10535
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
10536
- }).describe(
10537
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
10538
- ).optional()
10539
- })
11270
+ z.intersection(
11271
+ z.object({
11272
+ resourceType: z.object({
11273
+ _id: z.string().describe("The type of the resource.").regex(
11274
+ /^[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}$/,
11275
+ "Must be a valid GUID"
11276
+ ).optional().nullable(),
11277
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
11278
+ }).describe(
11279
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
11280
+ ).optional()
11281
+ }),
11282
+ z.xor([
11283
+ z.object({ resourceIds: z.never().optional() }),
11284
+ z.object({
11285
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
11286
+ "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."
11287
+ )
11288
+ })
11289
+ ])
11290
+ )
10540
11291
  ).max(3).optional(),
10541
11292
  supportedSlugs: z.array(
10542
11293
  z.object({
@@ -10663,8 +11414,18 @@ var SearchServicesResponse = z.object({
10663
11414
  taxableAddress: z.object({
10664
11415
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
10665
11416
  }).describe("Taxable address used to calculate tax").optional(),
10666
- inheritResourceLocations: z.boolean().describe(
10667
- "Whether to inherit resource locations for availability resolution."
11417
+ primaryResourceType: z.string().describe(
11418
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
11419
+ that serves as the primary resource for this appointment service. The primary resource type
11420
+ determines which resources drive slot assignment and availability resolution.
11421
+
11422
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
11423
+ based on the rooms' schedules rather than staff schedules.
11424
+
11425
+ Default: The staff resource type.`
11426
+ ).regex(
11427
+ /^[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}$/,
11428
+ "Must be a valid GUID"
10668
11429
  ).optional().nullable()
10669
11430
  })
10670
11431
  ).optional(),
@@ -11726,14 +12487,55 @@ var QueryPoliciesResponse = z.object({
11726
12487
  durations: z.array(
11727
12488
  z.object({
11728
12489
  minutes: z.number().int().describe(
11729
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
12490
+ "The duration of the service in minutes."
11730
12491
  ).min(1).max(44639).optional()
11731
12492
  })
11732
12493
  ).max(50).optional(),
11733
12494
  sessionDurations: z.array(z.number().int()).max(50).optional(),
11734
12495
  timeBetweenSessions: z.number().int().describe(
11735
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
11736
- ).min(0).max(720).optional()
12496
+ "The number of minutes between the end of a session and the start of the next."
12497
+ ).min(0).max(720).optional(),
12498
+ durationRange: z.intersection(
12499
+ z.object({
12500
+ unitType: z.enum(["HOUR", "DAY"]).describe(
12501
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
12502
+ ).optional()
12503
+ }),
12504
+ z.xor([
12505
+ z.object({
12506
+ hourOptions: z.never().optional(),
12507
+ dayOptions: z.never().optional()
12508
+ }),
12509
+ z.object({
12510
+ dayOptions: z.never().optional(),
12511
+ hourOptions: z.object({
12512
+ minDurationInMinutes: z.number().int().describe(
12513
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
12514
+ ).min(30).max(1440).optional(),
12515
+ maxDurationInMinutes: z.number().int().describe(
12516
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
12517
+ ).min(30).max(1440).optional()
12518
+ }).describe(
12519
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
12520
+ )
12521
+ }),
12522
+ z.object({
12523
+ hourOptions: z.never().optional(),
12524
+ dayOptions: z.object({
12525
+ minDurationInDays: z.number().int().describe(
12526
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
12527
+ ).min(1).max(8).optional(),
12528
+ maxDurationInDays: z.number().int().describe(
12529
+ "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`."
12530
+ ).min(1).max(8).optional()
12531
+ }).describe(
12532
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
12533
+ )
12534
+ })
12535
+ ])
12536
+ ).describe(
12537
+ "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."
12538
+ ).optional()
11737
12539
  }).describe("Limitations affecting the service availability.").optional()
11738
12540
  }).describe(
11739
12541
  "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)."
@@ -11766,17 +12568,29 @@ var QueryPoliciesResponse = z.object({
11766
12568
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
11767
12569
  ).optional(),
11768
12570
  serviceResources: z.array(
11769
- z.object({
11770
- resourceType: z.object({
11771
- _id: z.string().describe("The type of the resource.").regex(
11772
- /^[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}$/,
11773
- "Must be a valid GUID"
11774
- ).optional().nullable(),
11775
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
11776
- }).describe(
11777
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
11778
- ).optional()
11779
- })
12571
+ z.intersection(
12572
+ z.object({
12573
+ resourceType: z.object({
12574
+ _id: z.string().describe("The type of the resource.").regex(
12575
+ /^[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}$/,
12576
+ "Must be a valid GUID"
12577
+ ).optional().nullable(),
12578
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
12579
+ }).describe(
12580
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
12581
+ ).optional()
12582
+ }),
12583
+ z.xor([
12584
+ z.object({ resourceIds: z.never().optional() }),
12585
+ z.object({
12586
+ resourceIds: z.object({
12587
+ values: z.array(z.string()).max(100).optional()
12588
+ }).describe(
12589
+ "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."
12590
+ )
12591
+ })
12592
+ ])
12593
+ )
11780
12594
  ).max(3).optional(),
11781
12595
  supportedSlugs: z.array(
11782
12596
  z.object({
@@ -11903,8 +12717,18 @@ var QueryPoliciesResponse = z.object({
11903
12717
  taxableAddress: z.object({
11904
12718
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
11905
12719
  }).describe("Taxable address used to calculate tax").optional(),
11906
- inheritResourceLocations: z.boolean().describe(
11907
- "Whether to inherit resource locations for availability resolution."
12720
+ primaryResourceType: z.string().describe(
12721
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
12722
+ that serves as the primary resource for this appointment service. The primary resource type
12723
+ determines which resources drive slot assignment and availability resolution.
12724
+
12725
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
12726
+ based on the rooms' schedules rather than staff schedules.
12727
+
12728
+ Default: The staff resource type.`
12729
+ ).regex(
12730
+ /^[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}$/,
12731
+ "Must be a valid GUID"
11908
12732
  ).optional().nullable()
11909
12733
  })
11910
12734
  ).max(5).optional(),
@@ -12891,15 +13715,54 @@ var SetServiceLocationsResponse = z.object({
12891
13715
  availabilityConstraints: z.object({
12892
13716
  durations: z.array(
12893
13717
  z.object({
12894
- minutes: z.number().int().describe(
12895
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
12896
- ).min(1).max(44639).optional()
13718
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
12897
13719
  })
12898
13720
  ).max(50).optional(),
12899
13721
  sessionDurations: z.array(z.number().int()).max(50).optional(),
12900
13722
  timeBetweenSessions: z.number().int().describe(
12901
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
12902
- ).min(0).max(720).optional()
13723
+ "The number of minutes between the end of a session and the start of the next."
13724
+ ).min(0).max(720).optional(),
13725
+ durationRange: z.intersection(
13726
+ z.object({
13727
+ unitType: z.enum(["HOUR", "DAY"]).describe(
13728
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
13729
+ ).optional()
13730
+ }),
13731
+ z.xor([
13732
+ z.object({
13733
+ hourOptions: z.never().optional(),
13734
+ dayOptions: z.never().optional()
13735
+ }),
13736
+ z.object({
13737
+ dayOptions: z.never().optional(),
13738
+ hourOptions: z.object({
13739
+ minDurationInMinutes: z.number().int().describe(
13740
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
13741
+ ).min(30).max(1440).optional(),
13742
+ maxDurationInMinutes: z.number().int().describe(
13743
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
13744
+ ).min(30).max(1440).optional()
13745
+ }).describe(
13746
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
13747
+ )
13748
+ }),
13749
+ z.object({
13750
+ hourOptions: z.never().optional(),
13751
+ dayOptions: z.object({
13752
+ minDurationInDays: z.number().int().describe(
13753
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
13754
+ ).min(1).max(8).optional(),
13755
+ maxDurationInDays: z.number().int().describe(
13756
+ "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`."
13757
+ ).min(1).max(8).optional()
13758
+ }).describe(
13759
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
13760
+ )
13761
+ })
13762
+ ])
13763
+ ).describe(
13764
+ "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."
13765
+ ).optional()
12903
13766
  }).describe("Limitations affecting the service availability.").optional()
12904
13767
  }).describe(
12905
13768
  "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)."
@@ -12932,17 +13795,27 @@ var SetServiceLocationsResponse = z.object({
12932
13795
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
12933
13796
  ).optional(),
12934
13797
  serviceResources: z.array(
12935
- z.object({
12936
- resourceType: z.object({
12937
- _id: z.string().describe("The type of the resource.").regex(
12938
- /^[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}$/,
12939
- "Must be a valid GUID"
12940
- ).optional().nullable(),
12941
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
12942
- }).describe(
12943
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
12944
- ).optional()
12945
- })
13798
+ z.intersection(
13799
+ z.object({
13800
+ resourceType: z.object({
13801
+ _id: z.string().describe("The type of the resource.").regex(
13802
+ /^[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}$/,
13803
+ "Must be a valid GUID"
13804
+ ).optional().nullable(),
13805
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
13806
+ }).describe(
13807
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
13808
+ ).optional()
13809
+ }),
13810
+ z.xor([
13811
+ z.object({ resourceIds: z.never().optional() }),
13812
+ z.object({
13813
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
13814
+ "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."
13815
+ )
13816
+ })
13817
+ ])
13818
+ )
12946
13819
  ).max(3).optional(),
12947
13820
  supportedSlugs: z.array(
12948
13821
  z.object({
@@ -13069,8 +13942,18 @@ var SetServiceLocationsResponse = z.object({
13069
13942
  taxableAddress: z.object({
13070
13943
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
13071
13944
  }).describe("Taxable address used to calculate tax").optional(),
13072
- inheritResourceLocations: z.boolean().describe(
13073
- "Whether to inherit resource locations for availability resolution."
13945
+ primaryResourceType: z.string().describe(
13946
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
13947
+ that serves as the primary resource for this appointment service. The primary resource type
13948
+ determines which resources drive slot assignment and availability resolution.
13949
+
13950
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
13951
+ based on the rooms' schedules rather than staff schedules.
13952
+
13953
+ Default: The staff resource type.`
13954
+ ).regex(
13955
+ /^[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}$/,
13956
+ "Must be a valid GUID"
13074
13957
  ).optional().nullable()
13075
13958
  }).describe("The updated service with the newly set locations.").optional()
13076
13959
  });
@@ -13636,15 +14519,54 @@ var EnablePricingPlansForServiceResponse = z.object({
13636
14519
  availabilityConstraints: z.object({
13637
14520
  durations: z.array(
13638
14521
  z.object({
13639
- minutes: z.number().int().describe(
13640
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
13641
- ).min(1).max(44639).optional()
14522
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
13642
14523
  })
13643
14524
  ).max(50).optional(),
13644
14525
  sessionDurations: z.array(z.number().int()).max(50).optional(),
13645
14526
  timeBetweenSessions: z.number().int().describe(
13646
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
13647
- ).min(0).max(720).optional()
14527
+ "The number of minutes between the end of a session and the start of the next."
14528
+ ).min(0).max(720).optional(),
14529
+ durationRange: z.intersection(
14530
+ z.object({
14531
+ unitType: z.enum(["HOUR", "DAY"]).describe(
14532
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
14533
+ ).optional()
14534
+ }),
14535
+ z.xor([
14536
+ z.object({
14537
+ hourOptions: z.never().optional(),
14538
+ dayOptions: z.never().optional()
14539
+ }),
14540
+ z.object({
14541
+ dayOptions: z.never().optional(),
14542
+ hourOptions: z.object({
14543
+ minDurationInMinutes: z.number().int().describe(
14544
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
14545
+ ).min(30).max(1440).optional(),
14546
+ maxDurationInMinutes: z.number().int().describe(
14547
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
14548
+ ).min(30).max(1440).optional()
14549
+ }).describe(
14550
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
14551
+ )
14552
+ }),
14553
+ z.object({
14554
+ hourOptions: z.never().optional(),
14555
+ dayOptions: z.object({
14556
+ minDurationInDays: z.number().int().describe(
14557
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
14558
+ ).min(1).max(8).optional(),
14559
+ maxDurationInDays: z.number().int().describe(
14560
+ "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`."
14561
+ ).min(1).max(8).optional()
14562
+ }).describe(
14563
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
14564
+ )
14565
+ })
14566
+ ])
14567
+ ).describe(
14568
+ "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."
14569
+ ).optional()
13648
14570
  }).describe("Limitations affecting the service availability.").optional()
13649
14571
  }).describe(
13650
14572
  "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)."
@@ -13677,17 +14599,27 @@ var EnablePricingPlansForServiceResponse = z.object({
13677
14599
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
13678
14600
  ).optional(),
13679
14601
  serviceResources: z.array(
13680
- z.object({
13681
- resourceType: z.object({
13682
- _id: z.string().describe("The type of the resource.").regex(
13683
- /^[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}$/,
13684
- "Must be a valid GUID"
13685
- ).optional().nullable(),
13686
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
13687
- }).describe(
13688
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
13689
- ).optional()
13690
- })
14602
+ z.intersection(
14603
+ z.object({
14604
+ resourceType: z.object({
14605
+ _id: z.string().describe("The type of the resource.").regex(
14606
+ /^[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}$/,
14607
+ "Must be a valid GUID"
14608
+ ).optional().nullable(),
14609
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
14610
+ }).describe(
14611
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
14612
+ ).optional()
14613
+ }),
14614
+ z.xor([
14615
+ z.object({ resourceIds: z.never().optional() }),
14616
+ z.object({
14617
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
14618
+ "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."
14619
+ )
14620
+ })
14621
+ ])
14622
+ )
13691
14623
  ).max(3).optional(),
13692
14624
  supportedSlugs: z.array(
13693
14625
  z.object({
@@ -13814,8 +14746,18 @@ var EnablePricingPlansForServiceResponse = z.object({
13814
14746
  taxableAddress: z.object({
13815
14747
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
13816
14748
  }).describe("Taxable address used to calculate tax").optional(),
13817
- inheritResourceLocations: z.boolean().describe(
13818
- "Whether to inherit resource locations for availability resolution."
14749
+ primaryResourceType: z.string().describe(
14750
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
14751
+ that serves as the primary resource for this appointment service. The primary resource type
14752
+ determines which resources drive slot assignment and availability resolution.
14753
+
14754
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
14755
+ based on the rooms' schedules rather than staff schedules.
14756
+
14757
+ Default: The staff resource type.`
14758
+ ).regex(
14759
+ /^[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}$/,
14760
+ "Must be a valid GUID"
13819
14761
  ).optional().nullable()
13820
14762
  }).describe("Updated service.").optional()
13821
14763
  });
@@ -14381,15 +15323,54 @@ var DisablePricingPlansForServiceResponse = z.object({
14381
15323
  availabilityConstraints: z.object({
14382
15324
  durations: z.array(
14383
15325
  z.object({
14384
- minutes: z.number().int().describe(
14385
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
14386
- ).min(1).max(44639).optional()
15326
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
14387
15327
  })
14388
15328
  ).max(50).optional(),
14389
15329
  sessionDurations: z.array(z.number().int()).max(50).optional(),
14390
15330
  timeBetweenSessions: z.number().int().describe(
14391
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
14392
- ).min(0).max(720).optional()
15331
+ "The number of minutes between the end of a session and the start of the next."
15332
+ ).min(0).max(720).optional(),
15333
+ durationRange: z.intersection(
15334
+ z.object({
15335
+ unitType: z.enum(["HOUR", "DAY"]).describe(
15336
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
15337
+ ).optional()
15338
+ }),
15339
+ z.xor([
15340
+ z.object({
15341
+ hourOptions: z.never().optional(),
15342
+ dayOptions: z.never().optional()
15343
+ }),
15344
+ z.object({
15345
+ dayOptions: z.never().optional(),
15346
+ hourOptions: z.object({
15347
+ minDurationInMinutes: z.number().int().describe(
15348
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
15349
+ ).min(30).max(1440).optional(),
15350
+ maxDurationInMinutes: z.number().int().describe(
15351
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
15352
+ ).min(30).max(1440).optional()
15353
+ }).describe(
15354
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
15355
+ )
15356
+ }),
15357
+ z.object({
15358
+ hourOptions: z.never().optional(),
15359
+ dayOptions: z.object({
15360
+ minDurationInDays: z.number().int().describe(
15361
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
15362
+ ).min(1).max(8).optional(),
15363
+ maxDurationInDays: z.number().int().describe(
15364
+ "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`."
15365
+ ).min(1).max(8).optional()
15366
+ }).describe(
15367
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
15368
+ )
15369
+ })
15370
+ ])
15371
+ ).describe(
15372
+ "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."
15373
+ ).optional()
14393
15374
  }).describe("Limitations affecting the service availability.").optional()
14394
15375
  }).describe(
14395
15376
  "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)."
@@ -14422,17 +15403,27 @@ var DisablePricingPlansForServiceResponse = z.object({
14422
15403
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
14423
15404
  ).optional(),
14424
15405
  serviceResources: z.array(
14425
- z.object({
14426
- resourceType: z.object({
14427
- _id: z.string().describe("The type of the resource.").regex(
14428
- /^[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}$/,
14429
- "Must be a valid GUID"
14430
- ).optional().nullable(),
14431
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
14432
- }).describe(
14433
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
14434
- ).optional()
14435
- })
15406
+ z.intersection(
15407
+ z.object({
15408
+ resourceType: z.object({
15409
+ _id: z.string().describe("The type of the resource.").regex(
15410
+ /^[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}$/,
15411
+ "Must be a valid GUID"
15412
+ ).optional().nullable(),
15413
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
15414
+ }).describe(
15415
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
15416
+ ).optional()
15417
+ }),
15418
+ z.xor([
15419
+ z.object({ resourceIds: z.never().optional() }),
15420
+ z.object({
15421
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
15422
+ "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."
15423
+ )
15424
+ })
15425
+ ])
15426
+ )
14436
15427
  ).max(3).optional(),
14437
15428
  supportedSlugs: z.array(
14438
15429
  z.object({
@@ -14559,8 +15550,18 @@ var DisablePricingPlansForServiceResponse = z.object({
14559
15550
  taxableAddress: z.object({
14560
15551
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
14561
15552
  }).describe("Taxable address used to calculate tax").optional(),
14562
- inheritResourceLocations: z.boolean().describe(
14563
- "Whether to inherit resource locations for availability resolution."
15553
+ primaryResourceType: z.string().describe(
15554
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
15555
+ that serves as the primary resource for this appointment service. The primary resource type
15556
+ determines which resources drive slot assignment and availability resolution.
15557
+
15558
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
15559
+ based on the rooms' schedules rather than staff schedules.
15560
+
15561
+ Default: The staff resource type.`
15562
+ ).regex(
15563
+ /^[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}$/,
15564
+ "Must be a valid GUID"
14564
15565
  ).optional().nullable()
14565
15566
  }).describe("Updated service.").optional()
14566
15567
  });
@@ -15137,15 +16138,54 @@ var SetCustomSlugResponse = z.object({
15137
16138
  availabilityConstraints: z.object({
15138
16139
  durations: z.array(
15139
16140
  z.object({
15140
- minutes: z.number().int().describe(
15141
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
15142
- ).min(1).max(44639).optional()
16141
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
15143
16142
  })
15144
16143
  ).max(50).optional(),
15145
16144
  sessionDurations: z.array(z.number().int()).max(50).optional(),
15146
16145
  timeBetweenSessions: z.number().int().describe(
15147
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
15148
- ).min(0).max(720).optional()
16146
+ "The number of minutes between the end of a session and the start of the next."
16147
+ ).min(0).max(720).optional(),
16148
+ durationRange: z.intersection(
16149
+ z.object({
16150
+ unitType: z.enum(["HOUR", "DAY"]).describe(
16151
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
16152
+ ).optional()
16153
+ }),
16154
+ z.xor([
16155
+ z.object({
16156
+ hourOptions: z.never().optional(),
16157
+ dayOptions: z.never().optional()
16158
+ }),
16159
+ z.object({
16160
+ dayOptions: z.never().optional(),
16161
+ hourOptions: z.object({
16162
+ minDurationInMinutes: z.number().int().describe(
16163
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
16164
+ ).min(30).max(1440).optional(),
16165
+ maxDurationInMinutes: z.number().int().describe(
16166
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
16167
+ ).min(30).max(1440).optional()
16168
+ }).describe(
16169
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
16170
+ )
16171
+ }),
16172
+ z.object({
16173
+ hourOptions: z.never().optional(),
16174
+ dayOptions: z.object({
16175
+ minDurationInDays: z.number().int().describe(
16176
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
16177
+ ).min(1).max(8).optional(),
16178
+ maxDurationInDays: z.number().int().describe(
16179
+ "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`."
16180
+ ).min(1).max(8).optional()
16181
+ }).describe(
16182
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
16183
+ )
16184
+ })
16185
+ ])
16186
+ ).describe(
16187
+ "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."
16188
+ ).optional()
15149
16189
  }).describe("Limitations affecting the service availability.").optional()
15150
16190
  }).describe(
15151
16191
  "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)."
@@ -15178,17 +16218,27 @@ var SetCustomSlugResponse = z.object({
15178
16218
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
15179
16219
  ).optional(),
15180
16220
  serviceResources: z.array(
15181
- z.object({
15182
- resourceType: z.object({
15183
- _id: z.string().describe("The type of the resource.").regex(
15184
- /^[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}$/,
15185
- "Must be a valid GUID"
15186
- ).optional().nullable(),
15187
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
15188
- }).describe(
15189
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
15190
- ).optional()
15191
- })
16221
+ z.intersection(
16222
+ z.object({
16223
+ resourceType: z.object({
16224
+ _id: z.string().describe("The type of the resource.").regex(
16225
+ /^[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}$/,
16226
+ "Must be a valid GUID"
16227
+ ).optional().nullable(),
16228
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
16229
+ }).describe(
16230
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
16231
+ ).optional()
16232
+ }),
16233
+ z.xor([
16234
+ z.object({ resourceIds: z.never().optional() }),
16235
+ z.object({
16236
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
16237
+ "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."
16238
+ )
16239
+ })
16240
+ ])
16241
+ )
15192
16242
  ).max(3).optional(),
15193
16243
  supportedSlugs: z.array(
15194
16244
  z.object({
@@ -15315,8 +16365,18 @@ var SetCustomSlugResponse = z.object({
15315
16365
  taxableAddress: z.object({
15316
16366
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
15317
16367
  }).describe("Taxable address used to calculate tax").optional(),
15318
- inheritResourceLocations: z.boolean().describe(
15319
- "Whether to inherit resource locations for availability resolution."
16368
+ primaryResourceType: z.string().describe(
16369
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
16370
+ that serves as the primary resource for this appointment service. The primary resource type
16371
+ determines which resources drive slot assignment and availability resolution.
16372
+
16373
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
16374
+ based on the rooms' schedules rather than staff schedules.
16375
+
16376
+ Default: The staff resource type.`
16377
+ ).regex(
16378
+ /^[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}$/,
16379
+ "Must be a valid GUID"
15320
16380
  ).optional().nullable()
15321
16381
  }).describe("Updated service.").optional()
15322
16382
  });
@@ -15895,15 +16955,54 @@ var CloneServiceResponse = z.object({
15895
16955
  availabilityConstraints: z.object({
15896
16956
  durations: z.array(
15897
16957
  z.object({
15898
- minutes: z.number().int().describe(
15899
- "The duration of the service in minutes.\n\nMin: `1` minute\nMax: `44639` minutes (30 days, 23 hours, and 59 minutes)"
15900
- ).min(1).max(44639).optional()
16958
+ minutes: z.number().int().describe("The duration of the service in minutes.").min(1).max(44639).optional()
15901
16959
  })
15902
16960
  ).max(50).optional(),
15903
16961
  sessionDurations: z.array(z.number().int()).max(50).optional(),
15904
16962
  timeBetweenSessions: z.number().int().describe(
15905
- "The number of minutes between the end of a session and the start of the next.\n\n\nMin: `0` minutes\nMax: `720` minutes"
15906
- ).min(0).max(720).optional()
16963
+ "The number of minutes between the end of a session and the start of the next."
16964
+ ).min(0).max(720).optional(),
16965
+ durationRange: z.intersection(
16966
+ z.object({
16967
+ unitType: z.enum(["HOUR", "DAY"]).describe(
16968
+ "The unit type for this duration range. Determines which configuration to use in the `config` union."
16969
+ ).optional()
16970
+ }),
16971
+ z.xor([
16972
+ z.object({
16973
+ hourOptions: z.never().optional(),
16974
+ dayOptions: z.never().optional()
16975
+ }),
16976
+ z.object({
16977
+ dayOptions: z.never().optional(),
16978
+ hourOptions: z.object({
16979
+ minDurationInMinutes: z.number().int().describe(
16980
+ "Minimum bookable duration in minutes. The customer can't book for less than this duration."
16981
+ ).min(30).max(1440).optional(),
16982
+ maxDurationInMinutes: z.number().int().describe(
16983
+ "Maximum bookable duration in minutes. The customer can't book for more than this duration.\n\nMust be greater than or equal to `minDurationInMinutes`."
16984
+ ).min(30).max(1440).optional()
16985
+ }).describe(
16986
+ "Configuration for hourly duration ranges. Set when `unitType` is `HOUR`."
16987
+ )
16988
+ }),
16989
+ z.object({
16990
+ hourOptions: z.never().optional(),
16991
+ dayOptions: z.object({
16992
+ minDurationInDays: z.number().int().describe(
16993
+ "Minimum bookable duration in days. The customer can't book for less than this number of days."
16994
+ ).min(1).max(8).optional(),
16995
+ maxDurationInDays: z.number().int().describe(
16996
+ "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`."
16997
+ ).min(1).max(8).optional()
16998
+ }).describe(
16999
+ "Configuration for daily duration ranges. Set when `unitType` is `DAY`."
17000
+ )
17001
+ })
17002
+ ])
17003
+ ).describe(
17004
+ "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."
17005
+ ).optional()
15907
17006
  }).describe("Limitations affecting the service availability.").optional()
15908
17007
  }).describe(
15909
17008
  "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)."
@@ -15936,17 +17035,27 @@ var CloneServiceResponse = z.object({
15936
17035
  "Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified."
15937
17036
  ).optional(),
15938
17037
  serviceResources: z.array(
15939
- z.object({
15940
- resourceType: z.object({
15941
- _id: z.string().describe("The type of the resource.").regex(
15942
- /^[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}$/,
15943
- "Must be a valid GUID"
15944
- ).optional().nullable(),
15945
- name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
15946
- }).describe(
15947
- "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
15948
- ).optional()
15949
- })
17038
+ z.intersection(
17039
+ z.object({
17040
+ resourceType: z.object({
17041
+ _id: z.string().describe("The type of the resource.").regex(
17042
+ /^[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}$/,
17043
+ "Must be a valid GUID"
17044
+ ).optional().nullable(),
17045
+ name: z.string().describe("The name of the resource type.").max(40).min(1).optional().nullable()
17046
+ }).describe(
17047
+ "Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)."
17048
+ ).optional()
17049
+ }),
17050
+ z.xor([
17051
+ z.object({ resourceIds: z.never().optional() }),
17052
+ z.object({
17053
+ resourceIds: z.object({ values: z.array(z.string()).max(100).optional() }).describe(
17054
+ "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."
17055
+ )
17056
+ })
17057
+ ])
17058
+ )
15950
17059
  ).max(3).optional(),
15951
17060
  supportedSlugs: z.array(
15952
17061
  z.object({
@@ -16073,8 +17182,18 @@ var CloneServiceResponse = z.object({
16073
17182
  taxableAddress: z.object({
16074
17183
  taxableAddressType: z.enum(["BUSINESS", "BILLING"]).describe("Taxable address type.").optional()
16075
17184
  }).describe("Taxable address used to calculate tax").optional(),
16076
- inheritResourceLocations: z.boolean().describe(
16077
- "Whether to inherit resource locations for availability resolution."
17185
+ primaryResourceType: z.string().describe(
17186
+ `ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
17187
+ that serves as the primary resource for this appointment service. The primary resource type
17188
+ determines which resources drive slot assignment and availability resolution.
17189
+
17190
+ For example, when set to a "Meeting Rooms" resource type, availability is calculated
17191
+ based on the rooms' schedules rather than staff schedules.
17192
+
17193
+ Default: The staff resource type.`
17194
+ ).regex(
17195
+ /^[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}$/,
17196
+ "Must be a valid GUID"
16078
17197
  ).optional().nullable()
16079
17198
  }).describe("Cloned service.").optional(),
16080
17199
  errors: z.array(z.enum(["OPTIONS_AND_VARIANTS", "FORM"])).optional()