@dv4resi/dvss-backend-module-calendar-im 0.0.6 → 0.0.8

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.
package/dist/index.d.ts CHANGED
@@ -1181,7 +1181,9 @@ declare enum GET_PAYMENTS_SORTING_ENUM {
1181
1181
  DATE = "DATE",
1182
1182
  AMOUNT = "AMOUNT",
1183
1183
  NOTES = "NOTES",
1184
- PAYMENT_MODE = "PAYMENT_MODE"
1184
+ PAYMENT_MODE = "PAYMENT_MODE",
1185
+ CREATED_TIME = "CREATED_TIME",
1186
+ DUE_AMOUNT = "DUE_AMOUNT"
1185
1187
  }
1186
1188
  interface IGetCustomerPaymentsSorting {
1187
1189
  by: GET_PAYMENTS_SORTING_ENUM;
@@ -1609,6 +1611,7 @@ declare enum RECURRING_INVOICE_STATUS {
1609
1611
  interface IRecurringInvoices {
1610
1612
  date: string;
1611
1613
  items: string;
1614
+ category: string;
1612
1615
  itemDescription: string;
1613
1616
  description: string;
1614
1617
  operator: string;
@@ -1740,6 +1743,7 @@ interface IBookingEvent {
1740
1743
  overrideDates?: string[];
1741
1744
  id?: string;
1742
1745
  timeZone?: string;
1746
+ seriesEndDateLabel?: string;
1743
1747
  syncMetadata?: IEventSyncMetadata;
1744
1748
  }
1745
1749
  interface IEventSyncMetadata {
@@ -1781,6 +1785,17 @@ interface IDeleteEventRequest extends IMailboxScope {
1781
1785
  eventId: string;
1782
1786
  resourceEmail: string;
1783
1787
  }
1788
+ interface IGetCalendarEventRequest extends IMailboxScope {
1789
+ eventId: string;
1790
+ resourceId: string;
1791
+ expandSeriesExceptions?: boolean;
1792
+ }
1793
+ interface IAcceptEventRequest extends IMailboxScope {
1794
+ eventId: string;
1795
+ resourceEmail: string;
1796
+ sendResponse?: boolean;
1797
+ comment?: string;
1798
+ }
1784
1799
  interface IGetEventsRequest extends IMailboxScope {
1785
1800
  resourceEmail: string;
1786
1801
  startDateLabel?: string;
@@ -1797,6 +1812,9 @@ interface IBookingEventInstance {
1797
1812
  id: string;
1798
1813
  startDateLabel: string;
1799
1814
  seriesId?: string;
1815
+ iCalUId?: string;
1816
+ transactionId?: string;
1817
+ subject?: string;
1800
1818
  }
1801
1819
  interface IGetEventsResponse {
1802
1820
  events: IBookingEventInstance[];
@@ -1806,7 +1824,7 @@ interface IBookingManagementContext {
1806
1824
  loggedInUserId: bigint;
1807
1825
  }
1808
1826
 
1809
- interface IWebhookSubscription {
1827
+ interface ICalendarWebhookSubscription {
1810
1828
  id?: string;
1811
1829
  resource: string;
1812
1830
  changeTypes: string[];
@@ -1819,18 +1837,51 @@ interface IRegisterWebhookRequest {
1819
1837
  resource: string;
1820
1838
  changeTypes: string[];
1821
1839
  notificationUrl: string;
1840
+ lifecycleNotificationUrl?: string;
1822
1841
  expirationDateTime: string;
1823
1842
  clientState?: string;
1824
1843
  }
1844
+ interface IGraphBatchRequestItem {
1845
+ id: string;
1846
+ method: 'POST' | 'PATCH' | 'DELETE' | 'GET';
1847
+ url: string;
1848
+ body?: Record<string, unknown>;
1849
+ headers?: Record<string, string>;
1850
+ dependsOn?: string[];
1851
+ }
1852
+ interface IGraphBatchRequest {
1853
+ requests: IGraphBatchRequestItem[];
1854
+ }
1855
+ interface IGraphBatchResponseItem {
1856
+ id: string;
1857
+ status: number;
1858
+ body?: Record<string, unknown>;
1859
+ }
1860
+ interface IGraphBatchResponse {
1861
+ responses: IGraphBatchResponseItem[];
1862
+ }
1863
+ interface IBatchRefreshWebhookItem {
1864
+ requestId: string;
1865
+ subscriptionId: string;
1866
+ expirationDateTime: string;
1867
+ }
1868
+ interface IBatchRefreshWebhookResult {
1869
+ requestId: string;
1870
+ subscriptionId: string;
1871
+ success: boolean;
1872
+ subscription?: ICalendarWebhookSubscription;
1873
+ status?: number;
1874
+ error?: string;
1875
+ }
1825
1876
  interface IRegisterWebhookResponse {
1826
- subscription: IWebhookSubscription;
1877
+ subscription: ICalendarWebhookSubscription;
1827
1878
  }
1828
1879
  interface IRefreshWebhookRequest {
1829
1880
  subscriptionId: string;
1830
1881
  expirationDateTime: string;
1831
1882
  }
1832
1883
  interface IRefreshWebhookResponse {
1833
- subscription: IWebhookSubscription;
1884
+ subscription: ICalendarWebhookSubscription;
1834
1885
  }
1835
1886
  interface IDeleteWebhookRequest {
1836
1887
  subscriptionId: string;
@@ -2115,6 +2166,8 @@ declare abstract class BaseCalendarBookingManagement {
2115
2166
  abstract cancelEvent(request: ICancelEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
2116
2167
  abstract deleteEvent(request: IDeleteEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
2117
2168
  abstract getEvents(request: IGetEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
2169
+ abstract getEvent?(request: IGetCalendarEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IBookingEventRef>;
2170
+ abstract acceptEvent?(request: IAcceptEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
2118
2171
  }
2119
2172
 
2120
2173
  declare abstract class BaseCalendarWebhookManagement {
@@ -2342,6 +2395,10 @@ interface IMicrosoftGraphEvent {
2342
2395
  };
2343
2396
  showAs?: string;
2344
2397
  isCancelled?: boolean;
2398
+ type?: string;
2399
+ seriesMasterId?: string;
2400
+ transactionId?: string;
2401
+ iCalUId?: string;
2345
2402
  recurrence?: IMicrosoftGraphRecurrence;
2346
2403
  attendees?: IMicrosoftGraphAttendee[];
2347
2404
  organizer?: {
@@ -2350,11 +2407,20 @@ interface IMicrosoftGraphEvent {
2350
2407
  name?: string;
2351
2408
  };
2352
2409
  };
2353
- seriesMasterId?: string;
2354
- type?: string;
2410
+ responseStatus?: {
2411
+ response?: string;
2412
+ time?: string;
2413
+ };
2414
+ exceptionOccurrences?: IMicrosoftGraphEvent[];
2415
+ cancelledOccurrences?: string[];
2416
+ '@removed'?: {
2417
+ reason?: string;
2418
+ };
2355
2419
  }
2356
2420
  interface IMicrosoftGraphEventsResponse {
2357
2421
  value?: IMicrosoftGraphEvent[];
2422
+ '@odata.nextLink'?: string;
2423
+ '@odata.deltaLink'?: string;
2358
2424
  }
2359
2425
  interface IMicrosoftGraphErrorBody {
2360
2426
  error?: {
@@ -2367,9 +2433,27 @@ interface IMicrosoftGraphSubscription {
2367
2433
  resource?: string;
2368
2434
  changeType?: string;
2369
2435
  notificationUrl?: string;
2436
+ lifecycleNotificationUrl?: string;
2370
2437
  expirationDateTime?: string;
2371
2438
  clientState?: string;
2372
2439
  }
2440
+ interface IMicrosoftGraphBatchRequest {
2441
+ requests: Array<{
2442
+ id: string;
2443
+ method: string;
2444
+ url: string;
2445
+ body?: Record<string, unknown>;
2446
+ headers?: Record<string, string>;
2447
+ dependsOn?: string[];
2448
+ }>;
2449
+ }
2450
+ interface IMicrosoftGraphBatchResponse {
2451
+ responses: Array<{
2452
+ id: string;
2453
+ status: number;
2454
+ body?: IMicrosoftGraphSubscription | Record<string, unknown>;
2455
+ }>;
2456
+ }
2373
2457
 
2374
2458
  declare class MicrosoftAuthService implements BaseAuth {
2375
2459
  private readonly logger;
@@ -2433,6 +2517,8 @@ declare class MicrosoftCalendarBookingService extends BaseCalendarBookingManagem
2433
2517
  updateEvent(request: IUpdateEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IBookingEventRef>;
2434
2518
  cancelEvent(request: ICancelEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
2435
2519
  deleteEvent(request: IDeleteEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
2520
+ getEvent(request: IGetCalendarEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IBookingEventRef>;
2521
+ acceptEvent(request: IAcceptEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
2436
2522
  getEvents(request: IGetEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
2437
2523
  private deleteGraphEvent;
2438
2524
  private resolveSkipDatesIfAny;
@@ -2451,6 +2537,7 @@ declare class MicrosoftCalendarWebhookService extends BaseCalendarWebhookManagem
2451
2537
  registerWebhook(request: IRegisterWebhookRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IRegisterWebhookResponse>;
2452
2538
  refreshSubscription(request: IRefreshWebhookRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IRefreshWebhookResponse>;
2453
2539
  deleteSubscription(request: IDeleteWebhookRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
2540
+ batchRefreshSubscriptions(items: IBatchRefreshWebhookItem[], integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IBatchRefreshWebhookResult[]>;
2454
2541
  private toGraphSubscription;
2455
2542
  private fromGraphSubscription;
2456
2543
  private collectUnknownGraphFields;
@@ -2474,9 +2561,13 @@ declare const MICROSOFT_GRAPH_PATHS: {
2474
2561
  readonly userCalendarEvents: (mailboxEmail: string) => string;
2475
2562
  readonly userCalendarEvent: (mailboxEmail: string, eventId: string) => string;
2476
2563
  readonly userCalendarView: (mailboxEmail: string, startDateTime: string, endDateTime: string) => string;
2564
+ readonly userCalendarViewDelta: (mailboxEmail: string, startDateTime: string, endDateTime: string) => string;
2565
+ readonly userCalendarEventAccept: (mailboxEmail: string, eventId: string) => string;
2566
+ readonly userCalendarEventDecline: (mailboxEmail: string, eventId: string) => string;
2477
2567
  readonly subscriptions: "/subscriptions";
2478
2568
  readonly subscription: (subscriptionId: string) => string;
2479
2569
  };
2570
+ declare const MICROSOFT_CALENDAR_DELTA_DEFAULT_WINDOW_YEARS = 10;
2480
2571
  declare const MICROSOFT_DEFAULT_GRAPH_BASE_URL = "https://graph.microsoft.com/v1.0";
2481
2572
  declare const MICROSOFT_DEFAULT_AUTH_URL = "https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token";
2482
2573
 
@@ -2502,6 +2593,8 @@ declare abstract class ICalendarBookingHandler {
2502
2593
  abstract cancelCalendarBooking(request: ICancelEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
2503
2594
  abstract deleteCalendarBooking(request: IDeleteEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
2504
2595
  abstract getCalendarBookings(request: IGetEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
2596
+ abstract getCalendarBooking(request: IGetCalendarEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IBookingEventRef>;
2597
+ abstract acceptCalendarBooking(request: IAcceptEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
2505
2598
  }
2506
2599
 
2507
2600
  declare abstract class ICalendarResourceHandler {
@@ -2512,6 +2605,7 @@ declare abstract class ICalendarWebhookHandler {
2512
2605
  abstract registerCalendarWebhook(request: IRegisterWebhookRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IRegisterWebhookResponse>;
2513
2606
  abstract refreshCalendarWebhook(request: IRefreshWebhookRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IRefreshWebhookResponse>;
2514
2607
  abstract deleteCalendarWebhook(request: IDeleteWebhookRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
2608
+ batchRefreshCalendarWebhooks(items: IBatchRefreshWebhookItem[], integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IBatchRefreshWebhookResult[]>;
2515
2609
  }
2516
2610
 
2517
2611
  declare abstract class ICalendarAuthHandler {
@@ -2535,6 +2629,8 @@ declare class MicrosoftCalendarBookingHandler extends ICalendarBookingHandler {
2535
2629
  cancelCalendarBooking(request: ICancelEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
2536
2630
  deleteCalendarBooking(request: IDeleteEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
2537
2631
  getCalendarBookings(request: IGetEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
2632
+ getCalendarBooking(request: IGetCalendarEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IBookingEventRef>;
2633
+ acceptCalendarBooking(request: IAcceptEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
2538
2634
  }
2539
2635
 
2540
2636
  declare class MicrosoftCalendarResourceHandler extends ICalendarResourceHandler {
@@ -2549,6 +2645,7 @@ declare class MicrosoftCalendarWebhookHandler extends ICalendarWebhookHandler {
2549
2645
  registerCalendarWebhook(request: IRegisterWebhookRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IRegisterWebhookResponse>;
2550
2646
  refreshCalendarWebhook(request: IRefreshWebhookRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IRefreshWebhookResponse>;
2551
2647
  deleteCalendarWebhook(request: IDeleteWebhookRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
2648
+ batchRefreshCalendarWebhooks(items: IBatchRefreshWebhookItem[], integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IBatchRefreshWebhookResult[]>;
2552
2649
  }
2553
2650
 
2554
2651
  declare class MicrosoftCalendarAuthHandler extends ICalendarAuthHandler {
@@ -2593,4 +2690,4 @@ declare class CalendarIntegrationConfigurationAdapterFactory extends AdapterFact
2593
2690
  constructor(microsoftCalendarIntegrationConfigurationHandler: MicrosoftCalendarIntegrationConfigurationHandler);
2594
2691
  }
2595
2692
 
2596
- export { type AccountConfig, type ActivityLogAuthor, AdapterFactoryService, BOOKABLE_ITEM_STATUS_ENUM, BOOKABLE_ITEM_TYPE_ENUM, BaseAccessManagement, BaseAccountingContactPersonManagement, BaseAccountingCreditNoteManagement, BaseAccountingCustomerPaymentManagement, BaseAccountingInvoiceManagement, BaseAccountingLOAManagement, BaseAccountingMiscellaneousManagement, BaseAccountingTaxManagement, BaseAuth, BaseCalendarBookingManagement, BaseCalendarResourceManagement, BaseCalendarWebhookManagement, BaseCreditBooking, BaseCustomerManagement, BaseDeviceManagement, BaseIntegrationConfiguration, BaseIntegrationResourceManagement, BaseMembershipCustomerManagement, BaseMembershipManagement, BasePackageManagement, BasePayment, BasePaymentMethodManagement, BasePaymentUserManagement, BaseWellnessManagement, CALENDAR_PROVIDER_ENUM, CREDIT_FILTER_BY_ENUM, CREDIT_NOTE_STATUS, CREDIT_STATUS_ENUM, CREDIT_TYPE_ENUM, CalendarAuthAdapterFactory, CalendarBookingAdapterFactory, CalendarIntegrationConfigurationAdapterFactory, AppModule$2 as CalendarIntegrationManager, CalendarResourceAdapterFactory, CalendarWebhookAdapterFactory, type CapabilityIntegrationCategory, type CustomerActivity, DOWNLOAD_CUSTOMER_ACCOUNTING_STATEMENT_FILTER_BY_ENUM, DOWNLOAD_CUSTOMER_ACCOUNTING_STATEMENT_STATUS_ENUM, type DigitalAsset, EVENT_INSTANCE_KIND, GET_CUSTOMER_CREDIT_NOTES_FILTER_BY, GET_CUSTOMER_CREDIT_NOTES_SORT_BY, GET_INVOICES_FILTER_BY_ENUM, GET_INVOICES_SORT_BY_ENUM, GET_PAYMENTS_FILTER_BY_ENUM, GET_PAYMENTS_FILTER_VALUE_ENUM, GET_PAYMENTS_SORTING_ENUM, GET_RECURRING_INVOICES_SORT_BY_ENUM, type GetCustomerActivitiesInput, type GetFolioActivitiesOptionsInput, HTTP_METHOD, type IAPIResponse, type IAccessProfile, type IAccessProfiles, type IAccountingAPIResponse, type IAccountingInvoice, type IAccountingListAPIPageContext, type IAccountingListAPIResponse, type IAccountingListAPISearchCriteria, type IAccounts, type IAddCapIntegResourceMapping, type IAddCapabilityIntegration, type IAddCapabilityIntegrationConfig, type IAddCapabilityIntegrationConfiguredFor, type IAddCapabilityIntegrationInput, type IAddCapabilityIntegrationMappingResponse, type IAddCustomerContactPersonRequest, type IAddCustomerRequest, type IAddItemToOrderItemConfig, type IAddItemToOrderRequest, type IAddItemToOrderResponse, type IAddPaymentToOrderRequest, type IAddResourceToIntegrationInput, type IAddResourceToIntegrationResponse, type IAddUpdateAccessGroupRequest, type IAdminCredentials, type IApiCallRequest, type IApplyCreditNoteForInvoicesRequest, type IAvailableDateWithSlots, type IAvailableTaxes, type IAvailableTimeSlot, type IBookableItem, type IBookableItemCategory, type IBookableItemMedia, type IBookableItemPrice, type IBookableItemPriceMeta, type IBookingEvent, type IBookingEventInstance, type IBookingEventRef, type IBookingItem, type IBookingItemResource, type IBookingManagementContext, ICalendarAuthHandler, ICalendarBookingHandler, ICalendarIntegrationConfigurationHandler, ICalendarResourceHandler, ICalendarWebhookHandler, type ICancelEventRequest, type ICapabilityIntegration, type ICapabilityIntegrationConfig, type ICapabilityIntegrationResourceMapping, type ICapabilityIntegrationResourceMappingRow, type IConfiguration, type ICreateCreditNoteForInvoiceRequest, type ICreateCustomerPaymentRequest, type ICreateEventRequest, type ICreateOrderRequest, type ICreateOrderResponse, type ICreateRecurringInvoiceLineItem, type ICreateRecurringInvoiceRequest, type ICreateRecurringInvoiceResponse, type ICreateRefundRequest, type ICredit, type ICreditNoteAppliedInvoice, type ICreditNoteOperator, type ICurrency, type ICustomer, type ICustomerAddionalDetails, type ICustomerContactPerson, type ICustomerContactPersonResponse, type ICustomerCreditNote, type ICustomerCreditNoteDetail, type ICustomerLastCheckIn, type ICustomerPaymentDetails, type ICustomerPaymentRecord, type ICustomerRole, type ICustomerStatusResponse, type IDeleteAPIResponse, type IDeleteCustomerContactPersonRequest, type IDeleteDeviceInput, type IDeleteDeviceResponse, type IDeleteEventRequest, type IDeleteWebhookRequest, type IDownloadCustomerAccountingStatementRequest, type IEventSyncMetadata, type IExcludedDateResult, type IFetchOfferingAvailabilityRequest, type IGetAccessProfilesResponse, type IGetAppointmentsRequest, type IGetAvailableDatesAndTimeSlotsResponse, type IGetBookableItemsFromCreditRequest, type IGetCapabilityIntegrationInput, type IGetCapabilityIntegrationResult, type IGetCapabilityIntegrationsFilterInput, type IGetCapabilityIntegrationsOptionsInput, type IGetCapabilityIntegrationsRequest, type IGetCapabilityIntegrationsResponse, type IGetCapabilityIntegrationsSortingInput, type IGetCategoriesRequest, type IGetCoursesRequest, type IGetCreateCustomerPayment, type IGetCreateCustomerPaymentInfo, type IGetCustomerAccessGroupsInput, type IGetCustomerAccessGroupsResponse, type IGetCustomerActivities, type IGetCustomerCreditNotesRequest, type IGetCustomerCreditNotesResponse, type IGetCustomerCreditsRequest, type IGetCustomerCreditsRequestFilters, type IGetCustomerCreditsRequestOptions, type IGetCustomerPayment, type IGetCustomerPaymentRefundInfo, type IGetCustomerPaymentRequest, type IGetCustomerPayments, type IGetCustomerPaymentsFilter, type IGetCustomerPaymentsOptions, type IGetCustomerPaymentsRequest, type IGetCustomerPaymentsSorting, type IGetCustomerRequest, type IGetDeviceKeyInput, type IGetDeviceKeyResponse, type IGetDevicesInput, type IGetDevicesResponse, type IGetEventsRequest, type IGetEventsResponse, type IGetInvoicesOptions, type IGetInvoicesRequest, type IGetOrderResponse, type IGetPractitionersRequest, type IGetRecurringInvoiceInput, type IGetRecurringInvoiceRequest, type IGetRecurringInvoicesOptions, type IGetRecurringInvoicesRequest, type IGetRefundCustomerPayment, type IGetResourcesRequest, type IGetResourcesResponse, type IGetSessionsRequest, type IIcon, type IIntegrationConfigFieldMetadata, type IIntegrationConfigFieldMetadataMap, type IIntegrationConfigJson, type IIntegrationConfigStructureMetadata, type IIntegrationRequestContext, type IIntegrationRequestLog, type IInvoice, type IInvoiceCapabilityIntegration, type IInvoiceCapabilityIntegrationConfig, type IInvoiceIntegrationRequest, type IInvoiceResponse, type IInvoicesResponse, type IKey, type IListUsersInput, type IListUsersResponse, type IMarkCustomerContactPersonPrimaryRequest, type IMicrosoftAccessDetails, type IMicrosoftAccessToken, type IMicrosoftApiCallRequest, type IMicrosoftConfig, type IMicrosoftGraphAttendee, type IMicrosoftGraphDateTimeTimeZone, type IMicrosoftGraphErrorBody, type IMicrosoftGraphEvent, type IMicrosoftGraphEventsResponse, type IMicrosoftGraphRecurrence, type IMicrosoftGraphRecurrencePattern, type IMicrosoftGraphRecurrenceRange, type IMicrosoftGraphRoom, type IMicrosoftGraphRoomsResponse, type IMicrosoftGraphSubscription, type IMicrosoftIntegrationConfig, type IMicrosoftPlatformConfig, type IMicrosoftTokenResponse, INVOICE_STATUS_ENUM, type INonSensitiveStoredField, type IOfferingBookingOccurrence, type IOfferingResource, type IOfferingResourceMedia, type IOrderGuest, type IRecurringInvoices, type IRecurringInvoicesResponse, type IRefreshWebhookRequest, type IRefreshWebhookResponse, type IRefundCustomerPayment, type IRegisterDeviceInput, type IRegisterDeviceResponse, type IRegisterWebhookRequest, type IRegisterWebhookResponse, type IRemoveCapabilityIntegrationMappingInput, type IRemoveResourceFromIntegrationRequest, type IRemoveResourceFromIntegrationResponse, type IResource, type IResourceManagementContext, type ISecureStorageWriteOptions, type ISensitiveStoredField, type IStoredConfigField, type ISystemResponse, type ITransactionNumberSeries, type ITransactionNumberSeriesItem, type IUpdateAPIResponse, type IUpdateCapabilityIntegration, type IUpdateCapabilityIntegrationRequest, type IUpdateCapabilityIntegrationResponse, type IUpdateCapabilityIntegrationUpdateData, type IUpdateCustomerContactPersonRequest, type IUpdateCustomerPaymentRequest, type IUpdateCustomerRequest, type IUpdateDeviceCertificateInput, type IUpdateDeviceCertificateResponse, type IUpdateEventRequest, type IUpdateOfferingIntegrationResourceConfigurationInput, type IUpdateOfferingIntegrationResourceConfigurationResponse, type IUpdateOrderRequest, type IUpdateOrderResponse, type IUpdateRecurringInvoiceRequest, type IUpdateRecurringInvoiceResponse, type IUpdateRecurringInvoiceStatusRequest, type IUserAccessGroup, type IValidatedCapabilityIntegration, type IValidatedCapabilityIntegrationConfig, type IWebhookManagementContext, type IWebhookSubscription, type IWellnessManagementRequestOptions, IntegrationBookingDao, IntegrationCommonDao, IntegrationConfigSecureStorageService, IntegrationConfigurationDao, AppModule$1 as IntegrationLibsModule, AppModule as IntegrationMicrosoftModule, IntegrationOnpremDeploymentDao, IntegrationRequestLoggerService, IntegrationResourceManagementDao, IntegrationServiceCommunicationTopicDao, IntegrationSubcapabilityDao, IntegrationUserManagementDao, IntegrationVisitorCredentialMappingDao, type InvoiceAccessDetails, MICROSOFT_CLIENT_CREDENTIALS_GRANT_TYPE, MICROSOFT_DEFAULT_ACCESS_TOKEN_TYPE, MICROSOFT_DEFAULT_AUTH_URL, MICROSOFT_DEFAULT_GRAPH_BASE_URL, MICROSOFT_DEFAULT_GRAPH_SCOPE, MICROSOFT_DEFAULT_HEADERS, MICROSOFT_GRAPH_PATHS, MICROSOFT_SECURE_STORAGE, MICROSOFT_TOKEN_HEADERS, MicrosoftApiClientService, MicrosoftAuthService, MicrosoftCalendarAuthHandler, MicrosoftCalendarBookingHandler, MicrosoftCalendarBookingService, MicrosoftCalendarIntegrationConfigurationHandler, MicrosoftCalendarResourceHandler, MicrosoftCalendarResourceService, MicrosoftCalendarWebhookHandler, MicrosoftCalendarWebhookService, type MicrosoftIntegrationConfigInput, MicrosoftIntegrationConfigurationService, type Note, type NoteAttachment, type NoteChangelog, type NoteChangelogRecord, type NoteResource, type NoteUserIdentity, RECURRING_INVOICE_STATUS, RECURRING_INVOICE_STATUS_ENUM, RateLimiterService, type ResourceAssetMapping, TRAFFIC_ROUTER_CONFIGURATION_STORE_KEY, TrafficGatewayService, type UserIdentity, buildMicrosoftIntegrationConfig, getMicrosoftKmsKeyId, looksLikeStoredSecureConfig };
2693
+ export { type AccountConfig, type ActivityLogAuthor, AdapterFactoryService, BOOKABLE_ITEM_STATUS_ENUM, BOOKABLE_ITEM_TYPE_ENUM, BaseAccessManagement, BaseAccountingContactPersonManagement, BaseAccountingCreditNoteManagement, BaseAccountingCustomerPaymentManagement, BaseAccountingInvoiceManagement, BaseAccountingLOAManagement, BaseAccountingMiscellaneousManagement, BaseAccountingTaxManagement, BaseAuth, BaseCalendarBookingManagement, BaseCalendarResourceManagement, BaseCalendarWebhookManagement, BaseCreditBooking, BaseCustomerManagement, BaseDeviceManagement, BaseIntegrationConfiguration, BaseIntegrationResourceManagement, BaseMembershipCustomerManagement, BaseMembershipManagement, BasePackageManagement, BasePayment, BasePaymentMethodManagement, BasePaymentUserManagement, BaseWellnessManagement, CALENDAR_PROVIDER_ENUM, CREDIT_FILTER_BY_ENUM, CREDIT_NOTE_STATUS, CREDIT_STATUS_ENUM, CREDIT_TYPE_ENUM, CalendarAuthAdapterFactory, CalendarBookingAdapterFactory, CalendarIntegrationConfigurationAdapterFactory, AppModule$2 as CalendarIntegrationManager, CalendarResourceAdapterFactory, CalendarWebhookAdapterFactory, type CapabilityIntegrationCategory, type CustomerActivity, DOWNLOAD_CUSTOMER_ACCOUNTING_STATEMENT_FILTER_BY_ENUM, DOWNLOAD_CUSTOMER_ACCOUNTING_STATEMENT_STATUS_ENUM, type DigitalAsset, EVENT_INSTANCE_KIND, GET_CUSTOMER_CREDIT_NOTES_FILTER_BY, GET_CUSTOMER_CREDIT_NOTES_SORT_BY, GET_INVOICES_FILTER_BY_ENUM, GET_INVOICES_SORT_BY_ENUM, GET_PAYMENTS_FILTER_BY_ENUM, GET_PAYMENTS_FILTER_VALUE_ENUM, GET_PAYMENTS_SORTING_ENUM, GET_RECURRING_INVOICES_SORT_BY_ENUM, type GetCustomerActivitiesInput, type GetFolioActivitiesOptionsInput, HTTP_METHOD, type IAPIResponse, type IAcceptEventRequest, type IAccessProfile, type IAccessProfiles, type IAccountingAPIResponse, type IAccountingInvoice, type IAccountingListAPIPageContext, type IAccountingListAPIResponse, type IAccountingListAPISearchCriteria, type IAccounts, type IAddCapIntegResourceMapping, type IAddCapabilityIntegration, type IAddCapabilityIntegrationConfig, type IAddCapabilityIntegrationConfiguredFor, type IAddCapabilityIntegrationInput, type IAddCapabilityIntegrationMappingResponse, type IAddCustomerContactPersonRequest, type IAddCustomerRequest, type IAddItemToOrderItemConfig, type IAddItemToOrderRequest, type IAddItemToOrderResponse, type IAddPaymentToOrderRequest, type IAddResourceToIntegrationInput, type IAddResourceToIntegrationResponse, type IAddUpdateAccessGroupRequest, type IAdminCredentials, type IApiCallRequest, type IApplyCreditNoteForInvoicesRequest, type IAvailableDateWithSlots, type IAvailableTaxes, type IAvailableTimeSlot, type IBatchRefreshWebhookItem, type IBatchRefreshWebhookResult, type IBookableItem, type IBookableItemCategory, type IBookableItemMedia, type IBookableItemPrice, type IBookableItemPriceMeta, type IBookingEvent, type IBookingEventInstance, type IBookingEventRef, type IBookingItem, type IBookingItemResource, type IBookingManagementContext, ICalendarAuthHandler, ICalendarBookingHandler, ICalendarIntegrationConfigurationHandler, ICalendarResourceHandler, ICalendarWebhookHandler, type ICalendarWebhookSubscription, type ICancelEventRequest, type ICapabilityIntegration, type ICapabilityIntegrationConfig, type ICapabilityIntegrationResourceMapping, type ICapabilityIntegrationResourceMappingRow, type IConfiguration, type ICreateCreditNoteForInvoiceRequest, type ICreateCustomerPaymentRequest, type ICreateEventRequest, type ICreateOrderRequest, type ICreateOrderResponse, type ICreateRecurringInvoiceLineItem, type ICreateRecurringInvoiceRequest, type ICreateRecurringInvoiceResponse, type ICreateRefundRequest, type ICredit, type ICreditNoteAppliedInvoice, type ICreditNoteOperator, type ICurrency, type ICustomer, type ICustomerAddionalDetails, type ICustomerContactPerson, type ICustomerContactPersonResponse, type ICustomerCreditNote, type ICustomerCreditNoteDetail, type ICustomerLastCheckIn, type ICustomerPaymentDetails, type ICustomerPaymentRecord, type ICustomerRole, type ICustomerStatusResponse, type IDeleteAPIResponse, type IDeleteCustomerContactPersonRequest, type IDeleteDeviceInput, type IDeleteDeviceResponse, type IDeleteEventRequest, type IDeleteWebhookRequest, type IDownloadCustomerAccountingStatementRequest, type IEventSyncMetadata, type IExcludedDateResult, type IFetchOfferingAvailabilityRequest, type IGetAccessProfilesResponse, type IGetAppointmentsRequest, type IGetAvailableDatesAndTimeSlotsResponse, type IGetBookableItemsFromCreditRequest, type IGetCalendarEventRequest, type IGetCapabilityIntegrationInput, type IGetCapabilityIntegrationResult, type IGetCapabilityIntegrationsFilterInput, type IGetCapabilityIntegrationsOptionsInput, type IGetCapabilityIntegrationsRequest, type IGetCapabilityIntegrationsResponse, type IGetCapabilityIntegrationsSortingInput, type IGetCategoriesRequest, type IGetCoursesRequest, type IGetCreateCustomerPayment, type IGetCreateCustomerPaymentInfo, type IGetCustomerAccessGroupsInput, type IGetCustomerAccessGroupsResponse, type IGetCustomerActivities, type IGetCustomerCreditNotesRequest, type IGetCustomerCreditNotesResponse, type IGetCustomerCreditsRequest, type IGetCustomerCreditsRequestFilters, type IGetCustomerCreditsRequestOptions, type IGetCustomerPayment, type IGetCustomerPaymentRefundInfo, type IGetCustomerPaymentRequest, type IGetCustomerPayments, type IGetCustomerPaymentsFilter, type IGetCustomerPaymentsOptions, type IGetCustomerPaymentsRequest, type IGetCustomerPaymentsSorting, type IGetCustomerRequest, type IGetDeviceKeyInput, type IGetDeviceKeyResponse, type IGetDevicesInput, type IGetDevicesResponse, type IGetEventsRequest, type IGetEventsResponse, type IGetInvoicesOptions, type IGetInvoicesRequest, type IGetOrderResponse, type IGetPractitionersRequest, type IGetRecurringInvoiceInput, type IGetRecurringInvoiceRequest, type IGetRecurringInvoicesOptions, type IGetRecurringInvoicesRequest, type IGetRefundCustomerPayment, type IGetResourcesRequest, type IGetResourcesResponse, type IGetSessionsRequest, type IGraphBatchRequest, type IGraphBatchRequestItem, type IGraphBatchResponse, type IGraphBatchResponseItem, type IIcon, type IIntegrationConfigFieldMetadata, type IIntegrationConfigFieldMetadataMap, type IIntegrationConfigJson, type IIntegrationConfigStructureMetadata, type IIntegrationRequestContext, type IIntegrationRequestLog, type IInvoice, type IInvoiceCapabilityIntegration, type IInvoiceCapabilityIntegrationConfig, type IInvoiceIntegrationRequest, type IInvoiceResponse, type IInvoicesResponse, type IKey, type IListUsersInput, type IListUsersResponse, type IMarkCustomerContactPersonPrimaryRequest, type IMicrosoftAccessDetails, type IMicrosoftAccessToken, type IMicrosoftApiCallRequest, type IMicrosoftConfig, type IMicrosoftGraphAttendee, type IMicrosoftGraphBatchRequest, type IMicrosoftGraphBatchResponse, type IMicrosoftGraphDateTimeTimeZone, type IMicrosoftGraphErrorBody, type IMicrosoftGraphEvent, type IMicrosoftGraphEventsResponse, type IMicrosoftGraphRecurrence, type IMicrosoftGraphRecurrencePattern, type IMicrosoftGraphRecurrenceRange, type IMicrosoftGraphRoom, type IMicrosoftGraphRoomsResponse, type IMicrosoftGraphSubscription, type IMicrosoftIntegrationConfig, type IMicrosoftPlatformConfig, type IMicrosoftTokenResponse, INVOICE_STATUS_ENUM, type INonSensitiveStoredField, type IOfferingBookingOccurrence, type IOfferingResource, type IOfferingResourceMedia, type IOrderGuest, type IRecurringInvoices, type IRecurringInvoicesResponse, type IRefreshWebhookRequest, type IRefreshWebhookResponse, type IRefundCustomerPayment, type IRegisterDeviceInput, type IRegisterDeviceResponse, type IRegisterWebhookRequest, type IRegisterWebhookResponse, type IRemoveCapabilityIntegrationMappingInput, type IRemoveResourceFromIntegrationRequest, type IRemoveResourceFromIntegrationResponse, type IResource, type IResourceManagementContext, type ISecureStorageWriteOptions, type ISensitiveStoredField, type IStoredConfigField, type ISystemResponse, type ITransactionNumberSeries, type ITransactionNumberSeriesItem, type IUpdateAPIResponse, type IUpdateCapabilityIntegration, type IUpdateCapabilityIntegrationRequest, type IUpdateCapabilityIntegrationResponse, type IUpdateCapabilityIntegrationUpdateData, type IUpdateCustomerContactPersonRequest, type IUpdateCustomerPaymentRequest, type IUpdateCustomerRequest, type IUpdateDeviceCertificateInput, type IUpdateDeviceCertificateResponse, type IUpdateEventRequest, type IUpdateOfferingIntegrationResourceConfigurationInput, type IUpdateOfferingIntegrationResourceConfigurationResponse, type IUpdateOrderRequest, type IUpdateOrderResponse, type IUpdateRecurringInvoiceRequest, type IUpdateRecurringInvoiceResponse, type IUpdateRecurringInvoiceStatusRequest, type IUserAccessGroup, type IValidatedCapabilityIntegration, type IValidatedCapabilityIntegrationConfig, type IWebhookManagementContext, type IWellnessManagementRequestOptions, IntegrationBookingDao, IntegrationCommonDao, IntegrationConfigSecureStorageService, IntegrationConfigurationDao, AppModule$1 as IntegrationLibsModule, AppModule as IntegrationMicrosoftModule, IntegrationOnpremDeploymentDao, IntegrationRequestLoggerService, IntegrationResourceManagementDao, IntegrationServiceCommunicationTopicDao, IntegrationSubcapabilityDao, IntegrationUserManagementDao, IntegrationVisitorCredentialMappingDao, type InvoiceAccessDetails, MICROSOFT_CALENDAR_DELTA_DEFAULT_WINDOW_YEARS, MICROSOFT_CLIENT_CREDENTIALS_GRANT_TYPE, MICROSOFT_DEFAULT_ACCESS_TOKEN_TYPE, MICROSOFT_DEFAULT_AUTH_URL, MICROSOFT_DEFAULT_GRAPH_BASE_URL, MICROSOFT_DEFAULT_GRAPH_SCOPE, MICROSOFT_DEFAULT_HEADERS, MICROSOFT_GRAPH_PATHS, MICROSOFT_SECURE_STORAGE, MICROSOFT_TOKEN_HEADERS, MicrosoftApiClientService, MicrosoftAuthService, MicrosoftCalendarAuthHandler, MicrosoftCalendarBookingHandler, MicrosoftCalendarBookingService, MicrosoftCalendarIntegrationConfigurationHandler, MicrosoftCalendarResourceHandler, MicrosoftCalendarResourceService, MicrosoftCalendarWebhookHandler, MicrosoftCalendarWebhookService, type MicrosoftIntegrationConfigInput, MicrosoftIntegrationConfigurationService, type Note, type NoteAttachment, type NoteChangelog, type NoteChangelogRecord, type NoteResource, type NoteUserIdentity, RECURRING_INVOICE_STATUS, RECURRING_INVOICE_STATUS_ENUM, RateLimiterService, type ResourceAssetMapping, TRAFFIC_ROUTER_CONFIGURATION_STORE_KEY, TrafficGatewayService, type UserIdentity, buildMicrosoftIntegrationConfig, getMicrosoftKmsKeyId, looksLikeStoredSecureConfig };
package/dist/index.js CHANGED
@@ -976,6 +976,8 @@ var GET_PAYMENTS_SORTING_ENUM = /* @__PURE__ */ (function(GET_PAYMENTS_SORTING_E
976
976
  GET_PAYMENTS_SORTING_ENUM2["AMOUNT"] = "AMOUNT";
977
977
  GET_PAYMENTS_SORTING_ENUM2["NOTES"] = "NOTES";
978
978
  GET_PAYMENTS_SORTING_ENUM2["PAYMENT_MODE"] = "PAYMENT_MODE";
979
+ GET_PAYMENTS_SORTING_ENUM2["CREATED_TIME"] = "CREATED_TIME";
980
+ GET_PAYMENTS_SORTING_ENUM2["DUE_AMOUNT"] = "DUE_AMOUNT";
979
981
  return GET_PAYMENTS_SORTING_ENUM2;
980
982
  })({});
981
983
  var EVENT_INSTANCE_KIND = /* @__PURE__ */ (function(EVENT_INSTANCE_KIND2) {
@@ -3523,9 +3525,13 @@ var MICROSOFT_GRAPH_PATHS = {
3523
3525
  userCalendarEvents: /* @__PURE__ */ __name((mailboxEmail) => `/users/${encodeURIComponent(mailboxEmail)}/calendar/events`, "userCalendarEvents"),
3524
3526
  userCalendarEvent: /* @__PURE__ */ __name((mailboxEmail, eventId) => `/users/${encodeURIComponent(mailboxEmail)}/calendar/events/${encodeURIComponent(eventId)}`, "userCalendarEvent"),
3525
3527
  userCalendarView: /* @__PURE__ */ __name((mailboxEmail, startDateTime, endDateTime) => `/users/${encodeURIComponent(mailboxEmail)}/calendarView?startDateTime=${encodeURIComponent(startDateTime)}&endDateTime=${encodeURIComponent(endDateTime)}`, "userCalendarView"),
3528
+ userCalendarViewDelta: /* @__PURE__ */ __name((mailboxEmail, startDateTime, endDateTime) => `/users/${encodeURIComponent(mailboxEmail)}/calendarView/delta?startDateTime=${encodeURIComponent(startDateTime)}&endDateTime=${encodeURIComponent(endDateTime)}`, "userCalendarViewDelta"),
3529
+ userCalendarEventAccept: /* @__PURE__ */ __name((mailboxEmail, eventId) => `/users/${encodeURIComponent(mailboxEmail)}/events/${encodeURIComponent(eventId)}/accept`, "userCalendarEventAccept"),
3530
+ userCalendarEventDecline: /* @__PURE__ */ __name((mailboxEmail, eventId) => `/users/${encodeURIComponent(mailboxEmail)}/events/${encodeURIComponent(eventId)}/decline`, "userCalendarEventDecline"),
3526
3531
  subscriptions: "/subscriptions",
3527
3532
  subscription: /* @__PURE__ */ __name((subscriptionId) => `/subscriptions/${encodeURIComponent(subscriptionId)}`, "subscription")
3528
3533
  };
3534
+ var MICROSOFT_CALENDAR_DELTA_DEFAULT_WINDOW_YEARS = 10;
3529
3535
  var MICROSOFT_DEFAULT_GRAPH_BASE_URL = "https://graph.microsoft.com/v1.0";
3530
3536
  var MICROSOFT_DEFAULT_AUTH_URL = "https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token";
3531
3537
 
@@ -3894,7 +3900,7 @@ function toGraphEvent(event, options) {
3894
3900
  if (event.isRecurring && event.schedule) {
3895
3901
  const recurrence = scheduleToGraphRecurrence(event.schedule, {
3896
3902
  startDate: event.bookingStartDateLabel,
3897
- endDate: event.bookingEndDateLabel
3903
+ endDate: event.seriesEndDateLabel ?? event.bookingEndDateLabel
3898
3904
  });
3899
3905
  if (recurrence) {
3900
3906
  graph.recurrence = recurrence;
@@ -4031,7 +4037,10 @@ function graphEventsToInstances(response) {
4031
4037
  return (response.value ?? []).filter((graph) => Boolean(graph.id && graph.start?.dateTime)).map((graph) => omitUndefined({
4032
4038
  id: graph.id,
4033
4039
  startDateLabel: graph.start.dateTime.slice(0, 10),
4034
- seriesId: graph.seriesMasterId
4040
+ seriesId: graph.seriesMasterId,
4041
+ iCalUId: graph.iCalUId,
4042
+ transactionId: graph.transactionId,
4043
+ subject: graph.subject
4035
4044
  }));
4036
4045
  }
4037
4046
  __name(graphEventsToInstances, "graphEventsToInstances");
@@ -4168,6 +4177,81 @@ exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService
4168
4177
  throw error;
4169
4178
  }
4170
4179
  }
4180
+ async getEvent(request, integration, loggedInUserId) {
4181
+ try {
4182
+ const mailboxEmail = this.pickMailbox(request.organizerUserEmail, request.resourceId);
4183
+ this.assertMailbox(mailboxEmail);
4184
+ this.assertEventId(request.eventId);
4185
+ let url = MICROSOFT_GRAPH_PATHS.userCalendarEvent(mailboxEmail, request.eventId);
4186
+ const queryParams = [];
4187
+ const selectFields = [
4188
+ "id",
4189
+ "seriesMasterId",
4190
+ "type",
4191
+ "subject",
4192
+ "body",
4193
+ "start",
4194
+ "end",
4195
+ "isAllDay",
4196
+ "location",
4197
+ "recurrence",
4198
+ "attendees",
4199
+ "organizer",
4200
+ "isOrganizer",
4201
+ "transactionId",
4202
+ "iCalUId"
4203
+ ];
4204
+ if (request.expandSeriesExceptions) {
4205
+ selectFields.push("cancelledOccurrences");
4206
+ queryParams.push("$expand=exceptionOccurrences");
4207
+ }
4208
+ queryParams.push(`$select=${selectFields.join(",")}`);
4209
+ if (queryParams.length > 0) {
4210
+ url += `?${queryParams.join("&")}`;
4211
+ }
4212
+ this.logger.info(loggedInUserId, this.getEvent.name, this.fileName, "Get Microsoft Graph calendar event", {
4213
+ mailboxEmail,
4214
+ eventId: request.eventId,
4215
+ url
4216
+ });
4217
+ const response = await this.microsoftApiClient.apiCall({
4218
+ apiMethod: HTTP_METHOD.GET,
4219
+ url
4220
+ }, integration, loggedInUserId);
4221
+ return graphEventToRef(response, {
4222
+ resourceId: request.resourceId,
4223
+ organizerUserEmail: this.organizerUserMailbox(request.organizerUserEmail)
4224
+ });
4225
+ } catch (error) {
4226
+ this.logger.error(loggedInUserId, this.getEvent.name, this.fileName, "Error getting Microsoft Graph calendar event", error);
4227
+ throw error;
4228
+ }
4229
+ }
4230
+ async acceptEvent(request, integration, loggedInUserId) {
4231
+ try {
4232
+ const mailboxEmail = this.pickMailbox(request.organizerUserEmail, request.resourceEmail);
4233
+ this.assertMailbox(mailboxEmail);
4234
+ this.assertEventId(request.eventId);
4235
+ this.logger.info(loggedInUserId, this.acceptEvent.name, this.fileName, "Accept Microsoft Graph calendar event", {
4236
+ mailboxEmail,
4237
+ eventId: request.eventId
4238
+ });
4239
+ const shouldSendResponse = request.sendResponse ?? false;
4240
+ await this.microsoftApiClient.apiCall({
4241
+ apiMethod: HTTP_METHOD.POST,
4242
+ url: `${MICROSOFT_GRAPH_PATHS.userCalendarEvent(mailboxEmail, request.eventId)}/accept`,
4243
+ body: {
4244
+ sendResponse: shouldSendResponse,
4245
+ ...shouldSendResponse && request.comment ? {
4246
+ comment: request.comment
4247
+ } : {}
4248
+ }
4249
+ }, integration, loggedInUserId);
4250
+ } catch (error) {
4251
+ this.logger.error(loggedInUserId, this.acceptEvent.name, this.fileName, "Error accepting Microsoft Graph calendar event", error);
4252
+ throw error;
4253
+ }
4254
+ }
4171
4255
  async getEvents(request, integration, loggedInUserId) {
4172
4256
  try {
4173
4257
  const mailboxEmail = this.pickMailbox(request.organizerUserEmail, request.resourceEmail);
@@ -4366,6 +4450,7 @@ var GRAPH_SUBSCRIPTION_KNOWN_KEYS = /* @__PURE__ */ new Set([
4366
4450
  "resource",
4367
4451
  "changeType",
4368
4452
  "notificationUrl",
4453
+ "lifecycleNotificationUrl",
4369
4454
  "expirationDateTime",
4370
4455
  "clientState"
4371
4456
  ]);
@@ -4455,6 +4540,66 @@ exports.MicrosoftCalendarWebhookService = class MicrosoftCalendarWebhookService
4455
4540
  throw error;
4456
4541
  }
4457
4542
  }
4543
+ async batchRefreshSubscriptions(items, integration, loggedInUserId) {
4544
+ if (items.length === 0) {
4545
+ return [];
4546
+ }
4547
+ const batchBody = {
4548
+ requests: items.map((item) => ({
4549
+ id: item.requestId,
4550
+ method: HTTP_METHOD.PATCH,
4551
+ url: MICROSOFT_GRAPH_PATHS.subscription(item.subscriptionId),
4552
+ body: {
4553
+ expirationDateTime: item.expirationDateTime
4554
+ },
4555
+ headers: {
4556
+ ["Content-Type"]: "application/json"
4557
+ }
4558
+ }))
4559
+ };
4560
+ try {
4561
+ this.logger.info(loggedInUserId, this.batchRefreshSubscriptions.name, this.fileName, "Batch refresh Microsoft Graph subscriptions", {
4562
+ count: items.length
4563
+ });
4564
+ const batchResponse = await this.microsoftApiClient.apiCall({
4565
+ apiMethod: HTTP_METHOD.POST,
4566
+ url: "/$batch",
4567
+ body: batchBody
4568
+ }, integration, loggedInUserId);
4569
+ return items.map((item) => {
4570
+ const response = batchResponse.responses.find((entry) => entry.id === item.requestId);
4571
+ if (!response) {
4572
+ return {
4573
+ requestId: item.requestId,
4574
+ subscriptionId: item.subscriptionId,
4575
+ success: false,
4576
+ error: "Missing batch response entry"
4577
+ };
4578
+ }
4579
+ if (response.status >= 200 && response.status < 300) {
4580
+ const subscription = this.fromGraphSubscription(response.body ?? {});
4581
+ return {
4582
+ requestId: item.requestId,
4583
+ subscriptionId: item.subscriptionId,
4584
+ success: true,
4585
+ subscription,
4586
+ status: response.status
4587
+ };
4588
+ }
4589
+ const errorBody = response.body;
4590
+ return {
4591
+ requestId: item.requestId,
4592
+ subscriptionId: item.subscriptionId,
4593
+ success: false,
4594
+ status: response.status,
4595
+ error: errorBody?.error?.message ?? `Graph batch PATCH failed with status ${response.status}`
4596
+ };
4597
+ });
4598
+ } catch (error) {
4599
+ this.logger.error(loggedInUserId, this.batchRefreshSubscriptions.name, this.fileName, "Error batch refreshing subscriptions", error);
4600
+ throw error;
4601
+ }
4602
+ }
4458
4603
  toGraphSubscription(request) {
4459
4604
  const graph = {
4460
4605
  changeType: request.changeTypes.join(","),
@@ -4462,6 +4607,9 @@ exports.MicrosoftCalendarWebhookService = class MicrosoftCalendarWebhookService
4462
4607
  resource: request.resource,
4463
4608
  expirationDateTime: request.expirationDateTime
4464
4609
  };
4610
+ if (request.lifecycleNotificationUrl) {
4611
+ graph.lifecycleNotificationUrl = request.lifecycleNotificationUrl;
4612
+ }
4465
4613
  if (request.clientState !== void 0) {
4466
4614
  graph.clientState = request.clientState;
4467
4615
  }
@@ -4821,6 +4969,12 @@ exports.MicrosoftCalendarBookingHandler = class MicrosoftCalendarBookingHandler
4821
4969
  async getCalendarBookings(request, integration, loggedInUserId) {
4822
4970
  return this.microsoftCalendarBookingService.getEvents(request, integration, loggedInUserId);
4823
4971
  }
4972
+ async getCalendarBooking(request, integration, loggedInUserId) {
4973
+ return this.microsoftCalendarBookingService.getEvent(request, integration, loggedInUserId);
4974
+ }
4975
+ async acceptCalendarBooking(request, integration, loggedInUserId) {
4976
+ return this.microsoftCalendarBookingService.acceptEvent(request, integration, loggedInUserId);
4977
+ }
4824
4978
  };
4825
4979
  exports.MicrosoftCalendarBookingHandler = _ts_decorate36([
4826
4980
  common.Injectable(),
@@ -5018,6 +5172,31 @@ var ICalendarWebhookHandler = class {
5018
5172
  static {
5019
5173
  __name(this, "ICalendarWebhookHandler");
5020
5174
  }
5175
+ async batchRefreshCalendarWebhooks(items, integration, loggedInUserId) {
5176
+ const results = [];
5177
+ for (const item of items) {
5178
+ try {
5179
+ const response = await this.refreshCalendarWebhook({
5180
+ subscriptionId: item.subscriptionId,
5181
+ expirationDateTime: item.expirationDateTime
5182
+ }, integration, loggedInUserId);
5183
+ results.push({
5184
+ requestId: item.requestId,
5185
+ subscriptionId: item.subscriptionId,
5186
+ success: true,
5187
+ subscription: response.subscription
5188
+ });
5189
+ } catch (error) {
5190
+ results.push({
5191
+ requestId: item.requestId,
5192
+ subscriptionId: item.subscriptionId,
5193
+ success: false,
5194
+ error: error instanceof Error ? error.message : String(error)
5195
+ });
5196
+ }
5197
+ }
5198
+ return results;
5199
+ }
5021
5200
  };
5022
5201
 
5023
5202
  // src/providers/microsoft/microsoft-calendar-webhook.handler.ts
@@ -5049,6 +5228,9 @@ exports.MicrosoftCalendarWebhookHandler = class MicrosoftCalendarWebhookHandler
5049
5228
  async deleteCalendarWebhook(request, integration, loggedInUserId) {
5050
5229
  return this.microsoftCalendarWebhookService.deleteSubscription(request, integration, loggedInUserId);
5051
5230
  }
5231
+ async batchRefreshCalendarWebhooks(items, integration, loggedInUserId) {
5232
+ return this.microsoftCalendarWebhookService.batchRefreshSubscriptions(items, integration, loggedInUserId);
5233
+ }
5052
5234
  };
5053
5235
  exports.MicrosoftCalendarWebhookHandler = _ts_decorate42([
5054
5236
  common.Injectable(),
@@ -5209,6 +5391,7 @@ exports.ICalendarResourceHandler = ICalendarResourceHandler;
5209
5391
  exports.ICalendarWebhookHandler = ICalendarWebhookHandler;
5210
5392
  exports.INVOICE_STATUS_ENUM = INVOICE_STATUS_ENUM;
5211
5393
  exports.IntegrationVisitorCredentialMappingDao = IntegrationVisitorCredentialMappingDao;
5394
+ exports.MICROSOFT_CALENDAR_DELTA_DEFAULT_WINDOW_YEARS = MICROSOFT_CALENDAR_DELTA_DEFAULT_WINDOW_YEARS;
5212
5395
  exports.MICROSOFT_CLIENT_CREDENTIALS_GRANT_TYPE = MICROSOFT_CLIENT_CREDENTIALS_GRANT_TYPE;
5213
5396
  exports.MICROSOFT_DEFAULT_ACCESS_TOKEN_TYPE = MICROSOFT_DEFAULT_ACCESS_TOKEN_TYPE;
5214
5397
  exports.MICROSOFT_DEFAULT_AUTH_URL = MICROSOFT_DEFAULT_AUTH_URL;