@wix/auto_sdk_bookings_booking-policies 1.0.82 → 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 +7 -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 +7 -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 +7 -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 +7 -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
package/build/cjs/index.d.ts
CHANGED
|
@@ -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.js';
|
|
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.js';
|
|
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 };
|
package/build/cjs/index.js
CHANGED
|
@@ -662,6 +662,29 @@ function queryBookingPolicies2() {
|
|
|
662
662
|
transformationPaths: {}
|
|
663
663
|
});
|
|
664
664
|
}
|
|
665
|
+
async function typedQueryBookingPolicies(query) {
|
|
666
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
667
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
|
|
668
|
+
const reqOpts = queryBookingPolicies(payload);
|
|
669
|
+
sideEffects?.onSiteCall?.();
|
|
670
|
+
try {
|
|
671
|
+
const result = await httpClient.request(reqOpts);
|
|
672
|
+
sideEffects?.onSuccess?.(result);
|
|
673
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
674
|
+
} catch (err) {
|
|
675
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
676
|
+
err,
|
|
677
|
+
{
|
|
678
|
+
spreadPathsToArguments: {},
|
|
679
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
680
|
+
singleArgumentUnchanged: false
|
|
681
|
+
},
|
|
682
|
+
["query"]
|
|
683
|
+
);
|
|
684
|
+
sideEffects?.onError?.(err);
|
|
685
|
+
throw transformedError;
|
|
686
|
+
}
|
|
687
|
+
}
|
|
665
688
|
async function countBookingPolicies2(options) {
|
|
666
689
|
const { httpClient, sideEffects } = arguments[1];
|
|
667
690
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
@@ -738,6 +761,13 @@ function queryBookingPolicies3(httpClient) {
|
|
|
738
761
|
{ httpClient }
|
|
739
762
|
);
|
|
740
763
|
}
|
|
764
|
+
function typedQueryBookingPolicies2(httpClient) {
|
|
765
|
+
return (query) => typedQueryBookingPolicies(
|
|
766
|
+
query,
|
|
767
|
+
// @ts-ignore
|
|
768
|
+
{ httpClient }
|
|
769
|
+
);
|
|
770
|
+
}
|
|
741
771
|
function countBookingPolicies3(httpClient) {
|
|
742
772
|
return (options) => countBookingPolicies2(
|
|
743
773
|
options,
|
|
@@ -815,14 +845,26 @@ var onBookingPolicyUpdated = (0, import_sdk_types.EventDefinition)(
|
|
|
815
845
|
// src/bookings-v1-booking-policy-booking-policies.context.ts
|
|
816
846
|
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
817
847
|
var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
|
|
848
|
+
var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
|
|
849
|
+
function customQueryBookingPolicies(httpClient) {
|
|
850
|
+
const router = (0, import_query_method_router.createQueryOverloadRouter)({
|
|
851
|
+
builderQueryFunction: () => queryBookingPolicies3(httpClient)(),
|
|
852
|
+
typedQueryFunction: (query) => typedQueryBookingPolicies2(httpClient)(query),
|
|
853
|
+
hasOptionsParameter: false
|
|
854
|
+
});
|
|
855
|
+
function overloadedQuery(query) {
|
|
856
|
+
return router(...arguments);
|
|
857
|
+
}
|
|
858
|
+
return overloadedQuery;
|
|
859
|
+
}
|
|
818
860
|
var createBookingPolicy4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createBookingPolicy3);
|
|
819
861
|
var getBookingPolicy4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getBookingPolicy3);
|
|
820
862
|
var getStrictestBookingPolicy4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getStrictestBookingPolicy3);
|
|
821
863
|
var updateBookingPolicy4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateBookingPolicy3);
|
|
822
864
|
var setDefaultBookingPolicy4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(setDefaultBookingPolicy3);
|
|
823
865
|
var deleteBookingPolicy4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteBookingPolicy3);
|
|
824
|
-
var queryBookingPolicies4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(queryBookingPolicies3);
|
|
825
866
|
var countBookingPolicies4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(countBookingPolicies3);
|
|
867
|
+
var queryBookingPolicies4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryBookingPolicies);
|
|
826
868
|
var onBookingPolicyCreated2 = (0, import_event_definition_modules.createEventModule)(
|
|
827
869
|
onBookingPolicyCreated
|
|
828
870
|
);
|