@nylas/web-elements 1.1.0-canary.4 → 1.1.0-canary.7
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 +224 -94
- package/dist/cjs/add-circle-icon_22.cjs.entry.js.map +1 -1
- 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 +2 -2
- package/dist/cjs/button-component.cjs.entry.js.map +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/{constants-6baf1f1d.js → constants-3e962931.js} +11 -1
- package/dist/cjs/{constants-6baf1f1d.js.map → constants-3e962931.js.map} +1 -1
- package/dist/cjs/{constants-0fba94a4.js → constants-d590922e.js} +11 -1
- package/dist/cjs/{constants-0fba94a4.js.map → constants-d590922e.js.map} +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_4.cjs.entry.js +467 -0
- 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 +1 -158
- package/dist/cjs/index-c14ea8f5.js +1 -358
- 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-27c25287.js +60 -0
- package/dist/cjs/nylas-api-request-27c25287.js.map +1 -0
- package/dist/cjs/nylas-api-request-abdb8dd8.js +58 -0
- package/dist/cjs/nylas-api-request-abdb8dd8.js.map +1 -0
- package/dist/cjs/nylas-availability-picker.cjs.entry.js +33 -16
- package/dist/cjs/nylas-availability-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-booked-event-card.cjs.entry.js +3 -3
- package/dist/cjs/nylas-booked-event-card_10.cjs.entry.js +7 -7
- package/dist/cjs/nylas-booking-calendar-picker.cjs.entry.js +12 -6
- package/dist/cjs/nylas-booking-calendar-picker.cjs.entry.js.map +1 -1
- 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 +13 -8
- package/dist/cjs/nylas-calendar-picker.cjs.entry.js.map +1 -1
- 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 +21 -12
- package/dist/cjs/nylas-custom-booking-flow.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-date-picker.cjs.entry.js +2 -2
- package/dist/cjs/nylas-editor-tabs.cjs.entry.js +85 -39
- package/dist/cjs/nylas-editor-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-event-description.cjs.entry.js +15 -6
- package/dist/cjs/nylas-event-description.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-event-duration.cjs.entry.js +15 -10
- package/dist/cjs/nylas-event-duration.cjs.entry.js.map +1 -1
- 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 +52 -12
- package/dist/cjs/nylas-event-title.cjs.entry.js.map +1 -1
- 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 +24 -11
- package/dist/cjs/nylas-limit-future-bookings.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-list-configurations.cjs.entry.js +129 -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 +3 -3
- package/dist/cjs/nylas-location-component.cjs.entry.js +17 -6
- package/dist/cjs/nylas-location-component.cjs.entry.js.map +1 -1
- 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 +28 -13
- package/dist/cjs/nylas-min-cancellation-notice.cjs.entry.js.map +1 -1
- 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 +201 -75
- 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 +3 -3
- 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-37690bf0.js +32 -0
- package/dist/cjs/scheduler-config-store-37690bf0.js.map +1 -0
- package/dist/cjs/scheduler-config-store-529c8d7e.js +32 -0
- package/dist/cjs/scheduler-config-store-529c8d7e.js.map +1 -0
- package/dist/cjs/{scheduler-store-7320f5d0.js → scheduler-store-0081970d.js} +16 -3
- package/dist/cjs/scheduler-store-0081970d.js.map +1 -0
- package/dist/cjs/{scheduler-store-4cb46b3c.js → scheduler-store-67dc1986.js} +16 -3
- package/dist/cjs/scheduler-store-67dc1986.js.map +1 -0
- 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/constants.js +9 -0
- package/dist/collection/common/constants.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 +27 -7
- 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.css +5 -0
- 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 +2 -2
- package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js.map +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-availability-picker/nylas-availability-picker.js +55 -15
- package/dist/collection/components/scheduler-editor/nylas-availability-picker/nylas-availability-picker.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-booking-calendar-picker/nylas-booking-calendar-picker.js +32 -5
- package/dist/collection/components/scheduler-editor/nylas-booking-calendar-picker/nylas-booking-calendar-picker.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-calendar-picker/nylas-calendar-picker.js +23 -14
- package/dist/collection/components/scheduler-editor/nylas-calendar-picker/nylas-calendar-picker.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-custom-booking-flow/nylas-custom-booking-flow.js +41 -9
- package/dist/collection/components/scheduler-editor/nylas-custom-booking-flow/nylas-custom-booking-flow.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.css +48 -9
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js +167 -36
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/tab-contents.js +4 -4
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/tab-contents.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-event-description/nylas-event-description.css +1 -1
- package/dist/collection/components/scheduler-editor/nylas-event-description/nylas-event-description.js +34 -2
- package/dist/collection/components/scheduler-editor/nylas-event-description/nylas-event-description.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-event-duration/nylas-event-duration.css +1 -1
- package/dist/collection/components/scheduler-editor/nylas-event-duration/nylas-event-duration.js +35 -7
- package/dist/collection/components/scheduler-editor/nylas-event-duration/nylas-event-duration.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-event-title/nylas-event-title.css +8 -1
- package/dist/collection/components/scheduler-editor/nylas-event-title/nylas-event-title.js +83 -9
- package/dist/collection/components/scheduler-editor/nylas-event-title/nylas-event-title.js.map +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 +45 -9
- package/dist/collection/components/scheduler-editor/nylas-limit-future-bookings/nylas-limit-future-bookings.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-list-configurations/nylas-list-configurations.css +142 -0
- package/dist/collection/components/scheduler-editor/nylas-list-configurations/nylas-list-configurations.js +330 -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.css +2 -2
- package/dist/collection/components/scheduler-editor/nylas-location-component/nylas-location-component.js +37 -3
- package/dist/collection/components/scheduler-editor/nylas-location-component/nylas-location-component.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-min-cancellation-notice/nylas-min-cancellation-notice.js +49 -11
- package/dist/collection/components/scheduler-editor/nylas-min-cancellation-notice/nylas-min-cancellation-notice.js.map +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 +23 -2
- package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.js +108 -53
- 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/nylas-scheduler-connector/errors/index.js +8 -0
- package/dist/collection/connector/nylas-scheduler-connector/errors/index.js.map +1 -1
- package/dist/collection/connector/shared/api/scheduler-config.js +118 -30
- package/dist/collection/connector/shared/api/scheduler-config.js.map +1 -1
- package/dist/collection/connector/shared/api/scheduler.js +6 -1
- package/dist/collection/connector/shared/api/scheduler.js.map +1 -1
- package/dist/collection/index.js +0 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/stores/scheduler-config-store.js +15 -2
- 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 +2 -3
- 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 +11 -2
- package/dist/components/constants.js.map +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.es.js +8 -3
- package/dist/components/index.es.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 -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 +3 -4
- package/dist/components/multi-select-dropdown2.js.map +1 -1
- package/dist/components/nylas-additional-participants.js +2 -3
- package/dist/components/nylas-additional-participants.js.map +1 -1
- package/dist/components/nylas-api-request.js +28 -7
- package/dist/components/nylas-api-request.js.map +1 -1
- package/dist/components/nylas-availability-picker2.js +33 -15
- package/dist/components/nylas-availability-picker2.js.map +1 -1
- package/dist/components/nylas-booked-event-card2.js +1 -2
- package/dist/components/nylas-booked-event-card2.js.map +1 -1
- package/dist/components/nylas-booking-calendar-picker2.js +12 -6
- package/dist/components/nylas-booking-calendar-picker2.js.map +1 -1
- package/dist/components/nylas-booking-form2.js +1 -2
- package/dist/components/nylas-booking-form2.js.map +1 -1
- package/dist/components/nylas-buffer-time2.js +1 -2
- package/dist/components/nylas-buffer-time2.js.map +1 -1
- package/dist/components/nylas-calendar-picker2.js +13 -9
- package/dist/components/nylas-calendar-picker2.js.map +1 -1
- package/dist/components/nylas-cancel-booking-form2.js +2 -3
- package/dist/components/nylas-cancel-booking-form2.js.map +1 -1
- package/dist/components/nylas-cancelled-event-card2.js +2 -3
- package/dist/components/nylas-cancelled-event-card2.js.map +1 -1
- package/dist/components/nylas-composer2.js +2 -3
- package/dist/components/nylas-composer2.js.map +1 -1
- package/dist/components/nylas-custom-booking-flow2.js +23 -13
- 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 +91 -43
- package/dist/components/nylas-editor-tabs2.js.map +1 -1
- package/dist/components/nylas-event-description2.js +17 -7
- package/dist/components/nylas-event-description2.js.map +1 -1
- package/dist/components/nylas-event-duration2.js +16 -10
- package/dist/components/nylas-event-duration2.js.map +1 -1
- package/dist/components/nylas-event-info2.js +2 -3
- package/dist/components/nylas-event-info2.js.map +1 -1
- package/dist/components/nylas-event-limits2.js +2 -3
- package/dist/components/nylas-event-limits2.js.map +1 -1
- package/dist/components/nylas-event-title2.js +56 -14
- package/dist/components/nylas-event-title2.js.map +1 -1
- package/dist/components/nylas-form-card2.js +2 -3
- package/dist/components/nylas-form-card2.js.map +1 -1
- package/dist/components/nylas-if-state.js +1 -2
- package/dist/components/nylas-if-state.js.map +1 -1
- package/dist/components/nylas-limit-future-bookings2.js +25 -11
- 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 +159 -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 +18 -6
- 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 +1 -2
- package/dist/components/nylas-mailbox-pagination.js.map +1 -1
- package/dist/components/nylas-mailbox-toolbar-button.js +2 -3
- package/dist/components/nylas-mailbox-toolbar-button.js.map +1 -1
- package/dist/components/nylas-mailbox.js +2 -3
- package/dist/components/nylas-mailbox.js.map +1 -1
- package/dist/components/nylas-min-cancellation-notice2.js +29 -13
- package/dist/components/nylas-min-cancellation-notice2.js.map +1 -1
- package/dist/components/nylas-notification2.js +2 -3
- package/dist/components/nylas-notification2.js.map +1 -1
- package/dist/components/nylas-provider.js +2 -3
- package/dist/components/nylas-provider.js.map +1 -1
- package/dist/components/nylas-scheduler-editor.js +270 -136
- package/dist/components/nylas-scheduler-editor.js.map +1 -1
- package/dist/components/nylas-scheduling.js +1 -2
- package/dist/components/nylas-scheduling.js.map +1 -1
- package/dist/components/nylas-selected-event-card2.js +1 -2
- 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 +3 -4
- package/dist/components/nylas-threads-refresh.js.map +1 -1
- package/dist/components/nylas-threads-search.js +2 -3
- 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 +15 -2
- package/dist/components/scheduler-config-store.js.map +1 -1
- package/dist/components/scheduler-store.js +15 -2
- package/dist/components/scheduler-store.js.map +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 +2 -3
- 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 +224 -94
- package/dist/esm/add-circle-icon_22.entry.js.map +1 -1
- 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 +2 -2
- package/dist/esm/button-component.entry.js.map +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/{constants-335dffcf.js → constants-bf39e913.js} +11 -2
- package/dist/esm/{constants-335dffcf.js.map → constants-bf39e913.js.map} +1 -1
- package/dist/esm/{constants-6ee60d6d.js → constants-f34b9c6e.js} +11 -2
- package/dist/esm/{constants-6ee60d6d.js.map → constants-f34b9c6e.js.map} +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_4.entry.js +460 -0
- 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 +1 -158
- package/dist/esm/index-8362ce5c.js +1 -358
- 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/esm/{mailbox-store-150cc456.js.map → mailbox-store-47fc8a1a.js.map} +1 -1
- package/dist/esm/{mailbox-store-150cc456.js → mailbox-store-d48269de.js} +3 -3
- package/dist/{nylas-web-elements/mailbox-store-150cc456.js.map → esm/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-8932547a.js +56 -0
- package/dist/esm/nylas-api-request-8932547a.js.map +1 -0
- package/dist/esm/nylas-api-request-b085294d.js +58 -0
- package/dist/esm/nylas-api-request-b085294d.js.map +1 -0
- package/dist/esm/nylas-availability-picker.entry.js +33 -16
- package/dist/esm/nylas-availability-picker.entry.js.map +1 -1
- package/dist/esm/nylas-booked-event-card.entry.js +3 -3
- package/dist/esm/nylas-booked-event-card_10.entry.js +7 -7
- package/dist/esm/nylas-booking-calendar-picker.entry.js +12 -6
- package/dist/esm/nylas-booking-calendar-picker.entry.js.map +1 -1
- 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 +13 -8
- package/dist/esm/nylas-calendar-picker.entry.js.map +1 -1
- 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 +21 -12
- package/dist/esm/nylas-custom-booking-flow.entry.js.map +1 -1
- package/dist/esm/nylas-date-picker.entry.js +2 -2
- package/dist/esm/nylas-editor-tabs.entry.js +86 -40
- package/dist/esm/nylas-editor-tabs.entry.js.map +1 -1
- package/dist/esm/nylas-event-description.entry.js +15 -6
- package/dist/esm/nylas-event-description.entry.js.map +1 -1
- package/dist/esm/nylas-event-duration.entry.js +15 -10
- package/dist/esm/nylas-event-duration.entry.js.map +1 -1
- 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 +52 -12
- package/dist/esm/nylas-event-title.entry.js.map +1 -1
- 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 +24 -11
- package/dist/esm/nylas-limit-future-bookings.entry.js.map +1 -1
- package/dist/esm/nylas-list-configurations.entry.js +125 -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 +3 -3
- package/dist/esm/nylas-location-component.entry.js +17 -6
- package/dist/esm/nylas-location-component.entry.js.map +1 -1
- 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 +28 -13
- package/dist/esm/nylas-min-cancellation-notice.entry.js.map +1 -1
- 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 +202 -76
- 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 +3 -3
- 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-07d98279.js +30 -0
- package/dist/esm/scheduler-config-store-07d98279.js.map +1 -0
- package/dist/esm/scheduler-config-store-8f2e658e.js +30 -0
- package/dist/esm/scheduler-config-store-8f2e658e.js.map +1 -0
- package/dist/{nylas-web-elements/scheduler-store-4d0a4f8a.js → esm/scheduler-store-66c2168c.js} +16 -3
- package/dist/esm/scheduler-store-66c2168c.js.map +1 -0
- package/dist/esm/{scheduler-store-72116723.js → scheduler-store-a175fc3e.js} +16 -3
- package/dist/esm/scheduler-store-a175fc3e.js.map +1 -0
- 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/esm/{utils-3a8d433a.js → 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 +2 -2
- package/dist/nylas-web-elements/button-component.entry.js.map +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/{constants-335dffcf.js → constants-bf39e913.js} +11 -2
- package/dist/nylas-web-elements/{constants-335dffcf.js.map → constants-bf39e913.js.map} +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/nylas-web-elements/nylas-api-request-b085294d.js +58 -0
- package/dist/nylas-web-elements/nylas-api-request-b085294d.js.map +1 -0
- package/dist/nylas-web-elements/nylas-availability-picker.entry.js +33 -16
- package/dist/nylas-web-elements/nylas-availability-picker.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-booked-event-card.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-booking-calendar-picker.entry.js +12 -6
- package/dist/nylas-web-elements/nylas-booking-calendar-picker.entry.js.map +1 -1
- 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 +13 -8
- package/dist/nylas-web-elements/nylas-calendar-picker.entry.js.map +1 -1
- 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 +21 -12
- package/dist/nylas-web-elements/nylas-custom-booking-flow.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-date-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-editor-tabs.entry.js +86 -40
- package/dist/nylas-web-elements/nylas-editor-tabs.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-event-description.entry.js +15 -6
- package/dist/nylas-web-elements/nylas-event-description.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-event-duration.entry.js +15 -10
- package/dist/nylas-web-elements/nylas-event-duration.entry.js.map +1 -1
- 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 +52 -12
- package/dist/nylas-web-elements/nylas-event-title.entry.js.map +1 -1
- 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 +24 -11
- package/dist/nylas-web-elements/nylas-limit-future-bookings.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-list-configurations.entry.js +125 -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 +3 -3
- package/dist/nylas-web-elements/nylas-location-component.entry.js +17 -6
- package/dist/nylas-web-elements/nylas-location-component.entry.js.map +1 -1
- 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 +28 -13
- package/dist/nylas-web-elements/nylas-min-cancellation-notice.entry.js.map +1 -1
- 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 +202 -76
- 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 +3 -3
- 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-00a9efc1.entry.js +2 -0
- package/dist/nylas-web-elements/p-1a91cce5.entry.js +2 -0
- package/dist/nylas-web-elements/p-1a91cce5.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-3631e6e5.entry.js → p-1d25ca06.entry.js} +2 -2
- package/dist/nylas-web-elements/p-1e445e86.entry.js +2 -0
- package/dist/nylas-web-elements/{p-395f49eb.entry.js → p-2081b475.entry.js} +2 -2
- package/dist/nylas-web-elements/p-22e5436c.js +2 -0
- package/dist/nylas-web-elements/p-22e5436c.js.map +1 -0
- package/dist/nylas-web-elements/p-2b636359.entry.js +2 -0
- package/dist/nylas-web-elements/p-2b636359.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-4ee6f11e.entry.js → p-30784693.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-40ed7eab.entry.js → p-33b940fb.entry.js} +2 -2
- package/dist/nylas-web-elements/p-343a02e1.entry.js +2 -0
- package/dist/nylas-web-elements/{p-4d9fceeb.entry.js → p-343b8684.entry.js} +2 -2
- package/dist/nylas-web-elements/p-3909ec3f.entry.js +2 -0
- package/dist/nylas-web-elements/{p-d85eecf4.entry.js.map → p-3909ec3f.entry.js.map} +1 -1
- package/dist/nylas-web-elements/{p-409d4410.entry.js → p-3b281401.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-5a3809a7.entry.js → p-42791515.entry.js} +2 -2
- package/dist/nylas-web-elements/p-44a9ce77.entry.js +2 -0
- package/dist/nylas-web-elements/{p-1819b3d7.js → p-49f716ed.js} +4 -4
- package/dist/nylas-web-elements/p-49f716ed.js.map +1 -0
- package/dist/nylas-web-elements/{p-b2208193.entry.js → p-50b4a80f.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-42a4c2fd.entry.js → p-571472d4.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-2523c292.entry.js → p-607b547b.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-006ab406.entry.js → p-6110351b.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-65062d50.entry.js → p-665ef10b.entry.js} +4 -4
- package/dist/nylas-web-elements/p-665ef10b.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-deafc6bc.entry.js → p-694b511a.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-64364434.entry.js → p-73c062f8.entry.js} +2 -2
- package/dist/nylas-web-elements/p-75a8d077.entry.js +2 -0
- package/dist/nylas-web-elements/{p-41c1654e.entry.js.map → p-75a8d077.entry.js.map} +1 -1
- 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-3da66838.entry.js → p-80d6175c.entry.js} +2 -2
- package/dist/nylas-web-elements/p-939db546.entry.js +2 -0
- package/dist/nylas-web-elements/{p-a1e27dc5.entry.js → p-95a3094a.entry.js} +2 -2
- 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-a628eaeb.js +2 -0
- package/dist/nylas-web-elements/p-a628eaeb.js.map +1 -0
- package/dist/nylas-web-elements/p-ad64c2b8.entry.js +2 -0
- package/dist/nylas-web-elements/{p-baa620b4.entry.js → p-b25821e1.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-374527e6.entry.js → p-b53062f7.entry.js} +2 -2
- package/dist/nylas-web-elements/p-bbf9aff2.entry.js +2 -0
- package/dist/nylas-web-elements/p-c20ab972.entry.js +2 -0
- package/dist/nylas-web-elements/{p-7b1bb792.entry.js → p-cc674b3b.entry.js} +3 -3
- package/dist/nylas-web-elements/p-d8f09631.entry.js +2 -0
- package/dist/nylas-web-elements/p-db15d382.js +2 -0
- package/dist/nylas-web-elements/p-db15d382.js.map +1 -0
- package/dist/nylas-web-elements/{p-9dac153b.entry.js → p-df6d54c7.entry.js} +2 -2
- 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-ad9c3cab.entry.js → p-f154a362.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-ae01e1cb.entry.js → p-f1f8f745.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-8f2e658e.js +30 -0
- package/dist/nylas-web-elements/scheduler-config-store-8f2e658e.js.map +1 -0
- package/dist/{esm/scheduler-store-4d0a4f8a.js → nylas-web-elements/scheduler-store-66c2168c.js} +16 -3
- package/dist/nylas-web-elements/scheduler-store-66c2168c.js.map +1 -0
- 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/nylas-web-elements/{utils-3a8d433a.js → 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/constants.d.ts +2 -0
- package/dist/types/common/nylas-api-request.d.ts +6 -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-availability-picker/nylas-availability-picker.d.ts +10 -4
- package/dist/types/components/scheduler-editor/nylas-booking-calendar-picker/nylas-booking-calendar-picker.d.ts +2 -0
- package/dist/types/components/scheduler-editor/nylas-calendar-picker/nylas-calendar-picker.d.ts +3 -2
- package/dist/types/components/scheduler-editor/nylas-custom-booking-flow/nylas-custom-booking-flow.d.ts +4 -1
- package/dist/types/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.d.ts +41 -7
- package/dist/types/components/scheduler-editor/nylas-event-description/nylas-event-description.d.ts +3 -0
- package/dist/types/components/scheduler-editor/nylas-event-duration/nylas-event-duration.d.ts +3 -0
- package/dist/types/components/scheduler-editor/nylas-event-title/nylas-event-title.d.ts +6 -1
- package/dist/types/components/scheduler-editor/nylas-limit-future-bookings/nylas-limit-future-bookings.d.ts +6 -6
- package/dist/types/components/scheduler-editor/nylas-list-configurations/nylas-list-configurations.d.ts +27 -0
- package/dist/types/components/scheduler-editor/nylas-location-component/nylas-location-component.d.ts +3 -0
- package/dist/types/components/scheduler-editor/nylas-min-cancellation-notice/nylas-min-cancellation-notice.d.ts +4 -1
- 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 +9 -4
- package/dist/types/components.d.ts +229 -18
- package/dist/types/connector/nylas-connector/index.d.ts +1 -1
- package/dist/types/connector/nylas-scheduler-config-connector/index.d.ts +3 -3
- package/dist/types/connector/nylas-scheduler-connector/errors/index.d.ts +1 -0
- package/dist/types/connector/shared/api/scheduler-config.d.ts +45 -8
- package/dist/types/index.d.ts +1 -1
- package/dist/types/stores/scheduler-config-store.d.ts +8 -2
- package/dist/types/utils/utils.d.ts +4 -1
- package/package.json +4 -3
- package/dist/cjs/google-logo-icon_3.cjs.entry.js +0 -302
- 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 +0 -39
- package/dist/cjs/nylas-api-request-8ec3a89c.js.map +0 -1
- package/dist/cjs/nylas-api-request-ab24150d.js +0 -37
- 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 +0 -19
- package/dist/cjs/scheduler-config-store-31b83ad3.js.map +0 -1
- package/dist/cjs/scheduler-config-store-9c2cc421.js +0 -19
- package/dist/cjs/scheduler-config-store-9c2cc421.js.map +0 -1
- package/dist/cjs/scheduler-store-4cb46b3c.js.map +0 -1
- package/dist/cjs/scheduler-store-7320f5d0.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/esm/google-logo-icon_3.entry.js +0 -296
- 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 +0 -37
- package/dist/esm/nylas-api-request-55446aba.js.map +0 -1
- package/dist/esm/nylas-api-request-c97a0153.js +0 -35
- 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 +0 -17
- package/dist/esm/scheduler-config-store-51ee4f42.js.map +0 -1
- package/dist/esm/scheduler-config-store-bc59545b.js +0 -17
- package/dist/esm/scheduler-config-store-bc59545b.js.map +0 -1
- package/dist/esm/scheduler-store-4d0a4f8a.js.map +0 -1
- package/dist/esm/scheduler-store-72116723.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 +0 -37
- 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-1819b3d7.js.map +0 -1
- package/dist/nylas-web-elements/p-2c5d5953.entry.js +0 -2
- package/dist/nylas-web-elements/p-39b280e2.entry.js +0 -2
- package/dist/nylas-web-elements/p-39b280e2.entry.js.map +0 -1
- 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-a0c2ce03.entry.js +0 -2
- 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-d92a0405.entry.js +0 -2
- package/dist/nylas-web-elements/p-de63bc35.entry.js +0 -2
- package/dist/nylas-web-elements/p-df5e9aaf.js +0 -2
- package/dist/nylas-web-elements/p-df5e9aaf.js.map +0 -1
- 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/p-f48d0571.entry.js +0 -2
- package/dist/nylas-web-elements/p-fbbca7a6.entry.js +0 -2
- package/dist/nylas-web-elements/register-component-0645dce0.js.map +0 -1
- package/dist/nylas-web-elements/scheduler-config-store-bc59545b.js +0 -17
- package/dist/nylas-web-elements/scheduler-config-store-bc59545b.js.map +0 -1
- package/dist/nylas-web-elements/scheduler-store-4d0a4f8a.js.map +0 -1
- /package/dist/nylas-web-elements/{p-de63bc35.entry.js.map → p-00a9efc1.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-3631e6e5.entry.js.map → p-1d25ca06.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-bfdc148c.entry.js.map → p-1e445e86.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-395f49eb.entry.js.map → p-2081b475.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-4ee6f11e.entry.js.map → p-30784693.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-40ed7eab.entry.js.map → p-33b940fb.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-d92a0405.entry.js.map → p-343a02e1.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-4d9fceeb.entry.js.map → p-343b8684.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-409d4410.entry.js.map → p-3b281401.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-5a3809a7.entry.js.map → p-42791515.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-a0c2ce03.entry.js.map → p-44a9ce77.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-b2208193.entry.js.map → p-50b4a80f.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-42a4c2fd.entry.js.map → p-571472d4.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-2523c292.entry.js.map → p-607b547b.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-006ab406.entry.js.map → p-6110351b.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-deafc6bc.entry.js.map → p-694b511a.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-64364434.entry.js.map → p-73c062f8.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-3da66838.entry.js.map → p-80d6175c.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-01bf65c2.entry.js.map → p-939db546.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-a1e27dc5.entry.js.map → p-95a3094a.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-f48d0571.entry.js.map → p-ad64c2b8.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-baa620b4.entry.js.map → p-b25821e1.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-374527e6.entry.js.map → p-b53062f7.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-2c5d5953.entry.js.map → p-bbf9aff2.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-a3d5a1dd.entry.js.map → p-c20ab972.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-7b1bb792.entry.js.map → p-cc674b3b.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-fbbca7a6.entry.js.map → p-d8f09631.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-9dac153b.entry.js.map → p-df6d54c7.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-ad9c3cab.entry.js.map → p-f154a362.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-ae01e1cb.entry.js.map → p-f1f8f745.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/connector/nylas-scheduler-connector/errors/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,wCAAuB,CAAA;IACvB,4BAAW,CAAA;IACX,8BAAa,CAAA;AACf,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AAQD,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/connector/nylas-scheduler-connector/errors/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,wCAAuB,CAAA;IACvB,4BAAW,CAAA;IACX,8BAAa,CAAA;AACf,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AAQD,MAAM,CAAN,IAAY,kBASX;AATD,WAAY,kBAAkB;IAC5B,qEAA+C,CAAA;IAC/C,yDAAmC,CAAA;IACnC,mEAA6C,CAAA;IAC7C,mEAA6C,CAAA;IAC7C,qDAA+B,CAAA;IAC/B,+DAAyC,CAAA;IACzC,2DAAqC,CAAA;IACrC,2DAAqC,CAAA;AACvC,CAAC,EATW,kBAAkB,KAAlB,kBAAkB,QAS7B;AAED,MAAM,CAAN,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,mDAAmC,CAAA;IACnC,+CAA+B,CAAA;IAC/B,iDAAiC,CAAA;IACjC,+DAA+C,CAAA;IAC/C,iEAAiD,CAAA;AACnD,CAAC,EANW,YAAY,KAAZ,YAAY,QAMvB;AAED,MAAM,OAAO,MAAM;IAAnB;QACE,cAAS,GAAG,CAAC,MAAc,EAAkE,EAAE;YAC7F,MAAM,QAAQ,GAAG,aAAa,CAAC,SAAS,CAAC;YACzC,MAAM,KAAK,GAAG,GAAG,MAAM,QAAQ,CAAC;YAChC,OAAO;gBACL,qBAAqB,EAAE,CAAC,UAAkB,oCAAoC,EAAE,EAAE;oBAChF,OAAO;wBACL,KAAK;wBACL,OAAO;wBACP,QAAQ;qBACT,CAAC;gBACJ,CAAC;gBACD,eAAe,EAAE,C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oBACjC,OAAO;wBACL,KAAK;wBACL,OAAO;wBACP,QAAQ;qBACT,CAAC;gBACJ,CAAC;gBACD,cAAc,EAAE,CAAC,OAAe,EAAE,EAAE;oBAClC,OAAO;wBACL,KAAK;wBACL,OAAO;wBACP,QAAQ;qBACT,CAAC;gBACJ,CAAC;gBACD,qBAAqB,EAAE,CAAC,OAAe,EAAE,EAAE;oBACzC,OAAO;wBACL,KAAK;wBACL,OAAO;wBACP,QAAQ;qBACT,CAAC;gBACJ,CAAC;gBACD,sBAAsB,EAAE,CAAC,OAAe,EAAE,EAAE;oBAC1C,OAAO;wBACL,KAAK;wBACL,OAAO;wBACP,QAAQ;qBACT,CAAC;gBACJ,CAAC;aACF,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;CAAA","sourcesContent":["export enum ErrorCategory {\n Component = 'component',\n Api = 'api',\n Auth = 'auth',\n}\n\nexport interface ErrorDetails {\n title: string;\n message: string;\n category: ErrorCategory;\n}\n\nexport enum ComponentErrorType {\n endtime_not_in_future = 'endtime_not_in_future',\n no_booking_info = 'no_booking_info',\n no_timeslot_selected = 'no_timeslot_selected',\n no_timezone_selected = 'no_timezone_selected',\n no_booking_id = 'no_booking_id',\n invalid_start_time = 'invalid_start_time',\n invalid_end_time = 'invalid_end_time',\n invalid_timezone = 'invalid_timezone',\n}\n\nexport enum APIErrorType {\n invalid_session = 'invalid_session',\n general_error = 'general_error',\n internal_error = 'internal_error',\n invalid_request_error = 'invalid_request_error',\n timeslot_not_available = 'timeslot_not_available',\n}\n\nexport class Errors {\n component = (_title: string): Record<ComponentErrorType, (message?: string) => ErrorDetails> => {\n const category = ErrorCategory.Component;\n const title = `${_title} error`;\n return {\n endtime_not_in_future: (message: string = '\"endtime\" can not be in the future') => {\n return {\n title,\n message,\n category,\n };\n },\n no_booking_info: (message: string = 'No booking info provided') => {\n return {\n title,\n message,\n category,\n };\n },\n no_timeslot_selected: (message: string = 'No timeslot selected') => {\n return {\n title,\n message,\n category,\n };\n },\n no_timezone_selected: (message: string = 'No timezone selected') => {\n return {\n title,\n message,\n category,\n };\n },\n no_booking_id: (message: string = 'No booking id provided') => {\n return {\n title,\n message,\n category,\n };\n },\n invalid_start_time: (message: string = 'Invalid start time') => {\n return {\n title,\n message,\n category,\n };\n },\n invalid_end_time: (message: string = 'Invalid end time') => {\n return {\n title,\n message,\n category,\n };\n },\n invalid_timezone: (message: string = 'Invalid timezone') => {\n return {\n title,\n message,\n category,\n };\n },\n };\n };\n\n api = (_title: string): Record<APIErrorType, (message: string) => ErrorDetails> => {\n const category = ErrorCategory.Api;\n const title = `${_title} error`;\n\n return {\n invalid_session: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n general_error: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n internal_error: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n invalid_request_error: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n timeslot_not_available: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n };\n };\n}\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,94 +6,181 @@ 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
|
-
this.nylasSchedulerConfigStore.state.
|
|
28
|
-
return existingConfig;
|
|
49
|
+
this.nylasSchedulerConfigStore.state.selectedConfiguration = 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
|
-
this.nylasSchedulerConfigStore.state.
|
|
67
|
+
this.nylasSchedulerConfigStore.state.selectedConfiguration = response.data;
|
|
41
68
|
if (this.nylasSchedulerConfigStore.state.configurations.find(c => c.id === configurationId)) {
|
|
42
69
|
this.nylasSchedulerConfigStore.state.configurations = this.nylasSchedulerConfigStore.state.configurations.map(c => (c.id === configurationId ? response.data : c));
|
|
43
70
|
}
|
|
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
|
-
this.nylasSchedulerConfigStore.state.
|
|
123
|
+
this.nylasSchedulerConfigStore.state.selectedConfiguration = 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
|
-
this.nylasSchedulerConfigStore.state.
|
|
149
|
+
this.nylasSchedulerConfigStore.state.selectedConfiguration = response.data;
|
|
89
150
|
if (this.nylasSchedulerConfigStore.state.configurations.find(c => c.id === configuration.id)) {
|
|
90
151
|
this.nylasSchedulerConfigStore.state.configurations = this.nylasSchedulerConfigStore.state.configurations.map(c => (c.id === configuration.id ? response.data : c));
|
|
91
152
|
}
|
|
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.selectedConfiguration?.id === configurationId) {
|
|
181
|
+
this.nylasSchedulerConfigStore.resetSelectedConfiguration();
|
|
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,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAA4B;YAC7E,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,WAAW;SAClB,CAAC,CAAC;QAEH,IAAI,oBAAoB,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,OAAO;gBACL,KAAK,EAAE,4BAA4B,GAAG,QAAQ,CAAC,KAAK,EAAE,OAAO;aACxC,CAAC;QAC1B,CAAC;QAGD,IAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC;QAE/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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,EAAE,gEAAgE;aAC1E,CAAC,CAAC;QACL,CAAC;QAED,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAA4B;YACtF,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,WAAW;SAClB,CAAC,CAAC;QAEH,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,YAAY,CAAC,IAAI,EAAE;gBACxB,OAAO,EAAE,4BAA4B,GAAG,KAAK,CAAC,OAAO;aACtD,CAAC,CAAC;QACL,CAAC;QAED,IAAI,oBAAoB,C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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,qBAAqB,EAAE,EAAE,KAAK,eAAe,EAAE,CAAC;YACvF,IAAI,CAAC,yBAAyB,CAAC,0BAA0B,EAAE,CAAC;QAC9D,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.selectedConfiguration = 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.selectedConfiguration = 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.selectedConfiguration = 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.selectedConfiguration = 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.selectedConfiguration?.id === configurationId) {\n this.nylasSchedulerConfigStore.resetSelectedConfiguration();\n }\n\n return dataResponse(response.data);\n }\n}\n"]}
|
|
@@ -94,7 +94,7 @@ export class NylaSchedulerAPIConnector {
|
|
|
94
94
|
}
|
|
95
95
|
async bookTimeslot(data) {
|
|
96
96
|
this.schedulerStore.set('isLoading', true);
|
|
97
|
-
const { selectedTimeslot, bookingInfo } = this.schedulerStore.state;
|
|
97
|
+
const { selectedTimeslot, selectedTimezone, bookingInfo } = this.schedulerStore.state;
|
|
98
98
|
if (!data && !bookingInfo) {
|
|
99
99
|
return { error: this.errors.component('Booking').no_booking_info() };
|
|
100
100
|
}
|
|
@@ -102,6 +102,10 @@ export class NylaSchedulerAPIConnector {
|
|
|
102
102
|
if (!timeslot) {
|
|
103
103
|
return { error: this.errors.component('Create Booking').no_timeslot_selected() };
|
|
104
104
|
}
|
|
105
|
+
const timezone = data && data?.timezone ? data?.timezone : selectedTimezone;
|
|
106
|
+
if (!timezone) {
|
|
107
|
+
return { error: this.errors.component('Create Booking').no_timezone_selected() };
|
|
108
|
+
}
|
|
105
109
|
const primaryParticipant = data ? data?.primaryParticipant : bookingInfo?.primaryParticipant;
|
|
106
110
|
const guests = data ? data?.guests || [] : bookingInfo?.guests || [];
|
|
107
111
|
const additional_fields = data ? { ...data?.additionalFields, guests } : { ...bookingInfo?.additionalFields, guests };
|
|
@@ -113,6 +117,7 @@ export class NylaSchedulerAPIConnector {
|
|
|
113
117
|
guest: { ...primaryParticipant },
|
|
114
118
|
start_time: timeslot.start_time.getTime() / 1000,
|
|
115
119
|
end_time: timeslot.end_time.getTime() / 1000,
|
|
120
|
+
timezone: timezone,
|
|
116
121
|
}), headers);
|
|
117
122
|
if ('error' in response) {
|
|
118
123
|
this.schedulerStore.set('isLoading', false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduler.js","sourceRoot":"","sources":["../../../../src/connector/shared/api/scheduler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,MAAM,EAAE,MAAM,8CAA8C,CAAC;AAapF,MAAM,OAAO,yBAAyB;IAOpC,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,SAAS,EAAE,QAAQ,EAAqC;QAF/F,WAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QAG5B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEO,UAAU;QAChB,OAAO,CAAC,IAAI,CAAC,QAAQ;YACnB,CAAC,CAAC;gBACE,aAAa,EAAE,UAAU,IAAI,CAAC,SAAS,EAAE;aAC1C;YACH,CAAC,CAAC,EAAE,CAAC;IACT,CAAC;IASM,KAAK,CAAC,cAAc,CAAI,IAAY,EAAE,MAAc,EAAE,IAAwB,EAAE,OAAO,GAAG,EAAE;QACjG,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACnD,YAAY,CAAC,QAAQ,GAAG,IAAI,CAAC;YAC7B,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,kBAAkB,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,EAAE;gBACxE,MAAM;gBACN,OAAO,EAAE;oBACP,cAAc,EAAE,kBA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AK,IAAI,sBAAsB,CAAC,CAAC;YACzG,CAAC;QACH,CAAC;QAED,IAAI,MAAM,IAAI,QAAQ;YAAE,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;QAE7E,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF","sourcesContent":["import { AvailabilityResponse, NylasEvent } from '@/common/types';\nimport { NylasSchedulerStoreType } from '../../../components';\nimport type { NylasErrorResponse, NylasResponse, NylasSchedulerBookingData, NylasSchedulerResponse, Timeslot } from '@nylas/core';\nimport { APIErrorType, Errors } from '@/connector/nylas-scheduler-connector/errors';\n\ntype NylasSchedulerAPIConnectorOptions = {\n schedulerAPIURL: string;\n schedulerStore: NylasSchedulerStoreType;\n sessionId?: string;\n configId?: string;\n};\n\n/**\n * NylaSchedulerConnector\n * This class is used to make API requests to the scheduler.\n */\nexport class NylaSchedulerAPIConnector {\n private schedulerStore: NylasSchedulerStoreType;\n private schedulerAPIURL: string;\n private sessionId: string | undefined;\n private configId: string | undefined;\n private errors = new Errors();\n\n constructor({ schedulerAPIURL, schedulerStore, sessionId, configId }: NylasSchedulerAPIConnectorOptions) {\n this.schedulerStore = schedulerStore;\n this.schedulerAPIURL = schedulerAPIURL;\n this.sessionId = sessionId;\n this.configId = configId;\n }\n\n private getHeaders() {\n return !this.configId\n ? {\n Authorization: `Bearer ${this.sessionId}`,\n }\n : {};\n }\n\n /**\n * Makes an API request to the scheduler.\n * @param path The path to the API endpoint.\n * @param method The HTTP method.\n * @param body The request body (if any).\n * @returns {Promise<T>}\n */\n public async makeAPIRequest<T>(path: string, method: string, body: string | undefined, headers = {}): Promise<NylasResponse<T>> {\n try {\n const schedulerURL = new URL(this.schedulerAPIURL);\n schedulerURL.pathname = path;\n const response = await fetch(decodeURIComponent(schedulerURL.toString()), {\n method,\n headers: {\n 'Content-Type': 'application/json',\n ...headers,\n },\n body,\n });\n // The server returns a json object for errors: eg.\n // {\n // \"request_id\": \"<request_id>\",\n // \"error\": {\n // \"type\": \"not_found_error\",\n // \"message\": \"Session not found\"\n // }\n // }\n const data = await response.json();\n return data as NylasResponse<T>;\n } catch (error: any) {\n // NOTE: current server implementation doesn't return a JSON object for errors on some endpoints\n // handle this case by returning the error response as a string to be handled downstream\n return {\n error: {\n message: error.message,\n title: 'API request failed',\n type: 'api',\n },\n } as NylasErrorResponse;\n }\n }\n\n /**\n * Selects a date in the scheduler.\n */\n public selectDate(date: Date) {\n this.schedulerStore.set('selectedDate', date);\n this.schedulerStore.set('selectedTimeslot', null);\n }\n\n /**\n * Selects a time in the scheduler.\n */\n public selectTime(time: Timeslot) {\n this.schedulerStore.set('selectedTimeslot', time);\n }\n\n /**\n * Sets the timezone in the scheduler.\n */\n public selectTimezone(timezone: string) {\n this.schedulerStore.set('selectedTimezone', timezone);\n }\n\n /**\n * Toggles showBookingForm\n * @param value boolean\n */\n public toggleAdditionalData(value: boolean) {\n this.schedulerStore.set('showBookingForm', value);\n }\n\n /**\n * Set/update the name of the participant booking the event.\n */\n public setParticipantName(name: string) {\n const { bookingInfo } = this.schedulerStore.state;\n this.schedulerStore.set('bookingInfo', {\n ...bookingInfo,\n primaryParticipant: {\n ...(bookingInfo?.primaryParticipant as NylasSchedulerBookingData['primaryParticipant']),\n name,\n },\n });\n }\n\n /**\n * Set/update the email of the participant booking the event.\n */\n public setParticipantEmail(email: string) {\n const { bookingInfo } = this.schedulerStore.state;\n this.schedulerStore.set('bookingInfo', {\n ...bookingInfo,\n primaryParticipant: {\n ...(bookingInfo?.primaryParticipant as NylasSchedulerBookingData['primaryParticipant']),\n email,\n },\n });\n }\n\n /**\n * Set reschedule booking id\n */\n public async setReschedule(bookingID: string) {\n const today = new Date();\n // Set reschedule booking id\n this.schedulerStore.set('rescheduleBookingId', bookingID);\n // Reset store state\n this.schedulerStore.set('selectedTimeslot', null);\n this.schedulerStore.set('eventInfo', null);\n this.schedulerStore.set('showBookingForm', false);\n // Refetch availability\n const startTime = new Date(today.getFullYear(), today.getMonth(), 1).getTime() / 1000;\n const endTime = new Date(today.getFullYear(), today.getMonth() + 1, 1).getTime() / 1000;\n const result = await this.getAvailability(startTime, endTime);\n // Set selected date to first available date\n const firstAvailableDate = this.schedulerStore.get('availability').find((timeslot: any) => new Date(timeslot.start_time) > new Date());\n let _selectedDate = today;\n if (firstAvailableDate) {\n _selectedDate = firstAvailableDate.start_time;\n }\n this.schedulerStore.set('selectedDate', _selectedDate);\n return result;\n }\n\n /**\n * Set cancel booking id\n */\n public async setCancel(bookingID: string) {\n this.schedulerStore.set('cancelBookingId', bookingID);\n }\n\n /**\n * Book the selected timeslot.\n * @param data The booking info.\n * @returns {Promise<NylasResponse<NylasEvent>>}\n */\n public async bookTimeslot(data?: NylasSchedulerBookingData & { timeslot?: Timeslot }): Promise<NylasSchedulerResponse<NylasEvent>> {\n this.schedulerStore.set('isLoading', true);\n const { selectedTimeslot, bookingInfo } = this.schedulerStore.state;\n if (!data && !bookingInfo) {\n return { error: this.errors.component('Booking').no_booking_info() };\n }\n\n const timeslot = data?.timeslot || selectedTimeslot;\n if (!timeslot) {\n return { error: this.errors.component('Create Booking').no_timeslot_selected() };\n }\n\n const primaryParticipant = data ? data?.primaryParticipant : bookingInfo?.primaryParticipant;\n const guests = data ? data?.guests || [] : bookingInfo?.guests || [];\n const additional_fields = data ? { ...data?.additionalFields, guests } : { ...bookingInfo?.additionalFields, guests };\n\n const headers = this.getHeaders();\n const configIdParam = this.configId ? `?configuration_id=${this.configId}` : '';\n const url = `/v3/scheduling/bookings${configIdParam}`;\n\n const response = await this.makeAPIRequest<NylasEvent>(\n decodeURIComponent(url),\n 'POST',\n JSON.stringify({\n additional_fields,\n guest: { ...primaryParticipant },\n start_time: timeslot.start_time.getTime() / 1000,\n end_time: timeslot.end_time.getTime() / 1000,\n }),\n headers,\n );\n\n if ('error' in response) {\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in this.errors.api('Create Booking')) {\n error = this.errors.api('Create Booking')[errorType as APIErrorType](error?.message || error?.title || 'Something went wrong');\n }\n return { error };\n }\n\n if ('data' in response) {\n this.schedulerStore.set('eventInfo', response?.data);\n }\n\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n\n /**\n * Gets the availability for a page.\n * @param startTime The start time.\n * @param endTime The end time.\n * @returns {Promise<AvailabilityResponse>}\n */\n public async getAvailability(startTime: number = 0, endTime: number = 0): Promise<NylasSchedulerResponse<AvailabilityResponse>> {\n this.schedulerStore.set('isLoading', true);\n const params = new URLSearchParams();\n const now = new Date();\n const nowTime = now.getTime();\n\n if (endTime && endTime < nowTime / 1000) {\n this.schedulerStore.set('isLoading', false);\n const error = this.errors.component('Get Availability').endtime_not_in_future();\n return { error };\n }\n\n // Calculate the start of the current month if startTime is not provided\n if (!startTime) {\n const startOfMonth = new Date(now.getFullYear(), now.getMonth(), 1);\n startTime = Math.floor(startOfMonth.getTime() / 1000); // Convert to UNIX timestamp in seconds\n }\n\n // Calculate the end of the current month if endTime is not provided\n if (!endTime) {\n const endOfMonth = new Date(now.getFullYear(), now.getMonth() + 1, 0); // Setting day to 0 gets the last day of the previous month, so in this case, the last day of the current month\n endTime = Math.floor(endOfMonth.getTime() / 1000); // Convert to UNIX timestamp in seconds\n }\n\n params.append('start_time', encodeURIComponent(startTime.toString()));\n params.append('end_time', encodeURIComponent(endTime.toString()));\n if (this.configId) {\n params.append('configuration_id', encodeURIComponent(this.configId));\n }\n const queryString = params.toString();\n const url = `/v3/scheduling/availability${queryString ? `?${queryString}` : ''}`;\n const headers = this.getHeaders();\n const response = await this.makeAPIRequest<AvailabilityResponse>(decodeURIComponent(url), 'GET', undefined, headers);\n\n if ('error' in response) {\n this.schedulerStore.set('availability', []);\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in this.errors.api('Get Availability')) {\n error = this.errors.api('Get Availability')[errorType as APIErrorType](error?.message || error?.title || 'Something went wrong');\n }\n return { error };\n }\n\n if ('data' in response) {\n const availability =\n response.data?.time_slots?.map(timeslot => {\n return {\n ...timeslot,\n start_time: new Date(timeslot.start_time * 1000),\n end_time: new Date(timeslot.end_time * 1000),\n };\n }) || [];\n\n // Filter out timeslots that are in the past\n const availabilityTimeslotsFiltered = availability.filter(timeslot => timeslot.start_time.getTime() > nowTime);\n this.schedulerStore.set('availability', availabilityTimeslotsFiltered);\n }\n\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n\n /**\n * Cancels a booking.\n * @param bookingId The booking ID.\n */\n public async cancelBooking(bookingId: string): Promise<NylasSchedulerResponse<Partial<NylasEvent>>> {\n this.schedulerStore.set('isLoading', true);\n if (!bookingId) {\n return { error: this.errors.component('Cancel Booking').no_booking_id() };\n }\n const configIdParam = this.configId ? `?configuration_id=${this.configId}` : '';\n const url = `/v3/scheduling/bookings/${bookingId}${configIdParam}`;\n const headers = this.getHeaders();\n const response = await this.makeAPIRequest<Partial<NylasEvent>>(\n decodeURIComponent(url),\n 'DELETE',\n JSON.stringify({\n action: 'cancel',\n }),\n headers,\n );\n\n if ('error' in response) {\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in this.errors.api('Cancel Booking')) {\n error = this.errors.api('Cancel Booking')[errorType as APIErrorType](error?.message || error?.title || 'Something went wrong');\n }\n return { error };\n }\n\n this.schedulerStore.set('cancelledEventInfo', {\n booking_id: bookingId,\n });\n\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n\n /**\n * Reschedules a booking.\n * @param bookingId The booking ID.\n * @param data The booking info.\n * @returns {Promise<NylasResponse<NylasEvent>>}\n */\n public async rescheduleBooking(bookingId: string, data: NylasSchedulerBookingData): Promise<NylasSchedulerResponse<NylasEvent>> {\n this.schedulerStore.set('isLoading', true);\n if (!bookingId) {\n return { error: this.errors.component('Reschedule Booking').no_booking_id() };\n }\n const apiErrors = this.errors.api('Reschedule Booking');\n const componentErrors = this.errors.component('Reschedule Booking');\n const { bookingInfo, selectedTimeslot, selectedTimezone } = this.schedulerStore.state;\n // Validate data\n const { startTime, endTime, timezone } = data;\n const start_time = startTime || selectedTimeslot?.start_time;\n\n if (!start_time) {\n return { error: componentErrors.invalid_start_time('Please pass \"startTime\" in data or set \"selectedTimeslot\" in the defaultSchedulerState.') };\n }\n const end_time = endTime || selectedTimeslot?.end_time;\n if (!end_time) {\n return { error: componentErrors.invalid_end_time('Please pass \"endTime\" in data or set \"selectedTimeslot\" in the defaultSchedulerState.') };\n }\n const time_zone = timezone || selectedTimezone;\n if (!time_zone) {\n return { error: componentErrors.invalid_timezone('Please pass \"timezone\" in data or set \"selectedTimezone\" in the defaultSchedulerState.') };\n }\n\n const primaryParticipant = data ? data?.primaryParticipant : bookingInfo?.primaryParticipant;\n const guests = data ? data?.guests || [] : bookingInfo?.guests || [];\n const additional_fields = data ? { ...data?.additionalFields, guests } : { ...bookingInfo?.additionalFields, guests };\n\n const configIdParam = this.configId ? `?configuration_id=${this.configId}` : '';\n const url = `/v3/scheduling/bookings/${bookingId}${configIdParam}`;\n const headers = this.getHeaders();\n const response = await this.makeAPIRequest<NylasEvent>(\n decodeURIComponent(url),\n 'PATCH',\n JSON.stringify({\n start_time: start_time.getTime() / 1000,\n end_time: end_time.getTime() / 1000,\n time_zone,\n additional_fields,\n guest: { ...primaryParticipant },\n }),\n headers,\n );\n\n if ('error' in response) {\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in apiErrors) {\n error = apiErrors[errorType as APIErrorType](error?.message || error?.title || 'Something went wrong');\n }\n }\n\n if ('data' in response) this.schedulerStore.set('eventInfo', response?.data);\n\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"scheduler.js","sourceRoot":"","sources":["../../../../src/connector/shared/api/scheduler.ts"],"names":[],"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EAAE,KAAK,IAAI,sBAAsB,CAAC,CAAC;YACzG,CAAC;QACH,CAAC;QAED,IAAI,MAAM,IAAI,QAAQ;YAAE,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;QAE7E,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF","sourcesContent":["import { AvailabilityResponse, NylasEvent } from '@/common/types';\nimport { NylasSchedulerStoreType } from '../../../components';\nimport type { NylasErrorResponse, NylasResponse, NylasSchedulerBookingData, NylasSchedulerResponse, Timeslot } from '@nylas/core';\nimport { APIErrorType, Errors } from '@/connector/nylas-scheduler-connector/errors';\n\ntype NylasSchedulerAPIConnectorOptions = {\n schedulerAPIURL: string;\n schedulerStore: NylasSchedulerStoreType;\n sessionId?: string;\n configId?: string;\n};\n\n/**\n * NylaSchedulerConnector\n * This class is used to make API requests to the scheduler.\n */\nexport class NylaSchedulerAPIConnector {\n private schedulerStore: NylasSchedulerStoreType;\n private schedulerAPIURL: string;\n private sessionId: string | undefined;\n private configId: string | undefined;\n private errors = new Errors();\n\n constructor({ schedulerAPIURL, schedulerStore, sessionId, configId }: NylasSchedulerAPIConnectorOptions) {\n this.schedulerStore = schedulerStore;\n this.schedulerAPIURL = schedulerAPIURL;\n this.sessionId = sessionId;\n this.configId = configId;\n }\n\n private getHeaders() {\n return !this.configId\n ? {\n Authorization: `Bearer ${this.sessionId}`,\n }\n : {};\n }\n\n /**\n * Makes an API request to the scheduler.\n * @param path The path to the API endpoint.\n * @param method The HTTP method.\n * @param body The request body (if any).\n * @returns {Promise<T>}\n */\n public async makeAPIRequest<T>(path: string, method: string, body: string | undefined, headers = {}): Promise<NylasResponse<T>> {\n try {\n const schedulerURL = new URL(this.schedulerAPIURL);\n schedulerURL.pathname = path;\n const response = await fetch(decodeURIComponent(schedulerURL.toString()), {\n method,\n headers: {\n 'Content-Type': 'application/json',\n ...headers,\n },\n body,\n });\n // The server returns a json object for errors: eg.\n // {\n // \"request_id\": \"<request_id>\",\n // \"error\": {\n // \"type\": \"not_found_error\",\n // \"message\": \"Session not found\"\n // }\n // }\n const data = await response.json();\n return data as NylasResponse<T>;\n } catch (error: any) {\n // NOTE: current server implementation doesn't return a JSON object for errors on some endpoints\n // handle this case by returning the error response as a string to be handled downstream\n return {\n error: {\n message: error.message,\n title: 'API request failed',\n type: 'api',\n },\n } as NylasErrorResponse;\n }\n }\n\n /**\n * Selects a date in the scheduler.\n */\n public selectDate(date: Date) {\n this.schedulerStore.set('selectedDate', date);\n this.schedulerStore.set('selectedTimeslot', null);\n }\n\n /**\n * Selects a time in the scheduler.\n */\n public selectTime(time: Timeslot) {\n this.schedulerStore.set('selectedTimeslot', time);\n }\n\n /**\n * Sets the timezone in the scheduler.\n */\n public selectTimezone(timezone: string) {\n this.schedulerStore.set('selectedTimezone', timezone);\n }\n\n /**\n * Toggles showBookingForm\n * @param value boolean\n */\n public toggleAdditionalData(value: boolean) {\n this.schedulerStore.set('showBookingForm', value);\n }\n\n /**\n * Set/update the name of the participant booking the event.\n */\n public setParticipantName(name: string) {\n const { bookingInfo } = this.schedulerStore.state;\n this.schedulerStore.set('bookingInfo', {\n ...bookingInfo,\n primaryParticipant: {\n ...(bookingInfo?.primaryParticipant as NylasSchedulerBookingData['primaryParticipant']),\n name,\n },\n });\n }\n\n /**\n * Set/update the email of the participant booking the event.\n */\n public setParticipantEmail(email: string) {\n const { bookingInfo } = this.schedulerStore.state;\n this.schedulerStore.set('bookingInfo', {\n ...bookingInfo,\n primaryParticipant: {\n ...(bookingInfo?.primaryParticipant as NylasSchedulerBookingData['primaryParticipant']),\n email,\n },\n });\n }\n\n /**\n * Set reschedule booking id\n */\n public async setReschedule(bookingID: string) {\n const today = new Date();\n // Set reschedule booking id\n this.schedulerStore.set('rescheduleBookingId', bookingID);\n // Reset store state\n this.schedulerStore.set('selectedTimeslot', null);\n this.schedulerStore.set('eventInfo', null);\n this.schedulerStore.set('showBookingForm', false);\n // Refetch availability\n const startTime = new Date(today.getFullYear(), today.getMonth(), 1).getTime() / 1000;\n const endTime = new Date(today.getFullYear(), today.getMonth() + 1, 1).getTime() / 1000;\n const result = await this.getAvailability(startTime, endTime);\n // Set selected date to first available date\n const firstAvailableDate = this.schedulerStore.get('availability').find((timeslot: any) => new Date(timeslot.start_time) > new Date());\n let _selectedDate = today;\n if (firstAvailableDate) {\n _selectedDate = firstAvailableDate.start_time;\n }\n this.schedulerStore.set('selectedDate', _selectedDate);\n return result;\n }\n\n /**\n * Set cancel booking id\n */\n public async setCancel(bookingID: string) {\n this.schedulerStore.set('cancelBookingId', bookingID);\n }\n\n /**\n * Book the selected timeslot.\n * @param data The booking info.\n * @returns {Promise<NylasResponse<NylasEvent>>}\n */\n public async bookTimeslot(data?: NylasSchedulerBookingData & { timeslot?: Timeslot }): Promise<NylasSchedulerResponse<NylasEvent>> {\n this.schedulerStore.set('isLoading', true);\n const { selectedTimeslot, selectedTimezone, bookingInfo } = this.schedulerStore.state;\n if (!data && !bookingInfo) {\n return { error: this.errors.component('Booking').no_booking_info() };\n }\n\n const timeslot = data?.timeslot || selectedTimeslot;\n if (!timeslot) {\n return { error: this.errors.component('Create Booking').no_timeslot_selected() };\n }\n\n const timezone = data && data?.timezone ? data?.timezone : selectedTimezone;\n\n if (!timezone) {\n return { error: this.errors.component('Create Booking').no_timezone_selected() };\n }\n\n const primaryParticipant = data ? data?.primaryParticipant : bookingInfo?.primaryParticipant;\n const guests = data ? data?.guests || [] : bookingInfo?.guests || [];\n const additional_fields = data ? { ...data?.additionalFields, guests } : { ...bookingInfo?.additionalFields, guests };\n\n const headers = this.getHeaders();\n const configIdParam = this.configId ? `?configuration_id=${this.configId}` : '';\n const url = `/v3/scheduling/bookings${configIdParam}`;\n\n const response = await this.makeAPIRequest<NylasEvent>(\n decodeURIComponent(url),\n 'POST',\n JSON.stringify({\n additional_fields,\n guest: { ...primaryParticipant },\n start_time: timeslot.start_time.getTime() / 1000,\n end_time: timeslot.end_time.getTime() / 1000,\n timezone: timezone,\n }),\n headers,\n );\n\n if ('error' in response) {\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in this.errors.api('Create Booking')) {\n error = this.errors.api('Create Booking')[errorType as APIErrorType](error?.message || error?.title || 'Something went wrong');\n }\n return { error };\n }\n\n if ('data' in response) {\n this.schedulerStore.set('eventInfo', response?.data);\n }\n\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n\n /**\n * Gets the availability for a page.\n * @param startTime The start time.\n * @param endTime The end time.\n * @returns {Promise<AvailabilityResponse>}\n */\n public async getAvailability(startTime: number = 0, endTime: number = 0): Promise<NylasSchedulerResponse<AvailabilityResponse>> {\n this.schedulerStore.set('isLoading', true);\n const params = new URLSearchParams();\n const now = new Date();\n const nowTime = now.getTime();\n\n if (endTime && endTime < nowTime / 1000) {\n this.schedulerStore.set('isLoading', false);\n const error = this.errors.component('Get Availability').endtime_not_in_future();\n return { error };\n }\n\n // Calculate the start of the current month if startTime is not provided\n if (!startTime) {\n const startOfMonth = new Date(now.getFullYear(), now.getMonth(), 1);\n startTime = Math.floor(startOfMonth.getTime() / 1000); // Convert to UNIX timestamp in seconds\n }\n\n // Calculate the end of the current month if endTime is not provided\n if (!endTime) {\n const endOfMonth = new Date(now.getFullYear(), now.getMonth() + 1, 0); // Setting day to 0 gets the last day of the previous month, so in this case, the last day of the current month\n endTime = Math.floor(endOfMonth.getTime() / 1000); // Convert to UNIX timestamp in seconds\n }\n\n params.append('start_time', encodeURIComponent(startTime.toString()));\n params.append('end_time', encodeURIComponent(endTime.toString()));\n if (this.configId) {\n params.append('configuration_id', encodeURIComponent(this.configId));\n }\n const queryString = params.toString();\n const url = `/v3/scheduling/availability${queryString ? `?${queryString}` : ''}`;\n const headers = this.getHeaders();\n const response = await this.makeAPIRequest<AvailabilityResponse>(decodeURIComponent(url), 'GET', undefined, headers);\n\n if ('error' in response) {\n this.schedulerStore.set('availability', []);\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in this.errors.api('Get Availability')) {\n error = this.errors.api('Get Availability')[errorType as APIErrorType](error?.message || error?.title || 'Something went wrong');\n }\n return { error };\n }\n\n if ('data' in response) {\n const availability =\n response.data?.time_slots?.map(timeslot => {\n return {\n ...timeslot,\n start_time: new Date(timeslot.start_time * 1000),\n end_time: new Date(timeslot.end_time * 1000),\n };\n }) || [];\n\n // Filter out timeslots that are in the past\n const availabilityTimeslotsFiltered = availability.filter(timeslot => timeslot.start_time.getTime() > nowTime);\n this.schedulerStore.set('availability', availabilityTimeslotsFiltered);\n }\n\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n\n /**\n * Cancels a booking.\n * @param bookingId The booking ID.\n */\n public async cancelBooking(bookingId: string): Promise<NylasSchedulerResponse<Partial<NylasEvent>>> {\n this.schedulerStore.set('isLoading', true);\n if (!bookingId) {\n return { error: this.errors.component('Cancel Booking').no_booking_id() };\n }\n const configIdParam = this.configId ? `?configuration_id=${this.configId}` : '';\n const url = `/v3/scheduling/bookings/${bookingId}${configIdParam}`;\n const headers = this.getHeaders();\n const response = await this.makeAPIRequest<Partial<NylasEvent>>(\n decodeURIComponent(url),\n 'DELETE',\n JSON.stringify({\n action: 'cancel',\n }),\n headers,\n );\n\n if ('error' in response) {\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in this.errors.api('Cancel Booking')) {\n error = this.errors.api('Cancel Booking')[errorType as APIErrorType](error?.message || error?.title || 'Something went wrong');\n }\n return { error };\n }\n\n this.schedulerStore.set('cancelledEventInfo', {\n booking_id: bookingId,\n });\n\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n\n /**\n * Reschedules a booking.\n * @param bookingId The booking ID.\n * @param data The booking info.\n * @returns {Promise<NylasResponse<NylasEvent>>}\n */\n public async rescheduleBooking(bookingId: string, data: NylasSchedulerBookingData): Promise<NylasSchedulerResponse<NylasEvent>> {\n this.schedulerStore.set('isLoading', true);\n if (!bookingId) {\n return { error: this.errors.component('Reschedule Booking').no_booking_id() };\n }\n const apiErrors = this.errors.api('Reschedule Booking');\n const componentErrors = this.errors.component('Reschedule Booking');\n const { bookingInfo, selectedTimeslot, selectedTimezone } = this.schedulerStore.state;\n // Validate data\n const { startTime, endTime, timezone } = data;\n const start_time = startTime || selectedTimeslot?.start_time;\n\n if (!start_time) {\n return { error: componentErrors.invalid_start_time('Please pass \"startTime\" in data or set \"selectedTimeslot\" in the defaultSchedulerState.') };\n }\n const end_time = endTime || selectedTimeslot?.end_time;\n if (!end_time) {\n return { error: componentErrors.invalid_end_time('Please pass \"endTime\" in data or set \"selectedTimeslot\" in the defaultSchedulerState.') };\n }\n const time_zone = timezone || selectedTimezone;\n if (!time_zone) {\n return { error: componentErrors.invalid_timezone('Please pass \"timezone\" in data or set \"selectedTimezone\" in the defaultSchedulerState.') };\n }\n\n const primaryParticipant = data ? data?.primaryParticipant : bookingInfo?.primaryParticipant;\n const guests = data ? data?.guests || [] : bookingInfo?.guests || [];\n const additional_fields = data ? { ...data?.additionalFields, guests } : { ...bookingInfo?.additionalFields, guests };\n\n const configIdParam = this.configId ? `?configuration_id=${this.configId}` : '';\n const url = `/v3/scheduling/bookings/${bookingId}${configIdParam}`;\n const headers = this.getHeaders();\n const response = await this.makeAPIRequest<NylasEvent>(\n decodeURIComponent(url),\n 'PATCH',\n JSON.stringify({\n start_time: start_time.getTime() / 1000,\n end_time: end_time.getTime() / 1000,\n time_zone,\n additional_fields,\n guest: { ...primaryParticipant },\n }),\n headers,\n );\n\n if ('error' in response) {\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in apiErrors) {\n error = apiErrors[errorType as APIErrorType](error?.message || error?.title || 'Something went wrong');\n }\n }\n\n if ('data' in response) this.schedulerStore.set('eventInfo', response?.data);\n\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n}\n"]}
|
package/dist/collection/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,eAA+B,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAc,CAAC;AACvC,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["export type * from './components.d.ts';\nexport { ObservableMap } from '@stencil/store';\nimport NylasThemeStore, { NylasTheme } from './common/nylas-theme';\nexport { NylasThemeStore, NylasTheme };\nexport { NylasIdentityRequestWrapper } from './common/nylas-api-request';\nexport type { NylasRequestArgs, NylasApiRequest } from './common/nylas-api-request';\n"]}
|
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
import { createStore } from "@stencil/store";
|
|
2
2
|
export function CreateNylasSchedulerConfigStore(defaultState = {}) {
|
|
3
3
|
const defaultNylasSchedulerConfigStoreState = {
|
|
4
|
-
|
|
4
|
+
selectedConfiguration: {},
|
|
5
5
|
configurations: [],
|
|
6
6
|
calendars: [],
|
|
7
7
|
currentUser: null,
|
|
8
|
+
action: null,
|
|
9
|
+
defaultRequiresSessionAuth: true,
|
|
8
10
|
...defaultState,
|
|
9
11
|
};
|
|
10
12
|
const store = createStore(defaultNylasSchedulerConfigStoreState);
|
|
11
|
-
|
|
13
|
+
function resetSelectedConfiguration() {
|
|
14
|
+
store.set('selectedConfiguration', { ...defaultState['selectedConfiguration'] });
|
|
15
|
+
}
|
|
16
|
+
store.onChange('action', async (action) => {
|
|
17
|
+
if (!action) {
|
|
18
|
+
resetSelectedConfiguration();
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return {
|
|
22
|
+
...store,
|
|
23
|
+
resetSelectedConfiguration,
|
|
24
|
+
};
|
|
12
25
|
}
|
|
13
26
|
//# sourceMappingURL=scheduler-config-store.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduler-config-store.js","sourceRoot":"","sources":["../../src/stores/scheduler-config-store.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"scheduler-config-store.js","sourceRoot":"","sources":["../../src/stores/scheduler-config-store.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,WAAW,EAAE,MAAM,gBAAgB,CAAC;AA8C5D,MAAM,UAAU,+BAA+B,CAAC,eAAwD,EAAE;IACxG,MAAM,qCAAqC,GAAmC;QAC5E,qBAAqB,EAAE,EAAE;QACzB,cAAc,EAAE,EAAE;QAClB,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE,IAAI;QACZ,0BAA0B,EAAE,IAAI;QAChC,GAAG,YAAY;KAChB,CAAC;IACF,MAAM,KAAK,GAAG,WAAW,CAAiC,qCAAqC,CAAC,CAAC;IAMjG,SAAS,0BAA0B;QACjC,KAAK,CAAC,GAAG,CAAC,uBAAuB,EAAE,EAAE,GAAG,YAAY,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACtC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,0BAA0B,EAAE,CAAC;QAC/B,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,KAAK;QACR,0BAA0B;KAC3B,CAAC;AACJ,CAAC","sourcesContent":["import { Calendar, Configuration } from '@nylas/core';\nimport { ObservableMap, createStore } from '@stencil/store';\nimport { User } from '@/common/nylas-api-request';\n\nexport interface NylasSchedulerConfigStoreState {\n /**\n * The selected configuration.\n * This is the configuration that is currently selected, use it to populate default values for new configurations.\n */\n selectedConfiguration: Partial<Configuration>;\n /**\n * The list of configurations.\n * This is the list of configurations that the user has created.\n */\n configurations: Configuration[];\n /**\n * The list of calendars.\n * This is the list of calendars that the user has access to.\n */\n calendars: Calendar[];\n /**\n * The current user.\n * This is the user that is currently logged in.\n */\n currentUser: User | null;\n /**\n * The current action.\n * This is the current action that the user is performing.\n */\n action: 'create' | 'edit' | null;\n /**\n * Whether the default configuration requires session authentication.\n * This is used to determine whether the default configuration should require session authentication.\n */\n defaultRequiresSessionAuth: boolean;\n}\n\nexport type NylasSchedulerConfigStoreType = ReturnType<typeof CreateNylasSchedulerConfigStore>;\n\nexport type CreateNylasSchedulerConfigStoreReturnType = ObservableMap<NylasSchedulerConfigStoreState> & {\n /**\n * Reset the selected configuration to the default state.\n * This is used to reset the selected configuration to the default state instead of setting it to an empty object.\n */\n resetSelectedConfiguration: () => void;\n};\n\nexport function CreateNylasSchedulerConfigStore(defaultState: Partial<NylasSchedulerConfigStoreState> = {}): CreateNylasSchedulerConfigStoreReturnType {\n const defaultNylasSchedulerConfigStoreState: NylasSchedulerConfigStoreState = {\n selectedConfiguration: {},\n configurations: [],\n calendars: [],\n currentUser: null,\n action: null,\n defaultRequiresSessionAuth: true,\n ...defaultState,\n };\n const store = createStore<NylasSchedulerConfigStoreState>(defaultNylasSchedulerConfigStoreState);\n\n /**\n * Reset the selected configuration to the default state.\n * This is used to reset the selected configuration to the default state instead of setting it to an empty object.\n */\n function resetSelectedConfiguration() {\n store.set('selectedConfiguration', { ...defaultState['selectedConfiguration'] });\n }\n\n store.onChange('action', async action => {\n if (!action) {\n resetSelectedConfiguration();\n }\n });\n\n return {\n ...store,\n resetSelectedConfiguration,\n };\n}\n"]}
|
|
@@ -289,4 +289,20 @@ export function getBrowser() {
|
|
|
289
289
|
return 'Edge (Legacy)';
|
|
290
290
|
return 'Unknown';
|
|
291
291
|
}
|
|
292
|
+
export function dataResponse(data, error = null) {
|
|
293
|
+
if (error) {
|
|
294
|
+
return [null, error];
|
|
295
|
+
}
|
|
296
|
+
return [data, null];
|
|
297
|
+
}
|
|
298
|
+
export function parsePreviewLink(link, config) {
|
|
299
|
+
const replacements = {
|
|
300
|
+
'config.id': config?.id,
|
|
301
|
+
'id': config?.id,
|
|
302
|
+
};
|
|
303
|
+
Object.keys(replacements).forEach(key => {
|
|
304
|
+
link = link.replace(`{${key}}`, replacements[key]);
|
|
305
|
+
});
|
|
306
|
+
return link;
|
|
307
|
+
}
|
|
292
308
|
//# sourceMappingURL=utils.js.map
|