@wix/auto_sdk_calendar_events 1.0.41 → 1.0.42

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 { ListEventsByContactIdOptions, ListEventsByContactIdResponse, ListEventsByMemberIdOptions, ListEventsByMemberIdResponse, GetEventOptions, Event, ListEventsOptions, ListEventsResponse, QueryEventsOptions, EventsQueryBuilder, CreateEventOptions, MaskedEvent, BulkCreateEventOptions, BulkCreateEventResponse, UpdateEvent, UpdateEventOptions, BulkUpdateEventRequestMaskedEvent, BulkUpdateEventOptions, BulkUpdateEventResponse, FieldWithLiterals, RestoreEventDefaultsOptions, RestoreEventDefaultsResponse, SplitRecurringEventOptions, SplitRecurringEventResponse, CancelEventOptions, CancelEventResponse, CancelEventApplicationErrors, BulkCancelEventOptions, BulkCancelEventResponse, BulkCancelEventApplicationErrors, EventCancelledEnvelope, EventCreatedEnvelope, EventRecurringSplitEnvelope, EventUpdatedEnvelope } from './index.typings.mjs';
3
- export { ActionEvent, Address, AddressHint, ApplicationError, BaseEventMetadata, BulkActionMetadata, BulkCancelEventRequest, BulkCreateEventRequest, BulkEventResult, BulkUpdateEventRequest, BusinessSchedule, CancelEventRequest, Categories, ChangeContext, ChangeContextPayloadOneOf, CommonCursorPaging, CommonCursorPagingMetadata, CommonCursors, CommonIdentificationData, CommonIdentificationDataIdOneOf, ConferencingDetails, ConsentPolicy, CreateEventRequest, CreateEventResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, Day, DayOfWeek, DayOfWeekWithLiterals, DayWithLiterals, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventCancelled, EventMetadata, EventUpdatedWithMetadata, EventsQueryResult, ExtendedFields, Field, Frequency, FrequencyWithLiterals, GeoCoordinates, GetEventRequest, GetEventResponse, IdentificationData, IdentificationDataIdOneOf, IdentityType, IdentityTypeWithLiterals, ItemMetadata, ListEventsByContactIdRequest, ListEventsByMemberIdRequest, ListEventsRequest, ListRecurringEventInstancesHistoryRequest, ListRecurringEventInstancesHistoryResponse, Locale, Location, LocationType, LocationTypeWithLiterals, MessageEnvelope, Multilingual, Participant, ParticipantNotification, Participants, ParticipantsStatus, ParticipantsStatusWithLiterals, Permission, PlacementType, PlacementTypeWithLiterals, Properties, PropertiesChange, QueryEventsRequest, QueryEventsResponse, RecurrenceRule, RecurrenceType, RecurrenceTypeWithLiterals, RecurringEventSplit, RequestedFields, RequestedFieldsWithLiterals, ResolutionMethod, ResolutionMethodWithLiterals, Resource, RestoreEventDefaultsRequest, RestoreInfo, Role, RoleWithLiterals, SiteCloned, SiteCreated, SitePropertiesEvent, SitePropertiesNotification, SortOrder, SortOrderWithLiterals, Sorting, SpecialHourPeriod, SplitRecurringEventRequest, Status, StatusWithLiterals, SupportedLanguage, TimePeriod, Translation, Transparency, TransparencyWithLiterals, Type, TypeWithLiterals, UpdateEventParticipantsRequest, UpdateEventParticipantsResponse, UpdateEventRequest, UpdateEventResponse, UpdateEventsWithFixedBusinessResourceIdRequest, UpdateEventsWithFixedBusinessResourceIdResponse, UpdateScheduleWithFixedBusinessResourceIdRequest, UpdateScheduleWithFixedBusinessResourceIdResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, ZonedDate } from './index.typings.mjs';
2
+ import { ListEventsByContactIdOptions, ListEventsByContactIdResponse, ListEventsByMemberIdOptions, ListEventsByMemberIdResponse, GetEventOptions, Event, ListEventsOptions, ListEventsResponse, CreateEventOptions, MaskedEvent, BulkCreateEventOptions, BulkCreateEventResponse, UpdateEvent, UpdateEventOptions, BulkUpdateEventRequestMaskedEvent, BulkUpdateEventOptions, BulkUpdateEventResponse, FieldWithLiterals, RestoreEventDefaultsOptions, RestoreEventDefaultsResponse, SplitRecurringEventOptions, SplitRecurringEventResponse, CancelEventOptions, CancelEventResponse, CancelEventApplicationErrors, BulkCancelEventOptions, BulkCancelEventResponse, BulkCancelEventApplicationErrors, EventCancelledEnvelope, EventCreatedEnvelope, EventRecurringSplitEnvelope, EventUpdatedEnvelope, CursorQuery, typedQueryEvents, QueryEventsOptions, EventsQueryBuilder } from './index.typings.mjs';
3
+ export { ActionEvent, Address, AddressHint, ApplicationError, BaseEventMetadata, BulkActionMetadata, BulkCancelEventRequest, BulkCreateEventRequest, BulkEventResult, BulkUpdateEventRequest, BusinessSchedule, CancelEventRequest, Categories, ChangeContext, ChangeContextPayloadOneOf, CommonCursorPaging, CommonCursorPagingMetadata, CommonCursors, CommonIdentificationData, CommonIdentificationDataIdOneOf, ConferencingDetails, ConsentPolicy, CreateEventRequest, CreateEventResponse, CursorPaging, CursorPagingMetadata, CursorQueryPagingMethodOneOf, Cursors, Day, DayOfWeek, DayOfWeekWithLiterals, DayWithLiterals, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventCancelled, EventMetadata, EventUpdatedWithMetadata, EventsQueryResult, ExtendedFields, Field, Frequency, FrequencyWithLiterals, GeoCoordinates, GetEventRequest, GetEventResponse, IdentificationData, IdentificationDataIdOneOf, IdentityType, IdentityTypeWithLiterals, ItemMetadata, ListEventsByContactIdRequest, ListEventsByMemberIdRequest, ListEventsRequest, ListRecurringEventInstancesHistoryRequest, ListRecurringEventInstancesHistoryResponse, Locale, Location, LocationType, LocationTypeWithLiterals, MessageEnvelope, Multilingual, Participant, ParticipantNotification, Participants, ParticipantsStatus, ParticipantsStatusWithLiterals, Permission, PlacementType, PlacementTypeWithLiterals, Properties, PropertiesChange, QueryEventsRequest, QueryEventsResponse, RecurrenceRule, RecurrenceType, RecurrenceTypeWithLiterals, RecurringEventSplit, RequestedFields, RequestedFieldsWithLiterals, ResolutionMethod, ResolutionMethodWithLiterals, Resource, RestoreEventDefaultsRequest, RestoreInfo, Role, RoleWithLiterals, SiteCloned, SiteCreated, SitePropertiesEvent, SitePropertiesNotification, SortOrder, SortOrderWithLiterals, Sorting, SpecialHourPeriod, SplitRecurringEventRequest, Status, StatusWithLiterals, SupportedLanguage, TimePeriod, Translation, Transparency, TransparencyWithLiterals, Type, TypeWithLiterals, UpdateEventParticipantsRequest, UpdateEventParticipantsResponse, UpdateEventRequest, UpdateEventResponse, UpdateEventsWithFixedBusinessResourceIdRequest, UpdateEventsWithFixedBusinessResourceIdResponse, UpdateScheduleWithFixedBusinessResourceIdRequest, UpdateScheduleWithFixedBusinessResourceIdResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, ZonedDate } from './index.typings.mjs';
4
4
 
5
5
  declare function listEventsByContactId$1(httpClient: HttpClient): ListEventsByContactIdSignature;
6
6
  interface ListEventsByContactIdSignature {
@@ -59,29 +59,6 @@ interface ListEventsSignature {
59
59
  */
60
60
  (eventIds: string[], options?: ListEventsOptions): Promise<NonNullablePaths<ListEventsResponse, `events` | `events.${number}.status` | `events.${number}.recurrenceType` | `events.${number}.recurrenceRule.frequency` | `events.${number}.transparency` | `events.${number}.location.type` | `events.${number}.participants.status` | `events.${number}.conferencingDetails.type`, 5>>;
61
61
  }
62
- declare function queryEvents$1(httpClient: HttpClient): QueryEventsSignature;
63
- interface QueryEventsSignature {
64
- /**
65
- * Creates a query to retrieve a list of events.
66
- *
67
- * The `queryEvents()` function builds a query to retrieve a list of events and returns an `EventsQueryBuilder` object.
68
- *
69
- * 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/calendar/events/events-query-builder/find) function.
70
- *
71
- * You can refine the query by chaining `EventsQueryBuilder` functions onto the query. `EventsQueryBuilder` functions enable you to sort, filter, and control the results that `queryEvents()` returns.
72
- *
73
- * `queryEvents()` runs with the following `EventsQueryBuilder` default that you can override:
74
- *
75
- * + `limit` is `50`.
76
- * + Sorted by `event.start` in ascending order.
77
- *
78
- * The functions that are chained to `queryEvents()` are applied in the order they are called.
79
- *
80
- * The following `EventsQueryBuilder` functions are supported for the `queryEvents()` function. For a full description of the events object, see the object returned for the [items](https://dev.wix.com/docs/sdk/backend-modules/calendar/events/events-query-result/items) property in `EventsQueryResult`.
81
- *
82
- */
83
- (options?: QueryEventsOptions): EventsQueryBuilder;
84
- }
85
62
  declare function createEvent$1(httpClient: HttpClient): CreateEventSignature;
86
63
  interface CreateEventSignature {
87
64
  /**
@@ -243,11 +220,16 @@ declare const onEventCreated$1: EventDefinition<EventCreatedEnvelope, "wix.calen
243
220
  declare const onEventRecurringSplit$1: EventDefinition<EventRecurringSplitEnvelope, "wix.calendar.v3.event_recurring_split">;
244
221
  declare const onEventUpdated$1: EventDefinition<EventUpdatedEnvelope, "wix.calendar.v3.event_updated">;
245
222
 
223
+ declare function customQueryEvents(httpClient: HttpClient): {
224
+ (query: CursorQuery): ReturnType<typeof typedQueryEvents>;
225
+ (query: CursorQuery, options: QueryEventsOptions): ReturnType<typeof typedQueryEvents>;
226
+ (): EventsQueryBuilder;
227
+ (options: QueryEventsOptions): EventsQueryBuilder;
228
+ };
246
229
  declare const listEventsByContactId: MaybeContext<BuildRESTFunction<typeof listEventsByContactId$1> & typeof listEventsByContactId$1>;
247
230
  declare const listEventsByMemberId: MaybeContext<BuildRESTFunction<typeof listEventsByMemberId$1> & typeof listEventsByMemberId$1>;
248
231
  declare const getEvent: MaybeContext<BuildRESTFunction<typeof getEvent$1> & typeof getEvent$1>;
249
232
  declare const listEvents: MaybeContext<BuildRESTFunction<typeof listEvents$1> & typeof listEvents$1>;
250
- declare const queryEvents: MaybeContext<BuildRESTFunction<typeof queryEvents$1> & typeof queryEvents$1>;
251
233
  declare const createEvent: MaybeContext<BuildRESTFunction<typeof createEvent$1> & typeof createEvent$1>;
252
234
  declare const bulkCreateEvent: MaybeContext<BuildRESTFunction<typeof bulkCreateEvent$1> & typeof bulkCreateEvent$1>;
253
235
  declare const updateEvent: MaybeContext<BuildRESTFunction<typeof updateEvent$1> & typeof updateEvent$1>;
@@ -256,6 +238,7 @@ declare const restoreEventDefaults: MaybeContext<BuildRESTFunction<typeof restor
256
238
  declare const splitRecurringEvent: MaybeContext<BuildRESTFunction<typeof splitRecurringEvent$1> & typeof splitRecurringEvent$1>;
257
239
  declare const cancelEvent: MaybeContext<BuildRESTFunction<typeof cancelEvent$1> & typeof cancelEvent$1>;
258
240
  declare const bulkCancelEvent: MaybeContext<BuildRESTFunction<typeof bulkCancelEvent$1> & typeof bulkCancelEvent$1>;
241
+ declare const queryEvents: MaybeContext<BuildRESTFunction<typeof customQueryEvents> & typeof customQueryEvents>;
259
242
  /**
260
243
  * Triggered when an event is canceled.
261
244
  *
@@ -286,4 +269,4 @@ declare const onEventRecurringSplit: BuildEventDefinition<typeof onEventRecurrin
286
269
  */
287
270
  declare const onEventUpdated: BuildEventDefinition<typeof onEventUpdated$1> & typeof onEventUpdated$1;
288
271
 
289
- export { BulkCancelEventApplicationErrors, BulkCancelEventOptions, BulkCancelEventResponse, BulkCreateEventOptions, BulkCreateEventResponse, BulkUpdateEventOptions, BulkUpdateEventRequestMaskedEvent, BulkUpdateEventResponse, CancelEventApplicationErrors, CancelEventOptions, CancelEventResponse, CreateEventOptions, Event, EventCancelledEnvelope, EventCreatedEnvelope, EventRecurringSplitEnvelope, EventUpdatedEnvelope, EventsQueryBuilder, FieldWithLiterals, GetEventOptions, ListEventsByContactIdOptions, ListEventsByContactIdResponse, ListEventsByMemberIdOptions, ListEventsByMemberIdResponse, ListEventsOptions, ListEventsResponse, MaskedEvent, QueryEventsOptions, RestoreEventDefaultsOptions, RestoreEventDefaultsResponse, SplitRecurringEventOptions, SplitRecurringEventResponse, UpdateEvent, UpdateEventOptions, bulkCancelEvent, bulkCreateEvent, bulkUpdateEvent, cancelEvent, createEvent, getEvent, listEvents, listEventsByContactId, listEventsByMemberId, onEventCancelled, onEventCreated, onEventRecurringSplit, onEventUpdated, queryEvents, restoreEventDefaults, splitRecurringEvent, updateEvent };
272
+ export { BulkCancelEventApplicationErrors, BulkCancelEventOptions, BulkCancelEventResponse, BulkCreateEventOptions, BulkCreateEventResponse, BulkUpdateEventOptions, BulkUpdateEventRequestMaskedEvent, BulkUpdateEventResponse, CancelEventApplicationErrors, CancelEventOptions, CancelEventResponse, CreateEventOptions, CursorQuery, Event, EventCancelledEnvelope, EventCreatedEnvelope, EventRecurringSplitEnvelope, EventUpdatedEnvelope, EventsQueryBuilder, FieldWithLiterals, GetEventOptions, ListEventsByContactIdOptions, ListEventsByContactIdResponse, ListEventsByMemberIdOptions, ListEventsByMemberIdResponse, ListEventsOptions, ListEventsResponse, MaskedEvent, QueryEventsOptions, RestoreEventDefaultsOptions, RestoreEventDefaultsResponse, SplitRecurringEventOptions, SplitRecurringEventResponse, UpdateEvent, UpdateEventOptions, bulkCancelEvent, bulkCreateEvent, bulkUpdateEvent, cancelEvent, createEvent, getEvent, listEvents, listEventsByContactId, listEventsByMemberId, onEventCancelled, onEventCreated, onEventRecurringSplit, onEventUpdated, queryEvents, restoreEventDefaults, splitRecurringEvent, updateEvent };
@@ -1001,6 +1001,32 @@ function queryEvents2(options) {
1001
1001
  }
1002
1002
  );
1003
1003
  }
1004
+ async function typedQueryEvents(query, options) {
1005
+ const { httpClient, sideEffects } = arguments[2];
1006
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1007
+ query,
1008
+ ...options
1009
+ });
1010
+ const reqOpts = queryEvents(payload);
1011
+ sideEffects?.onSiteCall?.();
1012
+ try {
1013
+ const result = await httpClient.request(reqOpts);
1014
+ sideEffects?.onSuccess?.(result);
1015
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1016
+ } catch (err) {
1017
+ const transformedError = sdkTransformError(
1018
+ err,
1019
+ {
1020
+ spreadPathsToArguments: {},
1021
+ explicitPathsToArguments: { query: "$[0]" },
1022
+ singleArgumentUnchanged: false
1023
+ },
1024
+ ["query", "options"]
1025
+ );
1026
+ sideEffects?.onError?.(err);
1027
+ throw transformedError;
1028
+ }
1029
+ }
1004
1030
  async function createEvent2(event, options) {
1005
1031
  const { httpClient, sideEffects } = arguments[2];
1006
1032
  const payload = renameKeysFromSDKRequestToRESTRequest({
@@ -1296,6 +1322,14 @@ function queryEvents3(httpClient) {
1296
1322
  { httpClient }
1297
1323
  );
1298
1324
  }
1325
+ function typedQueryEvents2(httpClient) {
1326
+ return (query, options) => typedQueryEvents(
1327
+ query,
1328
+ options,
1329
+ // @ts-ignore
1330
+ { httpClient }
1331
+ );
1332
+ }
1299
1333
  function createEvent3(httpClient) {
1300
1334
  return (event, options) => createEvent2(
1301
1335
  event,
@@ -1481,11 +1515,22 @@ var onEventUpdated = EventDefinition(
1481
1515
  // src/calendar-v3-event-events.context.ts
1482
1516
  import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
1483
1517
  import { createEventModule } from "@wix/sdk-runtime/event-definition-modules";
1518
+ import { createQueryOverloadRouter } from "@wix/sdk-runtime/query-method-router";
1519
+ function customQueryEvents(httpClient) {
1520
+ const router = createQueryOverloadRouter({
1521
+ builderQueryFunction: (options) => queryEvents3(httpClient)(options),
1522
+ typedQueryFunction: (query, options) => typedQueryEvents2(httpClient)(query, options),
1523
+ hasOptionsParameter: true
1524
+ });
1525
+ function overloadedQuery(queryOrOptions, options) {
1526
+ return router(...arguments);
1527
+ }
1528
+ return overloadedQuery;
1529
+ }
1484
1530
  var listEventsByContactId4 = /* @__PURE__ */ createRESTModule(listEventsByContactId3);
1485
1531
  var listEventsByMemberId4 = /* @__PURE__ */ createRESTModule(listEventsByMemberId3);
1486
1532
  var getEvent4 = /* @__PURE__ */ createRESTModule(getEvent3);
1487
1533
  var listEvents4 = /* @__PURE__ */ createRESTModule(listEvents3);
1488
- var queryEvents4 = /* @__PURE__ */ createRESTModule(queryEvents3);
1489
1534
  var createEvent4 = /* @__PURE__ */ createRESTModule(createEvent3);
1490
1535
  var bulkCreateEvent4 = /* @__PURE__ */ createRESTModule(bulkCreateEvent3);
1491
1536
  var updateEvent4 = /* @__PURE__ */ createRESTModule(updateEvent3);
@@ -1494,6 +1539,7 @@ var restoreEventDefaults4 = /* @__PURE__ */ createRESTModule(restoreEventDefault
1494
1539
  var splitRecurringEvent4 = /* @__PURE__ */ createRESTModule(splitRecurringEvent3);
1495
1540
  var cancelEvent4 = /* @__PURE__ */ createRESTModule(cancelEvent3);
1496
1541
  var bulkCancelEvent4 = /* @__PURE__ */ createRESTModule(bulkCancelEvent3);
1542
+ var queryEvents4 = /* @__PURE__ */ createRESTModule(customQueryEvents);
1497
1543
  var onEventCancelled2 = createEventModule(onEventCancelled);
1498
1544
  var onEventCreated2 = createEventModule(onEventCreated);
1499
1545
  var onEventRecurringSplit2 = createEventModule(