@dv4resi/dvss-backend-module-calendar-im 0.0.8 → 0.0.9
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 +49 -1
- package/dist/index.js +123 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1802,6 +1802,28 @@ interface IGetEventsRequest extends IMailboxScope {
|
|
|
1802
1802
|
endDateLabel?: string;
|
|
1803
1803
|
timeZone?: string;
|
|
1804
1804
|
}
|
|
1805
|
+
interface IGetEventInstancesRequest extends IMailboxScope {
|
|
1806
|
+
resourceEmail: string;
|
|
1807
|
+
seriesEventId: string;
|
|
1808
|
+
startDateLabel: string;
|
|
1809
|
+
endDateLabel: string;
|
|
1810
|
+
timeZone?: string;
|
|
1811
|
+
}
|
|
1812
|
+
interface IInstanceUpdate {
|
|
1813
|
+
instanceId: string;
|
|
1814
|
+
event: Partial<IBookingEvent>;
|
|
1815
|
+
}
|
|
1816
|
+
interface IUpdateEventInstancesRequest extends IMailboxScope {
|
|
1817
|
+
resourceEmail: string;
|
|
1818
|
+
updates: IInstanceUpdate[];
|
|
1819
|
+
}
|
|
1820
|
+
interface IUpdateEventInstancesResponse {
|
|
1821
|
+
results: Array<{
|
|
1822
|
+
instanceId: string;
|
|
1823
|
+
ref?: IBookingEventRef;
|
|
1824
|
+
error?: string;
|
|
1825
|
+
}>;
|
|
1826
|
+
}
|
|
1805
1827
|
interface IBookingEventRef {
|
|
1806
1828
|
id?: string;
|
|
1807
1829
|
seriesId?: string;
|
|
@@ -2168,6 +2190,8 @@ declare abstract class BaseCalendarBookingManagement {
|
|
|
2168
2190
|
abstract getEvents(request: IGetEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
|
|
2169
2191
|
abstract getEvent?(request: IGetCalendarEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IBookingEventRef>;
|
|
2170
2192
|
abstract acceptEvent?(request: IAcceptEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
|
|
2193
|
+
abstract getEventInstances(request: IGetEventInstancesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
|
|
2194
|
+
abstract updateEventInstances(request: IUpdateEventInstancesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IUpdateEventInstancesResponse>;
|
|
2171
2195
|
}
|
|
2172
2196
|
|
|
2173
2197
|
declare abstract class BaseCalendarWebhookManagement {
|
|
@@ -2428,6 +2452,21 @@ interface IMicrosoftGraphErrorBody {
|
|
|
2428
2452
|
message?: string;
|
|
2429
2453
|
};
|
|
2430
2454
|
}
|
|
2455
|
+
interface IMicrosoftGraphBatchRequestItem<TBody = unknown> {
|
|
2456
|
+
id: string;
|
|
2457
|
+
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
2458
|
+
url: string;
|
|
2459
|
+
body?: TBody;
|
|
2460
|
+
headers?: Record<string, string>;
|
|
2461
|
+
}
|
|
2462
|
+
interface IMicrosoftGraphBatchResponseItem<TBody = unknown> {
|
|
2463
|
+
id: string;
|
|
2464
|
+
status: number;
|
|
2465
|
+
body?: TBody;
|
|
2466
|
+
}
|
|
2467
|
+
interface IMicrosoftGraphEventBatchResponse<TBody = unknown> {
|
|
2468
|
+
responses: IMicrosoftGraphBatchResponseItem<TBody>[];
|
|
2469
|
+
}
|
|
2431
2470
|
interface IMicrosoftGraphSubscription {
|
|
2432
2471
|
id?: string;
|
|
2433
2472
|
resource?: string;
|
|
@@ -2520,6 +2559,9 @@ declare class MicrosoftCalendarBookingService extends BaseCalendarBookingManagem
|
|
|
2520
2559
|
getEvent(request: IGetCalendarEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IBookingEventRef>;
|
|
2521
2560
|
acceptEvent(request: IAcceptEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
|
|
2522
2561
|
getEvents(request: IGetEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
|
|
2562
|
+
getEventInstances(request: IGetEventInstancesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
|
|
2563
|
+
updateEventInstances(request: IUpdateEventInstancesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IUpdateEventInstancesResponse>;
|
|
2564
|
+
private chunkInstanceUpdates;
|
|
2523
2565
|
private deleteGraphEvent;
|
|
2524
2566
|
private resolveSkipDatesIfAny;
|
|
2525
2567
|
private findOccurrenceInstanceId;
|
|
@@ -2564,8 +2606,10 @@ declare const MICROSOFT_GRAPH_PATHS: {
|
|
|
2564
2606
|
readonly userCalendarViewDelta: (mailboxEmail: string, startDateTime: string, endDateTime: string) => string;
|
|
2565
2607
|
readonly userCalendarEventAccept: (mailboxEmail: string, eventId: string) => string;
|
|
2566
2608
|
readonly userCalendarEventDecline: (mailboxEmail: string, eventId: string) => string;
|
|
2609
|
+
readonly userCalendarEventInstances: (mailboxEmail: string, seriesMasterEventId: string, startDateTime: string, endDateTime: string) => string;
|
|
2567
2610
|
readonly subscriptions: "/subscriptions";
|
|
2568
2611
|
readonly subscription: (subscriptionId: string) => string;
|
|
2612
|
+
readonly batch: "/$batch";
|
|
2569
2613
|
};
|
|
2570
2614
|
declare const MICROSOFT_CALENDAR_DELTA_DEFAULT_WINDOW_YEARS = 10;
|
|
2571
2615
|
declare const MICROSOFT_DEFAULT_GRAPH_BASE_URL = "https://graph.microsoft.com/v1.0";
|
|
@@ -2595,6 +2639,8 @@ declare abstract class ICalendarBookingHandler {
|
|
|
2595
2639
|
abstract getCalendarBookings(request: IGetEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
|
|
2596
2640
|
abstract getCalendarBooking(request: IGetCalendarEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IBookingEventRef>;
|
|
2597
2641
|
abstract acceptCalendarBooking(request: IAcceptEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
|
|
2642
|
+
abstract getCalendarBookingInstances(request: IGetEventInstancesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
|
|
2643
|
+
abstract updateCalendarBookingInstances(request: IUpdateEventInstancesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IUpdateEventInstancesResponse>;
|
|
2598
2644
|
}
|
|
2599
2645
|
|
|
2600
2646
|
declare abstract class ICalendarResourceHandler {
|
|
@@ -2631,6 +2677,8 @@ declare class MicrosoftCalendarBookingHandler extends ICalendarBookingHandler {
|
|
|
2631
2677
|
getCalendarBookings(request: IGetEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
|
|
2632
2678
|
getCalendarBooking(request: IGetCalendarEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IBookingEventRef>;
|
|
2633
2679
|
acceptCalendarBooking(request: IAcceptEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
|
|
2680
|
+
getCalendarBookingInstances(request: IGetEventInstancesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
|
|
2681
|
+
updateCalendarBookingInstances(request: IUpdateEventInstancesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IUpdateEventInstancesResponse>;
|
|
2634
2682
|
}
|
|
2635
2683
|
|
|
2636
2684
|
declare class MicrosoftCalendarResourceHandler extends ICalendarResourceHandler {
|
|
@@ -2690,4 +2738,4 @@ declare class CalendarIntegrationConfigurationAdapterFactory extends AdapterFact
|
|
|
2690
2738
|
constructor(microsoftCalendarIntegrationConfigurationHandler: MicrosoftCalendarIntegrationConfigurationHandler);
|
|
2691
2739
|
}
|
|
2692
2740
|
|
|
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 };
|
|
2741
|
+
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 IGetEventInstancesRequest, 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 IInstanceUpdate, 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 IMicrosoftGraphBatchRequestItem, type IMicrosoftGraphBatchResponse, type IMicrosoftGraphBatchResponseItem, type IMicrosoftGraphDateTimeTimeZone, type IMicrosoftGraphErrorBody, type IMicrosoftGraphEvent, type IMicrosoftGraphEventBatchResponse, 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 IUpdateEventInstancesRequest, type IUpdateEventInstancesResponse, 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
|
@@ -3528,8 +3528,12 @@ var MICROSOFT_GRAPH_PATHS = {
|
|
|
3528
3528
|
userCalendarViewDelta: /* @__PURE__ */ __name((mailboxEmail, startDateTime, endDateTime) => `/users/${encodeURIComponent(mailboxEmail)}/calendarView/delta?startDateTime=${encodeURIComponent(startDateTime)}&endDateTime=${encodeURIComponent(endDateTime)}`, "userCalendarViewDelta"),
|
|
3529
3529
|
userCalendarEventAccept: /* @__PURE__ */ __name((mailboxEmail, eventId) => `/users/${encodeURIComponent(mailboxEmail)}/events/${encodeURIComponent(eventId)}/accept`, "userCalendarEventAccept"),
|
|
3530
3530
|
userCalendarEventDecline: /* @__PURE__ */ __name((mailboxEmail, eventId) => `/users/${encodeURIComponent(mailboxEmail)}/events/${encodeURIComponent(eventId)}/decline`, "userCalendarEventDecline"),
|
|
3531
|
+
/** Real Graph instance ids of a recurring series in a date window - backs "this and following" edits. */
|
|
3532
|
+
userCalendarEventInstances: /* @__PURE__ */ __name((mailboxEmail, seriesMasterEventId, startDateTime, endDateTime) => `/users/${encodeURIComponent(mailboxEmail)}/calendar/events/${encodeURIComponent(seriesMasterEventId)}/instances?startDateTime=${encodeURIComponent(startDateTime)}&endDateTime=${encodeURIComponent(endDateTime)}`, "userCalendarEventInstances"),
|
|
3531
3533
|
subscriptions: "/subscriptions",
|
|
3532
|
-
subscription: /* @__PURE__ */ __name((subscriptionId) => `/subscriptions/${encodeURIComponent(subscriptionId)}`, "subscription")
|
|
3534
|
+
subscription: /* @__PURE__ */ __name((subscriptionId) => `/subscriptions/${encodeURIComponent(subscriptionId)}`, "subscription"),
|
|
3535
|
+
/** Graph JSON batching endpoint - up to 20 sub-requests per call. */
|
|
3536
|
+
batch: "/$batch"
|
|
3533
3537
|
};
|
|
3534
3538
|
var MICROSOFT_CALENDAR_DELTA_DEFAULT_WINDOW_YEARS = 10;
|
|
3535
3539
|
var MICROSOFT_DEFAULT_GRAPH_BASE_URL = "https://graph.microsoft.com/v1.0";
|
|
@@ -4072,6 +4076,7 @@ function _ts_metadata23(k, v) {
|
|
|
4072
4076
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
4073
4077
|
}
|
|
4074
4078
|
__name(_ts_metadata23, "_ts_metadata");
|
|
4079
|
+
var GRAPH_BATCH_MAX_SIZE = 20;
|
|
4075
4080
|
exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService extends BaseCalendarBookingManagement {
|
|
4076
4081
|
static {
|
|
4077
4082
|
__name(this, "MicrosoftCalendarBookingService");
|
|
@@ -4280,6 +4285,117 @@ exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService
|
|
|
4280
4285
|
throw error;
|
|
4281
4286
|
}
|
|
4282
4287
|
}
|
|
4288
|
+
/**
|
|
4289
|
+
* Resolves the real Graph instance ids of a recurring series over a date window — the
|
|
4290
|
+
* per-occurrence exception model needs these to PATCH an occurrence directly rather than the
|
|
4291
|
+
* series master, so an edit never touches the master's own `start`/`recurrence.range`.
|
|
4292
|
+
*/
|
|
4293
|
+
async getEventInstances(request, integration, loggedInUserId) {
|
|
4294
|
+
try {
|
|
4295
|
+
const mailboxEmail = this.pickMailbox(request.organizerUserEmail, request.resourceEmail);
|
|
4296
|
+
this.assertMailbox(mailboxEmail);
|
|
4297
|
+
this.assertEventId(request.seriesEventId);
|
|
4298
|
+
const url = MICROSOFT_GRAPH_PATHS.userCalendarEventInstances(mailboxEmail, request.seriesEventId, `${request.startDateLabel}T00:00:00`, `${request.endDateLabel}T23:59:59`);
|
|
4299
|
+
this.logger.info(loggedInUserId, this.getEventInstances.name, this.fileName, "List Microsoft Graph series instances", {
|
|
4300
|
+
mailboxEmail,
|
|
4301
|
+
seriesEventId: request.seriesEventId,
|
|
4302
|
+
path: url
|
|
4303
|
+
});
|
|
4304
|
+
const response = await this.microsoftApiClient.apiCall({
|
|
4305
|
+
apiMethod: HTTP_METHOD.GET,
|
|
4306
|
+
url
|
|
4307
|
+
}, integration, loggedInUserId);
|
|
4308
|
+
const events = graphEventsToInstances(response);
|
|
4309
|
+
this.logger.info(loggedInUserId, this.getEventInstances.name, this.fileName, "Listed Microsoft Graph series instances", {
|
|
4310
|
+
mailboxEmail,
|
|
4311
|
+
seriesEventId: request.seriesEventId,
|
|
4312
|
+
count: events.length
|
|
4313
|
+
});
|
|
4314
|
+
return {
|
|
4315
|
+
events
|
|
4316
|
+
};
|
|
4317
|
+
} catch (error) {
|
|
4318
|
+
this.logger.error(loggedInUserId, this.getEventInstances.name, this.fileName, "Error listing Microsoft Graph series instances", error);
|
|
4319
|
+
throw error;
|
|
4320
|
+
}
|
|
4321
|
+
}
|
|
4322
|
+
/**
|
|
4323
|
+
* PATCHes a set of a series' own instances as provider-native exceptions, batched via Graph
|
|
4324
|
+
* `$batch` (≤20 sub-requests per call). Never throws on a partial failure — each instance's
|
|
4325
|
+
* outcome is reported individually so the caller can persist what succeeded and retry the rest.
|
|
4326
|
+
*/
|
|
4327
|
+
async updateEventInstances(request, integration, loggedInUserId) {
|
|
4328
|
+
try {
|
|
4329
|
+
const mailboxEmail = this.pickMailbox(request.organizerUserEmail, request.resourceEmail);
|
|
4330
|
+
this.assertMailbox(mailboxEmail);
|
|
4331
|
+
this.logger.info(loggedInUserId, this.updateEventInstances.name, this.fileName, "Batch-update Microsoft Graph series instances", {
|
|
4332
|
+
mailboxEmail,
|
|
4333
|
+
instanceCount: request.updates.length
|
|
4334
|
+
});
|
|
4335
|
+
const results = [];
|
|
4336
|
+
for (const chunk of this.chunkInstanceUpdates(request.updates)) {
|
|
4337
|
+
const batchRequests = chunk.map((update, index) => ({
|
|
4338
|
+
id: String(index),
|
|
4339
|
+
method: "PATCH",
|
|
4340
|
+
url: MICROSOFT_GRAPH_PATHS.userCalendarEvent(mailboxEmail, update.instanceId),
|
|
4341
|
+
body: toGraphEvent(update.event, {
|
|
4342
|
+
targetMailbox: mailboxEmail
|
|
4343
|
+
})
|
|
4344
|
+
}));
|
|
4345
|
+
const batchResponse = await this.microsoftApiClient.apiCall({
|
|
4346
|
+
apiMethod: HTTP_METHOD.POST,
|
|
4347
|
+
url: MICROSOFT_GRAPH_PATHS.batch,
|
|
4348
|
+
body: {
|
|
4349
|
+
requests: batchRequests
|
|
4350
|
+
}
|
|
4351
|
+
}, integration, loggedInUserId);
|
|
4352
|
+
const responseById = new Map(batchResponse.responses.map((entry) => [
|
|
4353
|
+
entry.id,
|
|
4354
|
+
entry
|
|
4355
|
+
]));
|
|
4356
|
+
chunk.forEach((update, index) => {
|
|
4357
|
+
const entry = responseById.get(String(index));
|
|
4358
|
+
if (!entry || entry.status >= 300) {
|
|
4359
|
+
this.logger.warn(loggedInUserId, this.updateEventInstances.name, this.fileName, "Failed to update a series instance", {
|
|
4360
|
+
mailboxEmail,
|
|
4361
|
+
instanceId: update.instanceId,
|
|
4362
|
+
status: entry?.status
|
|
4363
|
+
});
|
|
4364
|
+
results.push({
|
|
4365
|
+
instanceId: update.instanceId,
|
|
4366
|
+
error: entry ? `Graph responded ${entry.status}` : "No batch response entry"
|
|
4367
|
+
});
|
|
4368
|
+
return;
|
|
4369
|
+
}
|
|
4370
|
+
results.push({
|
|
4371
|
+
instanceId: update.instanceId,
|
|
4372
|
+
ref: graphEventToRef(entry.body ?? {}, {
|
|
4373
|
+
organizerUserEmail: request.organizerUserEmail
|
|
4374
|
+
})
|
|
4375
|
+
});
|
|
4376
|
+
});
|
|
4377
|
+
}
|
|
4378
|
+
this.logger.info(loggedInUserId, this.updateEventInstances.name, this.fileName, "Batch-updated Microsoft Graph series instances", {
|
|
4379
|
+
mailboxEmail,
|
|
4380
|
+
succeeded: results.filter((result) => !result.error).length,
|
|
4381
|
+
failed: results.filter((result) => result.error).length
|
|
4382
|
+
});
|
|
4383
|
+
return {
|
|
4384
|
+
results
|
|
4385
|
+
};
|
|
4386
|
+
} catch (error) {
|
|
4387
|
+
this.logger.error(loggedInUserId, this.updateEventInstances.name, this.fileName, "Error batch-updating Microsoft Graph series instances", error);
|
|
4388
|
+
throw error;
|
|
4389
|
+
}
|
|
4390
|
+
}
|
|
4391
|
+
/** Splits instance updates into Graph-`$batch`-sized chunks (≤20 sub-requests each). */
|
|
4392
|
+
chunkInstanceUpdates(updates) {
|
|
4393
|
+
const chunks = [];
|
|
4394
|
+
for (let i = 0; i < updates.length; i += GRAPH_BATCH_MAX_SIZE) {
|
|
4395
|
+
chunks.push(updates.slice(i, i + GRAPH_BATCH_MAX_SIZE));
|
|
4396
|
+
}
|
|
4397
|
+
return chunks;
|
|
4398
|
+
}
|
|
4283
4399
|
async deleteGraphEvent(mailboxEmail, eventId, integration, loggedInUserId) {
|
|
4284
4400
|
this.assertMailbox(mailboxEmail);
|
|
4285
4401
|
this.assertEventId(eventId);
|
|
@@ -4975,6 +5091,12 @@ exports.MicrosoftCalendarBookingHandler = class MicrosoftCalendarBookingHandler
|
|
|
4975
5091
|
async acceptCalendarBooking(request, integration, loggedInUserId) {
|
|
4976
5092
|
return this.microsoftCalendarBookingService.acceptEvent(request, integration, loggedInUserId);
|
|
4977
5093
|
}
|
|
5094
|
+
async getCalendarBookingInstances(request, integration, loggedInUserId) {
|
|
5095
|
+
return this.microsoftCalendarBookingService.getEventInstances(request, integration, loggedInUserId);
|
|
5096
|
+
}
|
|
5097
|
+
async updateCalendarBookingInstances(request, integration, loggedInUserId) {
|
|
5098
|
+
return this.microsoftCalendarBookingService.updateEventInstances(request, integration, loggedInUserId);
|
|
5099
|
+
}
|
|
4978
5100
|
};
|
|
4979
5101
|
exports.MicrosoftCalendarBookingHandler = _ts_decorate36([
|
|
4980
5102
|
common.Injectable(),
|