@wix/auto_sdk_bookings_service-options-and-variants 1.0.54 → 1.0.56

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.
@@ -1,6 +1,6 @@
1
1
  import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
- import { ServiceOptionsAndVariants, CreateServiceOptionsAndVariantsApplicationErrors, CloneServiceOptionsAndVariantsResponse, GetServiceOptionsAndVariantsByServiceIdResponse, UpdateServiceOptionsAndVariants, UpdateServiceOptionsAndVariantsApplicationErrors, DeleteServiceOptionsAndVariantsOptions, ServiceOptionsAndVariantsListQueryBuilder, ServiceOptionsAndVariantsCreatedEnvelope, ServiceOptionsAndVariantsDeletedEnvelope, ServiceOptionsAndVariantsUpdatedEnvelope } from './index.typings.js';
3
- export { ActionEvent, Address, AddressHint, BaseEventMetadata, BusinessSchedule, Categories, ChangeContext, ChangeContextPayloadOneOf, CloneServiceOptionsAndVariantsRequest, ConsentPolicy, CreateServiceOptionsAndVariantsRequest, CreateServiceOptionsAndVariantsResponse, CursorPaging, Cursors, CustomServiceOption, DayOfWeek, DayOfWeekWithLiterals, DeleteServiceOptionsAndVariantsRequest, DeleteServiceOptionsAndVariantsResponse, DomainEvent, DomainEventBodyOneOf, Duration, DurationServiceOption, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, ExtendedFields, GeoCoordinates, GetServiceOptionsAndVariantsByServiceIdRequest, GetServiceOptionsAndVariantsRequest, GetServiceOptionsAndVariantsResponse, IdentificationData, IdentificationDataIdOneOf, Locale, MessageEnvelope, Money, Multilingual, Paging, PagingMetadataV2, PlacementType, PlacementTypeWithLiterals, Properties, PropertiesChange, QueryServiceOptionsAndVariantsRequest, QueryServiceOptionsAndVariantsResponse, QueryV2, QueryV2PagingMethodOneOf, ResolutionMethod, ResolutionMethodWithLiterals, RestoreInfo, ServiceChoice, ServiceChoiceChoiceOneOf, ServiceOption, ServiceOptionOptionSpecificDataOneOf, ServiceOptionType, ServiceOptionTypeWithLiterals, ServiceOptions, ServiceOptionsAndVariantsListQueryResult, ServiceVariant, ServiceVariants, SiteCloned, SiteCreated, SitePropertiesEvent, SitePropertiesNotification, SortOrder, SortOrderWithLiterals, Sorting, SpecialHourPeriod, SupportedLanguage, TimePeriod, Translation, UpdateServiceOptionsAndVariantsRequest, UpdateServiceOptionsAndVariantsResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
2
+ import { ServiceOptionsAndVariants, CreateServiceOptionsAndVariantsApplicationErrors, CloneServiceOptionsAndVariantsResponse, GetServiceOptionsAndVariantsByServiceIdResponse, UpdateServiceOptionsAndVariants, UpdateServiceOptionsAndVariantsApplicationErrors, DeleteServiceOptionsAndVariantsOptions, ServiceOptionsAndVariantsCreatedEnvelope, ServiceOptionsAndVariantsDeletedEnvelope, ServiceOptionsAndVariantsUpdatedEnvelope, ServiceOptionsAndVariantsListQueryBuilder, QueryV2, typedQueryServiceOptionsAndVariants } from './index.typings.js';
3
+ export { ActionEvent, Address, AddressHint, BaseEventMetadata, BusinessSchedule, Categories, ChangeContext, ChangeContextPayloadOneOf, CloneServiceOptionsAndVariantsRequest, ConsentPolicy, CreateServiceOptionsAndVariantsRequest, CreateServiceOptionsAndVariantsResponse, CursorPaging, Cursors, CustomServiceOption, DayOfWeek, DayOfWeekWithLiterals, DeleteServiceOptionsAndVariantsRequest, DeleteServiceOptionsAndVariantsResponse, DomainEvent, DomainEventBodyOneOf, Duration, DurationServiceOption, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, ExtendedFields, GeoCoordinates, GetServiceOptionsAndVariantsByServiceIdRequest, GetServiceOptionsAndVariantsRequest, GetServiceOptionsAndVariantsResponse, IdentificationData, IdentificationDataIdOneOf, Locale, MessageEnvelope, Money, Multilingual, Paging, PagingMetadataV2, PlacementType, PlacementTypeWithLiterals, Properties, PropertiesChange, QueryServiceOptionsAndVariantsRequest, QueryServiceOptionsAndVariantsResponse, QueryV2PagingMethodOneOf, ResolutionMethod, ResolutionMethodWithLiterals, RestoreInfo, ServiceChoice, ServiceChoiceChoiceOneOf, ServiceOption, ServiceOptionOptionSpecificDataOneOf, ServiceOptionType, ServiceOptionTypeWithLiterals, ServiceOptions, ServiceOptionsAndVariantsListQueryResult, ServiceVariant, ServiceVariants, SiteCloned, SiteCreated, SitePropertiesEvent, SitePropertiesNotification, SortOrder, SortOrderWithLiterals, Sorting, SpecialHourPeriod, SupportedLanguage, TimePeriod, Translation, UpdateServiceOptionsAndVariantsRequest, UpdateServiceOptionsAndVariantsResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
4
4
 
5
5
  declare function createServiceOptionsAndVariants$1(httpClient: HttpClient): CreateServiceOptionsAndVariantsSignature;
6
6
  interface CreateServiceOptionsAndVariantsSignature {
@@ -125,7 +125,7 @@ interface DeleteServiceOptionsAndVariantsSignature {
125
125
  *
126
126
  *
127
127
  * Because each service can be connected to only a single `serviceOptionsAndVariants`
128
- * object, the service doesn't support [varied pricing](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/service-rates#service-rates)
128
+ * object, the service doesn't support [varied pricing](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-service-payments)
129
129
  * after deleting a `serviceOptionsAndVariants` object. Instead, Wix Bookings
130
130
  * uses its standard price calculation.
131
131
  * @param - ID of the `serviceOptionsAndVariants` object to delete.
@@ -133,39 +133,21 @@ interface DeleteServiceOptionsAndVariantsSignature {
133
133
  */
134
134
  (serviceOptionsAndVariantsId: string, options?: DeleteServiceOptionsAndVariantsOptions): Promise<void>;
135
135
  }
136
- declare function queryServiceOptionsAndVariants$1(httpClient: HttpClient): QueryServiceOptionsAndVariantsSignature;
137
- interface QueryServiceOptionsAndVariantsSignature {
138
- /**
139
- * Creates a query to retrieve a list of `serviceOptionsAndVariants` objects.
140
- *
141
- * The `queryServiceOptionsAndVariants()` function builds a query to retrieve a list of `serviceOptionsAndVariants` objects and returns a `ServiceOptionsAndVariantsQueryBuilder` object.
142
- *
143
- * 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/service-options-and-variants/service-options-and-variants-list-query-builder/find) function.
144
- *
145
- * You can refine the query by chaining `ServiceOptionsAndVariantsQueryBuilder` functions onto the query. `ServiceOptionsAndVariantsQueryBuilder` functions enable you to sort, filter, and control the results that `queryServiceOptionsAndVariants()` returns.
146
- *
147
- * `queryServiceOptionsAndVariants()` runs with the following `ServiceOptionsAndVariantsQueryBuilder` default that you can override:
148
- *
149
- * + `limit` is `50`.
150
- * + Sorted by `id` in ascending order.
151
- *
152
- * The functions that are chained to `queryServiceOptionsAndVariants()` are applied in the order they are called. For example, if you apply `ascending("options.values.type")` and then `ascending("variants.values.price")`, the results are sorted first by the `"type"`, and then, if there are multiple results with the same `"type"`, the items are sorted by `"price"`.
153
- *
154
- * The following `ServiceOptionsAndVariantsQueryBuilder` functions are supported for the `queryServiceOptionsAndVariants()` function. For a full description of the `serviceOptionsAndVariants` object, see the object returned for the [items](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/service-options-and-variants-list-query-result/items) property in `ServiceOptionsAndVariantsQueryResult`.
155
- */
156
- (): ServiceOptionsAndVariantsListQueryBuilder;
157
- }
158
136
  declare const onServiceOptionsAndVariantsCreated$1: EventDefinition<ServiceOptionsAndVariantsCreatedEnvelope, "wix.bookings.catalog.v1.service_options_and_variants_created">;
159
137
  declare const onServiceOptionsAndVariantsDeleted$1: EventDefinition<ServiceOptionsAndVariantsDeletedEnvelope, "wix.bookings.catalog.v1.service_options_and_variants_deleted">;
160
138
  declare const onServiceOptionsAndVariantsUpdated$1: EventDefinition<ServiceOptionsAndVariantsUpdatedEnvelope, "wix.bookings.catalog.v1.service_options_and_variants_updated">;
161
139
 
140
+ declare function customQueryServiceOptionsAndVariants(httpClient: HttpClient): {
141
+ (): ServiceOptionsAndVariantsListQueryBuilder;
142
+ (query: QueryV2): ReturnType<typeof typedQueryServiceOptionsAndVariants>;
143
+ };
162
144
  declare const createServiceOptionsAndVariants: MaybeContext<BuildRESTFunction<typeof createServiceOptionsAndVariants$1> & typeof createServiceOptionsAndVariants$1>;
163
145
  declare const cloneServiceOptionsAndVariants: MaybeContext<BuildRESTFunction<typeof cloneServiceOptionsAndVariants$1> & typeof cloneServiceOptionsAndVariants$1>;
164
146
  declare const getServiceOptionsAndVariants: MaybeContext<BuildRESTFunction<typeof getServiceOptionsAndVariants$1> & typeof getServiceOptionsAndVariants$1>;
165
147
  declare const getServiceOptionsAndVariantsByServiceId: MaybeContext<BuildRESTFunction<typeof getServiceOptionsAndVariantsByServiceId$1> & typeof getServiceOptionsAndVariantsByServiceId$1>;
166
148
  declare const updateServiceOptionsAndVariants: MaybeContext<BuildRESTFunction<typeof updateServiceOptionsAndVariants$1> & typeof updateServiceOptionsAndVariants$1>;
167
149
  declare const deleteServiceOptionsAndVariants: MaybeContext<BuildRESTFunction<typeof deleteServiceOptionsAndVariants$1> & typeof deleteServiceOptionsAndVariants$1>;
168
- declare const queryServiceOptionsAndVariants: MaybeContext<BuildRESTFunction<typeof queryServiceOptionsAndVariants$1> & typeof queryServiceOptionsAndVariants$1>;
150
+ declare const queryServiceOptionsAndVariants: MaybeContext<BuildRESTFunction<typeof customQueryServiceOptionsAndVariants> & typeof customQueryServiceOptionsAndVariants>;
169
151
  /** */
170
152
  declare const onServiceOptionsAndVariantsCreated: BuildEventDefinition<typeof onServiceOptionsAndVariantsCreated$1> & typeof onServiceOptionsAndVariantsCreated$1;
171
153
  /** */
@@ -173,4 +155,4 @@ declare const onServiceOptionsAndVariantsDeleted: BuildEventDefinition<typeof on
173
155
  /** */
174
156
  declare const onServiceOptionsAndVariantsUpdated: BuildEventDefinition<typeof onServiceOptionsAndVariantsUpdated$1> & typeof onServiceOptionsAndVariantsUpdated$1;
175
157
 
176
- export { CloneServiceOptionsAndVariantsResponse, CreateServiceOptionsAndVariantsApplicationErrors, DeleteServiceOptionsAndVariantsOptions, GetServiceOptionsAndVariantsByServiceIdResponse, ServiceOptionsAndVariants, ServiceOptionsAndVariantsCreatedEnvelope, ServiceOptionsAndVariantsDeletedEnvelope, ServiceOptionsAndVariantsListQueryBuilder, ServiceOptionsAndVariantsUpdatedEnvelope, UpdateServiceOptionsAndVariants, UpdateServiceOptionsAndVariantsApplicationErrors, cloneServiceOptionsAndVariants, createServiceOptionsAndVariants, deleteServiceOptionsAndVariants, getServiceOptionsAndVariants, getServiceOptionsAndVariantsByServiceId, onServiceOptionsAndVariantsCreated, onServiceOptionsAndVariantsDeleted, onServiceOptionsAndVariantsUpdated, queryServiceOptionsAndVariants, updateServiceOptionsAndVariants };
158
+ export { CloneServiceOptionsAndVariantsResponse, CreateServiceOptionsAndVariantsApplicationErrors, DeleteServiceOptionsAndVariantsOptions, GetServiceOptionsAndVariantsByServiceIdResponse, QueryV2, ServiceOptionsAndVariants, ServiceOptionsAndVariantsCreatedEnvelope, ServiceOptionsAndVariantsDeletedEnvelope, ServiceOptionsAndVariantsListQueryBuilder, ServiceOptionsAndVariantsUpdatedEnvelope, UpdateServiceOptionsAndVariants, UpdateServiceOptionsAndVariantsApplicationErrors, cloneServiceOptionsAndVariants, createServiceOptionsAndVariants, deleteServiceOptionsAndVariants, getServiceOptionsAndVariants, getServiceOptionsAndVariantsByServiceId, onServiceOptionsAndVariantsCreated, onServiceOptionsAndVariantsDeleted, onServiceOptionsAndVariantsUpdated, queryServiceOptionsAndVariants, updateServiceOptionsAndVariants };
@@ -581,6 +581,31 @@ function queryServiceOptionsAndVariants2() {
581
581
  transformationPaths: {}
582
582
  });
583
583
  }
584
+ async function typedQueryServiceOptionsAndVariants(query) {
585
+ const { httpClient, sideEffects } = arguments[1];
586
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
587
+ const reqOpts = queryServiceOptionsAndVariants(
588
+ payload
589
+ );
590
+ sideEffects?.onSiteCall?.();
591
+ try {
592
+ const result = await httpClient.request(reqOpts);
593
+ sideEffects?.onSuccess?.(result);
594
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
595
+ } catch (err) {
596
+ const transformedError = (0, import_transform_error.transformError)(
597
+ err,
598
+ {
599
+ spreadPathsToArguments: {},
600
+ explicitPathsToArguments: { query: "$[0]" },
601
+ singleArgumentUnchanged: false
602
+ },
603
+ ["query"]
604
+ );
605
+ sideEffects?.onError?.(err);
606
+ throw transformedError;
607
+ }
608
+ }
584
609
 
585
610
  // src/bookings-catalog-v1-service-options-and-variants-service-options-and-variants.public.ts
586
611
  function createServiceOptionsAndVariants3(httpClient) {
@@ -634,6 +659,13 @@ function queryServiceOptionsAndVariants3(httpClient) {
634
659
  { httpClient }
635
660
  );
636
661
  }
662
+ function typedQueryServiceOptionsAndVariants2(httpClient) {
663
+ return (query) => typedQueryServiceOptionsAndVariants(
664
+ query,
665
+ // @ts-ignore
666
+ { httpClient }
667
+ );
668
+ }
637
669
  var onServiceOptionsAndVariantsCreated = (0, import_sdk_types.EventDefinition)(
638
670
  "wix.bookings.catalog.v1.service_options_and_variants_created",
639
671
  true,
@@ -674,6 +706,18 @@ var onServiceOptionsAndVariantsUpdated = (0, import_sdk_types.EventDefinition)(
674
706
  // src/bookings-catalog-v1-service-options-and-variants-service-options-and-variants.context.ts
675
707
  var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
676
708
  var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
709
+ var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
710
+ function customQueryServiceOptionsAndVariants(httpClient) {
711
+ const router = (0, import_query_method_router.createQueryOverloadRouter)({
712
+ builderQueryFunction: () => queryServiceOptionsAndVariants3(httpClient)(),
713
+ typedQueryFunction: (query) => typedQueryServiceOptionsAndVariants2(httpClient)(query),
714
+ hasOptionsParameter: false
715
+ });
716
+ function overloadedQuery(query) {
717
+ return router(...arguments);
718
+ }
719
+ return overloadedQuery;
720
+ }
677
721
  var createServiceOptionsAndVariants4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createServiceOptionsAndVariants3);
678
722
  var cloneServiceOptionsAndVariants4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(cloneServiceOptionsAndVariants3);
679
723
  var getServiceOptionsAndVariants4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getServiceOptionsAndVariants3);
@@ -682,7 +726,7 @@ var getServiceOptionsAndVariantsByServiceId4 = /* @__PURE__ */ (0, import_rest_m
682
726
  );
683
727
  var updateServiceOptionsAndVariants4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateServiceOptionsAndVariants3);
684
728
  var deleteServiceOptionsAndVariants4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteServiceOptionsAndVariants3);
685
- var queryServiceOptionsAndVariants4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(queryServiceOptionsAndVariants3);
729
+ var queryServiceOptionsAndVariants4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryServiceOptionsAndVariants);
686
730
  var onServiceOptionsAndVariantsCreated2 = (0, import_event_definition_modules.createEventModule)(
687
731
  onServiceOptionsAndVariantsCreated
688
732
  );