@dv4resi/dvss-backend-module-calendar-im 0.0.11 → 0.0.12
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 +66 -1
- package/dist/index.js +156 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1847,6 +1847,64 @@ interface IBookingManagementContext {
|
|
|
1847
1847
|
integration: ICapabilityIntegration;
|
|
1848
1848
|
loggedInUserId: bigint;
|
|
1849
1849
|
}
|
|
1850
|
+
interface ISyncEventsRequest extends IMailboxScope {
|
|
1851
|
+
resourceEmail: string;
|
|
1852
|
+
syncToken?: string;
|
|
1853
|
+
startDateLabel?: string;
|
|
1854
|
+
endDateLabel?: string;
|
|
1855
|
+
timeZone?: string;
|
|
1856
|
+
}
|
|
1857
|
+
interface ICalendarInboundRecurrence {
|
|
1858
|
+
pattern: {
|
|
1859
|
+
type: string;
|
|
1860
|
+
interval: number;
|
|
1861
|
+
daysOfWeek?: string[];
|
|
1862
|
+
firstDayOfWeek?: string;
|
|
1863
|
+
dayOfMonth?: number;
|
|
1864
|
+
month?: number;
|
|
1865
|
+
index?: string;
|
|
1866
|
+
};
|
|
1867
|
+
range: {
|
|
1868
|
+
type: string;
|
|
1869
|
+
startDate: string;
|
|
1870
|
+
endDate?: string;
|
|
1871
|
+
numberOfOccurrences?: number;
|
|
1872
|
+
recurrenceTimeZone?: string;
|
|
1873
|
+
};
|
|
1874
|
+
}
|
|
1875
|
+
interface ICalendarInboundSyncEvent {
|
|
1876
|
+
id?: string;
|
|
1877
|
+
subject?: string;
|
|
1878
|
+
body?: string;
|
|
1879
|
+
start?: {
|
|
1880
|
+
dateTime?: string;
|
|
1881
|
+
timeZone?: string;
|
|
1882
|
+
};
|
|
1883
|
+
end?: {
|
|
1884
|
+
dateTime?: string;
|
|
1885
|
+
timeZone?: string;
|
|
1886
|
+
};
|
|
1887
|
+
location?: string;
|
|
1888
|
+
resourceId?: string;
|
|
1889
|
+
type?: string;
|
|
1890
|
+
seriesMasterId?: string;
|
|
1891
|
+
transactionId?: string;
|
|
1892
|
+
isCancelled?: boolean;
|
|
1893
|
+
organizerEmail?: string;
|
|
1894
|
+
showAs?: string;
|
|
1895
|
+
attendees?: Array<{
|
|
1896
|
+
email: string;
|
|
1897
|
+
name?: string;
|
|
1898
|
+
type?: string;
|
|
1899
|
+
}>;
|
|
1900
|
+
recurrence?: ICalendarInboundRecurrence;
|
|
1901
|
+
responseStatus?: string;
|
|
1902
|
+
providerPayload?: Record<string, unknown>;
|
|
1903
|
+
}
|
|
1904
|
+
interface ISyncEventsResponse {
|
|
1905
|
+
events: ICalendarInboundSyncEvent[];
|
|
1906
|
+
nextSyncToken?: string;
|
|
1907
|
+
}
|
|
1850
1908
|
|
|
1851
1909
|
interface ICalendarWebhookSubscription {
|
|
1852
1910
|
id?: string;
|
|
@@ -2190,6 +2248,7 @@ declare abstract class BaseCalendarBookingManagement {
|
|
|
2190
2248
|
abstract cancelEvent(request: ICancelEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
|
|
2191
2249
|
abstract deleteEvent(request: IDeleteEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
|
|
2192
2250
|
abstract getEvents(request: IGetEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
|
|
2251
|
+
abstract syncEvents?(request: ISyncEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISyncEventsResponse>;
|
|
2193
2252
|
abstract getEvent?(request: IGetCalendarEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IBookingEventRef>;
|
|
2194
2253
|
abstract acceptEvent?(request: IAcceptEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
|
|
2195
2254
|
abstract getEventInstances(request: IGetEventInstancesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
|
|
@@ -2573,6 +2632,10 @@ declare class MicrosoftCalendarBookingService extends BaseCalendarBookingManagem
|
|
|
2573
2632
|
private organizerUserMailbox;
|
|
2574
2633
|
private assertMailbox;
|
|
2575
2634
|
private assertEventId;
|
|
2635
|
+
syncEvents(request: ISyncEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISyncEventsResponse>;
|
|
2636
|
+
private resolveDeltaUrl;
|
|
2637
|
+
private resolveSeedWindow;
|
|
2638
|
+
private toGraphRelativePath;
|
|
2576
2639
|
}
|
|
2577
2640
|
|
|
2578
2641
|
declare class MicrosoftCalendarWebhookService extends BaseCalendarWebhookManagement {
|
|
@@ -2643,6 +2706,7 @@ declare abstract class ICalendarBookingHandler {
|
|
|
2643
2706
|
abstract getCalendarBookings(request: IGetEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
|
|
2644
2707
|
abstract getCalendarBooking(request: IGetCalendarEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IBookingEventRef>;
|
|
2645
2708
|
abstract acceptCalendarBooking(request: IAcceptEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
|
|
2709
|
+
abstract syncCalendarBookings(request: ISyncEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISyncEventsResponse>;
|
|
2646
2710
|
abstract getCalendarBookingInstances(request: IGetEventInstancesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
|
|
2647
2711
|
abstract updateCalendarBookingInstances(request: IUpdateEventInstancesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IUpdateEventInstancesResponse>;
|
|
2648
2712
|
}
|
|
@@ -2681,6 +2745,7 @@ declare class MicrosoftCalendarBookingHandler extends ICalendarBookingHandler {
|
|
|
2681
2745
|
getCalendarBookings(request: IGetEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
|
|
2682
2746
|
getCalendarBooking(request: IGetCalendarEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IBookingEventRef>;
|
|
2683
2747
|
acceptCalendarBooking(request: IAcceptEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
|
|
2748
|
+
syncCalendarBookings(request: ISyncEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISyncEventsResponse>;
|
|
2684
2749
|
getCalendarBookingInstances(request: IGetEventInstancesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
|
|
2685
2750
|
updateCalendarBookingInstances(request: IUpdateEventInstancesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IUpdateEventInstancesResponse>;
|
|
2686
2751
|
}
|
|
@@ -2742,4 +2807,4 @@ declare class CalendarIntegrationConfigurationAdapterFactory extends AdapterFact
|
|
|
2742
2807
|
constructor(microsoftCalendarIntegrationConfigurationHandler: MicrosoftCalendarIntegrationConfigurationHandler);
|
|
2743
2808
|
}
|
|
2744
2809
|
|
|
2745
|
-
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 };
|
|
2810
|
+
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, type ICalendarInboundRecurrence, type ICalendarInboundSyncEvent, 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 ISyncEventsRequest, type ISyncEventsResponse, 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
|
@@ -4102,6 +4102,57 @@ function omitUndefined(value) {
|
|
|
4102
4102
|
return Object.fromEntries(Object.entries(value).filter(([, entry]) => entry !== void 0));
|
|
4103
4103
|
}
|
|
4104
4104
|
__name(omitUndefined, "omitUndefined");
|
|
4105
|
+
function fromGraphEvent(graph, options) {
|
|
4106
|
+
const providerPayload = {
|
|
4107
|
+
...graph
|
|
4108
|
+
};
|
|
4109
|
+
return {
|
|
4110
|
+
id: graph.id,
|
|
4111
|
+
subject: graph.subject ?? "",
|
|
4112
|
+
body: graph.body?.content,
|
|
4113
|
+
start: graph.start ?? {
|
|
4114
|
+
dateTime: "",
|
|
4115
|
+
timeZone: ""
|
|
4116
|
+
},
|
|
4117
|
+
end: graph.end ?? {
|
|
4118
|
+
dateTime: "",
|
|
4119
|
+
timeZone: ""
|
|
4120
|
+
},
|
|
4121
|
+
location: graph.location?.displayName,
|
|
4122
|
+
resourceId: options?.resourceId,
|
|
4123
|
+
recurrence: graph.recurrence ? {
|
|
4124
|
+
pattern: {
|
|
4125
|
+
type: graph.recurrence.pattern?.type ?? "",
|
|
4126
|
+
interval: graph.recurrence.pattern?.interval ?? 1,
|
|
4127
|
+
daysOfWeek: graph.recurrence.pattern?.daysOfWeek,
|
|
4128
|
+
firstDayOfWeek: graph.recurrence.pattern?.firstDayOfWeek,
|
|
4129
|
+
dayOfMonth: graph.recurrence.pattern?.dayOfMonth,
|
|
4130
|
+
month: graph.recurrence.pattern?.month,
|
|
4131
|
+
index: graph.recurrence.pattern?.index
|
|
4132
|
+
},
|
|
4133
|
+
range: {
|
|
4134
|
+
type: graph.recurrence.range?.type ?? "",
|
|
4135
|
+
startDate: graph.recurrence.range?.startDate ?? "",
|
|
4136
|
+
endDate: graph.recurrence.range?.endDate,
|
|
4137
|
+
numberOfOccurrences: graph.recurrence.range?.numberOfOccurrences,
|
|
4138
|
+
recurrenceTimeZone: graph.recurrence.range?.recurrenceTimeZone
|
|
4139
|
+
}
|
|
4140
|
+
} : void 0,
|
|
4141
|
+
attendees: graph.attendees?.filter((attendee) => Boolean(attendee.emailAddress?.address)).map((attendee) => ({
|
|
4142
|
+
email: attendee.emailAddress?.address ?? "",
|
|
4143
|
+
name: attendee.emailAddress?.name,
|
|
4144
|
+
type: attendee.type
|
|
4145
|
+
})),
|
|
4146
|
+
organizerEmail: graph.organizer?.emailAddress?.address,
|
|
4147
|
+
showAs: graph.showAs,
|
|
4148
|
+
isCancelled: graph.isCancelled === true || graph["@removed"] != null,
|
|
4149
|
+
type: graph.type,
|
|
4150
|
+
seriesMasterId: graph.seriesMasterId,
|
|
4151
|
+
transactionId: graph.transactionId,
|
|
4152
|
+
providerPayload
|
|
4153
|
+
};
|
|
4154
|
+
}
|
|
4155
|
+
__name(fromGraphEvent, "fromGraphEvent");
|
|
4105
4156
|
|
|
4106
4157
|
// ../../packages/dvss-integration-microsoft/src/capabilities/booking-management/booking-management.service.ts
|
|
4107
4158
|
function _ts_decorate28(decorators, target, key, desc2) {
|
|
@@ -4560,6 +4611,108 @@ exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService
|
|
|
4560
4611
|
throw new dvssBackendModuleUtility.CustomException("BAD_REQUEST", "eventId is required");
|
|
4561
4612
|
}
|
|
4562
4613
|
}
|
|
4614
|
+
async syncEvents(request, integration, loggedInUserId) {
|
|
4615
|
+
try {
|
|
4616
|
+
this.assertMailbox(request.resourceEmail);
|
|
4617
|
+
const mailboxEmail = request.resourceEmail;
|
|
4618
|
+
let url = this.resolveDeltaUrl(request, mailboxEmail);
|
|
4619
|
+
this.logger.info(loggedInUserId, this.syncEvents.name, this.fileName, "Sync Microsoft Graph calendar events (delta)", {
|
|
4620
|
+
mailboxEmail,
|
|
4621
|
+
resourceId: request.resourceEmail,
|
|
4622
|
+
hasSyncToken: Boolean(request.syncToken),
|
|
4623
|
+
path: url
|
|
4624
|
+
});
|
|
4625
|
+
const events = [];
|
|
4626
|
+
let nextSyncToken;
|
|
4627
|
+
let page = 0;
|
|
4628
|
+
while (url) {
|
|
4629
|
+
page += 1;
|
|
4630
|
+
const response = await this.microsoftApiClient.apiCall({
|
|
4631
|
+
apiMethod: HTTP_METHOD.GET,
|
|
4632
|
+
url,
|
|
4633
|
+
headers: {
|
|
4634
|
+
["Prefer"]: "odata.maxpagesize=50"
|
|
4635
|
+
}
|
|
4636
|
+
}, integration, loggedInUserId);
|
|
4637
|
+
for (const graphEvent of response.value ?? []) {
|
|
4638
|
+
events.push(fromGraphEvent(graphEvent, {
|
|
4639
|
+
resourceId: request.resourceEmail,
|
|
4640
|
+
organizerUserEmail: this.organizerUserMailbox(request.organizerUserEmail)
|
|
4641
|
+
}));
|
|
4642
|
+
}
|
|
4643
|
+
const nextLink = response["@odata.nextLink"];
|
|
4644
|
+
const deltaLink = response["@odata.deltaLink"];
|
|
4645
|
+
if (nextLink) {
|
|
4646
|
+
url = this.toGraphRelativePath(nextLink);
|
|
4647
|
+
continue;
|
|
4648
|
+
}
|
|
4649
|
+
nextSyncToken = deltaLink;
|
|
4650
|
+
url = "";
|
|
4651
|
+
}
|
|
4652
|
+
this.logger.info(loggedInUserId, this.syncEvents.name, this.fileName, "Synced Microsoft Graph calendar events (delta)", {
|
|
4653
|
+
mailboxEmail,
|
|
4654
|
+
resourceId: request.resourceEmail,
|
|
4655
|
+
count: events.length,
|
|
4656
|
+
pages: page,
|
|
4657
|
+
hasNextSyncToken: Boolean(nextSyncToken)
|
|
4658
|
+
});
|
|
4659
|
+
return {
|
|
4660
|
+
events,
|
|
4661
|
+
nextSyncToken
|
|
4662
|
+
};
|
|
4663
|
+
} catch (error) {
|
|
4664
|
+
this.logger.error(loggedInUserId, this.syncEvents.name, this.fileName, "Error syncing Microsoft Graph calendar events (delta)", error);
|
|
4665
|
+
throw error;
|
|
4666
|
+
}
|
|
4667
|
+
}
|
|
4668
|
+
resolveDeltaUrl(request, mailboxEmail) {
|
|
4669
|
+
if (request.syncToken?.trim()) {
|
|
4670
|
+
return this.toGraphRelativePath(request.syncToken.trim());
|
|
4671
|
+
}
|
|
4672
|
+
const window = this.resolveSeedWindow(request);
|
|
4673
|
+
return MICROSOFT_GRAPH_PATHS.userCalendarViewDelta(mailboxEmail, window.startDateTime, window.endDateTime);
|
|
4674
|
+
}
|
|
4675
|
+
resolveSeedWindow(request) {
|
|
4676
|
+
if (request.startDateLabel && request.endDateLabel) {
|
|
4677
|
+
return {
|
|
4678
|
+
startDateTime: `${request.startDateLabel}T00:00:00`,
|
|
4679
|
+
endDateTime: `${request.endDateLabel}T23:59:59`
|
|
4680
|
+
};
|
|
4681
|
+
}
|
|
4682
|
+
const start = /* @__PURE__ */ new Date();
|
|
4683
|
+
const end = new Date(start);
|
|
4684
|
+
end.setUTCFullYear(end.getUTCFullYear() + MICROSOFT_CALENDAR_DELTA_DEFAULT_WINDOW_YEARS);
|
|
4685
|
+
return {
|
|
4686
|
+
startDateTime: start.toISOString().replace("Z", ""),
|
|
4687
|
+
endDateTime: end.toISOString().replace("Z", "")
|
|
4688
|
+
};
|
|
4689
|
+
}
|
|
4690
|
+
/**
|
|
4691
|
+
* Traffic gateway always prefixes platform baseUrl — convert absolute Graph next/delta
|
|
4692
|
+
* links into path+query relative to `/v1.0`.
|
|
4693
|
+
*/
|
|
4694
|
+
toGraphRelativePath(urlOrPath) {
|
|
4695
|
+
if (urlOrPath.startsWith("/")) {
|
|
4696
|
+
return urlOrPath;
|
|
4697
|
+
}
|
|
4698
|
+
const baseNoSlash = MICROSOFT_DEFAULT_GRAPH_BASE_URL.replace(/\/$/, "");
|
|
4699
|
+
if (urlOrPath.startsWith(baseNoSlash)) {
|
|
4700
|
+
const rest = urlOrPath.slice(baseNoSlash.length);
|
|
4701
|
+
return rest.startsWith("/") ? rest : `/${rest}`;
|
|
4702
|
+
}
|
|
4703
|
+
try {
|
|
4704
|
+
const parsed = new URL(urlOrPath);
|
|
4705
|
+
let path = `${parsed.pathname}${parsed.search}`;
|
|
4706
|
+
if (path.startsWith("/v1.0/")) {
|
|
4707
|
+
path = path.slice("/v1.0".length);
|
|
4708
|
+
} else if (path === "/v1.0") {
|
|
4709
|
+
path = "/";
|
|
4710
|
+
}
|
|
4711
|
+
return path.startsWith("/") ? path : `/${path}`;
|
|
4712
|
+
} catch {
|
|
4713
|
+
return urlOrPath.startsWith("/") ? urlOrPath : `/${urlOrPath}`;
|
|
4714
|
+
}
|
|
4715
|
+
}
|
|
4563
4716
|
};
|
|
4564
4717
|
exports.MicrosoftCalendarBookingService = _ts_decorate28([
|
|
4565
4718
|
common.Injectable(),
|
|
@@ -5171,6 +5324,9 @@ exports.MicrosoftCalendarBookingHandler = class MicrosoftCalendarBookingHandler
|
|
|
5171
5324
|
async acceptCalendarBooking(request, integration, loggedInUserId) {
|
|
5172
5325
|
return this.microsoftCalendarBookingService.acceptEvent(request, integration, loggedInUserId);
|
|
5173
5326
|
}
|
|
5327
|
+
async syncCalendarBookings(request, integration, loggedInUserId) {
|
|
5328
|
+
return this.microsoftCalendarBookingService.syncEvents(request, integration, loggedInUserId);
|
|
5329
|
+
}
|
|
5174
5330
|
async getCalendarBookingInstances(request, integration, loggedInUserId) {
|
|
5175
5331
|
return this.microsoftCalendarBookingService.getEventInstances(request, integration, loggedInUserId);
|
|
5176
5332
|
}
|