@wix/auto_sdk_calendar_schedules 1.0.84 → 1.0.86

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 { GetScheduleOptions, Schedule, QuerySchedulesOptions, SchedulesQueryBuilder, CreateScheduleOptions, UpdateSchedule, UpdateScheduleOptions, UpdateScheduleApplicationErrors, CancelScheduleOptions, CancelScheduleResponse, CancelScheduleApplicationErrors, ScheduleCancelledEnvelope, ScheduleClonedEnvelope, ScheduleCreatedEnvelope, ScheduleUpdatedEnvelope } from './index.typings.js';
3
- export { ActionEvent, Address, AddressHint, Asset, BaseEventMetadata, BusinessSchedule, CancelScheduleRequest, Categories, ChangeContext, ChangeContextPayloadOneOf, CloneScheduleRequest, CloneScheduleResponse, CommonIdentificationData, CommonIdentificationDataIdOneOf, ConferencingDetails, ConsentPolicy, CreateScheduleRequest, CreateScheduleResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DayOfWeek, DayOfWeekWithLiterals, DeleteContext, DeleteStatus, DeleteStatusWithLiterals, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, ExtendedFields, GeoCoordinates, GetScheduleRequest, GetScheduleResponse, IdentificationData, IdentificationDataIdOneOf, IdentityType, IdentityTypeWithLiterals, Locale, Location, LocationType, LocationTypeWithLiterals, MessageEnvelope, MetaSiteSpecialEvent, MetaSiteSpecialEventPayloadOneOf, Multilingual, Namespace, NamespaceChanged, NamespaceWithLiterals, OdeditorAssigned, OdeditorUnassigned, ParticipantNotification, Permission, PicassoAssigned, PicassoUnassigned, PlacementType, PlacementTypeWithLiterals, Properties, PropertiesChange, QuerySchedulesRequest, QuerySchedulesResponse, RequestedFields, RequestedFieldsWithLiterals, ResolutionMethod, ResolutionMethodWithLiterals, RestoreInfo, Role, RoleWithLiterals, ScheduleCancelled, ScheduleCloned, ScheduleUpdatedWithMetadata, SchedulesQueryResult, ServiceProvisioned, ServiceRemoved, SiteCloned, SiteCreated, SiteCreatedContext, SiteCreatedContextWithLiterals, SiteDeleted, SiteHardDeleted, SiteMarkedAsTemplate, SiteMarkedAsWixSite, SitePropertiesEvent, SitePropertiesNotification, SitePublished, SitePurgedExternally, SiteRenamed, SiteTransferred, SiteUndeleted, SiteUnpublished, SiteUrlChanged, SpecialHourPeriod, State, StateWithLiterals, Status, StatusWithLiterals, StudioAssigned, StudioTwoAssigned, StudioTwoUnassigned, StudioUnassigned, SupportedLanguage, TimePeriod, Translation, Trigger, TriggerWithLiterals, Type, TypeWithLiterals, UpdateScheduleRequest, UpdateScheduleResponse, V4SiteCreated, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WixelAssigned, WixelUnassigned } from './index.typings.js';
2
+ import { GetScheduleOptions, Schedule, CreateScheduleOptions, UpdateSchedule, UpdateScheduleOptions, UpdateScheduleApplicationErrors, CancelScheduleOptions, CancelScheduleResponse, CancelScheduleApplicationErrors, ScheduleCancelledEnvelope, ScheduleClonedEnvelope, ScheduleCreatedEnvelope, ScheduleUpdatedEnvelope, CursorQuery, typedQuerySchedules, QuerySchedulesOptions, SchedulesQueryBuilder } from './index.typings.js';
3
+ export { ActionEvent, Address, AddressHint, Asset, BaseEventMetadata, BusinessSchedule, CancelScheduleRequest, Categories, ChangeContext, ChangeContextPayloadOneOf, CloneScheduleRequest, CloneScheduleResponse, CommonIdentificationData, CommonIdentificationDataIdOneOf, ConferencingDetails, ConsentPolicy, CreateScheduleRequest, CreateScheduleResponse, CursorPaging, CursorPagingMetadata, CursorQueryPagingMethodOneOf, Cursors, DayOfWeek, DayOfWeekWithLiterals, DeleteContext, DeleteStatus, DeleteStatusWithLiterals, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, ExtendedFields, GeoCoordinates, GetScheduleRequest, GetScheduleResponse, IdentificationData, IdentificationDataIdOneOf, IdentityType, IdentityTypeWithLiterals, Locale, Location, LocationType, LocationTypeWithLiterals, MessageEnvelope, MetaSiteSpecialEvent, MetaSiteSpecialEventPayloadOneOf, Multilingual, Namespace, NamespaceChanged, NamespaceWithLiterals, OdeditorAssigned, OdeditorUnassigned, ParticipantNotification, Permission, PicassoAssigned, PicassoUnassigned, PlacementType, PlacementTypeWithLiterals, Properties, PropertiesChange, QuerySchedulesRequest, QuerySchedulesResponse, RequestedFields, RequestedFieldsWithLiterals, ResolutionMethod, ResolutionMethodWithLiterals, RestoreInfo, Role, RoleWithLiterals, ScheduleCancelled, ScheduleCloned, ScheduleUpdatedWithMetadata, SchedulesQueryResult, ServiceProvisioned, ServiceRemoved, SiteCloned, SiteCreated, SiteCreatedContext, SiteCreatedContextWithLiterals, SiteDeleted, SiteHardDeleted, SiteMarkedAsTemplate, SiteMarkedAsWixSite, SitePropertiesEvent, SitePropertiesNotification, SitePublished, SitePurgedExternally, SiteRenamed, SiteTransferred, SiteUndeleted, SiteUnpublished, SiteUrlChanged, SpecialHourPeriod, State, StateWithLiterals, Status, StatusWithLiterals, StudioAssigned, StudioTwoAssigned, StudioTwoUnassigned, StudioUnassigned, SupportedLanguage, TimePeriod, Translation, Trigger, TriggerWithLiterals, Type, TypeWithLiterals, UpdateScheduleRequest, UpdateScheduleResponse, V4SiteCreated, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WixelAssigned, WixelUnassigned } from './index.typings.js';
4
4
 
5
5
  declare function getSchedule$1(httpClient: HttpClient): GetScheduleSignature;
6
6
  interface GetScheduleSignature {
@@ -11,28 +11,6 @@ interface GetScheduleSignature {
11
11
  */
12
12
  (scheduleId: string, options?: GetScheduleOptions): Promise<NonNullablePaths<Schedule, `status` | `defaultLocation.type` | `defaultConferencingDetails.type` | `permissions` | `permissions.${number}.identity.wixUserId` | `permissions.${number}.role`, 5>>;
13
13
  }
14
- declare function querySchedules$1(httpClient: HttpClient): QuerySchedulesSignature;
15
- interface QuerySchedulesSignature {
16
- /**
17
- * Creates a query to retrieve a list of schedules.
18
- *
19
- * The `querySchedules()` function builds a query to retrieve a list of tip settings and returns a `SchedulesQueryBuilder` object.
20
- *
21
- * 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/schedules/schedules-query-builder/find) function.
22
- *
23
- * You can refine the query by chaining `SchedulesQueryBuilder` functions onto the query. `SchedulesQueryBuilder` functions enable you to sort, filter, and control the results that `querySchedules()` returns.
24
- *
25
- * `querySchedules()` runs with the following `SchedulesQueryBuilder` default that you can override:
26
- *
27
- * + `limit` is `50`.
28
- * + Sorted by `id` in ascending order.
29
- *
30
- * The functions that are chained to `querySchedules()` are applied in the order they are called. For example, if you apply `ascending("status")` and then `ascending("externalId")`, the results are sorted first by the `"status"`, and then, if there are multiple results with the same `"status"`, the items are sorted by `"externalId"`.
31
- *
32
- * The following `SchedulesQueryBuilder` functions are supported for the `querySchedules()` function. For a full description of the tip settings object, see the object returned for the [items](https://dev.wix.com/docs/sdk/backend-modules/calendar/schedules/schedules-query-result/items) property in `SchedulesQueryResult`.
33
- */
34
- (options?: QuerySchedulesOptions): SchedulesQueryBuilder;
35
- }
36
14
  declare function createSchedule$1(httpClient: HttpClient): CreateScheduleSignature;
37
15
  interface CreateScheduleSignature {
38
16
  /**
@@ -87,11 +65,17 @@ declare const onScheduleCloned$1: EventDefinition<ScheduleClonedEnvelope, "wix.c
87
65
  declare const onScheduleCreated$1: EventDefinition<ScheduleCreatedEnvelope, "wix.calendar.v3.schedule_created">;
88
66
  declare const onScheduleUpdated$1: EventDefinition<ScheduleUpdatedEnvelope, "wix.calendar.v3.schedule_updated">;
89
67
 
68
+ declare function customQuerySchedules(httpClient: HttpClient): {
69
+ (query: CursorQuery): ReturnType<typeof typedQuerySchedules>;
70
+ (query: CursorQuery, options: QuerySchedulesOptions): ReturnType<typeof typedQuerySchedules>;
71
+ (): SchedulesQueryBuilder;
72
+ (options: QuerySchedulesOptions): SchedulesQueryBuilder;
73
+ };
90
74
  declare const getSchedule: MaybeContext<BuildRESTFunction<typeof getSchedule$1> & typeof getSchedule$1>;
91
- declare const querySchedules: MaybeContext<BuildRESTFunction<typeof querySchedules$1> & typeof querySchedules$1>;
92
75
  declare const createSchedule: MaybeContext<BuildRESTFunction<typeof createSchedule$1> & typeof createSchedule$1>;
93
76
  declare const updateSchedule: MaybeContext<BuildRESTFunction<typeof updateSchedule$1> & typeof updateSchedule$1>;
94
77
  declare const cancelSchedule: MaybeContext<BuildRESTFunction<typeof cancelSchedule$1> & typeof cancelSchedule$1>;
78
+ declare const querySchedules: MaybeContext<BuildRESTFunction<typeof customQuerySchedules> & typeof customQuerySchedules>;
95
79
  /**
96
80
  * Triggered when a schedule is canceled.
97
81
  */
@@ -109,4 +93,4 @@ declare const onScheduleCreated: BuildEventDefinition<typeof onScheduleCreated$1
109
93
  */
110
94
  declare const onScheduleUpdated: BuildEventDefinition<typeof onScheduleUpdated$1> & typeof onScheduleUpdated$1;
111
95
 
112
- export { CancelScheduleApplicationErrors, CancelScheduleOptions, CancelScheduleResponse, CreateScheduleOptions, GetScheduleOptions, QuerySchedulesOptions, Schedule, ScheduleCancelledEnvelope, ScheduleClonedEnvelope, ScheduleCreatedEnvelope, ScheduleUpdatedEnvelope, SchedulesQueryBuilder, UpdateSchedule, UpdateScheduleApplicationErrors, UpdateScheduleOptions, cancelSchedule, createSchedule, getSchedule, onScheduleCancelled, onScheduleCloned, onScheduleCreated, onScheduleUpdated, querySchedules, updateSchedule };
96
+ export { CancelScheduleApplicationErrors, CancelScheduleOptions, CancelScheduleResponse, CreateScheduleOptions, CursorQuery, GetScheduleOptions, QuerySchedulesOptions, Schedule, ScheduleCancelledEnvelope, ScheduleClonedEnvelope, ScheduleCreatedEnvelope, ScheduleUpdatedEnvelope, SchedulesQueryBuilder, UpdateSchedule, UpdateScheduleApplicationErrors, UpdateScheduleOptions, cancelSchedule, createSchedule, getSchedule, onScheduleCancelled, onScheduleCloned, onScheduleCreated, onScheduleUpdated, querySchedules, updateSchedule };
@@ -482,6 +482,32 @@ function querySchedules2(options) {
482
482
  transformationPaths: {}
483
483
  });
484
484
  }
485
+ async function typedQuerySchedules(query, options) {
486
+ const { httpClient, sideEffects } = arguments[2];
487
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
488
+ query,
489
+ ...options
490
+ });
491
+ const reqOpts = querySchedules(payload);
492
+ sideEffects?.onSiteCall?.();
493
+ try {
494
+ const result = await httpClient.request(reqOpts);
495
+ sideEffects?.onSuccess?.(result);
496
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
497
+ } catch (err) {
498
+ const transformedError = (0, import_transform_error.transformError)(
499
+ err,
500
+ {
501
+ spreadPathsToArguments: {},
502
+ explicitPathsToArguments: { query: "$[0]" },
503
+ singleArgumentUnchanged: false
504
+ },
505
+ ["query", "options"]
506
+ );
507
+ sideEffects?.onError?.(err);
508
+ throw transformedError;
509
+ }
510
+ }
485
511
  async function createSchedule2(schedule, options) {
486
512
  const { httpClient, sideEffects } = arguments[2];
487
513
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
@@ -588,6 +614,14 @@ function querySchedules3(httpClient) {
588
614
  { httpClient }
589
615
  );
590
616
  }
617
+ function typedQuerySchedules2(httpClient) {
618
+ return (query, options) => typedQuerySchedules(
619
+ query,
620
+ options,
621
+ // @ts-ignore
622
+ { httpClient }
623
+ );
624
+ }
591
625
  function createSchedule3(httpClient) {
592
626
  return (schedule, options) => createSchedule2(
593
627
  schedule,
@@ -681,11 +715,23 @@ var onScheduleUpdated = (0, import_sdk_types.EventDefinition)(
681
715
  // src/calendar-v3-schedule-schedules.context.ts
682
716
  var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
683
717
  var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
718
+ var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
719
+ function customQuerySchedules(httpClient) {
720
+ const router = (0, import_query_method_router.createQueryOverloadRouter)({
721
+ builderQueryFunction: (options) => querySchedules3(httpClient)(options),
722
+ typedQueryFunction: (query, options) => typedQuerySchedules2(httpClient)(query, options),
723
+ hasOptionsParameter: true
724
+ });
725
+ function overloadedQuery(queryOrOptions, options) {
726
+ return router(...arguments);
727
+ }
728
+ return overloadedQuery;
729
+ }
684
730
  var getSchedule4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getSchedule3);
685
- var querySchedules4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(querySchedules3);
686
731
  var createSchedule4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createSchedule3);
687
732
  var updateSchedule4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateSchedule3);
688
733
  var cancelSchedule4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(cancelSchedule3);
734
+ var querySchedules4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQuerySchedules);
689
735
  var onScheduleCancelled2 = (0, import_event_definition_modules.createEventModule)(
690
736
  onScheduleCancelled
691
737
  );