@dv4resi/dvss-backend-module-calendar-im 0.0.11 → 0.0.13
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 +81 -4
- package/dist/index.js +171 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpService } from '@nestjs/axios';
|
|
2
2
|
import { LoggerService, GraphQLContext, IMedia, MASK_STRATEGY_ENUM, SecretProvider, AddAPIResponse } from '@dv4resi/dvss-backend-module-utility';
|
|
3
|
-
import { schema, CAPABILITY_PROVIDER_INTEGRATION_ENUM as CAPABILITY_PROVIDER_INTEGRATION_ENUM$1, SORTING_ORDER_ENUM, CommonValidationDatabaseService, RedisCacheStoreService } from '@dv4resi/dvss-backend-module-datastore';
|
|
3
|
+
import { schema, CAPABILITY_PROVIDER_INTEGRATION_ENUM as CAPABILITY_PROVIDER_INTEGRATION_ENUM$1, SORTING_ORDER_ENUM, BEHAVIOUR_TYPE_ENUM, CommonValidationDatabaseService, RedisCacheStoreService } from '@dv4resi/dvss-backend-module-datastore';
|
|
4
4
|
import { CONFIGURED_FOR_TYPE_ENUM, MEDIA_PROVIDER_ENUM, IAddUpdateAPIStatusResponseBigInt, DAY_OF_WEEK, OFFERING_RESOURCE_TYPE, STATUS, OFFERING_BOOKING_TIME_TYPE, IScheduleConfig } from '@dv4resi/dvss-backend-module-datastore/dist/datastore/models';
|
|
5
5
|
export { BEHAVIOUR_TYPE_ENUM, DAY_OF_WEEK, IScheduleConfig, OFFERING_BOOKING_TIME_TYPE, OFFERING_BOOKING_TYPE_ENUM, SCHEDULE_MONTHLY_UNIT, SCHEDULE_REPEAT_TYPE } from '@dv4resi/dvss-backend-module-datastore/dist/datastore/models';
|
|
6
6
|
import { CAPABILITY_INTEGRATION_STATUS_ENUM, CAPABILITY_RESOURCE_AVAILABLE_FOR_ENUM } from '@dv4resi/dvss-backend-module-datastore/dist/datastore/models/capability-integration.model';
|
|
@@ -1197,13 +1197,18 @@ interface IGetCustomerPayments {
|
|
|
1197
1197
|
records: ICustomerPaymentRecord[];
|
|
1198
1198
|
hasMorePage: boolean;
|
|
1199
1199
|
}
|
|
1200
|
+
interface IOperator {
|
|
1201
|
+
id: string;
|
|
1202
|
+
name: string;
|
|
1203
|
+
type: BEHAVIOUR_TYPE_ENUM;
|
|
1204
|
+
}
|
|
1200
1205
|
interface ICustomerPaymentRecord {
|
|
1201
1206
|
customerId: string;
|
|
1202
1207
|
date: string;
|
|
1203
1208
|
dueInExcess: number;
|
|
1204
1209
|
invoiceNumbers: string;
|
|
1205
1210
|
mode: string;
|
|
1206
|
-
operator
|
|
1211
|
+
operator?: IOperator;
|
|
1207
1212
|
paymentId: string;
|
|
1208
1213
|
paymentNumber: string;
|
|
1209
1214
|
referenceId: string;
|
|
@@ -1847,6 +1852,64 @@ interface IBookingManagementContext {
|
|
|
1847
1852
|
integration: ICapabilityIntegration;
|
|
1848
1853
|
loggedInUserId: bigint;
|
|
1849
1854
|
}
|
|
1855
|
+
interface ISyncEventsRequest extends IMailboxScope {
|
|
1856
|
+
resourceEmail: string;
|
|
1857
|
+
syncToken?: string;
|
|
1858
|
+
startDateLabel?: string;
|
|
1859
|
+
endDateLabel?: string;
|
|
1860
|
+
timeZone?: string;
|
|
1861
|
+
}
|
|
1862
|
+
interface ICalendarInboundRecurrence {
|
|
1863
|
+
pattern: {
|
|
1864
|
+
type: string;
|
|
1865
|
+
interval: number;
|
|
1866
|
+
daysOfWeek?: string[];
|
|
1867
|
+
firstDayOfWeek?: string;
|
|
1868
|
+
dayOfMonth?: number;
|
|
1869
|
+
month?: number;
|
|
1870
|
+
index?: string;
|
|
1871
|
+
};
|
|
1872
|
+
range: {
|
|
1873
|
+
type: string;
|
|
1874
|
+
startDate: string;
|
|
1875
|
+
endDate?: string;
|
|
1876
|
+
numberOfOccurrences?: number;
|
|
1877
|
+
recurrenceTimeZone?: string;
|
|
1878
|
+
};
|
|
1879
|
+
}
|
|
1880
|
+
interface ICalendarInboundSyncEvent {
|
|
1881
|
+
id?: string;
|
|
1882
|
+
subject?: string;
|
|
1883
|
+
body?: string;
|
|
1884
|
+
start?: {
|
|
1885
|
+
dateTime?: string;
|
|
1886
|
+
timeZone?: string;
|
|
1887
|
+
};
|
|
1888
|
+
end?: {
|
|
1889
|
+
dateTime?: string;
|
|
1890
|
+
timeZone?: string;
|
|
1891
|
+
};
|
|
1892
|
+
location?: string;
|
|
1893
|
+
resourceId?: string;
|
|
1894
|
+
type?: string;
|
|
1895
|
+
seriesMasterId?: string;
|
|
1896
|
+
transactionId?: string;
|
|
1897
|
+
isCancelled?: boolean;
|
|
1898
|
+
organizerEmail?: string;
|
|
1899
|
+
showAs?: string;
|
|
1900
|
+
attendees?: Array<{
|
|
1901
|
+
email: string;
|
|
1902
|
+
name?: string;
|
|
1903
|
+
type?: string;
|
|
1904
|
+
}>;
|
|
1905
|
+
recurrence?: ICalendarInboundRecurrence;
|
|
1906
|
+
responseStatus?: string;
|
|
1907
|
+
providerPayload?: Record<string, unknown>;
|
|
1908
|
+
}
|
|
1909
|
+
interface ISyncEventsResponse {
|
|
1910
|
+
events: ICalendarInboundSyncEvent[];
|
|
1911
|
+
nextSyncToken?: string;
|
|
1912
|
+
}
|
|
1850
1913
|
|
|
1851
1914
|
interface ICalendarWebhookSubscription {
|
|
1852
1915
|
id?: string;
|
|
@@ -2190,6 +2253,7 @@ declare abstract class BaseCalendarBookingManagement {
|
|
|
2190
2253
|
abstract cancelEvent(request: ICancelEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
|
|
2191
2254
|
abstract deleteEvent(request: IDeleteEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
|
|
2192
2255
|
abstract getEvents(request: IGetEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
|
|
2256
|
+
abstract syncEvents?(request: ISyncEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISyncEventsResponse>;
|
|
2193
2257
|
abstract getEvent?(request: IGetCalendarEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IBookingEventRef>;
|
|
2194
2258
|
abstract acceptEvent?(request: IAcceptEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
|
|
2195
2259
|
abstract getEventInstances(request: IGetEventInstancesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
|
|
@@ -2351,6 +2415,7 @@ interface IMicrosoftAccessDetails {
|
|
|
2351
2415
|
interface IMicrosoftConfig {
|
|
2352
2416
|
platformConfig: IMicrosoftPlatformConfig;
|
|
2353
2417
|
integrationConfig: IMicrosoftIntegrationConfig;
|
|
2418
|
+
supportResourceSubscription?: boolean;
|
|
2354
2419
|
accessDetails?: IMicrosoftAccessDetails;
|
|
2355
2420
|
}
|
|
2356
2421
|
interface IMicrosoftTokenResponse {
|
|
@@ -2573,6 +2638,10 @@ declare class MicrosoftCalendarBookingService extends BaseCalendarBookingManagem
|
|
|
2573
2638
|
private organizerUserMailbox;
|
|
2574
2639
|
private assertMailbox;
|
|
2575
2640
|
private assertEventId;
|
|
2641
|
+
syncEvents(request: ISyncEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISyncEventsResponse>;
|
|
2642
|
+
private resolveDeltaUrl;
|
|
2643
|
+
private resolveSeedWindow;
|
|
2644
|
+
private toGraphRelativePath;
|
|
2576
2645
|
}
|
|
2577
2646
|
|
|
2578
2647
|
declare class MicrosoftCalendarWebhookService extends BaseCalendarWebhookManagement {
|
|
@@ -2620,7 +2689,13 @@ declare const MICROSOFT_DEFAULT_GRAPH_BASE_URL = "https://graph.microsoft.com/v1
|
|
|
2620
2689
|
declare const MICROSOFT_DEFAULT_AUTH_URL = "https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token";
|
|
2621
2690
|
|
|
2622
2691
|
type MicrosoftIntegrationConfigInput = Pick<IMicrosoftIntegrationConfig, 'tenantId' | 'clientId' | 'clientSecret'>;
|
|
2623
|
-
|
|
2692
|
+
type ExistingMicrosoftConfig = {
|
|
2693
|
+
platformConfig?: Partial<IMicrosoftPlatformConfig>;
|
|
2694
|
+
integrationConfig?: Partial<IMicrosoftIntegrationConfig>;
|
|
2695
|
+
supportResourceSubscription?: boolean;
|
|
2696
|
+
accessDetails?: IMicrosoftConfig['accessDetails'];
|
|
2697
|
+
};
|
|
2698
|
+
declare function buildMicrosoftIntegrationConfig(integrationConfig: MicrosoftIntegrationConfigInput, existing?: ExistingMicrosoftConfig): IMicrosoftConfig;
|
|
2624
2699
|
|
|
2625
2700
|
declare const MICROSOFT_SECURE_STORAGE = "MICROSOFT_INTEGRATION_CONFIG_SECURE_STORAGE";
|
|
2626
2701
|
declare function getMicrosoftKmsKeyId(): string;
|
|
@@ -2643,6 +2718,7 @@ declare abstract class ICalendarBookingHandler {
|
|
|
2643
2718
|
abstract getCalendarBookings(request: IGetEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
|
|
2644
2719
|
abstract getCalendarBooking(request: IGetCalendarEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IBookingEventRef>;
|
|
2645
2720
|
abstract acceptCalendarBooking(request: IAcceptEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
|
|
2721
|
+
abstract syncCalendarBookings(request: ISyncEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISyncEventsResponse>;
|
|
2646
2722
|
abstract getCalendarBookingInstances(request: IGetEventInstancesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
|
|
2647
2723
|
abstract updateCalendarBookingInstances(request: IUpdateEventInstancesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IUpdateEventInstancesResponse>;
|
|
2648
2724
|
}
|
|
@@ -2681,6 +2757,7 @@ declare class MicrosoftCalendarBookingHandler extends ICalendarBookingHandler {
|
|
|
2681
2757
|
getCalendarBookings(request: IGetEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
|
|
2682
2758
|
getCalendarBooking(request: IGetCalendarEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IBookingEventRef>;
|
|
2683
2759
|
acceptCalendarBooking(request: IAcceptEventRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
|
|
2760
|
+
syncCalendarBookings(request: ISyncEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISyncEventsResponse>;
|
|
2684
2761
|
getCalendarBookingInstances(request: IGetEventInstancesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetEventsResponse>;
|
|
2685
2762
|
updateCalendarBookingInstances(request: IUpdateEventInstancesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IUpdateEventInstancesResponse>;
|
|
2686
2763
|
}
|
|
@@ -2742,4 +2819,4 @@ declare class CalendarIntegrationConfigurationAdapterFactory extends AdapterFact
|
|
|
2742
2819
|
constructor(microsoftCalendarIntegrationConfigurationHandler: MicrosoftCalendarIntegrationConfigurationHandler);
|
|
2743
2820
|
}
|
|
2744
2821
|
|
|
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 };
|
|
2822
|
+
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 IOperator, 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
|
@@ -3541,18 +3541,23 @@ var MICROSOFT_DEFAULT_AUTH_URL = "https://login.microsoftonline.com/{tenantId}/o
|
|
|
3541
3541
|
|
|
3542
3542
|
// ../../packages/dvss-integration-microsoft/src/common/build-microsoft-integration-config.ts
|
|
3543
3543
|
function buildMicrosoftIntegrationConfig(integrationConfig, existing) {
|
|
3544
|
-
const existingBaseUrl = existing?.platformConfig?.baseUrl.trim();
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3544
|
+
const existingBaseUrl = typeof existing?.platformConfig?.baseUrl === "string" ? existing.platformConfig.baseUrl.trim() : void 0;
|
|
3545
|
+
const platformConfig = {
|
|
3546
|
+
authUrl: MICROSOFT_DEFAULT_AUTH_URL.replace("{tenantId}", integrationConfig.tenantId),
|
|
3547
|
+
baseUrl: existingBaseUrl || MICROSOFT_DEFAULT_GRAPH_BASE_URL
|
|
3548
|
+
};
|
|
3549
|
+
const result = {
|
|
3550
|
+
platformConfig,
|
|
3550
3551
|
integrationConfig: {
|
|
3551
3552
|
tenantId: integrationConfig.tenantId,
|
|
3552
3553
|
clientId: integrationConfig.clientId,
|
|
3553
3554
|
clientSecret: integrationConfig.clientSecret
|
|
3554
3555
|
}
|
|
3555
3556
|
};
|
|
3557
|
+
if (typeof existing?.supportResourceSubscription === "boolean") {
|
|
3558
|
+
result.supportResourceSubscription = existing.supportResourceSubscription;
|
|
3559
|
+
}
|
|
3560
|
+
return result;
|
|
3556
3561
|
}
|
|
3557
3562
|
__name(buildMicrosoftIntegrationConfig, "buildMicrosoftIntegrationConfig");
|
|
3558
3563
|
|
|
@@ -4102,6 +4107,57 @@ function omitUndefined(value) {
|
|
|
4102
4107
|
return Object.fromEntries(Object.entries(value).filter(([, entry]) => entry !== void 0));
|
|
4103
4108
|
}
|
|
4104
4109
|
__name(omitUndefined, "omitUndefined");
|
|
4110
|
+
function fromGraphEvent(graph, options) {
|
|
4111
|
+
const providerPayload = {
|
|
4112
|
+
...graph
|
|
4113
|
+
};
|
|
4114
|
+
return {
|
|
4115
|
+
id: graph.id,
|
|
4116
|
+
subject: graph.subject ?? "",
|
|
4117
|
+
body: graph.body?.content,
|
|
4118
|
+
start: graph.start ?? {
|
|
4119
|
+
dateTime: "",
|
|
4120
|
+
timeZone: ""
|
|
4121
|
+
},
|
|
4122
|
+
end: graph.end ?? {
|
|
4123
|
+
dateTime: "",
|
|
4124
|
+
timeZone: ""
|
|
4125
|
+
},
|
|
4126
|
+
location: graph.location?.displayName,
|
|
4127
|
+
resourceId: options?.resourceId,
|
|
4128
|
+
recurrence: graph.recurrence ? {
|
|
4129
|
+
pattern: {
|
|
4130
|
+
type: graph.recurrence.pattern?.type ?? "",
|
|
4131
|
+
interval: graph.recurrence.pattern?.interval ?? 1,
|
|
4132
|
+
daysOfWeek: graph.recurrence.pattern?.daysOfWeek,
|
|
4133
|
+
firstDayOfWeek: graph.recurrence.pattern?.firstDayOfWeek,
|
|
4134
|
+
dayOfMonth: graph.recurrence.pattern?.dayOfMonth,
|
|
4135
|
+
month: graph.recurrence.pattern?.month,
|
|
4136
|
+
index: graph.recurrence.pattern?.index
|
|
4137
|
+
},
|
|
4138
|
+
range: {
|
|
4139
|
+
type: graph.recurrence.range?.type ?? "",
|
|
4140
|
+
startDate: graph.recurrence.range?.startDate ?? "",
|
|
4141
|
+
endDate: graph.recurrence.range?.endDate,
|
|
4142
|
+
numberOfOccurrences: graph.recurrence.range?.numberOfOccurrences,
|
|
4143
|
+
recurrenceTimeZone: graph.recurrence.range?.recurrenceTimeZone
|
|
4144
|
+
}
|
|
4145
|
+
} : void 0,
|
|
4146
|
+
attendees: graph.attendees?.filter((attendee) => Boolean(attendee.emailAddress?.address)).map((attendee) => ({
|
|
4147
|
+
email: attendee.emailAddress?.address ?? "",
|
|
4148
|
+
name: attendee.emailAddress?.name,
|
|
4149
|
+
type: attendee.type
|
|
4150
|
+
})),
|
|
4151
|
+
organizerEmail: graph.organizer?.emailAddress?.address,
|
|
4152
|
+
showAs: graph.showAs,
|
|
4153
|
+
isCancelled: graph.isCancelled === true || graph["@removed"] != null,
|
|
4154
|
+
type: graph.type,
|
|
4155
|
+
seriesMasterId: graph.seriesMasterId,
|
|
4156
|
+
transactionId: graph.transactionId,
|
|
4157
|
+
providerPayload
|
|
4158
|
+
};
|
|
4159
|
+
}
|
|
4160
|
+
__name(fromGraphEvent, "fromGraphEvent");
|
|
4105
4161
|
|
|
4106
4162
|
// ../../packages/dvss-integration-microsoft/src/capabilities/booking-management/booking-management.service.ts
|
|
4107
4163
|
function _ts_decorate28(decorators, target, key, desc2) {
|
|
@@ -4560,6 +4616,108 @@ exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService
|
|
|
4560
4616
|
throw new dvssBackendModuleUtility.CustomException("BAD_REQUEST", "eventId is required");
|
|
4561
4617
|
}
|
|
4562
4618
|
}
|
|
4619
|
+
async syncEvents(request, integration, loggedInUserId) {
|
|
4620
|
+
try {
|
|
4621
|
+
this.assertMailbox(request.resourceEmail);
|
|
4622
|
+
const mailboxEmail = request.resourceEmail;
|
|
4623
|
+
let url = this.resolveDeltaUrl(request, mailboxEmail);
|
|
4624
|
+
this.logger.info(loggedInUserId, this.syncEvents.name, this.fileName, "Sync Microsoft Graph calendar events (delta)", {
|
|
4625
|
+
mailboxEmail,
|
|
4626
|
+
resourceId: request.resourceEmail,
|
|
4627
|
+
hasSyncToken: Boolean(request.syncToken),
|
|
4628
|
+
path: url
|
|
4629
|
+
});
|
|
4630
|
+
const events = [];
|
|
4631
|
+
let nextSyncToken;
|
|
4632
|
+
let page = 0;
|
|
4633
|
+
while (url) {
|
|
4634
|
+
page += 1;
|
|
4635
|
+
const response = await this.microsoftApiClient.apiCall({
|
|
4636
|
+
apiMethod: HTTP_METHOD.GET,
|
|
4637
|
+
url,
|
|
4638
|
+
headers: {
|
|
4639
|
+
["Prefer"]: "odata.maxpagesize=50"
|
|
4640
|
+
}
|
|
4641
|
+
}, integration, loggedInUserId);
|
|
4642
|
+
for (const graphEvent of response.value ?? []) {
|
|
4643
|
+
events.push(fromGraphEvent(graphEvent, {
|
|
4644
|
+
resourceId: request.resourceEmail,
|
|
4645
|
+
organizerUserEmail: this.organizerUserMailbox(request.organizerUserEmail)
|
|
4646
|
+
}));
|
|
4647
|
+
}
|
|
4648
|
+
const nextLink = response["@odata.nextLink"];
|
|
4649
|
+
const deltaLink = response["@odata.deltaLink"];
|
|
4650
|
+
if (nextLink) {
|
|
4651
|
+
url = this.toGraphRelativePath(nextLink);
|
|
4652
|
+
continue;
|
|
4653
|
+
}
|
|
4654
|
+
nextSyncToken = deltaLink;
|
|
4655
|
+
url = "";
|
|
4656
|
+
}
|
|
4657
|
+
this.logger.info(loggedInUserId, this.syncEvents.name, this.fileName, "Synced Microsoft Graph calendar events (delta)", {
|
|
4658
|
+
mailboxEmail,
|
|
4659
|
+
resourceId: request.resourceEmail,
|
|
4660
|
+
count: events.length,
|
|
4661
|
+
pages: page,
|
|
4662
|
+
hasNextSyncToken: Boolean(nextSyncToken)
|
|
4663
|
+
});
|
|
4664
|
+
return {
|
|
4665
|
+
events,
|
|
4666
|
+
nextSyncToken
|
|
4667
|
+
};
|
|
4668
|
+
} catch (error) {
|
|
4669
|
+
this.logger.error(loggedInUserId, this.syncEvents.name, this.fileName, "Error syncing Microsoft Graph calendar events (delta)", error);
|
|
4670
|
+
throw error;
|
|
4671
|
+
}
|
|
4672
|
+
}
|
|
4673
|
+
resolveDeltaUrl(request, mailboxEmail) {
|
|
4674
|
+
if (request.syncToken?.trim()) {
|
|
4675
|
+
return this.toGraphRelativePath(request.syncToken.trim());
|
|
4676
|
+
}
|
|
4677
|
+
const window = this.resolveSeedWindow(request);
|
|
4678
|
+
return MICROSOFT_GRAPH_PATHS.userCalendarViewDelta(mailboxEmail, window.startDateTime, window.endDateTime);
|
|
4679
|
+
}
|
|
4680
|
+
resolveSeedWindow(request) {
|
|
4681
|
+
if (request.startDateLabel && request.endDateLabel) {
|
|
4682
|
+
return {
|
|
4683
|
+
startDateTime: `${request.startDateLabel}T00:00:00`,
|
|
4684
|
+
endDateTime: `${request.endDateLabel}T23:59:59`
|
|
4685
|
+
};
|
|
4686
|
+
}
|
|
4687
|
+
const start = /* @__PURE__ */ new Date();
|
|
4688
|
+
const end = new Date(start);
|
|
4689
|
+
end.setUTCFullYear(end.getUTCFullYear() + MICROSOFT_CALENDAR_DELTA_DEFAULT_WINDOW_YEARS);
|
|
4690
|
+
return {
|
|
4691
|
+
startDateTime: start.toISOString().replace("Z", ""),
|
|
4692
|
+
endDateTime: end.toISOString().replace("Z", "")
|
|
4693
|
+
};
|
|
4694
|
+
}
|
|
4695
|
+
/**
|
|
4696
|
+
* Traffic gateway always prefixes platform baseUrl — convert absolute Graph next/delta
|
|
4697
|
+
* links into path+query relative to `/v1.0`.
|
|
4698
|
+
*/
|
|
4699
|
+
toGraphRelativePath(urlOrPath) {
|
|
4700
|
+
if (urlOrPath.startsWith("/")) {
|
|
4701
|
+
return urlOrPath;
|
|
4702
|
+
}
|
|
4703
|
+
const baseNoSlash = MICROSOFT_DEFAULT_GRAPH_BASE_URL.replace(/\/$/, "");
|
|
4704
|
+
if (urlOrPath.startsWith(baseNoSlash)) {
|
|
4705
|
+
const rest = urlOrPath.slice(baseNoSlash.length);
|
|
4706
|
+
return rest.startsWith("/") ? rest : `/${rest}`;
|
|
4707
|
+
}
|
|
4708
|
+
try {
|
|
4709
|
+
const parsed = new URL(urlOrPath);
|
|
4710
|
+
let path = `${parsed.pathname}${parsed.search}`;
|
|
4711
|
+
if (path.startsWith("/v1.0/")) {
|
|
4712
|
+
path = path.slice("/v1.0".length);
|
|
4713
|
+
} else if (path === "/v1.0") {
|
|
4714
|
+
path = "/";
|
|
4715
|
+
}
|
|
4716
|
+
return path.startsWith("/") ? path : `/${path}`;
|
|
4717
|
+
} catch {
|
|
4718
|
+
return urlOrPath.startsWith("/") ? urlOrPath : `/${urlOrPath}`;
|
|
4719
|
+
}
|
|
4720
|
+
}
|
|
4563
4721
|
};
|
|
4564
4722
|
exports.MicrosoftCalendarBookingService = _ts_decorate28([
|
|
4565
4723
|
common.Injectable(),
|
|
@@ -4921,9 +5079,10 @@ exports.MicrosoftIntegrationConfigurationService = class MicrosoftIntegrationCon
|
|
|
4921
5079
|
clientSecret: asString(incomingConfig.integrationConfig?.clientSecret) || asString(existingConfig.integrationConfig?.clientSecret) || ""
|
|
4922
5080
|
};
|
|
4923
5081
|
const platformConfig = incomingConfig.platformConfig ?? existingConfig.platformConfig;
|
|
4924
|
-
const mergedConfig = buildMicrosoftIntegrationConfig(mergedCredentials,
|
|
4925
|
-
platformConfig
|
|
4926
|
-
|
|
5082
|
+
const mergedConfig = buildMicrosoftIntegrationConfig(mergedCredentials, {
|
|
5083
|
+
platformConfig,
|
|
5084
|
+
supportResourceSubscription: typeof incomingConfig.supportResourceSubscription === "boolean" ? incomingConfig.supportResourceSubscription : existingConfig.supportResourceSubscription
|
|
5085
|
+
});
|
|
4927
5086
|
await this.microsoftAuthService.getAccessToken({
|
|
4928
5087
|
id: request.id,
|
|
4929
5088
|
config: mergedConfig,
|
|
@@ -5171,6 +5330,9 @@ exports.MicrosoftCalendarBookingHandler = class MicrosoftCalendarBookingHandler
|
|
|
5171
5330
|
async acceptCalendarBooking(request, integration, loggedInUserId) {
|
|
5172
5331
|
return this.microsoftCalendarBookingService.acceptEvent(request, integration, loggedInUserId);
|
|
5173
5332
|
}
|
|
5333
|
+
async syncCalendarBookings(request, integration, loggedInUserId) {
|
|
5334
|
+
return this.microsoftCalendarBookingService.syncEvents(request, integration, loggedInUserId);
|
|
5335
|
+
}
|
|
5174
5336
|
async getCalendarBookingInstances(request, integration, loggedInUserId) {
|
|
5175
5337
|
return this.microsoftCalendarBookingService.getEventInstances(request, integration, loggedInUserId);
|
|
5176
5338
|
}
|