@wix/auto_sdk_bookings_booking-policies 1.0.38 → 1.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +23 -10
- package/build/cjs/index.js +1 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/{bookings-v1-booking-policy-booking-policies.universal-Dn-27NDP.d.ts → index.typings.d.ts} +266 -1
- package/build/cjs/index.typings.js +641 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +2 -1
- package/build/es/index.d.mts +23 -10
- package/build/es/index.mjs +1 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/{bookings-v1-booking-policy-booking-policies.universal-Dn-27NDP.d.mts → index.typings.d.mts} +266 -1
- package/build/es/index.typings.mjs +601 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +2 -1
- package/build/internal/cjs/index.d.ts +23 -10
- package/build/internal/cjs/index.js +1 -0
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/{bookings-v1-booking-policy-booking-policies.universal-Dn-27NDP.d.ts → index.typings.d.ts} +266 -1
- package/build/internal/cjs/index.typings.js +641 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +2 -1
- package/build/internal/es/index.d.mts +23 -10
- package/build/internal/es/index.mjs +1 -0
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/{bookings-v1-booking-policy-booking-policies.universal-Dn-27NDP.d.mts → index.typings.d.mts} +266 -1
- package/build/internal/es/index.typings.mjs +601 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +2 -1
- package/package.json +2 -2
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* A booking policy is a set of rules that determine how customers can book a
|
|
3
5
|
* service, including timeframes for booking, canceling, or rescheduling.
|
|
@@ -1434,6 +1436,37 @@ declare enum WebhookIdentityType {
|
|
|
1434
1436
|
}
|
|
1435
1437
|
/** @enumType */
|
|
1436
1438
|
type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
|
|
1439
|
+
type CreateBookingPolicyValidationErrors = {
|
|
1440
|
+
ruleName?: 'BOTH_LATE_AND_AFTER_START_POLICIES_NOT_ALLOWED';
|
|
1441
|
+
} | {
|
|
1442
|
+
ruleName?: 'INVALID_BOOKING_WINDOW';
|
|
1443
|
+
} | {
|
|
1444
|
+
ruleName?: 'CANCELLATION_FEE_WITHOUT_CREDIT_CARD';
|
|
1445
|
+
} | {
|
|
1446
|
+
ruleName?: 'CANCELLATION_FEE_WITHOUT_DESCRIPTION';
|
|
1447
|
+
} | {
|
|
1448
|
+
ruleName?: 'INVALID_CANCELLATION_WINDOWS_ORDER';
|
|
1449
|
+
} | {
|
|
1450
|
+
ruleName?: 'EMPTY_CANCELLATION_WINDOWS_LIST';
|
|
1451
|
+
};
|
|
1452
|
+
type UpdateBookingPolicyValidationErrors = {
|
|
1453
|
+
ruleName?: 'BOTH_LATE_AND_AFTER_START_POLICIES_NOT_ALLOWED';
|
|
1454
|
+
} | {
|
|
1455
|
+
ruleName?: 'INVALID_BOOKING_WINDOW';
|
|
1456
|
+
} | {
|
|
1457
|
+
ruleName?: 'CANCELLATION_FEE_WITHOUT_CREDIT_CARD';
|
|
1458
|
+
} | {
|
|
1459
|
+
ruleName?: 'CANCELLATION_FEE_WITHOUT_DESCRIPTION';
|
|
1460
|
+
} | {
|
|
1461
|
+
ruleName?: 'INVALID_CANCELLATION_WINDOWS_ORDER';
|
|
1462
|
+
} | {
|
|
1463
|
+
ruleName?: 'EMPTY_CANCELLATION_WINDOWS_LIST';
|
|
1464
|
+
};
|
|
1465
|
+
type DeleteBookingPolicyApplicationErrors = {
|
|
1466
|
+
code?: 'DEFAULT_POLICY_CANNOT_BE_DELETED';
|
|
1467
|
+
description?: string;
|
|
1468
|
+
data?: Record<string, any>;
|
|
1469
|
+
};
|
|
1437
1470
|
interface BaseEventMetadata {
|
|
1438
1471
|
/**
|
|
1439
1472
|
* App instance ID.
|
|
@@ -1482,17 +1515,176 @@ interface BookingPolicyCreatedEnvelope {
|
|
|
1482
1515
|
entity: BookingPolicy;
|
|
1483
1516
|
metadata: EventMetadata;
|
|
1484
1517
|
}
|
|
1518
|
+
/**
|
|
1519
|
+
* Triggered when a booking policy is created.
|
|
1520
|
+
* @permissionScope Manage Stores
|
|
1521
|
+
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
1522
|
+
* @permissionScope Read Bookings - Public Data
|
|
1523
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
|
|
1524
|
+
* @permissionScope Manage Bookings Services and Settings
|
|
1525
|
+
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
1526
|
+
* @permissionScope Manage Bookings
|
|
1527
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
1528
|
+
* @permissionScope Read Bookings - Including Participants
|
|
1529
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
|
|
1530
|
+
* @permissionScope Read Bookings - all read permissions
|
|
1531
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
|
|
1532
|
+
* @permissionScope Manage Bookings - all permissions
|
|
1533
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
1534
|
+
* @permissionId BOOKINGS.BOOKING_POLICY_READ
|
|
1535
|
+
* @webhook
|
|
1536
|
+
* @eventType wix.bookings.v1.booking_policy_created
|
|
1537
|
+
* @slug created
|
|
1538
|
+
*/
|
|
1539
|
+
declare function onBookingPolicyCreated(handler: (event: BookingPolicyCreatedEnvelope) => void | Promise<void>): void;
|
|
1485
1540
|
interface BookingPolicyDefaultBookingPolicySetEnvelope {
|
|
1486
1541
|
data: DefaultBookingPolicySet;
|
|
1487
1542
|
metadata: EventMetadata;
|
|
1488
1543
|
}
|
|
1544
|
+
/**
|
|
1545
|
+
* Triggered when the site's default policy changes. Then,
|
|
1546
|
+
* _Booking Policy Updated_
|
|
1547
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/booking-policies/on-booking-policy-updated) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policies/booking-policy-updated))
|
|
1548
|
+
* is also triggered both for the new and the previous default policy.
|
|
1549
|
+
* @permissionScope Manage Stores
|
|
1550
|
+
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
1551
|
+
* @permissionScope Read Bookings - Public Data
|
|
1552
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
|
|
1553
|
+
* @permissionScope Manage Bookings Services and Settings
|
|
1554
|
+
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
1555
|
+
* @permissionScope Manage Bookings
|
|
1556
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
1557
|
+
* @permissionScope Read Bookings - Including Participants
|
|
1558
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
|
|
1559
|
+
* @permissionScope Read Bookings - all read permissions
|
|
1560
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
|
|
1561
|
+
* @permissionScope Manage Bookings - all permissions
|
|
1562
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
1563
|
+
* @permissionId BOOKINGS.BOOKING_POLICY_READ
|
|
1564
|
+
* @webhook
|
|
1565
|
+
* @eventType wix.bookings.v1.booking_policy_default_booking_policy_set
|
|
1566
|
+
* @slug default_booking_policy_set
|
|
1567
|
+
*/
|
|
1568
|
+
declare function onBookingPolicyDefaultBookingPolicySet(handler: (event: BookingPolicyDefaultBookingPolicySetEnvelope) => void | Promise<void>): void;
|
|
1489
1569
|
interface BookingPolicyDeletedEnvelope {
|
|
1490
1570
|
metadata: EventMetadata;
|
|
1491
1571
|
}
|
|
1572
|
+
/**
|
|
1573
|
+
* Triggered when a booking policy is deleted.
|
|
1574
|
+
* @permissionScope Manage Stores
|
|
1575
|
+
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
1576
|
+
* @permissionScope Read Bookings - Public Data
|
|
1577
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
|
|
1578
|
+
* @permissionScope Manage Bookings Services and Settings
|
|
1579
|
+
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
1580
|
+
* @permissionScope Manage Bookings
|
|
1581
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
1582
|
+
* @permissionScope Read Bookings - Including Participants
|
|
1583
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
|
|
1584
|
+
* @permissionScope Read Bookings - all read permissions
|
|
1585
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
|
|
1586
|
+
* @permissionScope Manage Bookings - all permissions
|
|
1587
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
1588
|
+
* @permissionId BOOKINGS.BOOKING_POLICY_READ
|
|
1589
|
+
* @webhook
|
|
1590
|
+
* @eventType wix.bookings.v1.booking_policy_deleted
|
|
1591
|
+
* @slug deleted
|
|
1592
|
+
*/
|
|
1593
|
+
declare function onBookingPolicyDeleted(handler: (event: BookingPolicyDeletedEnvelope) => void | Promise<void>): void;
|
|
1492
1594
|
interface BookingPolicyUpdatedEnvelope {
|
|
1493
1595
|
entity: BookingPolicy;
|
|
1494
1596
|
metadata: EventMetadata;
|
|
1495
1597
|
}
|
|
1598
|
+
/**
|
|
1599
|
+
* Triggered when a booking policy is updated, including when a policy's
|
|
1600
|
+
* `default` attribute changes.
|
|
1601
|
+
* @permissionScope Manage Stores
|
|
1602
|
+
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
1603
|
+
* @permissionScope Read Bookings - Public Data
|
|
1604
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
|
|
1605
|
+
* @permissionScope Manage Bookings Services and Settings
|
|
1606
|
+
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
1607
|
+
* @permissionScope Manage Bookings
|
|
1608
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
1609
|
+
* @permissionScope Read Bookings - Including Participants
|
|
1610
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
|
|
1611
|
+
* @permissionScope Read Bookings - all read permissions
|
|
1612
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
|
|
1613
|
+
* @permissionScope Manage Bookings - all permissions
|
|
1614
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
1615
|
+
* @permissionId BOOKINGS.BOOKING_POLICY_READ
|
|
1616
|
+
* @webhook
|
|
1617
|
+
* @eventType wix.bookings.v1.booking_policy_updated
|
|
1618
|
+
* @slug updated
|
|
1619
|
+
*/
|
|
1620
|
+
declare function onBookingPolicyUpdated(handler: (event: BookingPolicyUpdatedEnvelope) => void | Promise<void>): void;
|
|
1621
|
+
type BookingPolicyNonNullablePaths = `customPolicyDescription.enabled` | `customPolicyDescription.description` | `limitEarlyBookingPolicy.enabled` | `limitEarlyBookingPolicy.earliestBookingInMinutes` | `limitLateBookingPolicy.enabled` | `limitLateBookingPolicy.latestBookingInMinutes` | `bookAfterStartPolicy.enabled` | `cancellationPolicy.enabled` | `cancellationPolicy.limitLatestCancellation` | `cancellationPolicy.latestCancellationInMinutes` | `reschedulePolicy.enabled` | `reschedulePolicy.limitLatestReschedule` | `reschedulePolicy.latestRescheduleInMinutes` | `waitlistPolicy.enabled` | `waitlistPolicy.capacity` | `waitlistPolicy.reservationTimeInMinutes` | `participantsPolicy.maxParticipantsPerBooking` | `cancellationFeePolicy.enabled` | `cancellationFeePolicy.cancellationWindows` | `cancellationFeePolicy.cancellationWindows.${number}.amount.value` | `cancellationFeePolicy.cancellationWindows.${number}.amount.currency` | `cancellationFeePolicy.cancellationWindows.${number}.percentage` | `saveCreditCardPolicy.enabled`;
|
|
1622
|
+
/**
|
|
1623
|
+
* Creates a booking policy.
|
|
1624
|
+
* @param bookingPolicy - Booking policy to create.
|
|
1625
|
+
* @public
|
|
1626
|
+
* @requiredField bookingPolicy
|
|
1627
|
+
* @permissionId BOOKINGS.BOOKING_POLICY_CREATE
|
|
1628
|
+
* @applicableIdentity APP
|
|
1629
|
+
* @returns Created booking policy.
|
|
1630
|
+
* @fqn wix.bookings.v1.BookingPoliciesService.CreateBookingPolicy
|
|
1631
|
+
*/
|
|
1632
|
+
declare function createBookingPolicy(bookingPolicy: BookingPolicy): Promise<NonNullablePaths<BookingPolicy, BookingPolicyNonNullablePaths> & {
|
|
1633
|
+
__validationErrorsType?: CreateBookingPolicyValidationErrors;
|
|
1634
|
+
}>;
|
|
1635
|
+
/**
|
|
1636
|
+
* Retrieves a booking policy.
|
|
1637
|
+
* @param bookingPolicyId - ID of the booking policy to retrieve.
|
|
1638
|
+
* @public
|
|
1639
|
+
* @requiredField bookingPolicyId
|
|
1640
|
+
* @permissionId BOOKINGS.BOOKING_POLICY_READ
|
|
1641
|
+
* @applicableIdentity APP
|
|
1642
|
+
* @applicableIdentity VISITOR
|
|
1643
|
+
* @returns Retrieved booking policy.
|
|
1644
|
+
* @fqn wix.bookings.v1.BookingPoliciesService.GetBookingPolicy
|
|
1645
|
+
*/
|
|
1646
|
+
declare function getBookingPolicy(bookingPolicyId: string): Promise<NonNullablePaths<BookingPolicy, BookingPolicyNonNullablePaths>>;
|
|
1647
|
+
/**
|
|
1648
|
+
* Retrieves the strictest version of each policy rule from a list of booking
|
|
1649
|
+
* policies.
|
|
1650
|
+
*
|
|
1651
|
+
*
|
|
1652
|
+
* Returns a hypothetical `bookingPolicy` object that combines the strictest
|
|
1653
|
+
* version of each rule. The `id` of the returned policy is `null` and no
|
|
1654
|
+
* corresponding `bookingPolicy` object is created. To create a new policy, you
|
|
1655
|
+
* can call *Create Booking Policy*
|
|
1656
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/booking-policies/create-booking-policy) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policies/create-booking-policy)).
|
|
1657
|
+
* @param bookingPolicyIds - IDs of the booking policies for which to retrieve the strictest rules for.
|
|
1658
|
+
* @public
|
|
1659
|
+
* @requiredField bookingPolicyIds
|
|
1660
|
+
* @permissionId BOOKINGS.BOOKING_POLICY_READ
|
|
1661
|
+
* @applicableIdentity APP
|
|
1662
|
+
* @applicableIdentity VISITOR
|
|
1663
|
+
* @fqn wix.bookings.v1.BookingPoliciesService.GetStrictestBookingPolicy
|
|
1664
|
+
*/
|
|
1665
|
+
declare function getStrictestBookingPolicy(bookingPolicyIds: string[]): Promise<NonNullablePaths<GetStrictestBookingPolicyResponse, {
|
|
1666
|
+
[P in BookingPolicyNonNullablePaths]: `bookingPolicy.${P}`;
|
|
1667
|
+
}[BookingPolicyNonNullablePaths]>>;
|
|
1668
|
+
/**
|
|
1669
|
+
* Updates a booking policy.
|
|
1670
|
+
*
|
|
1671
|
+
*
|
|
1672
|
+
* Each time the booking policy is updated, `revision` increments by 1.
|
|
1673
|
+
* The current `revision` must be specified when updating the booking policy.
|
|
1674
|
+
* This ensures you're working with the latest booking policy and prevents unintended overwrites.
|
|
1675
|
+
* @param _id - ID of the booking policy.
|
|
1676
|
+
* @public
|
|
1677
|
+
* @requiredField _id
|
|
1678
|
+
* @requiredField bookingPolicy
|
|
1679
|
+
* @requiredField bookingPolicy.revision
|
|
1680
|
+
* @permissionId BOOKINGS.BOOKING_POLICY_UPDATE
|
|
1681
|
+
* @applicableIdentity APP
|
|
1682
|
+
* @returns Updated booking policy.
|
|
1683
|
+
* @fqn wix.bookings.v1.BookingPoliciesService.UpdateBookingPolicy
|
|
1684
|
+
*/
|
|
1685
|
+
declare function updateBookingPolicy(_id: string, bookingPolicy: NonNullablePaths<UpdateBookingPolicy, `revision`>): Promise<NonNullablePaths<BookingPolicy, BookingPolicyNonNullablePaths> & {
|
|
1686
|
+
__validationErrorsType?: UpdateBookingPolicyValidationErrors;
|
|
1687
|
+
}>;
|
|
1496
1688
|
interface UpdateBookingPolicy {
|
|
1497
1689
|
/**
|
|
1498
1690
|
* ID of the booking policy.
|
|
@@ -1559,6 +1751,65 @@ interface UpdateBookingPolicy {
|
|
|
1559
1751
|
/** Extensions enabling users to save custom data related to the booking policies. */
|
|
1560
1752
|
extendedFields?: ExtendedFields;
|
|
1561
1753
|
}
|
|
1754
|
+
/**
|
|
1755
|
+
* Sets a booking policy as the default.
|
|
1756
|
+
*
|
|
1757
|
+
*
|
|
1758
|
+
* Also updates the site's current default policy by setting its `default`
|
|
1759
|
+
* attribute to `false`. If the provided policy is already the site's
|
|
1760
|
+
* default, the call succeeds without changing any `bookingPolicy` object.
|
|
1761
|
+
* @param bookingPolicyId - ID of the booking policy that's set as default.
|
|
1762
|
+
* @public
|
|
1763
|
+
* @requiredField bookingPolicyId
|
|
1764
|
+
* @permissionId BOOKINGS.BOOKING_POLICY_SET_DEFAULT
|
|
1765
|
+
* @applicableIdentity APP
|
|
1766
|
+
* @fqn wix.bookings.v1.BookingPoliciesService.SetDefaultBookingPolicy
|
|
1767
|
+
*/
|
|
1768
|
+
declare function setDefaultBookingPolicy(bookingPolicyId: string): Promise<NonNullablePaths<SetDefaultBookingPolicyResponse, {
|
|
1769
|
+
[P in BookingPolicyNonNullablePaths]: `currentDefaultBookingPolicy.${P}`;
|
|
1770
|
+
}[BookingPolicyNonNullablePaths] | {
|
|
1771
|
+
[P in BookingPolicyNonNullablePaths]: `previousDefaultBookingPolicy.${P}`;
|
|
1772
|
+
}[BookingPolicyNonNullablePaths]>>;
|
|
1773
|
+
/**
|
|
1774
|
+
* Deletes a booking policy.
|
|
1775
|
+
*
|
|
1776
|
+
*
|
|
1777
|
+
* You can't delete the default policy without first *setting a different policy as default*
|
|
1778
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/booking-policies/set-default-booking-policy) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policies/set-default-booking-policy)).
|
|
1779
|
+
* @param bookingPolicyId - ID of the booking policy to delete.
|
|
1780
|
+
* @public
|
|
1781
|
+
* @requiredField bookingPolicyId
|
|
1782
|
+
* @permissionId BOOKINGS.BOOKING_POLICY_DELETE
|
|
1783
|
+
* @applicableIdentity APP
|
|
1784
|
+
* @fqn wix.bookings.v1.BookingPoliciesService.DeleteBookingPolicy
|
|
1785
|
+
*/
|
|
1786
|
+
declare function deleteBookingPolicy(bookingPolicyId: string): Promise<void & {
|
|
1787
|
+
__applicationErrorsType?: DeleteBookingPolicyApplicationErrors;
|
|
1788
|
+
}>;
|
|
1789
|
+
/**
|
|
1790
|
+
* Creates a query to retrieve a list of `bookingPolicy` objects.
|
|
1791
|
+
*
|
|
1792
|
+
* The `queryBookingPolicies()` function builds a query to retrieve a list of `bookingPolicy` objects and returns a `BookingPoliciesQueryBuilder` object.
|
|
1793
|
+
*
|
|
1794
|
+
* The returned object contains the query definition, which is typically used to run the query using the [find()](https://dev.wix.com/docs/sdk/backend-modules/bookings/booking-policies/booking-policies-query-builder/find) function.
|
|
1795
|
+
*
|
|
1796
|
+
* You can refine the query by chaining `BookingPoliciesQueryBuilder` functions onto the query. `BookingPoliciesQueryBuilder` functions enable you to sort, filter, and control the results that `queryBookingPolicies()` returns.
|
|
1797
|
+
*
|
|
1798
|
+
* `queryBookingPolicies()` runs with the following `BookingPoliciesQueryBuilder` defaults that you can override:
|
|
1799
|
+
*
|
|
1800
|
+
* + `limit` is `50`.
|
|
1801
|
+
* + Sorted by `createdDate` in ascending order.
|
|
1802
|
+
*
|
|
1803
|
+
* The functions that are chained to `queryBookingPolicies()` are applied in the order they are called. For example, if you apply `ascending("waitlistPolicy.capacity")` and then `ascending("name")`, the results are sorted first by `waitlistPolicy.capacity`, and then, if there are multiple results with the same `waitlistPolicy.capacity`, the items are sorted by `name`.
|
|
1804
|
+
*
|
|
1805
|
+
* The following `BookingPoliciesQueryBuilder` functions are supported for the `queryBookingPolicies()` function. For a full description of the `bookingPolicy` object, see the object returned for the [items](https://dev.wix.com/docs/sdk/backend-modules/bookings/booking-policies/booking-policies-query-result/items) property in `BookingPoliciesQueryResult`.
|
|
1806
|
+
* @public
|
|
1807
|
+
* @permissionId BOOKINGS.BOOKING_POLICY_READ
|
|
1808
|
+
* @applicableIdentity APP
|
|
1809
|
+
* @applicableIdentity VISITOR
|
|
1810
|
+
* @fqn wix.bookings.v1.BookingPoliciesService.QueryBookingPolicies
|
|
1811
|
+
*/
|
|
1812
|
+
declare function queryBookingPolicies(): BookingPoliciesQueryBuilder;
|
|
1562
1813
|
interface QueryCursorResult {
|
|
1563
1814
|
cursors: Cursors;
|
|
1564
1815
|
hasNext: () => boolean;
|
|
@@ -1612,6 +1863,20 @@ interface BookingPoliciesQueryBuilder {
|
|
|
1612
1863
|
skipTo: (cursor: string) => BookingPoliciesQueryBuilder;
|
|
1613
1864
|
find: () => Promise<BookingPoliciesQueryResult>;
|
|
1614
1865
|
}
|
|
1866
|
+
/**
|
|
1867
|
+
* Counts booking policies, given the provided filtering.
|
|
1868
|
+
*
|
|
1869
|
+
*
|
|
1870
|
+
* See *supported filters*
|
|
1871
|
+
* ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policies/supported-filters))
|
|
1872
|
+
* for a complete list of supported filters.
|
|
1873
|
+
* @public
|
|
1874
|
+
* @permissionId BOOKINGS.BOOKING_POLICY_READ
|
|
1875
|
+
* @applicableIdentity APP
|
|
1876
|
+
* @applicableIdentity VISITOR
|
|
1877
|
+
* @fqn wix.bookings.v1.BookingPoliciesService.CountBookingPolicies
|
|
1878
|
+
*/
|
|
1879
|
+
declare function countBookingPolicies(options?: CountBookingPoliciesOptions): Promise<NonNullablePaths<CountBookingPoliciesResponse, `count`>>;
|
|
1615
1880
|
interface CountBookingPoliciesOptions {
|
|
1616
1881
|
/**
|
|
1617
1882
|
* Filter to base the count on. See
|
|
@@ -1622,4 +1887,4 @@ interface CountBookingPoliciesOptions {
|
|
|
1622
1887
|
filter?: Record<string, any> | null;
|
|
1623
1888
|
}
|
|
1624
1889
|
|
|
1625
|
-
export { type
|
|
1890
|
+
export { type ActionEvent, type Address, type AddressHint, type Asset, type BaseEventMetadata, type BookAfterStartPolicy, type BookingPoliciesQueryBuilder, type BookingPoliciesQueryResult, type BookingPolicy, type BookingPolicyCreatedEnvelope, type BookingPolicyDefaultBookingPolicySetEnvelope, type BookingPolicyDeletedEnvelope, type BookingPolicyUpdatedEnvelope, type BusinessSchedule, type CancellationFeePolicy, type CancellationPolicy, type CancellationWindow, type CancellationWindowFeeOneOf, type Categories, type ChangeContext, type ChangeContextPayloadOneOf, type ConsentPolicy, type CountBookingPoliciesOptions, type CountBookingPoliciesRequest, type CountBookingPoliciesResponse, type CreateBookingPolicyRequest, type CreateBookingPolicyResponse, type CreateBookingPolicyValidationErrors, type CreateMissingDefaultPolicyRequest, type CreateMissingDefaultPolicyResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, DayOfWeek, type DayOfWeekWithLiterals, type DefaultBookingPolicySet, type DeleteBookingPolicyApplicationErrors, type DeleteBookingPolicyRequest, type DeleteBookingPolicyResponse, type DeleteContext, DeleteStatus, type DeleteStatusWithLiterals, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, type GeoCoordinates, type GetBookingPolicyRequest, type GetBookingPolicyResponse, type GetStrictestBookingPolicyRequest, type GetStrictestBookingPolicyResponse, type IdentificationData, type IdentificationDataIdOneOf, type LimitEarlyBookingPolicy, type LimitLateBookingPolicy, type Locale, type MessageEnvelope, type MetaSiteSpecialEvent, type MetaSiteSpecialEventPayloadOneOf, type Money, type Multilingual, Namespace, type NamespaceChanged, type NamespaceWithLiterals, type OdeditorAssigned, type OdeditorUnassigned, type ParticipantsPolicy, type PicassoAssigned, type PicassoUnassigned, PlacementType, type PlacementTypeWithLiterals, type PolicyDescription, type Properties, type PropertiesChange, type QueryBookingPoliciesRequest, type QueryBookingPoliciesResponse, type ReschedulePolicy, ResolutionMethod, type ResolutionMethodWithLiterals, type ResourcesPolicy, type RestoreInfo, type SaveCreditCardPolicy, type ServiceProvisioned, type ServiceRemoved, type SetDefaultBookingPolicyRequest, type SetDefaultBookingPolicyResponse, type SiteCloned, type SiteCreated, SiteCreatedContext, type SiteCreatedContextWithLiterals, type SiteDeleted, type SiteHardDeleted, type SiteMarkedAsTemplate, type SiteMarkedAsWixSite, type SitePropertiesEvent, type SitePropertiesNotification, type SitePublished, type SitePurgedExternally, type SiteRenamed, type SiteTransferred, type SiteUndeleted, type SiteUnpublished, type SiteUrlChanged, SortOrder, type SortOrderWithLiterals, type Sorting, type SpecialHourPeriod, State, type StateWithLiterals, type StudioAssigned, type StudioUnassigned, type SupportedLanguage, type TimePeriod, type Translation, type UpdateAllPoliciesRequest, type UpdateAllPoliciesResponse, type UpdateBookingPolicy, type UpdateBookingPolicyRequest, type UpdateBookingPolicyResponse, type UpdateBookingPolicyValidationErrors, type V4SiteCreated, type WaitlistPolicy, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, countBookingPolicies, createBookingPolicy, deleteBookingPolicy, getBookingPolicy, getStrictestBookingPolicy, onBookingPolicyCreated, onBookingPolicyDefaultBookingPolicySet, onBookingPolicyDeleted, onBookingPolicyUpdated, queryBookingPolicies, setDefaultBookingPolicy, updateBookingPolicy };
|