@dv4resi/dvss-backend-module-calendar-im 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +88 -22
- package/dist/index.js +122 -54
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1140,6 +1140,7 @@ interface GetFolioActivitiesOptionsInput {
|
|
|
1140
1140
|
interface GetCustomerActivitiesInput {
|
|
1141
1141
|
customerId: string;
|
|
1142
1142
|
projectId: string;
|
|
1143
|
+
propertyTimeZone: string;
|
|
1143
1144
|
options?: GetFolioActivitiesOptionsInput;
|
|
1144
1145
|
}
|
|
1145
1146
|
|
|
@@ -1228,6 +1229,7 @@ interface ICustomerPaymentDetails {
|
|
|
1228
1229
|
accountName?: string;
|
|
1229
1230
|
accountType?: string;
|
|
1230
1231
|
referenceNumber?: string;
|
|
1232
|
+
bankCharges?: number;
|
|
1231
1233
|
currency: ICurrency;
|
|
1232
1234
|
customFields?: Array<{
|
|
1233
1235
|
apiName: string;
|
|
@@ -1299,6 +1301,8 @@ interface IUpdateCustomerPaymentRequest {
|
|
|
1299
1301
|
apiName: string;
|
|
1300
1302
|
value: string;
|
|
1301
1303
|
}>;
|
|
1304
|
+
bankCharges?: number;
|
|
1305
|
+
accountId?: string;
|
|
1302
1306
|
}
|
|
1303
1307
|
interface IGetCreateCustomerPayment {
|
|
1304
1308
|
payment: IGetCreateCustomerPaymentInfo;
|
|
@@ -1407,6 +1411,10 @@ interface ICreateCreditNoteForInvoiceRequest {
|
|
|
1407
1411
|
is_inclusive_tax: boolean;
|
|
1408
1412
|
salesperson_name?: string;
|
|
1409
1413
|
place_of_supply?: string;
|
|
1414
|
+
custom_fields?: Array<{
|
|
1415
|
+
api_name: string;
|
|
1416
|
+
value: string;
|
|
1417
|
+
}>;
|
|
1410
1418
|
}
|
|
1411
1419
|
interface IAccountingListAPIPageContext {
|
|
1412
1420
|
page: number;
|
|
@@ -1478,6 +1486,31 @@ interface IGetCustomerCreditNotesResponse {
|
|
|
1478
1486
|
creditNotes: ICustomerCreditNote[];
|
|
1479
1487
|
hasMorePage: boolean;
|
|
1480
1488
|
}
|
|
1489
|
+
interface ICreditNoteOperator {
|
|
1490
|
+
id?: string;
|
|
1491
|
+
type?: string;
|
|
1492
|
+
name?: string;
|
|
1493
|
+
}
|
|
1494
|
+
interface ICreditNoteAppliedInvoice {
|
|
1495
|
+
invoiceId: string;
|
|
1496
|
+
invoiceNumber: string;
|
|
1497
|
+
appliedAmount: number;
|
|
1498
|
+
}
|
|
1499
|
+
interface ICustomerCreditNoteDetail {
|
|
1500
|
+
creditNoteId: string;
|
|
1501
|
+
creditNoteNumber: string;
|
|
1502
|
+
status: CREDIT_NOTE_STATUS;
|
|
1503
|
+
customerId: string;
|
|
1504
|
+
date: string;
|
|
1505
|
+
operator?: ICreditNoteOperator;
|
|
1506
|
+
updatedAt?: Date;
|
|
1507
|
+
appliedInvoices: ICreditNoteAppliedInvoice[];
|
|
1508
|
+
totalAmount: number;
|
|
1509
|
+
creditsUsed: number;
|
|
1510
|
+
refundAmount: number;
|
|
1511
|
+
remainingAmount: number;
|
|
1512
|
+
currency?: ICurrency;
|
|
1513
|
+
}
|
|
1481
1514
|
interface IInvoicesResponse {
|
|
1482
1515
|
invoices: IAccountingInvoice[];
|
|
1483
1516
|
hasMorePage: boolean;
|
|
@@ -1559,6 +1592,12 @@ interface IGetRecurringInvoicesOptions {
|
|
|
1559
1592
|
interface IGetRecurringInvoicesRequest {
|
|
1560
1593
|
getRecurringInvoicesInput?: IGetRecurringInvoicesOptions;
|
|
1561
1594
|
}
|
|
1595
|
+
interface IGetRecurringInvoiceInput {
|
|
1596
|
+
recurringInvoiceId: string;
|
|
1597
|
+
}
|
|
1598
|
+
interface IGetRecurringInvoiceRequest extends IInvoiceIntegrationRequest {
|
|
1599
|
+
getRecurringInvoiceInput: IGetRecurringInvoiceInput;
|
|
1600
|
+
}
|
|
1562
1601
|
declare enum RECURRING_INVOICE_STATUS {
|
|
1563
1602
|
ACTIVE = "ACTIVE",
|
|
1564
1603
|
STOPPED = "STOPPED",
|
|
@@ -1629,6 +1668,14 @@ interface IUpdateRecurringInvoiceRequest extends ICreateRecurringInvoiceRequest
|
|
|
1629
1668
|
interface IUpdateRecurringInvoiceResponse {
|
|
1630
1669
|
status: boolean;
|
|
1631
1670
|
}
|
|
1671
|
+
declare enum RECURRING_INVOICE_STATUS_ENUM {
|
|
1672
|
+
STOP = "STOP",
|
|
1673
|
+
RESUME = "RESUME"
|
|
1674
|
+
}
|
|
1675
|
+
interface IUpdateRecurringInvoiceStatusRequest {
|
|
1676
|
+
recurringInvoiceId: string;
|
|
1677
|
+
status: RECURRING_INVOICE_STATUS_ENUM;
|
|
1678
|
+
}
|
|
1632
1679
|
|
|
1633
1680
|
interface ICalendarResource {
|
|
1634
1681
|
id: string;
|
|
@@ -1660,6 +1707,7 @@ interface ICalendarRecurrencePattern {
|
|
|
1660
1707
|
firstDayOfWeek?: string;
|
|
1661
1708
|
dayOfMonth?: number;
|
|
1662
1709
|
month?: number;
|
|
1710
|
+
index?: string;
|
|
1663
1711
|
}
|
|
1664
1712
|
interface ICalendarRecurrenceRange {
|
|
1665
1713
|
type: string;
|
|
@@ -1677,6 +1725,14 @@ interface ICalendarEventSyncMetadata {
|
|
|
1677
1725
|
syncVersion?: number;
|
|
1678
1726
|
lastSyncTimestamp?: string;
|
|
1679
1727
|
externalEventId?: string;
|
|
1728
|
+
syncType?: 'SINGLE' | 'RECURRING_SERIES' | 'CUSTOM_DATES';
|
|
1729
|
+
externalSeriesId?: string;
|
|
1730
|
+
externalEventIds?: {
|
|
1731
|
+
date: string;
|
|
1732
|
+
eventId: string;
|
|
1733
|
+
}[];
|
|
1734
|
+
organizerUserEmail?: string;
|
|
1735
|
+
resourceId?: string;
|
|
1680
1736
|
}
|
|
1681
1737
|
interface ICalendarAttendee {
|
|
1682
1738
|
email: string;
|
|
@@ -1690,7 +1746,7 @@ interface ICalendarEvent {
|
|
|
1690
1746
|
start: ICalendarDateTime;
|
|
1691
1747
|
end: ICalendarDateTime;
|
|
1692
1748
|
location?: string;
|
|
1693
|
-
|
|
1749
|
+
resourceId?: string;
|
|
1694
1750
|
recurrence?: ICalendarRecurrence;
|
|
1695
1751
|
attendees?: ICalendarAttendee[];
|
|
1696
1752
|
organizerEmail?: string;
|
|
@@ -1699,29 +1755,32 @@ interface ICalendarEvent {
|
|
|
1699
1755
|
syncMetadata?: ICalendarEventSyncMetadata;
|
|
1700
1756
|
providerPayload?: Record<string, unknown>;
|
|
1701
1757
|
}
|
|
1702
|
-
interface
|
|
1758
|
+
interface ICalendarMailboxScope {
|
|
1759
|
+
organizerUserEmail?: string;
|
|
1760
|
+
}
|
|
1761
|
+
interface ICreateCalendarEventRequest extends ICalendarMailboxScope {
|
|
1703
1762
|
event: ICalendarEvent;
|
|
1704
|
-
|
|
1763
|
+
resourceId: string;
|
|
1705
1764
|
}
|
|
1706
|
-
interface IUpdateCalendarEventRequest {
|
|
1765
|
+
interface IUpdateCalendarEventRequest extends ICalendarMailboxScope {
|
|
1707
1766
|
eventId: string;
|
|
1708
|
-
|
|
1767
|
+
resourceId: string;
|
|
1709
1768
|
event: Partial<ICalendarEvent>;
|
|
1710
1769
|
}
|
|
1711
|
-
interface ICancelCalendarEventRequest {
|
|
1770
|
+
interface ICancelCalendarEventRequest extends ICalendarMailboxScope {
|
|
1712
1771
|
eventId: string;
|
|
1713
|
-
|
|
1772
|
+
resourceId: string;
|
|
1714
1773
|
}
|
|
1715
|
-
interface IDeleteCalendarEventRequest {
|
|
1774
|
+
interface IDeleteCalendarEventRequest extends ICalendarMailboxScope {
|
|
1716
1775
|
eventId: string;
|
|
1717
|
-
|
|
1776
|
+
resourceId: string;
|
|
1718
1777
|
}
|
|
1719
|
-
interface IGetCalendarEventRequest {
|
|
1778
|
+
interface IGetCalendarEventRequest extends ICalendarMailboxScope {
|
|
1720
1779
|
eventId: string;
|
|
1721
|
-
|
|
1780
|
+
resourceId: string;
|
|
1722
1781
|
}
|
|
1723
|
-
interface IGetCalendarEventsRequest {
|
|
1724
|
-
|
|
1782
|
+
interface IGetCalendarEventsRequest extends ICalendarMailboxScope {
|
|
1783
|
+
resourceId: string;
|
|
1725
1784
|
start?: ICalendarDateTime;
|
|
1726
1785
|
end?: ICalendarDateTime;
|
|
1727
1786
|
syncToken?: string;
|
|
@@ -1730,8 +1789,8 @@ interface IGetCalendarEventsResponse {
|
|
|
1730
1789
|
events: ICalendarEvent[];
|
|
1731
1790
|
nextSyncToken?: string;
|
|
1732
1791
|
}
|
|
1733
|
-
interface ISyncCalendarEventsRequest {
|
|
1734
|
-
|
|
1792
|
+
interface ISyncCalendarEventsRequest extends ICalendarMailboxScope {
|
|
1793
|
+
resourceId: string;
|
|
1735
1794
|
syncToken?: string;
|
|
1736
1795
|
}
|
|
1737
1796
|
interface ISyncCalendarEventsResponse {
|
|
@@ -1739,12 +1798,12 @@ interface ISyncCalendarEventsResponse {
|
|
|
1739
1798
|
nextSyncToken?: string;
|
|
1740
1799
|
}
|
|
1741
1800
|
interface IGetRoomAvailabilityRequest {
|
|
1742
|
-
|
|
1801
|
+
resourceIds: string[];
|
|
1743
1802
|
start: ICalendarDateTime;
|
|
1744
1803
|
end: ICalendarDateTime;
|
|
1745
1804
|
}
|
|
1746
1805
|
interface IRoomAvailabilitySlot {
|
|
1747
|
-
|
|
1806
|
+
resourceId: string;
|
|
1748
1807
|
start: ICalendarDateTime;
|
|
1749
1808
|
end: ICalendarDateTime;
|
|
1750
1809
|
status: 'free' | 'busy' | 'tentative' | 'oof' | 'unknown';
|
|
@@ -1924,6 +1983,7 @@ declare abstract class BaseAccountingCreditNoteManagement {
|
|
|
1924
1983
|
abstract createCreditNoteRefund(creditNoteId: string, refundRequest: ICreateRefundRequest, capabilityIntegration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IAccountingAPIResponse>;
|
|
1925
1984
|
abstract createCreditNoteForInvoice(request: ICreateCreditNoteForInvoiceRequest, externalInvoiceId: string, capabilityIntegration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IAccountingAPIResponse>;
|
|
1926
1985
|
abstract getCustomerCreditNotes(request: IGetCustomerCreditNotesRequest, capabilityIntegration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetCustomerCreditNotesResponse>;
|
|
1986
|
+
abstract getCreditNote(creditNoteId: string, capabilityIntegration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ICustomerCreditNoteDetail>;
|
|
1927
1987
|
}
|
|
1928
1988
|
|
|
1929
1989
|
declare abstract class BaseAccountingCustomerPaymentManagement {
|
|
@@ -1942,12 +2002,14 @@ declare abstract class BaseAccountingInvoiceManagement {
|
|
|
1942
2002
|
abstract deleteInvoice(request: IInvoiceIntegrationRequest, loggedInUserId: bigint): Promise<IAccountingAPIResponse>;
|
|
1943
2003
|
abstract downloadInvoice(request: IInvoiceIntegrationRequest, loggedInUserId: bigint): Promise<ArrayBuffer>;
|
|
1944
2004
|
abstract getInvoice(request: IInvoiceIntegrationRequest, loggedInUserId: bigint): Promise<IInvoiceResponse>;
|
|
2005
|
+
abstract getRecurringInvoice(request: IGetRecurringInvoiceRequest, loggedInUserId: bigint): Promise<unknown>;
|
|
1945
2006
|
abstract markInvoiceAsPaid(request: IInvoiceIntegrationRequest, loggedInUserId: bigint): Promise<IAccountingAPIResponse>;
|
|
1946
2007
|
abstract updateInvoiceStatus(request: IInvoiceIntegrationRequest, loggedInUserId: bigint): Promise<IAccountingAPIResponse>;
|
|
1947
2008
|
abstract getInvoices(request: IGetInvoicesRequest, capabilityIntegration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IInvoicesResponse>;
|
|
1948
2009
|
abstract getRecurringInvoices(request: IGetRecurringInvoicesRequest, capabilityIntegration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IRecurringInvoicesResponse>;
|
|
1949
2010
|
abstract updateRecurringInvoice(request: IUpdateRecurringInvoiceRequest, capabilityIntegration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IUpdateRecurringInvoiceResponse>;
|
|
1950
2011
|
abstract markInvoiceAsSent(invoiceId: string, capabilityIntegration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IAccountingAPIResponse>;
|
|
2012
|
+
abstract updateRecurringInvoiceStatus(request: IUpdateRecurringInvoiceStatusRequest, capabilityIntegration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IUpdateRecurringInvoiceResponse>;
|
|
1951
2013
|
}
|
|
1952
2014
|
|
|
1953
2015
|
declare abstract class BaseAccountingLOAManagement {
|
|
@@ -2129,6 +2191,7 @@ interface IMicrosoftGraphRecurrencePattern {
|
|
|
2129
2191
|
firstDayOfWeek?: string;
|
|
2130
2192
|
dayOfMonth?: number;
|
|
2131
2193
|
month?: number;
|
|
2194
|
+
index?: string;
|
|
2132
2195
|
}
|
|
2133
2196
|
interface IMicrosoftGraphRecurrenceRange {
|
|
2134
2197
|
type?: string;
|
|
@@ -2257,7 +2320,10 @@ declare class MicrosoftCalendarBookingService extends BaseCalendarBookingManagem
|
|
|
2257
2320
|
syncEvents(request: ISyncCalendarEventsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISyncCalendarEventsResponse>;
|
|
2258
2321
|
getRoomAvailability(request: IGetRoomAvailabilityRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetRoomAvailabilityResponse>;
|
|
2259
2322
|
private deleteGraphEvent;
|
|
2260
|
-
private
|
|
2323
|
+
private resolveMailboxEmail;
|
|
2324
|
+
private organizerUserMailbox;
|
|
2325
|
+
private resourceAsAttendee;
|
|
2326
|
+
private assertResourceId;
|
|
2261
2327
|
private assertEventId;
|
|
2262
2328
|
}
|
|
2263
2329
|
|
|
@@ -2289,9 +2355,9 @@ declare const MICROSOFT_TOKEN_HEADERS: {
|
|
|
2289
2355
|
|
|
2290
2356
|
declare const MICROSOFT_GRAPH_PATHS: {
|
|
2291
2357
|
readonly rooms: "/places/microsoft.graph.room";
|
|
2292
|
-
readonly userCalendarEvents: (
|
|
2293
|
-
readonly userCalendarEvent: (
|
|
2294
|
-
readonly userCalendarView: (
|
|
2358
|
+
readonly userCalendarEvents: (mailboxEmail: string) => string;
|
|
2359
|
+
readonly userCalendarEvent: (mailboxEmail: string, eventId: string) => string;
|
|
2360
|
+
readonly userCalendarView: (mailboxEmail: string, startDateTime: string, endDateTime: string) => string;
|
|
2295
2361
|
readonly subscriptions: "/subscriptions";
|
|
2296
2362
|
readonly subscription: (subscriptionId: string) => string;
|
|
2297
2363
|
};
|
|
@@ -2417,4 +2483,4 @@ declare class CalendarIntegrationConfigurationAdapterFactory extends AdapterFact
|
|
|
2417
2483
|
constructor(microsoftCalendarIntegrationConfigurationHandler: MicrosoftCalendarIntegrationConfigurationHandler);
|
|
2418
2484
|
}
|
|
2419
2485
|
|
|
2420
|
-
export { type AccountConfig, type ActivityLogAuthor, AdapterFactoryService, BOOKABLE_ITEM_STATUS_ENUM, BOOKABLE_ITEM_TYPE_ENUM, BaseAccessManagement, BaseAccountingContactPersonManagement, BaseAccountingCreditNoteManagement, BaseAccountingCustomerPaymentManagement, BaseAccountingInvoiceManagement, BaseAccountingLOAManagement, BaseAccountingMiscellaneousManagement, BaseAccountingTaxManagement, BaseAuth, BaseCalendarBookingManagement, BaseCalendarResourceManagement, BaseCalendarWebhookManagement, BaseCreditBooking, BaseCustomerManagement, BaseDeviceManagement, BaseIntegrationConfiguration, BaseIntegrationResourceManagement, BaseMembershipCustomerManagement, BaseMembershipManagement, BasePackageManagement, BasePayment, BasePaymentMethodManagement, BasePaymentUserManagement, BaseWellnessManagement, CALENDAR_PROVIDER_ENUM, CREDIT_FILTER_BY_ENUM, CREDIT_NOTE_STATUS, CREDIT_STATUS_ENUM, CREDIT_TYPE_ENUM, CalendarAuthAdapterFactory, CalendarBookingAdapterFactory, CalendarIntegrationConfigurationAdapterFactory, AppModule$2 as CalendarIntegrationManager, CalendarResourceAdapterFactory, CalendarWebhookAdapterFactory, type CapabilityIntegrationCategory, type CustomerActivity, DOWNLOAD_CUSTOMER_ACCOUNTING_STATEMENT_FILTER_BY_ENUM, DOWNLOAD_CUSTOMER_ACCOUNTING_STATEMENT_STATUS_ENUM, type DigitalAsset, GET_CUSTOMER_CREDIT_NOTES_FILTER_BY, GET_CUSTOMER_CREDIT_NOTES_SORT_BY, GET_INVOICES_FILTER_BY_ENUM, GET_INVOICES_SORT_BY_ENUM, GET_PAYMENTS_FILTER_BY_ENUM, GET_PAYMENTS_FILTER_VALUE_ENUM, GET_PAYMENTS_SORTING_ENUM, GET_RECURRING_INVOICES_SORT_BY_ENUM, type GetCustomerActivitiesInput, type GetFolioActivitiesOptionsInput, HTTP_METHOD, type IAPIResponse, type IAccessProfile, type IAccessProfiles, type IAccountingAPIResponse, type IAccountingInvoice, type IAccountingListAPIPageContext, type IAccountingListAPIResponse, type IAccountingListAPISearchCriteria, type IAccounts, type IAddCapIntegResourceMapping, type IAddCapabilityIntegration, type IAddCapabilityIntegrationConfig, type IAddCapabilityIntegrationConfiguredFor, type IAddCapabilityIntegrationInput, type IAddCapabilityIntegrationMappingResponse, type IAddCustomerContactPersonRequest, type IAddCustomerRequest, type IAddItemToOrderItemConfig, type IAddItemToOrderRequest, type IAddItemToOrderResponse, type IAddPaymentToOrderRequest, type IAddResourceToIntegrationInput, type IAddResourceToIntegrationResponse, type IAddUpdateAccessGroupRequest, type IAdminCredentials, type IApiCallRequest, type IApplyCreditNoteForInvoicesRequest, type IAvailableDateWithSlots, type IAvailableTaxes, type IAvailableTimeSlot, type IBookableItem, type IBookableItemCategory, type IBookableItemMedia, type IBookableItemPrice, type IBookableItemPriceMeta, type ICalendarAttendee, ICalendarAuthHandler, ICalendarBookingHandler, type ICalendarBookingManagementContext, type ICalendarDateTime, type ICalendarEvent, type ICalendarEventSyncMetadata, ICalendarIntegrationConfigurationHandler, type ICalendarRecurrence, type ICalendarRecurrencePattern, type ICalendarRecurrenceRange, type ICalendarResource, ICalendarResourceHandler, type ICalendarResourceManagementContext, ICalendarWebhookHandler, type ICalendarWebhookManagementContext, type ICalendarWebhookSubscription, type ICancelCalendarEventRequest, type ICapabilityIntegration, type ICapabilityIntegrationConfig, type ICapabilityIntegrationResourceMapping, type ICapabilityIntegrationResourceMappingRow, type IConfiguration, type ICreateCalendarEventRequest, type ICreateCreditNoteForInvoiceRequest, type ICreateCustomerPaymentRequest, type ICreateOrderRequest, type ICreateOrderResponse, type ICreateRecurringInvoiceLineItem, type ICreateRecurringInvoiceRequest, type ICreateRecurringInvoiceResponse, type ICreateRefundRequest, type ICredit, type ICurrency, type ICustomer, type ICustomerAddionalDetails, type ICustomerContactPerson, type ICustomerContactPersonResponse, type ICustomerCreditNote, type ICustomerLastCheckIn, type ICustomerPaymentDetails, type ICustomerPaymentRecord, type ICustomerRole, type ICustomerStatusResponse, type IDeleteAPIResponse, type IDeleteCalendarEventRequest, type IDeleteCalendarWebhookRequest, type IDeleteCustomerContactPersonRequest, type IDeleteDeviceInput, type IDeleteDeviceResponse, type IDownloadCustomerAccountingStatementRequest, type IFetchOfferingAvailabilityRequest, type IGetAccessProfilesResponse, type IGetAppointmentsRequest, type IGetAvailableDatesAndTimeSlotsResponse, type IGetBookableItemsFromCreditRequest, type IGetCalendarEventRequest, type IGetCalendarEventsRequest, type IGetCalendarEventsResponse, type IGetCalendarResourcesRequest, type IGetCalendarResourcesResponse, type IGetCapabilityIntegrationInput, type IGetCapabilityIntegrationResult, type IGetCapabilityIntegrationsFilterInput, type IGetCapabilityIntegrationsOptionsInput, type IGetCapabilityIntegrationsRequest, type IGetCapabilityIntegrationsResponse, type IGetCapabilityIntegrationsSortingInput, type IGetCategoriesRequest, type IGetCoursesRequest, type IGetCreateCustomerPayment, type IGetCreateCustomerPaymentInfo, type IGetCustomerAccessGroupsInput, type IGetCustomerAccessGroupsResponse, type IGetCustomerActivities, type IGetCustomerCreditNotesRequest, type IGetCustomerCreditNotesResponse, type IGetCustomerCreditsRequest, type IGetCustomerCreditsRequestFilters, type IGetCustomerCreditsRequestOptions, type IGetCustomerPayment, type IGetCustomerPaymentRefundInfo, type IGetCustomerPaymentRequest, type IGetCustomerPayments, type IGetCustomerPaymentsFilter, type IGetCustomerPaymentsOptions, type IGetCustomerPaymentsRequest, type IGetCustomerPaymentsSorting, type IGetCustomerRequest, type IGetDeviceKeyInput, type IGetDeviceKeyResponse, type IGetDevicesInput, type IGetDevicesResponse, type IGetInvoicesOptions, type IGetInvoicesRequest, type IGetOrderResponse, type IGetPractitionersRequest, type IGetRecurringInvoicesOptions, type IGetRecurringInvoicesRequest, type IGetRefundCustomerPayment, type IGetRoomAvailabilityRequest, type IGetRoomAvailabilityResponse, type IGetSessionsRequest, type IIcon, type IIntegrationConfigFieldMetadata, type IIntegrationConfigFieldMetadataMap, type IIntegrationConfigJson, type IIntegrationConfigStructureMetadata, type IIntegrationRequestContext, type IIntegrationRequestLog, type IInvoice, type IInvoiceCapabilityIntegration, type IInvoiceCapabilityIntegrationConfig, type IInvoiceIntegrationRequest, type IInvoiceResponse, type IInvoicesResponse, type IKey, type IListUsersInput, type IListUsersResponse, type IMarkCustomerContactPersonPrimaryRequest, type IMicrosoftAccessDetails, type IMicrosoftAccessToken, type IMicrosoftApiCallRequest, type IMicrosoftConfig, type IMicrosoftGraphAttendee, type IMicrosoftGraphDateTimeTimeZone, type IMicrosoftGraphErrorBody, type IMicrosoftGraphEvent, type IMicrosoftGraphEventsResponse, type IMicrosoftGraphRecurrence, type IMicrosoftGraphRecurrencePattern, type IMicrosoftGraphRecurrenceRange, type IMicrosoftGraphRoom, type IMicrosoftGraphRoomsResponse, type IMicrosoftGraphSubscription, type IMicrosoftIntegrationConfig, type IMicrosoftPlatformConfig, type IMicrosoftTokenResponse, INVOICE_STATUS_ENUM, type INonSensitiveStoredField, type IOfferingBookingOccurrence, type IOfferingResource, type IOfferingResourceMedia, type IOrderGuest, type IRecurringInvoices, type IRecurringInvoicesResponse, type IRefreshCalendarWebhookRequest, type IRefreshCalendarWebhookResponse, type IRefundCustomerPayment, type IRegisterCalendarWebhookRequest, type IRegisterCalendarWebhookResponse, type IRegisterDeviceInput, type IRegisterDeviceResponse, type IRemoveCapabilityIntegrationMappingInput, type IRemoveResourceFromIntegrationRequest, type IRemoveResourceFromIntegrationResponse, type IRoomAvailabilitySlot, type ISecureStorageWriteOptions, type ISensitiveStoredField, type IStoredConfigField, type ISyncCalendarEventsRequest, type ISyncCalendarEventsResponse, type ISystemResponse, type ITransactionNumberSeries, type ITransactionNumberSeriesItem, type IUpdateAPIResponse, type IUpdateCalendarEventRequest, type IUpdateCapabilityIntegration, type IUpdateCapabilityIntegrationRequest, type IUpdateCapabilityIntegrationResponse, type IUpdateCapabilityIntegrationUpdateData, type IUpdateCustomerContactPersonRequest, type IUpdateCustomerPaymentRequest, type IUpdateCustomerRequest, type IUpdateDeviceCertificateInput, type IUpdateDeviceCertificateResponse, type IUpdateOfferingIntegrationResourceConfigurationInput, type IUpdateOfferingIntegrationResourceConfigurationResponse, type IUpdateOrderRequest, type IUpdateOrderResponse, type IUpdateRecurringInvoiceRequest, type IUpdateRecurringInvoiceResponse, type IUserAccessGroup, type IValidatedCapabilityIntegration, type IValidatedCapabilityIntegrationConfig, type IWellnessManagementRequestOptions, IntegrationBookingDao, IntegrationCommonDao, IntegrationConfigSecureStorageService, IntegrationConfigurationDao, AppModule$1 as IntegrationLibsModule, AppModule as IntegrationMicrosoftModule, IntegrationOnpremDeploymentDao, IntegrationRequestLoggerService, IntegrationResourceManagementDao, IntegrationServiceCommunicationTopicDao, IntegrationSubcapabilityDao, IntegrationUserManagementDao, IntegrationVisitorCredentialMappingDao, type InvoiceAccessDetails, MICROSOFT_CLIENT_CREDENTIALS_GRANT_TYPE, MICROSOFT_DEFAULT_ACCESS_TOKEN_TYPE, MICROSOFT_DEFAULT_AUTH_URL, MICROSOFT_DEFAULT_GRAPH_BASE_URL, MICROSOFT_DEFAULT_GRAPH_SCOPE, MICROSOFT_DEFAULT_HEADERS, MICROSOFT_GRAPH_PATHS, MICROSOFT_SECURE_STORAGE, MICROSOFT_TOKEN_HEADERS, MicrosoftApiClientService, MicrosoftAuthService, MicrosoftCalendarAuthHandler, MicrosoftCalendarBookingHandler, MicrosoftCalendarBookingService, MicrosoftCalendarIntegrationConfigurationHandler, MicrosoftCalendarResourceHandler, MicrosoftCalendarResourceService, MicrosoftCalendarWebhookHandler, MicrosoftCalendarWebhookService, type MicrosoftIntegrationConfigInput, MicrosoftIntegrationConfigurationService, type Note, type NoteAttachment, type NoteChangelog, type NoteChangelogRecord, type NoteResource, type NoteUserIdentity, RECURRING_INVOICE_STATUS, RateLimiterService, type ResourceAssetMapping, TRAFFIC_ROUTER_CONFIGURATION_STORE_KEY, TrafficGatewayService, type UserIdentity, buildMicrosoftIntegrationConfig, getMicrosoftKmsKeyId, looksLikeStoredSecureConfig };
|
|
2486
|
+
export { type AccountConfig, type ActivityLogAuthor, AdapterFactoryService, BOOKABLE_ITEM_STATUS_ENUM, BOOKABLE_ITEM_TYPE_ENUM, BaseAccessManagement, BaseAccountingContactPersonManagement, BaseAccountingCreditNoteManagement, BaseAccountingCustomerPaymentManagement, BaseAccountingInvoiceManagement, BaseAccountingLOAManagement, BaseAccountingMiscellaneousManagement, BaseAccountingTaxManagement, BaseAuth, BaseCalendarBookingManagement, BaseCalendarResourceManagement, BaseCalendarWebhookManagement, BaseCreditBooking, BaseCustomerManagement, BaseDeviceManagement, BaseIntegrationConfiguration, BaseIntegrationResourceManagement, BaseMembershipCustomerManagement, BaseMembershipManagement, BasePackageManagement, BasePayment, BasePaymentMethodManagement, BasePaymentUserManagement, BaseWellnessManagement, CALENDAR_PROVIDER_ENUM, CREDIT_FILTER_BY_ENUM, CREDIT_NOTE_STATUS, CREDIT_STATUS_ENUM, CREDIT_TYPE_ENUM, CalendarAuthAdapterFactory, CalendarBookingAdapterFactory, CalendarIntegrationConfigurationAdapterFactory, AppModule$2 as CalendarIntegrationManager, CalendarResourceAdapterFactory, CalendarWebhookAdapterFactory, type CapabilityIntegrationCategory, type CustomerActivity, DOWNLOAD_CUSTOMER_ACCOUNTING_STATEMENT_FILTER_BY_ENUM, DOWNLOAD_CUSTOMER_ACCOUNTING_STATEMENT_STATUS_ENUM, type DigitalAsset, GET_CUSTOMER_CREDIT_NOTES_FILTER_BY, GET_CUSTOMER_CREDIT_NOTES_SORT_BY, GET_INVOICES_FILTER_BY_ENUM, GET_INVOICES_SORT_BY_ENUM, GET_PAYMENTS_FILTER_BY_ENUM, GET_PAYMENTS_FILTER_VALUE_ENUM, GET_PAYMENTS_SORTING_ENUM, GET_RECURRING_INVOICES_SORT_BY_ENUM, type GetCustomerActivitiesInput, type GetFolioActivitiesOptionsInput, HTTP_METHOD, type IAPIResponse, type IAccessProfile, type IAccessProfiles, type IAccountingAPIResponse, type IAccountingInvoice, type IAccountingListAPIPageContext, type IAccountingListAPIResponse, type IAccountingListAPISearchCriteria, type IAccounts, type IAddCapIntegResourceMapping, type IAddCapabilityIntegration, type IAddCapabilityIntegrationConfig, type IAddCapabilityIntegrationConfiguredFor, type IAddCapabilityIntegrationInput, type IAddCapabilityIntegrationMappingResponse, type IAddCustomerContactPersonRequest, type IAddCustomerRequest, type IAddItemToOrderItemConfig, type IAddItemToOrderRequest, type IAddItemToOrderResponse, type IAddPaymentToOrderRequest, type IAddResourceToIntegrationInput, type IAddResourceToIntegrationResponse, type IAddUpdateAccessGroupRequest, type IAdminCredentials, type IApiCallRequest, type IApplyCreditNoteForInvoicesRequest, type IAvailableDateWithSlots, type IAvailableTaxes, type IAvailableTimeSlot, type IBookableItem, type IBookableItemCategory, type IBookableItemMedia, type IBookableItemPrice, type IBookableItemPriceMeta, type ICalendarAttendee, ICalendarAuthHandler, ICalendarBookingHandler, type ICalendarBookingManagementContext, type ICalendarDateTime, type ICalendarEvent, type ICalendarEventSyncMetadata, ICalendarIntegrationConfigurationHandler, type ICalendarRecurrence, type ICalendarRecurrencePattern, type ICalendarRecurrenceRange, type ICalendarResource, ICalendarResourceHandler, type ICalendarResourceManagementContext, ICalendarWebhookHandler, type ICalendarWebhookManagementContext, type ICalendarWebhookSubscription, type ICancelCalendarEventRequest, type ICapabilityIntegration, type ICapabilityIntegrationConfig, type ICapabilityIntegrationResourceMapping, type ICapabilityIntegrationResourceMappingRow, type IConfiguration, type ICreateCalendarEventRequest, type ICreateCreditNoteForInvoiceRequest, type ICreateCustomerPaymentRequest, type ICreateOrderRequest, type ICreateOrderResponse, type ICreateRecurringInvoiceLineItem, type ICreateRecurringInvoiceRequest, type ICreateRecurringInvoiceResponse, type ICreateRefundRequest, type ICredit, type ICreditNoteAppliedInvoice, type ICreditNoteOperator, type ICurrency, type ICustomer, type ICustomerAddionalDetails, type ICustomerContactPerson, type ICustomerContactPersonResponse, type ICustomerCreditNote, type ICustomerCreditNoteDetail, type ICustomerLastCheckIn, type ICustomerPaymentDetails, type ICustomerPaymentRecord, type ICustomerRole, type ICustomerStatusResponse, type IDeleteAPIResponse, type IDeleteCalendarEventRequest, type IDeleteCalendarWebhookRequest, type IDeleteCustomerContactPersonRequest, type IDeleteDeviceInput, type IDeleteDeviceResponse, type IDownloadCustomerAccountingStatementRequest, type IFetchOfferingAvailabilityRequest, type IGetAccessProfilesResponse, type IGetAppointmentsRequest, type IGetAvailableDatesAndTimeSlotsResponse, type IGetBookableItemsFromCreditRequest, type IGetCalendarEventRequest, type IGetCalendarEventsRequest, type IGetCalendarEventsResponse, type IGetCalendarResourcesRequest, type IGetCalendarResourcesResponse, type IGetCapabilityIntegrationInput, type IGetCapabilityIntegrationResult, type IGetCapabilityIntegrationsFilterInput, type IGetCapabilityIntegrationsOptionsInput, type IGetCapabilityIntegrationsRequest, type IGetCapabilityIntegrationsResponse, type IGetCapabilityIntegrationsSortingInput, type IGetCategoriesRequest, type IGetCoursesRequest, type IGetCreateCustomerPayment, type IGetCreateCustomerPaymentInfo, type IGetCustomerAccessGroupsInput, type IGetCustomerAccessGroupsResponse, type IGetCustomerActivities, type IGetCustomerCreditNotesRequest, type IGetCustomerCreditNotesResponse, type IGetCustomerCreditsRequest, type IGetCustomerCreditsRequestFilters, type IGetCustomerCreditsRequestOptions, type IGetCustomerPayment, type IGetCustomerPaymentRefundInfo, type IGetCustomerPaymentRequest, type IGetCustomerPayments, type IGetCustomerPaymentsFilter, type IGetCustomerPaymentsOptions, type IGetCustomerPaymentsRequest, type IGetCustomerPaymentsSorting, type IGetCustomerRequest, type IGetDeviceKeyInput, type IGetDeviceKeyResponse, type IGetDevicesInput, type IGetDevicesResponse, type IGetInvoicesOptions, type IGetInvoicesRequest, type IGetOrderResponse, type IGetPractitionersRequest, type IGetRecurringInvoiceInput, type IGetRecurringInvoiceRequest, type IGetRecurringInvoicesOptions, type IGetRecurringInvoicesRequest, type IGetRefundCustomerPayment, type IGetRoomAvailabilityRequest, type IGetRoomAvailabilityResponse, type IGetSessionsRequest, type IIcon, type IIntegrationConfigFieldMetadata, type IIntegrationConfigFieldMetadataMap, type IIntegrationConfigJson, type IIntegrationConfigStructureMetadata, type IIntegrationRequestContext, type IIntegrationRequestLog, type IInvoice, type IInvoiceCapabilityIntegration, type IInvoiceCapabilityIntegrationConfig, type IInvoiceIntegrationRequest, type IInvoiceResponse, type IInvoicesResponse, type IKey, type IListUsersInput, type IListUsersResponse, type IMarkCustomerContactPersonPrimaryRequest, type IMicrosoftAccessDetails, type IMicrosoftAccessToken, type IMicrosoftApiCallRequest, type IMicrosoftConfig, type IMicrosoftGraphAttendee, type IMicrosoftGraphDateTimeTimeZone, type IMicrosoftGraphErrorBody, type IMicrosoftGraphEvent, type IMicrosoftGraphEventsResponse, type IMicrosoftGraphRecurrence, type IMicrosoftGraphRecurrencePattern, type IMicrosoftGraphRecurrenceRange, type IMicrosoftGraphRoom, type IMicrosoftGraphRoomsResponse, type IMicrosoftGraphSubscription, type IMicrosoftIntegrationConfig, type IMicrosoftPlatformConfig, type IMicrosoftTokenResponse, INVOICE_STATUS_ENUM, type INonSensitiveStoredField, type IOfferingBookingOccurrence, type IOfferingResource, type IOfferingResourceMedia, type IOrderGuest, type IRecurringInvoices, type IRecurringInvoicesResponse, type IRefreshCalendarWebhookRequest, type IRefreshCalendarWebhookResponse, type IRefundCustomerPayment, type IRegisterCalendarWebhookRequest, type IRegisterCalendarWebhookResponse, type IRegisterDeviceInput, type IRegisterDeviceResponse, type IRemoveCapabilityIntegrationMappingInput, type IRemoveResourceFromIntegrationRequest, type IRemoveResourceFromIntegrationResponse, type IRoomAvailabilitySlot, type ISecureStorageWriteOptions, type ISensitiveStoredField, type IStoredConfigField, type ISyncCalendarEventsRequest, type ISyncCalendarEventsResponse, type ISystemResponse, type ITransactionNumberSeries, type ITransactionNumberSeriesItem, type IUpdateAPIResponse, type IUpdateCalendarEventRequest, type IUpdateCapabilityIntegration, type IUpdateCapabilityIntegrationRequest, type IUpdateCapabilityIntegrationResponse, type IUpdateCapabilityIntegrationUpdateData, type IUpdateCustomerContactPersonRequest, type IUpdateCustomerPaymentRequest, type IUpdateCustomerRequest, type IUpdateDeviceCertificateInput, type IUpdateDeviceCertificateResponse, type IUpdateOfferingIntegrationResourceConfigurationInput, type IUpdateOfferingIntegrationResourceConfigurationResponse, type IUpdateOrderRequest, type IUpdateOrderResponse, type IUpdateRecurringInvoiceRequest, type IUpdateRecurringInvoiceResponse, type IUpdateRecurringInvoiceStatusRequest, type IUserAccessGroup, type IValidatedCapabilityIntegration, type IValidatedCapabilityIntegrationConfig, type IWellnessManagementRequestOptions, IntegrationBookingDao, IntegrationCommonDao, IntegrationConfigSecureStorageService, IntegrationConfigurationDao, AppModule$1 as IntegrationLibsModule, AppModule as IntegrationMicrosoftModule, IntegrationOnpremDeploymentDao, IntegrationRequestLoggerService, IntegrationResourceManagementDao, IntegrationServiceCommunicationTopicDao, IntegrationSubcapabilityDao, IntegrationUserManagementDao, IntegrationVisitorCredentialMappingDao, type InvoiceAccessDetails, MICROSOFT_CLIENT_CREDENTIALS_GRANT_TYPE, MICROSOFT_DEFAULT_ACCESS_TOKEN_TYPE, MICROSOFT_DEFAULT_AUTH_URL, MICROSOFT_DEFAULT_GRAPH_BASE_URL, MICROSOFT_DEFAULT_GRAPH_SCOPE, MICROSOFT_DEFAULT_HEADERS, MICROSOFT_GRAPH_PATHS, MICROSOFT_SECURE_STORAGE, MICROSOFT_TOKEN_HEADERS, MicrosoftApiClientService, MicrosoftAuthService, MicrosoftCalendarAuthHandler, MicrosoftCalendarBookingHandler, MicrosoftCalendarBookingService, MicrosoftCalendarIntegrationConfigurationHandler, MicrosoftCalendarResourceHandler, MicrosoftCalendarResourceService, MicrosoftCalendarWebhookHandler, MicrosoftCalendarWebhookService, type MicrosoftIntegrationConfigInput, MicrosoftIntegrationConfigurationService, type Note, type NoteAttachment, type NoteChangelog, type NoteChangelogRecord, type NoteResource, type NoteUserIdentity, RECURRING_INVOICE_STATUS, RECURRING_INVOICE_STATUS_ENUM, RateLimiterService, type ResourceAssetMapping, TRAFFIC_ROUTER_CONFIGURATION_STORE_KEY, TrafficGatewayService, type UserIdentity, buildMicrosoftIntegrationConfig, getMicrosoftKmsKeyId, looksLikeStoredSecureConfig };
|
package/dist/index.js
CHANGED
|
@@ -858,6 +858,11 @@ var RECURRING_INVOICE_STATUS = /* @__PURE__ */ (function(RECURRING_INVOICE_STATU
|
|
|
858
858
|
RECURRING_INVOICE_STATUS2["EXPIRED"] = "EXPIRED";
|
|
859
859
|
return RECURRING_INVOICE_STATUS2;
|
|
860
860
|
})({});
|
|
861
|
+
var RECURRING_INVOICE_STATUS_ENUM = /* @__PURE__ */ (function(RECURRING_INVOICE_STATUS_ENUM2) {
|
|
862
|
+
RECURRING_INVOICE_STATUS_ENUM2["STOP"] = "STOP";
|
|
863
|
+
RECURRING_INVOICE_STATUS_ENUM2["RESUME"] = "RESUME";
|
|
864
|
+
return RECURRING_INVOICE_STATUS_ENUM2;
|
|
865
|
+
})({});
|
|
861
866
|
|
|
862
867
|
// ../../packages/dvss-integration-libs/src/integration-operation-skeletons/models/miscellaneous.model.ts
|
|
863
868
|
var DOWNLOAD_CUSTOMER_ACCOUNTING_STATEMENT_FILTER_BY_ENUM = /* @__PURE__ */ (function(DOWNLOAD_CUSTOMER_ACCOUNTING_STATEMENT_FILTER_BY_ENUM2) {
|
|
@@ -4000,9 +4005,9 @@ exports.IntegrationOnpremDeploymentDao = _ts_decorate16([
|
|
|
4000
4005
|
// ../../packages/dvss-integration-microsoft/src/common/microsoft.constant.ts
|
|
4001
4006
|
var MICROSOFT_GRAPH_PATHS = {
|
|
4002
4007
|
rooms: "/places/microsoft.graph.room",
|
|
4003
|
-
userCalendarEvents: /* @__PURE__ */ __name((
|
|
4004
|
-
userCalendarEvent: /* @__PURE__ */ __name((
|
|
4005
|
-
userCalendarView: /* @__PURE__ */ __name((
|
|
4008
|
+
userCalendarEvents: /* @__PURE__ */ __name((mailboxEmail) => `/users/${encodeURIComponent(mailboxEmail)}/calendar/events`, "userCalendarEvents"),
|
|
4009
|
+
userCalendarEvent: /* @__PURE__ */ __name((mailboxEmail, eventId) => `/users/${encodeURIComponent(mailboxEmail)}/calendar/events/${encodeURIComponent(eventId)}`, "userCalendarEvent"),
|
|
4010
|
+
userCalendarView: /* @__PURE__ */ __name((mailboxEmail, startDateTime, endDateTime) => `/users/${encodeURIComponent(mailboxEmail)}/calendarView?startDateTime=${encodeURIComponent(startDateTime)}&endDateTime=${encodeURIComponent(endDateTime)}`, "userCalendarView"),
|
|
4006
4011
|
subscriptions: "/subscriptions",
|
|
4007
4012
|
subscription: /* @__PURE__ */ __name((subscriptionId) => `/subscriptions/${encodeURIComponent(subscriptionId)}`, "subscription")
|
|
4008
4013
|
};
|
|
@@ -4380,7 +4385,8 @@ var GRAPH_EVENT_KNOWN_KEYS = /* @__PURE__ */ new Set([
|
|
|
4380
4385
|
"attendees",
|
|
4381
4386
|
"organizer"
|
|
4382
4387
|
]);
|
|
4383
|
-
|
|
4388
|
+
var GRAPH_RESOURCE_ATTENDEE_TYPE = "resource";
|
|
4389
|
+
function toGraphEvent(event, options) {
|
|
4384
4390
|
const graph = {};
|
|
4385
4391
|
if (event.subject !== void 0) {
|
|
4386
4392
|
graph.subject = event.subject;
|
|
@@ -4431,12 +4437,20 @@ function toGraphEvent(event) {
|
|
|
4431
4437
|
return mapped;
|
|
4432
4438
|
});
|
|
4433
4439
|
}
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
+
const resourceId = options?.resourceId?.trim();
|
|
4441
|
+
if (resourceId) {
|
|
4442
|
+
const isAlreadyInvited = graph.attendees?.some((attendee) => attendee.emailAddress?.address?.toLowerCase() === resourceId.toLowerCase());
|
|
4443
|
+
if (isAlreadyInvited !== true) {
|
|
4444
|
+
graph.attendees = [
|
|
4445
|
+
...graph.attendees ?? [],
|
|
4446
|
+
{
|
|
4447
|
+
emailAddress: {
|
|
4448
|
+
address: resourceId
|
|
4449
|
+
},
|
|
4450
|
+
type: GRAPH_RESOURCE_ATTENDEE_TYPE
|
|
4451
|
+
}
|
|
4452
|
+
];
|
|
4453
|
+
}
|
|
4440
4454
|
}
|
|
4441
4455
|
return graph;
|
|
4442
4456
|
}
|
|
@@ -4449,7 +4463,8 @@ function toGraphRecurrence(recurrence) {
|
|
|
4449
4463
|
daysOfWeek: recurrence.pattern.daysOfWeek,
|
|
4450
4464
|
firstDayOfWeek: recurrence.pattern.firstDayOfWeek,
|
|
4451
4465
|
dayOfMonth: recurrence.pattern.dayOfMonth,
|
|
4452
|
-
month: recurrence.pattern.month
|
|
4466
|
+
month: recurrence.pattern.month,
|
|
4467
|
+
index: recurrence.pattern.index
|
|
4453
4468
|
}),
|
|
4454
4469
|
range: omitUndefined({
|
|
4455
4470
|
type: recurrence.range.type,
|
|
@@ -4476,7 +4491,7 @@ function fromGraphEvent(graph, options) {
|
|
|
4476
4491
|
timeZone: ""
|
|
4477
4492
|
},
|
|
4478
4493
|
location: graph.location?.displayName,
|
|
4479
|
-
|
|
4494
|
+
resourceId: options?.resourceId,
|
|
4480
4495
|
recurrence: graph.recurrence ? fromGraphRecurrence(graph.recurrence) : void 0,
|
|
4481
4496
|
attendees: graph.attendees?.filter((attendee) => Boolean(attendee.emailAddress?.address)).map((attendee) => ({
|
|
4482
4497
|
email: attendee.emailAddress?.address ?? "",
|
|
@@ -4488,7 +4503,11 @@ function fromGraphEvent(graph, options) {
|
|
|
4488
4503
|
isCancelled: graph.isCancelled,
|
|
4489
4504
|
syncMetadata: omitUndefined({
|
|
4490
4505
|
...options?.syncMetadata,
|
|
4491
|
-
externalEventId: graph.id ?? options?.syncMetadata?.externalEventId
|
|
4506
|
+
externalEventId: graph.id ?? options?.syncMetadata?.externalEventId,
|
|
4507
|
+
// Event ids are mailbox-scoped — remember which mailbox can address this id.
|
|
4508
|
+
// Left undefined when the room organizes; `resourceId` addresses the event then.
|
|
4509
|
+
organizerUserEmail: options?.organizerUserEmail ?? options?.syncMetadata?.organizerUserEmail,
|
|
4510
|
+
resourceId: options?.resourceId ?? options?.syncMetadata?.resourceId
|
|
4492
4511
|
}),
|
|
4493
4512
|
providerPayload
|
|
4494
4513
|
};
|
|
@@ -4502,7 +4521,8 @@ function fromGraphRecurrence(recurrence) {
|
|
|
4502
4521
|
daysOfWeek: recurrence.pattern?.daysOfWeek,
|
|
4503
4522
|
firstDayOfWeek: recurrence.pattern?.firstDayOfWeek,
|
|
4504
4523
|
dayOfMonth: recurrence.pattern?.dayOfMonth,
|
|
4505
|
-
month: recurrence.pattern?.month
|
|
4524
|
+
month: recurrence.pattern?.month,
|
|
4525
|
+
index: recurrence.pattern?.index
|
|
4506
4526
|
}),
|
|
4507
4527
|
range: omitUndefined({
|
|
4508
4528
|
type: recurrence.range?.type ?? "",
|
|
@@ -4553,24 +4573,30 @@ exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService
|
|
|
4553
4573
|
}
|
|
4554
4574
|
async createEvent(request, integration, loggedInUserId) {
|
|
4555
4575
|
try {
|
|
4576
|
+
const mailboxEmail = this.resolveMailboxEmail(request);
|
|
4556
4577
|
this.logger.info(loggedInUserId, this.createEvent.name, this.fileName, "Create Microsoft Graph calendar event", {
|
|
4557
|
-
|
|
4578
|
+
mailboxEmail,
|
|
4579
|
+
resourceId: request.resourceId,
|
|
4558
4580
|
subject: request.event.subject,
|
|
4559
|
-
path: MICROSOFT_GRAPH_PATHS.userCalendarEvents(
|
|
4581
|
+
path: MICROSOFT_GRAPH_PATHS.userCalendarEvents(mailboxEmail)
|
|
4560
4582
|
});
|
|
4561
|
-
this.
|
|
4583
|
+
this.assertResourceId(request.resourceId);
|
|
4562
4584
|
const graphEvent = await this.microsoftApiClient.apiCall({
|
|
4563
4585
|
apiMethod: HTTP_METHOD.POST,
|
|
4564
|
-
url: MICROSOFT_GRAPH_PATHS.userCalendarEvents(
|
|
4565
|
-
body: toGraphEvent(request.event
|
|
4586
|
+
url: MICROSOFT_GRAPH_PATHS.userCalendarEvents(mailboxEmail),
|
|
4587
|
+
body: toGraphEvent(request.event, {
|
|
4588
|
+
resourceId: this.resourceAsAttendee(mailboxEmail, request.resourceId)
|
|
4589
|
+
})
|
|
4566
4590
|
}, integration, loggedInUserId);
|
|
4567
4591
|
const mapped = fromGraphEvent(graphEvent, {
|
|
4568
|
-
|
|
4592
|
+
resourceId: request.resourceId,
|
|
4593
|
+
organizerUserEmail: this.organizerUserMailbox(request),
|
|
4569
4594
|
syncMetadata: request.event.syncMetadata
|
|
4570
4595
|
});
|
|
4571
4596
|
this.logger.info(loggedInUserId, this.createEvent.name, this.fileName, "Created Microsoft Graph calendar event", {
|
|
4572
4597
|
eventId: mapped.id,
|
|
4573
|
-
|
|
4598
|
+
mailboxEmail,
|
|
4599
|
+
resourceId: request.resourceId
|
|
4574
4600
|
});
|
|
4575
4601
|
return mapped;
|
|
4576
4602
|
} catch (error) {
|
|
@@ -4580,25 +4606,29 @@ exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService
|
|
|
4580
4606
|
}
|
|
4581
4607
|
async updateEvent(request, integration, loggedInUserId) {
|
|
4582
4608
|
try {
|
|
4609
|
+
const mailboxEmail = this.resolveMailboxEmail(request);
|
|
4583
4610
|
this.logger.info(loggedInUserId, this.updateEvent.name, this.fileName, "Update Microsoft Graph calendar event", {
|
|
4584
|
-
|
|
4611
|
+
mailboxEmail,
|
|
4612
|
+
resourceId: request.resourceId,
|
|
4585
4613
|
eventId: request.eventId,
|
|
4586
|
-
path: MICROSOFT_GRAPH_PATHS.userCalendarEvent(
|
|
4614
|
+
path: MICROSOFT_GRAPH_PATHS.userCalendarEvent(mailboxEmail, request.eventId)
|
|
4587
4615
|
});
|
|
4588
|
-
this.
|
|
4616
|
+
this.assertResourceId(request.resourceId);
|
|
4589
4617
|
this.assertEventId(request.eventId);
|
|
4590
4618
|
const graphEvent = await this.microsoftApiClient.apiCall({
|
|
4591
4619
|
apiMethod: HTTP_METHOD.PATCH,
|
|
4592
|
-
url: MICROSOFT_GRAPH_PATHS.userCalendarEvent(
|
|
4620
|
+
url: MICROSOFT_GRAPH_PATHS.userCalendarEvent(mailboxEmail, request.eventId),
|
|
4593
4621
|
body: toGraphEvent(request.event)
|
|
4594
4622
|
}, integration, loggedInUserId);
|
|
4595
4623
|
const mapped = fromGraphEvent(graphEvent, {
|
|
4596
|
-
|
|
4624
|
+
resourceId: request.resourceId,
|
|
4625
|
+
organizerUserEmail: this.organizerUserMailbox(request),
|
|
4597
4626
|
syncMetadata: request.event.syncMetadata
|
|
4598
4627
|
});
|
|
4599
4628
|
this.logger.info(loggedInUserId, this.updateEvent.name, this.fileName, "Updated Microsoft Graph calendar event", {
|
|
4600
4629
|
eventId: mapped.id,
|
|
4601
|
-
|
|
4630
|
+
mailboxEmail,
|
|
4631
|
+
resourceId: request.resourceId
|
|
4602
4632
|
});
|
|
4603
4633
|
return mapped;
|
|
4604
4634
|
} catch (error) {
|
|
@@ -4608,15 +4638,18 @@ exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService
|
|
|
4608
4638
|
}
|
|
4609
4639
|
async cancelEvent(request, integration, loggedInUserId) {
|
|
4610
4640
|
try {
|
|
4641
|
+
const mailboxEmail = this.resolveMailboxEmail(request);
|
|
4611
4642
|
this.logger.info(loggedInUserId, this.cancelEvent.name, this.fileName, "Cancel Microsoft Graph calendar event", {
|
|
4612
|
-
|
|
4643
|
+
mailboxEmail,
|
|
4644
|
+
resourceId: request.resourceId,
|
|
4613
4645
|
eventId: request.eventId,
|
|
4614
|
-
path: MICROSOFT_GRAPH_PATHS.userCalendarEvent(
|
|
4646
|
+
path: MICROSOFT_GRAPH_PATHS.userCalendarEvent(mailboxEmail, request.eventId)
|
|
4615
4647
|
});
|
|
4616
|
-
await this.deleteGraphEvent(request.
|
|
4648
|
+
await this.deleteGraphEvent(mailboxEmail, request.resourceId, request.eventId, integration, loggedInUserId);
|
|
4617
4649
|
this.logger.info(loggedInUserId, this.cancelEvent.name, this.fileName, "Cancelled Microsoft Graph calendar event", {
|
|
4618
4650
|
eventId: request.eventId,
|
|
4619
|
-
|
|
4651
|
+
mailboxEmail,
|
|
4652
|
+
resourceId: request.resourceId
|
|
4620
4653
|
});
|
|
4621
4654
|
} catch (error) {
|
|
4622
4655
|
this.logger.error(loggedInUserId, this.cancelEvent.name, this.fileName, "Error cancelling Microsoft Graph calendar event", error);
|
|
@@ -4625,15 +4658,18 @@ exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService
|
|
|
4625
4658
|
}
|
|
4626
4659
|
async deleteEvent(request, integration, loggedInUserId) {
|
|
4627
4660
|
try {
|
|
4661
|
+
const mailboxEmail = this.resolveMailboxEmail(request);
|
|
4628
4662
|
this.logger.info(loggedInUserId, this.deleteEvent.name, this.fileName, "Delete Microsoft Graph calendar event", {
|
|
4629
|
-
|
|
4663
|
+
mailboxEmail,
|
|
4664
|
+
resourceId: request.resourceId,
|
|
4630
4665
|
eventId: request.eventId,
|
|
4631
|
-
path: MICROSOFT_GRAPH_PATHS.userCalendarEvent(
|
|
4666
|
+
path: MICROSOFT_GRAPH_PATHS.userCalendarEvent(mailboxEmail, request.eventId)
|
|
4632
4667
|
});
|
|
4633
|
-
await this.deleteGraphEvent(request.
|
|
4668
|
+
await this.deleteGraphEvent(mailboxEmail, request.resourceId, request.eventId, integration, loggedInUserId);
|
|
4634
4669
|
this.logger.info(loggedInUserId, this.deleteEvent.name, this.fileName, "Deleted Microsoft Graph calendar event", {
|
|
4635
4670
|
eventId: request.eventId,
|
|
4636
|
-
|
|
4671
|
+
mailboxEmail,
|
|
4672
|
+
resourceId: request.resourceId
|
|
4637
4673
|
});
|
|
4638
4674
|
} catch (error) {
|
|
4639
4675
|
this.logger.error(loggedInUserId, this.deleteEvent.name, this.fileName, "Error deleting Microsoft Graph calendar event", error);
|
|
@@ -4642,23 +4678,27 @@ exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService
|
|
|
4642
4678
|
}
|
|
4643
4679
|
async getEvent(request, integration, loggedInUserId) {
|
|
4644
4680
|
try {
|
|
4681
|
+
const mailboxEmail = this.resolveMailboxEmail(request);
|
|
4645
4682
|
this.logger.info(loggedInUserId, this.getEvent.name, this.fileName, "Get Microsoft Graph calendar event", {
|
|
4646
|
-
|
|
4683
|
+
mailboxEmail,
|
|
4684
|
+
resourceId: request.resourceId,
|
|
4647
4685
|
eventId: request.eventId,
|
|
4648
|
-
path: MICROSOFT_GRAPH_PATHS.userCalendarEvent(
|
|
4686
|
+
path: MICROSOFT_GRAPH_PATHS.userCalendarEvent(mailboxEmail, request.eventId)
|
|
4649
4687
|
});
|
|
4650
|
-
this.
|
|
4688
|
+
this.assertResourceId(request.resourceId);
|
|
4651
4689
|
this.assertEventId(request.eventId);
|
|
4652
4690
|
const graphEvent = await this.microsoftApiClient.apiCall({
|
|
4653
4691
|
apiMethod: HTTP_METHOD.GET,
|
|
4654
|
-
url: MICROSOFT_GRAPH_PATHS.userCalendarEvent(
|
|
4692
|
+
url: MICROSOFT_GRAPH_PATHS.userCalendarEvent(mailboxEmail, request.eventId)
|
|
4655
4693
|
}, integration, loggedInUserId);
|
|
4656
4694
|
const mapped = fromGraphEvent(graphEvent, {
|
|
4657
|
-
|
|
4695
|
+
resourceId: request.resourceId,
|
|
4696
|
+
organizerUserEmail: this.organizerUserMailbox(request)
|
|
4658
4697
|
});
|
|
4659
4698
|
this.logger.info(loggedInUserId, this.getEvent.name, this.fileName, "Fetched Microsoft Graph calendar event", {
|
|
4660
4699
|
eventId: mapped.id,
|
|
4661
|
-
|
|
4700
|
+
mailboxEmail,
|
|
4701
|
+
resourceId: request.resourceId
|
|
4662
4702
|
});
|
|
4663
4703
|
return mapped;
|
|
4664
4704
|
} catch (error) {
|
|
@@ -4668,10 +4708,12 @@ exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService
|
|
|
4668
4708
|
}
|
|
4669
4709
|
async getEvents(request, integration, loggedInUserId) {
|
|
4670
4710
|
try {
|
|
4671
|
-
this.
|
|
4672
|
-
const
|
|
4711
|
+
this.assertResourceId(request.resourceId);
|
|
4712
|
+
const mailboxEmail = this.resolveMailboxEmail(request);
|
|
4713
|
+
const url = request.start && request.end ? MICROSOFT_GRAPH_PATHS.userCalendarView(mailboxEmail, request.start.dateTime, request.end.dateTime) : MICROSOFT_GRAPH_PATHS.userCalendarEvents(mailboxEmail);
|
|
4673
4714
|
this.logger.info(loggedInUserId, this.getEvents.name, this.fileName, "List Microsoft Graph calendar events", {
|
|
4674
|
-
|
|
4715
|
+
mailboxEmail,
|
|
4716
|
+
resourceId: request.resourceId,
|
|
4675
4717
|
path: url,
|
|
4676
4718
|
hasTimeWindow: Boolean(request.start && request.end)
|
|
4677
4719
|
});
|
|
@@ -4680,10 +4722,12 @@ exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService
|
|
|
4680
4722
|
url
|
|
4681
4723
|
}, integration, loggedInUserId);
|
|
4682
4724
|
const events = (response.value ?? []).map((graphEvent) => fromGraphEvent(graphEvent, {
|
|
4683
|
-
|
|
4725
|
+
resourceId: request.resourceId,
|
|
4726
|
+
organizerUserEmail: this.organizerUserMailbox(request)
|
|
4684
4727
|
}));
|
|
4685
4728
|
this.logger.info(loggedInUserId, this.getEvents.name, this.fileName, "Listed Microsoft Graph calendar events", {
|
|
4686
|
-
|
|
4729
|
+
mailboxEmail,
|
|
4730
|
+
resourceId: request.resourceId,
|
|
4687
4731
|
count: events.length
|
|
4688
4732
|
});
|
|
4689
4733
|
return {
|
|
@@ -4696,7 +4740,7 @@ exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService
|
|
|
4696
4740
|
}
|
|
4697
4741
|
syncEvents(request, integration, loggedInUserId) {
|
|
4698
4742
|
this.logger.info(loggedInUserId, this.syncEvents.name, this.fileName, "Sync Microsoft Graph calendar events (delta)", {
|
|
4699
|
-
|
|
4743
|
+
resourceId: request.resourceId,
|
|
4700
4744
|
hasSyncToken: Boolean(request.syncToken)
|
|
4701
4745
|
});
|
|
4702
4746
|
void this.microsoftApiClient;
|
|
@@ -4704,22 +4748,44 @@ exports.MicrosoftCalendarBookingService = class MicrosoftCalendarBookingService
|
|
|
4704
4748
|
}
|
|
4705
4749
|
getRoomAvailability(request, integration, loggedInUserId) {
|
|
4706
4750
|
this.logger.info(loggedInUserId, this.getRoomAvailability.name, this.fileName, "Get Microsoft Graph room availability", {
|
|
4707
|
-
resourceCount: request.
|
|
4751
|
+
resourceCount: request.resourceIds.length
|
|
4708
4752
|
});
|
|
4709
4753
|
void this.microsoftApiClient;
|
|
4710
4754
|
return Promise.reject(new common.NotImplementedException("MicrosoftCalendarBookingService.getRoomAvailability is not implemented yet"));
|
|
4711
4755
|
}
|
|
4712
|
-
async deleteGraphEvent(
|
|
4713
|
-
this.
|
|
4756
|
+
async deleteGraphEvent(mailboxEmail, resourceId, eventId, integration, loggedInUserId) {
|
|
4757
|
+
this.assertResourceId(resourceId);
|
|
4714
4758
|
this.assertEventId(eventId);
|
|
4715
4759
|
await this.microsoftApiClient.apiCall({
|
|
4716
4760
|
apiMethod: HTTP_METHOD.DELETE,
|
|
4717
|
-
url: MICROSOFT_GRAPH_PATHS.userCalendarEvent(
|
|
4761
|
+
url: MICROSOFT_GRAPH_PATHS.userCalendarEvent(mailboxEmail, eventId)
|
|
4718
4762
|
}, integration, loggedInUserId);
|
|
4719
4763
|
}
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4764
|
+
/**
|
|
4765
|
+
* Mailbox the Graph call targets: the organizing user when one is known, otherwise the
|
|
4766
|
+
* resource mailbox, which keeps the room-organizes behaviour for callers that cannot
|
|
4767
|
+
* resolve a user. The return value is therefore a user *or* a resource mailbox — never
|
|
4768
|
+
* store it as `organizerUserEmail`; use `organizerUserMailbox` for that.
|
|
4769
|
+
*/
|
|
4770
|
+
resolveMailboxEmail(request) {
|
|
4771
|
+
return this.organizerUserMailbox(request) ?? request.resourceId;
|
|
4772
|
+
}
|
|
4773
|
+
/**
|
|
4774
|
+
* The organizing user's mailbox, or undefined when the room ends up organizing.
|
|
4775
|
+
*/
|
|
4776
|
+
organizerUserMailbox(request) {
|
|
4777
|
+
return request.organizerUserEmail?.trim() || void 0;
|
|
4778
|
+
}
|
|
4779
|
+
/**
|
|
4780
|
+
* The room only needs to be invited as an attendee when the event lives in someone
|
|
4781
|
+
* else's mailbox. Posting into the room's own calendar already books it.
|
|
4782
|
+
*/
|
|
4783
|
+
resourceAsAttendee(mailboxEmail, resourceId) {
|
|
4784
|
+
return mailboxEmail.trim().toLowerCase() === resourceId.trim().toLowerCase() ? void 0 : resourceId;
|
|
4785
|
+
}
|
|
4786
|
+
assertResourceId(resourceId) {
|
|
4787
|
+
if (!resourceId?.trim()) {
|
|
4788
|
+
throw new dvssBackendModuleUtility.CustomException("BAD_REQUEST", "resourceId is required");
|
|
4723
4789
|
}
|
|
4724
4790
|
}
|
|
4725
4791
|
assertEventId(eventId) {
|
|
@@ -5108,6 +5174,7 @@ exports.IntegrationMicrosoftModule = _ts_decorate23([
|
|
|
5108
5174
|
exports.MicrosoftCalendarResourceService,
|
|
5109
5175
|
exports.MicrosoftCalendarBookingService,
|
|
5110
5176
|
exports.MicrosoftCalendarWebhookService,
|
|
5177
|
+
exports.IntegrationSubcapabilityDao,
|
|
5111
5178
|
exports.IntegrationConfigurationDao,
|
|
5112
5179
|
dvssBackendModuleDatastore.CommonValidationDatabaseService,
|
|
5113
5180
|
{
|
|
@@ -5657,6 +5724,7 @@ exports.MICROSOFT_GRAPH_PATHS = MICROSOFT_GRAPH_PATHS;
|
|
|
5657
5724
|
exports.MICROSOFT_SECURE_STORAGE = MICROSOFT_SECURE_STORAGE;
|
|
5658
5725
|
exports.MICROSOFT_TOKEN_HEADERS = MICROSOFT_TOKEN_HEADERS;
|
|
5659
5726
|
exports.RECURRING_INVOICE_STATUS = RECURRING_INVOICE_STATUS;
|
|
5727
|
+
exports.RECURRING_INVOICE_STATUS_ENUM = RECURRING_INVOICE_STATUS_ENUM;
|
|
5660
5728
|
exports.TRAFFIC_ROUTER_CONFIGURATION_STORE_KEY = TRAFFIC_ROUTER_CONFIGURATION_STORE_KEY;
|
|
5661
5729
|
exports.buildMicrosoftIntegrationConfig = buildMicrosoftIntegrationConfig;
|
|
5662
5730
|
exports.getMicrosoftKmsKeyId = getMicrosoftKmsKeyId;
|