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