@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.
Files changed (29) hide show
  1. package/build/cjs/index.d.ts +23 -10
  2. package/build/cjs/index.js +1 -0
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/{bookings-v1-booking-policy-booking-policies.universal-Dn-27NDP.d.ts → index.typings.d.ts} +266 -1
  5. package/build/cjs/index.typings.js +641 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +2 -1
  8. package/build/es/index.d.mts +23 -10
  9. package/build/es/index.mjs +1 -0
  10. package/build/es/index.mjs.map +1 -1
  11. package/build/es/{bookings-v1-booking-policy-booking-policies.universal-Dn-27NDP.d.mts → index.typings.d.mts} +266 -1
  12. package/build/es/index.typings.mjs +601 -0
  13. package/build/es/index.typings.mjs.map +1 -0
  14. package/build/es/meta.d.mts +2 -1
  15. package/build/internal/cjs/index.d.ts +23 -10
  16. package/build/internal/cjs/index.js +1 -0
  17. package/build/internal/cjs/index.js.map +1 -1
  18. package/build/internal/cjs/{bookings-v1-booking-policy-booking-policies.universal-Dn-27NDP.d.ts → index.typings.d.ts} +266 -1
  19. package/build/internal/cjs/index.typings.js +641 -0
  20. package/build/internal/cjs/index.typings.js.map +1 -0
  21. package/build/internal/cjs/meta.d.ts +2 -1
  22. package/build/internal/es/index.d.mts +23 -10
  23. package/build/internal/es/index.mjs +1 -0
  24. package/build/internal/es/index.mjs.map +1 -1
  25. package/build/internal/es/{bookings-v1-booking-policy-booking-policies.universal-Dn-27NDP.d.mts → index.typings.d.mts} +266 -1
  26. package/build/internal/es/index.typings.mjs +601 -0
  27. package/build/internal/es/index.typings.mjs.map +1 -0
  28. package/build/internal/es/meta.d.mts +2 -1
  29. package/package.json +2 -2
@@ -1,7 +1,8 @@
1
- import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
- import { B as BookingPolicy, G as GetStrictestBookingPolicyResponse, U as UpdateBookingPolicy, S as SetDefaultBookingPolicyResponse, a as BookingPoliciesQueryBuilder, C as CountBookingPoliciesOptions, b as CountBookingPoliciesResponse, c as BookingPolicyCreatedEnvelope, d as BookingPolicyDefaultBookingPolicySetEnvelope, e as BookingPolicyDeletedEnvelope, f as BookingPolicyUpdatedEnvelope } from './bookings-v1-booking-policy-booking-policies.universal-Dn-27NDP.js';
3
- export { ab as ActionEvent, ai as Address, aj as AddressHint, az as Asset, aZ as BaseEventMetadata, m as BookAfterStartPolicy, a$ as BookingPoliciesQueryResult, al as BusinessSchedule, s as CancellationFeePolicy, n as CancellationPolicy, t as CancellationWindow, u as CancellationWindowFeeOneOf, ag as Categories, as as ChangeContext, at as ChangeContextPayloadOneOf, aq as ConsentPolicy, a0 as CountBookingPoliciesRequest, x as CreateBookingPolicyRequest, y as CreateBookingPolicyResponse, a3 as CreateMissingDefaultPolicyRequest, a4 as CreateMissingDefaultPolicyResponse, Y as CursorPaging, _ as CursorPagingMetadata, T as CursorQuery, V as CursorQueryPagingMethodOneOf, $ as Cursors, D as DayOfWeek, w as DefaultBookingPolicySet, K as DeleteBookingPolicyRequest, O as DeleteBookingPolicyResponse, aD as DeleteContext, j as DeleteStatus, a5 as DomainEvent, a6 as DomainEventBodyOneOf, ac as Empty, a7 as EntityCreatedEvent, aa as EntityDeletedEvent, a9 as EntityUpdatedEvent, a_ as EventMetadata, E as ExtendedFields, ak as GeoCoordinates, z as GetBookingPolicyRequest, A as GetBookingPolicyResponse, F as GetStrictestBookingPolicyRequest, aX as IdentificationData, aY as IdentificationDataIdOneOf, L as LimitEarlyBookingPolicy, l as LimitLateBookingPolicy, ah as Locale, aW as MessageEnvelope, ax as MetaSiteSpecialEvent, ay as MetaSiteSpecialEventPayloadOneOf, M as Money, ao as Multilingual, N as Namespace, aN as NamespaceChanged, aS as OdeditorAssigned, aT as OdeditorUnassigned, q as ParticipantsPolicy, aU as PicassoAssigned, aV as PicassoUnassigned, P as PlacementType, k as PolicyDescription, af as Properties, au as PropertiesChange, Q as QueryBookingPoliciesRequest, Z as QueryBookingPoliciesResponse, o as ReschedulePolicy, R as ResolutionMethod, r as ResourcesPolicy, a8 as RestoreInfo, v as SaveCreditCardPolicy, aJ as ServiceProvisioned, aK as ServiceRemoved, J as SetDefaultBookingPolicyRequest, aw as SiteCloned, aA as SiteCreated, i as SiteCreatedContext, aC as SiteDeleted, aM as SiteHardDeleted, aH as SiteMarkedAsTemplate, aI as SiteMarkedAsWixSite, ae as SitePropertiesEvent, ad as SitePropertiesNotification, aF as SitePublished, aR as SitePurgedExternally, aL as SiteRenamed, aB as SiteTransferred, aE as SiteUndeleted, aG as SiteUnpublished, aQ as SiteUrlChanged, g as SortOrder, X as Sorting, an as SpecialHourPeriod, h as State, aO as StudioAssigned, aP as StudioUnassigned, ap as SupportedLanguage, am as TimePeriod, ar as Translation, a1 as UpdateAllPoliciesRequest, a2 as UpdateAllPoliciesResponse, H as UpdateBookingPolicyRequest, I as UpdateBookingPolicyResponse, av as V4SiteCreated, p as WaitlistPolicy, W as WebhookIdentityType } from './bookings-v1-booking-policy-booking-policies.universal-Dn-27NDP.js';
1
+ import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
+ import { BookingPolicy, CreateBookingPolicyValidationErrors, GetStrictestBookingPolicyResponse, UpdateBookingPolicy, UpdateBookingPolicyValidationErrors, SetDefaultBookingPolicyResponse, DeleteBookingPolicyApplicationErrors, BookingPoliciesQueryBuilder, CountBookingPoliciesOptions, CountBookingPoliciesResponse, BookingPolicyCreatedEnvelope, BookingPolicyDefaultBookingPolicySetEnvelope, BookingPolicyDeletedEnvelope, BookingPolicyUpdatedEnvelope } from './index.typings.js';
3
+ export { ActionEvent, Address, AddressHint, Asset, BaseEventMetadata, BookAfterStartPolicy, BookingPoliciesQueryResult, BusinessSchedule, CancellationFeePolicy, CancellationPolicy, CancellationWindow, CancellationWindowFeeOneOf, Categories, ChangeContext, ChangeContextPayloadOneOf, ConsentPolicy, CountBookingPoliciesRequest, CreateBookingPolicyRequest, CreateBookingPolicyResponse, CreateMissingDefaultPolicyRequest, CreateMissingDefaultPolicyResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DayOfWeek, DefaultBookingPolicySet, DeleteBookingPolicyRequest, DeleteBookingPolicyResponse, DeleteContext, DeleteStatus, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, ExtendedFields, GeoCoordinates, GetBookingPolicyRequest, GetBookingPolicyResponse, GetStrictestBookingPolicyRequest, IdentificationData, IdentificationDataIdOneOf, LimitEarlyBookingPolicy, LimitLateBookingPolicy, Locale, MessageEnvelope, MetaSiteSpecialEvent, MetaSiteSpecialEventPayloadOneOf, Money, Multilingual, Namespace, NamespaceChanged, OdeditorAssigned, OdeditorUnassigned, ParticipantsPolicy, PicassoAssigned, PicassoUnassigned, PlacementType, PolicyDescription, Properties, PropertiesChange, QueryBookingPoliciesRequest, QueryBookingPoliciesResponse, ReschedulePolicy, ResolutionMethod, ResourcesPolicy, RestoreInfo, SaveCreditCardPolicy, ServiceProvisioned, ServiceRemoved, SetDefaultBookingPolicyRequest, SiteCloned, SiteCreated, SiteCreatedContext, SiteDeleted, SiteHardDeleted, SiteMarkedAsTemplate, SiteMarkedAsWixSite, SitePropertiesEvent, SitePropertiesNotification, SitePublished, SitePurgedExternally, SiteRenamed, SiteTransferred, SiteUndeleted, SiteUnpublished, SiteUrlChanged, SortOrder, Sorting, SpecialHourPeriod, State, StudioAssigned, StudioUnassigned, SupportedLanguage, TimePeriod, Translation, UpdateAllPoliciesRequest, UpdateAllPoliciesResponse, UpdateBookingPolicyRequest, UpdateBookingPolicyResponse, V4SiteCreated, WaitlistPolicy, WebhookIdentityType } from './index.typings.js';
4
4
 
5
+ 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`;
5
6
  declare function createBookingPolicy$1(httpClient: HttpClient): CreateBookingPolicySignature;
6
7
  interface CreateBookingPolicySignature {
7
8
  /**
@@ -9,7 +10,9 @@ interface CreateBookingPolicySignature {
9
10
  * @param - Booking policy to create.
10
11
  * @returns Created booking policy.
11
12
  */
12
- (bookingPolicy: BookingPolicy): Promise<BookingPolicy>;
13
+ (bookingPolicy: BookingPolicy): Promise<NonNullablePaths<BookingPolicy, BookingPolicyNonNullablePaths> & {
14
+ __validationErrorsType?: CreateBookingPolicyValidationErrors;
15
+ }>;
13
16
  }
14
17
  declare function getBookingPolicy$1(httpClient: HttpClient): GetBookingPolicySignature;
15
18
  interface GetBookingPolicySignature {
@@ -18,7 +21,7 @@ interface GetBookingPolicySignature {
18
21
  * @param - ID of the booking policy to retrieve.
19
22
  * @returns Retrieved booking policy.
20
23
  */
21
- (bookingPolicyId: string): Promise<BookingPolicy>;
24
+ (bookingPolicyId: string): Promise<NonNullablePaths<BookingPolicy, BookingPolicyNonNullablePaths>>;
22
25
  }
23
26
  declare function getStrictestBookingPolicy$1(httpClient: HttpClient): GetStrictestBookingPolicySignature;
24
27
  interface GetStrictestBookingPolicySignature {
@@ -34,7 +37,9 @@ interface GetStrictestBookingPolicySignature {
34
37
  * ([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)).
35
38
  * @param - IDs of the booking policies for which to retrieve the strictest rules for.
36
39
  */
37
- (bookingPolicyIds: string[]): Promise<GetStrictestBookingPolicyResponse>;
40
+ (bookingPolicyIds: string[]): Promise<NonNullablePaths<GetStrictestBookingPolicyResponse, {
41
+ [P in BookingPolicyNonNullablePaths]: `bookingPolicy.${P}`;
42
+ }[BookingPolicyNonNullablePaths]>>;
38
43
  }
39
44
  declare function updateBookingPolicy$1(httpClient: HttpClient): UpdateBookingPolicySignature;
40
45
  interface UpdateBookingPolicySignature {
@@ -48,7 +53,9 @@ interface UpdateBookingPolicySignature {
48
53
  * @param - ID of the booking policy.
49
54
  * @returns Updated booking policy.
50
55
  */
51
- (_id: string, bookingPolicy: UpdateBookingPolicy): Promise<BookingPolicy>;
56
+ (_id: string, bookingPolicy: NonNullablePaths<UpdateBookingPolicy, `revision`>): Promise<NonNullablePaths<BookingPolicy, BookingPolicyNonNullablePaths> & {
57
+ __validationErrorsType?: UpdateBookingPolicyValidationErrors;
58
+ }>;
52
59
  }
53
60
  declare function setDefaultBookingPolicy$1(httpClient: HttpClient): SetDefaultBookingPolicySignature;
54
61
  interface SetDefaultBookingPolicySignature {
@@ -61,7 +68,11 @@ interface SetDefaultBookingPolicySignature {
61
68
  * default, the call succeeds without changing any `bookingPolicy` object.
62
69
  * @param - ID of the booking policy that's set as default.
63
70
  */
64
- (bookingPolicyId: string): Promise<SetDefaultBookingPolicyResponse>;
71
+ (bookingPolicyId: string): Promise<NonNullablePaths<SetDefaultBookingPolicyResponse, {
72
+ [P in BookingPolicyNonNullablePaths]: `currentDefaultBookingPolicy.${P}`;
73
+ }[BookingPolicyNonNullablePaths] | {
74
+ [P in BookingPolicyNonNullablePaths]: `previousDefaultBookingPolicy.${P}`;
75
+ }[BookingPolicyNonNullablePaths]>>;
65
76
  }
66
77
  declare function deleteBookingPolicy$1(httpClient: HttpClient): DeleteBookingPolicySignature;
67
78
  interface DeleteBookingPolicySignature {
@@ -73,7 +84,9 @@ interface DeleteBookingPolicySignature {
73
84
  * ([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)).
74
85
  * @param - ID of the booking policy to delete.
75
86
  */
76
- (bookingPolicyId: string): Promise<void>;
87
+ (bookingPolicyId: string): Promise<void & {
88
+ __applicationErrorsType?: DeleteBookingPolicyApplicationErrors;
89
+ }>;
77
90
  }
78
91
  declare function queryBookingPolicies$1(httpClient: HttpClient): QueryBookingPoliciesSignature;
79
92
  interface QueryBookingPoliciesSignature {
@@ -107,7 +120,7 @@ interface CountBookingPoliciesSignature {
107
120
  * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policies/supported-filters))
108
121
  * for a complete list of supported filters.
109
122
  */
110
- (options?: CountBookingPoliciesOptions | undefined): Promise<CountBookingPoliciesResponse>;
123
+ (options?: CountBookingPoliciesOptions): Promise<NonNullablePaths<CountBookingPoliciesResponse, `count`>>;
111
124
  }
112
125
  declare const onBookingPolicyCreated$1: EventDefinition<BookingPolicyCreatedEnvelope, "wix.bookings.v1.booking_policy_created">;
113
126
  declare const onBookingPolicyDefaultBookingPolicySet$1: EventDefinition<BookingPolicyDefaultBookingPolicySetEnvelope, "wix.bookings.v1.booking_policy_default_booking_policy_set">;
@@ -543,6 +543,7 @@ async function deleteBookingPolicy2(bookingPolicyId) {
543
543
  try {
544
544
  const result = await httpClient.request(reqOpts);
545
545
  sideEffects?.onSuccess?.(result);
546
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
546
547
  } catch (err) {
547
548
  const transformedError = (0, import_transform_error.transformError)(
548
549
  err,