@nylas/web-elements 0.0.0-test-20250319204140 → 0.0.0-test-20250320184617
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/cdn/nylas-scheduler-editor/nylas-scheduler-editor.es.js +26 -26
- package/dist/cdn/nylas-scheduling/nylas-scheduling.es.js +4813 -4805
- package/dist/cjs/button-component_2.cjs.entry.js +1 -1
- package/dist/cjs/button-component_2.cjs.entry.js.map +1 -1
- package/dist/cjs/calendar-agenda-fill-icon_36.cjs.entry.js +17 -18
- package/dist/cjs/calendar-agenda-fill-icon_36.cjs.entry.js.map +1 -1
- package/dist/cjs/chevron-icon_3.cjs.entry.js +1 -1
- package/dist/cjs/chevron-icon_3.cjs.entry.js.map +1 -1
- package/dist/cjs/google-logo-icon_6.cjs.entry.js +5 -5
- package/dist/cjs/google-logo-icon_6.cjs.entry.js.map +1 -1
- package/dist/cjs/input-dropdown_2.cjs.entry.js +2 -2
- package/dist/cjs/input-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/multi-select-dropdown_2.cjs.entry.js +2 -2
- package/dist/cjs/multi-select-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-booked-event-card_12.cjs.entry.js +14 -10
- package/dist/cjs/nylas-booked-event-card_12.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-key-points.cjs.entry.js +1 -1
- package/dist/cjs/nylas-key-points.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-provider.cjs.entry.js +1 -1
- package/dist/cjs/nylas-provider.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-scheduling.cjs.entry.js +1 -1
- package/dist/cjs/nylas-scheduling.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-web-elements.cjs.js +1 -1
- package/dist/cjs/{scheduler-store-c1fc5cf3.js → scheduler-store-df3a9a3a.js} +9 -1
- package/dist/cjs/scheduler-store-df3a9a3a.js.map +1 -0
- package/dist/collection/components/design-system/button-component/button-component.js +4 -3
- package/dist/collection/components/design-system/button-component/button-component.js.map +1 -1
- package/dist/collection/components/design-system/input-dropdown/input-dropdown.js +10 -7
- package/dist/collection/components/design-system/input-dropdown/input-dropdown.js.map +1 -1
- package/dist/collection/components/design-system/multi-select-dropdown/multi-select-dropdown.js +5 -4
- package/dist/collection/components/design-system/multi-select-dropdown/multi-select-dropdown.js.map +1 -1
- package/dist/collection/components/design-system/select-dropdown/select-dropdown.js +13 -9
- package/dist/collection/components/design-system/select-dropdown/select-dropdown.js.map +1 -1
- package/dist/collection/components/design-system/time-period-selector/time-period-selector.js +3 -3
- package/dist/collection/components/design-system/time-period-selector/time-period-selector.js.map +1 -1
- package/dist/collection/components/nylas-notebook/nylas-key-points/nylas-key-points.js +4 -3
- package/dist/collection/components/nylas-notebook/nylas-key-points/nylas-key-points.js.map +1 -1
- package/dist/collection/components/nylas-provider/nylas-provider.js +1 -1
- package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js +13 -11
- package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js +3 -3
- package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-booking-form/test/nylas-booking-form.spec.js +8 -6
- package/dist/collection/components/scheduler/nylas-booking-form/test/nylas-booking-form.spec.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-organizer-confirmation-card/nylas-organizer-confirmation-card.js +8 -10
- package/dist/collection/components/scheduler/nylas-organizer-confirmation-card/nylas-organizer-confirmation-card.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.js +2 -2
- package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-buffer-time/nylas-buffer-time.js +2 -2
- package/dist/collection/components/scheduler-editor/nylas-buffer-time/nylas-buffer-time.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs-group/nylas-editor-tabs-group.js +36 -21
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs-group/nylas-editor-tabs-group.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-event-duration/nylas-event-duration.js +15 -16
- package/dist/collection/components/scheduler-editor/nylas-event-duration/nylas-event-duration.js.map +1 -1
- package/dist/collection/connector/nylas-scheduler-connector/errors/index.js +1 -29
- package/dist/collection/connector/nylas-scheduler-connector/errors/index.js.map +1 -1
- package/dist/collection/connector/shared/api/auth.js.map +1 -1
- package/dist/collection/connector/shared/api/scheduler.js.map +1 -1
- package/dist/collection/types/index.js +29 -0
- package/dist/collection/types/index.js.map +1 -1
- package/dist/components/button-component2.js +1 -1
- package/dist/components/button-component2.js.map +1 -1
- package/dist/components/input-dropdown2.js +1 -1
- package/dist/components/input-dropdown2.js.map +1 -1
- package/dist/components/multi-select-dropdown2.js +2 -2
- package/dist/components/multi-select-dropdown2.js.map +1 -1
- package/dist/components/nylas-booked-event-card2.js +9 -5
- package/dist/components/nylas-booked-event-card2.js.map +1 -1
- package/dist/components/nylas-booking-form2.js +3 -3
- package/dist/components/nylas-booking-form2.js.map +1 -1
- package/dist/components/nylas-buffer-time2.js +2 -2
- package/dist/components/nylas-buffer-time2.js.map +1 -1
- package/dist/components/nylas-editor-tabs-group2.js +5 -5
- package/dist/components/nylas-editor-tabs-group2.js.map +1 -1
- package/dist/components/nylas-event-duration2.js +15 -16
- package/dist/components/nylas-event-duration2.js.map +1 -1
- package/dist/components/nylas-key-points.js +1 -1
- package/dist/components/nylas-key-points.js.map +1 -1
- package/dist/components/nylas-organizer-confirmation-card2.js +4 -4
- package/dist/components/nylas-organizer-confirmation-card2.js.map +1 -1
- package/dist/components/nylas-provider.js.map +1 -1
- package/dist/components/nylas-scheduling.js.map +1 -1
- package/dist/components/scheduler-store.js +8 -0
- package/dist/components/scheduler-store.js.map +1 -1
- package/dist/components/select-dropdown2.js +1 -1
- package/dist/components/select-dropdown2.js.map +1 -1
- package/dist/components/time-period-selector2.js +1 -1
- package/dist/components/time-period-selector2.js.map +1 -1
- package/dist/esm/button-component_2.entry.js +1 -1
- package/dist/esm/button-component_2.entry.js.map +1 -1
- package/dist/esm/calendar-agenda-fill-icon_36.entry.js +17 -18
- package/dist/esm/calendar-agenda-fill-icon_36.entry.js.map +1 -1
- package/dist/esm/chevron-icon_3.entry.js +1 -1
- package/dist/esm/chevron-icon_3.entry.js.map +1 -1
- package/dist/esm/google-logo-icon_6.entry.js +5 -5
- package/dist/esm/google-logo-icon_6.entry.js.map +1 -1
- package/dist/esm/input-dropdown_2.entry.js +2 -2
- package/dist/esm/input-dropdown_2.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/multi-select-dropdown_2.entry.js +2 -2
- package/dist/esm/multi-select-dropdown_2.entry.js.map +1 -1
- package/dist/esm/nylas-booked-event-card_12.entry.js +14 -10
- package/dist/esm/nylas-booked-event-card_12.entry.js.map +1 -1
- package/dist/esm/nylas-key-points.entry.js +1 -1
- package/dist/esm/nylas-key-points.entry.js.map +1 -1
- package/dist/esm/nylas-provider.entry.js +1 -1
- package/dist/esm/nylas-provider.entry.js.map +1 -1
- package/dist/esm/nylas-scheduling.entry.js +1 -1
- package/dist/esm/nylas-scheduling.entry.js.map +1 -1
- package/dist/esm/nylas-web-elements.js +1 -1
- package/dist/esm/{scheduler-store-bbb4cf8d.js → scheduler-store-ef022be9.js} +9 -1
- package/dist/esm/scheduler-store-ef022be9.js.map +1 -0
- package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
- package/dist/nylas-web-elements/nylas-web-elements.esm.js.map +1 -1
- package/dist/nylas-web-elements/{p-c3cfe486.entry.js → p-09bbd467.entry.js} +2 -2
- package/dist/nylas-web-elements/p-09bbd467.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-6371e0a3.entry.js → p-0d80f50b.entry.js} +2 -2
- package/dist/nylas-web-elements/p-0d80f50b.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-13a6c977.entry.js +2 -0
- package/dist/nylas-web-elements/p-13a6c977.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-14569ed8.entry.js → p-1fb32e0e.entry.js} +2 -2
- package/dist/nylas-web-elements/p-1fb32e0e.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-19f6fcf8.entry.js → p-3ca36162.entry.js} +2 -2
- package/dist/nylas-web-elements/p-3ca36162.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-78bd1f85.entry.js → p-51434e4a.entry.js} +2 -2
- package/dist/nylas-web-elements/p-51434e4a.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-731a856b.js +2 -0
- package/dist/nylas-web-elements/p-731a856b.js.map +1 -0
- package/dist/nylas-web-elements/p-7b787c73.entry.js +8 -0
- package/dist/nylas-web-elements/p-7b787c73.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-f7ea608d.entry.js → p-a906d005.entry.js} +2 -2
- package/dist/nylas-web-elements/p-a906d005.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-ab3ba8dc.entry.js +2 -0
- package/dist/nylas-web-elements/p-ab3ba8dc.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-91bc630c.entry.js → p-b1c57792.entry.js} +2 -2
- package/dist/nylas-web-elements/p-b1c57792.entry.js.map +1 -0
- package/dist/types/components/design-system/button-component/button-component.d.ts +1 -2
- package/dist/types/components/design-system/input-dropdown/input-dropdown.d.ts +1 -6
- package/dist/types/components/design-system/multi-select-dropdown/multi-select-dropdown.d.ts +1 -7
- package/dist/types/components/design-system/select-dropdown/select-dropdown.d.ts +1 -6
- package/dist/types/components/design-system/time-period-selector/time-period-selector.d.ts +1 -1
- package/dist/types/components/nylas-notebook/nylas-key-points/nylas-key-points.d.ts +1 -6
- package/dist/types/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.d.ts +2 -1
- package/dist/types/components/scheduler/nylas-booking-form/nylas-booking-form.d.ts +1 -1
- package/dist/types/components/scheduler/nylas-organizer-confirmation-card/nylas-organizer-confirmation-card.d.ts +1 -1
- package/dist/types/components/scheduler-editor/nylas-editor-tabs-group/nylas-editor-tabs-group.d.ts +17 -16
- package/dist/types/components/scheduler-editor/nylas-event-duration/nylas-event-duration.d.ts +2 -2
- package/dist/types/components.d.ts +17 -17
- package/dist/types/connector/nylas-connector/index.d.ts +1 -1
- package/dist/types/connector/nylas-scheduler-connector/errors/index.d.ts +1 -31
- package/dist/types/connector/shared/api/auth.d.ts +1 -1
- package/dist/types/connector/shared/api/scheduler.d.ts +1 -1
- package/dist/types/types/index.d.ts +36 -0
- package/package.json +2 -2
- package/dist/cjs/scheduler-store-c1fc5cf3.js.map +0 -1
- package/dist/esm/scheduler-store-bbb4cf8d.js.map +0 -1
- package/dist/nylas-web-elements/p-14569ed8.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-19f6fcf8.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-463d9c42.entry.js +0 -8
- package/dist/nylas-web-elements/p-463d9c42.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-6371e0a3.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-78bd1f85.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-91bc630c.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-ac757a7b.entry.js +0 -2
- package/dist/nylas-web-elements/p-ac757a7b.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-b0f18064.entry.js +0 -2
- package/dist/nylas-web-elements/p-b0f18064.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-c3cfe486.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-f0c25e38.js +0 -2
- package/dist/nylas-web-elements/p-f0c25e38.js.map +0 -1
- package/dist/nylas-web-elements/p-f7ea608d.entry.js.map +0 -1
package/dist/types/components/design-system/multi-select-dropdown/multi-select-dropdown.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
-
|
|
3
|
-
label: string;
|
|
4
|
-
value: string;
|
|
5
|
-
selected?: boolean;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
}
|
|
2
|
+
import { DropdownOption } from '@nylas/core';
|
|
8
3
|
export declare class MultiSelectDropdown {
|
|
9
4
|
el: HTMLElement;
|
|
10
5
|
name: string;
|
|
@@ -38,4 +33,3 @@ export declare class MultiSelectDropdown {
|
|
|
38
33
|
renderOption(option: DropdownOption): any;
|
|
39
34
|
render(): any;
|
|
40
35
|
}
|
|
41
|
-
export {};
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
-
|
|
3
|
-
labelHTML?: HTMLElement;
|
|
4
|
-
label: string;
|
|
5
|
-
value: string;
|
|
6
|
-
}
|
|
2
|
+
import { DropdownOption } from '@nylas/core';
|
|
7
3
|
export declare class SelectDropdown {
|
|
8
4
|
el: HTMLElement;
|
|
9
5
|
private readonly componentType;
|
|
@@ -56,4 +52,3 @@ export declare class SelectDropdown {
|
|
|
56
52
|
handleOutsideClick(event: MouseEvent): void;
|
|
57
53
|
render(): any;
|
|
58
54
|
}
|
|
59
|
-
export {};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
time: number;
|
|
3
|
-
text: string;
|
|
4
|
-
active?: boolean;
|
|
5
|
-
}
|
|
1
|
+
import { KeyPoint } from "../../../types/index";
|
|
6
2
|
export declare class NylasKeyPoints {
|
|
7
3
|
keyPoints: KeyPoint[];
|
|
8
4
|
transcripts(): {
|
|
@@ -12,4 +8,3 @@ export declare class NylasKeyPoints {
|
|
|
12
8
|
}[];
|
|
13
9
|
render(): any;
|
|
14
10
|
}
|
|
15
|
-
export {};
|
package/dist/types/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { NylasSchedulerBookingData } from '../../..';
|
|
3
|
+
import { ConfigSettings } from "../../../stores/scheduler-store";
|
|
3
4
|
import { NylasEvent } from "../../../common/types";
|
|
4
5
|
import { NylasSchedulerErrorResponse, ThemeConfig, Timeslot } from '@nylas/core';
|
|
5
6
|
export declare class NylasBookedEventCard {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Event, EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
-
import
|
|
2
|
+
import { ConfigSettings } from "../../../stores/scheduler-store";
|
|
3
3
|
import type { NylasSchedulerBookingDataWithFlatFields, NylasSchedulerBookingData, NylasEvent } from "../../../common/types";
|
|
4
4
|
import { Notification, ThemeConfig } from '@nylas/core';
|
|
5
5
|
export declare class NylasBookingForm {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
-
import { ConfigSettings } from
|
|
2
|
+
import { ConfigSettings } from "../../../stores/scheduler-store";
|
|
3
3
|
import { NylasSchedulerErrorResponse, ThemeConfig } from '@nylas/core';
|
|
4
4
|
export declare class NylasOrganizerConfirmationCard {
|
|
5
5
|
host: HTMLNylasOrganizerConfirmationCardElement;
|
package/dist/types/components/scheduler-editor/nylas-editor-tabs-group/nylas-editor-tabs-group.d.ts
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { AdditionalFields, Appearance, BookingType, Calendar, Conference, Configuration, EmailTemplate, EventReminder, GroupConfiguration, GroupEvent, GroupEventAPIData, ImportGroupEventDetails, RecurrenceDeleteOption, RecurrenceUpdateOption } from '@nylas/core';
|
|
2
2
|
import { Event, EventEmitter } from '../../../stencil-public-runtime';
|
|
3
|
-
import { TabGroup
|
|
3
|
+
import { TabGroup } from './tab-contents-group';
|
|
4
4
|
import { User } from "../../../common/nylas-api-request";
|
|
5
5
|
import { CONFIGURATION_EVENT_TYPE } from "../../../common/constants";
|
|
6
6
|
import { LANGUAGE_CODE } from "../../../common/constants";
|
|
7
7
|
import { CreateGroupEventFormState } from '../../..';
|
|
8
|
-
|
|
9
|
-
config: Partial<GroupConfiguration>;
|
|
10
|
-
groupEvent?: Partial<GroupEvent>;
|
|
11
|
-
action: 'create' | 'edit';
|
|
12
|
-
host: HTMLNylasEditorTabsGroupElement;
|
|
13
|
-
resetLoadingState?: (e: CustomEvent) => void;
|
|
14
|
-
};
|
|
8
|
+
import { SchedulerGroupEventDetail } from '@nylas/core';
|
|
15
9
|
export declare class NylasEditorTabsGroup {
|
|
16
10
|
private formRef;
|
|
17
11
|
host: HTMLNylasEditorTabsGroupElement;
|
|
@@ -21,14 +15,14 @@ export declare class NylasEditorTabsGroup {
|
|
|
21
15
|
currentUser?: User;
|
|
22
16
|
schedulerPreviewLink: string;
|
|
23
17
|
mode?: 'app' | 'composable';
|
|
24
|
-
hideEditorTabs?:
|
|
18
|
+
hideEditorTabs?: TabGroup[];
|
|
25
19
|
enableUserFeedback?: boolean;
|
|
26
20
|
selectedLanguage?: LANGUAGE_CODE;
|
|
27
21
|
selectedEventType?: CONFIGURATION_EVENT_TYPE;
|
|
28
22
|
selectedGroupEvent?: GroupEventAPIData;
|
|
29
23
|
action: 'create' | 'edit';
|
|
30
24
|
showFeedbackModal: boolean;
|
|
31
|
-
activeTab:
|
|
25
|
+
activeTab: TabGroup;
|
|
32
26
|
isLoading: boolean;
|
|
33
27
|
hasUnsavedChanges: boolean;
|
|
34
28
|
changesSaved: boolean;
|
|
@@ -68,8 +62,12 @@ export declare class NylasEditorTabsGroup {
|
|
|
68
62
|
};
|
|
69
63
|
}>;
|
|
70
64
|
error?: string;
|
|
71
|
-
schedulerConfigChanged: EventEmitter<SchedulerGroupEventDetail
|
|
72
|
-
|
|
65
|
+
schedulerConfigChanged: EventEmitter<SchedulerGroupEventDetail & {
|
|
66
|
+
host: HTMLNylasEditorTabsGroupElement;
|
|
67
|
+
}>;
|
|
68
|
+
schedulerConfigCreated: EventEmitter<SchedulerGroupEventDetail & {
|
|
69
|
+
host: HTMLNylasEditorTabsGroupElement;
|
|
70
|
+
}>;
|
|
73
71
|
cancelButtonClick: EventEmitter<void>;
|
|
74
72
|
formSubmitted: EventEmitter<void>;
|
|
75
73
|
previewButtonClicked: EventEmitter<HTMLNylasEditorTabsGroupElement>;
|
|
@@ -108,7 +106,11 @@ export declare class NylasEditorTabsGroup {
|
|
|
108
106
|
selectedGroupEventChangedHandler(newConfig: GroupEventAPIData): void;
|
|
109
107
|
userChangedHandler(newUser: User): void;
|
|
110
108
|
selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE): void;
|
|
111
|
-
schedulerConfigCreatedEventHandler(data: SchedulerGroupEventDetail
|
|
109
|
+
schedulerConfigCreatedEventHandler(data: SchedulerGroupEventDetail & {
|
|
110
|
+
host: HTMLNylasEditorTabsGroupElement;
|
|
111
|
+
}): Promise<CustomEvent<SchedulerGroupEventDetail & {
|
|
112
|
+
host: HTMLNylasEditorTabsGroupElement;
|
|
113
|
+
}>>;
|
|
112
114
|
setError(error: Error): Promise<void>;
|
|
113
115
|
resetError(): Promise<void>;
|
|
114
116
|
connectedCallback(): void;
|
|
@@ -182,11 +184,10 @@ export declare class NylasEditorTabsGroup {
|
|
|
182
184
|
recurrence: string[];
|
|
183
185
|
};
|
|
184
186
|
}>;
|
|
185
|
-
setActiveTab(e: Event, tabName:
|
|
187
|
+
setActiveTab(e: Event, tabName: TabGroup): void;
|
|
186
188
|
formSubmissionHandler: (event: Event) => Promise<void>;
|
|
187
189
|
checkForBookingFormErrors: (config: any) => boolean;
|
|
188
|
-
hideTab(tab:
|
|
190
|
+
hideTab(tab: TabGroup): boolean;
|
|
189
191
|
onFeedbackClick(e: Event): void;
|
|
190
192
|
render(): any;
|
|
191
193
|
}
|
|
192
|
-
export {};
|
package/dist/types/components/scheduler-editor/nylas-event-duration/nylas-event-duration.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare class NylasEventDuration {
|
|
|
12
12
|
durationIncrement: number;
|
|
13
13
|
error: string;
|
|
14
14
|
durationMinutesOptions: {
|
|
15
|
-
value:
|
|
15
|
+
value: string;
|
|
16
16
|
label: string;
|
|
17
17
|
}[];
|
|
18
18
|
internals: ElementInternals;
|
|
@@ -29,7 +29,7 @@ export declare class NylasEventDuration {
|
|
|
29
29
|
disconnectedCallback(): void;
|
|
30
30
|
get isInternalsAvailable(): boolean;
|
|
31
31
|
setDurationMintueOptions(): {
|
|
32
|
-
value:
|
|
32
|
+
value: string;
|
|
33
33
|
label: string;
|
|
34
34
|
}[];
|
|
35
35
|
validateDuration(): string;
|
|
@@ -5,18 +5,19 @@
|
|
|
5
5
|
* It contains typing information for all components that exist in this project.
|
|
6
6
|
*/
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
|
-
import { AdditionalParticipant, Appearance, AuthConfig, Calendar, Conference, Configuration, EmailTemplate, EventDetails, EventReminder, GroupConfiguration, GroupEvent, GroupEventAPIData, ImportGroupEventDetails, Notification, NylasAuthType, NylasCalendar, NylasSchedulerBookingData as NylasSchedulerBookingData2, NylasSchedulerErrorResponse, NylasSchedulerResponse, Participant, RecurrenceDeleteOption, RecurrenceUpdateOption, ThemeConfig, Timeslot } from "@nylas/core";
|
|
8
|
+
import { AdditionalParticipant, Appearance, AuthConfig, ButtonType, Calendar, Conference, Configuration, DropdownOption, EmailTemplate, EventDetails, EventReminder, GroupConfiguration, GroupEvent, GroupEventAPIData, ImportGroupEventDetails, Notification, NylasAuthType, NylasCalendar, NylasSchedulerBookingData as NylasSchedulerBookingData2, NylasSchedulerErrorResponse, NylasSchedulerResponse, Participant, RecurrenceDeleteOption, RecurrenceUpdateOption, SchedulerGroupEventDetail, ThemeConfig, TimePeriod, Timeslot } from "@nylas/core";
|
|
9
9
|
import { AuthArgs, NylasApiRequest, User } from "./common/nylas-api-request";
|
|
10
10
|
import { CONFIGURATION_EVENT_TYPE, EXPERIMENTAL_FEATURES, LANGUAGE_CODE, Locale } from "./common/constants";
|
|
11
11
|
import { OpenHours } from "./components/scheduler-editor/nylas-availability-picker/nylas-availability-picker";
|
|
12
12
|
import { NylasEvent, NylasSchedulerBookingData as NylasSchedulerBookingData1, NylasSchedulerBookingDataWithFlatFields, UISettingsResponse } from "./common/types";
|
|
13
|
-
import {
|
|
14
|
-
import { AvailabilityTimeslot, ConfigSettings
|
|
13
|
+
import { NylasEvent as NylasEvent1, NylasSchedulerBookingData, NylasSchedulerErrorResponse as NylasSchedulerErrorResponse1 } from ".";
|
|
14
|
+
import { AvailabilityTimeslot, ConfigSettings, NylasSchedulerStoreState, NylasSchedulerStoreType } from "./stores/scheduler-store";
|
|
15
15
|
import { Tab } from "./components/scheduler-editor/nylas-editor-tabs/tab-contents";
|
|
16
16
|
import { SchedulerEventDetail } from "./components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs";
|
|
17
|
-
import {
|
|
17
|
+
import { TabGroup } from "./components/scheduler-editor/nylas-editor-tabs-group/tab-contents-group";
|
|
18
18
|
import { CreateGroupEventFormState } from "./components/scheduler-editor/nylas-event-calendar/nylas-event-calendar";
|
|
19
19
|
import { Stores, Transitions } from "./components/nylas-if-state/nylas-if-state";
|
|
20
|
+
import { KeyPoint } from "./types/index";
|
|
20
21
|
import { NylasAuthConnectorInterface } from "./connector/connector-interface";
|
|
21
22
|
import { EventOverride, SchedulerEditorEventOverride, SchedulerEventOverride } from "./common/component-types";
|
|
22
23
|
import { NylasConnector } from "./connector/nylas-connector/index";
|
|
@@ -25,19 +26,19 @@ import { NylasSchedulerConfigStoreState, NylasSchedulerConfigStoreType } from ".
|
|
|
25
26
|
import { Config } from "@nylas/identity";
|
|
26
27
|
import { NylasSchedulerConfigConnector } from "./connector/nylas-scheduler-config-connector/index";
|
|
27
28
|
import { NylasSchedulerConnector } from "./connector/nylas-scheduler-connector/index";
|
|
28
|
-
|
|
29
|
-
export { AdditionalParticipant, Appearance, AuthConfig, Calendar, Conference, Configuration, EmailTemplate, EventDetails, EventReminder, GroupConfiguration, GroupEvent, GroupEventAPIData, ImportGroupEventDetails, Notification, NylasAuthType, NylasCalendar, NylasSchedulerBookingData as NylasSchedulerBookingData2, NylasSchedulerErrorResponse, NylasSchedulerResponse, Participant, RecurrenceDeleteOption, RecurrenceUpdateOption, ThemeConfig, Timeslot } from "@nylas/core";
|
|
29
|
+
export { AdditionalParticipant, Appearance, AuthConfig, ButtonType, Calendar, Conference, Configuration, DropdownOption, EmailTemplate, EventDetails, EventReminder, GroupConfiguration, GroupEvent, GroupEventAPIData, ImportGroupEventDetails, Notification, NylasAuthType, NylasCalendar, NylasSchedulerBookingData as NylasSchedulerBookingData2, NylasSchedulerErrorResponse, NylasSchedulerResponse, Participant, RecurrenceDeleteOption, RecurrenceUpdateOption, SchedulerGroupEventDetail, ThemeConfig, TimePeriod, Timeslot } from "@nylas/core";
|
|
30
30
|
export { AuthArgs, NylasApiRequest, User } from "./common/nylas-api-request";
|
|
31
31
|
export { CONFIGURATION_EVENT_TYPE, EXPERIMENTAL_FEATURES, LANGUAGE_CODE, Locale } from "./common/constants";
|
|
32
32
|
export { OpenHours } from "./components/scheduler-editor/nylas-availability-picker/nylas-availability-picker";
|
|
33
33
|
export { NylasEvent, NylasSchedulerBookingData as NylasSchedulerBookingData1, NylasSchedulerBookingDataWithFlatFields, UISettingsResponse } from "./common/types";
|
|
34
|
-
export {
|
|
35
|
-
export { AvailabilityTimeslot, ConfigSettings
|
|
34
|
+
export { NylasEvent as NylasEvent1, NylasSchedulerBookingData, NylasSchedulerErrorResponse as NylasSchedulerErrorResponse1 } from ".";
|
|
35
|
+
export { AvailabilityTimeslot, ConfigSettings, NylasSchedulerStoreState, NylasSchedulerStoreType } from "./stores/scheduler-store";
|
|
36
36
|
export { Tab } from "./components/scheduler-editor/nylas-editor-tabs/tab-contents";
|
|
37
37
|
export { SchedulerEventDetail } from "./components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs";
|
|
38
|
-
export {
|
|
38
|
+
export { TabGroup } from "./components/scheduler-editor/nylas-editor-tabs-group/tab-contents-group";
|
|
39
39
|
export { CreateGroupEventFormState } from "./components/scheduler-editor/nylas-event-calendar/nylas-event-calendar";
|
|
40
40
|
export { Stores, Transitions } from "./components/nylas-if-state/nylas-if-state";
|
|
41
|
+
export { KeyPoint } from "./types/index";
|
|
41
42
|
export { NylasAuthConnectorInterface } from "./connector/connector-interface";
|
|
42
43
|
export { EventOverride, SchedulerEditorEventOverride, SchedulerEventOverride } from "./common/component-types";
|
|
43
44
|
export { NylasConnector } from "./connector/nylas-connector/index";
|
|
@@ -46,7 +47,6 @@ export { NylasSchedulerConfigStoreState, NylasSchedulerConfigStoreType } from ".
|
|
|
46
47
|
export { Config } from "@nylas/identity";
|
|
47
48
|
export { NylasSchedulerConfigConnector } from "./connector/nylas-scheduler-config-connector/index";
|
|
48
49
|
export { NylasSchedulerConnector } from "./connector/nylas-scheduler-connector/index";
|
|
49
|
-
export { TimePeriod } from "@nylas/core/lib";
|
|
50
50
|
export namespace Components {
|
|
51
51
|
interface AddCircleIcon {
|
|
52
52
|
"height": string;
|
|
@@ -1091,7 +1091,7 @@ export namespace Components {
|
|
|
1091
1091
|
/**
|
|
1092
1092
|
* @standalone This prop is passed down by the parent component. It is an optional prop is used to hide tabs in the editor. Available tabs are: eventInfo, availability, participants, bookingOptions, bookingForm
|
|
1093
1093
|
*/
|
|
1094
|
-
"hideEditorTabs"?:
|
|
1094
|
+
"hideEditorTabs"?: TabGroup[];
|
|
1095
1095
|
/**
|
|
1096
1096
|
* @standalone The mode of the editor. - `app`: The editor is used as a standalone app. - `composable`: The editor is used as a composable component.
|
|
1097
1097
|
*/
|
|
@@ -1103,7 +1103,7 @@ export namespace Components {
|
|
|
1103
1103
|
/**
|
|
1104
1104
|
* Event handler for the scheduler config created event.
|
|
1105
1105
|
*/
|
|
1106
|
-
"schedulerConfigCreatedEventHandler": (data: SchedulerGroupEventDetail) => Promise<CustomEvent<SchedulerGroupEventDetail>>;
|
|
1106
|
+
"schedulerConfigCreatedEventHandler": (data: SchedulerGroupEventDetail & { host: HTMLNylasEditorTabsGroupElement; }) => Promise<CustomEvent<SchedulerGroupEventDetail & { host: HTMLNylasEditorTabsGroupElement; }>>;
|
|
1107
1107
|
/**
|
|
1108
1108
|
* @standalone The scheduler preview link to use when the user clicks on the preview button. You can use a placeholder `{config.id}` to replace the configuration id anywhere in the link.
|
|
1109
1109
|
*/
|
|
@@ -3544,8 +3544,8 @@ declare global {
|
|
|
3544
3544
|
new (): HTMLNylasEditorTabsElement;
|
|
3545
3545
|
};
|
|
3546
3546
|
interface HTMLNylasEditorTabsGroupElementEventMap {
|
|
3547
|
-
"schedulerConfigChanged": SchedulerGroupEventDetail;
|
|
3548
|
-
"schedulerConfigCreated": SchedulerGroupEventDetail;
|
|
3547
|
+
"schedulerConfigChanged": SchedulerGroupEventDetail & { host: HTMLNylasEditorTabsGroupElement };
|
|
3548
|
+
"schedulerConfigCreated": SchedulerGroupEventDetail & { host: HTMLNylasEditorTabsGroupElement };
|
|
3549
3549
|
"cancelButtonClick": void;
|
|
3550
3550
|
"formSubmitted": void;
|
|
3551
3551
|
"previewButtonClicked": HTMLNylasEditorTabsGroupElement;
|
|
@@ -6143,7 +6143,7 @@ declare namespace LocalJSX {
|
|
|
6143
6143
|
/**
|
|
6144
6144
|
* @standalone This prop is passed down by the parent component. It is an optional prop is used to hide tabs in the editor. Available tabs are: eventInfo, availability, participants, bookingOptions, bookingForm
|
|
6145
6145
|
*/
|
|
6146
|
-
"hideEditorTabs"?:
|
|
6146
|
+
"hideEditorTabs"?: TabGroup[];
|
|
6147
6147
|
/**
|
|
6148
6148
|
* @standalone The mode of the editor. - `app`: The editor is used as a standalone app. - `composable`: The editor is used as a composable component.
|
|
6149
6149
|
*/
|
|
@@ -6201,11 +6201,11 @@ declare namespace LocalJSX {
|
|
|
6201
6201
|
/**
|
|
6202
6202
|
* Event emitted when the configuration is created/updated (after the request is complete). This fires for both create and edit actions.
|
|
6203
6203
|
*/
|
|
6204
|
-
"onSchedulerConfigChanged"?: (event: NylasEditorTabsGroupCustomEvent<SchedulerGroupEventDetail>) => void;
|
|
6204
|
+
"onSchedulerConfigChanged"?: (event: NylasEditorTabsGroupCustomEvent<SchedulerGroupEventDetail & { host: HTMLNylasEditorTabsGroupElement }>) => void;
|
|
6205
6205
|
/**
|
|
6206
6206
|
* Event emitted when the configuration is created (after the request is made). This fires for only for create action.
|
|
6207
6207
|
*/
|
|
6208
|
-
"onSchedulerConfigCreated"?: (event: NylasEditorTabsGroupCustomEvent<SchedulerGroupEventDetail>) => void;
|
|
6208
|
+
"onSchedulerConfigCreated"?: (event: NylasEditorTabsGroupCustomEvent<SchedulerGroupEventDetail & { host: HTMLNylasEditorTabsGroupElement }>) => void;
|
|
6209
6209
|
/**
|
|
6210
6210
|
* Event emitted when the value of a form field changes.
|
|
6211
6211
|
*/
|
|
@@ -29,7 +29,7 @@ export declare class NylasConnector implements NylasConnectorInterface {
|
|
|
29
29
|
<T>(path: string, method?: string | undefined, body?: any, parseJSON?: boolean | undefined, domain?: string | undefined, request?: RequestInit | undefined): Promise<T>;
|
|
30
30
|
<T_1>(path: string, method: string, body: any, parseJSON: false, domain?: string | undefined, request?: RequestInit | undefined): Promise<ReadableStream<Uint8Array> | null>;
|
|
31
31
|
<T_2>(path: string, method: string, body: any, parseJSON: true, domain?: string | undefined, request?: RequestInit | undefined): Promise<T_2>;
|
|
32
|
-
<T_3>(path: string, method: string, body: any, parseJSON: boolean, domain?: string | undefined, request?: RequestInit | undefined): Promise<ReadableStream<Uint8Array> |
|
|
32
|
+
<T_3>(path: string, method: string, body: any, parseJSON: boolean, domain?: string | undefined, request?: RequestInit | undefined): Promise<T_3 | ReadableStream<Uint8Array> | null>;
|
|
33
33
|
};
|
|
34
34
|
exchangeAuthCodeForTokenInfo(code: string): Promise<import("@nylas/core").TokenExchangeResponse | null>;
|
|
35
35
|
nylasDownloadFileRequest(path: string, method?: string | undefined, body?: any): Promise<Blob>;
|
|
@@ -1,34 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Component = "component",
|
|
3
|
-
Api = "api",
|
|
4
|
-
Auth = "auth"
|
|
5
|
-
}
|
|
6
|
-
export interface ErrorDetails {
|
|
7
|
-
title: string;
|
|
8
|
-
message: string;
|
|
9
|
-
category: ErrorCategory;
|
|
10
|
-
}
|
|
11
|
-
export declare enum ComponentErrorType {
|
|
12
|
-
endtime_not_in_future = "endtime_not_in_future",
|
|
13
|
-
no_booking_info = "no_booking_info",
|
|
14
|
-
no_timeslot_selected = "no_timeslot_selected",
|
|
15
|
-
no_timezone_selected = "no_timezone_selected",
|
|
16
|
-
no_booking_id = "no_booking_id",
|
|
17
|
-
no_salt = "no_salt",
|
|
18
|
-
invalid_start_time = "invalid_start_time",
|
|
19
|
-
invalid_end_time = "invalid_end_time",
|
|
20
|
-
invalid_timezone = "invalid_timezone",
|
|
21
|
-
no_config_id = "no_config_id"
|
|
22
|
-
}
|
|
23
|
-
export declare enum APIErrorType {
|
|
24
|
-
invalid_session = "invalid_session",
|
|
25
|
-
general_error = "general_error",
|
|
26
|
-
internal_error = "internal_error",
|
|
27
|
-
invalid_request_error = "invalid_request_error",
|
|
28
|
-
timeslot_not_available = "timeslot_not_available",
|
|
29
|
-
provider_error = "provider_error",
|
|
30
|
-
not_found_error = "not_found_error"
|
|
31
|
-
}
|
|
1
|
+
import { APIErrorType, ComponentErrorType, ErrorDetails } from "../../../types/index";
|
|
32
2
|
export declare class Errors {
|
|
33
3
|
component: (_title: string) => Record<ComponentErrorType, (message?: string) => ErrorDetails>;
|
|
34
4
|
api: (_title: string) => Record<APIErrorType, (message: string) => ErrorDetails>;
|
|
@@ -53,7 +53,7 @@ export declare class NylaSchedulerAPIConnector {
|
|
|
53
53
|
reason?: string;
|
|
54
54
|
}): Promise<NylasSchedulerResponse<NylasEvent>>;
|
|
55
55
|
validateGroupEventTimeslot(timeslot: Timeslot): Promise<NylasErrorResponse | import("@nylas/core").NylasSuccessResponse<NylasEvent> | {
|
|
56
|
-
error: import("
|
|
56
|
+
error: import("../../../types").ErrorDetails;
|
|
57
57
|
}>;
|
|
58
58
|
}
|
|
59
59
|
export {};
|
|
@@ -415,3 +415,39 @@ export type ImportGroupEventResponse = {
|
|
|
415
415
|
reason: string;
|
|
416
416
|
}[];
|
|
417
417
|
};
|
|
418
|
+
export declare enum ErrorCategory {
|
|
419
|
+
Component = "component",
|
|
420
|
+
Api = "api",
|
|
421
|
+
Auth = "auth"
|
|
422
|
+
}
|
|
423
|
+
export interface ErrorDetails {
|
|
424
|
+
title: string;
|
|
425
|
+
message: string;
|
|
426
|
+
category: ErrorCategory;
|
|
427
|
+
}
|
|
428
|
+
export declare enum ComponentErrorType {
|
|
429
|
+
endtime_not_in_future = "endtime_not_in_future",
|
|
430
|
+
no_booking_info = "no_booking_info",
|
|
431
|
+
no_timeslot_selected = "no_timeslot_selected",
|
|
432
|
+
no_timezone_selected = "no_timezone_selected",
|
|
433
|
+
no_booking_id = "no_booking_id",
|
|
434
|
+
no_salt = "no_salt",
|
|
435
|
+
invalid_start_time = "invalid_start_time",
|
|
436
|
+
invalid_end_time = "invalid_end_time",
|
|
437
|
+
invalid_timezone = "invalid_timezone",
|
|
438
|
+
no_config_id = "no_config_id"
|
|
439
|
+
}
|
|
440
|
+
export declare enum APIErrorType {
|
|
441
|
+
invalid_session = "invalid_session",
|
|
442
|
+
general_error = "general_error",
|
|
443
|
+
internal_error = "internal_error",
|
|
444
|
+
invalid_request_error = "invalid_request_error",
|
|
445
|
+
timeslot_not_available = "timeslot_not_available",
|
|
446
|
+
provider_error = "provider_error",
|
|
447
|
+
not_found_error = "not_found_error"
|
|
448
|
+
}
|
|
449
|
+
export interface KeyPoint {
|
|
450
|
+
time: number;
|
|
451
|
+
text: string;
|
|
452
|
+
active?: boolean;
|
|
453
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nylas/web-elements",
|
|
3
|
-
"version": "0.0.0-test-
|
|
3
|
+
"version": "0.0.0-test-20250320184617",
|
|
4
4
|
"description": "Nylas Web Elements",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"sanitize-html": "^2.13.0",
|
|
43
43
|
"sortablejs": "^1.15.6",
|
|
44
44
|
"@nylas/identity": "^3.0.0",
|
|
45
|
-
"@nylas/core": "^0.0.0-test-
|
|
45
|
+
"@nylas/core": "^0.0.0-test-20250320184617"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@playwright/test": "^1.50.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"scheduler-store-c1fc5cf3.js","mappings":";;;;;AAAYA;AAAZ,WAAY,aAAa;IACvB,wCAAuB,CAAA;IACvB,4BAAW,CAAA;IACX,8BAAa,CAAA;AACf,CAAC,EAJWA,qBAAa,KAAbA,qBAAa,QAIxB;AAQD,IAAY,kBAWX;AAXD,WAAY,kBAAkB;IAC5B,qEAA+C,CAAA;IAC/C,yDAAmC,CAAA;IACnC,mEAA6C,CAAA;IAC7C,mEAA6C,CAAA;IAC7C,qDAA+B,CAAA;IAC/B,yCAAmB,CAAA;IACnB,+DAAyC,CAAA;IACzC,2DAAqC,CAAA;IACrC,2DAAqC,CAAA;IACrC,mDAA6B,CAAA;AAC/B,CAAC,EAXW,kBAAkB,KAAlB,kBAAkB,QAW7B;AAED,IAAY,YAQX;AARD,WAAY,YAAY;IACtB,mDAAmC,CAAA;IACnC,+CAA+B,CAAA;IAC/B,iDAAiC,CAAA;IACjC,+DAA+C,CAAA;IAC/C,iEAAiD,CAAA;IACjD,iDAAiC,CAAA;IACjC,mDAAmC,CAAA;AACrC,CAAC,EARW,YAAY,KAAZ,YAAY,QAQvB;MAEY,MAAM;IAAnB;QACE,cAAS,GAAG,CAAC,MAAc;YACzB,MAAM,QAAQ,GAAGA,qBAAa,CAAC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Ae,CAAC,CAAC;QAC9C,KAAK,CAAC,GAAG,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAAC;QAC9C,MAAM,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QACjC,IAAI,CAAC,QAAQ;YAAE,OAAO;QACtB,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,KAAK,CAAC,CAAC;QAC1GA,WAAK,CAAC,qBAAqB,EAAE,eAAe,CAAC,CAAC;QAC9C,KAAK,CAAC,GAAG,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;KAC7C,CAAC,CAAC;IAOH,KAAK,CAAC,KAAK,GAAG;QACZ,KAAK,MAAM,GAAG,IAAI,sBAAsB,EAAE;YACxC,MAAM,KAAK,GAAG,sBAAsB,CAAC,GAA0C,CAAC,CAAC;YACjF,KAAK,CAAC,GAAG,CAAC,GAAU,EAAE,KAAK,CAAC,CAAC;SAC9B;KACF,CAAC;IAEF,OAAO,KAAK,CAAC;AACf;;;;;","names":["ErrorCategory","i18next","addDaysToCurrentDate","debug","createStore"],"sources":["src/connector/nylas-scheduler-connector/errors/index.ts","src/connector/shared/api/scheduler.ts","src/stores/scheduler-store.ts"],"sourcesContent":["export enum ErrorCategory {\n Component = 'component',\n Api = 'api',\n Auth = 'auth',\n}\n\nexport interface ErrorDetails {\n title: string;\n message: string;\n category: ErrorCategory;\n}\n\nexport enum ComponentErrorType {\n endtime_not_in_future = 'endtime_not_in_future',\n no_booking_info = 'no_booking_info',\n no_timeslot_selected = 'no_timeslot_selected',\n no_timezone_selected = 'no_timezone_selected',\n no_booking_id = 'no_booking_id',\n no_salt = 'no_salt',\n invalid_start_time = 'invalid_start_time',\n invalid_end_time = 'invalid_end_time',\n invalid_timezone = 'invalid_timezone',\n no_config_id = 'no_config_id',\n}\n\nexport enum APIErrorType {\n invalid_session = 'invalid_session',\n general_error = 'general_error',\n internal_error = 'internal_error',\n invalid_request_error = 'invalid_request_error',\n timeslot_not_available = 'timeslot_not_available',\n provider_error = 'provider_error',\n not_found_error = 'not_found_error',\n}\n\nexport class Errors {\n component = (_title: string): Record<ComponentErrorType, (message?: string) => ErrorDetails> => {\n const category = ErrorCategory.Component;\n const title = `${_title} Error`;\n return {\n endtime_not_in_future: (message: string = '\"endtime\" can not be in the future') => {\n return {\n title,\n message,\n category,\n };\n },\n no_booking_info: (message: string = 'No booking info provided') => {\n return {\n title,\n message,\n category,\n };\n },\n no_timeslot_selected: (message: string = 'No timeslot selected') => {\n return {\n title,\n message,\n category,\n };\n },\n no_timezone_selected: (message: string = 'No timezone selected') => {\n return {\n title,\n message,\n category,\n };\n },\n no_booking_id: (message: string = 'No booking id provided') => {\n return {\n title,\n message,\n category,\n };\n },\n no_salt: (message: string = 'No salt provided') => {\n return {\n title,\n message,\n category,\n };\n },\n invalid_start_time: (message: string = 'Invalid start time') => {\n return {\n title,\n message,\n category,\n };\n },\n invalid_end_time: (message: string = 'Invalid end time') => {\n return {\n title,\n message,\n category,\n };\n },\n invalid_timezone: (message: string = 'Invalid timezone') => {\n return {\n title,\n message,\n category,\n };\n },\n no_config_id: (message: string = 'No configuration id provided') => {\n return {\n title,\n message,\n category,\n };\n },\n };\n };\n\n api = (_title: string): Record<APIErrorType, (message: string) => ErrorDetails> => {\n const category = ErrorCategory.Api;\n const title = `${_title} Error`;\n\n return {\n invalid_session: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n general_error: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n internal_error: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n invalid_request_error: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n timeslot_not_available: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n provider_error: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n not_found_error: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n };\n };\n}\n","import { AvailabilityResponse, NylasSchedulerBookingDataWithFlatFields, NylasEvent, UISettingsResponse } from '@/common/types';\nimport { NylasSchedulerStoreType } from '../../../components';\nimport type { NylasErrorResponse, NylasResponse, NylasSchedulerBookingData, NylasSchedulerResponse, Timeslot } from '@nylas/core';\nimport { APIErrorType, Errors } from '@/connector/nylas-scheduler-connector/errors';\nimport { addDaysToCurrentDate } from '@/utils/utils';\nimport i18next from '@/utils/i18n';\n\ntype NylasSchedulerAPIConnectorOptions = {\n schedulerAPIURL: string;\n schedulerStore: NylasSchedulerStoreType;\n sessionId?: string;\n configId?: string;\n slug?: string;\n clientId?: string;\n};\n\n/**\n * NylaSchedulerConnector\n * This class is used to make API requests to the scheduler.\n */\nexport class NylaSchedulerAPIConnector {\n private schedulerStore: NylasSchedulerStoreType;\n private schedulerAPIURL: string;\n private sessionId: string | undefined;\n private configId: string | undefined;\n private slug: string | undefined;\n private clientId: string | undefined;\n private errors = new Errors();\n\n constructor({ schedulerAPIURL, schedulerStore, sessionId, configId, slug, clientId }: NylasSchedulerAPIConnectorOptions) {\n this.schedulerStore = schedulerStore;\n this.schedulerAPIURL = schedulerAPIURL;\n this.sessionId = sessionId;\n this.configId = configId;\n this.slug = slug;\n this.clientId = clientId;\n }\n\n private getHeaders() {\n return this.sessionId\n ? {\n Authorization: `Bearer ${this.sessionId}`,\n }\n : {};\n }\n\n /**\n * Makes an API request to the scheduler.\n * @param path The path to the API endpoint.\n * @param method The HTTP method.\n * @param body The request body (if any).\n * @returns {Promise<T>}\n */\n public async makeAPIRequest<T>(path: string, method: string, body: string | undefined, headers = {}): Promise<NylasResponse<T>> {\n try {\n const schedulerURL = new URL(this.schedulerAPIURL);\n const version = process.env.PACKAGE_VERSION || 'latest';\n schedulerURL.pathname = path;\n const response = await fetch(decodeURIComponent(schedulerURL.toString()), {\n method,\n headers: {\n 'Content-Type': 'application/json',\n 'Origin': window.location.origin,\n 'X-Source': 'nylas-scheduling',\n 'X-Nylas-Web-Elements-Version': version,\n ...headers,\n },\n body,\n });\n // The server returns a json object for errors: eg.\n // {\n // \"request_id\": \"<request_id>\",\n // \"error\": {\n // \"type\": \"not_found_error\",\n // \"message\": \"Session not found\"\n // }\n // }\n const data = await response.json();\n return data as NylasResponse<T>;\n } catch (error: any) {\n // NOTE: current server implementation doesn't return a JSON object for errors on some endpoints\n // handle this case by returning the error response as a string to be handled downstream\n return {\n error: {\n message: error.message,\n title: 'API request failed',\n type: 'api',\n },\n } as NylasErrorResponse;\n }\n }\n\n private getErrorMessage(error: NylasErrorResponse['error']) {\n let errorMessage = error?.message || error?.title || 'Something went wrong';\n if (error?.type === 'provider_error') {\n errorMessage = error?.provider_error?.error?.message || error?.provider_error?.error?.title || 'Something went wrong';\n }\n return errorMessage;\n }\n\n public setConfigId(configId: string) {\n this.configId = configId;\n }\n\n /**\n * Selects a date in the scheduler.\n */\n public selectDate(date: Date) {\n this.schedulerStore.set('selectedDate', date);\n this.schedulerStore.set('selectedTimeslot', null);\n }\n\n /**\n * Selects a time in the scheduler.\n */\n public selectTime(time: Timeslot) {\n this.schedulerStore.set('selectedTimeslot', time);\n }\n\n /**\n * Sets the timezone in the scheduler.\n */\n public selectTimezone(timezone: string) {\n this.schedulerStore.set('selectedTimezone', timezone);\n }\n\n /**\n * Sets the language in the scheduler.\n */\n public selectLanguage(language: string) {\n this.schedulerStore.set('selectedLanguage', language);\n i18next.changeLanguage(language);\n }\n\n /**\n * Toggles showBookingForm\n * @param value boolean\n */\n public async toggleAdditionalData(value: boolean) {\n if (!value) {\n // Refetch availability\n await this.refetchAvailability();\n }\n this.schedulerStore.set('showBookingForm', value);\n }\n\n /**\n * Set/update the name of the participant booking the event.\n */\n public setParticipantName(name: string) {\n const { bookingInfo } = this.schedulerStore.state;\n this.schedulerStore.set('bookingInfo', {\n ...bookingInfo,\n primaryParticipant: {\n ...(bookingInfo?.primaryParticipant as NylasSchedulerBookingData['primaryParticipant']),\n name,\n },\n });\n }\n\n /**\n * Set/update the email of the participant booking the event.\n */\n public setParticipantEmail(email: string) {\n const { bookingInfo } = this.schedulerStore.state;\n this.schedulerStore.set('bookingInfo', {\n ...bookingInfo,\n primaryParticipant: {\n ...(bookingInfo?.primaryParticipant as NylasSchedulerBookingData['primaryParticipant']),\n email,\n },\n });\n }\n\n private async refetchAvailability() {\n const today = new Date();\n // Refetch availability\n const startTime = new Date(today.getFullYear(), today.getMonth(), 1).getTime() / 1000;\n const startTimeWithOffset = startTime < today.getTime() / 1000 ? Math.floor(today.getTime() / 1000) : startTime;\n const endTime = new Date(today.getFullYear(), today.getMonth() + 1, 1).getTime() / 1000;\n const result = await this.getAvailability(startTimeWithOffset, endTime);\n return result;\n }\n\n private async resetStoreStateAndFetchAvailability() {\n const today = new Date();\n // Refetch availability\n const result = await this.refetchAvailability();\n // Set selected date to first available date\n const firstAvailableDate = this.schedulerStore.get('availability').find((timeslot: any) => new Date(timeslot.start_time) > new Date());\n let _selectedDate = today;\n if (firstAvailableDate) {\n _selectedDate = firstAvailableDate.start_time;\n }\n this.schedulerStore.set('selectedDate', _selectedDate);\n // Reset store state\n this.schedulerStore.set('eventInfo', null);\n this.schedulerStore.set('showBookingForm', false);\n this.schedulerStore.set('selectedTimeslot', null);\n\n return result;\n }\n\n /**\n * Set reschedule booking id\n */\n public async setReschedule(bookingID: string) {\n this.schedulerStore.set('isLoading', true);\n const eventInfo = this.schedulerStore.state.eventInfo;\n if (eventInfo) {\n this.schedulerStore.set('reschedulingEventInfo', eventInfo);\n }\n this.schedulerStore.set('rescheduleBookingId', bookingID);\n await this.getUISettings();\n // Set reschedule booking id\n const result = await this.resetStoreStateAndFetchAvailability().finally(() => {\n this.schedulerStore.set('isLoading', false);\n });\n\n return result;\n }\n\n /**\n * Set cancel booking id\n */\n public async setCancel(bookingID: string) {\n this.schedulerStore.set('cancelBookingId', bookingID);\n }\n\n /**\n * Set reject booking id\n */\n public async setReject(bookingID: string) {\n this.schedulerStore.set('rejectBookingId', bookingID);\n }\n\n public async resetCancel() {\n const result = await this.resetStoreStateAndFetchAvailability();\n this.schedulerStore.set('cancelBookingId', '');\n this.schedulerStore.set('rejectBookingId', '');\n this.schedulerStore.set('cancelledEventInfo', null);\n return result;\n }\n\n public async goBack() {\n this.schedulerStore.set('cancelBookingId', '');\n return;\n }\n\n public async resetConfirm() {\n const result = await this.resetStoreStateAndFetchAvailability();\n this.schedulerStore.set('organizerConfirmationBookingId', '');\n this.schedulerStore.set('confirmedEventInfo', undefined);\n return result;\n }\n\n /**\n * Book the selected timeslot.\n * @param data The booking info.\n * @returns {Promise<NylasResponse<NylasEvent>>}\n */\n public async bookTimeslot(data?: NylasSchedulerBookingDataWithFlatFields & { timeslot?: Timeslot }): Promise<NylasSchedulerResponse<NylasEvent>> {\n this.schedulerStore.set('isLoading', true);\n const { selectedTimeslot, selectedTimezone, bookingInfo, selectedLanguage } = this.schedulerStore.state;\n\n if (!data && !bookingInfo) {\n return { error: this.errors.component(i18next.t('createBookingErrorTitle')).no_booking_info() };\n }\n\n const timeslot = data?.timeslot || selectedTimeslot;\n if (!timeslot) {\n return { error: this.errors.component(i18next.t('createBookingErrorTitle')).no_timeslot_selected() };\n }\n\n const timezone = data && data?.timezone ? data?.timezone : selectedTimezone;\n const language = selectedLanguage || 'en-US';\n\n if (!timezone) {\n return { error: this.errors.component(i18next.t('createBookingErrorTitle')).no_timezone_selected() };\n }\n\n const order = [...this.schedulerStore.get('availabilityOrderEmails')];\n\n let participantToBookWith = '';\n const emails = timeslot?.emails || [];\n\n const addFields = {};\n Object.entries(bookingInfo?.additionalFields || {}).forEach(([key, entry]) => {\n addFields[key] = (entry as { value: string; type?: string }).value;\n });\n\n const primaryGuest = data ? data?.primaryParticipant : bookingInfo?.primaryParticipant;\n const guests = data ? data?.guests || [] : bookingInfo?.guests || [];\n const additional_fields = data ? data?.additionalFields : addFields;\n\n const headers = this.getHeaders();\n const configIdParam =\n !this.sessionId && this.configId\n ? `?configuration_id=${this.configId}`\n : !this.sessionId && this.slug && this.clientId\n ? `?slug=${this.slug}&client_id=${this.clientId}`\n : '';\n const url = `/v3/scheduling/bookings${configIdParam}`;\n\n // If the order array is empty, make a single request without retries\n if (order.length === 0) {\n const response = await this.makeAPIRequest<NylasEvent>(\n decodeURIComponent(url),\n 'POST',\n JSON.stringify({\n additional_fields,\n additional_guests: guests,\n guest: { ...primaryGuest },\n start_time: timeslot.start_time.getTime() / 1000,\n end_time: timeslot.end_time.getTime() / 1000,\n timezone,\n event_id: timeslot?.event_id || undefined,\n master_id: timeslot?.master_id || undefined,\n calendar_id: timeslot?.calendar_id || undefined,\n email_language: this.getTwoLetterLanguageCode(language),\n }),\n headers,\n );\n\n this.schedulerStore.set('isLoading', false);\n if ('data' in response) {\n this.schedulerStore.set('eventInfo', response.data);\n return response;\n }\n return { error: response.error };\n }\n\n while (order.length > 0) {\n participantToBookWith = order.shift()!;\n\n if (!emails.includes(participantToBookWith)) {\n continue; // Skip if the email is not part of the timeslot\n }\n\n const response = await this.makeAPIRequest<NylasEvent>(\n decodeURIComponent(url),\n 'POST',\n JSON.stringify({\n participants: participantToBookWith ? [{ email: participantToBookWith }] : undefined,\n additional_fields,\n additional_guests: guests,\n guest: { ...primaryGuest },\n start_time: timeslot.start_time.getTime() / 1000,\n end_time: timeslot.end_time.getTime() / 1000,\n timezone: timezone,\n email_language: this.getTwoLetterLanguageCode(language),\n }),\n headers,\n );\n\n if ('data' in response) {\n // Successful booking\n this.schedulerStore.set('isLoading', false);\n this.schedulerStore.set('eventInfo', response?.data);\n return response;\n } else if (response.error?.message?.startsWith('The selected timeslot is unavailable')) {\n // Retry with the next email in the order\n continue;\n } else {\n // Return other errors\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in this.errors.api(i18next.t('createBookingErrorTitle'))) {\n const errorMessage = this.getErrorMessage(error);\n error = this.errors.api(i18next.t('createBookingErrorTitle'))[errorType as APIErrorType](errorMessage);\n }\n return { error };\n }\n }\n\n // If no emails in order succeed\n this.schedulerStore.set('isLoading', false);\n return {\n error: this.errors.api(i18next.t('createBookingErrorTitle')).timeslot_not_available('The selected timeslot is unavailable'),\n };\n }\n\n /**\n * Get UI settings for the scheduler.\n */\n public async getUISettings(): Promise<NylasSchedulerResponse<UISettingsResponse>> {\n this.schedulerStore.set('isLoading', true);\n const bookingId = this.schedulerStore.get('rescheduleBookingId');\n const headers = this.getHeaders();\n let configIdParam =\n !this.sessionId && this.configId\n ? `?configuration_id=${this.configId}`\n : !this.sessionId && this.slug && this.clientId\n ? `?slug=${this.slug}&client_id=${this.clientId}`\n : '';\n if (bookingId && !!configIdParam) {\n configIdParam += `&booking_id=${bookingId}`;\n } else if (bookingId) {\n configIdParam += `?booking_id=${bookingId}`;\n }\n\n const url = `/v3/scheduling/ui-settings${configIdParam}`;\n\n const response = await this.makeAPIRequest<UISettingsResponse>(url, 'GET', undefined, headers);\n if ('error' in response) {\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in this.errors.api(i18next.t('getUISettingErrorTitle'))) {\n error = this.errors.api(i18next.t('getUISettingErrorTitle'))[errorType as APIErrorType](error?.message || error?.title || 'Something went wrong');\n }\n return { error };\n }\n if ('data' in response) {\n this.schedulerStore.set('configSettings', response.data);\n }\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n\n private getTwoLetterLanguageCode(language: string) {\n return language.split('-')[0];\n }\n\n private getStartTimeWithMinBookingNotice(startTime: number) {\n const scheduler = this.schedulerStore.get('configSettings')?.scheduler;\n const min_booking_notice = scheduler?.min_booking_notice;\n if (!min_booking_notice) {\n return startTime;\n }\n const today = new Date().getTime();\n\n if (startTime < (today + min_booking_notice * 60 * 1000) / 1000) {\n return Math.floor((today + min_booking_notice * 60 * 1000) / 1000);\n } else {\n return startTime;\n }\n }\n\n private getEndTimeForAvailableDaysInFuture(endTime: number) {\n const today = new Date();\n const availableDaysInFuture = this.schedulerStore.get('configSettings')?.scheduler?.available_days_in_future;\n const endTimeForAvailableDaysInFuture = Math.floor(addDaysToCurrentDate(today, availableDaysInFuture).getTime() / 1000);\n const endTimeWithOffset = Math.min(endTimeForAvailableDaysInFuture, endTime);\n return endTimeWithOffset;\n }\n\n /**\n * Gets the availability for a page.\n * @param startTime The start time.\n * @param endTime The end time.\n * @returns {Promise<AvailabilityResponse>}\n */\n public async getAvailability(startTime: number = 0, endTime: number = 0): Promise<NylasSchedulerResponse<AvailabilityResponse>> {\n this.schedulerStore.set('isLoading', true);\n const params = new URLSearchParams();\n const now = new Date();\n const nowTime = now.getTime();\n\n if (endTime && endTime < nowTime / 1000) {\n this.schedulerStore.set('isLoading', false);\n const error = this.errors.component(i18next.t('getAvailabilityErrorTitle')).endtime_not_in_future();\n return { error };\n }\n\n // Calculate the start of the current month if startTime is not provided\n if (!startTime) {\n const startOfMonth = new Date(now.getFullYear(), now.getMonth(), 1);\n startTime = Math.floor(startOfMonth.getTime() / 1000); // Convert to UNIX timestamp in seconds\n }\n\n // Calculate the end of the current month if endTime is not provided\n if (!endTime) {\n const endOfMonth = new Date(now.getFullYear(), now.getMonth() + 1, 0); // Setting day to 0 gets the last day of the previous month, so in this case, the last day of the current month\n endTime = Math.floor(endOfMonth.getTime() / 1000); // Convert to UNIX timestamp in seconds\n }\n\n endTime = this.getEndTimeForAvailableDaysInFuture(endTime);\n const startTimeWithMinBooking = this.getStartTimeWithMinBookingNotice(startTime);\n startTime = startTimeWithMinBooking;\n endTime = startTimeWithMinBooking > endTime ? startTimeWithMinBooking + 1 : endTime;\n\n params.append('start_time', encodeURIComponent(startTime.toString()));\n params.append('end_time', encodeURIComponent(endTime.toString()));\n if (this.configId && !this.sessionId) {\n params.append('configuration_id', encodeURIComponent(this.configId));\n } else if (this.slug && this.clientId && !this.sessionId) {\n params.append('slug', encodeURIComponent(this.slug));\n params.append('client_id', encodeURIComponent(this.clientId));\n }\n\n const rescheduleBookingId = this.schedulerStore.get('rescheduleBookingId');\n if (rescheduleBookingId) {\n params.append('booking_id', encodeURIComponent(rescheduleBookingId));\n }\n const queryString = params.toString();\n const url = `/v3/scheduling/availability${queryString ? `?${queryString}` : ''}`;\n const headers = this.getHeaders();\n const response = await this.makeAPIRequest<AvailabilityResponse>(decodeURIComponent(url), 'GET', undefined, headers);\n\n if ('error' in response) {\n this.schedulerStore.set('availability', []);\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in this.errors.api(i18next.t('getAvailabilityErrorTitle'))) {\n const errorMessage = this.getErrorMessage(error);\n error = this.errors.api(i18next.t('getAvailabilityErrorTitle'))[errorType as APIErrorType](errorMessage);\n }\n return { error };\n }\n\n if ('data' in response) {\n const availability =\n response.data?.time_slots?.map(timeslot => {\n return {\n ...timeslot,\n start_time: new Date(timeslot.start_time * 1000),\n end_time: new Date(timeslot.end_time * 1000),\n };\n }) || [];\n\n // Filter out timeslots that are in the past\n const availabilityTimeslotsFiltered = availability.filter(timeslot => timeslot.start_time.getTime() > nowTime);\n const availabilityTimeslotSorted = availabilityTimeslotsFiltered.sort((a, b) => a.start_time.getTime() - b.start_time.getTime());\n this.schedulerStore.set('availability', availabilityTimeslotSorted);\n const order = response.data?.order || [];\n this.schedulerStore.set('availabilityOrderEmails', order);\n }\n\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n\n /**\n * Cancels a booking.\n * @param bookingId The booking ID.\n */\n public async cancelBooking(bookingId: string, reason: string): Promise<NylasSchedulerResponse<Partial<NylasEvent>>> {\n this.schedulerStore.set('isLoading', true);\n if (!bookingId) {\n return { error: this.errors.component(i18next.t('cancelBookingErrorTitle')).no_booking_id() };\n }\n const configIdParam =\n !this.sessionId && this.configId\n ? `?configuration_id=${this.configId}`\n : !this.sessionId && this.slug && this.clientId\n ? `?slug=${this.slug}&client_id=${this.clientId}`\n : '';\n const url = `/v3/scheduling/bookings/${bookingId}${configIdParam}`;\n const headers = this.getHeaders();\n const response = await this.makeAPIRequest<Partial<NylasEvent>>(\n decodeURIComponent(url),\n 'DELETE',\n JSON.stringify({\n action: 'cancel',\n cancellation_reason: reason,\n }),\n headers,\n );\n\n if ('error' in response) {\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in this.errors.api(i18next.t('cancelBookingErrorTitle'))) {\n const errorMessage = this.getErrorMessage(error);\n error = this.errors.api(i18next.t('cancelBookingErrorTitle'))[errorType as APIErrorType](errorMessage);\n }\n return { error };\n }\n\n this.schedulerStore.set('cancelledEventInfo', {\n booking_id: bookingId,\n });\n this.schedulerStore.set('rescheduleBookingId', '');\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n\n /**\n * Reschedules a booking.\n * @param bookingId The booking ID.\n * @param data The booking info.\n * @returns {Promise<NylasResponse<NylasEvent>>}\n */\n public async rescheduleBooking(bookingId: string, data: NylasSchedulerBookingDataWithFlatFields): Promise<NylasSchedulerResponse<NylasEvent>> {\n this.schedulerStore.set('isLoading', true);\n if (!bookingId) {\n return { error: this.errors.component(i18next.t('rescheduleBookingErrorTitle')).no_booking_id() };\n }\n const apiErrors = this.errors.api(i18next.t('rescheduleBookingErrorTitle'));\n const componentErrors = this.errors.component(i18next.t('rescheduleBookingErrorTitle'));\n const { bookingInfo, selectedTimeslot, selectedTimezone, selectedLanguage } = this.schedulerStore.state;\n // Validate data\n const { startTime, endTime, timezone } = data;\n const start_time = startTime || selectedTimeslot?.start_time;\n\n if (!start_time) {\n return { error: componentErrors.invalid_start_time('Please pass \"startTime\" in data or set \"selectedTimeslot\" in the defaultSchedulerState.') };\n }\n const end_time = endTime || selectedTimeslot?.end_time;\n if (!end_time) {\n return { error: componentErrors.invalid_end_time('Please pass \"endTime\" in data or set \"selectedTimeslot\" in the defaultSchedulerState.') };\n }\n\n const order = this.schedulerStore.get('availabilityOrderEmails');\n let participantToBookWith = '';\n if (order.length > 0) {\n // Get the emails in the timeslot\n const emails = selectedTimeslot?.emails || [];\n for (let i = 0; i < order.length; i++) {\n if (emails.includes(order[i])) {\n participantToBookWith = order[i];\n break;\n }\n }\n }\n\n const time_zone = timezone || selectedTimezone;\n if (!time_zone) {\n return { error: componentErrors.invalid_timezone('Please pass \"timezone\" in data or set \"selectedTimezone\" in the defaultSchedulerState.') };\n }\n const addFields = {};\n Object.entries(bookingInfo?.additionalFields || {}).forEach(([key, entry]) => {\n addFields[key] = (entry as { value: string; type?: string }).value;\n });\n const primaryGuest = data ? data?.primaryParticipant : bookingInfo?.primaryParticipant;\n const guests = data ? data?.guests || [] : bookingInfo?.guests || [];\n const additional_fields = data ? data?.additionalFields : addFields;\n\n const configIdParam =\n !this.sessionId && this.configId\n ? `?configuration_id=${this.configId}`\n : !this.sessionId && this.slug && this.clientId\n ? `?slug=${this.slug}&client_id=${this.clientId}`\n : '';\n const url = `/v3/scheduling/bookings/${bookingId}${configIdParam}`;\n const headers = this.getHeaders();\n const response = await this.makeAPIRequest<NylasEvent>(\n decodeURIComponent(url),\n 'PATCH',\n JSON.stringify({\n start_time: start_time.getTime() / 1000,\n end_time: end_time.getTime() / 1000,\n timezone: time_zone,\n additional_fields,\n guest: { ...primaryGuest },\n additional_guests: guests,\n participants: participantToBookWith ? [{ email: participantToBookWith }] : undefined,\n email_language: this.getTwoLetterLanguageCode(selectedLanguage),\n }),\n headers,\n );\n\n if ('error' in response) {\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in apiErrors) {\n const errorMessage = this.getErrorMessage(error);\n error = apiErrors[errorType as APIErrorType](errorMessage);\n }\n return { error };\n }\n\n const eventInfo = this.schedulerStore.get('reschedulingEventInfo');\n if ('data' in response) {\n this.schedulerStore.set('eventInfo', response?.data);\n } else if (eventInfo) {\n this.schedulerStore.set('eventInfo', eventInfo);\n } else {\n // We should technically never reach this point\n const event = {\n booking_id: bookingId,\n } as NylasEvent;\n this.schedulerStore.set('eventInfo', event);\n }\n\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n\n /**\n * Updates the booking.\n * @param bookingId The booking ID.\n */\n public async updateBooking(payload: { bookingId: string; status: 'confirmed' | 'cancelled'; reason?: string }): Promise<NylasSchedulerResponse<NylasEvent>> {\n this.schedulerStore.set('isLoading', true);\n const { bookingId, status, reason } = payload;\n const salt = this.schedulerStore.get('organizerConfirmationSalt');\n const errorTitle = status === 'confirmed' ? i18next.t('confirmBookingErrorTitle') : i18next.t('rejectBookingErrorTitle');\n\n if (!bookingId) {\n return { error: this.errors.component(errorTitle).no_booking_id() };\n }\n if (!salt) {\n return { error: this.errors.component(errorTitle).no_salt() };\n }\n\n const configIdParam =\n !this.sessionId && this.configId\n ? `?configuration_id=${this.configId}`\n : !this.sessionId && this.slug && this.clientId\n ? `?slug=${this.slug}&client_id=${this.clientId}`\n : '';\n const url = `/v3/scheduling/bookings/${bookingId}${configIdParam}`;\n const headers = this.getHeaders();\n const response = await this.makeAPIRequest<NylasEvent>(\n decodeURIComponent(url),\n 'PUT',\n JSON.stringify({\n status: status,\n cancellation_reason: reason,\n salt,\n }),\n headers,\n );\n\n if ('error' in response) {\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in this.errors.api(errorTitle)) {\n const errorMessage = this.getErrorMessage(error);\n error = this.errors.api(errorTitle)[errorType as APIErrorType](errorMessage);\n }\n return { error };\n }\n\n if ('data' in response && status === 'confirmed') {\n this.schedulerStore.set('confirmedEventInfo', response?.data);\n } else if ('request_id' in response && status === 'cancelled') {\n this.schedulerStore.set('cancelledEventInfo', {\n booking_id: bookingId,\n });\n }\n\n this.schedulerStore.set('organizerConfirmationBookingId', '');\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n\n /**\n * Validate timeslot for group event booking\n */\n public async validateGroupEventTimeslot(timeslot: Timeslot) {\n this.schedulerStore.set('isLoading', true);\n const configId = this.schedulerStore.get('configSettings')?.configuration_id;\n if (!configId) {\n return { error: this.errors.component(i18next.t('validateTimeslotErrorTitle')).no_config_id() };\n }\n\n const headers = this.getHeaders();\n const url = `/v3/scheduling/configurations/${configId}/group-events/validate-timeslot`;\n const response = await this.makeAPIRequest<NylasEvent>(\n decodeURIComponent(url),\n 'POST',\n JSON.stringify({\n ...timeslot,\n start_time: timeslot.start_time.getTime() / 1000,\n end_time: timeslot.end_time.getTime() / 1000,\n }),\n headers,\n );\n\n if ('error' in response) {\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in this.errors.api(i18next.t('validateTimeslotErrorTitle'))) {\n const errorMessage = this.getErrorMessage(error);\n error = this.errors.api(i18next.t('validateTimeslotErrorTitle'))[errorType as APIErrorType](errorMessage);\n }\n this.refetchAvailability();\n return { error };\n }\n\n this.schedulerStore.set('selectedTimeslot', timeslot);\n this.schedulerStore.set('showBookingForm', true);\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n}\n","import { DataState, NylasEvent } from '@/common/types';\nimport { debug } from '@/utils/utils';\nimport { AdditionalFields, Appearance, NylasSchedulerBookingData, ThemeConfig, Timeslot } from '@nylas/core';\nimport { createStore } from '@stencil/store';\n\nexport type AvailabilityTimeslot = {\n emails: string[];\n start_time: Date;\n end_time: Date;\n capacity?: number;\n event_id?: string;\n master_id?: string;\n calendar_id?: string;\n};\n\nexport type LoadingState = {\n api: 'availability' | 'createBooking' | 'cancelBooking' | 'rescheduleBooking';\n};\n\nexport type ConfigSettings = {\n configuration_id: string;\n booking?: {\n additional_fields: Record<string, string>;\n additional_guests: {\n email: string;\n name: string;\n }[];\n booking_ref: string;\n booking_ref_salt: string;\n guest: {\n email: string;\n name: string;\n };\n timezone: string;\n email_language: string;\n event_data: {\n location: string;\n when: {\n start_time: Date;\n end_time: Date;\n end_timezone: string;\n start_timezone: string;\n object: string;\n };\n };\n event_organizer: {\n name: string;\n email: string;\n is_organizer: boolean;\n };\n };\n scheduler: {\n available_days_in_future: number;\n min_cancellation_notice: number;\n min_booking_notice: number;\n rescheduling_url?: string;\n cancellation_url?: string;\n cancellation_policy?: string;\n hide_additional_guests?: boolean;\n hide_cancellation_options?: boolean;\n hide_rescheduling_options?: boolean;\n additional_fields?: Record<string, AdditionalFields>;\n confirmation_redirect_url?: string;\n organizer_confirmation_url?: string;\n };\n organizer: {\n name: string;\n email: string;\n };\n slug: string;\n appearance: Appearance;\n booking_type: string;\n name: string;\n};\n\nexport interface NylasSchedulerStoreState {\n selectedDate: Date | null;\n selectedLanguage: string;\n selectedTimezone: string;\n selectedTimeslot: Timeslot | null;\n availabilityOrderEmails: string[];\n showBookingForm: boolean;\n selectableDates: Date[] | null;\n eventDuration: number;\n availability: AvailabilityTimeslot[];\n state: DataState;\n eventInfo: NylasEvent | null;\n cancelledEventInfo: Partial<NylasEvent> | null;\n reschedulingEventInfo?: NylasEvent;\n confirmedEventInfo?: NylasEvent;\n bookingInfo?: NylasSchedulerBookingData;\n rescheduleBookingId?: string;\n cancelBookingId?: string;\n isLoading: boolean;\n nylasBranding?: boolean;\n configSettings?: ConfigSettings;\n organizerConfirmationBookingId?: string;\n rejectBookingId?: string;\n organizerConfirmationSalt?: string;\n themeConfig?: ThemeConfig;\n hour12?: boolean;\n}\n\nexport type NylasSchedulerStoreType = ReturnType<typeof CreateNylasSchedulerStore>;\n\nexport function CreateNylasSchedulerStore(defaultState: Partial<NylasSchedulerStoreState> = {}) {\n const defaultNylasStoreState: NylasSchedulerStoreState = {\n selectedDate: null,\n selectedLanguage: navigator.language,\n selectedTimezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n selectedTimeslot: null,\n showBookingForm: false,\n availabilityOrderEmails: [],\n selectableDates: null,\n availability: [],\n eventDuration: 0,\n state: 'ready',\n eventInfo: null,\n cancelledEventInfo: null,\n isLoading: false,\n nylasBranding: true,\n ...defaultState,\n };\n debug(`[defaultNylasStoreState]: `, defaultNylasStoreState);\n const store = createStore<NylasSchedulerStoreState>(defaultNylasStoreState);\n\n store.onChange('availability', availability => {\n debug(`[availability]: `, availability);\n const selectableDates = availability.map(timeslot => timeslot.start_time);\n debug(`[selectableDates]: `, selectableDates);\n store.set('selectableDates', selectableDates);\n const timeslot = availability[0];\n if (!timeslot) return;\n const durationMinutes = Math.floor((timeslot.end_time.getTime() - timeslot.start_time.getTime()) / 60000);\n debug(`[durationMinutes]: `, durationMinutes);\n store.set('eventDuration', durationMinutes);\n });\n\n /**\n * Reset the Nylas store to its default state.\n * There is something wrong with the stencil/store reset method,\n * so we have to do it via this hack.\n */\n store.reset = () => {\n for (const key in defaultNylasStoreState) {\n const value = defaultNylasStoreState[key as keyof typeof defaultNylasStoreState];\n store.set(key as any, value);\n }\n };\n\n return store;\n}\n"],"version":3}
|