@wix/auto_sdk_bookings_service-options-and-variants 1.0.55 → 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.
@@ -543,6 +543,31 @@ function queryServiceOptionsAndVariants2() {
543
543
  transformationPaths: {}
544
544
  });
545
545
  }
546
+ async function typedQueryServiceOptionsAndVariants(query) {
547
+ const { httpClient, sideEffects } = arguments[1];
548
+ const payload = renameKeysFromSDKRequestToRESTRequest({ query });
549
+ const reqOpts = queryServiceOptionsAndVariants(
550
+ payload
551
+ );
552
+ sideEffects?.onSiteCall?.();
553
+ try {
554
+ const result = await httpClient.request(reqOpts);
555
+ sideEffects?.onSuccess?.(result);
556
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
557
+ } catch (err) {
558
+ const transformedError = sdkTransformError(
559
+ err,
560
+ {
561
+ spreadPathsToArguments: {},
562
+ explicitPathsToArguments: { query: "$[0]" },
563
+ singleArgumentUnchanged: false
564
+ },
565
+ ["query"]
566
+ );
567
+ sideEffects?.onError?.(err);
568
+ throw transformedError;
569
+ }
570
+ }
546
571
 
547
572
  // src/bookings-catalog-v1-service-options-and-variants-service-options-and-variants.public.ts
548
573
  function createServiceOptionsAndVariants3(httpClient) {
@@ -596,6 +621,13 @@ function queryServiceOptionsAndVariants3(httpClient) {
596
621
  { httpClient }
597
622
  );
598
623
  }
624
+ function typedQueryServiceOptionsAndVariants2(httpClient) {
625
+ return (query) => typedQueryServiceOptionsAndVariants(
626
+ query,
627
+ // @ts-ignore
628
+ { httpClient }
629
+ );
630
+ }
599
631
  var onServiceOptionsAndVariantsCreated = EventDefinition(
600
632
  "wix.bookings.catalog.v1.service_options_and_variants_created",
601
633
  true,
@@ -636,6 +668,18 @@ var onServiceOptionsAndVariantsUpdated = EventDefinition(
636
668
  // src/bookings-catalog-v1-service-options-and-variants-service-options-and-variants.context.ts
637
669
  import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
638
670
  import { createEventModule } from "@wix/sdk-runtime/event-definition-modules";
671
+ import { createQueryOverloadRouter } from "@wix/sdk-runtime/query-method-router";
672
+ function customQueryServiceOptionsAndVariants(httpClient) {
673
+ const router = createQueryOverloadRouter({
674
+ builderQueryFunction: () => queryServiceOptionsAndVariants3(httpClient)(),
675
+ typedQueryFunction: (query) => typedQueryServiceOptionsAndVariants2(httpClient)(query),
676
+ hasOptionsParameter: false
677
+ });
678
+ function overloadedQuery(query) {
679
+ return router(...arguments);
680
+ }
681
+ return overloadedQuery;
682
+ }
639
683
  var createServiceOptionsAndVariants4 = /* @__PURE__ */ createRESTModule(createServiceOptionsAndVariants3);
640
684
  var cloneServiceOptionsAndVariants4 = /* @__PURE__ */ createRESTModule(cloneServiceOptionsAndVariants3);
641
685
  var getServiceOptionsAndVariants4 = /* @__PURE__ */ createRESTModule(getServiceOptionsAndVariants3);
@@ -644,7 +688,7 @@ var getServiceOptionsAndVariantsByServiceId4 = /* @__PURE__ */ createRESTModule(
644
688
  );
645
689
  var updateServiceOptionsAndVariants4 = /* @__PURE__ */ createRESTModule(updateServiceOptionsAndVariants3);
646
690
  var deleteServiceOptionsAndVariants4 = /* @__PURE__ */ createRESTModule(deleteServiceOptionsAndVariants3);
647
- var queryServiceOptionsAndVariants4 = /* @__PURE__ */ createRESTModule(queryServiceOptionsAndVariants3);
691
+ var queryServiceOptionsAndVariants4 = /* @__PURE__ */ createRESTModule(customQueryServiceOptionsAndVariants);
648
692
  var onServiceOptionsAndVariantsCreated2 = createEventModule(
649
693
  onServiceOptionsAndVariantsCreated
650
694
  );