@wix/auto_sdk_bookings_booking-policies 1.0.81 → 1.0.83
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 +8 -26
- package/build/cjs/index.js +43 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +15 -1
- package/build/cjs/index.typings.js +25 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/es/index.d.mts +8 -26
- package/build/es/index.mjs +43 -1
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +15 -1
- package/build/es/index.typings.mjs +24 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +8 -26
- package/build/internal/cjs/index.js +43 -1
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +15 -1
- package/build/internal/cjs/index.typings.js +25 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/es/index.d.mts +8 -26
- package/build/internal/es/index.mjs +43 -1
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +15 -1
- package/build/internal/es/index.typings.mjs +24 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
|
-
import { BookingPolicy, CreateBookingPolicyValidationErrors, GetStrictestBookingPolicyResponse, UpdateBookingPolicy, UpdateBookingPolicyValidationErrors, SetDefaultBookingPolicyResponse, DeleteBookingPolicyApplicationErrors,
|
|
3
|
-
export { ActionEvent, Address, AddressHint, Asset, BaseEventMetadata, BookAfterStartPolicy, BookingPoliciesQueryResult, BusinessSchedule, CancellationFeePolicy, CancellationPolicy, CancellationWindow, CancellationWindowFeeOneOf, Categories, ChangeContext, ChangeContextPayloadOneOf, CompletionRequirement, CompletionRequirementWithLiterals, ConsentPolicy, CountBookingPoliciesRequest, CreateBookingPolicyRequest, CreateBookingPolicyResponse, CreateMissingDefaultPolicyRequest, CreateMissingDefaultPolicyResponse, CursorPaging, CursorPagingMetadata,
|
|
2
|
+
import { BookingPolicy, CreateBookingPolicyValidationErrors, GetStrictestBookingPolicyResponse, UpdateBookingPolicy, UpdateBookingPolicyValidationErrors, SetDefaultBookingPolicyResponse, DeleteBookingPolicyApplicationErrors, CountBookingPoliciesOptions, CountBookingPoliciesResponse, BookingPolicyCreatedEnvelope, BookingPolicyDefaultBookingPolicySetEnvelope, BookingPolicyDeletedEnvelope, BookingPolicyUpdatedEnvelope, BookingPoliciesQueryBuilder, CursorQuery, typedQueryBookingPolicies } from './index.typings.mjs';
|
|
3
|
+
export { ActionEvent, Address, AddressHint, Asset, BaseEventMetadata, BookAfterStartPolicy, BookingPoliciesQueryResult, BusinessSchedule, CancellationFeePolicy, CancellationPolicy, CancellationWindow, CancellationWindowFeeOneOf, Categories, ChangeContext, ChangeContextPayloadOneOf, CompletionRequirement, CompletionRequirementWithLiterals, ConsentPolicy, CountBookingPoliciesRequest, CreateBookingPolicyRequest, CreateBookingPolicyResponse, CreateMissingDefaultPolicyRequest, CreateMissingDefaultPolicyResponse, CursorPaging, CursorPagingMetadata, CursorQueryPagingMethodOneOf, Cursors, CustomOptions, DayOfWeek, DayOfWeekWithLiterals, DefaultBookingPolicySet, DeleteBookingPolicyRequest, DeleteBookingPolicyResponse, DeleteContext, DeleteStatus, DeleteStatusWithLiterals, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, ExtendedFields, GeoCoordinates, GetBookingPolicyRequest, GetBookingPolicyResponse, GetStrictestBookingPolicyRequest, IdentificationData, IdentificationDataIdOneOf, IntakeFormPolicy, LimitEarlyBookingPolicy, LimitLateBookingPolicy, Locale, MessageEnvelope, MetaSiteSpecialEvent, MetaSiteSpecialEventPayloadOneOf, Money, Multilingual, Namespace, NamespaceChanged, NamespaceWithLiterals, OdeditorAssigned, OdeditorUnassigned, ParticipantsPolicy, PicassoAssigned, PicassoUnassigned, PlacementType, PlacementTypeWithLiterals, PolicyDescription, Properties, PropertiesChange, QueryBookingPoliciesRequest, QueryBookingPoliciesResponse, RankingOptions, RankingOrder, RankingOrderWithLiterals, ReschedulePolicy, ResolutionMethod, ResolutionMethodWithLiterals, ResourcesPolicy, RestoreInfo, SaveCreditCardPolicy, ServiceProvisioned, ServiceRemoved, SetDefaultBookingPolicyRequest, SiteCloned, SiteCreated, SiteCreatedContext, SiteCreatedContextWithLiterals, SiteDeleted, SiteHardDeleted, SiteMarkedAsTemplate, SiteMarkedAsWixSite, SitePropertiesEvent, SitePropertiesNotification, SitePublished, SitePurgedExternally, SiteRenamed, SiteTransferred, SiteUndeleted, SiteUnpublished, SiteUrlChanged, SortOrder, SortOrderWithLiterals, Sorting, SortingMethodType, SortingMethodTypeWithLiterals, SpecialHourPeriod, StaffSortingPolicy, StaffSortingPolicyOptionsOneOf, State, StateWithLiterals, StudioAssigned, StudioTwoAssigned, StudioTwoUnassigned, StudioUnassigned, SupportedLanguage, TimePeriod, Timing, TimingWithLiterals, Translation, UpdateAllPoliciesRequest, UpdateAllPoliciesResponse, UpdateBookingPolicyRequest, UpdateBookingPolicyResponse, V4SiteCreated, WaitlistPolicy, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WixelAssigned, WixelUnassigned } from './index.typings.mjs';
|
|
4
4
|
|
|
5
5
|
declare function createBookingPolicy$1(httpClient: HttpClient): CreateBookingPolicySignature;
|
|
6
6
|
interface CreateBookingPolicySignature {
|
|
@@ -79,28 +79,6 @@ interface DeleteBookingPolicySignature {
|
|
|
79
79
|
__applicationErrorsType?: DeleteBookingPolicyApplicationErrors;
|
|
80
80
|
}>;
|
|
81
81
|
}
|
|
82
|
-
declare function queryBookingPolicies$1(httpClient: HttpClient): QueryBookingPoliciesSignature;
|
|
83
|
-
interface QueryBookingPoliciesSignature {
|
|
84
|
-
/**
|
|
85
|
-
* Creates a query to retrieve a list of `bookingPolicy` objects.
|
|
86
|
-
*
|
|
87
|
-
* The `queryBookingPolicies()` function builds a query to retrieve a list of `bookingPolicy` objects and returns a `BookingPoliciesQueryBuilder` object.
|
|
88
|
-
*
|
|
89
|
-
* 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.
|
|
90
|
-
*
|
|
91
|
-
* 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.
|
|
92
|
-
*
|
|
93
|
-
* `queryBookingPolicies()` runs with the following `BookingPoliciesQueryBuilder` defaults that you can override:
|
|
94
|
-
*
|
|
95
|
-
* + `limit` is `50`.
|
|
96
|
-
* + Sorted by `createdDate` in ascending order.
|
|
97
|
-
*
|
|
98
|
-
* 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`.
|
|
99
|
-
*
|
|
100
|
-
* 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`.
|
|
101
|
-
*/
|
|
102
|
-
(): BookingPoliciesQueryBuilder;
|
|
103
|
-
}
|
|
104
82
|
declare function countBookingPolicies$1(httpClient: HttpClient): CountBookingPoliciesSignature;
|
|
105
83
|
interface CountBookingPoliciesSignature {
|
|
106
84
|
/**
|
|
@@ -117,14 +95,18 @@ declare const onBookingPolicyDefaultBookingPolicySet$1: EventDefinition<BookingP
|
|
|
117
95
|
declare const onBookingPolicyDeleted$1: EventDefinition<BookingPolicyDeletedEnvelope, "wix.bookings.v1.booking_policy_deleted">;
|
|
118
96
|
declare const onBookingPolicyUpdated$1: EventDefinition<BookingPolicyUpdatedEnvelope, "wix.bookings.v1.booking_policy_updated">;
|
|
119
97
|
|
|
98
|
+
declare function customQueryBookingPolicies(httpClient: HttpClient): {
|
|
99
|
+
(): BookingPoliciesQueryBuilder;
|
|
100
|
+
(query: CursorQuery): ReturnType<typeof typedQueryBookingPolicies>;
|
|
101
|
+
};
|
|
120
102
|
declare const createBookingPolicy: MaybeContext<BuildRESTFunction<typeof createBookingPolicy$1> & typeof createBookingPolicy$1>;
|
|
121
103
|
declare const getBookingPolicy: MaybeContext<BuildRESTFunction<typeof getBookingPolicy$1> & typeof getBookingPolicy$1>;
|
|
122
104
|
declare const getStrictestBookingPolicy: MaybeContext<BuildRESTFunction<typeof getStrictestBookingPolicy$1> & typeof getStrictestBookingPolicy$1>;
|
|
123
105
|
declare const updateBookingPolicy: MaybeContext<BuildRESTFunction<typeof updateBookingPolicy$1> & typeof updateBookingPolicy$1>;
|
|
124
106
|
declare const setDefaultBookingPolicy: MaybeContext<BuildRESTFunction<typeof setDefaultBookingPolicy$1> & typeof setDefaultBookingPolicy$1>;
|
|
125
107
|
declare const deleteBookingPolicy: MaybeContext<BuildRESTFunction<typeof deleteBookingPolicy$1> & typeof deleteBookingPolicy$1>;
|
|
126
|
-
declare const queryBookingPolicies: MaybeContext<BuildRESTFunction<typeof queryBookingPolicies$1> & typeof queryBookingPolicies$1>;
|
|
127
108
|
declare const countBookingPolicies: MaybeContext<BuildRESTFunction<typeof countBookingPolicies$1> & typeof countBookingPolicies$1>;
|
|
109
|
+
declare const queryBookingPolicies: MaybeContext<BuildRESTFunction<typeof customQueryBookingPolicies> & typeof customQueryBookingPolicies>;
|
|
128
110
|
/**
|
|
129
111
|
* Triggered when a booking policy is created.
|
|
130
112
|
*/
|
|
@@ -145,4 +127,4 @@ declare const onBookingPolicyDeleted: BuildEventDefinition<typeof onBookingPolic
|
|
|
145
127
|
*/
|
|
146
128
|
declare const onBookingPolicyUpdated: BuildEventDefinition<typeof onBookingPolicyUpdated$1> & typeof onBookingPolicyUpdated$1;
|
|
147
129
|
|
|
148
|
-
export { BookingPoliciesQueryBuilder, BookingPolicy, BookingPolicyCreatedEnvelope, BookingPolicyDefaultBookingPolicySetEnvelope, BookingPolicyDeletedEnvelope, BookingPolicyUpdatedEnvelope, CountBookingPoliciesOptions, CountBookingPoliciesResponse, CreateBookingPolicyValidationErrors, DeleteBookingPolicyApplicationErrors, GetStrictestBookingPolicyResponse, SetDefaultBookingPolicyResponse, UpdateBookingPolicy, UpdateBookingPolicyValidationErrors, countBookingPolicies, createBookingPolicy, deleteBookingPolicy, getBookingPolicy, getStrictestBookingPolicy, onBookingPolicyCreated, onBookingPolicyDefaultBookingPolicySet, onBookingPolicyDeleted, onBookingPolicyUpdated, queryBookingPolicies, setDefaultBookingPolicy, updateBookingPolicy };
|
|
130
|
+
export { BookingPoliciesQueryBuilder, BookingPolicy, BookingPolicyCreatedEnvelope, BookingPolicyDefaultBookingPolicySetEnvelope, BookingPolicyDeletedEnvelope, BookingPolicyUpdatedEnvelope, CountBookingPoliciesOptions, CountBookingPoliciesResponse, CreateBookingPolicyValidationErrors, CursorQuery, DeleteBookingPolicyApplicationErrors, GetStrictestBookingPolicyResponse, SetDefaultBookingPolicyResponse, UpdateBookingPolicy, UpdateBookingPolicyValidationErrors, countBookingPolicies, createBookingPolicy, deleteBookingPolicy, getBookingPolicy, getStrictestBookingPolicy, onBookingPolicyCreated, onBookingPolicyDefaultBookingPolicySet, onBookingPolicyDeleted, onBookingPolicyUpdated, queryBookingPolicies, setDefaultBookingPolicy, updateBookingPolicy };
|
|
@@ -615,6 +615,29 @@ function queryBookingPolicies2() {
|
|
|
615
615
|
transformationPaths: {}
|
|
616
616
|
});
|
|
617
617
|
}
|
|
618
|
+
async function typedQueryBookingPolicies(query) {
|
|
619
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
620
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ query });
|
|
621
|
+
const reqOpts = queryBookingPolicies(payload);
|
|
622
|
+
sideEffects?.onSiteCall?.();
|
|
623
|
+
try {
|
|
624
|
+
const result = await httpClient.request(reqOpts);
|
|
625
|
+
sideEffects?.onSuccess?.(result);
|
|
626
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
627
|
+
} catch (err) {
|
|
628
|
+
const transformedError = sdkTransformError(
|
|
629
|
+
err,
|
|
630
|
+
{
|
|
631
|
+
spreadPathsToArguments: {},
|
|
632
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
633
|
+
singleArgumentUnchanged: false
|
|
634
|
+
},
|
|
635
|
+
["query"]
|
|
636
|
+
);
|
|
637
|
+
sideEffects?.onError?.(err);
|
|
638
|
+
throw transformedError;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
618
641
|
async function countBookingPolicies2(options) {
|
|
619
642
|
const { httpClient, sideEffects } = arguments[1];
|
|
620
643
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
@@ -691,6 +714,13 @@ function queryBookingPolicies3(httpClient) {
|
|
|
691
714
|
{ httpClient }
|
|
692
715
|
);
|
|
693
716
|
}
|
|
717
|
+
function typedQueryBookingPolicies2(httpClient) {
|
|
718
|
+
return (query) => typedQueryBookingPolicies(
|
|
719
|
+
query,
|
|
720
|
+
// @ts-ignore
|
|
721
|
+
{ httpClient }
|
|
722
|
+
);
|
|
723
|
+
}
|
|
694
724
|
function countBookingPolicies3(httpClient) {
|
|
695
725
|
return (options) => countBookingPolicies2(
|
|
696
726
|
options,
|
|
@@ -768,14 +798,26 @@ var onBookingPolicyUpdated = EventDefinition(
|
|
|
768
798
|
// src/bookings-v1-booking-policy-booking-policies.context.ts
|
|
769
799
|
import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
|
|
770
800
|
import { createEventModule } from "@wix/sdk-runtime/event-definition-modules";
|
|
801
|
+
import { createQueryOverloadRouter } from "@wix/sdk-runtime/query-method-router";
|
|
802
|
+
function customQueryBookingPolicies(httpClient) {
|
|
803
|
+
const router = createQueryOverloadRouter({
|
|
804
|
+
builderQueryFunction: () => queryBookingPolicies3(httpClient)(),
|
|
805
|
+
typedQueryFunction: (query) => typedQueryBookingPolicies2(httpClient)(query),
|
|
806
|
+
hasOptionsParameter: false
|
|
807
|
+
});
|
|
808
|
+
function overloadedQuery(query) {
|
|
809
|
+
return router(...arguments);
|
|
810
|
+
}
|
|
811
|
+
return overloadedQuery;
|
|
812
|
+
}
|
|
771
813
|
var createBookingPolicy4 = /* @__PURE__ */ createRESTModule(createBookingPolicy3);
|
|
772
814
|
var getBookingPolicy4 = /* @__PURE__ */ createRESTModule(getBookingPolicy3);
|
|
773
815
|
var getStrictestBookingPolicy4 = /* @__PURE__ */ createRESTModule(getStrictestBookingPolicy3);
|
|
774
816
|
var updateBookingPolicy4 = /* @__PURE__ */ createRESTModule(updateBookingPolicy3);
|
|
775
817
|
var setDefaultBookingPolicy4 = /* @__PURE__ */ createRESTModule(setDefaultBookingPolicy3);
|
|
776
818
|
var deleteBookingPolicy4 = /* @__PURE__ */ createRESTModule(deleteBookingPolicy3);
|
|
777
|
-
var queryBookingPolicies4 = /* @__PURE__ */ createRESTModule(queryBookingPolicies3);
|
|
778
819
|
var countBookingPolicies4 = /* @__PURE__ */ createRESTModule(countBookingPolicies3);
|
|
820
|
+
var queryBookingPolicies4 = /* @__PURE__ */ createRESTModule(customQueryBookingPolicies);
|
|
779
821
|
var onBookingPolicyCreated2 = createEventModule(
|
|
780
822
|
onBookingPolicyCreated
|
|
781
823
|
);
|