@dv4resi/dvss-backend-module-calendar-im 0.0.2 → 0.0.3

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
@@ -1140,6 +1140,7 @@ interface GetFolioActivitiesOptionsInput {
1140
1140
  interface GetCustomerActivitiesInput {
1141
1141
  customerId: string;
1142
1142
  projectId: string;
1143
+ propertyTimeZone: string;
1143
1144
  options?: GetFolioActivitiesOptionsInput;
1144
1145
  }
1145
1146
 
@@ -1300,6 +1301,8 @@ interface IUpdateCustomerPaymentRequest {
1300
1301
  apiName: string;
1301
1302
  value: string;
1302
1303
  }>;
1304
+ bankCharges?: number;
1305
+ accountId?: string;
1303
1306
  }
1304
1307
  interface IGetCreateCustomerPayment {
1305
1308
  payment: IGetCreateCustomerPaymentInfo;
@@ -1498,6 +1501,7 @@ interface ICustomerCreditNoteDetail {
1498
1501
  creditNoteNumber: string;
1499
1502
  status: CREDIT_NOTE_STATUS;
1500
1503
  customerId: string;
1504
+ date: string;
1501
1505
  operator?: ICreditNoteOperator;
1502
1506
  updatedAt?: Date;
1503
1507
  appliedInvoices: ICreditNoteAppliedInvoice[];
@@ -1588,6 +1592,12 @@ interface IGetRecurringInvoicesOptions {
1588
1592
  interface IGetRecurringInvoicesRequest {
1589
1593
  getRecurringInvoicesInput?: IGetRecurringInvoicesOptions;
1590
1594
  }
1595
+ interface IGetRecurringInvoiceInput {
1596
+ recurringInvoiceId: string;
1597
+ }
1598
+ interface IGetRecurringInvoiceRequest extends IInvoiceIntegrationRequest {
1599
+ getRecurringInvoiceInput: IGetRecurringInvoiceInput;
1600
+ }
1591
1601
  declare enum RECURRING_INVOICE_STATUS {
1592
1602
  ACTIVE = "ACTIVE",
1593
1603
  STOPPED = "STOPPED",
@@ -1697,6 +1707,7 @@ interface ICalendarRecurrencePattern {
1697
1707
  firstDayOfWeek?: string;
1698
1708
  dayOfMonth?: number;
1699
1709
  month?: number;
1710
+ index?: string;
1700
1711
  }
1701
1712
  interface ICalendarRecurrenceRange {
1702
1713
  type: string;
@@ -1714,6 +1725,14 @@ interface ICalendarEventSyncMetadata {
1714
1725
  syncVersion?: number;
1715
1726
  lastSyncTimestamp?: string;
1716
1727
  externalEventId?: string;
1728
+ syncType?: 'SINGLE' | 'RECURRING_SERIES' | 'CUSTOM_DATES';
1729
+ externalSeriesId?: string;
1730
+ externalEventIds?: {
1731
+ date: string;
1732
+ eventId: string;
1733
+ }[];
1734
+ organizerUserEmail?: string;
1735
+ resourceId?: string;
1717
1736
  }
1718
1737
  interface ICalendarAttendee {
1719
1738
  email: string;
@@ -1727,7 +1746,7 @@ interface ICalendarEvent {
1727
1746
  start: ICalendarDateTime;
1728
1747
  end: ICalendarDateTime;
1729
1748
  location?: string;
1730
- resourceEmail?: string;
1749
+ resourceId?: string;
1731
1750
  recurrence?: ICalendarRecurrence;
1732
1751
  attendees?: ICalendarAttendee[];
1733
1752
  organizerEmail?: string;
@@ -1736,29 +1755,32 @@ interface ICalendarEvent {
1736
1755
  syncMetadata?: ICalendarEventSyncMetadata;
1737
1756
  providerPayload?: Record<string, unknown>;
1738
1757
  }
1739
- interface ICreateCalendarEventRequest {
1758
+ interface ICalendarMailboxScope {
1759
+ organizerUserEmail?: string;
1760
+ }
1761
+ interface ICreateCalendarEventRequest extends ICalendarMailboxScope {
1740
1762
  event: ICalendarEvent;
1741
- resourceEmail: string;
1763
+ resourceId: string;
1742
1764
  }
1743
- interface IUpdateCalendarEventRequest {
1765
+ interface IUpdateCalendarEventRequest extends ICalendarMailboxScope {
1744
1766
  eventId: string;
1745
- resourceEmail: string;
1767
+ resourceId: string;
1746
1768
  event: Partial<ICalendarEvent>;
1747
1769
  }
1748
- interface ICancelCalendarEventRequest {
1770
+ interface ICancelCalendarEventRequest extends ICalendarMailboxScope {
1749
1771
  eventId: string;
1750
- resourceEmail: string;
1772
+ resourceId: string;
1751
1773
  }
1752
- interface IDeleteCalendarEventRequest {
1774
+ interface IDeleteCalendarEventRequest extends ICalendarMailboxScope {
1753
1775
  eventId: string;
1754
- resourceEmail: string;
1776
+ resourceId: string;
1755
1777
  }
1756
- interface IGetCalendarEventRequest {
1778
+ interface IGetCalendarEventRequest extends ICalendarMailboxScope {
1757
1779
  eventId: string;
1758
- resourceEmail: string;
1780
+ resourceId: string;
1759
1781
  }
1760
- interface IGetCalendarEventsRequest {
1761
- resourceEmail: string;
1782
+ interface IGetCalendarEventsRequest extends ICalendarMailboxScope {
1783
+ resourceId: string;
1762
1784
  start?: ICalendarDateTime;
1763
1785
  end?: ICalendarDateTime;
1764
1786
  syncToken?: string;
@@ -1767,8 +1789,8 @@ interface IGetCalendarEventsResponse {
1767
1789
  events: ICalendarEvent[];
1768
1790
  nextSyncToken?: string;
1769
1791
  }
1770
- interface ISyncCalendarEventsRequest {
1771
- resourceEmail: string;
1792
+ interface ISyncCalendarEventsRequest extends ICalendarMailboxScope {
1793
+ resourceId: string;
1772
1794
  syncToken?: string;
1773
1795
  }
1774
1796
  interface ISyncCalendarEventsResponse {
@@ -1776,12 +1798,12 @@ interface ISyncCalendarEventsResponse {
1776
1798
  nextSyncToken?: string;
1777
1799
  }
1778
1800
  interface IGetRoomAvailabilityRequest {
1779
- resourceEmails: string[];
1801
+ resourceIds: string[];
1780
1802
  start: ICalendarDateTime;
1781
1803
  end: ICalendarDateTime;
1782
1804
  }
1783
1805
  interface IRoomAvailabilitySlot {
1784
- resourceEmail: string;
1806
+ resourceId: string;
1785
1807
  start: ICalendarDateTime;
1786
1808
  end: ICalendarDateTime;
1787
1809
  status: 'free' | 'busy' | 'tentative' | 'oof' | 'unknown';
@@ -1980,6 +2002,7 @@ declare abstract class BaseAccountingInvoiceManagement {
1980
2002
  abstract deleteInvoice(request: IInvoiceIntegrationRequest, loggedInUserId: bigint): Promise<IAccountingAPIResponse>;
1981
2003
  abstract downloadInvoice(request: IInvoiceIntegrationRequest, loggedInUserId: bigint): Promise<ArrayBuffer>;
1982
2004
  abstract getInvoice(request: IInvoiceIntegrationRequest, loggedInUserId: bigint): Promise<IInvoiceResponse>;
2005
+ abstract getRecurringInvoice(request: IGetRecurringInvoiceRequest, loggedInUserId: bigint): Promise<unknown>;
1983
2006
  abstract markInvoiceAsPaid(request: IInvoiceIntegrationRequest, loggedInUserId: bigint): Promise<IAccountingAPIResponse>;
1984
2007
  abstract updateInvoiceStatus(request: IInvoiceIntegrationRequest, loggedInUserId: bigint): Promise<IAccountingAPIResponse>;
1985
2008
  abstract getInvoices(request: IGetInvoicesRequest, capabilityIntegration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IInvoicesResponse>;
@@ -2168,6 +2191,7 @@ interface IMicrosoftGraphRecurrencePattern {
2168
2191
  firstDayOfWeek?: string;
2169
2192
  dayOfMonth?: number;
2170
2193
  month?: number;
2194
+ index?: string;
2171
2195
  }
2172
2196
  interface IMicrosoftGraphRecurrenceRange {
2173
2197
  type?: string;
@@ -2296,7 +2320,10 @@ declare class MicrosoftCalendarBookingService extends BaseCalendarBookingManagem
2296
2320
  syncEvents(request: ISyncCalendarEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISyncCalendarEventsResponse>;
2297
2321
  getRoomAvailability(request: IGetRoomAvailabilityRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetRoomAvailabilityResponse>;
2298
2322
  private deleteGraphEvent;
2299
- private assertResourceEmail;
2323
+ private resolveMailboxEmail;
2324
+ private organizerUserMailbox;
2325
+ private resourceAsAttendee;
2326
+ private assertResourceId;
2300
2327
  private assertEventId;
2301
2328
  }
2302
2329
 
@@ -2328,9 +2355,9 @@ declare const MICROSOFT_TOKEN_HEADERS: {
2328
2355
 
2329
2356
  declare const MICROSOFT_GRAPH_PATHS: {
2330
2357
  readonly rooms: "/places/microsoft.graph.room";
2331
- readonly userCalendarEvents: (roomEmail: string) => string;
2332
- readonly userCalendarEvent: (roomEmail: string, eventId: string) => string;
2333
- readonly userCalendarView: (roomEmail: string, startDateTime: string, endDateTime: string) => string;
2358
+ readonly userCalendarEvents: (mailboxEmail: string) => string;
2359
+ readonly userCalendarEvent: (mailboxEmail: string, eventId: string) => string;
2360
+ readonly userCalendarView: (mailboxEmail: string, startDateTime: string, endDateTime: string) => string;
2334
2361
  readonly subscriptions: "/subscriptions";
2335
2362
  readonly subscription: (subscriptionId: string) => string;
2336
2363
  };
@@ -2456,4 +2483,4 @@ declare class CalendarIntegrationConfigurationAdapterFactory extends AdapterFact
2456
2483
  constructor(microsoftCalendarIntegrationConfigurationHandler: MicrosoftCalendarIntegrationConfigurationHandler);
2457
2484
  }
2458
2485
 
2459
- 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, 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 ICalendarAttendee, ICalendarAuthHandler, ICalendarBookingHandler, type ICalendarBookingManagementContext, type ICalendarDateTime, type ICalendarEvent, type ICalendarEventSyncMetadata, ICalendarIntegrationConfigurationHandler, type ICalendarRecurrence, type ICalendarRecurrencePattern, type ICalendarRecurrenceRange, type ICalendarResource, ICalendarResourceHandler, type ICalendarResourceManagementContext, ICalendarWebhookHandler, type ICalendarWebhookManagementContext, type ICalendarWebhookSubscription, type ICancelCalendarEventRequest, type ICapabilityIntegration, type ICapabilityIntegrationConfig, type ICapabilityIntegrationResourceMapping, type ICapabilityIntegrationResourceMappingRow, type IConfiguration, type ICreateCalendarEventRequest, type ICreateCreditNoteForInvoiceRequest, type ICreateCustomerPaymentRequest, 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 IDeleteCalendarEventRequest, type IDeleteCalendarWebhookRequest, type IDeleteCustomerContactPersonRequest, type IDeleteDeviceInput, type IDeleteDeviceResponse, type IDownloadCustomerAccountingStatementRequest, type IFetchOfferingAvailabilityRequest, type IGetAccessProfilesResponse, type IGetAppointmentsRequest, type IGetAvailableDatesAndTimeSlotsResponse, type IGetBookableItemsFromCreditRequest, type IGetCalendarEventRequest, type IGetCalendarEventsRequest, type IGetCalendarEventsResponse, type IGetCalendarResourcesRequest, type IGetCalendarResourcesResponse, 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 IGetInvoicesOptions, type IGetInvoicesRequest, type IGetOrderResponse, type IGetPractitionersRequest, type IGetRecurringInvoicesOptions, type IGetRecurringInvoicesRequest, type IGetRefundCustomerPayment, type IGetRoomAvailabilityRequest, type IGetRoomAvailabilityResponse, 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 IRefreshCalendarWebhookRequest, type IRefreshCalendarWebhookResponse, type IRefundCustomerPayment, type IRegisterCalendarWebhookRequest, type IRegisterCalendarWebhookResponse, type IRegisterDeviceInput, type IRegisterDeviceResponse, type IRemoveCapabilityIntegrationMappingInput, type IRemoveResourceFromIntegrationRequest, type IRemoveResourceFromIntegrationResponse, type IRoomAvailabilitySlot, type ISecureStorageWriteOptions, type ISensitiveStoredField, type IStoredConfigField, type ISyncCalendarEventsRequest, type ISyncCalendarEventsResponse, type ISystemResponse, type ITransactionNumberSeries, type ITransactionNumberSeriesItem, type IUpdateAPIResponse, type IUpdateCalendarEventRequest, type IUpdateCapabilityIntegration, type IUpdateCapabilityIntegrationRequest, type IUpdateCapabilityIntegrationResponse, type IUpdateCapabilityIntegrationUpdateData, type IUpdateCustomerContactPersonRequest, type IUpdateCustomerPaymentRequest, type IUpdateCustomerRequest, type IUpdateDeviceCertificateInput, type IUpdateDeviceCertificateResponse, type IUpdateOfferingIntegrationResourceConfigurationInput, type IUpdateOfferingIntegrationResourceConfigurationResponse, type IUpdateOrderRequest, type IUpdateOrderResponse, type IUpdateRecurringInvoiceRequest, type IUpdateRecurringInvoiceResponse, type IUpdateRecurringInvoiceStatusRequest, type IUserAccessGroup, type IValidatedCapabilityIntegration, type IValidatedCapabilityIntegrationConfig, 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 };
2486
+ 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, 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 ICalendarAttendee, ICalendarAuthHandler, ICalendarBookingHandler, type ICalendarBookingManagementContext, type ICalendarDateTime, type ICalendarEvent, type ICalendarEventSyncMetadata, ICalendarIntegrationConfigurationHandler, type ICalendarRecurrence, type ICalendarRecurrencePattern, type ICalendarRecurrenceRange, type ICalendarResource, ICalendarResourceHandler, type ICalendarResourceManagementContext, ICalendarWebhookHandler, type ICalendarWebhookManagementContext, type ICalendarWebhookSubscription, type ICancelCalendarEventRequest, type ICapabilityIntegration, type ICapabilityIntegrationConfig, type ICapabilityIntegrationResourceMapping, type ICapabilityIntegrationResourceMappingRow, type IConfiguration, type ICreateCalendarEventRequest, type ICreateCreditNoteForInvoiceRequest, type ICreateCustomerPaymentRequest, 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 IDeleteCalendarEventRequest, type IDeleteCalendarWebhookRequest, type IDeleteCustomerContactPersonRequest, type IDeleteDeviceInput, type IDeleteDeviceResponse, type IDownloadCustomerAccountingStatementRequest, type IFetchOfferingAvailabilityRequest, type IGetAccessProfilesResponse, type IGetAppointmentsRequest, type IGetAvailableDatesAndTimeSlotsResponse, type IGetBookableItemsFromCreditRequest, type IGetCalendarEventRequest, type IGetCalendarEventsRequest, type IGetCalendarEventsResponse, type IGetCalendarResourcesRequest, type IGetCalendarResourcesResponse, 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 IGetInvoicesOptions, type IGetInvoicesRequest, type IGetOrderResponse, type IGetPractitionersRequest, type IGetRecurringInvoiceInput, type IGetRecurringInvoiceRequest, type IGetRecurringInvoicesOptions, type IGetRecurringInvoicesRequest, type IGetRefundCustomerPayment, type IGetRoomAvailabilityRequest, type IGetRoomAvailabilityResponse, 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 IRefreshCalendarWebhookRequest, type IRefreshCalendarWebhookResponse, type IRefundCustomerPayment, type IRegisterCalendarWebhookRequest, type IRegisterCalendarWebhookResponse, type IRegisterDeviceInput, type IRegisterDeviceResponse, type IRemoveCapabilityIntegrationMappingInput, type IRemoveResourceFromIntegrationRequest, type IRemoveResourceFromIntegrationResponse, type IRoomAvailabilitySlot, type ISecureStorageWriteOptions, type ISensitiveStoredField, type IStoredConfigField, type ISyncCalendarEventsRequest, type ISyncCalendarEventsResponse, type ISystemResponse, type ITransactionNumberSeries, type ITransactionNumberSeriesItem, type IUpdateAPIResponse, type IUpdateCalendarEventRequest, type IUpdateCapabilityIntegration, type IUpdateCapabilityIntegrationRequest, type IUpdateCapabilityIntegrationResponse, type IUpdateCapabilityIntegrationUpdateData, type IUpdateCustomerContactPersonRequest, type IUpdateCustomerPaymentRequest, type IUpdateCustomerRequest, type IUpdateDeviceCertificateInput, type IUpdateDeviceCertificateResponse, type IUpdateOfferingIntegrationResourceConfigurationInput, type IUpdateOfferingIntegrationResourceConfigurationResponse, type IUpdateOrderRequest, type IUpdateOrderResponse, type IUpdateRecurringInvoiceRequest, type IUpdateRecurringInvoiceResponse, type IUpdateRecurringInvoiceStatusRequest, type IUserAccessGroup, type IValidatedCapabilityIntegration, type IValidatedCapabilityIntegrationConfig, 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 };
package/dist/index.js CHANGED
@@ -4005,9 +4005,9 @@ exports.IntegrationOnpremDeploymentDao = _ts_decorate16([
4005
4005
  // ../../packages/dvss-integration-microsoft/src/common/microsoft.constant.ts
4006
4006
  var MICROSOFT_GRAPH_PATHS = {
4007
4007
  rooms: "/places/microsoft.graph.room",
4008
- userCalendarEvents: /* @__PURE__ */ __name((roomEmail) => `/users/${encodeURIComponent(roomEmail)}/calendar/events`, "userCalendarEvents"),
4009
- userCalendarEvent: /* @__PURE__ */ __name((roomEmail, eventId) => `/users/${encodeURIComponent(roomEmail)}/calendar/events/${encodeURIComponent(eventId)}`, "userCalendarEvent"),
4010
- userCalendarView: /* @__PURE__ */ __name((roomEmail, startDateTime, endDateTime) => `/users/${encodeURIComponent(roomEmail)}/calendarView?startDateTime=${encodeURIComponent(startDateTime)}&endDateTime=${encodeURIComponent(endDateTime)}`, "userCalendarView"),
4008
+ userCalendarEvents: /* @__PURE__ */ __name((mailboxEmail) => `/users/${encodeURIComponent(mailboxEmail)}/calendar/events`, "userCalendarEvents"),
4009
+ userCalendarEvent: /* @__PURE__ */ __name((mailboxEmail, eventId) => `/users/${encodeURIComponent(mailboxEmail)}/calendar/events/${encodeURIComponent(eventId)}`, "userCalendarEvent"),
4010
+ userCalendarView: /* @__PURE__ */ __name((mailboxEmail, startDateTime, endDateTime) => `/users/${encodeURIComponent(mailboxEmail)}/calendarView?startDateTime=${encodeURIComponent(startDateTime)}&endDateTime=${encodeURIComponent(endDateTime)}`, "userCalendarView"),
4011
4011
  subscriptions: "/subscriptions",
4012
4012
  subscription: /* @__PURE__ */ __name((subscriptionId) => `/subscriptions/${encodeURIComponent(subscriptionId)}`, "subscription")
4013
4013
  };
@@ -4385,7 +4385,8 @@ var GRAPH_EVENT_KNOWN_KEYS = /* @__PURE__ */ new Set([
4385
4385
  "attendees",
4386
4386
  "organizer"
4387
4387
  ]);
4388
- function toGraphEvent(event) {
4388
+ var GRAPH_RESOURCE_ATTENDEE_TYPE = "resource";
4389
+ function toGraphEvent(event, options) {
4389
4390
  const graph = {};
4390
4391
  if (event.subject !== void 0) {
4391
4392
  graph.subject = event.subject;
@@ -4436,12 +4437,20 @@ function toGraphEvent(event) {
4436
4437
  return mapped;
4437
4438
  });
4438
4439
  }
4439
- if (event.organizerEmail !== void 0) {
4440
- graph.organizer = {
4441
- emailAddress: {
4442
- address: event.organizerEmail
4443
- }
4444
- };
4440
+ const resourceId = options?.resourceId?.trim();
4441
+ if (resourceId) {
4442
+ const isAlreadyInvited = graph.attendees?.some((attendee) => attendee.emailAddress?.address?.toLowerCase() === resourceId.toLowerCase());
4443
+ if (isAlreadyInvited !== true) {
4444
+ graph.attendees = [
4445
+ ...graph.attendees ?? [],
4446
+ {
4447
+ emailAddress: {
4448
+ address: resourceId
4449
+ },
4450
+ type: GRAPH_RESOURCE_ATTENDEE_TYPE
4451
+ }
4452
+ ];
4453
+ }
4445
4454
  }
4446
4455
  return graph;
4447
4456
  }
@@ -4454,7 +4463,8 @@ function toGraphRecurrence(recurrence) {
4454
4463
  daysOfWeek: recurrence.pattern.daysOfWeek,
4455
4464
  firstDayOfWeek: recurrence.pattern.firstDayOfWeek,
4456
4465
  dayOfMonth: recurrence.pattern.dayOfMonth,
4457
- month: recurrence.pattern.month
4466
+ month: recurrence.pattern.month,
4467
+ index: recurrence.pattern.index
4458
4468
  }),
4459
4469
  range: omitUndefined({
4460
4470
  type: recurrence.range.type,
@@ -4481,7 +4491,7 @@ function fromGraphEvent(graph, options) {
4481
4491
  timeZone: ""
4482
4492
  },
4483
4493
  location: graph.location?.displayName,
4484
- resourceEmail: options?.resourceEmail,
4494
+ resourceId: options?.resourceId,
4485
4495
  recurrence: graph.recurrence ? fromGraphRecurrence(graph.recurrence) : void 0,
4486
4496
  attendees: graph.attendees?.filter((attendee) => Boolean(attendee.emailAddress?.address)).map((attendee) => ({
4487
4497
  email: attendee.emailAddress?.address ?? "",
@@ -4493,7 +4503,11 @@ function fromGraphEvent(graph, options) {
4493
4503
  isCancelled: graph.isCancelled,
4494
4504
  syncMetadata: omitUndefined({
4495
4505
  ...options?.syncMetadata,
4496
- externalEventId: graph.id ?? options?.syncMetadata?.externalEventId
4506
+ externalEventId: graph.id ?? options?.syncMetadata?.externalEventId,
4507
+ // Event ids are mailbox-scoped — remember which mailbox can address this id.
4508
+ // Left undefined when the room organizes; `resourceId` addresses the event then.
4509
+ organizerUserEmail: options?.organizerUserEmail ?? options?.syncMetadata?.organizerUserEmail,
4510
+ resourceId: options?.resourceId ?? options?.syncMetadata?.resourceId
4497
4511
  }),
4498
4512
  providerPayload
4499
4513
  };
@@ -4507,7 +4521,8 @@ function fromGraphRecurrence(recurrence) {
4507
4521
  daysOfWeek: recurrence.pattern?.daysOfWeek,
4508
4522
  firstDayOfWeek: recurrence.pattern?.firstDayOfWeek,
4509
4523
  dayOfMonth: recurrence.pattern?.dayOfMonth,
4510
- month: recurrence.pattern?.month
4524
+ month: recurrence.pattern?.month,
4525
+ index: recurrence.pattern?.index
4511
4526
  }),
4512
4527
  range: omitUndefined({
4513
4528
  type: recurrence.range?.type ?? "",
@@ -4558,24 +4573,30 @@ exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService
4558
4573
  }
4559
4574
  async createEvent(request, integration, loggedInUserId) {
4560
4575
  try {
4576
+ const mailboxEmail = this.resolveMailboxEmail(request);
4561
4577
  this.logger.info(loggedInUserId, this.createEvent.name, this.fileName, "Create Microsoft Graph calendar event", {
4562
- resourceEmail: request.resourceEmail,
4578
+ mailboxEmail,
4579
+ resourceId: request.resourceId,
4563
4580
  subject: request.event.subject,
4564
- path: MICROSOFT_GRAPH_PATHS.userCalendarEvents(request.resourceEmail)
4581
+ path: MICROSOFT_GRAPH_PATHS.userCalendarEvents(mailboxEmail)
4565
4582
  });
4566
- this.assertResourceEmail(request.resourceEmail);
4583
+ this.assertResourceId(request.resourceId);
4567
4584
  const graphEvent = await this.microsoftApiClient.apiCall({
4568
4585
  apiMethod: HTTP_METHOD.POST,
4569
- url: MICROSOFT_GRAPH_PATHS.userCalendarEvents(request.resourceEmail),
4570
- body: toGraphEvent(request.event)
4586
+ url: MICROSOFT_GRAPH_PATHS.userCalendarEvents(mailboxEmail),
4587
+ body: toGraphEvent(request.event, {
4588
+ resourceId: this.resourceAsAttendee(mailboxEmail, request.resourceId)
4589
+ })
4571
4590
  }, integration, loggedInUserId);
4572
4591
  const mapped = fromGraphEvent(graphEvent, {
4573
- resourceEmail: request.resourceEmail,
4592
+ resourceId: request.resourceId,
4593
+ organizerUserEmail: this.organizerUserMailbox(request),
4574
4594
  syncMetadata: request.event.syncMetadata
4575
4595
  });
4576
4596
  this.logger.info(loggedInUserId, this.createEvent.name, this.fileName, "Created Microsoft Graph calendar event", {
4577
4597
  eventId: mapped.id,
4578
- resourceEmail: request.resourceEmail
4598
+ mailboxEmail,
4599
+ resourceId: request.resourceId
4579
4600
  });
4580
4601
  return mapped;
4581
4602
  } catch (error) {
@@ -4585,25 +4606,29 @@ exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService
4585
4606
  }
4586
4607
  async updateEvent(request, integration, loggedInUserId) {
4587
4608
  try {
4609
+ const mailboxEmail = this.resolveMailboxEmail(request);
4588
4610
  this.logger.info(loggedInUserId, this.updateEvent.name, this.fileName, "Update Microsoft Graph calendar event", {
4589
- resourceEmail: request.resourceEmail,
4611
+ mailboxEmail,
4612
+ resourceId: request.resourceId,
4590
4613
  eventId: request.eventId,
4591
- path: MICROSOFT_GRAPH_PATHS.userCalendarEvent(request.resourceEmail, request.eventId)
4614
+ path: MICROSOFT_GRAPH_PATHS.userCalendarEvent(mailboxEmail, request.eventId)
4592
4615
  });
4593
- this.assertResourceEmail(request.resourceEmail);
4616
+ this.assertResourceId(request.resourceId);
4594
4617
  this.assertEventId(request.eventId);
4595
4618
  const graphEvent = await this.microsoftApiClient.apiCall({
4596
4619
  apiMethod: HTTP_METHOD.PATCH,
4597
- url: MICROSOFT_GRAPH_PATHS.userCalendarEvent(request.resourceEmail, request.eventId),
4620
+ url: MICROSOFT_GRAPH_PATHS.userCalendarEvent(mailboxEmail, request.eventId),
4598
4621
  body: toGraphEvent(request.event)
4599
4622
  }, integration, loggedInUserId);
4600
4623
  const mapped = fromGraphEvent(graphEvent, {
4601
- resourceEmail: request.resourceEmail,
4624
+ resourceId: request.resourceId,
4625
+ organizerUserEmail: this.organizerUserMailbox(request),
4602
4626
  syncMetadata: request.event.syncMetadata
4603
4627
  });
4604
4628
  this.logger.info(loggedInUserId, this.updateEvent.name, this.fileName, "Updated Microsoft Graph calendar event", {
4605
4629
  eventId: mapped.id,
4606
- resourceEmail: request.resourceEmail
4630
+ mailboxEmail,
4631
+ resourceId: request.resourceId
4607
4632
  });
4608
4633
  return mapped;
4609
4634
  } catch (error) {
@@ -4613,15 +4638,18 @@ exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService
4613
4638
  }
4614
4639
  async cancelEvent(request, integration, loggedInUserId) {
4615
4640
  try {
4641
+ const mailboxEmail = this.resolveMailboxEmail(request);
4616
4642
  this.logger.info(loggedInUserId, this.cancelEvent.name, this.fileName, "Cancel Microsoft Graph calendar event", {
4617
- resourceEmail: request.resourceEmail,
4643
+ mailboxEmail,
4644
+ resourceId: request.resourceId,
4618
4645
  eventId: request.eventId,
4619
- path: MICROSOFT_GRAPH_PATHS.userCalendarEvent(request.resourceEmail, request.eventId)
4646
+ path: MICROSOFT_GRAPH_PATHS.userCalendarEvent(mailboxEmail, request.eventId)
4620
4647
  });
4621
- await this.deleteGraphEvent(request.resourceEmail, request.eventId, integration, loggedInUserId);
4648
+ await this.deleteGraphEvent(mailboxEmail, request.resourceId, request.eventId, integration, loggedInUserId);
4622
4649
  this.logger.info(loggedInUserId, this.cancelEvent.name, this.fileName, "Cancelled Microsoft Graph calendar event", {
4623
4650
  eventId: request.eventId,
4624
- resourceEmail: request.resourceEmail
4651
+ mailboxEmail,
4652
+ resourceId: request.resourceId
4625
4653
  });
4626
4654
  } catch (error) {
4627
4655
  this.logger.error(loggedInUserId, this.cancelEvent.name, this.fileName, "Error cancelling Microsoft Graph calendar event", error);
@@ -4630,15 +4658,18 @@ exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService
4630
4658
  }
4631
4659
  async deleteEvent(request, integration, loggedInUserId) {
4632
4660
  try {
4661
+ const mailboxEmail = this.resolveMailboxEmail(request);
4633
4662
  this.logger.info(loggedInUserId, this.deleteEvent.name, this.fileName, "Delete Microsoft Graph calendar event", {
4634
- resourceEmail: request.resourceEmail,
4663
+ mailboxEmail,
4664
+ resourceId: request.resourceId,
4635
4665
  eventId: request.eventId,
4636
- path: MICROSOFT_GRAPH_PATHS.userCalendarEvent(request.resourceEmail, request.eventId)
4666
+ path: MICROSOFT_GRAPH_PATHS.userCalendarEvent(mailboxEmail, request.eventId)
4637
4667
  });
4638
- await this.deleteGraphEvent(request.resourceEmail, request.eventId, integration, loggedInUserId);
4668
+ await this.deleteGraphEvent(mailboxEmail, request.resourceId, request.eventId, integration, loggedInUserId);
4639
4669
  this.logger.info(loggedInUserId, this.deleteEvent.name, this.fileName, "Deleted Microsoft Graph calendar event", {
4640
4670
  eventId: request.eventId,
4641
- resourceEmail: request.resourceEmail
4671
+ mailboxEmail,
4672
+ resourceId: request.resourceId
4642
4673
  });
4643
4674
  } catch (error) {
4644
4675
  this.logger.error(loggedInUserId, this.deleteEvent.name, this.fileName, "Error deleting Microsoft Graph calendar event", error);
@@ -4647,23 +4678,27 @@ exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService
4647
4678
  }
4648
4679
  async getEvent(request, integration, loggedInUserId) {
4649
4680
  try {
4681
+ const mailboxEmail = this.resolveMailboxEmail(request);
4650
4682
  this.logger.info(loggedInUserId, this.getEvent.name, this.fileName, "Get Microsoft Graph calendar event", {
4651
- resourceEmail: request.resourceEmail,
4683
+ mailboxEmail,
4684
+ resourceId: request.resourceId,
4652
4685
  eventId: request.eventId,
4653
- path: MICROSOFT_GRAPH_PATHS.userCalendarEvent(request.resourceEmail, request.eventId)
4686
+ path: MICROSOFT_GRAPH_PATHS.userCalendarEvent(mailboxEmail, request.eventId)
4654
4687
  });
4655
- this.assertResourceEmail(request.resourceEmail);
4688
+ this.assertResourceId(request.resourceId);
4656
4689
  this.assertEventId(request.eventId);
4657
4690
  const graphEvent = await this.microsoftApiClient.apiCall({
4658
4691
  apiMethod: HTTP_METHOD.GET,
4659
- url: MICROSOFT_GRAPH_PATHS.userCalendarEvent(request.resourceEmail, request.eventId)
4692
+ url: MICROSOFT_GRAPH_PATHS.userCalendarEvent(mailboxEmail, request.eventId)
4660
4693
  }, integration, loggedInUserId);
4661
4694
  const mapped = fromGraphEvent(graphEvent, {
4662
- resourceEmail: request.resourceEmail
4695
+ resourceId: request.resourceId,
4696
+ organizerUserEmail: this.organizerUserMailbox(request)
4663
4697
  });
4664
4698
  this.logger.info(loggedInUserId, this.getEvent.name, this.fileName, "Fetched Microsoft Graph calendar event", {
4665
4699
  eventId: mapped.id,
4666
- resourceEmail: request.resourceEmail
4700
+ mailboxEmail,
4701
+ resourceId: request.resourceId
4667
4702
  });
4668
4703
  return mapped;
4669
4704
  } catch (error) {
@@ -4673,10 +4708,12 @@ exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService
4673
4708
  }
4674
4709
  async getEvents(request, integration, loggedInUserId) {
4675
4710
  try {
4676
- this.assertResourceEmail(request.resourceEmail);
4677
- const url = request.start && request.end ? MICROSOFT_GRAPH_PATHS.userCalendarView(request.resourceEmail, request.start.dateTime, request.end.dateTime) : MICROSOFT_GRAPH_PATHS.userCalendarEvents(request.resourceEmail);
4711
+ this.assertResourceId(request.resourceId);
4712
+ const mailboxEmail = this.resolveMailboxEmail(request);
4713
+ const url = request.start && request.end ? MICROSOFT_GRAPH_PATHS.userCalendarView(mailboxEmail, request.start.dateTime, request.end.dateTime) : MICROSOFT_GRAPH_PATHS.userCalendarEvents(mailboxEmail);
4678
4714
  this.logger.info(loggedInUserId, this.getEvents.name, this.fileName, "List Microsoft Graph calendar events", {
4679
- resourceEmail: request.resourceEmail,
4715
+ mailboxEmail,
4716
+ resourceId: request.resourceId,
4680
4717
  path: url,
4681
4718
  hasTimeWindow: Boolean(request.start && request.end)
4682
4719
  });
@@ -4685,10 +4722,12 @@ exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService
4685
4722
  url
4686
4723
  }, integration, loggedInUserId);
4687
4724
  const events = (response.value ?? []).map((graphEvent) => fromGraphEvent(graphEvent, {
4688
- resourceEmail: request.resourceEmail
4725
+ resourceId: request.resourceId,
4726
+ organizerUserEmail: this.organizerUserMailbox(request)
4689
4727
  }));
4690
4728
  this.logger.info(loggedInUserId, this.getEvents.name, this.fileName, "Listed Microsoft Graph calendar events", {
4691
- resourceEmail: request.resourceEmail,
4729
+ mailboxEmail,
4730
+ resourceId: request.resourceId,
4692
4731
  count: events.length
4693
4732
  });
4694
4733
  return {
@@ -4701,7 +4740,7 @@ exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService
4701
4740
  }
4702
4741
  syncEvents(request, integration, loggedInUserId) {
4703
4742
  this.logger.info(loggedInUserId, this.syncEvents.name, this.fileName, "Sync Microsoft Graph calendar events (delta)", {
4704
- resourceEmail: request.resourceEmail,
4743
+ resourceId: request.resourceId,
4705
4744
  hasSyncToken: Boolean(request.syncToken)
4706
4745
  });
4707
4746
  void this.microsoftApiClient;
@@ -4709,22 +4748,44 @@ exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService
4709
4748
  }
4710
4749
  getRoomAvailability(request, integration, loggedInUserId) {
4711
4750
  this.logger.info(loggedInUserId, this.getRoomAvailability.name, this.fileName, "Get Microsoft Graph room availability", {
4712
- resourceCount: request.resourceEmails.length
4751
+ resourceCount: request.resourceIds.length
4713
4752
  });
4714
4753
  void this.microsoftApiClient;
4715
4754
  return Promise.reject(new common.NotImplementedException("MicrosoftCalendarBookingService.getRoomAvailability is not implemented yet"));
4716
4755
  }
4717
- async deleteGraphEvent(resourceEmail, eventId, integration, loggedInUserId) {
4718
- this.assertResourceEmail(resourceEmail);
4756
+ async deleteGraphEvent(mailboxEmail, resourceId, eventId, integration, loggedInUserId) {
4757
+ this.assertResourceId(resourceId);
4719
4758
  this.assertEventId(eventId);
4720
4759
  await this.microsoftApiClient.apiCall({
4721
4760
  apiMethod: HTTP_METHOD.DELETE,
4722
- url: MICROSOFT_GRAPH_PATHS.userCalendarEvent(resourceEmail, eventId)
4761
+ url: MICROSOFT_GRAPH_PATHS.userCalendarEvent(mailboxEmail, eventId)
4723
4762
  }, integration, loggedInUserId);
4724
4763
  }
4725
- assertResourceEmail(resourceEmail) {
4726
- if (!resourceEmail?.trim()) {
4727
- throw new dvssBackendModuleUtility.CustomException("BAD_REQUEST", "resourceEmail is required");
4764
+ /**
4765
+ * Mailbox the Graph call targets: the organizing user when one is known, otherwise the
4766
+ * resource mailbox, which keeps the room-organizes behaviour for callers that cannot
4767
+ * resolve a user. The return value is therefore a user *or* a resource mailbox — never
4768
+ * store it as `organizerUserEmail`; use `organizerUserMailbox` for that.
4769
+ */
4770
+ resolveMailboxEmail(request) {
4771
+ return this.organizerUserMailbox(request) ?? request.resourceId;
4772
+ }
4773
+ /**
4774
+ * The organizing user's mailbox, or undefined when the room ends up organizing.
4775
+ */
4776
+ organizerUserMailbox(request) {
4777
+ return request.organizerUserEmail?.trim() || void 0;
4778
+ }
4779
+ /**
4780
+ * The room only needs to be invited as an attendee when the event lives in someone
4781
+ * else's mailbox. Posting into the room's own calendar already books it.
4782
+ */
4783
+ resourceAsAttendee(mailboxEmail, resourceId) {
4784
+ return mailboxEmail.trim().toLowerCase() === resourceId.trim().toLowerCase() ? void 0 : resourceId;
4785
+ }
4786
+ assertResourceId(resourceId) {
4787
+ if (!resourceId?.trim()) {
4788
+ throw new dvssBackendModuleUtility.CustomException("BAD_REQUEST", "resourceId is required");
4728
4789
  }
4729
4790
  }
4730
4791
  assertEventId(eventId) {