@wix/auto_sdk_calendar_schedules 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,3 +1,5 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
1
3
  /**
2
4
  * A collection of [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/event-object)
3
5
  * associated with a specific entity, such as a
@@ -270,6 +272,8 @@ declare enum IdentityType {
270
272
  UNKNOWN = "UNKNOWN",
271
273
  WIX_USER = "WIX_USER"
272
274
  }
275
+ /** @enumType */
276
+ type IdentityTypeWithLiterals = IdentityType | 'UNKNOWN' | 'WIX_USER';
273
277
  declare enum Role {
274
278
  UNKNOWN_ROLE = "UNKNOWN_ROLE",
275
279
  /** Full read and write access. */
@@ -1408,6 +1412,16 @@ declare enum WebhookIdentityType {
1408
1412
  }
1409
1413
  /** @enumType */
1410
1414
  type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
1415
+ type UpdateScheduleApplicationErrors = {
1416
+ code?: 'UPDATE_CANCELLED_SCHEDULE_NOT_ALLOWED';
1417
+ description?: string;
1418
+ data?: Record<string, any>;
1419
+ };
1420
+ type CancelScheduleApplicationErrors = {
1421
+ code?: 'SCHEDULE_ALREADY_CANCELLED';
1422
+ description?: string;
1423
+ data?: Record<string, any>;
1424
+ };
1411
1425
  interface BaseEventMetadata {
1412
1426
  /**
1413
1427
  * App instance ID.
@@ -1456,18 +1470,116 @@ interface ScheduleCancelledEnvelope {
1456
1470
  data: ScheduleCancelled;
1457
1471
  metadata: EventMetadata;
1458
1472
  }
1473
+ /**
1474
+ * Triggered when a schedule is canceled.
1475
+ * @permissionScope Read Calendar - Including PI
1476
+ * @permissionScopeId SCOPE.DC-CALENDAR.READ-PI
1477
+ * @permissionScope Manage Calendars
1478
+ * @permissionScopeId SCOPE.DC-CALENDAR.MANAGE
1479
+ * @permissionScope Manage Bookings
1480
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1481
+ * @permissionScope Read Bookings - Including Participants
1482
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1483
+ * @permissionScope Manage Bookings - all permissions
1484
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1485
+ * @permissionScope Read bookings calendar - including participants
1486
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-CALENDAR-WITH-PARTICIPANTS
1487
+ * @permissionId CALENDAR.SCHEDULE_READ_PI
1488
+ * @webhook
1489
+ * @eventType wix.calendar.v3.schedule_cancelled
1490
+ * @serviceIdentifier wix.calendar.schedules.v3.SchedulesService
1491
+ * @slug cancelled
1492
+ */
1493
+ declare function onScheduleCancelled(handler: (event: ScheduleCancelledEnvelope) => void | Promise<void>): void;
1459
1494
  interface ScheduleClonedEnvelope {
1460
1495
  data: ScheduleCloned;
1461
1496
  metadata: EventMetadata;
1462
1497
  }
1498
+ /**
1499
+ * Triggered when a schedule is cloned.
1500
+ * @permissionScope Read Calendar - Including PI
1501
+ * @permissionScopeId SCOPE.DC-CALENDAR.READ-PI
1502
+ * @permissionScope Manage Calendars
1503
+ * @permissionScopeId SCOPE.DC-CALENDAR.MANAGE
1504
+ * @permissionScope Manage Bookings
1505
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1506
+ * @permissionScope Read Bookings - Including Participants
1507
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1508
+ * @permissionScope Manage Bookings - all permissions
1509
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1510
+ * @permissionScope Read bookings calendar - including participants
1511
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-CALENDAR-WITH-PARTICIPANTS
1512
+ * @permissionId CALENDAR.SCHEDULE_READ_PI
1513
+ * @webhook
1514
+ * @eventType wix.calendar.v3.schedule_cloned
1515
+ * @serviceIdentifier wix.calendar.schedules.v3.SchedulesService
1516
+ * @slug cloned
1517
+ */
1518
+ declare function onScheduleCloned(handler: (event: ScheduleClonedEnvelope) => void | Promise<void>): void;
1463
1519
  interface ScheduleCreatedEnvelope {
1464
1520
  entity: Schedule;
1465
1521
  metadata: EventMetadata;
1466
1522
  }
1523
+ /**
1524
+ * Triggered when a schedule is created.
1525
+ * @permissionScope Read Calendar - Including PI
1526
+ * @permissionScopeId SCOPE.DC-CALENDAR.READ-PI
1527
+ * @permissionScope Manage Calendars
1528
+ * @permissionScopeId SCOPE.DC-CALENDAR.MANAGE
1529
+ * @permissionScope Manage Bookings
1530
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1531
+ * @permissionScope Read Bookings - Including Participants
1532
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1533
+ * @permissionScope Manage Bookings - all permissions
1534
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1535
+ * @permissionScope Read bookings calendar - including participants
1536
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-CALENDAR-WITH-PARTICIPANTS
1537
+ * @permissionId CALENDAR.SCHEDULE_READ_PI
1538
+ * @webhook
1539
+ * @eventType wix.calendar.v3.schedule_created
1540
+ * @serviceIdentifier wix.calendar.schedules.v3.SchedulesService
1541
+ * @slug created
1542
+ */
1543
+ declare function onScheduleCreated(handler: (event: ScheduleCreatedEnvelope) => void | Promise<void>): void;
1467
1544
  interface ScheduleUpdatedEnvelope {
1468
1545
  entity: Schedule;
1469
1546
  metadata: EventMetadata;
1470
1547
  }
1548
+ /**
1549
+ * Triggered when a schedule is updated.
1550
+ * @permissionScope Read Calendar - Including PI
1551
+ * @permissionScopeId SCOPE.DC-CALENDAR.READ-PI
1552
+ * @permissionScope Manage Calendars
1553
+ * @permissionScopeId SCOPE.DC-CALENDAR.MANAGE
1554
+ * @permissionScope Manage Bookings
1555
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
1556
+ * @permissionScope Read Bookings - Including Participants
1557
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
1558
+ * @permissionScope Manage Bookings - all permissions
1559
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
1560
+ * @permissionScope Read bookings calendar - including participants
1561
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-CALENDAR-WITH-PARTICIPANTS
1562
+ * @permissionId CALENDAR.SCHEDULE_READ_PI
1563
+ * @webhook
1564
+ * @eventType wix.calendar.v3.schedule_updated
1565
+ * @serviceIdentifier wix.calendar.schedules.v3.SchedulesService
1566
+ * @slug updated
1567
+ */
1568
+ declare function onScheduleUpdated(handler: (event: ScheduleUpdatedEnvelope) => void | Promise<void>): void;
1569
+ type ScheduleNonNullablePaths = `status` | `defaultLocation.type` | `defaultConferencingDetails.type` | `permissions` | `permissions.${number}.identity.wixUserId` | `permissions.${number}.role`;
1570
+ /**
1571
+ * Retrieves a schedule.
1572
+ * @param scheduleId - ID of the schedule to retrieve.
1573
+ * @public
1574
+ * @requiredField scheduleId
1575
+ * @permissionId CALENDAR.SCHEDULE_READ
1576
+ * @permissionId CALENDAR.SCHEDULE_READ_PI
1577
+ * @applicableIdentity APP
1578
+ * @applicableIdentity VISITOR
1579
+ * @returns Retrieved schedule.
1580
+ * @fqn wix.calendar.schedules.v3.SchedulesService.GetSchedule
1581
+ */
1582
+ declare function getSchedule(scheduleId: string, options?: GetScheduleOptions): Promise<NonNullablePaths<Schedule, ScheduleNonNullablePaths>>;
1471
1583
  interface GetScheduleOptions {
1472
1584
  /**
1473
1585
  * Information about which fields containing personal data to return. Refer to the
@@ -1484,6 +1596,31 @@ interface GetScheduleOptions {
1484
1596
  */
1485
1597
  fields?: RequestedFieldsWithLiterals[];
1486
1598
  }
1599
+ /**
1600
+ * Creates a query to retrieve a list of schedules.
1601
+ *
1602
+ * The `querySchedules()` function builds a query to retrieve a list of tip settings and returns a `SchedulesQueryBuilder` object.
1603
+ *
1604
+ * 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.
1605
+ *
1606
+ * 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.
1607
+ *
1608
+ * `querySchedules()` runs with the following `SchedulesQueryBuilder` default that you can override:
1609
+ *
1610
+ * + `limit` is `50`.
1611
+ * + Sorted by `id` in ascending order.
1612
+ *
1613
+ * 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"`.
1614
+ *
1615
+ * 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`.
1616
+ * @public
1617
+ * @permissionId CALENDAR.SCHEDULE_READ
1618
+ * @permissionId CALENDAR.SCHEDULE_READ_PI
1619
+ * @applicableIdentity APP
1620
+ * @applicableIdentity VISITOR
1621
+ * @fqn wix.calendar.schedules.v3.SchedulesService.QuerySchedules
1622
+ */
1623
+ declare function querySchedules(options?: QuerySchedulesOptions): SchedulesQueryBuilder;
1487
1624
  interface QuerySchedulesOptions {
1488
1625
  /**
1489
1626
  * Information about which fields containing personal data to return. Refer to the
@@ -1525,6 +1662,29 @@ interface SchedulesQueryBuilder {
1525
1662
  skipTo: (cursor: string) => SchedulesQueryBuilder;
1526
1663
  find: () => Promise<SchedulesQueryResult>;
1527
1664
  }
1665
+ /**
1666
+ * Creates a schedule.
1667
+ *
1668
+ *
1669
+ * If you want the schedule's events to appear in the
1670
+ * [Bookings calendar](https://support.wix.com/en/article/wix-bookings-about-the-wix-booking-calendar),
1671
+ * you must set `appId` to the ID of the Wix Bookings app by providing
1672
+ * `{"appId": "13d21c63-b5ec-5912-8397-c3a5ddb27a97"}`.
1673
+ * @param schedule - Schedule to create.
1674
+ * @public
1675
+ * @requiredField schedule
1676
+ * @requiredField schedule.defaultConferencingDetails.guestUrl
1677
+ * @requiredField schedule.defaultConferencingDetails.hostUrl
1678
+ * @requiredField schedule.defaultConferencingDetails.type
1679
+ * @requiredField schedule.defaultLocation.type
1680
+ * @requiredField schedule.permissions.identity
1681
+ * @requiredField schedule.permissions.role
1682
+ * @permissionId CALENDAR.SCHEDULE_CREATE
1683
+ * @applicableIdentity APP
1684
+ * @returns Created schedule.
1685
+ * @fqn wix.calendar.schedules.v3.SchedulesService.CreateSchedule
1686
+ */
1687
+ declare function createSchedule(schedule: NonNullablePaths<Schedule, `defaultConferencingDetails.guestUrl` | `defaultConferencingDetails.hostUrl` | `defaultConferencingDetails.type` | `defaultLocation.type` | `permissions.${number}.identity` | `permissions.${number}.role`>, options?: CreateScheduleOptions): Promise<NonNullablePaths<Schedule, ScheduleNonNullablePaths>>;
1528
1688
  interface CreateScheduleOptions {
1529
1689
  /**
1530
1690
  * Idempotency key guaranteeing that you don't create the same schedule more
@@ -1533,6 +1693,30 @@ interface CreateScheduleOptions {
1533
1693
  */
1534
1694
  idempotencyKey?: string | null;
1535
1695
  }
1696
+ /**
1697
+ * Updates a schedule.
1698
+ *
1699
+ *
1700
+ * Each time the schedule is updated,
1701
+ * `revision` increments by 1.
1702
+ * The current `revision` must be passed when updating the schedule.
1703
+ * This ensures you're working with the latest schedule
1704
+ * and prevents unintended overwrites.
1705
+ * @param _id - Schedule ID.
1706
+ * @public
1707
+ * @requiredField _id
1708
+ * @requiredField schedule
1709
+ * @requiredField schedule.permissions.identity
1710
+ * @requiredField schedule.permissions.role
1711
+ * @requiredField schedule.revision
1712
+ * @permissionId CALENDAR.SCHEDULE_UPDATE
1713
+ * @applicableIdentity APP
1714
+ * @returns Updated schedule.
1715
+ * @fqn wix.calendar.schedules.v3.SchedulesService.UpdateSchedule
1716
+ */
1717
+ declare function updateSchedule(_id: string, schedule: NonNullablePaths<UpdateSchedule, `permissions.${number}.identity` | `permissions.${number}.role` | `revision`>, options?: UpdateScheduleOptions): Promise<NonNullablePaths<Schedule, ScheduleNonNullablePaths> & {
1718
+ __applicationErrorsType?: UpdateScheduleApplicationErrors;
1719
+ }>;
1536
1720
  interface UpdateSchedule {
1537
1721
  /**
1538
1722
  * Schedule ID.
@@ -1665,6 +1849,26 @@ interface UpdateScheduleOptions {
1665
1849
  */
1666
1850
  participantNotification?: ParticipantNotification;
1667
1851
  }
1852
+ /**
1853
+ * Sets a schedule's `status` to `CANCELLED`.
1854
+ *
1855
+ *
1856
+ * Also cancels future events belonging to the schedule.
1857
+ *
1858
+ * Once a schedule is marked as `CANCELLED`, you can't reactivate it, update it,
1859
+ * or assign new events.
1860
+ * @param scheduleId - ID of the schedule to cancel.
1861
+ * @public
1862
+ * @requiredField scheduleId
1863
+ * @permissionId CALENDAR.SCHEDULE_CANCEL
1864
+ * @applicableIdentity APP
1865
+ * @fqn wix.calendar.schedules.v3.SchedulesService.CancelSchedule
1866
+ */
1867
+ declare function cancelSchedule(scheduleId: string, options?: CancelScheduleOptions): Promise<NonNullablePaths<CancelScheduleResponse, {
1868
+ [P in ScheduleNonNullablePaths]: `schedule.${P}`;
1869
+ }[ScheduleNonNullablePaths]> & {
1870
+ __applicationErrorsType?: CancelScheduleApplicationErrors;
1871
+ }>;
1668
1872
  interface CancelScheduleOptions {
1669
1873
  /**
1670
1874
  * Whether to preserve future events with participants.
@@ -1678,4 +1882,4 @@ interface CancelScheduleOptions {
1678
1882
  participantNotification?: ParticipantNotification;
1679
1883
  }
1680
1884
 
1681
- export { type ScheduleCancelled as $, type QuerySchedulesResponse as A, type CursorPagingMetadata as B, type CreateScheduleOptions as C, DeleteStatus as D, type ExtendedFields as E, type Cursors as F, type GetScheduleOptions as G, type CreateScheduleRequest as H, IdentityType as I, type CreateScheduleResponse as J, type UpdateScheduleRequest as K, LocationType as L, type ParticipantNotification as M, Namespace as N, type UpdateScheduleResponse as O, PlacementType as P, type QuerySchedulesOptions as Q, Role as R, type Schedule as S, Type as T, type UpdateSchedule as U, type ScheduleUpdatedWithMetadata as V, WebhookIdentityType as W, type CloneScheduleRequest as X, type CloneScheduleResponse as Y, type ScheduleCloned as Z, type CancelScheduleRequest as _, type SchedulesQueryBuilder as a, type MetaSiteSpecialEvent as a0, type MetaSiteSpecialEventPayloadOneOf as a1, type Asset as a2, type SiteCreated as a3, type SiteTransferred as a4, type SiteDeleted as a5, type DeleteContext as a6, type SiteUndeleted as a7, type SitePublished as a8, type SiteUnpublished as a9, type SpecialHourPeriod as aA, type Multilingual as aB, type SupportedLanguage as aC, type ConsentPolicy as aD, type Translation as aE, type ChangeContext as aF, type ChangeContextPayloadOneOf as aG, type PropertiesChange as aH, type V4SiteCreated as aI, type SiteCloned as aJ, type DomainEvent as aK, type DomainEventBodyOneOf as aL, type EntityCreatedEvent as aM, type RestoreInfo as aN, type EntityUpdatedEvent as aO, type EntityDeletedEvent as aP, type ActionEvent as aQ, type MessageEnvelope as aR, type IdentificationData as aS, type IdentificationDataIdOneOf as aT, type BaseEventMetadata as aU, type EventMetadata as aV, type SchedulesQueryResult as aW, type SiteMarkedAsTemplate as aa, type SiteMarkedAsWixSite as ab, type ServiceProvisioned as ac, type ServiceRemoved as ad, type SiteRenamed as ae, type SiteHardDeleted as af, type NamespaceChanged as ag, type StudioAssigned as ah, type StudioUnassigned as ai, type SiteUrlChanged as aj, type SitePurgedExternally as ak, type OdeditorAssigned as al, type OdeditorUnassigned as am, type PicassoAssigned as an, type PicassoUnassigned as ao, type Empty as ap, type SitePropertiesNotification as aq, type SitePropertiesEvent as ar, type Properties as as, type Categories as at, type Locale as au, type Address as av, type AddressHint as aw, type GeoCoordinates as ax, type BusinessSchedule as ay, type TimePeriod as az, type UpdateScheduleOptions as b, type CancelScheduleOptions as c, type CancelScheduleResponse as d, type ScheduleCancelledEnvelope as e, type ScheduleClonedEnvelope as f, type ScheduleCreatedEnvelope as g, type ScheduleUpdatedEnvelope as h, Status as i, RequestedFields as j, Trigger as k, State as l, SiteCreatedContext as m, DayOfWeek as n, ResolutionMethod as o, type Location as p, type ConferencingDetails as q, type Permission as r, type CommonIdentificationData as s, type CommonIdentificationDataIdOneOf as t, type GetScheduleRequest as u, type GetScheduleResponse as v, type QuerySchedulesRequest as w, type CursorQuery as x, type CursorQueryPagingMethodOneOf as y, type CursorPaging as z };
1885
+ export { type ActionEvent, type Address, type AddressHint, type Asset, type BaseEventMetadata, type BusinessSchedule, type CancelScheduleApplicationErrors, type CancelScheduleOptions, type CancelScheduleRequest, type CancelScheduleResponse, type Categories, type ChangeContext, type ChangeContextPayloadOneOf, type CloneScheduleRequest, type CloneScheduleResponse, type CommonIdentificationData, type CommonIdentificationDataIdOneOf, type ConferencingDetails, type ConsentPolicy, type CreateScheduleOptions, type CreateScheduleRequest, type CreateScheduleResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, DayOfWeek, type DayOfWeekWithLiterals, type DeleteContext, DeleteStatus, type DeleteStatusWithLiterals, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, type GeoCoordinates, type GetScheduleOptions, type GetScheduleRequest, type GetScheduleResponse, type IdentificationData, type IdentificationDataIdOneOf, IdentityType, type IdentityTypeWithLiterals, type Locale, type Location, LocationType, type LocationTypeWithLiterals, type MessageEnvelope, type MetaSiteSpecialEvent, type MetaSiteSpecialEventPayloadOneOf, type Multilingual, Namespace, type NamespaceChanged, type NamespaceWithLiterals, type OdeditorAssigned, type OdeditorUnassigned, type ParticipantNotification, type Permission, type PicassoAssigned, type PicassoUnassigned, PlacementType, type PlacementTypeWithLiterals, type Properties, type PropertiesChange, type QuerySchedulesOptions, type QuerySchedulesRequest, type QuerySchedulesResponse, RequestedFields, type RequestedFieldsWithLiterals, ResolutionMethod, type ResolutionMethodWithLiterals, type RestoreInfo, Role, type RoleWithLiterals, type Schedule, type ScheduleCancelled, type ScheduleCancelledEnvelope, type ScheduleCloned, type ScheduleClonedEnvelope, type ScheduleCreatedEnvelope, type ScheduleUpdatedEnvelope, type ScheduleUpdatedWithMetadata, type SchedulesQueryBuilder, type SchedulesQueryResult, type ServiceProvisioned, type ServiceRemoved, type SiteCloned, type SiteCreated, SiteCreatedContext, type SiteCreatedContextWithLiterals, type SiteDeleted, type SiteHardDeleted, type SiteMarkedAsTemplate, type SiteMarkedAsWixSite, type SitePropertiesEvent, type SitePropertiesNotification, type SitePublished, type SitePurgedExternally, type SiteRenamed, type SiteTransferred, type SiteUndeleted, type SiteUnpublished, type SiteUrlChanged, type SpecialHourPeriod, State, type StateWithLiterals, Status, type StatusWithLiterals, type StudioAssigned, type StudioUnassigned, type SupportedLanguage, type TimePeriod, type Translation, Trigger, type TriggerWithLiterals, Type, type TypeWithLiterals, type UpdateSchedule, type UpdateScheduleApplicationErrors, type UpdateScheduleOptions, type UpdateScheduleRequest, type UpdateScheduleResponse, type V4SiteCreated, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, cancelSchedule, createSchedule, getSchedule, onScheduleCancelled, onScheduleCloned, onScheduleCreated, onScheduleUpdated, querySchedules, updateSchedule };