@wix/auto_sdk_seatings_seating-reservation 1.0.15 → 1.0.16

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 { CreateSeatingReservationOptions, SeatingReservation, CreateSeatingReservationApplicationErrors, ReservationsQueryBuilder, DeleteSeatingReservationResponse, GetSeatingCategorySummaryOptions, GetSeatingCategorySummaryResponse, GetSeatingReservationSummaryResponse, SeatingReservationCreatedEnvelope, SeatingReservationDeletedEnvelope } from './index.typings.js';
3
- export { ActionEvent, App, AvailablePlace, BaseEventMetadata, CancelSeatingPlaceReservationsRequest, CancelSeatingPlaceReservationsResponse, Category, CategoryDetails, CreateSeatingReservationRequest, CreateSeatingReservationResponse, CursorPaging, Cursors, CustomTag, DeleteSeatingPlaceReservationRequest, DeleteSeatingReservationRequest, DomainEvent, DomainEventBodyOneOf, Element, ElementGroup, ElementGroupUiProperties, ElementUiProperties, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, ExtendedFields, File, GetReservationRequest, GetReservationResponse, GetReservedPlacesRequest, GetReservedPlacesResponse, GetSeatingCategorySummaryRequest, GetSeatingReservationSummaryRequest, Icon, IconWithLiterals, IdentificationData, IdentificationDataIdOneOf, Image, InvalidateCache, InvalidateCacheGetByOneOf, ListAvailablePlacesRequest, ListAvailablePlacesResponse, ListReservedPlacesRequest, ListReservedPlacesResponse, MessageEnvelope, MultiRowProperties, Numbering, NumberingWithLiterals, Page, Paging, PagingMetadata, PagingMetadataV2, Place, PlaceReservation, PlaceReservationDetails, PlaceTypeEnumType, PlaceTypeEnumTypeWithLiterals, Places, Position, PositionWithLiterals, QuerySeatingReservationRequest, QuerySeatingReservationResponse, QueryV2, QueryV2PagingMethodOneOf, RegenerateSummariesRequest, RegenerateSummariesResponse, ReservationErrorDetails, ReservationOptions, ReservationsQueryResult, ReservedPlace, RestoreInfo, RowElement, RowElementUiProperties, SeatReservation, SeatingPlan, SeatingPlanCategoriesSummaryUpdated, SeatingPlanUiProperties, SeatingReservationsSummary, Section, Sequencing, ShapeTypeEnumType, ShapeTypeEnumTypeWithLiterals, SortOrder, SortOrderWithLiterals, Sorting, Type, TypeWithLiterals, URI, UnavailablePlaces, UpdateSeatingReservationRequest, UpdateSeatingReservationResponse, VerticalSequencing, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
2
+ import { CreateSeatingReservationOptions, SeatingReservation, CreateSeatingReservationApplicationErrors, DeleteSeatingReservationResponse, GetSeatingCategorySummaryOptions, GetSeatingCategorySummaryResponse, GetSeatingReservationSummaryResponse, SeatingReservationCreatedEnvelope, SeatingReservationDeletedEnvelope, ReservationsQueryBuilder, QueryV2, typedQuerySeatingReservation } from './index.typings.js';
3
+ export { ActionEvent, App, AvailablePlace, BaseEventMetadata, CancelSeatingPlaceReservationsRequest, CancelSeatingPlaceReservationsResponse, Category, CategoryDetails, CreateSeatingReservationRequest, CreateSeatingReservationResponse, CursorPaging, Cursors, CustomTag, DeleteSeatingPlaceReservationRequest, DeleteSeatingReservationRequest, DomainEvent, DomainEventBodyOneOf, Element, ElementGroup, ElementGroupUiProperties, ElementUiProperties, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, ExtendedFields, File, GetReservationRequest, GetReservationResponse, GetReservedPlacesRequest, GetReservedPlacesResponse, GetSeatingCategorySummaryRequest, GetSeatingReservationSummaryRequest, Icon, IconWithLiterals, IdentificationData, IdentificationDataIdOneOf, Image, InvalidateCache, InvalidateCacheGetByOneOf, ListAvailablePlacesRequest, ListAvailablePlacesResponse, ListReservedPlacesRequest, ListReservedPlacesResponse, MessageEnvelope, MultiRowProperties, Numbering, NumberingWithLiterals, Page, Paging, PagingMetadata, PagingMetadataV2, Place, PlaceReservation, PlaceReservationDetails, PlaceTypeEnumType, PlaceTypeEnumTypeWithLiterals, Places, Position, PositionWithLiterals, QuerySeatingReservationRequest, QuerySeatingReservationResponse, QueryV2PagingMethodOneOf, RegenerateSummariesRequest, RegenerateSummariesResponse, ReservationErrorDetails, ReservationOptions, ReservationsQueryResult, ReservedPlace, RestoreInfo, RowElement, RowElementUiProperties, SeatReservation, SeatingPlan, SeatingPlanCategoriesSummaryUpdated, SeatingPlanUiProperties, SeatingReservationsSummary, Section, Sequencing, ShapeTypeEnumType, ShapeTypeEnumTypeWithLiterals, SortOrder, SortOrderWithLiterals, Sorting, Type, TypeWithLiterals, URI, UnavailablePlaces, UpdateSeatingReservationRequest, UpdateSeatingReservationResponse, VerticalSequencing, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
4
4
 
5
5
  declare function createSeatingReservation$1(httpClient: HttpClient): CreateSeatingReservationSignature;
6
6
  interface CreateSeatingReservationSignature {
@@ -21,13 +21,6 @@ interface GetReservationSignature {
21
21
  */
22
22
  (_id: string): Promise<NonNullablePaths<SeatingReservation, `reservedPlaces` | `reservedPlaces.${number}._id`, 4>>;
23
23
  }
24
- declare function querySeatingReservation$1(httpClient: HttpClient): QuerySeatingReservationSignature;
25
- interface QuerySeatingReservationSignature {
26
- /**
27
- * Retrieves seating reservations that match specified criteria.
28
- */
29
- (): ReservationsQueryBuilder;
30
- }
31
24
  declare function deleteSeatingReservation$1(httpClient: HttpClient): DeleteSeatingReservationSignature;
32
25
  interface DeleteSeatingReservationSignature {
33
26
  /**
@@ -57,15 +50,19 @@ interface GetSeatingReservationSummarySignature {
57
50
  declare const onSeatingReservationCreated$1: EventDefinition<SeatingReservationCreatedEnvelope, "wix.seating.v1.seating_reservation_created">;
58
51
  declare const onSeatingReservationDeleted$1: EventDefinition<SeatingReservationDeletedEnvelope, "wix.seating.v1.seating_reservation_deleted">;
59
52
 
53
+ declare function customQuerySeatingReservation(httpClient: HttpClient): {
54
+ (): ReservationsQueryBuilder;
55
+ (query: QueryV2): ReturnType<typeof typedQuerySeatingReservation>;
56
+ };
60
57
  declare const createSeatingReservation: MaybeContext<BuildRESTFunction<typeof createSeatingReservation$1> & typeof createSeatingReservation$1>;
61
58
  declare const getReservation: MaybeContext<BuildRESTFunction<typeof getReservation$1> & typeof getReservation$1>;
62
- declare const querySeatingReservation: MaybeContext<BuildRESTFunction<typeof querySeatingReservation$1> & typeof querySeatingReservation$1>;
63
59
  declare const deleteSeatingReservation: MaybeContext<BuildRESTFunction<typeof deleteSeatingReservation$1> & typeof deleteSeatingReservation$1>;
64
60
  declare const getSeatingCategorySummary: MaybeContext<BuildRESTFunction<typeof getSeatingCategorySummary$1> & typeof getSeatingCategorySummary$1>;
65
61
  declare const getSeatingReservationSummary: MaybeContext<BuildRESTFunction<typeof getSeatingReservationSummary$1> & typeof getSeatingReservationSummary$1>;
62
+ declare const querySeatingReservation: MaybeContext<BuildRESTFunction<typeof customQuerySeatingReservation> & typeof customQuerySeatingReservation>;
66
63
  /** */
67
64
  declare const onSeatingReservationCreated: BuildEventDefinition<typeof onSeatingReservationCreated$1> & typeof onSeatingReservationCreated$1;
68
65
  /** */
69
66
  declare const onSeatingReservationDeleted: BuildEventDefinition<typeof onSeatingReservationDeleted$1> & typeof onSeatingReservationDeleted$1;
70
67
 
71
- export { CreateSeatingReservationApplicationErrors, CreateSeatingReservationOptions, DeleteSeatingReservationResponse, GetSeatingCategorySummaryOptions, GetSeatingCategorySummaryResponse, GetSeatingReservationSummaryResponse, ReservationsQueryBuilder, SeatingReservation, SeatingReservationCreatedEnvelope, SeatingReservationDeletedEnvelope, createSeatingReservation, deleteSeatingReservation, getReservation, getSeatingCategorySummary, getSeatingReservationSummary, onSeatingReservationCreated, onSeatingReservationDeleted, querySeatingReservation };
68
+ export { CreateSeatingReservationApplicationErrors, CreateSeatingReservationOptions, DeleteSeatingReservationResponse, GetSeatingCategorySummaryOptions, GetSeatingCategorySummaryResponse, GetSeatingReservationSummaryResponse, QueryV2, ReservationsQueryBuilder, SeatingReservation, SeatingReservationCreatedEnvelope, SeatingReservationDeletedEnvelope, createSeatingReservation, deleteSeatingReservation, getReservation, getSeatingCategorySummary, getSeatingReservationSummary, onSeatingReservationCreated, onSeatingReservationDeleted, querySeatingReservation };
@@ -464,6 +464,29 @@ function querySeatingReservation2() {
464
464
  transformationPaths: {}
465
465
  });
466
466
  }
467
+ async function typedQuerySeatingReservation(query) {
468
+ const { httpClient, sideEffects } = arguments[1];
469
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
470
+ const reqOpts = querySeatingReservation(payload);
471
+ sideEffects?.onSiteCall?.();
472
+ try {
473
+ const result = await httpClient.request(reqOpts);
474
+ sideEffects?.onSuccess?.(result);
475
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
476
+ } catch (err) {
477
+ const transformedError = (0, import_transform_error.transformError)(
478
+ err,
479
+ {
480
+ spreadPathsToArguments: {},
481
+ explicitPathsToArguments: { query: "$[0]" },
482
+ singleArgumentUnchanged: false
483
+ },
484
+ ["query"]
485
+ );
486
+ sideEffects?.onError?.(err);
487
+ throw transformedError;
488
+ }
489
+ }
467
490
  async function deleteSeatingReservation2(_id) {
468
491
  const { httpClient, sideEffects } = arguments[1];
469
492
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
@@ -561,6 +584,13 @@ function querySeatingReservation3(httpClient) {
561
584
  { httpClient }
562
585
  );
563
586
  }
587
+ function typedQuerySeatingReservation2(httpClient) {
588
+ return (query) => typedQuerySeatingReservation(
589
+ query,
590
+ // @ts-ignore
591
+ { httpClient }
592
+ );
593
+ }
564
594
  function deleteSeatingReservation3(httpClient) {
565
595
  return (_id) => deleteSeatingReservation2(
566
596
  _id,
@@ -610,12 +640,24 @@ var onSeatingReservationDeleted = (0, import_sdk_types.EventDefinition)(
610
640
  // src/seating-v1-seating-reservation-seating-reservation.context.ts
611
641
  var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
612
642
  var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
643
+ var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
644
+ function customQuerySeatingReservation(httpClient) {
645
+ const router = (0, import_query_method_router.createQueryOverloadRouter)({
646
+ builderQueryFunction: () => querySeatingReservation3(httpClient)(),
647
+ typedQueryFunction: (query) => typedQuerySeatingReservation2(httpClient)(query),
648
+ hasOptionsParameter: false
649
+ });
650
+ function overloadedQuery(query) {
651
+ return router(...arguments);
652
+ }
653
+ return overloadedQuery;
654
+ }
613
655
  var createSeatingReservation4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createSeatingReservation3);
614
656
  var getReservation4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getReservation3);
615
- var querySeatingReservation4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(querySeatingReservation3);
616
657
  var deleteSeatingReservation4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteSeatingReservation3);
617
658
  var getSeatingCategorySummary4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getSeatingCategorySummary3);
618
659
  var getSeatingReservationSummary4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getSeatingReservationSummary3);
660
+ var querySeatingReservation4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQuerySeatingReservation);
619
661
  var onSeatingReservationCreated2 = (0, import_event_definition_modules.createEventModule)(
620
662
  onSeatingReservationCreated
621
663
  );