@nylas/web-elements 1.1.0-canary.4 → 1.1.0-canary.5
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/cjs/add-circle-icon.cjs.entry.js +1 -1
- package/dist/cjs/add-circle-icon_22.cjs.entry.js +20 -20
- package/dist/cjs/archive-icon.cjs.entry.js +1 -1
- package/dist/cjs/archive-icon_7.cjs.entry.js +7 -7
- package/dist/cjs/arrow-icon.cjs.entry.js +1 -1
- package/dist/cjs/bold-icon.cjs.entry.js +1 -1
- package/dist/cjs/bold-icon_3.cjs.entry.js +3 -3
- package/dist/cjs/button-component.cjs.entry.js +1 -1
- package/dist/cjs/calendar-cancel-icon.cjs.entry.js +1 -1
- package/dist/cjs/calendar-check-icon.cjs.entry.js +1 -1
- package/dist/cjs/calendar-check-icon_2.cjs.entry.js +2 -2
- package/dist/cjs/calendar-icon.cjs.entry.js +1 -1
- package/dist/cjs/calendar-info-icon.cjs.entry.js +1 -1
- package/dist/cjs/calendar-patterns-icon.cjs.entry.js +1 -1
- package/dist/cjs/checkmark-circle-icon.cjs.entry.js +1 -1
- package/dist/cjs/chevron-icon.cjs.entry.js +1 -1
- package/dist/cjs/chevron-icon_3.cjs.entry.js +4 -4
- package/dist/cjs/close-icon.cjs.entry.js +1 -1
- package/dist/cjs/document-refresh-icon.cjs.entry.js +1 -1
- package/dist/cjs/flow-icon.cjs.entry.js +1 -1
- package/dist/cjs/folder-icon.cjs.entry.js +1 -1
- package/dist/cjs/forward-icon.cjs.entry.js +1 -1
- package/dist/cjs/forward-icon_6.cjs.entry.js +9 -9
- package/dist/cjs/globe-icon.cjs.entry.js +1 -1
- package/dist/cjs/google-logo-icon.cjs.entry.js +1 -1
- package/dist/cjs/{google-logo-icon_3.cjs.entry.js → google-logo-icon_4.cjs.entry.js} +136 -15
- package/dist/cjs/google-logo-icon_4.cjs.entry.js.map +1 -0
- package/dist/cjs/inbox-icon.cjs.entry.js +1 -1
- package/dist/cjs/index-7af03e3f.js +6 -6
- package/dist/cjs/index-c14ea8f5.js +12 -8
- package/dist/cjs/index.cjs.js +3 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/{index.es-68425511.js → index.es-0a0f2d87.js} +9 -4
- package/dist/cjs/index.es-0a0f2d87.js.map +1 -0
- package/dist/cjs/{index.es-447c5aca.js → index.es-b12b7df1.js} +9 -4
- package/dist/cjs/index.es-b12b7df1.js.map +1 -0
- package/dist/cjs/info-icon.cjs.entry.js +1 -1
- package/dist/cjs/info-icon_2.cjs.entry.js +2 -2
- package/dist/cjs/italic-icon.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/loading-icon.cjs.entry.js +1 -1
- package/dist/cjs/location-icon.cjs.entry.js +1 -1
- package/dist/cjs/location-off-icon.cjs.entry.js +1 -1
- package/dist/cjs/{mailbox-store-556bc7b6.js → mailbox-store-05fa3bec.js} +3 -3
- package/dist/cjs/{mailbox-store-556bc7b6.js.map → mailbox-store-05fa3bec.js.map} +1 -1
- package/dist/cjs/{mailbox-store-aacd75ff.js → mailbox-store-14531fd4.js} +3 -3
- package/dist/cjs/{mailbox-store-aacd75ff.js.map → mailbox-store-14531fd4.js.map} +1 -1
- package/dist/cjs/microsoft-logo-icon.cjs.entry.js +1 -1
- package/dist/cjs/multi-select-dropdown.cjs.entry.js +3 -3
- package/dist/cjs/nylas-additional-participants.cjs.entry.js +3 -3
- package/dist/cjs/{nylas-api-request-8ec3a89c.js → nylas-api-request-2a0e7022.js} +17 -7
- package/dist/cjs/nylas-api-request-2a0e7022.js.map +1 -0
- package/dist/cjs/{nylas-api-request-ab24150d.js → nylas-api-request-55923233.js} +17 -7
- package/dist/cjs/nylas-api-request-55923233.js.map +1 -0
- package/dist/cjs/nylas-availability-picker.cjs.entry.js +2 -2
- package/dist/cjs/nylas-booked-event-card.cjs.entry.js +2 -2
- package/dist/cjs/nylas-booked-event-card_10.cjs.entry.js +6 -6
- package/dist/cjs/nylas-booking-calendar-picker.cjs.entry.js +2 -2
- package/dist/cjs/nylas-booking-form.cjs.entry.js +2 -2
- package/dist/cjs/nylas-buffer-time.cjs.entry.js +2 -2
- package/dist/cjs/nylas-calendar-picker.cjs.entry.js +2 -2
- package/dist/cjs/nylas-cancel-booking-form.cjs.entry.js +3 -3
- package/dist/cjs/nylas-cancelled-event-card.cjs.entry.js +3 -3
- package/dist/cjs/nylas-composer.cjs.entry.js +2 -2
- package/dist/cjs/nylas-custom-booking-flow.cjs.entry.js +3 -3
- package/dist/cjs/nylas-date-picker.cjs.entry.js +2 -2
- package/dist/cjs/nylas-editor-tabs.cjs.entry.js +24 -7
- package/dist/cjs/nylas-editor-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-event-description.cjs.entry.js +2 -2
- package/dist/cjs/nylas-event-duration.cjs.entry.js +2 -2
- package/dist/cjs/nylas-event-info.cjs.entry.js +3 -3
- package/dist/cjs/nylas-event-limits.cjs.entry.js +3 -3
- package/dist/cjs/nylas-event-title.cjs.entry.js +2 -2
- package/dist/cjs/nylas-form-card.cjs.entry.js +3 -3
- package/dist/cjs/nylas-if-state.cjs.entry.js +2 -2
- package/dist/cjs/nylas-limit-future-bookings.cjs.entry.js +3 -3
- package/dist/cjs/nylas-list-configurations.cjs.entry.js +114 -0
- package/dist/cjs/nylas-list-configurations.cjs.entry.js.map +1 -0
- package/dist/cjs/nylas-list-folders.cjs.entry.js +3 -3
- package/dist/cjs/nylas-list-threads.cjs.entry.js +3 -3
- package/dist/cjs/nylas-locale-switch.cjs.entry.js +2 -2
- package/dist/cjs/nylas-location-component.cjs.entry.js +5 -5
- package/dist/cjs/nylas-login.cjs.entry.js +3 -3
- package/dist/cjs/nylas-logo.cjs.entry.js +1 -1
- package/dist/cjs/nylas-mailbox-pagination.cjs.entry.js +2 -2
- package/dist/cjs/nylas-mailbox-toolbar-button.cjs.entry.js +3 -3
- package/dist/cjs/nylas-mailbox.cjs.entry.js +4 -4
- package/dist/cjs/nylas-min-cancellation-notice.cjs.entry.js +3 -3
- package/dist/cjs/nylas-notification.cjs.entry.js +2 -2
- package/dist/cjs/nylas-provider.cjs.entry.js +6 -6
- package/dist/cjs/nylas-scheduler-editor.cjs.entry.js +193 -67
- package/dist/cjs/nylas-scheduler-editor.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-scheduling.cjs.entry.js +3 -3
- package/dist/cjs/nylas-selected-event-card.cjs.entry.js +2 -2
- package/dist/cjs/nylas-summarize-message-button.cjs.entry.js +4 -4
- package/dist/cjs/nylas-threads-refresh.cjs.entry.js +4 -4
- package/dist/cjs/nylas-threads-search.cjs.entry.js +3 -3
- package/dist/cjs/nylas-time-window-picker.cjs.entry.js +2 -2
- package/dist/cjs/nylas-timeslot-picker.cjs.entry.js +2 -2
- package/dist/cjs/nylas-view-email.cjs.entry.js +2 -2
- package/dist/cjs/nylas-view-thread.cjs.entry.js +3 -3
- package/dist/cjs/nylas-web-elements.cjs.js +1 -1
- package/dist/cjs/people-icon.cjs.entry.js +1 -1
- package/dist/cjs/play-icon.cjs.entry.js +1 -1
- package/dist/cjs/play-icon_2.cjs.entry.js +2 -2
- package/dist/cjs/refresh-icon.cjs.entry.js +1 -1
- package/dist/cjs/{register-component-d729f3f7.js → register-component-09ebdf31.js} +8 -2
- package/dist/cjs/register-component-09ebdf31.js.map +1 -0
- package/dist/cjs/{register-component-f1ebc65d.js → register-component-c8b6e907.js} +8 -2
- package/dist/cjs/register-component-c8b6e907.js.map +1 -0
- package/dist/cjs/reply-all-icon.cjs.entry.js +1 -1
- package/dist/cjs/reply-icon.cjs.entry.js +1 -1
- package/dist/cjs/{scheduler-config-store-9c2cc421.js → scheduler-config-store-4d93a9b7.js} +8 -1
- package/dist/cjs/scheduler-config-store-4d93a9b7.js.map +1 -0
- package/dist/cjs/{scheduler-config-store-31b83ad3.js → scheduler-config-store-a0e08cab.js} +8 -1
- package/dist/cjs/scheduler-config-store-a0e08cab.js.map +1 -0
- package/dist/cjs/{scheduler-store-7320f5d0.js → scheduler-store-a492526c.js} +2 -2
- package/dist/cjs/{scheduler-store-4cb46b3c.js.map → scheduler-store-a492526c.js.map} +1 -1
- package/dist/cjs/{scheduler-store-4cb46b3c.js → scheduler-store-e148a4cc.js} +2 -2
- package/dist/cjs/{scheduler-store-7320f5d0.js.map → scheduler-store-e148a4cc.js.map} +1 -1
- package/dist/cjs/search-icon.cjs.entry.js +1 -1
- package/dist/cjs/select-dropdown.cjs.entry.js +2 -2
- package/dist/cjs/sent-icon.cjs.entry.js +1 -1
- package/dist/cjs/spam-icon.cjs.entry.js +1 -1
- package/dist/cjs/star-icon.cjs.entry.js +1 -1
- package/dist/cjs/stop-icon.cjs.entry.js +1 -1
- package/dist/cjs/time-period-selector.cjs.entry.js +2 -2
- package/dist/cjs/tooltip-component.cjs.entry.js +1 -1
- package/dist/cjs/translate-icon.cjs.entry.js +1 -1
- package/dist/cjs/trash-icon.cjs.entry.js +1 -1
- package/dist/cjs/underline-icon.cjs.entry.js +1 -1
- package/dist/cjs/{utils-53dd7574.js → utils-20663d54.js} +19 -1
- package/dist/cjs/utils-20663d54.js.map +1 -0
- package/dist/cjs/{utils-53298b01.js → utils-2c7f0895.js} +19 -1
- package/dist/cjs/{utils-53298b01.js.map → utils-2c7f0895.js.map} +1 -1
- package/dist/cjs/warning-icon.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/common/abstract-provider.js +7 -2
- package/dist/collection/common/abstract-provider.js.map +1 -1
- package/dist/collection/common/component-types.js.map +1 -1
- package/dist/collection/common/icons/add-circle.js +1 -1
- package/dist/collection/common/icons/archive.js +1 -1
- package/dist/collection/common/icons/arrow.js +1 -1
- package/dist/collection/common/icons/bold.js +1 -1
- package/dist/collection/common/icons/calendar-cancel.js +1 -1
- package/dist/collection/common/icons/calendar-check.js +1 -1
- package/dist/collection/common/icons/calendar-info.js +1 -1
- package/dist/collection/common/icons/calendar-patterns.js +1 -1
- package/dist/collection/common/icons/calendar.js +1 -1
- package/dist/collection/common/icons/checkmark-circle.js +1 -1
- package/dist/collection/common/icons/chevron.js +1 -1
- package/dist/collection/common/icons/close.js +1 -1
- package/dist/collection/common/icons/document-refresh.js +1 -1
- package/dist/collection/common/icons/flow.js +1 -1
- package/dist/collection/common/icons/folder.js +1 -1
- package/dist/collection/common/icons/forward.js +1 -1
- package/dist/collection/common/icons/globe.js +1 -1
- package/dist/collection/common/icons/google-logo.js +1 -1
- package/dist/collection/common/icons/inbox.js +1 -1
- package/dist/collection/common/icons/info.js +1 -1
- package/dist/collection/common/icons/italic.js +1 -1
- package/dist/collection/common/icons/loading.js +1 -1
- package/dist/collection/common/icons/location-off.js +1 -1
- package/dist/collection/common/icons/location.js +1 -1
- package/dist/collection/common/icons/microsoft-logo.js +1 -1
- package/dist/collection/common/icons/nylas-logo.js +1 -1
- package/dist/collection/common/icons/people.js +1 -1
- package/dist/collection/common/icons/play.js +1 -1
- package/dist/collection/common/icons/refresh.js +1 -1
- package/dist/collection/common/icons/reply-all.js +1 -1
- package/dist/collection/common/icons/reply.js +1 -1
- package/dist/collection/common/icons/search.js +1 -1
- package/dist/collection/common/icons/sent.js +1 -1
- package/dist/collection/common/icons/spam.js +1 -1
- package/dist/collection/common/icons/star.js +1 -1
- package/dist/collection/common/icons/stop.js +1 -1
- package/dist/collection/common/icons/translate.js +1 -1
- package/dist/collection/common/icons/trash.js +1 -1
- package/dist/collection/common/icons/underline.js +1 -1
- package/dist/collection/common/icons/warning.js +1 -1
- package/dist/collection/common/nylas-api-request.js +15 -6
- package/dist/collection/common/nylas-api-request.js.map +1 -1
- package/dist/collection/common/register-component.js +6 -0
- package/dist/collection/common/register-component.js.map +1 -1
- package/dist/collection/common/types.js.map +1 -1
- package/dist/collection/components/design-system/button-component/button-component.js +1 -1
- package/dist/collection/components/design-system/multi-select-dropdown/multi-select-dropdown.js +2 -2
- package/dist/collection/components/design-system/select-dropdown/select-dropdown.js +2 -2
- package/dist/collection/components/design-system/time-period-selector/time-period-selector.js +1 -1
- package/dist/collection/components/design-system/tooltip-component/toolitp-component.js +1 -1
- package/dist/collection/components/mailbox/nylas-composer/nylas-composer.js +1 -1
- package/dist/collection/components/mailbox/nylas-list-folders/nylas-list-folders.js +1 -1
- package/dist/collection/components/mailbox/nylas-list-threads/nylas-list-threads.js +1 -1
- package/dist/collection/components/mailbox/nylas-mailbox/nylas-mailbox.js +1 -1
- package/dist/collection/components/mailbox/nylas-mailbox-toolbar-button/nylas-mailbox-toolbar-button.js +1 -1
- package/dist/collection/components/mailbox/nylas-summarize-message-button/nylas-summarize-message-button.js +2 -2
- package/dist/collection/components/mailbox/nylas-threads-refresh/nylas-threads-refresh.js +2 -2
- package/dist/collection/components/mailbox/nylas-threads-search/nylas-threads-search.js +1 -1
- package/dist/collection/components/mailbox/nylas-view-email/nylas-view-email.js +1 -1
- package/dist/collection/components/mailbox/nylas-view-thread/nylas-view-thread.js +1 -1
- package/dist/collection/components/nylas-login/nylas-login.js +1 -1
- package/dist/collection/components/nylas-provider/nylas-provider.js +1 -1
- package/dist/collection/components/scheduler/nylas-cancel-booking-form/nylas-cancel-booking-form.js +1 -1
- package/dist/collection/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.js +1 -1
- package/dist/collection/components/scheduler/nylas-notification/nylas-notification.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-custom-booking-flow/nylas-custom-booking-flow.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.css +15 -8
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js +74 -6
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-event-info/nylas-event-info.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-event-limits/nylas-event-limits.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-form-card/nylas-form-card.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-limit-future-bookings/nylas-limit-future-bookings.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-list-configurations/nylas-list-configurations.css +105 -0
- package/dist/collection/components/scheduler-editor/nylas-list-configurations/nylas-list-configurations.js +293 -0
- package/dist/collection/components/scheduler-editor/nylas-list-configurations/nylas-list-configurations.js.map +1 -0
- package/dist/collection/components/scheduler-editor/nylas-location-component/nylas-location-component.js +3 -3
- package/dist/collection/components/scheduler-editor/nylas-min-cancellation-notice/nylas-min-cancellation-notice.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/LoginRequired.js +30 -0
- package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/LoginRequired.js.map +1 -0
- package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.css +17 -2
- package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.js +76 -41
- package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-time-window-picker/nylas-time-window-picker.js +1 -1
- package/dist/collection/connector/nylas-scheduler-config-connector/index.js.map +1 -1
- package/dist/collection/connector/shared/api/scheduler-config.js +114 -26
- package/dist/collection/connector/shared/api/scheduler-config.js.map +1 -1
- package/dist/collection/stores/scheduler-config-store.js +7 -0
- package/dist/collection/stores/scheduler-config-store.js.map +1 -1
- package/dist/collection/utils/utils.js +16 -0
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/collection/utils/utils.spec.js +8 -1
- package/dist/collection/utils/utils.spec.js.map +1 -1
- package/dist/components/add-circle.js +1 -2
- package/dist/components/add-circle.js.map +1 -1
- package/dist/components/archive.js +1 -2
- package/dist/components/archive.js.map +1 -1
- package/dist/components/arrow.js +1 -2
- package/dist/components/arrow.js.map +1 -1
- package/dist/components/bold.js +1 -2
- package/dist/components/bold.js.map +1 -1
- package/dist/components/button-component2.js +1 -2
- package/dist/components/button-component2.js.map +1 -1
- package/dist/components/calendar-cancel.js +1 -2
- package/dist/components/calendar-cancel.js.map +1 -1
- package/dist/components/calendar-check.js +1 -2
- package/dist/components/calendar-check.js.map +1 -1
- package/dist/components/calendar-info.js +1 -2
- package/dist/components/calendar-info.js.map +1 -1
- package/dist/components/calendar-patterns.js +1 -2
- package/dist/components/calendar-patterns.js.map +1 -1
- package/dist/components/calendar.js +1 -2
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/checkmark-circle.js +1 -2
- package/dist/components/checkmark-circle.js.map +1 -1
- package/dist/components/chevron.js +1 -2
- package/dist/components/chevron.js.map +1 -1
- package/dist/components/close.js +1 -2
- package/dist/components/close.js.map +1 -1
- package/dist/components/constants.js +1 -1
- package/dist/components/document-refresh-icon.js +1 -2
- package/dist/components/document-refresh-icon.js.map +1 -1
- package/dist/components/flow.js +1 -2
- package/dist/components/flow.js.map +1 -1
- package/dist/components/focus-visible.js +1 -1
- package/dist/components/folder.js +1 -2
- package/dist/components/folder.js.map +1 -1
- package/dist/components/forward.js +1 -2
- package/dist/components/forward.js.map +1 -1
- package/dist/components/globe.js +1 -2
- package/dist/components/globe.js.map +1 -1
- package/dist/components/google-logo.js +1 -2
- package/dist/components/google-logo.js.map +1 -1
- package/dist/components/inbox.js +1 -2
- package/dist/components/inbox.js.map +1 -1
- package/dist/components/index.d.ts +179 -0
- package/dist/components/index.es.js +201 -4
- package/dist/components/index.es.js.map +1 -1
- package/dist/components/index.js +89 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/info.js +1 -2
- package/dist/components/info.js.map +1 -1
- package/dist/components/italic.js +1 -2
- package/dist/components/italic.js.map +1 -1
- package/dist/components/loading.js +1 -2
- package/dist/components/loading.js.map +1 -1
- package/dist/components/location-off.js +1 -2
- package/dist/components/location-off.js.map +1 -1
- package/dist/components/location.js +1 -2
- package/dist/components/location.js.map +1 -1
- package/dist/components/mailbox-store.js +1 -2
- package/dist/components/mailbox-store.js.map +1 -1
- package/dist/components/microsoft-logo.js +1 -2
- package/dist/components/microsoft-logo.js.map +1 -1
- package/dist/components/multi-select-dropdown2.js +2 -3
- package/dist/components/multi-select-dropdown2.js.map +1 -1
- package/dist/components/nylas-additional-participants.js +1 -2
- package/dist/components/nylas-additional-participants.js.map +1 -1
- package/dist/components/nylas-availability-picker2.js +1 -2
- package/dist/components/nylas-availability-picker2.js.map +1 -1
- package/dist/components/nylas-booked-event-card2.js +0 -1
- package/dist/components/nylas-booked-event-card2.js.map +1 -1
- package/dist/components/nylas-booking-calendar-picker2.js +0 -1
- package/dist/components/nylas-booking-calendar-picker2.js.map +1 -1
- package/dist/components/nylas-booking-form2.js +0 -1
- package/dist/components/nylas-booking-form2.js.map +1 -1
- package/dist/components/nylas-buffer-time2.js +0 -1
- package/dist/components/nylas-buffer-time2.js.map +1 -1
- package/dist/components/nylas-calendar-picker2.js +0 -1
- package/dist/components/nylas-calendar-picker2.js.map +1 -1
- package/dist/components/nylas-cancel-booking-form2.js +1 -2
- package/dist/components/nylas-cancel-booking-form2.js.map +1 -1
- package/dist/components/nylas-cancelled-event-card2.js +1 -2
- package/dist/components/nylas-cancelled-event-card2.js.map +1 -1
- package/dist/components/nylas-composer2.js +1 -2
- package/dist/components/nylas-composer2.js.map +1 -1
- package/dist/components/nylas-custom-booking-flow2.js +1 -2
- package/dist/components/nylas-custom-booking-flow2.js.map +1 -1
- package/dist/components/nylas-date-picker2.js +1 -2
- package/dist/components/nylas-date-picker2.js.map +1 -1
- package/dist/components/nylas-editor-tabs2.js +24 -7
- package/dist/components/nylas-editor-tabs2.js.map +1 -1
- package/dist/components/nylas-event-description2.js +0 -1
- package/dist/components/nylas-event-description2.js.map +1 -1
- package/dist/components/nylas-event-duration2.js +0 -1
- package/dist/components/nylas-event-duration2.js.map +1 -1
- package/dist/components/nylas-event-info2.js +1 -2
- package/dist/components/nylas-event-info2.js.map +1 -1
- package/dist/components/nylas-event-limits2.js +1 -2
- package/dist/components/nylas-event-limits2.js.map +1 -1
- package/dist/components/nylas-event-title2.js +1 -2
- package/dist/components/nylas-event-title2.js.map +1 -1
- package/dist/components/nylas-form-card2.js +1 -2
- package/dist/components/nylas-form-card2.js.map +1 -1
- package/dist/components/nylas-if-state.js +0 -1
- package/dist/components/nylas-if-state.js.map +1 -1
- package/dist/components/nylas-limit-future-bookings2.js +1 -2
- package/dist/components/nylas-limit-future-bookings2.js.map +1 -1
- package/dist/components/nylas-list-configurations.d.ts +11 -0
- package/dist/components/nylas-list-configurations.js +8 -0
- package/dist/components/nylas-list-configurations.js.map +1 -0
- package/dist/components/nylas-list-configurations2.js +142 -0
- package/dist/components/nylas-list-configurations2.js.map +1 -0
- package/dist/components/nylas-list-folders.js +2 -3
- package/dist/components/nylas-list-folders.js.map +1 -1
- package/dist/components/nylas-list-threads.js +2 -3
- package/dist/components/nylas-list-threads.js.map +1 -1
- package/dist/components/nylas-locale-switch2.js +0 -1
- package/dist/components/nylas-locale-switch2.js.map +1 -1
- package/dist/components/nylas-location-component2.js +3 -4
- package/dist/components/nylas-location-component2.js.map +1 -1
- package/dist/components/nylas-login.js +1 -2
- package/dist/components/nylas-login.js.map +1 -1
- package/dist/components/nylas-logo2.js +1 -2
- package/dist/components/nylas-logo2.js.map +1 -1
- package/dist/components/nylas-mailbox-pagination.js +0 -1
- package/dist/components/nylas-mailbox-pagination.js.map +1 -1
- package/dist/components/nylas-mailbox-toolbar-button.js +1 -2
- package/dist/components/nylas-mailbox-toolbar-button.js.map +1 -1
- package/dist/components/nylas-mailbox.js +1 -2
- package/dist/components/nylas-mailbox.js.map +1 -1
- package/dist/components/nylas-min-cancellation-notice2.js +1 -2
- package/dist/components/nylas-min-cancellation-notice2.js.map +1 -1
- package/dist/components/nylas-notification2.js +1 -2
- package/dist/components/nylas-notification2.js.map +1 -1
- package/dist/components/nylas-provider.js +1 -2
- package/dist/components/nylas-provider.js.map +1 -1
- package/dist/components/nylas-scheduler-editor.js +303 -129
- package/dist/components/nylas-scheduler-editor.js.map +1 -1
- package/dist/components/nylas-scheduling.js +0 -1
- package/dist/components/nylas-scheduling.js.map +1 -1
- package/dist/components/nylas-selected-event-card2.js +0 -1
- package/dist/components/nylas-selected-event-card2.js.map +1 -1
- package/dist/components/nylas-summarize-message-button2.js +3 -4
- package/dist/components/nylas-summarize-message-button2.js.map +1 -1
- package/dist/components/nylas-threads-refresh.js +2 -3
- package/dist/components/nylas-threads-refresh.js.map +1 -1
- package/dist/components/nylas-threads-search.js +1 -2
- package/dist/components/nylas-threads-search.js.map +1 -1
- package/dist/components/nylas-time-window-picker2.js +2 -4
- package/dist/components/nylas-time-window-picker2.js.map +1 -1
- package/dist/components/nylas-timeslot-picker2.js +1 -2
- package/dist/components/nylas-timeslot-picker2.js.map +1 -1
- package/dist/components/nylas-view-email2.js +2 -4
- package/dist/components/nylas-view-email2.js.map +1 -1
- package/dist/components/nylas-view-thread.js +2 -3
- package/dist/components/nylas-view-thread.js.map +1 -1
- package/dist/components/people-icon.js +1 -2
- package/dist/components/people-icon.js.map +1 -1
- package/dist/components/play.js +1 -2
- package/dist/components/play.js.map +1 -1
- package/dist/components/refresh.js +1 -2
- package/dist/components/refresh.js.map +1 -1
- package/dist/components/register-component.js +7 -1
- package/dist/components/register-component.js.map +1 -1
- package/dist/components/reply-all.js +1 -2
- package/dist/components/reply-all.js.map +1 -1
- package/dist/components/reply.js +1 -2
- package/dist/components/reply.js.map +1 -1
- package/dist/components/scheduler-config-store.js +8 -1
- package/dist/components/scheduler-config-store.js.map +1 -1
- package/dist/components/scheduler-store.js +1 -1
- package/dist/components/search.js +1 -2
- package/dist/components/search.js.map +1 -1
- package/dist/components/select-dropdown2.js +2 -3
- package/dist/components/select-dropdown2.js.map +1 -1
- package/dist/components/sent.js +1 -2
- package/dist/components/sent.js.map +1 -1
- package/dist/components/spam.js +1 -2
- package/dist/components/spam.js.map +1 -1
- package/dist/components/star.js +1 -2
- package/dist/components/star.js.map +1 -1
- package/dist/components/stop.js +1 -2
- package/dist/components/stop.js.map +1 -1
- package/dist/components/time-period-selector2.js +1 -2
- package/dist/components/time-period-selector2.js.map +1 -1
- package/dist/components/toolitp-component.js +1 -2
- package/dist/components/toolitp-component.js.map +1 -1
- package/dist/components/translate.js +1 -2
- package/dist/components/translate.js.map +1 -1
- package/dist/components/trash.js +1 -2
- package/dist/components/trash.js.map +1 -1
- package/dist/components/underline.js +1 -2
- package/dist/components/underline.js.map +1 -1
- package/dist/components/utils.js +49 -2
- package/dist/components/utils.js.map +1 -1
- package/dist/components/warning.js +1 -2
- package/dist/components/warning.js.map +1 -1
- package/dist/esm/add-circle-icon.entry.js +1 -1
- package/dist/esm/add-circle-icon_22.entry.js +20 -20
- package/dist/esm/archive-icon.entry.js +1 -1
- package/dist/esm/archive-icon_7.entry.js +7 -7
- package/dist/esm/arrow-icon.entry.js +1 -1
- package/dist/esm/bold-icon.entry.js +1 -1
- package/dist/esm/bold-icon_3.entry.js +3 -3
- package/dist/esm/button-component.entry.js +1 -1
- package/dist/esm/calendar-cancel-icon.entry.js +1 -1
- package/dist/esm/calendar-check-icon.entry.js +1 -1
- package/dist/esm/calendar-check-icon_2.entry.js +2 -2
- package/dist/esm/calendar-icon.entry.js +1 -1
- package/dist/esm/calendar-info-icon.entry.js +1 -1
- package/dist/esm/calendar-patterns-icon.entry.js +1 -1
- package/dist/esm/checkmark-circle-icon.entry.js +1 -1
- package/dist/esm/chevron-icon.entry.js +1 -1
- package/dist/esm/chevron-icon_3.entry.js +4 -4
- package/dist/esm/close-icon.entry.js +1 -1
- package/dist/esm/document-refresh-icon.entry.js +1 -1
- package/dist/esm/flow-icon.entry.js +1 -1
- package/dist/esm/folder-icon.entry.js +1 -1
- package/dist/esm/forward-icon.entry.js +1 -1
- package/dist/esm/forward-icon_6.entry.js +9 -9
- package/dist/esm/globe-icon.entry.js +1 -1
- package/dist/esm/google-logo-icon.entry.js +1 -1
- package/dist/esm/{google-logo-icon_3.entry.js → google-logo-icon_4.entry.js} +137 -17
- package/dist/esm/google-logo-icon_4.entry.js.map +1 -0
- package/dist/esm/inbox-icon.entry.js +1 -1
- package/dist/esm/index-7cb0dd3d.js +6 -6
- package/dist/esm/index-8362ce5c.js +12 -8
- package/dist/{nylas-web-elements/index.es-bd511719.js → esm/index.es-2842f8c8.js} +9 -4
- package/dist/esm/index.es-2842f8c8.js.map +1 -0
- package/dist/esm/{index.es-2578c6a5.js → index.es-f57e612a.js} +9 -4
- package/dist/esm/index.es-f57e612a.js.map +1 -0
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/info-icon.entry.js +1 -1
- package/dist/esm/info-icon_2.entry.js +2 -2
- package/dist/esm/italic-icon.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/loading-icon.entry.js +1 -1
- package/dist/esm/location-icon.entry.js +1 -1
- package/dist/esm/location-off-icon.entry.js +1 -1
- package/dist/esm/{mailbox-store-bb21512c.js → mailbox-store-47fc8a1a.js} +3 -3
- package/dist/{nylas-web-elements/mailbox-store-150cc456.js.map → esm/mailbox-store-47fc8a1a.js.map} +1 -1
- package/dist/esm/{mailbox-store-150cc456.js → mailbox-store-d48269de.js} +3 -3
- package/dist/esm/{mailbox-store-150cc456.js.map → mailbox-store-d48269de.js.map} +1 -1
- package/dist/esm/microsoft-logo-icon.entry.js +1 -1
- package/dist/esm/multi-select-dropdown.entry.js +3 -3
- package/dist/esm/nylas-additional-participants.entry.js +3 -3
- package/dist/esm/{nylas-api-request-c97a0153.js → nylas-api-request-3120d9ac.js} +17 -7
- package/dist/esm/nylas-api-request-3120d9ac.js.map +1 -0
- package/dist/{nylas-web-elements/nylas-api-request-55446aba.js → esm/nylas-api-request-4f3dbb72.js} +17 -7
- package/dist/esm/nylas-api-request-4f3dbb72.js.map +1 -0
- package/dist/esm/nylas-availability-picker.entry.js +2 -2
- package/dist/esm/nylas-booked-event-card.entry.js +2 -2
- package/dist/esm/nylas-booked-event-card_10.entry.js +6 -6
- package/dist/esm/nylas-booking-calendar-picker.entry.js +2 -2
- package/dist/esm/nylas-booking-form.entry.js +2 -2
- package/dist/esm/nylas-buffer-time.entry.js +2 -2
- package/dist/esm/nylas-calendar-picker.entry.js +2 -2
- package/dist/esm/nylas-cancel-booking-form.entry.js +3 -3
- package/dist/esm/nylas-cancelled-event-card.entry.js +3 -3
- package/dist/esm/nylas-composer.entry.js +2 -2
- package/dist/esm/nylas-custom-booking-flow.entry.js +3 -3
- package/dist/esm/nylas-date-picker.entry.js +2 -2
- package/dist/esm/nylas-editor-tabs.entry.js +25 -8
- package/dist/esm/nylas-editor-tabs.entry.js.map +1 -1
- package/dist/esm/nylas-event-description.entry.js +2 -2
- package/dist/esm/nylas-event-duration.entry.js +2 -2
- package/dist/esm/nylas-event-info.entry.js +3 -3
- package/dist/esm/nylas-event-limits.entry.js +3 -3
- package/dist/esm/nylas-event-title.entry.js +2 -2
- package/dist/esm/nylas-form-card.entry.js +3 -3
- package/dist/esm/nylas-if-state.entry.js +2 -2
- package/dist/esm/nylas-limit-future-bookings.entry.js +3 -3
- package/dist/esm/nylas-list-configurations.entry.js +110 -0
- package/dist/esm/nylas-list-configurations.entry.js.map +1 -0
- package/dist/esm/nylas-list-folders.entry.js +3 -3
- package/dist/esm/nylas-list-threads.entry.js +3 -3
- package/dist/esm/nylas-locale-switch.entry.js +2 -2
- package/dist/esm/nylas-location-component.entry.js +5 -5
- package/dist/esm/nylas-login.entry.js +3 -3
- package/dist/esm/nylas-logo.entry.js +1 -1
- package/dist/esm/nylas-mailbox-pagination.entry.js +2 -2
- package/dist/esm/nylas-mailbox-toolbar-button.entry.js +3 -3
- package/dist/esm/nylas-mailbox.entry.js +4 -4
- package/dist/esm/nylas-min-cancellation-notice.entry.js +3 -3
- package/dist/esm/nylas-notification.entry.js +2 -2
- package/dist/esm/nylas-provider.entry.js +6 -6
- package/dist/esm/nylas-scheduler-editor.entry.js +194 -68
- package/dist/esm/nylas-scheduler-editor.entry.js.map +1 -1
- package/dist/esm/nylas-scheduling.entry.js +3 -3
- package/dist/esm/nylas-selected-event-card.entry.js +2 -2
- package/dist/esm/nylas-summarize-message-button.entry.js +4 -4
- package/dist/esm/nylas-threads-refresh.entry.js +4 -4
- package/dist/esm/nylas-threads-search.entry.js +3 -3
- package/dist/esm/nylas-time-window-picker.entry.js +2 -2
- package/dist/esm/nylas-timeslot-picker.entry.js +2 -2
- package/dist/esm/nylas-view-email.entry.js +2 -2
- package/dist/esm/nylas-view-thread.entry.js +3 -3
- package/dist/esm/nylas-web-elements.js +1 -1
- package/dist/esm/people-icon.entry.js +1 -1
- package/dist/esm/play-icon.entry.js +1 -1
- package/dist/esm/play-icon_2.entry.js +2 -2
- package/dist/esm/refresh-icon.entry.js +1 -1
- package/dist/esm/{register-component-dc659dc3.js → register-component-cf5c8420.js} +8 -2
- package/dist/esm/register-component-cf5c8420.js.map +1 -0
- package/dist/{nylas-web-elements/register-component-0645dce0.js → esm/register-component-e5afe237.js} +8 -2
- package/dist/esm/register-component-e5afe237.js.map +1 -0
- package/dist/esm/reply-all-icon.entry.js +1 -1
- package/dist/esm/reply-icon.entry.js +1 -1
- package/dist/esm/{scheduler-config-store-bc59545b.js → scheduler-config-store-0efc3519.js} +8 -1
- package/dist/esm/scheduler-config-store-0efc3519.js.map +1 -0
- package/dist/esm/{scheduler-config-store-51ee4f42.js → scheduler-config-store-6222c0ed.js} +8 -1
- package/dist/esm/scheduler-config-store-6222c0ed.js.map +1 -0
- package/dist/esm/{scheduler-store-72116723.js → scheduler-store-39d37291.js} +2 -2
- package/dist/esm/{scheduler-store-4d0a4f8a.js.map → scheduler-store-39d37291.js.map} +1 -1
- package/dist/{nylas-web-elements/scheduler-store-4d0a4f8a.js → esm/scheduler-store-8ddcc496.js} +2 -2
- package/dist/esm/{scheduler-store-72116723.js.map → scheduler-store-8ddcc496.js.map} +1 -1
- package/dist/esm/search-icon.entry.js +1 -1
- package/dist/esm/select-dropdown.entry.js +2 -2
- package/dist/esm/sent-icon.entry.js +1 -1
- package/dist/esm/spam-icon.entry.js +1 -1
- package/dist/esm/star-icon.entry.js +1 -1
- package/dist/esm/stop-icon.entry.js +1 -1
- package/dist/esm/time-period-selector.entry.js +2 -2
- package/dist/esm/tooltip-component.entry.js +1 -1
- package/dist/esm/translate-icon.entry.js +1 -1
- package/dist/esm/trash-icon.entry.js +1 -1
- package/dist/esm/underline-icon.entry.js +1 -1
- package/dist/{nylas-web-elements/utils-3a8d433a.js → esm/utils-73d8a928.js} +18 -2
- package/dist/{nylas-web-elements/utils-3a8d433a.js.map → esm/utils-73d8a928.js.map} +1 -1
- package/dist/esm/{utils-c00bdc3c.js → utils-d6204242.js} +18 -2
- package/dist/esm/utils-d6204242.js.map +1 -0
- package/dist/esm/warning-icon.entry.js +1 -1
- package/dist/nylas-web-elements/add-circle-icon.entry.js +1 -1
- package/dist/nylas-web-elements/archive-icon.entry.js +1 -1
- package/dist/nylas-web-elements/arrow-icon.entry.js +1 -1
- package/dist/nylas-web-elements/bold-icon.entry.js +1 -1
- package/dist/nylas-web-elements/button-component.entry.js +1 -1
- package/dist/nylas-web-elements/calendar-cancel-icon.entry.js +1 -1
- package/dist/nylas-web-elements/calendar-check-icon.entry.js +1 -1
- package/dist/nylas-web-elements/calendar-icon.entry.js +1 -1
- package/dist/nylas-web-elements/calendar-info-icon.entry.js +1 -1
- package/dist/nylas-web-elements/calendar-patterns-icon.entry.js +1 -1
- package/dist/nylas-web-elements/checkmark-circle-icon.entry.js +1 -1
- package/dist/nylas-web-elements/chevron-icon.entry.js +1 -1
- package/dist/nylas-web-elements/close-icon.entry.js +1 -1
- package/dist/nylas-web-elements/document-refresh-icon.entry.js +1 -1
- package/dist/nylas-web-elements/flow-icon.entry.js +1 -1
- package/dist/nylas-web-elements/folder-icon.entry.js +1 -1
- package/dist/nylas-web-elements/forward-icon.entry.js +1 -1
- package/dist/nylas-web-elements/globe-icon.entry.js +1 -1
- package/dist/nylas-web-elements/google-logo-icon.entry.js +1 -1
- package/dist/nylas-web-elements/inbox-icon.entry.js +1 -1
- package/dist/{esm/index.es-bd511719.js → nylas-web-elements/index.es-2842f8c8.js} +9 -4
- package/dist/nylas-web-elements/index.es-2842f8c8.js.map +1 -0
- package/dist/nylas-web-elements/index.esm.js +3 -1
- package/dist/nylas-web-elements/index.esm.js.map +1 -1
- package/dist/nylas-web-elements/info-icon.entry.js +1 -1
- package/dist/nylas-web-elements/italic-icon.entry.js +1 -1
- package/dist/nylas-web-elements/loading-icon.entry.js +1 -1
- package/dist/nylas-web-elements/location-icon.entry.js +1 -1
- package/dist/nylas-web-elements/location-off-icon.entry.js +1 -1
- package/dist/nylas-web-elements/{mailbox-store-150cc456.js → mailbox-store-d48269de.js} +3 -3
- package/dist/{esm/mailbox-store-bb21512c.js.map → nylas-web-elements/mailbox-store-d48269de.js.map} +1 -1
- package/dist/nylas-web-elements/microsoft-logo-icon.entry.js +1 -1
- package/dist/nylas-web-elements/multi-select-dropdown.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-additional-participants.entry.js +3 -3
- package/dist/{esm/nylas-api-request-55446aba.js → nylas-web-elements/nylas-api-request-4f3dbb72.js} +17 -7
- package/dist/nylas-web-elements/nylas-api-request-4f3dbb72.js.map +1 -0
- package/dist/nylas-web-elements/nylas-availability-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-booked-event-card.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-booking-calendar-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-booking-form.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-buffer-time.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-calendar-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-cancel-booking-form.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-cancelled-event-card.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-composer.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-custom-booking-flow.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-date-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-editor-tabs.entry.js +25 -8
- package/dist/nylas-web-elements/nylas-editor-tabs.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-event-description.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-event-duration.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-event-info.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-event-limits.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-event-title.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-form-card.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-if-state.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-limit-future-bookings.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-list-configurations.entry.js +110 -0
- package/dist/nylas-web-elements/nylas-list-configurations.entry.js.map +1 -0
- package/dist/nylas-web-elements/nylas-list-folders.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-list-threads.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-locale-switch.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-location-component.entry.js +5 -5
- package/dist/nylas-web-elements/nylas-login.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-logo.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-mailbox-pagination.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-mailbox-toolbar-button.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-mailbox.entry.js +4 -4
- package/dist/nylas-web-elements/nylas-min-cancellation-notice.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-notification.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-provider.entry.js +6 -6
- package/dist/nylas-web-elements/nylas-scheduler-editor.entry.js +194 -68
- package/dist/nylas-web-elements/nylas-scheduler-editor.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-scheduling.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-selected-event-card.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-summarize-message-button.entry.js +4 -4
- package/dist/nylas-web-elements/nylas-threads-refresh.entry.js +4 -4
- package/dist/nylas-web-elements/nylas-threads-search.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-time-window-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-timeslot-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-view-email.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-view-thread.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
- package/dist/nylas-web-elements/{p-f48d0571.entry.js → p-04e3a98e.entry.js} +2 -2
- package/dist/nylas-web-elements/p-0edb3b69.entry.js +2 -0
- package/dist/nylas-web-elements/{p-40ed7eab.entry.js → p-1260ac06.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-65062d50.entry.js → p-1655dec3.entry.js} +4 -4
- package/dist/nylas-web-elements/p-1655dec3.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-64364434.entry.js → p-18a936a3.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-df5e9aaf.js → p-1aa7b357.js} +2 -2
- package/dist/nylas-web-elements/{p-b2208193.entry.js → p-1ab25f04.entry.js} +2 -2
- package/dist/nylas-web-elements/p-1c94940d.entry.js +2 -0
- package/dist/nylas-web-elements/{p-d85eecf4.entry.js.map → p-1c94940d.entry.js.map} +1 -1
- package/dist/nylas-web-elements/p-1f843391.js +2 -0
- package/dist/nylas-web-elements/p-1f843391.js.map +1 -0
- package/dist/nylas-web-elements/{p-42a4c2fd.entry.js → p-266f9995.entry.js} +2 -2
- package/dist/nylas-web-elements/p-3116f5cc.js +2 -0
- package/dist/nylas-web-elements/p-3116f5cc.js.map +1 -0
- package/dist/nylas-web-elements/{p-ad9c3cab.entry.js → p-370cdcca.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-2c5d5953.entry.js → p-3f6155de.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-901f9612.js → p-41dc0d93.js} +2 -2
- package/dist/nylas-web-elements/p-41dc0d93.js.map +1 -0
- package/dist/nylas-web-elements/{p-006ab406.entry.js → p-424f4d9a.entry.js} +2 -2
- package/dist/nylas-web-elements/p-47180df9.entry.js +2 -0
- package/dist/nylas-web-elements/{p-5a3809a7.entry.js → p-55368bc0.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-374527e6.entry.js → p-572bf8c2.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-2523c292.entry.js → p-57b753c6.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-a0c2ce03.entry.js → p-605142a9.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-4ee6f11e.entry.js → p-618b94cd.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-4d9fceeb.entry.js → p-674b6d5d.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-39b280e2.entry.js → p-6dcc9411.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-395f49eb.entry.js → p-7692056f.entry.js} +2 -2
- package/dist/nylas-web-elements/p-7c55dfa0.entry.js +2 -0
- package/dist/nylas-web-elements/{p-ba3d383f.entry.js.map → p-7c55dfa0.entry.js.map} +1 -1
- package/dist/nylas-web-elements/{p-9dac153b.entry.js → p-81ea7310.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-a1e27dc5.entry.js → p-858f0aad.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-baa620b4.entry.js → p-8b1a6e27.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-deafc6bc.entry.js → p-945caf14.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-ae01e1cb.entry.js → p-9b195811.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-409d4410.entry.js → p-9c399019.entry.js} +2 -2
- package/dist/nylas-web-elements/p-9d0c0340.entry.js +2 -0
- package/dist/nylas-web-elements/{p-fbbca7a6.entry.js → p-9d4bffbb.entry.js} +2 -2
- package/dist/nylas-web-elements/p-9d75bcb2.entry.js +2 -0
- package/dist/nylas-web-elements/p-9d75bcb2.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-9ea458c3.js +2 -0
- package/dist/nylas-web-elements/p-9ea458c3.js.map +1 -0
- package/dist/nylas-web-elements/{p-7b1bb792.entry.js → p-ae893050.entry.js} +3 -3
- package/dist/nylas-web-elements/{p-d92a0405.entry.js → p-be7124f0.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-3da66838.entry.js → p-c199d203.entry.js} +2 -2
- package/dist/nylas-web-elements/p-c451c9e1.entry.js +2 -0
- package/dist/nylas-web-elements/{p-41c1654e.entry.js.map → p-c451c9e1.entry.js.map} +1 -1
- package/dist/nylas-web-elements/p-c45ac7c6.entry.js +2 -0
- package/dist/nylas-web-elements/{p-d224c7af.entry.js → p-e03b2592.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-9f168ff0.js → p-e22aa0b0.js} +2 -2
- package/dist/nylas-web-elements/{p-408dda49.js → p-eaa9151b.js} +2 -2
- package/dist/nylas-web-elements/p-eaa9151b.js.map +1 -0
- package/dist/nylas-web-elements/{p-3631e6e5.entry.js → p-fe3b8e66.entry.js} +2 -2
- package/dist/nylas-web-elements/people-icon.entry.js +1 -1
- package/dist/nylas-web-elements/play-icon.entry.js +1 -1
- package/dist/nylas-web-elements/refresh-icon.entry.js +1 -1
- package/dist/{esm/register-component-0645dce0.js → nylas-web-elements/register-component-e5afe237.js} +8 -2
- package/dist/nylas-web-elements/register-component-e5afe237.js.map +1 -0
- package/dist/nylas-web-elements/reply-all-icon.entry.js +1 -1
- package/dist/nylas-web-elements/reply-icon.entry.js +1 -1
- package/dist/nylas-web-elements/{scheduler-config-store-bc59545b.js → scheduler-config-store-0efc3519.js} +8 -1
- package/dist/nylas-web-elements/scheduler-config-store-0efc3519.js.map +1 -0
- package/dist/{esm/scheduler-store-4d0a4f8a.js → nylas-web-elements/scheduler-store-8ddcc496.js} +2 -2
- package/dist/nylas-web-elements/{scheduler-store-4d0a4f8a.js.map → scheduler-store-8ddcc496.js.map} +1 -1
- package/dist/nylas-web-elements/search-icon.entry.js +1 -1
- package/dist/nylas-web-elements/select-dropdown.entry.js +2 -2
- package/dist/nylas-web-elements/sent-icon.entry.js +1 -1
- package/dist/nylas-web-elements/spam-icon.entry.js +1 -1
- package/dist/nylas-web-elements/star-icon.entry.js +1 -1
- package/dist/nylas-web-elements/stop-icon.entry.js +1 -1
- package/dist/nylas-web-elements/time-period-selector.entry.js +2 -2
- package/dist/nylas-web-elements/tooltip-component.entry.js +1 -1
- package/dist/nylas-web-elements/translate-icon.entry.js +1 -1
- package/dist/nylas-web-elements/trash-icon.entry.js +1 -1
- package/dist/nylas-web-elements/underline-icon.entry.js +1 -1
- package/dist/{esm/utils-3a8d433a.js → nylas-web-elements/utils-73d8a928.js} +18 -2
- package/dist/{esm/utils-3a8d433a.js.map → nylas-web-elements/utils-73d8a928.js.map} +1 -1
- package/dist/nylas-web-elements/warning-icon.entry.js +1 -1
- package/dist/types/common/component-types.d.ts +3 -1
- package/dist/types/common/nylas-api-request.d.ts +3 -2
- package/dist/types/common/register-component.d.ts +1 -0
- package/dist/types/common/types.d.ts +3 -1
- package/dist/types/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.d.ts +6 -2
- package/dist/types/components/scheduler-editor/nylas-list-configurations/nylas-list-configurations.d.ts +25 -0
- package/dist/types/components/scheduler-editor/nylas-scheduler-editor/LoginRequired.d.ts +4 -0
- package/dist/types/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.d.ts +7 -3
- package/dist/types/components.d.ts +123 -0
- package/dist/types/connector/nylas-scheduler-config-connector/index.d.ts +2 -2
- package/dist/types/connector/shared/api/scheduler-config.d.ts +45 -8
- package/dist/types/stores/scheduler-config-store.d.ts +2 -0
- package/dist/types/utils/utils.d.ts +4 -1
- package/package.json +1 -2
- package/dist/cjs/google-logo-icon_3.cjs.entry.js.map +0 -1
- package/dist/cjs/index.es-447c5aca.js.map +0 -1
- package/dist/cjs/index.es-68425511.js.map +0 -1
- package/dist/cjs/nylas-api-request-8ec3a89c.js.map +0 -1
- package/dist/cjs/nylas-api-request-ab24150d.js.map +0 -1
- package/dist/cjs/register-component-d729f3f7.js.map +0 -1
- package/dist/cjs/register-component-f1ebc65d.js.map +0 -1
- package/dist/cjs/scheduler-config-store-31b83ad3.js.map +0 -1
- package/dist/cjs/scheduler-config-store-9c2cc421.js.map +0 -1
- package/dist/cjs/utils-53dd7574.js.map +0 -1
- package/dist/components/_commonjsHelpers.js +0 -36
- package/dist/components/_commonjsHelpers.js.map +0 -1
- package/dist/components/index2.js +0 -196
- package/dist/components/index2.js.map +0 -1
- package/dist/components/nylas-api-request.js +0 -37
- package/dist/components/nylas-api-request.js.map +0 -1
- package/dist/esm/google-logo-icon_3.entry.js.map +0 -1
- package/dist/esm/index.es-2578c6a5.js.map +0 -1
- package/dist/esm/index.es-bd511719.js.map +0 -1
- package/dist/esm/nylas-api-request-55446aba.js.map +0 -1
- package/dist/esm/nylas-api-request-c97a0153.js.map +0 -1
- package/dist/esm/register-component-0645dce0.js.map +0 -1
- package/dist/esm/register-component-dc659dc3.js.map +0 -1
- package/dist/esm/scheduler-config-store-51ee4f42.js.map +0 -1
- package/dist/esm/scheduler-config-store-bc59545b.js.map +0 -1
- package/dist/esm/utils-c00bdc3c.js.map +0 -1
- package/dist/nylas-web-elements/index.es-bd511719.js.map +0 -1
- package/dist/nylas-web-elements/nylas-api-request-55446aba.js.map +0 -1
- package/dist/nylas-web-elements/p-01bf65c2.entry.js +0 -2
- package/dist/nylas-web-elements/p-408dda49.js.map +0 -1
- package/dist/nylas-web-elements/p-41c1654e.entry.js +0 -2
- package/dist/nylas-web-elements/p-65062d50.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-65fdfb60.js +0 -2
- package/dist/nylas-web-elements/p-65fdfb60.js.map +0 -1
- package/dist/nylas-web-elements/p-901f9612.js.map +0 -1
- package/dist/nylas-web-elements/p-a3d5a1dd.entry.js +0 -2
- package/dist/nylas-web-elements/p-ba3d383f.entry.js +0 -2
- package/dist/nylas-web-elements/p-bfdc148c.entry.js +0 -2
- package/dist/nylas-web-elements/p-cadc9052.js +0 -2
- package/dist/nylas-web-elements/p-cadc9052.js.map +0 -1
- package/dist/nylas-web-elements/p-d67d1c72.js +0 -2
- package/dist/nylas-web-elements/p-d67d1c72.js.map +0 -1
- package/dist/nylas-web-elements/p-d85eecf4.entry.js +0 -2
- package/dist/nylas-web-elements/p-de63bc35.entry.js +0 -2
- package/dist/nylas-web-elements/p-eb93a363.entry.js +0 -2
- package/dist/nylas-web-elements/p-eb93a363.entry.js.map +0 -1
- package/dist/nylas-web-elements/register-component-0645dce0.js.map +0 -1
- package/dist/nylas-web-elements/scheduler-config-store-bc59545b.js.map +0 -1
- /package/dist/nylas-web-elements/{p-f48d0571.entry.js.map → p-04e3a98e.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-a3d5a1dd.entry.js.map → p-0edb3b69.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-40ed7eab.entry.js.map → p-1260ac06.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-64364434.entry.js.map → p-18a936a3.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-df5e9aaf.js.map → p-1aa7b357.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-b2208193.entry.js.map → p-1ab25f04.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-42a4c2fd.entry.js.map → p-266f9995.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-ad9c3cab.entry.js.map → p-370cdcca.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-2c5d5953.entry.js.map → p-3f6155de.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-006ab406.entry.js.map → p-424f4d9a.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-bfdc148c.entry.js.map → p-47180df9.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-5a3809a7.entry.js.map → p-55368bc0.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-374527e6.entry.js.map → p-572bf8c2.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-2523c292.entry.js.map → p-57b753c6.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-a0c2ce03.entry.js.map → p-605142a9.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-4ee6f11e.entry.js.map → p-618b94cd.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-4d9fceeb.entry.js.map → p-674b6d5d.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-39b280e2.entry.js.map → p-6dcc9411.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-395f49eb.entry.js.map → p-7692056f.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-9dac153b.entry.js.map → p-81ea7310.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-a1e27dc5.entry.js.map → p-858f0aad.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-baa620b4.entry.js.map → p-8b1a6e27.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-deafc6bc.entry.js.map → p-945caf14.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-ae01e1cb.entry.js.map → p-9b195811.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-409d4410.entry.js.map → p-9c399019.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-01bf65c2.entry.js.map → p-9d0c0340.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-fbbca7a6.entry.js.map → p-9d4bffbb.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-7b1bb792.entry.js.map → p-ae893050.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-d92a0405.entry.js.map → p-be7124f0.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-3da66838.entry.js.map → p-c199d203.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-de63bc35.entry.js.map → p-c45ac7c6.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-d224c7af.entry.js.map → p-e03b2592.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-9f168ff0.js.map → p-e22aa0b0.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-3631e6e5.entry.js.map → p-fe3b8e66.entry.js.map} +0 -0
package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.js
CHANGED
|
@@ -1,19 +1,30 @@
|
|
|
1
1
|
import { NylasBaseProvider } from "../../../common/abstract-provider";
|
|
2
|
+
import { NylasIdentityRequestWrapper } from "../../../common/nylas-api-request";
|
|
2
3
|
import { NylasSchedulerConfigConnector } from "../../../connector/nylas-scheduler-config-connector/index";
|
|
3
4
|
import { CreateNylasSchedulerConfigStore } from "../../../stores/scheduler-config-store";
|
|
4
5
|
import { debug } from "../../../utils/utils";
|
|
5
|
-
import { Host, h } from "@stencil/core";
|
|
6
|
-
import { NylasIdentityRequestWrapper } from "../../../common/nylas-api-request";
|
|
7
6
|
import { NylasSessions } from "@nylas/identity";
|
|
7
|
+
import { Host, h } from "@stencil/core";
|
|
8
|
+
import { LoginRequired } from "./LoginRequired";
|
|
8
9
|
export class NylasSchedulerEditor {
|
|
9
10
|
constructor() {
|
|
10
11
|
this.handleSchedulerConfigCloseClicked = (_event) => {
|
|
11
12
|
this.schedulerConfigCloseClicked.emit(this.host);
|
|
12
13
|
};
|
|
14
|
+
this.authenticationUrl = async (provider) => {
|
|
15
|
+
if (!this.nylasApiRequest) {
|
|
16
|
+
console.error(`[nylas-scheduler-editor] Nylas API Request is not initialized.`);
|
|
17
|
+
return '';
|
|
18
|
+
}
|
|
19
|
+
const url = await this.nylasApiRequest.authenticationUrl({ provider });
|
|
20
|
+
return url || '';
|
|
21
|
+
};
|
|
22
|
+
this.defaultRequiresSessionAuth = true;
|
|
13
23
|
this.configurationId = undefined;
|
|
14
24
|
this.nylasApiRequest = undefined;
|
|
15
25
|
this.nylasSessionsConfig = undefined;
|
|
16
26
|
this.eventOverrides = {};
|
|
27
|
+
this.schedulerPreviewLink = '';
|
|
17
28
|
this.defaultSchedulerConfigStoreState = undefined;
|
|
18
29
|
this.mode = 'app';
|
|
19
30
|
this.automaticComponentRegistration = true;
|
|
@@ -28,6 +39,7 @@ export class NylasSchedulerEditor {
|
|
|
28
39
|
...this.defaultSchedulerConfigStoreState,
|
|
29
40
|
}),
|
|
30
41
|
};
|
|
42
|
+
this.stores?.schedulerConfig?.set('defaultRequiresSessionAuth', this.defaultRequiresSessionAuth);
|
|
31
43
|
if (!this.nylasApiRequest && this.nylasSessionsConfig) {
|
|
32
44
|
const nylasSession = new NylasSessions(this.nylasSessionsConfig);
|
|
33
45
|
await nylasSession.isLoggedIn();
|
|
@@ -44,11 +56,6 @@ export class NylasSchedulerEditor {
|
|
|
44
56
|
});
|
|
45
57
|
this.nylasApiRequest = new NylasIdentityRequestWrapper(nylasSession);
|
|
46
58
|
}
|
|
47
|
-
if (!this.nylasApiRequest) {
|
|
48
|
-
debug(`[nylas-scheduler-editor] No NylasApiRequest provided. Unable to continue.`);
|
|
49
|
-
console.error(`[nylas-scheduler-editor] No NylasApiRequest provided. Unable to continue.`);
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
59
|
this.baseProvider = new NylasBaseProvider(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides);
|
|
53
60
|
const nylasSchedulerConfigStore = this.baseProvider.getStore('schedulerConfig');
|
|
54
61
|
this.nylasSchedulerConfigConnector = new NylasSchedulerConfigConnector({
|
|
@@ -67,6 +74,11 @@ export class NylasSchedulerEditor {
|
|
|
67
74
|
this.loggedOut.emit(this.host);
|
|
68
75
|
}
|
|
69
76
|
}
|
|
77
|
+
this.stores?.schedulerConfig?.onChange('config', async (config) => {
|
|
78
|
+
if (config && config.id) {
|
|
79
|
+
this.configurationId = config.id;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
70
82
|
this.baseProvider?.componentWillLoad(this.nylasSchedulerConfigConnector);
|
|
71
83
|
}
|
|
72
84
|
async componentDidLoad() {
|
|
@@ -76,19 +88,17 @@ export class NylasSchedulerEditor {
|
|
|
76
88
|
componentDisconnected() {
|
|
77
89
|
this.baseProvider?.componentDisconnected();
|
|
78
90
|
}
|
|
79
|
-
|
|
80
|
-
this.stores?.schedulerConfig?.set('
|
|
81
|
-
if (this.configurationId) {
|
|
82
|
-
await this.nylasSchedulerConfigConnector?.schedulerConfig?.getConfigurationById(this.configurationId);
|
|
83
|
-
}
|
|
84
|
-
await this.nylasSchedulerConfigConnector?.schedulerConfig?.getCalendars();
|
|
91
|
+
defaultRequiresSessionAuthChanged(newRequireSessionAuth) {
|
|
92
|
+
this.stores?.schedulerConfig?.set('defaultRequiresSessionAuth', newRequireSessionAuth);
|
|
85
93
|
}
|
|
86
94
|
async configurationIdChanged(newConfigurationId) {
|
|
87
95
|
if (newConfigurationId) {
|
|
88
96
|
await this.nylasSchedulerConfigConnector?.schedulerConfig?.getConfigurationById(newConfigurationId);
|
|
97
|
+
this.stores?.schedulerConfig?.set('action', 'edit');
|
|
89
98
|
}
|
|
90
99
|
else {
|
|
91
100
|
this.stores?.schedulerConfig?.set('config', {});
|
|
101
|
+
this.stores?.schedulerConfig?.set('action', null);
|
|
92
102
|
}
|
|
93
103
|
}
|
|
94
104
|
async store() {
|
|
@@ -103,34 +113,20 @@ export class NylasSchedulerEditor {
|
|
|
103
113
|
async unregisterComponentHandler(event) {
|
|
104
114
|
this.baseProvider?.unregisterComponent(event.detail);
|
|
105
115
|
}
|
|
116
|
+
async loggedInHandler(currentUser) {
|
|
117
|
+
this.stores?.schedulerConfig?.set('currentUser', currentUser);
|
|
118
|
+
if (!this.nylasSchedulerConfigConnector) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (this.configurationId) {
|
|
122
|
+
await this.nylasSchedulerConfigConnector.schedulerConfig?.getConfigurationById(this.configurationId);
|
|
123
|
+
}
|
|
124
|
+
await this.nylasSchedulerConfigConnector.schedulerConfig?.getCalendars();
|
|
125
|
+
}
|
|
106
126
|
render() {
|
|
107
127
|
const defaultEditor = this.mode === 'app';
|
|
108
128
|
if (defaultEditor) {
|
|
109
|
-
return (h(Host, null, h("div", { class: "scheduler-editor-header", part: "nse__header" }, h("h1", { class: "scheduler-editor-title", part: "nse__title" }, h("calendar-icon", { width: "18", height: "18" }), "Scheduler editor"), h("button", { class: "scheduler-editor-close", onClick: e => this.handleSchedulerConfigCloseClicked(e), part: "nse__close-button" }, h("close-icon", { width: "18", height: "18" }))), this.stores?.schedulerConfig?.state.currentUser &&
|
|
110
|
-
const authUrl = await this.nylasApiRequest?.authenticationUrl({ provider: 'google' });
|
|
111
|
-
if (authUrl) {
|
|
112
|
-
window.location.href = authUrl;
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
console.error(`[nylas-scheduler-editor] Unable to get authentication URL.`);
|
|
116
|
-
}
|
|
117
|
-
} }, h("span", { class: "icon" }, h("google-logo-icon", { width: "15", height: "15" })), "Continue with Google"), h("button", { class: "microsoft-button", onClick: async () => {
|
|
118
|
-
const authUrl = await this.nylasApiRequest?.authenticationUrl({ provider: 'microsoft' });
|
|
119
|
-
if (authUrl) {
|
|
120
|
-
window.location.href = authUrl;
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
console.error(`[nylas-scheduler-editor] Unable to get authentication URL.`);
|
|
124
|
-
}
|
|
125
|
-
} }, h("span", { class: "icon" }, h("microsoft-logo-icon", { width: "15", height: "15" })), "Continue with Microsoft"), h("button", { class: "other-provider-button", onClick: async () => {
|
|
126
|
-
const authUrl = await this.nylasApiRequest?.authenticationUrl();
|
|
127
|
-
if (authUrl) {
|
|
128
|
-
window.location.href = authUrl;
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
console.error(`[nylas-scheduler-editor] Unable to get authentication URL.`);
|
|
132
|
-
}
|
|
133
|
-
} }, "View all providers ", h("chevron-icon", { width: "17", height: "17" })), h("small", { class: "disclaimer-text" }, "* You will be redirected to authenticate your account.")))))));
|
|
129
|
+
return (h(Host, null, h("div", { class: "scheduler-editor-header", part: "nse__header" }, h("h1", { class: "scheduler-editor-title", part: "nse__title" }, h("calendar-icon", { width: "18", height: "18" }), "Scheduler editor"), h("button", { class: "scheduler-editor-close", onClick: e => this.handleSchedulerConfigCloseClicked(e), part: "nse__close-button" }, h("close-icon", { width: "18", height: "18" }))), this.stores?.schedulerConfig?.state.currentUser && this.stores.schedulerConfig.state.action === null && (h("div", { class: "list-configurations" }, h("nylas-list-configurations", null))), this.stores?.schedulerConfig?.state.currentUser && (this.stores.schedulerConfig.state.action === 'create' || this.stores.schedulerConfig.state.action === 'edit') && (h("nylas-editor-tabs", null)), !this.stores?.schedulerConfig?.state.currentUser && (h("slot", { name: "login-required" }, h(LoginRequired, { authenticationUrl: this.authenticationUrl })))));
|
|
134
130
|
}
|
|
135
131
|
return (h(Host, null, h("slot", null)));
|
|
136
132
|
}
|
|
@@ -148,9 +144,27 @@ export class NylasSchedulerEditor {
|
|
|
148
144
|
}
|
|
149
145
|
static get properties() {
|
|
150
146
|
return {
|
|
147
|
+
"defaultRequiresSessionAuth": {
|
|
148
|
+
"type": "boolean",
|
|
149
|
+
"mutable": true,
|
|
150
|
+
"complexType": {
|
|
151
|
+
"original": "boolean",
|
|
152
|
+
"resolved": "boolean",
|
|
153
|
+
"references": {}
|
|
154
|
+
},
|
|
155
|
+
"required": false,
|
|
156
|
+
"optional": false,
|
|
157
|
+
"docs": {
|
|
158
|
+
"tags": [],
|
|
159
|
+
"text": "The default require session auth flag to used to set the default value for the requireSessionAuth\nproperty when creating a configuration. If set to true, then a session token must be provided\nto the <nylas-scheduling/> component. If set to false, then a session token is not required\nand the configuration id can passed to the <nylas-scheduling/> component instead."
|
|
160
|
+
},
|
|
161
|
+
"attribute": "default-requires-session-auth",
|
|
162
|
+
"reflect": false,
|
|
163
|
+
"defaultValue": "true"
|
|
164
|
+
},
|
|
151
165
|
"configurationId": {
|
|
152
166
|
"type": "string",
|
|
153
|
-
"mutable":
|
|
167
|
+
"mutable": true,
|
|
154
168
|
"complexType": {
|
|
155
169
|
"original": "string",
|
|
156
170
|
"resolved": "string | undefined",
|
|
@@ -167,7 +181,7 @@ export class NylasSchedulerEditor {
|
|
|
167
181
|
},
|
|
168
182
|
"nylasApiRequest": {
|
|
169
183
|
"type": "unknown",
|
|
170
|
-
"mutable":
|
|
184
|
+
"mutable": true,
|
|
171
185
|
"complexType": {
|
|
172
186
|
"original": "NylasApiRequest",
|
|
173
187
|
"resolved": "NylasApiRequest | undefined",
|
|
@@ -212,7 +226,7 @@ export class NylasSchedulerEditor {
|
|
|
212
226
|
"mutable": false,
|
|
213
227
|
"complexType": {
|
|
214
228
|
"original": "SchedulerEditorEventOverride",
|
|
215
|
-
"resolved": "Partial<{ valueChanged: (event: CustomEvent<{ value: OpenHours[]; name: string; } | { value: string[]; name: string; valueChangedHandler?: ((event: CustomEvent<{ value: string[]; name: string; }>) => void) | undefined; } | { value: string; name: string; valueChanged?: ((event: CustomEvent<{ value: string; name: string; }>) => void) | undefined; } | { value: string; name: string; } | { value: string; name: string; } | { value: string; name: string; }>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; schedulerConfigChanged: (event: CustomEvent<SchedulerEventDetail>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; }> & EventOverride<NylasSchedulerConfigConnectorInterface>",
|
|
229
|
+
"resolved": "Partial<{ valueChanged: (event: CustomEvent<{ value: OpenHours[]; name: string; } | { value: string[]; name: string; valueChangedHandler?: ((event: CustomEvent<{ value: string[]; name: string; }>) => void) | undefined; } | { value: string; name: string; valueChanged?: ((event: CustomEvent<{ value: string; name: string; }>) => void) | undefined; } | { value: string; name: string; } | { value: string; name: string; } | { value: string; name: string; }>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; schedulerConfigChanged: (event: CustomEvent<SchedulerEventDetail>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; cancelButtonClick: (event: CustomEvent<void>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; previewButtonClicked: (event: CustomEvent<HTMLNylasEditorTabsElement>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; initListConfigurations: (event: CustomEvent<HTMLNylasListConfigurationsElement>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; createButtonClick: (event: CustomEvent<HTMLNylasListConfigurationsElement>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; editButtonClick: (event: CustomEvent<{ host: HTMLNylasListConfigurationsElement; configuration: Configuration; }>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; deleteButtonClick: (event: CustomEvent<{ host: HTMLNylasListConfigurationsElement; configuration: Configuration; }>, connector?: NylasSchedulerConnectorInterface | undefined) => Promise<void>; }> & EventOverride<NylasSchedulerConfigConnectorInterface>",
|
|
216
230
|
"references": {
|
|
217
231
|
"SchedulerEditorEventOverride": {
|
|
218
232
|
"location": "import",
|
|
@@ -229,6 +243,24 @@ export class NylasSchedulerEditor {
|
|
|
229
243
|
},
|
|
230
244
|
"defaultValue": "{}"
|
|
231
245
|
},
|
|
246
|
+
"schedulerPreviewLink": {
|
|
247
|
+
"type": "string",
|
|
248
|
+
"mutable": false,
|
|
249
|
+
"complexType": {
|
|
250
|
+
"original": "string",
|
|
251
|
+
"resolved": "string",
|
|
252
|
+
"references": {}
|
|
253
|
+
},
|
|
254
|
+
"required": false,
|
|
255
|
+
"optional": false,
|
|
256
|
+
"docs": {
|
|
257
|
+
"tags": [],
|
|
258
|
+
"text": "The scheduler preview link to use when the user clicks on the preview button.\nYou can use a placeholder `{config.id}` to replace the configuration id anywhere in the link."
|
|
259
|
+
},
|
|
260
|
+
"attribute": "scheduler-preview-link",
|
|
261
|
+
"reflect": false,
|
|
262
|
+
"defaultValue": "''"
|
|
263
|
+
},
|
|
232
264
|
"defaultSchedulerConfigStoreState": {
|
|
233
265
|
"type": "unknown",
|
|
234
266
|
"mutable": false,
|
|
@@ -420,6 +452,9 @@ export class NylasSchedulerEditor {
|
|
|
420
452
|
static get elementRef() { return "host"; }
|
|
421
453
|
static get watchers() {
|
|
422
454
|
return [{
|
|
455
|
+
"propName": "defaultRequiresSessionAuth",
|
|
456
|
+
"methodName": "defaultRequiresSessionAuthChanged"
|
|
457
|
+
}, {
|
|
423
458
|
"propName": "configurationId",
|
|
424
459
|
"methodName": "configurationIdChanged"
|
|
425
460
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nylas-scheduler-editor.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAE,+BAA+B,EAAiE,MAAM,iCAAiC,CAAC;AACjJ,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrH,OAAO,EAAE,2BAA2B,EAA8B,MAAM,4BAA4B,CAAC;AACrG,OAAO,EAAU,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAYxD,MAAM,OAAO,oBAAoB;;QAiPvB,sCAAiC,GAAG,CAAC,MAAa,EAAE,EAAE;YAC5D,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnD,CAAC,CAAC;;;;8BA/LqD,EAAE;;oBAaU,KAAK;8CAgCrB,IAAI;;IAEvD,iBAAiB;QACf,KAAK,CAAC,4CAA4C,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,KAAK,CAAC,4CAA4C,CAAC,CAAC;QACpD,IAAI,CAAC,MAAM,GAAG;YACZ,eAAe,EAAE,+BAA+B,CAAC;gBAC/C,GAAG,IAAI,CAAC,gCAAgC;a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KAAK,CAAC,4DAA4D,CAAC,CAAC;oCAC9E,CAAC;gCACH,CAAC;gCAED,YAAM,KAAK,EAAC,MAAM;oCAChB,2BAAqB,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,GAAG,CACzC;0DAEA;4BAET,cACE,KAAK,EAAC,uBAAuB,EAC7B,OAAO,EAAE,KAAK,IAAI,EAAE;oCAClB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,eAAe,EAAE,iBAAiB,EAAE,CAAC;oCAChE,IAAI,OAAO,EAAE,CAAC;wCACZ,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,OAAO,CAAC;oCACjC,CAAC;yCAAM,CAAC;wCACN,OAAO,CAAC,KAAK,CAAC,4DAA4D,CAAC,CAAC;oCAC9E,CAAC;gCACH,CAAC;;gCAEkB,oBAAc,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,GAAG,CACnD;4BAET,aAAO,KAAK,EAAC,iBAAiB,6DAA+D,CACzF,CACF,CACD,CACR,CACI,CACR,CAAC;QACJ,CAAC;QAED,OAAO,CACL,EAAC,IAAI;YACH,eAAa,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { NylasBaseProvider } from '@/common/abstract-provider';\nimport type { SchedulerEditorEventOverride } from '@/common/component-types';\nimport { RegisteredComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { CreateNylasSchedulerConfigStore, NylasSchedulerConfigStoreState, NylasSchedulerConfigStoreType } from '@/stores/scheduler-config-store';\nimport { debug } from '@/utils/utils';\nimport { Component, Element, Event, EventEmitter, Host, Listen, Method, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasIdentityRequestWrapper, User, type NylasApiRequest } from '@/common/nylas-api-request';\nimport { Config, NylasSessions } from '@nylas/identity';\n\n/**\n * The `nylas-scheduler-editor` component is a form that allows users to configure the settings for the Nylas Scheduler.\n *\n * @slot login-required - This slot is used to display a message when the user is not logged in.\n */\n@Component({\n tag: 'nylas-scheduler-editor',\n styleUrl: 'nylas-scheduler-editor.scss',\n shadow: true,\n})\nexport class NylasSchedulerEditor {\n /**\n * Stores to be used by the provider.\n */\n private stores?: {\n schedulerConfig: NylasSchedulerConfigStoreType;\n };\n\n /**\n * This is a base provide that defines the common methods and properties\n * that all providers should have.\n *\n * Because stencil does not support abstract classes, we have to use a\n * property to store the base provider instance.\n */\n private baseProvider?: NylasBaseProvider<Exclude<typeof this.stores, undefined>>;\n\n /**\n * The Nylas Scheduler Config Connector instance.\n * The brains of the provider. It manages data fetching and state synchronization.\n */\n private nylasSchedulerConfigConnector?: NylasSchedulerConfigConnector;\n\n /**\n * The host element.\n * Used to manage the host element of the provider.\n */\n @Element() private host!: HTMLNylasSchedulerEditorElement;\n\n /***\n * The configuration id to use for the scheduler editor.\n * If provided, then the scheduler editor will try and fetch the configuration\n * with the provided id. If found, it will automatically load the editor\n * with the configuration settings for editing.\n */\n @Prop() configurationId?: string;\n\n /**\n * The Nylas Api Request instance.\n * Used to make requests to the Nylas API.\n */\n @Prop() nylasApiRequest?: NylasApiRequest;\n\n /**\n * The Nylas Sessions configuration.\n * Used to configure the Nylas Sessions instance.\n */\n @Prop() nylasSessionsConfig?: Config;\n\n /**\n * This provides a way to override the default event handlers.\n */\n @Prop() eventOverrides: SchedulerEditorEventOverride = {};\n\n /**\n * The default scheduler config store state.\n * Used to set the initial state of the scheduler config store.\n */\n @Prop({ attribute: 'default-scheduler-config-store-state' }) readonly defaultSchedulerConfigStoreState?: NylasSchedulerConfigStoreState;\n\n /**\n * The is used to set the mode for the scheduler config.\n * The mode can be 'app' or 'composable'.\n * The default mode is 'app'.\n */\n @Prop({ attribute: 'mode' }) readonly mode: 'app' | 'composable' = 'app';\n\n /**\n * This event is fired when the provider is initialized.\n * By default, this event handles determining if the user is logged in or not.\n * In addition, it fetches the provided configuration if a valid configuration id is provided.\n */\n @Event({ cancelable: true }) readonly init!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * This event is fired when the the NyalsAuth isAuthenticated state changes\n * to true.\n */\n @Event({ cancelable: true }) readonly loggedIn!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * This event is fired when the the NyalsAuth isAuthenticated state changes\n * to true.\n */\n @Event({ cancelable: true }) readonly loggedOut!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * This event is fired when the close button on scheduler config is clicked.\n */\n @Event({ cancelable: true }) readonly schedulerConfigCloseClicked!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * Automatically register components that have the `@RegisterComponent` decorator.\n * If this is set to false, you will need to manually register components using the\n * `registerComponent` method.\n * @default true\n */\n @State() automaticComponentRegistration: boolean = true;\n\n connectedCallback() {\n debug(`[nylas-scheduler-editor] connectedCallback`);\n }\n\n async componentWillLoad() {\n debug(`[nylas-scheduler-editor] componentWillLoad`);\n this.stores = {\n schedulerConfig: CreateNylasSchedulerConfigStore({\n ...this.defaultSchedulerConfigStoreState,\n }),\n };\n\n if (!this.nylasApiRequest && this.nylasSessionsConfig) {\n const nylasSession = new NylasSessions(this.nylasSessionsConfig);\n\n // We must check if the user is logged in before continuing\n // otherwise, a PCKE code will not be generated and the user\n // will not be able to log in.\n await nylasSession.isLoggedIn();\n\n // Watch for login events so that we can automatically update the state\n nylasSession.onLoginSuccess(async () => {\n const currentUser = await this.nylasSchedulerConfigConnector?.schedulerConfig?.currentUser();\n if (currentUser) {\n this.loggedIn.emit(this.host);\n this.loggedInHandler(currentUser);\n }\n });\n\n // Watch for logout events so that we can automatically update the state\n nylasSession.onLoginFail(async () => {\n this.stores?.schedulerConfig?.set('currentUser', null);\n this.loggedOut.emit(this.host);\n });\n\n this.nylasApiRequest = new NylasIdentityRequestWrapper(nylasSession);\n }\n\n if (!this.nylasApiRequest) {\n debug(`[nylas-scheduler-editor] No NylasApiRequest provided. Unable to continue.`);\n console.error(`[nylas-scheduler-editor] No NylasApiRequest provided. Unable to continue.`);\n return;\n }\n\n this.baseProvider = new NylasBaseProvider(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides);\n\n const nylasSchedulerConfigStore = this.baseProvider.getStore('schedulerConfig');\n this.nylasSchedulerConfigConnector = new NylasSchedulerConfigConnector({\n nylasApiRequest: this.nylasApiRequest,\n nylasSchedulerConfigStore: nylasSchedulerConfigStore,\n });\n\n const initEvent = this.init.emit(this.host);\n if (!initEvent.defaultPrevented) {\n const currentUser = await this.nylasSchedulerConfigConnector?.schedulerConfig?.currentUser();\n if (currentUser) {\n this.loggedIn.emit(this.host);\n await this.loggedInHandler(currentUser);\n } else {\n this.stores?.schedulerConfig?.set('currentUser', null);\n this.loggedOut.emit(this.host);\n }\n }\n\n this.baseProvider?.componentWillLoad(this.nylasSchedulerConfigConnector);\n }\n\n async componentDidLoad() {\n debug(`[nylas-scheduler-editor] componentDidLoad`);\n this.baseProvider?.componentDidLoad();\n }\n\n componentDisconnected() {\n this.baseProvider?.componentDisconnected();\n }\n\n private async loggedInHandler(currentUser: User) {\n this.stores?.schedulerConfig?.set('currentUser', currentUser);\n if (this.configurationId) {\n await this.nylasSchedulerConfigConnector?.schedulerConfig?.getConfigurationById(this.configurationId);\n }\n await this.nylasSchedulerConfigConnector?.schedulerConfig?.getCalendars();\n }\n\n /**\n * Watch for changes to the configuration id and automatically fetch the configuration\n * when the configuration id changes. If the configuration id is cleared, then the\n * configuration is cleared as well.\n * @param newConfigurationId A new configuration id to fetch\n */\n @Watch('configurationId')\n async configurationIdChanged(newConfigurationId: string) {\n if (newConfigurationId) {\n await this.nylasSchedulerConfigConnector?.schedulerConfig?.getConfigurationById(newConfigurationId);\n } else {\n // Clear the configuration\n this.stores?.schedulerConfig?.set('config', {});\n }\n }\n\n /**\n * This method is used to get the NylasSchedulerConfigStore instance.\n * You can use this instance to update or get the state of the store.\n * @returns Promise<NylasSchedulerConfigStoreType | undefined>\n */\n @Method()\n async store(): Promise<NylasSchedulerConfigStoreType | undefined> {\n return this.stores?.schedulerConfig;\n }\n\n /**\n * This method is used to get the NylasSchedulerConfigConnector instance.\n * You can use this instance to make requests to the Nylas API.\n * @returns Promise<NylasSchedulerConfigConnector | undefined>\n */\n @Method()\n async schedulerConnector(): Promise<NylasSchedulerConfigConnector | undefined> {\n return this.nylasSchedulerConfigConnector;\n }\n\n /**\n * This is a custom event handler that is used to register a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to register\n * @returns Promise<void>\n */\n @Listen('registerComponent')\n async registerComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n this.baseProvider?.registerComponent(event.detail);\n }\n\n /**\n * This is a custom event handler that is used to unregister a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to unregister\n * @returns Promise<void>\n */\n @Listen('unregisterComponent')\n async unregisterComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n this.baseProvider?.unregisterComponent(event.detail);\n }\n\n private handleSchedulerConfigCloseClicked = (_event: Event) => {\n this.schedulerConfigCloseClicked.emit(this.host);\n };\n\n render() {\n const defaultEditor = this.mode === 'app';\n\n if (defaultEditor) {\n return (\n <Host>\n <div class=\"scheduler-editor-header\" part=\"nse__header\">\n <h1 class=\"scheduler-editor-title\" part=\"nse__title\">\n <calendar-icon width=\"18\" height=\"18\" />\n Scheduler editor\n </h1>\n <button class=\"scheduler-editor-close\" onClick={e => this.handleSchedulerConfigCloseClicked(e)} part=\"nse__close-button\">\n <close-icon width=\"18\" height=\"18\" />\n </button>\n </div>\n {this.stores?.schedulerConfig?.state.currentUser && <nylas-editor-tabs></nylas-editor-tabs>}\n {!this.stores?.schedulerConfig?.state.currentUser && (\n <slot name=\"login-required\">\n <div class={'login-required'}>\n <div class={'card'}>\n <p>Log into your account to use the Scheduler Editor.</p>\n\n <button\n class=\"google-button\"\n onClick={async () => {\n const authUrl = await this.nylasApiRequest?.authenticationUrl({ provider: 'google' });\n if (authUrl) {\n window.location.href = authUrl;\n } else {\n console.error(`[nylas-scheduler-editor] Unable to get authentication URL.`);\n }\n }}\n >\n <span class=\"icon\">\n <google-logo-icon width=\"15\" height=\"15\" />\n </span>\n Continue with Google\n </button>\n\n <button\n class=\"microsoft-button\"\n onClick={async () => {\n const authUrl = await this.nylasApiRequest?.authenticationUrl({ provider: 'microsoft' });\n if (authUrl) {\n window.location.href = authUrl;\n } else {\n console.error(`[nylas-scheduler-editor] Unable to get authentication URL.`);\n }\n }}\n >\n <span class=\"icon\">\n <microsoft-logo-icon width=\"15\" height=\"15\" />\n </span>\n Continue with Microsoft\n </button>\n\n <button\n class=\"other-provider-button\"\n onClick={async () => {\n const authUrl = await this.nylasApiRequest?.authenticationUrl();\n if (authUrl) {\n window.location.href = authUrl;\n } else {\n console.error(`[nylas-scheduler-editor] Unable to get authentication URL.`);\n }\n }}\n >\n View all providers <chevron-icon width=\"17\" height=\"17\" />\n </button>\n\n <small class=\"disclaimer-text\">* You will be redirected to authenticate your account.</small>\n </div>\n </div>\n </slot>\n )}\n </Host>\n );\n }\n\n return (\n <Host>\n <slot></slot>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"nylas-scheduler-editor.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D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xC;gBACA,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,CAAC,WAAW,IAAI,CACnD,YAAM,IAAI,EAAC,gBAAgB;oBACzB,EAAC,aAAa,IAAC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,GAAI,CACvD,CACR,CACI,CACR,CAAC;QACJ,CAAC;QAED,OAAO,CACL,EAAC,IAAI;YACH,eAAa,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { NylasBaseProvider } from '@/common/abstract-provider';\nimport type { SchedulerEditorEventOverride } from '@/common/component-types';\nimport { NylasIdentityRequestWrapper, User, type NylasApiRequest } from '@/common/nylas-api-request';\nimport { RegisteredComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { CreateNylasSchedulerConfigStore, NylasSchedulerConfigStoreState, NylasSchedulerConfigStoreType } from '@/stores/scheduler-config-store';\nimport { debug } from '@/utils/utils';\nimport { Config, NylasSessions } from '@nylas/identity';\nimport { Component, Element, Event, EventEmitter, Host, Listen, Method, Prop, State, Watch, h } from '@stencil/core';\nimport { LoginRequired } from './LoginRequired';\n\n/**\n * The `nylas-scheduler-editor` component is a form that allows users to configure the settings for the Nylas Scheduler.\n *\n * @slot login-required - This slot is used to display a message when the user is not logged in.\n */\n@Component({\n tag: 'nylas-scheduler-editor',\n styleUrl: 'nylas-scheduler-editor.scss',\n shadow: true,\n})\nexport class NylasSchedulerEditor {\n /**\n * Stores to be used by the provider.\n */\n private stores?: {\n schedulerConfig: NylasSchedulerConfigStoreType;\n };\n\n /**\n * This is a base provide that defines the common methods and properties\n * that all providers should have.\n *\n * Because stencil does not support abstract classes, we have to use a\n * property to store the base provider instance.\n */\n private baseProvider?: NylasBaseProvider<Exclude<typeof this.stores, undefined>>;\n\n /**\n * The Nylas Scheduler Config Connector instance.\n * The brains of the provider. It manages data fetching and state synchronization.\n */\n private nylasSchedulerConfigConnector?: NylasSchedulerConfigConnector;\n\n /**\n * The host element.\n * Used to manage the host element of the provider.\n */\n @Element() private host!: HTMLNylasSchedulerEditorElement;\n\n /**\n * The default require session auth flag to used to set the default value for the requireSessionAuth\n * property when creating a configuration. If set to true, then a session token must be provided\n * to the <nylas-scheduling/> component. If set to false, then a session token is not required\n * and the configuration id can passed to the <nylas-scheduling/> component instead.\n */\n @Prop({ mutable: true }) defaultRequiresSessionAuth: boolean = true;\n\n /***\n * The configuration id to use for the scheduler editor.\n * If provided, then the scheduler editor will try and fetch the configuration\n * with the provided id. If found, it will automatically load the editor\n * with the configuration settings for editing.\n */\n @Prop({ mutable: true }) configurationId?: string;\n\n /**\n * The Nylas Api Request instance.\n * Used to make requests to the Nylas API.\n */\n @Prop({ mutable: true }) nylasApiRequest?: NylasApiRequest;\n\n /**\n * The Nylas Sessions configuration.\n * Used to configure the Nylas Sessions instance.\n */\n @Prop() nylasSessionsConfig?: Config;\n\n /**\n * This provides a way to override the default event handlers.\n */\n @Prop() eventOverrides: SchedulerEditorEventOverride = {};\n\n /**\n * The scheduler preview link to use when the user clicks on the preview button.\n * You can use a placeholder `{config.id}` to replace the configuration id anywhere in the link.\n */\n @Prop({ attribute: 'scheduler-preview-link' }) schedulerPreviewLink: string = '';\n\n /**\n * The default scheduler config store state.\n * Used to set the initial state of the scheduler config store.\n */\n @Prop({ attribute: 'default-scheduler-config-store-state' }) readonly defaultSchedulerConfigStoreState?: NylasSchedulerConfigStoreState;\n\n /**\n * The is used to set the mode for the scheduler config.\n * The mode can be 'app' or 'composable'.\n * The default mode is 'app'.\n */\n @Prop({ attribute: 'mode' }) readonly mode: 'app' | 'composable' = 'app';\n\n /**\n * This event is fired when the provider is initialized.\n * By default, this event handles determining if the user is logged in or not.\n * In addition, it fetches the provided configuration if a valid configuration id is provided.\n */\n @Event({ cancelable: true }) readonly init!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * This event is fired when the the NyalsAuth isAuthenticated state changes\n * to true.\n */\n @Event({ cancelable: true }) readonly loggedIn!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * This event is fired when the the NyalsAuth isAuthenticated state changes\n * to true.\n */\n @Event({ cancelable: true }) readonly loggedOut!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * This event is fired when the close button on scheduler config is clicked.\n */\n @Event({ cancelable: true }) readonly schedulerConfigCloseClicked!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * Automatically register components that have the `@RegisterComponent` decorator.\n * If this is set to false, you will need to manually register components using the\n * `registerComponent` method.\n * @default true\n */\n @State() automaticComponentRegistration: boolean = true;\n\n connectedCallback() {\n debug(`[nylas-scheduler-editor] connectedCallback`);\n }\n\n async componentWillLoad() {\n debug(`[nylas-scheduler-editor] componentWillLoad`);\n this.stores = {\n schedulerConfig: CreateNylasSchedulerConfigStore({\n ...this.defaultSchedulerConfigStoreState,\n }),\n };\n\n // Update our store state\n this.stores?.schedulerConfig?.set('defaultRequiresSessionAuth', this.defaultRequiresSessionAuth);\n\n if (!this.nylasApiRequest && this.nylasSessionsConfig) {\n const nylasSession = new NylasSessions(this.nylasSessionsConfig);\n\n // We must check if the user is logged in before continuing\n // otherwise, a PCKE code will not be generated and the user\n // will not be able to log in.\n await nylasSession.isLoggedIn();\n\n // Watch for login events so that we can automatically update the state\n nylasSession.onLoginSuccess(async () => {\n const currentUser = await this.nylasSchedulerConfigConnector?.schedulerConfig?.currentUser();\n if (currentUser) {\n this.loggedIn.emit(this.host);\n this.loggedInHandler(currentUser);\n }\n });\n\n // Watch for logout events so that we can automatically update the state\n nylasSession.onLoginFail(async () => {\n this.stores?.schedulerConfig?.set('currentUser', null);\n this.loggedOut.emit(this.host);\n });\n\n this.nylasApiRequest = new NylasIdentityRequestWrapper(nylasSession);\n }\n\n this.baseProvider = new NylasBaseProvider(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides);\n\n const nylasSchedulerConfigStore = this.baseProvider.getStore('schedulerConfig');\n this.nylasSchedulerConfigConnector = new NylasSchedulerConfigConnector({\n nylasApiRequest: this.nylasApiRequest,\n nylasSchedulerConfigStore: nylasSchedulerConfigStore,\n });\n\n const initEvent = this.init.emit(this.host);\n if (!initEvent.defaultPrevented) {\n const currentUser = await this.nylasSchedulerConfigConnector?.schedulerConfig?.currentUser();\n if (currentUser) {\n this.loggedIn.emit(this.host);\n await this.loggedInHandler(currentUser);\n } else {\n this.stores?.schedulerConfig?.set('currentUser', null);\n this.loggedOut.emit(this.host);\n }\n }\n\n // Watch for store changes\n this.stores?.schedulerConfig?.onChange('config', async config => {\n if (config && config.id) {\n this.configurationId = config.id;\n }\n });\n\n this.baseProvider?.componentWillLoad(this.nylasSchedulerConfigConnector);\n }\n\n async componentDidLoad() {\n debug(`[nylas-scheduler-editor] componentDidLoad`);\n this.baseProvider?.componentDidLoad();\n }\n\n componentDisconnected() {\n this.baseProvider?.componentDisconnected();\n }\n\n /**\n * Watch for changes to the defaultRequiresSessionAuth property and update the\n * defaultRequiresSessionAuth property in the scheduler config store.\n * @param newRequireSessionAuth The new value for the defaultRequiresSessionAuth property\n */\n @Watch('defaultRequiresSessionAuth')\n defaultRequiresSessionAuthChanged(newRequireSessionAuth: boolean) {\n this.stores?.schedulerConfig?.set('defaultRequiresSessionAuth', newRequireSessionAuth);\n }\n\n /**\n * Watch for changes to the configuration id and automatically fetch the configuration\n * when the configuration id changes. If the configuration id is cleared, then the\n * configuration is cleared as well.\n * @param newConfigurationId The new configuration id\n */\n @Watch('configurationId')\n async configurationIdChanged(newConfigurationId: string) {\n if (newConfigurationId) {\n await this.nylasSchedulerConfigConnector?.schedulerConfig?.getConfigurationById(newConfigurationId);\n this.stores?.schedulerConfig?.set('action', 'edit');\n } else {\n // Clear the configuration\n this.stores?.schedulerConfig?.set('config', {});\n this.stores?.schedulerConfig?.set('action', null);\n }\n }\n\n /**\n * This method is used to get the NylasSchedulerConfigStore instance.\n * You can use this instance to update or get the state of the store.\n * @returns Promise<NylasSchedulerConfigStoreType | undefined>\n */\n @Method()\n async store(): Promise<NylasSchedulerConfigStoreType | undefined> {\n return this.stores?.schedulerConfig;\n }\n\n /**\n * This method is used to get the NylasSchedulerConfigConnector instance.\n * You can use this instance to make requests to the Nylas API.\n * @returns Promise<NylasSchedulerConfigConnector | undefined>\n */\n @Method()\n async schedulerConnector(): Promise<NylasSchedulerConfigConnector | undefined> {\n return this.nylasSchedulerConfigConnector;\n }\n\n /**\n * This is a custom event handler that is used to register a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to register\n * @returns Promise<void>\n */\n @Listen('registerComponent')\n async registerComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n this.baseProvider?.registerComponent(event.detail);\n }\n\n /**\n * This is a custom event handler that is used to unregister a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to unregister\n * @returns Promise<void>\n */\n @Listen('unregisterComponent')\n async unregisterComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n this.baseProvider?.unregisterComponent(event.detail);\n }\n\n /**\n * Upon login, set the current user and fetch the configuration and calendars.\n * @param currentUser The current user that is logged in\n */\n private async loggedInHandler(currentUser: User) {\n this.stores?.schedulerConfig?.set('currentUser', currentUser);\n\n if (!this.nylasSchedulerConfigConnector) {\n return;\n }\n\n if (this.configurationId) {\n await this.nylasSchedulerConfigConnector.schedulerConfig?.getConfigurationById(this.configurationId);\n }\n\n await this.nylasSchedulerConfigConnector.schedulerConfig?.getCalendars();\n }\n\n /**\n * This is a custom event handler that is used to update the state of the provider.\n */\n private handleSchedulerConfigCloseClicked = (_event: Event) => {\n this.schedulerConfigCloseClicked.emit(this.host);\n };\n\n /**\n * This method is used to get the authentication URL for a provider.\n * @param provider The provider to get the authentication URL for (e.g. google, microsoft, etc.)\n * @returns Promise<string> The authentication URL to redirect the user for the provider\n */\n private authenticationUrl = async (provider?: string) => {\n if (!this.nylasApiRequest) {\n console.error(`[nylas-scheduler-editor] Nylas API Request is not initialized.`);\n return '';\n }\n const url = await this.nylasApiRequest.authenticationUrl({ provider });\n\n return url || '';\n };\n\n render() {\n const defaultEditor = this.mode === 'app';\n\n if (defaultEditor) {\n return (\n <Host>\n <div class=\"scheduler-editor-header\" part=\"nse__header\">\n <h1 class=\"scheduler-editor-title\" part=\"nse__title\">\n <calendar-icon width=\"18\" height=\"18\" />\n Scheduler editor\n </h1>\n <button class=\"scheduler-editor-close\" onClick={e => this.handleSchedulerConfigCloseClicked(e)} part=\"nse__close-button\">\n <close-icon width=\"18\" height=\"18\" />\n </button>\n </div>\n {this.stores?.schedulerConfig?.state.currentUser && this.stores.schedulerConfig.state.action === null && (\n <div class=\"list-configurations\">\n <nylas-list-configurations></nylas-list-configurations>\n </div>\n )}\n {this.stores?.schedulerConfig?.state.currentUser && (this.stores.schedulerConfig.state.action === 'create' || this.stores.schedulerConfig.state.action === 'edit') && (\n <nylas-editor-tabs></nylas-editor-tabs>\n )}\n {!this.stores?.schedulerConfig?.state.currentUser && (\n <slot name=\"login-required\">\n <LoginRequired authenticationUrl={this.authenticationUrl} />\n </slot>\n )}\n </Host>\n );\n }\n\n return (\n <Host>\n <slot></slot>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -230,7 +230,7 @@ export class TimeInput {
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
render() {
|
|
233
|
-
return (h(Host, { key: '
|
|
233
|
+
return (h(Host, { key: '68fb5327c6e823e29aafa4fd7e81bddac7ab19e9' }, h("div", { key: 'c1f7edbdc95926f66fb627cfe0eb7044611518a5', class: "time-picker", part: "time-picker" }, h("input", { key: 'f1c274637b24b9e4e88798ab83524efb8e75de36', type: "text", name: this.name, id: this.name, part: "time-input", class: {
|
|
234
234
|
'time-input': true,
|
|
235
235
|
'error': !!this.err || this.hasError,
|
|
236
236
|
}, ref: el => (this.timeInput = el), value: this.time, onClick: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connector/nylas-scheduler-config-connector/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAOlF,MAAM,OAAO,6BAA6B;IAMxC,YAAY,EAAE,eAAe,EAAE,yBAAyB,EAAwC;QAC9F,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,yBAAyB,GAAG,yBAAyB,CAAC;IAC7D,CAAC;IAEM,IAAI;QACT,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAC9C,CAAC;IAED,IAAW,oBAAoB;QAC7B,OAAO,IAAI,CAAC,yBAAyB,CAAC;IACxC,CAAC;IAED,IAAW,eAAe;QACxB,IAAI,IAAI,CAAC,yBAAyB,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC,yBAAyB,CAAC;QACxC,CAAC;QAED,IAAI,CAAC,yBAAyB,GAAG,IAAI,gCAAgC,CAAC;YACpE,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,yBAAyB,EAAE,IAAI,CAAC,yBAAyB;SAC1D,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,yBAAyB,CAAC;IACxC,CAAC;IAEM,WAAW;QAChB,KAAK,CAAC,2CAA2C,CAAC,CAAC;QACnD,IAAI,CAAC,yBAAyB,CAAC,KAAK,EAAE,CAAC;IACzC,CAAC;IAEM,KAAK,CAAC,MAAM;QACjB,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAC9C,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;CACF","sourcesContent":["import { NylasApiRequest } from '@/common/nylas-api-request';\nimport { NylasSchedulerConfigStoreType } from '@/stores/scheduler-config-store';\nimport { debug } from '@/utils/utils';\nimport { NylasSchedulerConfigAPIConnector } from '../shared/api/scheduler-config';\n\ntype NylasSchedulerConfigConnectorOptions = {\n nylasSchedulerConfigStore: NylasSchedulerConfigStoreType;\n nylasApiRequest
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connector/nylas-scheduler-config-connector/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAOlF,MAAM,OAAO,6BAA6B;IAMxC,YAAY,EAAE,eAAe,EAAE,yBAAyB,EAAwC;QAC9F,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,yBAAyB,GAAG,yBAAyB,CAAC;IAC7D,CAAC;IAEM,IAAI;QACT,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAC9C,CAAC;IAED,IAAW,oBAAoB;QAC7B,OAAO,IAAI,CAAC,yBAAyB,CAAC;IACxC,CAAC;IAED,IAAW,eAAe;QACxB,IAAI,IAAI,CAAC,yBAAyB,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC,yBAAyB,CAAC;QACxC,CAAC;QAED,IAAI,CAAC,yBAAyB,GAAG,IAAI,gCAAgC,CAAC;YACpE,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,yBAAyB,EAAE,IAAI,CAAC,yBAAyB;SAC1D,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,yBAAyB,CAAC;IACxC,CAAC;IAEM,WAAW;QAChB,KAAK,CAAC,2CAA2C,CAAC,CAAC;QACnD,IAAI,CAAC,yBAAyB,CAAC,KAAK,EAAE,CAAC;IACzC,CAAC;IAEM,KAAK,CAAC,MAAM;QACjB,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAC9C,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;CACF","sourcesContent":["import { NylasApiRequest } from '@/common/nylas-api-request';\nimport { NylasSchedulerConfigStoreType } from '@/stores/scheduler-config-store';\nimport { debug } from '@/utils/utils';\nimport { NylasSchedulerConfigAPIConnector } from '../shared/api/scheduler-config';\n\ntype NylasSchedulerConfigConnectorOptions = {\n nylasSchedulerConfigStore: NylasSchedulerConfigStoreType;\n nylasApiRequest?: NylasApiRequest;\n};\n\nexport class NylasSchedulerConfigConnector {\n public nylasApiRequest?: NylasApiRequest;\n public nylasSchedulerConfigStore: NylasSchedulerConfigStoreType;\n\n private _schedulerConfigConnector: NylasSchedulerConfigAPIConnector | undefined;\n\n constructor({ nylasApiRequest, nylasSchedulerConfigStore }: NylasSchedulerConfigConnectorOptions) {\n this.nylasApiRequest = nylasApiRequest;\n this.nylasSchedulerConfigStore = nylasSchedulerConfigStore;\n }\n\n public init() {\n debug('NylasSchedulerConfigConnector init');\n }\n\n public get schedulerConfigStore() {\n return this.nylasSchedulerConfigStore;\n }\n\n public get schedulerConfig() {\n if (this._schedulerConfigConnector) {\n return this._schedulerConfigConnector;\n }\n\n this._schedulerConfigConnector = new NylasSchedulerConfigAPIConnector({\n nylasApiRequest: this.nylasApiRequest,\n nylasSchedulerConfigStore: this.nylasSchedulerConfigStore,\n });\n return this._schedulerConfigConnector;\n }\n\n public resetStores() {\n debug('NylasSchedulerConfigConnector resetStores');\n this.nylasSchedulerConfigStore.reset();\n }\n\n public async logout() {\n debug('NylasSchedulerConfigConnector logout');\n this.resetStores();\n }\n}\n\nexport type PublicMethods<T> = {\n [K in keyof T]: T[K] extends Function ? (string extends K ? never : K) : never;\n}[keyof T];\n\nexport type NylasSchedulerConfigConnectorPublicMethods = PublicMethods<NylasSchedulerConfigConnector>;\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { dataResponse } from "../../../utils/utils";
|
|
1
2
|
import { isNylasErrorResponse } from "@nylas/core";
|
|
2
3
|
export class NylasSchedulerConfigAPIConnector {
|
|
3
4
|
constructor({ nylasApiRequest, nylasSchedulerConfigStore }) {
|
|
@@ -5,37 +6,63 @@ export class NylasSchedulerConfigAPIConnector {
|
|
|
5
6
|
this.nylasSchedulerConfigStore = nylasSchedulerConfigStore;
|
|
6
7
|
}
|
|
7
8
|
async currentUser() {
|
|
9
|
+
if (!this.nylasApiRequest) {
|
|
10
|
+
console.warn('Nylas API Request is not initialized');
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
8
13
|
return this.nylasApiRequest.currentUser();
|
|
9
14
|
}
|
|
10
15
|
async getCalendars() {
|
|
11
|
-
|
|
16
|
+
if (!this.nylasApiRequest) {
|
|
17
|
+
console.warn('Nylas API Request is not initialized');
|
|
18
|
+
return dataResponse(null, {
|
|
19
|
+
message: 'Error fetching calendars: Nylas API Request is not initialized',
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
const [response, error] = await this.nylasApiRequest.request({
|
|
12
23
|
method: 'GET',
|
|
13
24
|
path: `calendars`,
|
|
14
25
|
});
|
|
26
|
+
if (error) {
|
|
27
|
+
return dataResponse(null, {
|
|
28
|
+
message: 'Error fetching calendars: ' + error.message,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
15
31
|
if (isNylasErrorResponse(response)) {
|
|
16
|
-
return {
|
|
17
|
-
|
|
18
|
-
};
|
|
32
|
+
return dataResponse(null, {
|
|
33
|
+
message: 'Error fetching calendars: ' + response.error?.message,
|
|
34
|
+
});
|
|
19
35
|
}
|
|
20
36
|
this.nylasSchedulerConfigStore.state.calendars = response.data;
|
|
21
|
-
return response
|
|
37
|
+
return dataResponse(response.data);
|
|
22
38
|
}
|
|
23
39
|
async getConfigurationById(configurationId, forceFetch = false) {
|
|
40
|
+
if (!this.nylasApiRequest) {
|
|
41
|
+
console.warn('Nylas API Request is not initialized');
|
|
42
|
+
return dataResponse(null, {
|
|
43
|
+
message: 'Error fetching configuration: Nylas API Request is not initialized',
|
|
44
|
+
});
|
|
45
|
+
}
|
|
24
46
|
if (!forceFetch) {
|
|
25
47
|
const existingConfig = this.nylasSchedulerConfigStore.state.configurations.find(c => c.id === configurationId);
|
|
26
48
|
if (existingConfig) {
|
|
27
49
|
this.nylasSchedulerConfigStore.state.config = existingConfig;
|
|
28
|
-
return existingConfig;
|
|
50
|
+
return dataResponse(existingConfig);
|
|
29
51
|
}
|
|
30
52
|
}
|
|
31
|
-
const response = await this.nylasApiRequest.request({
|
|
53
|
+
const [response, error] = await this.nylasApiRequest.request({
|
|
32
54
|
method: 'GET',
|
|
33
55
|
path: `scheduling/configurations/${configurationId}`,
|
|
34
56
|
});
|
|
57
|
+
if (error) {
|
|
58
|
+
return dataResponse(null, {
|
|
59
|
+
message: 'Error fetching configuration: ' + error.message,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
35
62
|
if (isNylasErrorResponse(response)) {
|
|
36
|
-
return {
|
|
37
|
-
|
|
38
|
-
};
|
|
63
|
+
return dataResponse(null, {
|
|
64
|
+
message: 'Error fetching configuration: ' + response.error?.message,
|
|
65
|
+
});
|
|
39
66
|
}
|
|
40
67
|
this.nylasSchedulerConfigStore.state.config = response.data;
|
|
41
68
|
if (this.nylasSchedulerConfigStore.state.configurations.find(c => c.id === configurationId)) {
|
|
@@ -44,46 +71,80 @@ export class NylasSchedulerConfigAPIConnector {
|
|
|
44
71
|
else {
|
|
45
72
|
this.nylasSchedulerConfigStore.state.configurations = [...this.nylasSchedulerConfigStore.state.configurations, response.data];
|
|
46
73
|
}
|
|
47
|
-
return response
|
|
74
|
+
return dataResponse(response.data);
|
|
48
75
|
}
|
|
49
76
|
async getConfigurations() {
|
|
50
|
-
|
|
77
|
+
if (!this.nylasApiRequest) {
|
|
78
|
+
console.warn('Nylas API Request is not initialized');
|
|
79
|
+
return dataResponse(null, {
|
|
80
|
+
message: 'Error fetching configurations: Nylas API Request is not initialized',
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
const [response, error] = await this.nylasApiRequest.request({
|
|
51
84
|
method: 'GET',
|
|
52
85
|
path: `scheduling/configurations`,
|
|
53
86
|
});
|
|
87
|
+
if (error) {
|
|
88
|
+
return dataResponse(null, {
|
|
89
|
+
message: 'Error fetching configurations: ' + error.message,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
54
92
|
if (isNylasErrorResponse(response)) {
|
|
55
|
-
return {
|
|
56
|
-
|
|
57
|
-
};
|
|
93
|
+
return dataResponse(null, {
|
|
94
|
+
message: 'Error fetching configurations: ' + response.error?.message,
|
|
95
|
+
});
|
|
58
96
|
}
|
|
59
97
|
this.nylasSchedulerConfigStore.state.configurations = response.data;
|
|
60
|
-
return response
|
|
98
|
+
return dataResponse(response.data);
|
|
61
99
|
}
|
|
62
100
|
async createConfiguration(configuration) {
|
|
63
|
-
|
|
101
|
+
if (!this.nylasApiRequest) {
|
|
102
|
+
console.warn('Nylas API Request is not initialized');
|
|
103
|
+
return dataResponse(null, {
|
|
104
|
+
message: 'Error creating configuration: Nylas API Request is not initialized',
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
configuration.requires_session_auth = this.nylasSchedulerConfigStore.state.defaultRequiresSessionAuth;
|
|
108
|
+
const [response, error] = await this.nylasApiRequest.request({
|
|
64
109
|
method: 'POST',
|
|
65
110
|
path: `scheduling/configurations`,
|
|
66
111
|
body: configuration,
|
|
67
112
|
});
|
|
113
|
+
if (error) {
|
|
114
|
+
return dataResponse(null, {
|
|
115
|
+
message: 'Error creating configuration: ' + error.message,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
68
118
|
if (isNylasErrorResponse(response)) {
|
|
69
|
-
return {
|
|
70
|
-
|
|
71
|
-
};
|
|
119
|
+
return dataResponse(null, {
|
|
120
|
+
message: 'Error creating configuration: ' + response.error?.message,
|
|
121
|
+
});
|
|
72
122
|
}
|
|
73
123
|
this.nylasSchedulerConfigStore.state.config = response.data;
|
|
74
124
|
this.nylasSchedulerConfigStore.state.configurations = [...this.nylasSchedulerConfigStore.state.configurations, response.data];
|
|
75
|
-
return response
|
|
125
|
+
return dataResponse(response.data);
|
|
76
126
|
}
|
|
77
127
|
async updateConfiguration(configuration) {
|
|
78
|
-
|
|
128
|
+
if (!this.nylasApiRequest) {
|
|
129
|
+
console.warn('Nylas API Request is not initialized');
|
|
130
|
+
return dataResponse(null, {
|
|
131
|
+
message: 'Error updating configuration: Nylas API Request is not initialized',
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
const [response, error] = await this.nylasApiRequest.request({
|
|
79
135
|
method: 'PUT',
|
|
80
136
|
path: `scheduling/configurations/${configuration.id}`,
|
|
81
137
|
body: configuration,
|
|
82
138
|
});
|
|
139
|
+
if (error) {
|
|
140
|
+
return dataResponse(null, {
|
|
141
|
+
message: 'Error updating configuration: ' + error.message,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
83
144
|
if (isNylasErrorResponse(response)) {
|
|
84
|
-
return {
|
|
85
|
-
|
|
86
|
-
};
|
|
145
|
+
return dataResponse(null, {
|
|
146
|
+
message: 'Error updating configuration: ' + response.error?.message,
|
|
147
|
+
});
|
|
87
148
|
}
|
|
88
149
|
this.nylasSchedulerConfigStore.state.config = response.data;
|
|
89
150
|
if (this.nylasSchedulerConfigStore.state.configurations.find(c => c.id === configuration.id)) {
|
|
@@ -92,7 +153,34 @@ export class NylasSchedulerConfigAPIConnector {
|
|
|
92
153
|
else {
|
|
93
154
|
this.nylasSchedulerConfigStore.state.configurations = [...this.nylasSchedulerConfigStore.state.configurations, response.data];
|
|
94
155
|
}
|
|
95
|
-
return response
|
|
156
|
+
return dataResponse(response.data);
|
|
157
|
+
}
|
|
158
|
+
async deleteConfiguration(configurationId) {
|
|
159
|
+
if (!this.nylasApiRequest) {
|
|
160
|
+
console.warn('Nylas API Request is not initialized');
|
|
161
|
+
return dataResponse(null, {
|
|
162
|
+
message: 'Error deleting configuration: Nylas API Request is not initialized',
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
const [response, error] = await this.nylasApiRequest.request({
|
|
166
|
+
method: 'DELETE',
|
|
167
|
+
path: `scheduling/configurations/${configurationId}`,
|
|
168
|
+
});
|
|
169
|
+
if (error) {
|
|
170
|
+
return dataResponse(null, {
|
|
171
|
+
message: 'Error deleting configuration: ' + error.message,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
if (isNylasErrorResponse(response)) {
|
|
175
|
+
return dataResponse(null, {
|
|
176
|
+
message: 'Error deleting configuration: ' + response.error?.message,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
this.nylasSchedulerConfigStore.state.configurations = this.nylasSchedulerConfigStore.state.configurations.filter(c => c.id !== configurationId);
|
|
180
|
+
if (this.nylasSchedulerConfigStore.state.config?.id === configurationId) {
|
|
181
|
+
this.nylasSchedulerConfigStore.state.config = {};
|
|
182
|
+
}
|
|
183
|
+
return dataResponse(response.data);
|
|
96
184
|
}
|
|
97
185
|
}
|
|
98
186
|
//# sourceMappingURL=scheduler-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduler-config.js","sourceRoot":"","sources":["../../../../src/connector/shared/api/scheduler-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAA8D,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAO/G,MAAM,OAAO,gCAAgC;IAI3C,YAAY,EAAE,eAAe,EAAE,yBAAyB,EAA2C;QACjG,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,yBAAyB,GAAG,yBAAyB,CAAC;IAC7D,CAAC;IAEM,KAAK,CAAC,WAAW;QACtB,OAAO,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC;IAC5C,CAAC;IAEM,KAAK,CAAC,YAAY;QACvB,MAA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,CAAC,EAAE,KAAK,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACtK,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC,cAAc,GAAG,CAAC,GAAG,IAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC,cAAc,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QAChI,CAAC;QAED,OAAO,QAAQ,EAAE,IAAI,CAAC;IACxB,CAAC;CACF","sourcesContent":["import { NylasApiRequest } from '@/common/nylas-api-request';\nimport { NylasSchedulerConfigStoreType } from '@/stores/scheduler-config-store';\nimport { Calendar, Configuration, NylasErrorResponse, NylasResponse, isNylasErrorResponse } from '@nylas/core';\n\ntype NylasSchedulerConfigAPIConnectorOptions = {\n nylasApiRequest: NylasApiRequest;\n nylasSchedulerConfigStore: NylasSchedulerConfigStoreType;\n};\n\nexport class NylasSchedulerConfigAPIConnector {\n private nylasApiRequest: NylasApiRequest;\n private nylasSchedulerConfigStore: NylasSchedulerConfigStoreType;\n\n constructor({ nylasApiRequest, nylasSchedulerConfigStore }: NylasSchedulerConfigAPIConnectorOptions) {\n this.nylasApiRequest = nylasApiRequest;\n this.nylasSchedulerConfigStore = nylasSchedulerConfigStore;\n }\n\n public async currentUser() {\n return this.nylasApiRequest.currentUser();\n }\n\n public async getCalendars() {\n const response = await this.nylasApiRequest.request<NylasResponse<Calendar[]>>({\n method: 'GET',\n path: `calendars`,\n });\n\n if (isNylasErrorResponse(response)) {\n return {\n error: 'Error fetching calendars: ' + response.error?.message,\n } as NylasErrorResponse;\n }\n\n // Set the new calendars as the current calendars\n this.nylasSchedulerConfigStore.state.calendars = response.data;\n\n return response?.data;\n }\n\n public async getConfigurationById(configurationId: string, forceFetch: boolean = false) {\n // If the configuration is already in the store, return it\n if (!forceFetch) {\n const existingConfig = this.nylasSchedulerConfigStore.state.configurations.find(c => c.id === configurationId);\n if (existingConfig) {\n this.nylasSchedulerConfigStore.state.config = existingConfig;\n return existingConfig;\n }\n }\n\n const response = await this.nylasApiRequest.request<NylasResponse<Configuration>>({\n method: 'GET',\n path: `scheduling/configurations/${configurationId}`,\n });\n\n if (isNylasErrorResponse(response)) {\n return {\n error: 'Error fetching configuration: ' + response.error?.message,\n } as NylasErrorResponse;\n }\n\n // Set the new configuration as the current configuration\n this.nylasSchedulerConfigStore.state.config = response.data;\n\n // If the configuration was updated, update the list of configurations\n // If it doesn't exist, add it to the list\n if (this.nylasSchedulerConfigStore.state.configurations.find(c => c.id === configurationId)) {\n this.nylasSchedulerConfigStore.state.configurations = this.nylasSchedulerConfigStore.state.configurations.map(c => (c.id === configurationId ? response.data : c));\n } else {\n this.nylasSchedulerConfigStore.state.configurations = [...this.nylasSchedulerConfigStore.state.configurations, response.data];\n }\n\n return response?.data;\n }\n\n public async getConfigurations() {\n const response = await this.nylasApiRequest.request<NylasResponse<Configuration[]>>({\n method: 'GET',\n path: `scheduling/configurations`,\n });\n\n if (isNylasErrorResponse(response)) {\n return {\n error: 'Error fetching configurations: ' + response.error?.message,\n } as NylasErrorResponse;\n }\n\n // Set the new configuration as the current configuration\n this.nylasSchedulerConfigStore.state.configurations = response.data;\n\n return response?.data;\n }\n\n public async createConfiguration(configuration: Omit<Partial<Configuration>, 'id'>) {\n const response = await this.nylasApiRequest.request<NylasResponse<Configuration>>({\n method: 'POST',\n path: `scheduling/configurations`,\n body: configuration,\n });\n\n if (isNylasErrorResponse(response)) {\n return {\n error: 'Error creating configuration: ' + response.error?.message,\n } as NylasErrorResponse;\n }\n\n // Set the new configuration as the current configuration\n this.nylasSchedulerConfigStore.state.config = response.data;\n\n // Add the new configuration to the list of configurations\n this.nylasSchedulerConfigStore.state.configurations = [...this.nylasSchedulerConfigStore.state.configurations, response.data];\n\n return response?.data;\n }\n\n public async updateConfiguration(configuration: Partial<Configuration>) {\n const response = await this.nylasApiRequest.request<NylasResponse<Configuration>>({\n method: 'PUT',\n path: `scheduling/configurations/${configuration.id}`,\n body: configuration,\n });\n\n if (isNylasErrorResponse(response)) {\n return {\n error: 'Error updating configuration: ' + response.error?.message,\n } as NylasErrorResponse;\n }\n\n // Set the new configuration as the current configuration\n this.nylasSchedulerConfigStore.state.config = response.data;\n\n // If the configuration was updated, update the list of configurations\n // If it doesn't exist, add it to the list\n if (this.nylasSchedulerConfigStore.state.configurations.find(c => c.id === configuration.id)) {\n this.nylasSchedulerConfigStore.state.configurations = this.nylasSchedulerConfigStore.state.configurations.map(c => (c.id === configuration.id ? response.data : c));\n } else {\n this.nylasSchedulerConfigStore.state.configurations = [...this.nylasSchedulerConfigStore.state.configurations, response.data];\n }\n\n return response?.data;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"scheduler-config.js","sourceRoot":"","sources":["../../../../src/connector/shared/api/scheduler-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAA0C,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAW3F,MAAM,OAAO,gCAAgC;IAI3C,YAAY,EAAE,eAAe,EAAE,yBAAyB,EAA2C;QACjG,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,yBAAyB,GAAG,yBAAyB,CAAC;IAC7D,CAAC;IAMM,KAAK,CAAC,WAAW;QACtB,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YAC1B,OAAO,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;YACrD,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC;IAC5C,CAAC;IAMM,KAAK,CAAC,YAAY;QACvB,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YAC1B,OAAO,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;YACrD,OAAO,YAAY,CAAC,IAAI,EAAE;gBACxB,OAAO,EA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I,CAAC,sCAAsC,CAAC,CAAC;YACrD,OAAO,YAAY,CAAC,IAAI,EAAE;gBACxB,OAAO,EAAE,oEAAoE;aAC9E,CAAC,CAAC;QACL,CAAC;QAED,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAA+B;YACzF,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,6BAA6B,eAAe,EAAE;SACrD,CAAC,CAAC;QAEH,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,YAAY,CAAC,IAAI,EAAE;gBACxB,OAAO,EAAE,gCAAgC,GAAG,KAAK,CAAC,OAAO;aAC1D,CAAC,CAAC;QACL,CAAC;QAED,IAAI,oBAAoB,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,OAAO,YAAY,CAAC,IAAI,EAAE;gBACxB,OAAO,EAAE,gCAAgC,GAAG,QAAQ,CAAC,KAAK,EAAE,OAAO;aACpE,CAAC,CAAC;QACL,CAAC;QAGD,IAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,eAAe,CAAC,CAAC;QAGhJ,IAAI,IAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,KAAK,eAAe,EAAE,CAAC;YACxE,IAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC;QACnD,CAAC;QAED,OAAO,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;CACF","sourcesContent":["import { NylasApiRequest } from '@/common/nylas-api-request';\nimport { NylasSchedulerConfigStoreType } from '@/stores/scheduler-config-store';\nimport { dataResponse } from '@/utils/utils';\nimport { Calendar, Configuration, NylasResponse, isNylasErrorResponse } from '@nylas/core';\n\ntype NylasSchedulerConfigAPIConnectorOptions = {\n nylasApiRequest?: NylasApiRequest;\n nylasSchedulerConfigStore: NylasSchedulerConfigStoreType;\n};\n\n/**\n * Nylas Scheduler Config API Connector\n * This class is responsible for making API requests to the Nylas API for Scheduler Configurations.\n */\nexport class NylasSchedulerConfigAPIConnector {\n private nylasApiRequest?: NylasApiRequest;\n private nylasSchedulerConfigStore: NylasSchedulerConfigStoreType;\n\n constructor({ nylasApiRequest, nylasSchedulerConfigStore }: NylasSchedulerConfigAPIConnectorOptions) {\n this.nylasApiRequest = nylasApiRequest;\n this.nylasSchedulerConfigStore = nylasSchedulerConfigStore;\n }\n\n /**\n * Get the current user.\n * @returns The current user or null if the request is not initialized.\n */\n public async currentUser() {\n if (!this.nylasApiRequest) {\n console.warn('Nylas API Request is not initialized');\n return null;\n }\n\n return this.nylasApiRequest.currentUser();\n }\n\n /**\n * Get the current user's calendars.\n * @returns The current user's calendars or an error if the request is not initialized.\n */\n public async getCalendars() {\n if (!this.nylasApiRequest) {\n console.warn('Nylas API Request is not initialized');\n return dataResponse(null, {\n message: 'Error fetching calendars: Nylas API Request is not initialized',\n });\n }\n\n const [response, error] = await this.nylasApiRequest.request<NylasResponse<Calendar[]>>({\n method: 'GET',\n path: `calendars`,\n });\n\n if (error) {\n return dataResponse(null, {\n message: 'Error fetching calendars: ' + error.message,\n });\n }\n\n if (isNylasErrorResponse(response)) {\n return dataResponse(null, {\n message: 'Error fetching calendars: ' + response.error?.message,\n });\n }\n\n // Set the new calendars as the current calendars\n this.nylasSchedulerConfigStore.state.calendars = response.data;\n\n return dataResponse(response.data);\n }\n\n /**\n * Get a configuration by its ID.\n * @param configurationId The ID of the configuration to fetch.\n */\n public async getConfigurationById(configurationId: string, forceFetch: boolean = false) {\n if (!this.nylasApiRequest) {\n console.warn('Nylas API Request is not initialized');\n return dataResponse(null, {\n message: 'Error fetching configuration: Nylas API Request is not initialized',\n });\n }\n\n // If the configuration is already in the store, return it\n if (!forceFetch) {\n const existingConfig = this.nylasSchedulerConfigStore.state.configurations.find(c => c.id === configurationId);\n if (existingConfig) {\n this.nylasSchedulerConfigStore.state.config = existingConfig;\n return dataResponse(existingConfig);\n }\n }\n\n const [response, error] = await this.nylasApiRequest.request<NylasResponse<Configuration>>({\n method: 'GET',\n path: `scheduling/configurations/${configurationId}`,\n });\n\n if (error) {\n return dataResponse(null, {\n message: 'Error fetching configuration: ' + error.message,\n });\n }\n\n if (isNylasErrorResponse(response)) {\n return dataResponse(null, {\n message: 'Error fetching configuration: ' + response.error?.message,\n });\n }\n\n // Set the new configuration as the current configuration\n this.nylasSchedulerConfigStore.state.config = response.data;\n\n // If the configuration was updated, update the list of configurations\n // If it doesn't exist, add it to the list\n if (this.nylasSchedulerConfigStore.state.configurations.find(c => c.id === configurationId)) {\n this.nylasSchedulerConfigStore.state.configurations = this.nylasSchedulerConfigStore.state.configurations.map(c => (c.id === configurationId ? response.data : c));\n } else {\n this.nylasSchedulerConfigStore.state.configurations = [...this.nylasSchedulerConfigStore.state.configurations, response.data];\n }\n\n return dataResponse(response.data);\n }\n\n /**\n * Get all configurations.\n * @returns The list of configurations or an error if the request is not initialized.\n */\n public async getConfigurations() {\n if (!this.nylasApiRequest) {\n console.warn('Nylas API Request is not initialized');\n return dataResponse(null, {\n message: 'Error fetching configurations: Nylas API Request is not initialized',\n });\n }\n\n const [response, error] = await this.nylasApiRequest.request<NylasResponse<Configuration[]>>({\n method: 'GET',\n path: `scheduling/configurations`,\n });\n\n if (error) {\n return dataResponse(null, {\n message: 'Error fetching configurations: ' + error.message,\n });\n }\n\n if (isNylasErrorResponse(response)) {\n return dataResponse(null, {\n message: 'Error fetching configurations: ' + response.error?.message,\n });\n }\n\n // Set the new configuration as the current configuration\n this.nylasSchedulerConfigStore.state.configurations = response.data;\n\n return dataResponse(response.data);\n }\n\n /**\n * Create a new configuration.\n * @param configuration The configuration to create.\n * @returns The new configuration or an error if the request is not initialized.\n */\n public async createConfiguration(configuration: Omit<Partial<Configuration>, 'id'>) {\n if (!this.nylasApiRequest) {\n console.warn('Nylas API Request is not initialized');\n return dataResponse(null, {\n message: 'Error creating configuration: Nylas API Request is not initialized',\n });\n }\n\n // Set the default require_session_auth based on the state value\n configuration.requires_session_auth = this.nylasSchedulerConfigStore.state.defaultRequiresSessionAuth;\n\n const [response, error] = await this.nylasApiRequest.request<NylasResponse<Configuration>>({\n method: 'POST',\n path: `scheduling/configurations`,\n body: configuration,\n });\n\n if (error) {\n return dataResponse(null, {\n message: 'Error creating configuration: ' + error.message,\n });\n }\n\n if (isNylasErrorResponse(response)) {\n return dataResponse(null, {\n message: 'Error creating configuration: ' + response.error?.message,\n });\n }\n\n // Set the new configuration as the current configuration\n this.nylasSchedulerConfigStore.state.config = response.data;\n\n // Add the new configuration to the list of configurations\n this.nylasSchedulerConfigStore.state.configurations = [...this.nylasSchedulerConfigStore.state.configurations, response.data];\n\n return dataResponse(response.data);\n }\n\n /**\n * Update an existing configuration.\n * @param configuration The configuration to update.\n * @returns The updated configuration or an error if the request is not initialized.\n */\n public async updateConfiguration(configuration: Partial<Configuration>) {\n if (!this.nylasApiRequest) {\n console.warn('Nylas API Request is not initialized');\n return dataResponse(null, {\n message: 'Error updating configuration: Nylas API Request is not initialized',\n });\n }\n\n const [response, error] = await this.nylasApiRequest.request<NylasResponse<Configuration>>({\n method: 'PUT',\n path: `scheduling/configurations/${configuration.id}`,\n body: configuration,\n });\n\n if (error) {\n return dataResponse(null, {\n message: 'Error updating configuration: ' + error.message,\n });\n }\n\n if (isNylasErrorResponse(response)) {\n return dataResponse(null, {\n message: 'Error updating configuration: ' + response.error?.message,\n });\n }\n\n // Set the new configuration as the current configuration\n this.nylasSchedulerConfigStore.state.config = response.data;\n\n // If the configuration was updated, update the list of configurations\n // If it doesn't exist, add it to the list\n if (this.nylasSchedulerConfigStore.state.configurations.find(c => c.id === configuration.id)) {\n this.nylasSchedulerConfigStore.state.configurations = this.nylasSchedulerConfigStore.state.configurations.map(c => (c.id === configuration.id ? response.data : c));\n } else {\n this.nylasSchedulerConfigStore.state.configurations = [...this.nylasSchedulerConfigStore.state.configurations, response.data];\n }\n\n return dataResponse(response.data);\n }\n\n /**\n * Delete a configuration by its ID.\n * @param configurationId The ID of the configuration to delete.\n * @returns The deleted configuration or an error if the request is not initialized.\n */\n public async deleteConfiguration(configurationId: string) {\n if (!this.nylasApiRequest) {\n console.warn('Nylas API Request is not initialized');\n return dataResponse(null, {\n message: 'Error deleting configuration: Nylas API Request is not initialized',\n });\n }\n\n const [response, error] = await this.nylasApiRequest.request<NylasResponse<Configuration>>({\n method: 'DELETE',\n path: `scheduling/configurations/${configurationId}`,\n });\n\n if (error) {\n return dataResponse(null, {\n message: 'Error deleting configuration: ' + error.message,\n });\n }\n\n if (isNylasErrorResponse(response)) {\n return dataResponse(null, {\n message: 'Error deleting configuration: ' + response.error?.message,\n });\n }\n\n // Remove the configuration from the list\n this.nylasSchedulerConfigStore.state.configurations = this.nylasSchedulerConfigStore.state.configurations.filter(c => c.id !== configurationId);\n\n // If the deleted configuration was the current configuration, reset it\n if (this.nylasSchedulerConfigStore.state.config?.id === configurationId) {\n this.nylasSchedulerConfigStore.state.config = {};\n }\n\n return dataResponse(response.data);\n }\n}\n"]}
|