@jetbrains/ring-ui 5.1.1 → 6.0.2-beta.0
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/README.md +1 -6
- package/babel.config.js +0 -1
- package/components/alert/alert.d.ts +1 -1
- package/components/alert/container.css +3 -0
- package/components/alert-service/alert-service.d.ts +2 -2
- package/components/analytics/analytics.d.ts +21 -7
- package/components/analytics/analytics.js +19 -24
- package/components/analytics/analytics__custom-plugin.d.ts +6 -16
- package/components/analytics/analytics__custom-plugin.js +12 -52
- package/components/analytics/analytics__fus-plugin.d.ts +15 -25
- package/components/analytics/analytics__fus-plugin.js +15 -73
- package/components/analytics/analytics__ga-plugin.d.ts +13 -3
- package/components/analytics/analytics__ga-plugin.js +35 -5
- package/components/analytics/analytics__plugin-utils.d.ts +16 -0
- package/components/analytics/analytics__plugin-utils.js +26 -1
- package/components/auth/auth__core.d.ts +5 -4
- package/components/auth/auth__core.js +44 -27
- package/components/auth-dialog/auth-dialog.d.ts +2 -2
- package/components/auth-dialog/auth-dialog.js +3 -1
- package/components/auth-dialog-service/auth-dialog-service.js +4 -1
- package/components/avatar/avatar.d.ts +3 -3
- package/components/avatar/fallback-avatar.d.ts +2 -2
- package/components/avatar/fallback-avatar.js +2 -1
- package/components/badge/badge.d.ts +2 -2
- package/components/button/button.css +7 -7
- package/components/button/button.d.ts +3 -4
- package/components/button/button.js +0 -1
- package/components/button-group/button-group.css +2 -2
- package/components/button-group/button-group.d.ts +2 -2
- package/components/button-group/caption.d.ts +2 -2
- package/components/button-set/button-set.d.ts +2 -2
- package/components/button-toolbar/button-toolbar.d.ts +2 -2
- package/components/checkbox/checkbox.css +2 -2
- package/components/checkbox/checkbox.d.ts +2 -2
- package/components/code/code.d.ts +1 -1
- package/components/confirm/confirm.d.ts +1 -1
- package/components/confirm/confirm.js +3 -3
- package/components/confirm-service/confirm-service.js +2 -2
- package/components/content-layout/content-layout.d.ts +2 -2
- package/components/content-layout/sidebar.d.ts +2 -2
- package/components/contenteditable/contenteditable.d.ts +3 -3
- package/components/control-label/control-label.css +23 -0
- package/components/control-label/control-label.d.ts +11 -0
- package/components/control-label/control-label.js +22 -0
- package/components/data-list/data-list.css +2 -1
- package/components/data-list/data-list.d.ts +3 -3
- package/components/data-list/data-list.mock.d.ts +2 -2
- package/components/data-list/item.d.ts +3 -3
- package/components/data-list/title.d.ts +1 -1
- package/components/date-picker/consts.d.ts +5 -5
- package/components/date-picker/date-input.d.ts +3 -12
- package/components/date-picker/date-input.js +9 -15
- package/components/date-picker/date-picker.css +1 -1
- package/components/date-picker/date-picker.d.ts +8 -6
- package/components/date-picker/date-picker.js +9 -15
- package/components/date-picker/date-popup.d.ts +1 -1
- package/components/date-picker/date-popup.js +2 -1
- package/components/date-picker/day.d.ts +2 -2
- package/components/date-picker/month-names.d.ts +2 -2
- package/components/date-picker/month-names.js +2 -2
- package/components/date-picker/month-slider.d.ts +2 -2
- package/components/date-picker/month.d.ts +2 -2
- package/components/date-picker/months.d.ts +2 -2
- package/components/date-picker/months.js +46 -29
- package/components/date-picker/weekdays.d.ts +2 -2
- package/components/date-picker/years.d.ts +6 -2
- package/components/date-picker/years.js +26 -14
- package/components/dialog/dialog.css +1 -1
- package/components/dialog/dialog.d.ts +4 -16
- package/components/dialog/dialog.js +4 -2
- package/components/dropdown/anchor.d.ts +1 -1
- package/components/dropdown/dropdown.d.ts +8 -1
- package/components/editable-heading/editable-heading.css +20 -7
- package/components/editable-heading/editable-heading.d.ts +2 -2
- package/components/editable-heading/editable-heading.js +39 -12
- package/components/error-bubble/error-bubble.d.ts +2 -2
- package/components/error-message/error-message.d.ts +2 -2
- package/components/footer/footer.js +1 -0
- package/components/form/form.examples.js +2 -11
- package/components/global/controls-height.d.ts +2 -0
- package/components/global/controls-height.js +8 -0
- package/components/global/create-stateful-context.d.ts +1 -1
- package/components/global/focus-sensor-hoc.d.ts +1 -0
- package/components/global/focus-sensor-hoc.js +5 -4
- package/components/global/react-dom-renderer.d.ts +4 -4
- package/components/global/react-dom-renderer.js +5 -5
- package/components/global/react-render-adapter.js +19 -31
- package/components/global/use-event-callback.d.ts +1 -0
- package/components/global/use-event-callback.js +14 -0
- package/components/global/variables_dark.css +2 -2
- package/components/grid/col.d.ts +2 -2
- package/components/grid/grid.d.ts +2 -2
- package/components/grid/row.d.ts +2 -2
- package/components/group/group.d.ts +2 -2
- package/components/header/header.d.ts +2 -2
- package/components/header/logo.d.ts +2 -2
- package/components/header/profile.d.ts +4 -2
- package/components/header/profile.js +15 -11
- package/components/header/services-link.d.ts +2 -2
- package/components/header/services.d.ts +2 -2
- package/components/header/smart-profile.d.ts +2 -2
- package/components/header/smart-services.d.ts +2 -2
- package/components/header/tray-icon.d.ts +2 -2
- package/components/header/tray.d.ts +2 -2
- package/components/heading/heading.css +8 -8
- package/components/http/http.d.ts +16 -6
- package/components/http/http.js +26 -0
- package/components/hub-source/hub-source__users-groups.d.ts +1 -1
- package/components/i18n/README.md +46 -0
- package/components/i18n/i18n-context.d.ts +13 -0
- package/components/i18n/i18n-context.js +14 -0
- package/components/i18n/i18n.d.ts +59 -0
- package/components/i18n/i18n.js +26 -0
- package/components/i18n/messages.json +53 -0
- package/components/icon/icon.d.ts +3 -3
- package/components/icon/icon__svg.d.ts +1 -1
- package/components/input/input-legacy.css +3 -3
- package/components/input/input.css +8 -21
- package/components/input/input.d.ts +7 -1
- package/components/input/input.js +18 -14
- package/components/input-size/input-size.examples.js +4 -150
- package/components/island/adaptive-island-hoc.d.ts +2 -2
- package/components/island/content.d.ts +1 -1
- package/components/island/header.d.ts +2 -2
- package/components/island/island.css +1 -1
- package/components/island/island.d.ts +3 -3
- package/components/island-legacy/content-legacy.d.ts +2 -2
- package/components/island-legacy/header-legacy.d.ts +2 -2
- package/components/island-legacy/island-legacy.d.ts +2 -2
- package/components/link/clickableLink.d.ts +1 -1
- package/components/link/link.css +1 -1
- package/components/link/link.d.ts +8 -9
- package/components/link/link.js +0 -1
- package/components/list/consts.js +3 -0
- package/components/list/list.css +2 -2
- package/components/list/list.d.ts +7 -7
- package/components/list/list.js +4 -1
- package/components/list/list__custom.d.ts +1 -1
- package/components/list/list__hint.d.ts +2 -2
- package/components/list/list__item.d.ts +2 -2
- package/components/list/list__link.d.ts +2 -2
- package/components/list/list__separator.d.ts +2 -2
- package/components/list/list__title.d.ts +2 -2
- package/components/loader/loader.d.ts +2 -2
- package/components/loader-inline/loader-inline.d.ts +2 -2
- package/components/loader-screen/loader-screen.d.ts +2 -2
- package/components/login-dialog/login-dialog.d.ts +2 -2
- package/components/login-dialog/service.js +4 -1
- package/components/markdown/code.d.ts +2 -2
- package/components/markdown/heading.d.ts +2 -2
- package/components/markdown/link.d.ts +2 -2
- package/components/markdown/markdown.d.ts +2 -2
- package/components/message/message.d.ts +3 -7
- package/components/message/message.js +17 -16
- package/components/pager/pager.d.ts +8 -13
- package/components/pager/pager.js +12 -14
- package/components/panel/panel.css +1 -1
- package/components/panel/panel.d.ts +2 -2
- package/components/popup/popup.d.ts +2 -2
- package/components/popup/popup.js +1 -1
- package/components/popup/position.d.ts +1 -1
- package/components/popup/position.js +43 -33
- package/components/popup-menu/popup-menu.d.ts +2 -2
- package/components/progress-bar/progress-bar.d.ts +2 -2
- package/components/query-assist/query-assist.css +16 -11
- package/components/query-assist/query-assist.d.ts +3 -7
- package/components/query-assist/query-assist.js +50 -31
- package/components/query-assist/query-assist__suggestions.d.ts +2 -2
- package/components/radio/radio.css +1 -1
- package/components/radio/radio.d.ts +1 -1
- package/components/radio/radio__item.d.ts +1 -1
- package/components/select/select-popup.css +2 -2
- package/components/select/select.css +9 -5
- package/components/select/select.d.ts +20 -9
- package/components/select/select.js +47 -23
- package/components/select/select__filter.d.ts +2 -3
- package/components/select/select__filter.js +4 -2
- package/components/select/select__popup.d.ts +48 -8
- package/components/select/select__popup.js +29 -8
- package/components/shortcuts/shortcuts-hoc.d.ts +2 -2
- package/components/shortcuts/shortcuts.d.ts +1 -1
- package/components/tab-trap/tab-trap.d.ts +1 -1
- package/components/table/cell.d.ts +2 -2
- package/components/table/disable-hover-hoc.d.ts +2 -2
- package/components/table/header-cell.d.ts +2 -2
- package/components/table/header.d.ts +3 -14
- package/components/table/header.js +5 -49
- package/components/table/multitable.d.ts +2 -2
- package/components/table/row-with-focus-sensor.d.ts +1 -1
- package/components/table/row.d.ts +2 -1
- package/components/table/row.js +4 -3
- package/components/table/smart-table.d.ts +3 -1
- package/components/table/table.css +9 -26
- package/components/table/table.d.ts +6 -4
- package/components/table/table.js +5 -3
- package/components/tabs/collapsible-more.d.ts +3 -3
- package/components/tabs/collapsible-tab.d.ts +1 -1
- package/components/tabs/collapsible-tabs.d.ts +2 -2
- package/components/tabs/dumb-tabs.d.ts +5 -3
- package/components/tabs/dumb-tabs.js +3 -2
- package/components/tabs/smart-tabs.d.ts +2 -2
- package/components/tabs/tab-link.d.ts +1 -1
- package/components/tabs/tab.d.ts +2 -2
- package/components/tabs/tab.js +3 -3
- package/components/tabs/tabs.css +4 -1
- package/components/tag/tag.css +3 -3
- package/components/tag/tag.d.ts +5 -5
- package/components/tags-input/tags-input.css +1 -1
- package/components/tags-input/tags-input.d.ts +9 -4
- package/components/tags-input/tags-input.js +7 -7
- package/components/tags-list/tags-list.d.ts +2 -2
- package/components/text/text.css +12 -0
- package/components/text/text.d.ts +8 -2
- package/components/text/text.js +12 -2
- package/components/toggle/toggle.css +1 -1
- package/components/toggle/toggle.d.ts +2 -2
- package/components/tooltip/tooltip.d.ts +1 -1
- package/components/user-agreement/service.js +4 -1
- package/components/user-agreement/user-agreement.d.ts +3 -11
- package/components/user-agreement/user-agreement.js +31 -30
- package/components/user-card/card.d.ts +22 -21
- package/components/user-card/card.js +29 -29
- package/components/user-card/smart-user-card-tooltip.d.ts +3 -3
- package/components/user-card/tooltip.d.ts +11 -6
- package/components/user-card/tooltip.js +1 -1
- package/components/user-card/user-card.css +10 -1
- package/dist/_helpers/_rollupPluginBabelHelpers.js +614 -1
- package/dist/_helpers/anchor.js +7 -8
- package/dist/_helpers/badge.js +1 -1
- package/dist/_helpers/button__classes.js +17 -29
- package/dist/_helpers/caption.js +31 -0
- package/dist/_helpers/card.js +100 -91
- package/dist/_helpers/date-picker.js +1 -1
- package/dist/_helpers/dialog__body-scroll-preventer.js +21 -12
- package/dist/_helpers/grid.js +1 -1
- package/dist/_helpers/header.js +1 -1
- package/dist/_helpers/icon__svg.js +73 -0
- package/dist/_helpers/input.js +228 -2
- package/dist/_helpers/island.js +1 -1
- package/dist/_helpers/list.js +1 -1
- package/dist/_helpers/query-assist__suggestions.js +92 -75
- package/dist/_helpers/select__filter.js +70 -43
- package/dist/_helpers/services-link.js +33 -21
- package/dist/_helpers/sidebar.js +87 -86
- package/dist/_helpers/tab-link.js +36 -0
- package/dist/_helpers/table.js +1 -1
- package/dist/_helpers/theme.js +43 -36
- package/dist/_helpers/title.js +66 -56
- package/dist/alert/alert.d.ts +1 -1
- package/dist/alert/alert.js +165 -130
- package/dist/alert/container.js +40 -29
- package/dist/alert-service/alert-service.d.ts +2 -2
- package/dist/alert-service/alert-service.js +170 -106
- package/dist/analytics/analytics.d.ts +21 -7
- package/dist/analytics/analytics.js +90 -71
- package/dist/analytics/analytics__custom-plugin.d.ts +6 -16
- package/dist/analytics/analytics__custom-plugin.js +74 -87
- package/dist/analytics/analytics__fus-plugin.d.ts +15 -25
- package/dist/analytics/analytics__fus-plugin.js +31 -89
- package/dist/analytics/analytics__ga-plugin.d.ts +13 -3
- package/dist/analytics/analytics__ga-plugin.js +76 -25
- package/dist/analytics/analytics__plugin-utils.d.ts +16 -0
- package/dist/analytics/analytics__plugin-utils.js +52 -21
- package/dist/auth/auth.js +40 -10
- package/dist/auth/auth__core.d.ts +5 -4
- package/dist/auth/auth__core.js +1460 -722
- package/dist/auth/background-flow.js +125 -84
- package/dist/auth/down-notification.js +77 -37
- package/dist/auth/iframe-flow.js +130 -73
- package/dist/auth/landing.js +94 -36
- package/dist/auth/request-builder.js +79 -45
- package/dist/auth/response-parser.js +117 -85
- package/dist/auth/storage.js +323 -164
- package/dist/auth/token-validator.js +239 -128
- package/dist/auth/window-flow.js +126 -83
- package/dist/auth-dialog/auth-dialog.d.ts +2 -2
- package/dist/auth-dialog/auth-dialog.js +153 -96
- package/dist/auth-dialog-service/auth-dialog-service.js +37 -12
- package/dist/avatar/avatar-example-datauri.js +1 -23
- package/dist/avatar/avatar.d.ts +3 -3
- package/dist/avatar/avatar.js +132 -99
- package/dist/avatar/fallback-avatar.d.ts +2 -2
- package/dist/avatar/fallback-avatar.js +44 -24
- package/dist/badge/badge.d.ts +2 -2
- package/dist/badge/badge.js +34 -26
- package/dist/button/button.d.ts +3 -4
- package/dist/button/button.js +90 -71
- package/dist/button/button__classes.js +1 -0
- package/dist/button-group/button-group.d.ts +2 -2
- package/dist/button-group/button-group.js +33 -17
- package/dist/button-group/caption.d.ts +2 -2
- package/dist/button-group/caption.js +5 -22
- package/dist/button-set/button-set.d.ts +2 -2
- package/dist/button-set/button-set.js +31 -16
- package/dist/button-toolbar/button-toolbar.d.ts +2 -2
- package/dist/button-toolbar/button-toolbar.js +30 -15
- package/dist/caret/caret.js +223 -188
- package/dist/checkbox/checkbox.d.ts +2 -2
- package/dist/checkbox/checkbox.js +86 -61
- package/dist/clipboard/clipboard-fallback.js +10 -10
- package/dist/clipboard/clipboard.js +132 -38
- package/dist/code/code.d.ts +1 -1
- package/dist/code/code.js +153 -81
- package/dist/confirm/confirm.d.ts +1 -1
- package/dist/confirm/confirm.js +86 -50
- package/dist/confirm-service/confirm-service.js +68 -47
- package/dist/content-layout/content-layout.d.ts +2 -2
- package/dist/content-layout/content-layout.js +53 -35
- package/dist/content-layout/sidebar.d.ts +2 -2
- package/dist/content-layout/sidebar.js +1 -0
- package/dist/contenteditable/contenteditable.d.ts +3 -3
- package/dist/contenteditable/contenteditable.js +54 -43
- package/dist/control-label/control-label.d.ts +11 -0
- package/dist/control-label/control-label.js +32 -0
- package/dist/data-list/data-list.d.ts +3 -3
- package/dist/data-list/data-list.js +166 -120
- package/dist/data-list/data-list.mock.d.ts +2 -2
- package/dist/data-list/data-list.mock.js +11 -4
- package/dist/data-list/item.d.ts +3 -3
- package/dist/data-list/item.js +141 -118
- package/dist/data-list/selection.js +139 -77
- package/dist/data-list/title.d.ts +1 -1
- package/dist/data-list/title.js +13 -3
- package/dist/date-picker/consts.d.ts +5 -5
- package/dist/date-picker/consts.js +18 -15
- package/dist/date-picker/date-input.d.ts +3 -12
- package/dist/date-picker/date-input.js +132 -111
- package/dist/date-picker/date-picker.d.ts +8 -6
- package/dist/date-picker/date-picker.js +215 -165
- package/dist/date-picker/date-popup.d.ts +1 -1
- package/dist/date-picker/date-popup.js +341 -301
- package/dist/date-picker/day.d.ts +2 -2
- package/dist/date-picker/day.js +78 -68
- package/dist/date-picker/month-names.d.ts +2 -2
- package/dist/date-picker/month-names.js +59 -41
- package/dist/date-picker/month-slider.d.ts +2 -2
- package/dist/date-picker/month-slider.js +59 -40
- package/dist/date-picker/month.d.ts +2 -2
- package/dist/date-picker/month.js +21 -15
- package/dist/date-picker/months.d.ts +2 -2
- package/dist/date-picker/months.js +80 -56
- package/dist/date-picker/weekdays.d.ts +2 -2
- package/dist/date-picker/weekdays.js +18 -12
- package/dist/date-picker/years.d.ts +6 -2
- package/dist/date-picker/years.js +102 -66
- package/dist/dialog/dialog.d.ts +4 -16
- package/dist/dialog/dialog.js +149 -100
- package/dist/dialog/dialog__body-scroll-preventer.js +5 -0
- package/dist/dropdown/anchor.d.ts +1 -1
- package/dist/dropdown/anchor.js +11 -3
- package/dist/dropdown/dropdown.d.ts +8 -1
- package/dist/dropdown/dropdown.js +159 -132
- package/dist/dropdown-menu/dropdown-menu.js +103 -77
- package/dist/editable-heading/editable-heading.d.ts +2 -2
- package/dist/editable-heading/editable-heading.js +134 -66
- package/dist/error-bubble/error-bubble.d.ts +2 -2
- package/dist/error-bubble/error-bubble.js +60 -27
- package/dist/error-message/error-message.d.ts +2 -2
- package/dist/error-message/error-message.js +55 -32
- package/dist/footer/footer.js +115 -8
- package/dist/global/compose.js +10 -1
- package/dist/global/composeRefs.js +12 -7
- package/dist/global/controls-height.d.ts +2 -0
- package/dist/global/controls-height.js +10 -2
- package/dist/global/create-stateful-context.d.ts +1 -1
- package/dist/global/create-stateful-context.js +19 -19
- package/dist/global/data-tests.js +15 -7
- package/dist/global/dom.js +93 -55
- package/dist/global/focus-sensor-hoc.d.ts +1 -0
- package/dist/global/focus-sensor-hoc.js +118 -102
- package/dist/global/fuzzy-highlight.js +41 -27
- package/dist/global/get-event-key.js +8 -8
- package/dist/global/get-uid.js +8 -4
- package/dist/global/inject-styles.js +15 -10
- package/dist/global/linear-function.js +2 -2
- package/dist/global/listeners.js +50 -28
- package/dist/global/memoize.js +13 -6
- package/dist/global/normalize-indent.js +51 -19
- package/dist/global/promise-with-timeout.js +8 -6
- package/dist/global/prop-types.js +5 -3
- package/dist/global/react-dom-renderer.d.ts +4 -4
- package/dist/global/react-dom-renderer.js +44 -28
- package/dist/global/react-render-adapter.js +21 -15
- package/dist/global/rerender-hoc.js +40 -19
- package/dist/global/schedule-raf.js +6 -5
- package/dist/global/sniffer.js +1 -1
- package/dist/global/theme.js +24 -0
- package/dist/global/trivial-template-tag.js +10 -3
- package/dist/global/typescript-utils.js +6 -2
- package/dist/global/url.js +27 -21
- package/dist/global/use-event-callback.d.ts +1 -0
- package/dist/global/use-event-callback.js +17 -0
- package/dist/grid/col.d.ts +2 -2
- package/dist/grid/col.js +42 -23
- package/dist/grid/grid.d.ts +2 -2
- package/dist/grid/grid.js +32 -13
- package/dist/grid/row.d.ts +2 -2
- package/dist/grid/row.js +32 -20
- package/dist/group/group.d.ts +2 -2
- package/dist/group/group.js +25 -14
- package/dist/header/header.d.ts +2 -2
- package/dist/header/header.js +76 -31
- package/dist/header/logo.d.ts +2 -2
- package/dist/header/logo.js +32 -14
- package/dist/header/profile.d.ts +4 -2
- package/dist/header/profile.js +155 -109
- package/dist/header/services-link.d.ts +2 -2
- package/dist/header/services-link.js +9 -2
- package/dist/header/services.d.ts +2 -2
- package/dist/header/services.js +105 -66
- package/dist/header/smart-profile.d.ts +2 -2
- package/dist/header/smart-profile.js +195 -104
- package/dist/header/smart-services.d.ts +2 -2
- package/dist/header/smart-services.js +112 -64
- package/dist/header/tray-icon.d.ts +2 -2
- package/dist/header/tray-icon.js +37 -22
- package/dist/header/tray.d.ts +2 -2
- package/dist/header/tray.js +30 -17
- package/dist/heading/heading.js +26 -27
- package/dist/http/http.d.ts +16 -6
- package/dist/http/http.js +357 -170
- package/dist/http/http.mock.js +105 -50
- package/dist/hub-source/hub-source.js +183 -77
- package/dist/hub-source/hub-source__user.js +45 -12
- package/dist/hub-source/hub-source__users-groups.d.ts +1 -1
- package/dist/hub-source/hub-source__users-groups.js +63 -34
- package/dist/i18n/i18n-context.d.ts +13 -0
- package/dist/i18n/i18n-context.js +28 -0
- package/dist/i18n/i18n.d.ts +59 -0
- package/dist/i18n/i18n.js +140 -0
- package/dist/icon/icon.d.ts +3 -3
- package/dist/icon/icon.js +78 -61
- package/dist/icon/icon__svg.d.ts +1 -1
- package/dist/icon/icon__svg.js +15 -71
- package/dist/icon/index.js +10 -2
- package/dist/input/input.d.ts +7 -1
- package/dist/input/input.js +30 -197
- package/dist/island/adaptive-island-hoc.d.ts +2 -2
- package/dist/island/adaptive-island-hoc.js +38 -27
- package/dist/island/content.d.ts +1 -1
- package/dist/island/content.js +104 -92
- package/dist/island/header.d.ts +2 -2
- package/dist/island/header.js +60 -47
- package/dist/island/island.d.ts +3 -3
- package/dist/island/island.js +33 -21
- package/dist/island-legacy/content-legacy.d.ts +2 -2
- package/dist/island-legacy/content-legacy.js +23 -13
- package/dist/island-legacy/header-legacy.d.ts +2 -2
- package/dist/island-legacy/header-legacy.js +25 -15
- package/dist/island-legacy/island-legacy.d.ts +2 -2
- package/dist/island-legacy/island-legacy.js +23 -13
- package/dist/link/clickableLink.d.ts +1 -1
- package/dist/link/clickableLink.js +43 -29
- package/dist/link/link.d.ts +8 -9
- package/dist/link/link.js +74 -63
- package/dist/list/consts.js +4 -1
- package/dist/list/list.d.ts +7 -7
- package/dist/list/list.js +500 -406
- package/dist/list/list__custom.d.ts +1 -1
- package/dist/list/list__custom.js +60 -47
- package/dist/list/list__hint.d.ts +2 -2
- package/dist/list/list__hint.js +18 -8
- package/dist/list/list__item.d.ts +2 -2
- package/dist/list/list__item.js +168 -135
- package/dist/list/list__link.d.ts +2 -2
- package/dist/list/list__link.js +54 -39
- package/dist/list/list__separator.d.ts +2 -2
- package/dist/list/list__separator.js +24 -14
- package/dist/list/list__title.d.ts +2 -2
- package/dist/list/list__title.js +32 -22
- package/dist/list/list__users-groups-source.js +131 -58
- package/dist/loader/loader.d.ts +2 -2
- package/dist/loader/loader.js +66 -34
- package/dist/loader/loader__core.js +197 -129
- package/dist/loader-inline/loader-inline.d.ts +2 -2
- package/dist/loader-inline/loader-inline.js +34 -19
- package/dist/loader-screen/loader-screen.d.ts +2 -2
- package/dist/loader-screen/loader-screen.js +45 -21
- package/dist/login-dialog/login-dialog.d.ts +2 -2
- package/dist/login-dialog/login-dialog.js +126 -81
- package/dist/login-dialog/service.js +40 -13
- package/dist/markdown/code.d.ts +2 -2
- package/dist/markdown/code.js +30 -9
- package/dist/markdown/heading.d.ts +2 -2
- package/dist/markdown/heading.js +3 -5
- package/dist/markdown/link.d.ts +2 -2
- package/dist/markdown/link.js +13 -8
- package/dist/markdown/markdown.d.ts +2 -2
- package/dist/markdown/markdown.js +67 -36
- package/dist/message/message.d.ts +3 -7
- package/dist/message/message.js +154 -121
- package/dist/old-browsers-message/old-browsers-message.js +19 -11
- package/dist/old-browsers-message/old-browsers-message__stop.js +8 -0
- package/dist/old-browsers-message/white-list.js +17 -10
- package/dist/pager/pager.d.ts +8 -13
- package/dist/pager/pager.js +260 -197
- package/dist/panel/panel.d.ts +2 -2
- package/dist/panel/panel.js +25 -14
- package/dist/permissions/permissions.js +166 -122
- package/dist/permissions/permissions__cache.js +220 -191
- package/dist/popup/popup.consts.js +1 -1
- package/dist/popup/popup.d.ts +2 -2
- package/dist/popup/popup.js +299 -236
- package/dist/popup/popup.target.js +8 -9
- package/dist/popup/position.d.ts +1 -1
- package/dist/popup/position.js +175 -154
- package/dist/popup-menu/popup-menu.d.ts +2 -2
- package/dist/popup-menu/popup-menu.js +81 -46
- package/dist/progress-bar/progress-bar.d.ts +2 -2
- package/dist/progress-bar/progress-bar.js +66 -52
- package/dist/query-assist/query-assist.d.ts +3 -7
- package/dist/query-assist/query-assist.js +679 -575
- package/dist/query-assist/query-assist__suggestions.d.ts +2 -2
- package/dist/query-assist/query-assist__suggestions.js +34 -6
- package/dist/radio/radio.d.ts +1 -1
- package/dist/radio/radio.js +28 -15
- package/dist/radio/radio__item.d.ts +1 -1
- package/dist/radio/radio__item.js +62 -45
- package/dist/select/select.d.ts +20 -9
- package/dist/select/select.js +832 -706
- package/dist/select/select__filter.d.ts +2 -3
- package/dist/select/select__filter.js +38 -8
- package/dist/select/select__popup.d.ts +48 -8
- package/dist/select/select__popup.js +430 -299
- package/dist/shortcuts/core.js +197 -146
- package/dist/shortcuts/shortcut-title.js +11 -6
- package/dist/shortcuts/shortcuts-hoc.d.ts +2 -2
- package/dist/shortcuts/shortcuts-hoc.js +43 -19
- package/dist/shortcuts/shortcuts.d.ts +1 -1
- package/dist/shortcuts/shortcuts.js +69 -43
- package/dist/storage/storage.js +35 -7
- package/dist/storage/storage__fallback.js +217 -143
- package/dist/storage/storage__local.js +156 -93
- package/dist/style.css +1 -1
- package/dist/tab-trap/tab-trap.d.ts +1 -1
- package/dist/tab-trap/tab-trap.js +117 -84
- package/dist/table/cell.d.ts +2 -2
- package/dist/table/cell.js +23 -9
- package/dist/table/disable-hover-hoc.d.ts +2 -2
- package/dist/table/disable-hover-hoc.js +44 -26
- package/dist/table/header-cell.d.ts +2 -2
- package/dist/table/header-cell.js +75 -56
- package/dist/table/header.d.ts +3 -14
- package/dist/table/header.js +103 -134
- package/dist/table/multitable.d.ts +2 -2
- package/dist/table/multitable.js +102 -86
- package/dist/table/row-with-focus-sensor.d.ts +1 -1
- package/dist/table/row-with-focus-sensor.js +70 -27
- package/dist/table/row.d.ts +2 -1
- package/dist/table/row.js +192 -158
- package/dist/table/selection-adapter.js +3 -1
- package/dist/table/selection-shortcuts-hoc.js +132 -131
- package/dist/table/selection.js +220 -150
- package/dist/table/smart-table.d.ts +3 -1
- package/dist/table/smart-table.js +88 -53
- package/dist/table/table.d.ts +6 -4
- package/dist/table/table.js +312 -250
- package/dist/tabs/collapsible-more.d.ts +3 -3
- package/dist/tabs/collapsible-more.js +91 -59
- package/dist/tabs/collapsible-tab.d.ts +1 -1
- package/dist/tabs/collapsible-tab.js +46 -42
- package/dist/tabs/collapsible-tabs.d.ts +2 -2
- package/dist/tabs/collapsible-tabs.js +167 -105
- package/dist/tabs/custom-item.js +2 -4
- package/dist/tabs/dumb-tabs.d.ts +5 -3
- package/dist/tabs/dumb-tabs.js +103 -62
- package/dist/tabs/smart-tabs.d.ts +2 -2
- package/dist/tabs/smart-tabs.js +72 -31
- package/dist/tabs/tab-link.d.ts +1 -1
- package/dist/tabs/tab-link.js +13 -35
- package/dist/tabs/tab.d.ts +2 -2
- package/dist/tabs/tab.js +26 -15
- package/dist/tabs/tabs.js +37 -7
- package/dist/tag/tag.d.ts +5 -5
- package/dist/tag/tag.js +147 -115
- package/dist/tags-input/tags-input.d.ts +9 -4
- package/dist/tags-input/tags-input.js +328 -227
- package/dist/tags-list/tags-list.d.ts +2 -2
- package/dist/tags-list/tags-list.js +62 -40
- package/dist/text/text.d.ts +8 -2
- package/dist/text/text.js +38 -17
- package/dist/toggle/toggle.d.ts +2 -2
- package/dist/toggle/toggle.js +55 -39
- package/dist/tooltip/tooltip.d.ts +1 -1
- package/dist/tooltip/tooltip.js +145 -102
- package/dist/user-agreement/service.js +411 -264
- package/dist/user-agreement/toolbox.eula.js +1 -160
- package/dist/user-agreement/user-agreement.d.ts +3 -11
- package/dist/user-agreement/user-agreement.js +107 -72
- package/dist/user-card/card.d.ts +22 -21
- package/dist/user-card/card.js +35 -5
- package/dist/user-card/smart-user-card-tooltip.d.ts +3 -3
- package/dist/user-card/smart-user-card-tooltip.js +138 -78
- package/dist/user-card/tooltip.d.ts +11 -6
- package/dist/user-card/tooltip.js +76 -36
- package/dist/user-card/user-card.js +35 -5
- package/package.json +86 -86
- package/components/auth-ng/auth-ng.examples.js +0 -41
- package/components/auth-ng/auth-ng.js +0 -143
- package/components/auth-ng/auth-ng.mock.js +0 -28
- package/components/autofocus-ng/autofocus-ng.examples.js +0 -41
- package/components/autofocus-ng/autofocus-ng.js +0 -51
- package/components/autofocus-ng/autofocus-ng.test.js +0 -49
- package/components/avatar-editor-ng/avatar-editor-ng.css +0 -104
- package/components/avatar-editor-ng/avatar-editor-ng.examples.js +0 -41
- package/components/avatar-editor-ng/avatar-editor-ng.js +0 -133
- package/components/avatar-editor-ng/avatar-editor-ng__template.js +0 -28
- package/components/avatar-ng/avatar-ng.examples.js +0 -33
- package/components/avatar-ng/avatar-ng.js +0 -7
- package/components/badge-ng/badge-ng.examples.js +0 -32
- package/components/badge-ng/badge-ng.js +0 -8
- package/components/breadcrumb-ng/breadcrumb-ng.examples.js +0 -33
- package/components/breadcrumb-ng/breadcrumb-ng.js +0 -60
- package/components/breadcrumb-ng/breadcrumb.css +0 -70
- package/components/button-group-ng/button-group-ng.css +0 -4
- package/components/button-group-ng/button-group-ng.examples.js +0 -30
- package/components/button-group-ng/button-group-ng.js +0 -43
- package/components/button-ng/button-ng.css +0 -23
- package/components/button-ng/button-ng.examples.js +0 -114
- package/components/button-ng/button-ng.js +0 -192
- package/components/button-ng/button-ng.test.js +0 -95
- package/components/button-set-ng/button-set-ng.examples.js +0 -30
- package/components/button-set-ng/button-set-ng.js +0 -22
- package/components/button-toolbar-ng/button-toolbar-ng.examples.js +0 -35
- package/components/button-toolbar-ng/button-toolbar-ng.js +0 -23
- package/components/checkbox-ng/checkbox-ng.examples.js +0 -80
- package/components/checkbox-ng/checkbox-ng.js +0 -64
- package/components/checkbox-ng/checkbox-ng.test.js +0 -61
- package/components/compiler-ng/compiler-ng.examples.js +0 -32
- package/components/compiler-ng/compiler-ng.js +0 -63
- package/components/compiler-ng/compiler-ng.test.js +0 -207
- package/components/confirm-ng/confirm-ng.examples.js +0 -43
- package/components/confirm-ng/confirm-ng.js +0 -30
- package/components/data-list-ng/data-list-ng.examples.js +0 -54
- package/components/data-list-ng/data-list-ng.js +0 -7
- package/components/dialog-ng/dialog-ng.css +0 -98
- package/components/dialog-ng/dialog-ng.examples.js +0 -240
- package/components/dialog-ng/dialog-ng.js +0 -607
- package/components/dialog-ng/dialog-ng.test.js +0 -829
- package/components/dialog-ng/dialog-ng__template.js +0 -70
- package/components/docked-panel-ng/docked-panel-ng.css +0 -28
- package/components/docked-panel-ng/docked-panel-ng.examples.js +0 -39
- package/components/docked-panel-ng/docked-panel-ng.js +0 -169
- package/components/error-message-ng/error-message-ng.examples.js +0 -33
- package/components/error-message-ng/error-message-ng.js +0 -50
- package/components/error-page-ng/error-page-ng.css +0 -6
- package/components/error-page-ng/error-page-ng.examples.js +0 -31
- package/components/error-page-ng/error-page-ng.js +0 -269
- package/components/error-page-ng/error-page-ng.test.js +0 -138
- package/components/footer-ng/footer-ng.examples.js +0 -35
- package/components/footer-ng/footer-ng.js +0 -61
- package/components/footer-ng/footer-ng.test.js +0 -41
- package/components/form-ng/error-bubble-ng.css +0 -7
- package/components/form-ng/form-ng.examples.js +0 -73
- package/components/form-ng/form-ng.js +0 -176
- package/components/global/angular-component-factory.js +0 -87
- package/components/global/angular-component-factory.test.js +0 -118
- package/components/global/ring-angular-component.js +0 -15
- package/components/global/ring-angular-component.test.js +0 -31
- package/components/group-ng/group-ng.js +0 -16
- package/components/group-ng/group.examples.js +0 -29
- package/components/heading-ng/heading-ng.examples.js +0 -29
- package/components/heading-ng/heading-ng.js +0 -8
- package/components/icon-ng/icon-ng.examples.js +0 -34
- package/components/icon-ng/icon-ng.js +0 -89
- package/components/input/input-label.d.ts +0 -10
- package/components/input/input-label.js +0 -18
- package/components/input-ng/input-ng.css +0 -7
- package/components/input-ng/input-ng.examples.js +0 -125
- package/components/input-ng/input-ng.js +0 -159
- package/components/input-ng/input-ng.test.js +0 -32
- package/components/island-ng/island-content-ng.js +0 -56
- package/components/island-ng/island-header-ng.js +0 -34
- package/components/island-ng/island-ng-class-fixer.js +0 -7
- package/components/island-ng/island-ng.examples.js +0 -54
- package/components/island-ng/island-ng.js +0 -35
- package/components/link-ng/link-ng.examples.js +0 -22
- package/components/link-ng/link-ng.js +0 -26
- package/components/link-ng/link-ng.test.js +0 -29
- package/components/loader-inline-ng/loader-inline-ng.examples.js +0 -28
- package/components/loader-inline-ng/loader-inline-ng.js +0 -17
- package/components/loader-inline-ng/loader-inline-ng.test.js +0 -28
- package/components/loader-ng/loader-ng.examples.js +0 -27
- package/components/loader-ng/loader-ng.js +0 -37
- package/components/loader-ng/loader-ng.test.js +0 -41
- package/components/loader-screen-ng/loader-screen-ng.examples.js +0 -30
- package/components/loader-screen-ng/loader-screen-ng.js +0 -95
- package/components/message-bundle-ng/message-bundle-ng.js +0 -67
- package/components/pager-ng/pager-ng.examples.js +0 -37
- package/components/pager-ng/pager-ng.js +0 -7
- package/components/palette/palette.examples.js +0 -63
- package/components/panel-ng/panel-ng.js +0 -20
- package/components/permissions-ng/permissions-ng.css +0 -5
- package/components/permissions-ng/permissions-ng.examples.js +0 -49
- package/components/permissions-ng/permissions-ng.js +0 -246
- package/components/permissions-ng/permissions-ng.test.js +0 -82
- package/components/place-under-ng/place-under-ng.examples.js +0 -94
- package/components/place-under-ng/place-under-ng.js +0 -190
- package/components/place-under-ng/place-under-ng.test.js +0 -182
- package/components/progress-bar-ng/progress-bar-ng.examples.js +0 -52
- package/components/progress-bar-ng/progress-bar-ng.js +0 -7
- package/components/promised-click-ng/promised-click-ng.examples.js +0 -42
- package/components/promised-click-ng/promised-click-ng.js +0 -118
- package/components/promised-click-ng/promised-click-ng.test.js +0 -166
- package/components/proxy-attrs/proxy-attrs.js +0 -24
- package/components/proxy-attrs/proxy-attrs.test.js +0 -102
- package/components/query-assist-ng/query-assist-ng.examples.js +0 -89
- package/components/query-assist-ng/query-assist-ng.js +0 -7
- package/components/radio-ng/radio-ng.examples.js +0 -31
- package/components/radio-ng/radio-ng.js +0 -61
- package/components/radio-ng/radio-ng.test.js +0 -55
- package/components/save-field-ng/save-field-ng.css +0 -13
- package/components/save-field-ng/save-field-ng.examples.js +0 -221
- package/components/save-field-ng/save-field-ng.js +0 -358
- package/components/save-field-ng/save-field-ng__template.js +0 -32
- package/components/select-ng/select-ng.examples.js +0 -483
- package/components/select-ng/select-ng.js +0 -561
- package/components/select-ng/select-ng.test.js +0 -620
- package/components/select-ng/select-ng__lazy.js +0 -83
- package/components/select-ng/select-ng__lazy.test.js +0 -81
- package/components/select-ng/select-ng__options.js +0 -147
- package/components/shortcuts-hint-ng/shortcuts-hint-ng.css +0 -116
- package/components/shortcuts-hint-ng/shortcuts-hint-ng.examples.js +0 -126
- package/components/shortcuts-hint-ng/shortcuts-hint-ng.js +0 -102
- package/components/shortcuts-hint-ng/shortcuts-hint-ng.test.js +0 -113
- package/components/shortcuts-hint-ng/shortcuts-hint-ng__template.js +0 -48
- package/components/shortcuts-ng/shortcuts-ng.js +0 -285
- package/components/sidebar-ng/sidebar-ng.examples.js +0 -94
- package/components/sidebar-ng/sidebar-ng.js +0 -100
- package/components/sidebar-ng/sidebar-ng.test.js +0 -37
- package/components/sidebar-ng/sidebar-ng__button-template.js +0 -18
- package/components/sidebar-ng/sidebar-ng__template.js +0 -10
- package/components/table-legacy-ng/table-legacy-ng.examples.js +0 -192
- package/components/table-legacy-ng/table-legacy-ng.js +0 -433
- package/components/table-legacy-ng/table-legacy-ng.test.js +0 -296
- package/components/table-legacy-ng/table-legacy-ng__pager.js +0 -32
- package/components/table-legacy-ng/table-legacy-ng__selection-navigate-actions.js +0 -105
- package/components/table-legacy-ng/table-legacy-ng__selection.js +0 -165
- package/components/table-legacy-ng/table-legacy-ng__toolbar.js +0 -58
- package/components/table-ng/smart-table-ng.js +0 -7
- package/components/table-ng/table-ng.examples.js +0 -84
- package/components/table-ng/table-ng.js +0 -7
- package/components/tabs-ng/tabs-ng.examples.js +0 -30
- package/components/tabs-ng/tabs-ng.js +0 -206
- package/components/tabs-ng/tabs-ng.test.js +0 -76
- package/components/tabs-ng/tabs-ng__template.js +0 -38
- package/components/tags-input-ng/tags-input-ng.examples.js +0 -41
- package/components/tags-input-ng/tags-input-ng.js +0 -7
- package/components/template-ng/template-ng.examples.js +0 -32
- package/components/template-ng/template-ng.js +0 -58
- package/components/template-ng/template-ng.test.js +0 -97
- package/components/title-ng/title-ng.examples.js +0 -30
- package/components/title-ng/title-ng.js +0 -120
- package/components/title-ng/title-ng.test.js +0 -47
- package/components/toggle-ng/toggle-ng.examples.js +0 -22
- package/components/toggle-ng/toggle-ng.js +0 -8
- package/components/tooltip-ng/tooltip-ng.css +0 -25
- package/components/tooltip-ng/tooltip-ng.examples.js +0 -36
- package/components/tooltip-ng/tooltip-ng.js +0 -100
- package/components/tooltip-ng/tooltip-ng.test.js +0 -69
- package/components/user-card-ng/user-card-ng.examples.js +0 -66
- package/components/user-card-ng/user-card-ng.js +0 -16
- package/dist/_helpers/button-group.js +0 -3
- package/dist/_helpers/button-set.js +0 -3
- package/dist/_helpers/button-toolbar.js +0 -3
- package/dist/_helpers/checkbox.js +0 -3
- package/dist/_helpers/error-message.js +0 -3
- package/dist/_helpers/footer.js +0 -110
- package/dist/_helpers/group.js +0 -3
- package/dist/_helpers/icon.js +0 -3
- package/dist/_helpers/link.js +0 -3
- package/dist/_helpers/loader-inline.js +0 -3
- package/dist/_helpers/loader-screen.js +0 -3
- package/dist/_helpers/panel.js +0 -3
- package/dist/_helpers/radio.js +0 -3
- package/dist/_helpers/tabs.js +0 -3
- package/dist/auth-ng/auth-ng.js +0 -198
- package/dist/auth-ng/auth-ng.mock.js +0 -29
- package/dist/autofocus-ng/autofocus-ng.js +0 -45
- package/dist/avatar-editor-ng/avatar-editor-ng.js +0 -161
- package/dist/avatar-editor-ng/avatar-editor-ng__template.js +0 -30
- package/dist/avatar-ng/avatar-ng.js +0 -19
- package/dist/badge-ng/badge-ng.js +0 -17
- package/dist/breadcrumb-ng/breadcrumb-ng.js +0 -61
- package/dist/button-group-ng/button-group-ng.js +0 -39
- package/dist/button-ng/button-ng.js +0 -180
- package/dist/button-set-ng/button-set-ng.js +0 -17
- package/dist/button-toolbar-ng/button-toolbar-ng.js +0 -21
- package/dist/checkbox-ng/checkbox-ng.js +0 -63
- package/dist/compiler-ng/compiler-ng.js +0 -48
- package/dist/confirm-ng/confirm-ng.js +0 -67
- package/dist/data-list-ng/data-list-ng.js +0 -57
- package/dist/dialog-ng/dialog-ng.js +0 -512
- package/dist/dialog-ng/dialog-ng__template.js +0 -72
- package/dist/docked-panel-ng/docked-panel-ng.js +0 -147
- package/dist/error-message-ng/error-message-ng.js +0 -53
- package/dist/footer-ng/footer-ng.js +0 -62
- package/dist/form-ng/form-ng.js +0 -148
- package/dist/global/angular-component-factory.js +0 -73
- package/dist/global/ring-angular-component.js +0 -19
- package/dist/group-ng/group-ng.js +0 -11
- package/dist/heading-ng/heading-ng.js +0 -16
- package/dist/icon-ng/icon-ng.js +0 -84
- package/dist/input/input-label.d.ts +0 -10
- package/dist/input/input-label.js +0 -27
- package/dist/input-ng/input-ng.js +0 -146
- package/dist/island-ng/island-content-ng.js +0 -53
- package/dist/island-ng/island-header-ng.js +0 -32
- package/dist/island-ng/island-ng-class-fixer.js +0 -9
- package/dist/island-ng/island-ng.js +0 -31
- package/dist/link-ng/link-ng.js +0 -23
- package/dist/loader-inline-ng/loader-inline-ng.js +0 -14
- package/dist/loader-ng/loader-ng.js +0 -36
- package/dist/loader-screen-ng/loader-screen-ng.js +0 -87
- package/dist/message-bundle-ng/message-bundle-ng.js +0 -68
- package/dist/pager-ng/pager-ng.js +0 -97
- package/dist/panel-ng/panel-ng.js +0 -16
- package/dist/permissions-ng/permissions-ng.js +0 -277
- package/dist/place-under-ng/place-under-ng.js +0 -138
- package/dist/progress-bar-ng/progress-bar-ng.js +0 -15
- package/dist/promised-click-ng/promised-click-ng.js +0 -107
- package/dist/proxy-attrs/proxy-attrs.js +0 -19
- package/dist/query-assist-ng/query-assist-ng.js +0 -83
- package/dist/radio-ng/radio-ng.js +0 -59
- package/dist/save-field-ng/save-field-ng.js +0 -291
- package/dist/save-field-ng/save-field-ng__template.js +0 -34
- package/dist/select-ng/select-ng.js +0 -577
- package/dist/select-ng/select-ng__lazy.js +0 -153
- package/dist/select-ng/select-ng__options.js +0 -119
- package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +0 -107
- package/dist/shortcuts-hint-ng/shortcuts-hint-ng__template.js +0 -50
- package/dist/shortcuts-ng/shortcuts-ng.js +0 -231
- package/dist/sidebar-ng/sidebar-ng.js +0 -101
- package/dist/sidebar-ng/sidebar-ng__button-template.js +0 -20
- package/dist/sidebar-ng/sidebar-ng__template.js +0 -12
- package/dist/table-legacy-ng/table-legacy-ng.js +0 -472
- package/dist/table-legacy-ng/table-legacy-ng__pager.js +0 -123
- package/dist/table-legacy-ng/table-legacy-ng__selection-navigate-actions.js +0 -92
- package/dist/table-legacy-ng/table-legacy-ng__selection.js +0 -147
- package/dist/table-legacy-ng/table-legacy-ng__toolbar.js +0 -53
- package/dist/table-ng/smart-table-ng.js +0 -67
- package/dist/table-ng/table-ng.js +0 -66
- package/dist/tabs-ng/tabs-ng.js +0 -172
- package/dist/tabs-ng/tabs-ng__template.js +0 -40
- package/dist/tags-input-ng/tags-input-ng.js +0 -90
- package/dist/template-ng/template-ng.js +0 -58
- package/dist/title-ng/title-ng.js +0 -103
- package/dist/toggle-ng/toggle-ng.js +0 -16
- package/dist/tooltip-ng/tooltip-ng.js +0 -96
- package/dist/user-card-ng/user-card-ng.js +0 -67
package/dist/auth/auth__core.js
CHANGED
|
@@ -1,22 +1,52 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
1
|
+
import { _ as _defineProperty, d as _createClass, g as _objectSpread2, l as _typeof, c as _classCallCheck, m as _toConsumableArray, h as _asyncToGenerator, i as _regeneratorRuntime } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import 'core-js/modules/es.object.to-string.js';
|
|
3
|
+
import 'core-js/modules/es.promise.js';
|
|
4
|
+
import 'core-js/modules/es.array.filter.js';
|
|
5
|
+
import 'core-js/modules/es.array.iterator.js';
|
|
6
|
+
import 'core-js/modules/es.set.js';
|
|
7
|
+
import 'core-js/modules/es.string.iterator.js';
|
|
8
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
9
|
+
import 'core-js/modules/es.array.concat.js';
|
|
10
|
+
import 'core-js/modules/es.array.includes.js';
|
|
11
|
+
import 'core-js/modules/es.string.includes.js';
|
|
12
|
+
import 'core-js/modules/es.regexp.exec.js';
|
|
13
|
+
import 'core-js/modules/es.string.replace.js';
|
|
14
|
+
import 'core-js/modules/es.regexp.to-string.js';
|
|
15
|
+
import 'core-js/modules/web.url.js';
|
|
16
|
+
import 'core-js/modules/web.url-search-params.js';
|
|
17
|
+
import 'core-js/modules/es.parse-int.js';
|
|
18
|
+
import 'core-js/modules/es.string.search.js';
|
|
2
19
|
import { getAbsoluteBaseURL, fixUrl } from '../global/url.js';
|
|
3
20
|
import Listeners from '../global/listeners.js';
|
|
4
21
|
import HTTP from '../http/http.js';
|
|
5
22
|
import promiseWithTimeout from '../global/promise-with-timeout.js';
|
|
23
|
+
import { translate, getTranslationsWithFallback, getTranslations } from '../i18n/i18n.js';
|
|
6
24
|
import AuthStorage from './storage.js';
|
|
7
25
|
import AuthResponseParser from './response-parser.js';
|
|
8
26
|
import AuthRequestBuilder from './request-builder.js';
|
|
9
27
|
import BackgroundFlow from './background-flow.js';
|
|
10
28
|
import TokenValidator from './token-validator.js';
|
|
29
|
+
import 'core-js/modules/es.string.match.js';
|
|
30
|
+
import 'core-js/modules/es.array.index-of.js';
|
|
31
|
+
import 'core-js/modules/es.map.js';
|
|
32
|
+
import 'core-js/modules/es.array.map.js';
|
|
33
|
+
import 'core-js/modules/es.weak-map.js';
|
|
34
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
|
35
|
+
import 'core-js/modules/es.object.entries.js';
|
|
36
|
+
import 'core-js/modules/es.reflect.delete-property.js';
|
|
11
37
|
import 'es6-error';
|
|
38
|
+
import 'core-js/modules/es.array.reduce.js';
|
|
39
|
+
import 'core-js/modules/es.array.sort.js';
|
|
12
40
|
import '../storage/storage.js';
|
|
13
41
|
import '../storage/storage__local.js';
|
|
42
|
+
import 'core-js/modules/es.object.keys.js';
|
|
14
43
|
import '../alert-service/alert-service.js';
|
|
15
44
|
import 'react';
|
|
16
45
|
import '../global/react-render-adapter.js';
|
|
17
46
|
import 'react-dom';
|
|
18
47
|
import '../global/get-uid.js';
|
|
19
48
|
import '../alert/alert.js';
|
|
49
|
+
import 'core-js/modules/es.object.values.js';
|
|
20
50
|
import 'classnames';
|
|
21
51
|
import 'prop-types';
|
|
22
52
|
import '@jetbrains/icons/exception';
|
|
@@ -26,15 +56,15 @@ import '@jetbrains/icons/close';
|
|
|
26
56
|
import '../icon/icon.js';
|
|
27
57
|
import 'util-deprecate';
|
|
28
58
|
import '../icon/icon__constants.js';
|
|
29
|
-
import '../_helpers/
|
|
30
|
-
import '
|
|
59
|
+
import '../_helpers/icon__svg.js';
|
|
60
|
+
import 'core-js/modules/es.string.starts-with.js';
|
|
31
61
|
import '../global/memoize.js';
|
|
32
62
|
import '../loader-inline/loader-inline.js';
|
|
33
63
|
import '../global/data-tests.js';
|
|
34
|
-
import '../_helpers/loader-inline.js';
|
|
35
64
|
import '../global/dom.js';
|
|
65
|
+
import 'core-js/modules/es.object.assign.js';
|
|
66
|
+
import 'core-js/modules/es.string.split.js';
|
|
36
67
|
import '../button/button.js';
|
|
37
|
-
import 'focus-visible';
|
|
38
68
|
import '@jetbrains/icons/chevron-10px';
|
|
39
69
|
import '../link/clickableLink.js';
|
|
40
70
|
import '../global/controls-height.js';
|
|
@@ -45,6 +75,9 @@ import '../popup/popup.js';
|
|
|
45
75
|
import '../global/schedule-raf.js';
|
|
46
76
|
import '../shortcuts/shortcuts.js';
|
|
47
77
|
import '../shortcuts/core.js';
|
|
78
|
+
import 'core-js/modules/es.array.slice.js';
|
|
79
|
+
import 'core-js/modules/es.array.splice.js';
|
|
80
|
+
import 'core-js/modules/es.array.find-index.js';
|
|
48
81
|
import 'combokeys';
|
|
49
82
|
import '../global/sniffer.js';
|
|
50
83
|
import 'sniffr';
|
|
@@ -57,19 +90,19 @@ import 'deep-equal';
|
|
|
57
90
|
import 'simply-uuid';
|
|
58
91
|
|
|
59
92
|
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
93
|
+
var DEFAULT_EXPIRES_TIMEOUT = 40 * 60;
|
|
94
|
+
var DEFAULT_BACKGROUND_TIMEOUT = 10 * 1000;
|
|
95
|
+
var DEFAULT_BACKEND_CHECK_TIMEOUT = 10 * 1000;
|
|
96
|
+
var BACKGROUND_REDIRECT_TIMEOUT = 20 * 1000;
|
|
97
|
+
var DEFAULT_WAIT_FOR_REDIRECT_TIMEOUT = 5 * 1000;
|
|
65
98
|
/* eslint-enable @typescript-eslint/no-magic-numbers */
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
99
|
+
var USER_CHANGED_EVENT = 'userChange';
|
|
100
|
+
var DOMAIN_USER_CHANGED_EVENT = 'domainUser';
|
|
101
|
+
var LOGOUT_EVENT = 'logout';
|
|
102
|
+
var LOGOUT_POSTPONED_EVENT = 'logoutPostponed';
|
|
103
|
+
var USER_CHANGE_POSTPONED_EVENT = 'changePostponed';
|
|
71
104
|
function noop() {}
|
|
72
|
-
|
|
105
|
+
var DEFAULT_CONFIG = {
|
|
73
106
|
cacheCurrentUser: false,
|
|
74
107
|
reloadOnUserChange: true,
|
|
75
108
|
embeddedLogin: false,
|
|
@@ -83,30 +116,24 @@ const DEFAULT_CONFIG = {
|
|
|
83
116
|
userFields: ['guest', 'id', 'name', 'login', 'profile/avatar/url'],
|
|
84
117
|
cleanHash: true,
|
|
85
118
|
onLogout: noop,
|
|
86
|
-
onPostponeChangedUser: ()
|
|
87
|
-
onPostponeLogout: ()
|
|
119
|
+
onPostponeChangedUser: function onPostponeChangedUser() {},
|
|
120
|
+
onPostponeLogout: function onPostponeLogout() {},
|
|
88
121
|
enableBackendStatusCheck: true,
|
|
89
122
|
backendCheckTimeout: DEFAULT_BACKEND_CHECK_TIMEOUT,
|
|
90
|
-
checkBackendIsUp: ()
|
|
91
|
-
|
|
123
|
+
checkBackendIsUp: function checkBackendIsUp() {
|
|
124
|
+
return Promise.resolve(null);
|
|
125
|
+
},
|
|
126
|
+
onBackendDown: function onBackendDown() {
|
|
127
|
+
return function () {};
|
|
128
|
+
},
|
|
92
129
|
defaultExpiresIn: DEFAULT_EXPIRES_TIMEOUT,
|
|
93
130
|
waitForRedirectTimeout: DEFAULT_WAIT_FOR_REDIRECT_TIMEOUT,
|
|
94
|
-
translations:
|
|
95
|
-
login: 'Log in',
|
|
96
|
-
loginTo: 'Log in to %serviceName%',
|
|
97
|
-
cancel: 'Cancel',
|
|
98
|
-
tryAgainLabel: 'Try again',
|
|
99
|
-
postpone: 'Postpone',
|
|
100
|
-
youHaveLoggedInAs: 'You have logged in as another user: %userName%',
|
|
101
|
-
applyChange: 'Apply change',
|
|
102
|
-
backendIsNotAvailable: 'Connection lost',
|
|
103
|
-
checkAgain: 'try again',
|
|
104
|
-
nothingHappensLink: 'Click here if nothing happens',
|
|
105
|
-
errorMessage: 'There may be a problem with your network connection. Make sure that you are online and'
|
|
106
|
-
}
|
|
131
|
+
translations: null
|
|
107
132
|
};
|
|
108
|
-
|
|
109
|
-
|
|
133
|
+
var Auth = /*#__PURE__*/function () {
|
|
134
|
+
function Auth(config) {
|
|
135
|
+
var _this = this;
|
|
136
|
+
_classCallCheck(this, Auth);
|
|
110
137
|
_defineProperty(this, "config", void 0);
|
|
111
138
|
_defineProperty(this, "listeners", new Listeners());
|
|
112
139
|
_defineProperty(this, "http", void 0);
|
|
@@ -130,782 +157,1493 @@ class Auth {
|
|
|
130
157
|
if (config.serverUri == null) {
|
|
131
158
|
throw new Error('\"serverUri\" property is required');
|
|
132
159
|
}
|
|
133
|
-
|
|
160
|
+
var unsupportedParams = ['redirect_uri', 'request_credentials', 'client_id'].filter(function (param) {
|
|
161
|
+
return config.hasOwnProperty(param);
|
|
162
|
+
});
|
|
134
163
|
if (unsupportedParams.length !== 0) {
|
|
135
|
-
throw new Error(
|
|
164
|
+
throw new Error("The following parameters are no longer supported: ".concat(unsupportedParams.join(', '), ". Please change them from snake_case to camelCase."));
|
|
136
165
|
}
|
|
137
166
|
config.userFields = config.userFields || [];
|
|
138
|
-
this.config = {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
requestCredentials,
|
|
147
|
-
scope
|
|
148
|
-
} = this.config;
|
|
149
|
-
const serverUriLength = this.config.serverUri.length;
|
|
167
|
+
this.config = _objectSpread2(_objectSpread2({}, Auth.DEFAULT_CONFIG), config);
|
|
168
|
+
var _this$config = this.config,
|
|
169
|
+
clientId = _this$config.clientId,
|
|
170
|
+
redirect = _this$config.redirect,
|
|
171
|
+
redirectUri = _this$config.redirectUri,
|
|
172
|
+
requestCredentials = _this$config.requestCredentials,
|
|
173
|
+
scope = _this$config.scope;
|
|
174
|
+
var serverUriLength = this.config.serverUri.length;
|
|
150
175
|
if (serverUriLength > 0 && this.config.serverUri.charAt(serverUriLength - 1) !== '/') {
|
|
151
176
|
this.config.serverUri += '/';
|
|
152
177
|
}
|
|
153
178
|
this.config.userParams = {
|
|
154
179
|
query: {
|
|
155
|
-
fields:
|
|
180
|
+
fields: _toConsumableArray(new Set(Auth.DEFAULT_CONFIG.userFields.concat(config.userFields))).join()
|
|
156
181
|
}
|
|
157
182
|
};
|
|
158
183
|
if (!scope.includes(Auth.DEFAULT_CONFIG.clientId)) {
|
|
159
184
|
scope.push(Auth.DEFAULT_CONFIG.clientId);
|
|
160
185
|
}
|
|
161
186
|
this._storage = new AuthStorage({
|
|
162
|
-
messagePrefix:
|
|
163
|
-
stateKeyPrefix:
|
|
164
|
-
tokenKey:
|
|
165
|
-
userKey:
|
|
187
|
+
messagePrefix: "".concat(clientId, "-message-"),
|
|
188
|
+
stateKeyPrefix: "".concat(clientId, "-states-"),
|
|
189
|
+
tokenKey: "".concat(clientId, "-token"),
|
|
190
|
+
userKey: "".concat(clientId, "-user-")
|
|
166
191
|
});
|
|
167
192
|
this._domainStorage = new AuthStorage({
|
|
168
193
|
messagePrefix: 'domain-message-'
|
|
169
194
|
});
|
|
170
195
|
this._requestBuilder = new AuthRequestBuilder({
|
|
171
196
|
authorization: this.config.serverUri + Auth.API_PATH + Auth.API_AUTH_PATH,
|
|
172
|
-
clientId,
|
|
173
|
-
redirect,
|
|
174
|
-
redirectUri,
|
|
175
|
-
requestCredentials,
|
|
197
|
+
clientId: clientId,
|
|
198
|
+
redirect: redirect,
|
|
199
|
+
redirectUri: redirectUri,
|
|
200
|
+
requestCredentials: requestCredentials,
|
|
176
201
|
scopes: scope
|
|
177
202
|
}, this._storage);
|
|
178
|
-
|
|
179
|
-
backgroundRefreshTimeout
|
|
180
|
-
} = this.config;
|
|
203
|
+
var backgroundRefreshTimeout = this.config.backgroundRefreshTimeout;
|
|
181
204
|
if (!backgroundRefreshTimeout) {
|
|
182
205
|
backgroundRefreshTimeout = this.config.embeddedLogin ? DEFAULT_BACKGROUND_TIMEOUT : BACKGROUND_REDIRECT_TIMEOUT;
|
|
183
206
|
}
|
|
184
207
|
this._backgroundFlow = new BackgroundFlow(this._requestBuilder, this._storage, backgroundRefreshTimeout);
|
|
185
208
|
if (this.config.EmbeddedLoginFlow) {
|
|
186
|
-
|
|
209
|
+
var _this$config$translat;
|
|
210
|
+
this._embeddedFlow = new this.config.EmbeddedLoginFlow(this._requestBuilder, this._storage, (_this$config$translat = this.config.translations) !== null && _this$config$translat !== void 0 ? _this$config$translat : getTranslationsWithFallback());
|
|
187
211
|
}
|
|
188
|
-
|
|
189
|
-
|
|
212
|
+
var API_BASE = this.config.serverUri + Auth.API_PATH;
|
|
213
|
+
var fetchConfig = config.fetchCredentials ? {
|
|
190
214
|
credentials: config.fetchCredentials
|
|
191
215
|
} : undefined;
|
|
192
216
|
this.http = new HTTP(this, API_BASE, fetchConfig);
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
217
|
+
var getUser = /*#__PURE__*/function () {
|
|
218
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(token) {
|
|
219
|
+
var user;
|
|
220
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
221
|
+
while (1) switch (_context.prev = _context.next) {
|
|
222
|
+
case 0:
|
|
223
|
+
_context.next = 2;
|
|
224
|
+
return _this.getUser(token);
|
|
225
|
+
case 2:
|
|
226
|
+
user = _context.sent;
|
|
227
|
+
_this.user = user;
|
|
228
|
+
return _context.abrupt("return", user);
|
|
229
|
+
case 5:
|
|
230
|
+
case "end":
|
|
231
|
+
return _context.stop();
|
|
232
|
+
}
|
|
233
|
+
}, _callee);
|
|
234
|
+
}));
|
|
235
|
+
return function getUser(_x) {
|
|
236
|
+
return _ref.apply(this, arguments);
|
|
237
|
+
};
|
|
238
|
+
}();
|
|
198
239
|
this._tokenValidator = new TokenValidator(this.config, getUser, this._storage);
|
|
199
240
|
if (this.config.onLogout) {
|
|
200
241
|
this.addListener(LOGOUT_EVENT, this.config.onLogout);
|
|
201
242
|
}
|
|
202
243
|
if (this.config.reloadOnUserChange) {
|
|
203
|
-
this.addListener(USER_CHANGED_EVENT, ()
|
|
244
|
+
this.addListener(USER_CHANGED_EVENT, function () {
|
|
245
|
+
return _this._reloadCurrentPage();
|
|
246
|
+
});
|
|
204
247
|
}
|
|
205
|
-
this.addListener(LOGOUT_POSTPONED_EVENT, ()
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
this.addListener(
|
|
248
|
+
this.addListener(LOGOUT_POSTPONED_EVENT, function () {
|
|
249
|
+
return _this._setPostponed(true);
|
|
250
|
+
});
|
|
251
|
+
this.addListener(USER_CHANGE_POSTPONED_EVENT, function () {
|
|
252
|
+
return _this._setPostponed(true);
|
|
253
|
+
});
|
|
254
|
+
this.addListener(USER_CHANGED_EVENT, function () {
|
|
255
|
+
return _this._setPostponed(false);
|
|
256
|
+
});
|
|
257
|
+
this.addListener(USER_CHANGED_EVENT, function (user) {
|
|
209
258
|
if (user) {
|
|
210
|
-
|
|
259
|
+
_this._updateDomainUser(user.id);
|
|
211
260
|
}
|
|
212
261
|
});
|
|
213
262
|
if (this.config.cacheCurrentUser) {
|
|
214
|
-
this.addListener(LOGOUT_EVENT, ()
|
|
215
|
-
|
|
263
|
+
this.addListener(LOGOUT_EVENT, function () {
|
|
264
|
+
var _this$_storage;
|
|
265
|
+
return (_this$_storage = _this._storage) === null || _this$_storage === void 0 ? void 0 : _this$_storage.wipeCachedCurrentUser();
|
|
266
|
+
});
|
|
267
|
+
this.addListener(USER_CHANGED_EVENT, function () {
|
|
268
|
+
var _this$_storage2;
|
|
269
|
+
return (_this$_storage2 = _this._storage) === null || _this$_storage2 === void 0 ? void 0 : _this$_storage2.onUserChanged();
|
|
270
|
+
});
|
|
216
271
|
}
|
|
217
272
|
this._createInitDeferred();
|
|
218
273
|
this.setUpPreconnect(config.serverUri);
|
|
219
274
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
this._domainStorage.sendMessage(DOMAIN_USER_CHANGED_EVENT, {
|
|
226
|
-
userID,
|
|
227
|
-
serviceID: this.config.clientId
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
addListener(event, handler) {
|
|
231
|
-
this.listeners.add(event, handler);
|
|
232
|
-
}
|
|
233
|
-
removeListener(event, handler) {
|
|
234
|
-
this.listeners.remove(event, handler);
|
|
235
|
-
}
|
|
236
|
-
setAuthDialogService(authDialogService) {
|
|
237
|
-
this._authDialogService = authDialogService;
|
|
238
|
-
}
|
|
239
|
-
setCurrentService(service) {
|
|
240
|
-
this._service = service;
|
|
241
|
-
}
|
|
242
|
-
_createInitDeferred() {
|
|
243
|
-
const deferred = {};
|
|
244
|
-
deferred.promise = new Promise((resolve, reject) => {
|
|
245
|
-
deferred.resolve = resolve;
|
|
246
|
-
deferred.reject = reject;
|
|
247
|
-
});
|
|
248
|
-
this._initDeferred = deferred;
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* @return {Promise.<string>} absolute URL promise that is resolved to a URL
|
|
252
|
-
* that should be restored after returning back from auth server.
|
|
253
|
-
*/
|
|
254
|
-
async init() {
|
|
255
|
-
this._storage?.onTokenChange(async token => {
|
|
256
|
-
const isGuest = this.user ? this.user.guest : false;
|
|
257
|
-
if (isGuest && !token) {
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
if (!token) {
|
|
261
|
-
this.logout();
|
|
262
|
-
} else {
|
|
263
|
-
try {
|
|
264
|
-
await this._detectUserChange(token.accessToken);
|
|
265
|
-
} catch (error) {
|
|
266
|
-
if (!(error instanceof Error)) {
|
|
267
|
-
throw error;
|
|
268
|
-
}
|
|
269
|
-
if (this._canShowDialogs()) {
|
|
270
|
-
this._showAuthDialog({
|
|
271
|
-
nonInteractive: true,
|
|
272
|
-
error
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
});
|
|
278
|
-
this._domainStorage.onMessage(DOMAIN_USER_CHANGED_EVENT, message => {
|
|
279
|
-
const {
|
|
280
|
-
userID,
|
|
281
|
-
serviceID
|
|
282
|
-
} = message || {};
|
|
283
|
-
if (serviceID === this.config.clientId) {
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
if (this.user && userID === this.user.id) {
|
|
287
|
-
return;
|
|
288
|
-
}
|
|
289
|
-
this.forceTokenUpdate();
|
|
290
|
-
});
|
|
291
|
-
let state;
|
|
292
|
-
try {
|
|
293
|
-
// Look for token or error in hash
|
|
294
|
-
state = await this._checkForAuthResponse();
|
|
295
|
-
} catch (error) {
|
|
296
|
-
return error instanceof Error ? this.handleInitError(error) : undefined;
|
|
275
|
+
_createClass(Auth, [{
|
|
276
|
+
key: "_setPostponed",
|
|
277
|
+
value: function _setPostponed() {
|
|
278
|
+
var postponed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
279
|
+
this._postponed = postponed;
|
|
297
280
|
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
281
|
+
}, {
|
|
282
|
+
key: "_updateDomainUser",
|
|
283
|
+
value: function _updateDomainUser(userID) {
|
|
284
|
+
this._domainStorage.sendMessage(DOMAIN_USER_CHANGED_EVENT, {
|
|
285
|
+
userID: userID,
|
|
286
|
+
serviceID: this.config.clientId
|
|
287
|
+
});
|
|
301
288
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
const message = await this._domainStorage._messagesStorage.get(`domain-message-${DOMAIN_USER_CHANGED_EVENT}`);
|
|
307
|
-
if (message) {
|
|
308
|
-
const {
|
|
309
|
-
userID,
|
|
310
|
-
serviceID
|
|
311
|
-
} = message;
|
|
312
|
-
if (serviceID !== this.config.clientId && (!userID || this.user?.id !== userID)) {
|
|
313
|
-
this.forceTokenUpdate();
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
// Access token appears to be valid.
|
|
317
|
-
// We may resolve restoreLocation URL now
|
|
318
|
-
if (!state) {
|
|
319
|
-
// Check if we have requested to restore state anyway
|
|
320
|
-
state = await this._checkForStateRestoration();
|
|
321
|
-
}
|
|
322
|
-
this._initDeferred?.resolve?.(state && state.restoreLocation);
|
|
323
|
-
return state?.restoreLocation;
|
|
324
|
-
} catch (error) {
|
|
325
|
-
if (Auth.storageIsUnavailable) {
|
|
326
|
-
this._initDeferred?.resolve?.(); // No way to handle if cookies are disabled
|
|
327
|
-
await this.requestUser(); // Someone may expect user to be loaded as a part of token validation
|
|
328
|
-
return null;
|
|
329
|
-
}
|
|
330
|
-
return error instanceof Error ? this.handleInitValidationError(error) : undefined;
|
|
289
|
+
}, {
|
|
290
|
+
key: "addListener",
|
|
291
|
+
value: function addListener(event, handler) {
|
|
292
|
+
this.listeners.add(event, handler);
|
|
331
293
|
}
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
this._redirectCurrentPage(authRequest.url);
|
|
294
|
+
}, {
|
|
295
|
+
key: "removeListener",
|
|
296
|
+
value: function removeListener(event, handler) {
|
|
297
|
+
this.listeners.remove(event, handler);
|
|
337
298
|
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
throw error;
|
|
343
|
-
}
|
|
344
|
-
async handleInitError(error) {
|
|
345
|
-
if ('stateId' in error && error.stateId) {
|
|
346
|
-
try {
|
|
347
|
-
const state = await this._storage?.getState(error.stateId);
|
|
348
|
-
if (state && state.nonRedirect) {
|
|
349
|
-
state.error = error;
|
|
350
|
-
this._storage?.saveState(error.stateId, state);
|
|
351
|
-
// Return endless promise in the background to avoid service start
|
|
352
|
-
return new Promise(noop);
|
|
353
|
-
}
|
|
354
|
-
} catch (e) {
|
|
355
|
-
// Throw the original error instead below
|
|
356
|
-
}
|
|
299
|
+
}, {
|
|
300
|
+
key: "setAuthDialogService",
|
|
301
|
+
value: function setAuthDialogService(authDialogService) {
|
|
302
|
+
this._authDialogService = authDialogService;
|
|
357
303
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
// eslint-disable-next-line no-console
|
|
363
|
-
console.error('RingUI Auth: invalid client detected. Logging out', error);
|
|
364
|
-
await this.logout();
|
|
365
|
-
return undefined;
|
|
304
|
+
}, {
|
|
305
|
+
key: "setCurrentService",
|
|
306
|
+
value: function setCurrentService(service) {
|
|
307
|
+
this._service = service;
|
|
366
308
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
309
|
+
}, {
|
|
310
|
+
key: "_createInitDeferred",
|
|
311
|
+
value: function _createInitDeferred() {
|
|
312
|
+
var deferred = {};
|
|
313
|
+
deferred.promise = new Promise(function (resolve, reject) {
|
|
314
|
+
deferred.resolve = resolve;
|
|
315
|
+
deferred.reject = reject;
|
|
316
|
+
});
|
|
317
|
+
this._initDeferred = deferred;
|
|
370
318
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
319
|
+
/**
|
|
320
|
+
* @return {Promise.<string>} absolute URL promise that is resolved to a URL
|
|
321
|
+
* that should be restored after returning back from auth server.
|
|
322
|
+
*/
|
|
323
|
+
}, {
|
|
324
|
+
key: "init",
|
|
325
|
+
value: function () {
|
|
326
|
+
var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
327
|
+
var _this$_storage3,
|
|
328
|
+
_this2 = this;
|
|
329
|
+
var state, _this$_tokenValidator, _this$_initDeferred, _this$_initDeferred$r, _state, message, _this$user, userID, serviceID, _this$_initDeferred2, _this$_initDeferred2$;
|
|
330
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
331
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
332
|
+
case 0:
|
|
333
|
+
(_this$_storage3 = this._storage) === null || _this$_storage3 === void 0 ? void 0 : _this$_storage3.onTokenChange( /*#__PURE__*/function () {
|
|
334
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(token) {
|
|
335
|
+
var isGuest;
|
|
336
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
337
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
338
|
+
case 0:
|
|
339
|
+
isGuest = _this2.user ? _this2.user.guest : false;
|
|
340
|
+
if (!(isGuest && !token)) {
|
|
341
|
+
_context2.next = 3;
|
|
342
|
+
break;
|
|
343
|
+
}
|
|
344
|
+
return _context2.abrupt("return");
|
|
345
|
+
case 3:
|
|
346
|
+
if (token) {
|
|
347
|
+
_context2.next = 7;
|
|
348
|
+
break;
|
|
349
|
+
}
|
|
350
|
+
_this2.logout();
|
|
351
|
+
_context2.next = 17;
|
|
352
|
+
break;
|
|
353
|
+
case 7:
|
|
354
|
+
_context2.prev = 7;
|
|
355
|
+
_context2.next = 10;
|
|
356
|
+
return _this2._detectUserChange(token.accessToken);
|
|
357
|
+
case 10:
|
|
358
|
+
_context2.next = 17;
|
|
359
|
+
break;
|
|
360
|
+
case 12:
|
|
361
|
+
_context2.prev = 12;
|
|
362
|
+
_context2.t0 = _context2["catch"](7);
|
|
363
|
+
if (_context2.t0 instanceof Error) {
|
|
364
|
+
_context2.next = 16;
|
|
365
|
+
break;
|
|
366
|
+
}
|
|
367
|
+
throw _context2.t0;
|
|
368
|
+
case 16:
|
|
369
|
+
if (_this2._canShowDialogs()) {
|
|
370
|
+
_this2._showAuthDialog({
|
|
371
|
+
nonInteractive: true,
|
|
372
|
+
error: _context2.t0
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
case 17:
|
|
376
|
+
case "end":
|
|
377
|
+
return _context2.stop();
|
|
378
|
+
}
|
|
379
|
+
}, _callee2, null, [[7, 12]]);
|
|
380
|
+
}));
|
|
381
|
+
return function (_x2) {
|
|
382
|
+
return _ref2.apply(this, arguments);
|
|
383
|
+
};
|
|
384
|
+
}());
|
|
385
|
+
this._domainStorage.onMessage(DOMAIN_USER_CHANGED_EVENT, function (message) {
|
|
386
|
+
var _ref3 = message || {},
|
|
387
|
+
userID = _ref3.userID,
|
|
388
|
+
serviceID = _ref3.serviceID;
|
|
389
|
+
if (serviceID === _this2.config.clientId) {
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
if (_this2.user && userID === _this2.user.id) {
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
_this2.forceTokenUpdate();
|
|
396
|
+
});
|
|
397
|
+
_context3.prev = 2;
|
|
398
|
+
_context3.next = 5;
|
|
399
|
+
return this._checkForAuthResponse();
|
|
400
|
+
case 5:
|
|
401
|
+
state = _context3.sent;
|
|
402
|
+
_context3.next = 11;
|
|
403
|
+
break;
|
|
404
|
+
case 8:
|
|
405
|
+
_context3.prev = 8;
|
|
406
|
+
_context3.t0 = _context3["catch"](2);
|
|
407
|
+
return _context3.abrupt("return", _context3.t0 instanceof Error ? this.handleInitError(_context3.t0) : undefined);
|
|
408
|
+
case 11:
|
|
409
|
+
if (!(state && state.nonRedirect)) {
|
|
410
|
+
_context3.next = 13;
|
|
411
|
+
break;
|
|
412
|
+
}
|
|
413
|
+
return _context3.abrupt("return", new Promise(noop));
|
|
414
|
+
case 13:
|
|
415
|
+
_context3.prev = 13;
|
|
416
|
+
_context3.next = 16;
|
|
417
|
+
return (_this$_tokenValidator = this._tokenValidator) === null || _this$_tokenValidator === void 0 ? void 0 : _this$_tokenValidator.validateToken();
|
|
418
|
+
case 16:
|
|
419
|
+
_context3.next = 18;
|
|
420
|
+
return this._domainStorage._messagesStorage.get("domain-message-".concat(DOMAIN_USER_CHANGED_EVENT));
|
|
421
|
+
case 18:
|
|
422
|
+
message = _context3.sent;
|
|
423
|
+
if (message) {
|
|
424
|
+
userID = message.userID, serviceID = message.serviceID;
|
|
425
|
+
if (serviceID !== this.config.clientId && (!userID || ((_this$user = this.user) === null || _this$user === void 0 ? void 0 : _this$user.id) !== userID)) {
|
|
426
|
+
this.forceTokenUpdate();
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
// Access token appears to be valid.
|
|
430
|
+
// We may resolve restoreLocation URL now
|
|
431
|
+
if (state) {
|
|
432
|
+
_context3.next = 24;
|
|
433
|
+
break;
|
|
434
|
+
}
|
|
435
|
+
_context3.next = 23;
|
|
436
|
+
return this._checkForStateRestoration();
|
|
437
|
+
case 23:
|
|
438
|
+
state = _context3.sent;
|
|
439
|
+
case 24:
|
|
440
|
+
(_this$_initDeferred = this._initDeferred) === null || _this$_initDeferred === void 0 || (_this$_initDeferred$r = _this$_initDeferred.resolve) === null || _this$_initDeferred$r === void 0 ? void 0 : _this$_initDeferred$r.call(_this$_initDeferred, state && state.restoreLocation);
|
|
441
|
+
return _context3.abrupt("return", (_state = state) === null || _state === void 0 ? void 0 : _state.restoreLocation);
|
|
442
|
+
case 28:
|
|
443
|
+
_context3.prev = 28;
|
|
444
|
+
_context3.t1 = _context3["catch"](13);
|
|
445
|
+
if (!Auth.storageIsUnavailable) {
|
|
446
|
+
_context3.next = 35;
|
|
447
|
+
break;
|
|
448
|
+
}
|
|
449
|
+
(_this$_initDeferred2 = this._initDeferred) === null || _this$_initDeferred2 === void 0 || (_this$_initDeferred2$ = _this$_initDeferred2.resolve) === null || _this$_initDeferred2$ === void 0 ? void 0 : _this$_initDeferred2$.call(_this$_initDeferred2); // No way to handle if cookies are disabled
|
|
450
|
+
_context3.next = 34;
|
|
451
|
+
return this.requestUser();
|
|
452
|
+
case 34:
|
|
453
|
+
return _context3.abrupt("return", null);
|
|
454
|
+
case 35:
|
|
455
|
+
return _context3.abrupt("return", _context3.t1 instanceof Error ? this.handleInitValidationError(_context3.t1) : undefined);
|
|
456
|
+
case 36:
|
|
457
|
+
case "end":
|
|
458
|
+
return _context3.stop();
|
|
459
|
+
}
|
|
460
|
+
}, _callee3, this, [[2, 8], [13, 28]]);
|
|
461
|
+
}));
|
|
462
|
+
function init() {
|
|
463
|
+
return _init.apply(this, arguments);
|
|
381
464
|
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
465
|
+
return init;
|
|
466
|
+
}()
|
|
467
|
+
}, {
|
|
468
|
+
key: "sendRedirect",
|
|
469
|
+
value: function () {
|
|
470
|
+
var _sendRedirect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(error) {
|
|
471
|
+
var _this$_requestBuilder,
|
|
472
|
+
_this3 = this;
|
|
473
|
+
var authRequest;
|
|
474
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
475
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
476
|
+
case 0:
|
|
477
|
+
_context4.next = 2;
|
|
478
|
+
return (_this$_requestBuilder = this._requestBuilder) === null || _this$_requestBuilder === void 0 ? void 0 : _this$_requestBuilder.prepareAuthRequest();
|
|
479
|
+
case 2:
|
|
480
|
+
authRequest = _context4.sent;
|
|
481
|
+
if (authRequest != null) {
|
|
482
|
+
this._redirectCurrentPage(authRequest.url);
|
|
483
|
+
}
|
|
484
|
+
// HUB-10867 Since we already redirecting the page, there is no actual need to throw an error
|
|
485
|
+
// and scare user with flashing error
|
|
486
|
+
// But let's keep it just in case redirect was not successful
|
|
487
|
+
_context4.next = 6;
|
|
488
|
+
return new Promise(function (resolve) {
|
|
489
|
+
return setTimeout(resolve, _this3.config.waitForRedirectTimeout);
|
|
490
|
+
});
|
|
491
|
+
case 6:
|
|
492
|
+
throw error;
|
|
493
|
+
case 7:
|
|
494
|
+
case "end":
|
|
495
|
+
return _context4.stop();
|
|
496
|
+
}
|
|
497
|
+
}, _callee4, this);
|
|
498
|
+
}));
|
|
499
|
+
function sendRedirect(_x3) {
|
|
500
|
+
return _sendRedirect.apply(this, arguments);
|
|
400
501
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
502
|
+
return sendRedirect;
|
|
503
|
+
}()
|
|
504
|
+
}, {
|
|
505
|
+
key: "handleInitError",
|
|
506
|
+
value: function () {
|
|
507
|
+
var _handleInitError = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(error) {
|
|
508
|
+
var _this$_storage4, state, _this$_storage5;
|
|
509
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
510
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
511
|
+
case 0:
|
|
512
|
+
if (!('stateId' in error && error.stateId)) {
|
|
513
|
+
_context5.next = 13;
|
|
514
|
+
break;
|
|
515
|
+
}
|
|
516
|
+
_context5.prev = 1;
|
|
517
|
+
_context5.next = 4;
|
|
518
|
+
return (_this$_storage4 = this._storage) === null || _this$_storage4 === void 0 ? void 0 : _this$_storage4.getState(error.stateId);
|
|
519
|
+
case 4:
|
|
520
|
+
state = _context5.sent;
|
|
521
|
+
if (!(state && state.nonRedirect)) {
|
|
522
|
+
_context5.next = 9;
|
|
523
|
+
break;
|
|
524
|
+
}
|
|
525
|
+
state.error = error;
|
|
526
|
+
(_this$_storage5 = this._storage) === null || _this$_storage5 === void 0 ? void 0 : _this$_storage5.saveState(error.stateId, state);
|
|
527
|
+
// Return endless promise in the background to avoid service start
|
|
528
|
+
return _context5.abrupt("return", new Promise(noop));
|
|
529
|
+
case 9:
|
|
530
|
+
_context5.next = 13;
|
|
531
|
+
break;
|
|
532
|
+
case 11:
|
|
533
|
+
_context5.prev = 11;
|
|
534
|
+
_context5.t0 = _context5["catch"](1);
|
|
535
|
+
case 13:
|
|
536
|
+
throw error;
|
|
537
|
+
case 14:
|
|
538
|
+
case "end":
|
|
539
|
+
return _context5.stop();
|
|
540
|
+
}
|
|
541
|
+
}, _callee5, this, [[1, 11]]);
|
|
542
|
+
}));
|
|
543
|
+
function handleInitError(_x4) {
|
|
544
|
+
return _handleInitError.apply(this, arguments);
|
|
415
545
|
}
|
|
416
|
-
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
546
|
+
return handleInitError;
|
|
547
|
+
}()
|
|
548
|
+
}, {
|
|
549
|
+
key: "handleInitValidationError",
|
|
550
|
+
value: function () {
|
|
551
|
+
var _handleInitValidationError = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(error) {
|
|
552
|
+
var _error$cause, _this$_initDeferred4, _this$_initDeferred4$;
|
|
553
|
+
var _this$_backgroundFlow, _this$_tokenValidator2, _this$_initDeferred3, _this$_initDeferred3$;
|
|
554
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
555
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
556
|
+
case 0:
|
|
557
|
+
if (!('cause' in error && error.cause instanceof Error && ((_error$cause = error.cause) === null || _error$cause === void 0 ? void 0 : _error$cause.message) === 'invalid_client')) {
|
|
558
|
+
_context6.next = 5;
|
|
559
|
+
break;
|
|
560
|
+
}
|
|
561
|
+
// eslint-disable-next-line no-console
|
|
562
|
+
console.error('RingUI Auth: invalid client detected. Logging out', error);
|
|
563
|
+
_context6.next = 4;
|
|
564
|
+
return this.logout();
|
|
565
|
+
case 4:
|
|
566
|
+
return _context6.abrupt("return", undefined);
|
|
567
|
+
case 5:
|
|
568
|
+
if (!('authRedirect' in error && error.authRedirect && this.config.redirect)) {
|
|
569
|
+
_context6.next = 7;
|
|
570
|
+
break;
|
|
571
|
+
}
|
|
572
|
+
return _context6.abrupt("return", this.sendRedirect(error));
|
|
573
|
+
case 7:
|
|
574
|
+
if (!('authRedirect' in error && error.authRedirect && !this.config.redirect)) {
|
|
575
|
+
_context6.next = 20;
|
|
576
|
+
break;
|
|
577
|
+
}
|
|
578
|
+
_context6.prev = 8;
|
|
579
|
+
_context6.next = 11;
|
|
580
|
+
return (_this$_backgroundFlow = this._backgroundFlow) === null || _this$_backgroundFlow === void 0 ? void 0 : _this$_backgroundFlow.authorize();
|
|
581
|
+
case 11:
|
|
582
|
+
_context6.next = 13;
|
|
583
|
+
return (_this$_tokenValidator2 = this._tokenValidator) === null || _this$_tokenValidator2 === void 0 ? void 0 : _this$_tokenValidator2.validateToken();
|
|
584
|
+
case 13:
|
|
585
|
+
(_this$_initDeferred3 = this._initDeferred) === null || _this$_initDeferred3 === void 0 || (_this$_initDeferred3$ = _this$_initDeferred3.resolve) === null || _this$_initDeferred3$ === void 0 ? void 0 : _this$_initDeferred3$.call(_this$_initDeferred3);
|
|
586
|
+
return _context6.abrupt("return", undefined);
|
|
587
|
+
case 17:
|
|
588
|
+
_context6.prev = 17;
|
|
589
|
+
_context6.t0 = _context6["catch"](8);
|
|
590
|
+
return _context6.abrupt("return", _context6.t0 instanceof Error ? this.sendRedirect(_context6.t0) : undefined);
|
|
591
|
+
case 20:
|
|
592
|
+
(_this$_initDeferred4 = this._initDeferred) === null || _this$_initDeferred4 === void 0 || (_this$_initDeferred4$ = _this$_initDeferred4.reject) === null || _this$_initDeferred4$ === void 0 ? void 0 : _this$_initDeferred4$.call(_this$_initDeferred4, error);
|
|
593
|
+
throw error;
|
|
594
|
+
case 22:
|
|
595
|
+
case "end":
|
|
596
|
+
return _context6.stop();
|
|
597
|
+
}
|
|
598
|
+
}, _callee6, this, [[8, 17]]);
|
|
599
|
+
}));
|
|
600
|
+
function handleInitValidationError(_x5) {
|
|
601
|
+
return _handleInitValidationError.apply(this, arguments);
|
|
428
602
|
}
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
603
|
+
return handleInitValidationError;
|
|
604
|
+
}()
|
|
605
|
+
/**
|
|
606
|
+
* Get token from local storage or request it if necessary.
|
|
607
|
+
* Can redirect to login page.
|
|
608
|
+
* @return {Promise.<string>}
|
|
609
|
+
*/
|
|
610
|
+
}, {
|
|
611
|
+
key: "requestToken",
|
|
612
|
+
value: function () {
|
|
613
|
+
var _requestToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
614
|
+
var _this$_initDeferred5, _yield$this$_tokenVal, _this$_tokenValidator3;
|
|
615
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
616
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
617
|
+
case 0:
|
|
618
|
+
if (!this._postponed) {
|
|
619
|
+
_context7.next = 2;
|
|
620
|
+
break;
|
|
621
|
+
}
|
|
622
|
+
throw new Error('You should log in to be able to make requests');
|
|
623
|
+
case 2:
|
|
624
|
+
_context7.prev = 2;
|
|
625
|
+
_context7.next = 5;
|
|
626
|
+
return (_this$_initDeferred5 = this._initDeferred) === null || _this$_initDeferred5 === void 0 ? void 0 : _this$_initDeferred5.promise;
|
|
627
|
+
case 5:
|
|
628
|
+
if (!Auth.storageIsUnavailable) {
|
|
629
|
+
_context7.next = 7;
|
|
630
|
+
break;
|
|
631
|
+
}
|
|
632
|
+
return _context7.abrupt("return", null);
|
|
633
|
+
case 7:
|
|
634
|
+
_context7.next = 9;
|
|
635
|
+
return (_this$_tokenValidator3 = this._tokenValidator) === null || _this$_tokenValidator3 === void 0 ? void 0 : _this$_tokenValidator3.validateTokenLocally();
|
|
636
|
+
case 9:
|
|
637
|
+
_context7.t1 = _yield$this$_tokenVal = _context7.sent;
|
|
638
|
+
_context7.t0 = _context7.t1 !== null;
|
|
639
|
+
if (!_context7.t0) {
|
|
640
|
+
_context7.next = 13;
|
|
641
|
+
break;
|
|
642
|
+
}
|
|
643
|
+
_context7.t0 = _yield$this$_tokenVal !== void 0;
|
|
644
|
+
case 13:
|
|
645
|
+
if (!_context7.t0) {
|
|
646
|
+
_context7.next = 17;
|
|
647
|
+
break;
|
|
648
|
+
}
|
|
649
|
+
_context7.t2 = _yield$this$_tokenVal;
|
|
650
|
+
_context7.next = 18;
|
|
651
|
+
break;
|
|
652
|
+
case 17:
|
|
653
|
+
_context7.t2 = null;
|
|
654
|
+
case 18:
|
|
655
|
+
return _context7.abrupt("return", _context7.t2);
|
|
656
|
+
case 21:
|
|
657
|
+
_context7.prev = 21;
|
|
658
|
+
_context7.t3 = _context7["catch"](2);
|
|
659
|
+
return _context7.abrupt("return", this.forceTokenUpdate());
|
|
660
|
+
case 24:
|
|
661
|
+
case "end":
|
|
662
|
+
return _context7.stop();
|
|
663
|
+
}
|
|
664
|
+
}, _callee7, this, [[2, 21]]);
|
|
665
|
+
}));
|
|
666
|
+
function requestToken() {
|
|
667
|
+
return _requestToken.apply(this, arguments);
|
|
668
|
+
}
|
|
669
|
+
return requestToken;
|
|
670
|
+
}()
|
|
671
|
+
/**
|
|
672
|
+
* Get new token in the background or redirect to the login page.
|
|
673
|
+
* @return {Promise.<string>}
|
|
674
|
+
*/
|
|
675
|
+
}, {
|
|
676
|
+
key: "forceTokenUpdate",
|
|
677
|
+
value: function () {
|
|
678
|
+
var _forceTokenUpdate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
679
|
+
var _this4 = this;
|
|
680
|
+
var _yield$this$_backgrou, _this$_backgroundFlow2, _this$_requestBuilder2, authRequest;
|
|
681
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
682
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
683
|
+
case 0:
|
|
684
|
+
_context9.prev = 0;
|
|
685
|
+
if (!this._backendCheckPromise) {
|
|
686
|
+
this._backendCheckPromise = this._checkBackendsStatusesIfEnabled();
|
|
687
|
+
}
|
|
688
|
+
_context9.next = 4;
|
|
689
|
+
return this._backendCheckPromise;
|
|
690
|
+
case 4:
|
|
691
|
+
_context9.next = 9;
|
|
692
|
+
break;
|
|
693
|
+
case 6:
|
|
694
|
+
_context9.prev = 6;
|
|
695
|
+
_context9.t0 = _context9["catch"](0);
|
|
696
|
+
throw new Error('Cannot refresh token: backend is not available. Postponed by user.');
|
|
697
|
+
case 9:
|
|
698
|
+
_context9.prev = 9;
|
|
699
|
+
this._backendCheckPromise = null;
|
|
700
|
+
return _context9.finish(9);
|
|
701
|
+
case 12:
|
|
702
|
+
_context9.prev = 12;
|
|
703
|
+
_context9.next = 15;
|
|
704
|
+
return (_this$_backgroundFlow2 = this._backgroundFlow) === null || _this$_backgroundFlow2 === void 0 ? void 0 : _this$_backgroundFlow2.authorize();
|
|
705
|
+
case 15:
|
|
706
|
+
_context9.t2 = _yield$this$_backgrou = _context9.sent;
|
|
707
|
+
_context9.t1 = _context9.t2 !== null;
|
|
708
|
+
if (!_context9.t1) {
|
|
709
|
+
_context9.next = 19;
|
|
710
|
+
break;
|
|
711
|
+
}
|
|
712
|
+
_context9.t1 = _yield$this$_backgrou !== void 0;
|
|
713
|
+
case 19:
|
|
714
|
+
if (!_context9.t1) {
|
|
715
|
+
_context9.next = 23;
|
|
716
|
+
break;
|
|
717
|
+
}
|
|
718
|
+
_context9.t3 = _yield$this$_backgrou;
|
|
719
|
+
_context9.next = 24;
|
|
720
|
+
break;
|
|
721
|
+
case 23:
|
|
722
|
+
_context9.t3 = null;
|
|
723
|
+
case 24:
|
|
724
|
+
return _context9.abrupt("return", _context9.t3);
|
|
725
|
+
case 27:
|
|
726
|
+
_context9.prev = 27;
|
|
727
|
+
_context9.t4 = _context9["catch"](12);
|
|
728
|
+
if (_context9.t4 instanceof Error) {
|
|
729
|
+
_context9.next = 31;
|
|
730
|
+
break;
|
|
731
|
+
}
|
|
732
|
+
return _context9.abrupt("return", null);
|
|
733
|
+
case 31:
|
|
734
|
+
if (!this._canShowDialogs()) {
|
|
735
|
+
_context9.next = 35;
|
|
736
|
+
break;
|
|
737
|
+
}
|
|
738
|
+
return _context9.abrupt("return", new Promise(function (resolve) {
|
|
739
|
+
var onTryAgain = /*#__PURE__*/function () {
|
|
740
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
741
|
+
var _this4$_backgroundFlo, result;
|
|
742
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
743
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
744
|
+
case 0:
|
|
745
|
+
_context8.prev = 0;
|
|
746
|
+
_context8.next = 3;
|
|
747
|
+
return (_this4$_backgroundFlo = _this4._backgroundFlow) === null || _this4$_backgroundFlo === void 0 ? void 0 : _this4$_backgroundFlo.authorize();
|
|
748
|
+
case 3:
|
|
749
|
+
result = _context8.sent;
|
|
750
|
+
resolve(result !== null && result !== void 0 ? result : null);
|
|
751
|
+
_context8.next = 11;
|
|
752
|
+
break;
|
|
753
|
+
case 7:
|
|
754
|
+
_context8.prev = 7;
|
|
755
|
+
_context8.t0 = _context8["catch"](0);
|
|
756
|
+
if (_context8.t0 instanceof Error) {
|
|
757
|
+
_this4._showAuthDialog({
|
|
758
|
+
nonInteractive: true,
|
|
759
|
+
error: _context8.t0,
|
|
760
|
+
onTryAgain: onTryAgain
|
|
761
|
+
});
|
|
762
|
+
}
|
|
763
|
+
throw _context8.t0;
|
|
764
|
+
case 11:
|
|
765
|
+
case "end":
|
|
766
|
+
return _context8.stop();
|
|
767
|
+
}
|
|
768
|
+
}, _callee8, null, [[0, 7]]);
|
|
769
|
+
}));
|
|
770
|
+
return function onTryAgain() {
|
|
771
|
+
return _ref4.apply(this, arguments);
|
|
772
|
+
};
|
|
773
|
+
}();
|
|
774
|
+
_this4._showAuthDialog({
|
|
438
775
|
nonInteractive: true,
|
|
439
|
-
error:
|
|
440
|
-
onTryAgain
|
|
776
|
+
error: _context9.t4,
|
|
777
|
+
onTryAgain: onTryAgain
|
|
441
778
|
});
|
|
779
|
+
}));
|
|
780
|
+
case 35:
|
|
781
|
+
_context9.next = 37;
|
|
782
|
+
return (_this$_requestBuilder2 = this._requestBuilder) === null || _this$_requestBuilder2 === void 0 ? void 0 : _this$_requestBuilder2.prepareAuthRequest();
|
|
783
|
+
case 37:
|
|
784
|
+
authRequest = _context9.sent;
|
|
785
|
+
if (authRequest != null) {
|
|
786
|
+
this._redirectCurrentPage(authRequest.url);
|
|
442
787
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
const authRequest = await this._requestBuilder?.prepareAuthRequest();
|
|
454
|
-
if (authRequest != null) {
|
|
455
|
-
this._redirectCurrentPage(authRequest.url);
|
|
456
|
-
}
|
|
788
|
+
case 39:
|
|
789
|
+
throw new TokenValidator.TokenValidationError(_context9.t4.message);
|
|
790
|
+
case 40:
|
|
791
|
+
case "end":
|
|
792
|
+
return _context9.stop();
|
|
793
|
+
}
|
|
794
|
+
}, _callee9, this, [[0, 6, 9, 12], [12, 27]]);
|
|
795
|
+
}));
|
|
796
|
+
function forceTokenUpdate() {
|
|
797
|
+
return _forceTokenUpdate.apply(this, arguments);
|
|
457
798
|
}
|
|
458
|
-
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
return user;
|
|
506
|
-
}
|
|
507
|
-
async updateUser() {
|
|
508
|
-
this._setPostponed(false);
|
|
509
|
-
const accessToken = await this.requestToken();
|
|
510
|
-
this._storage?.wipeCachedCurrentUser();
|
|
511
|
-
const user = await this.getUser(accessToken);
|
|
512
|
-
this.user = user;
|
|
513
|
-
this.listeners.trigger(USER_CHANGED_EVENT, user);
|
|
514
|
-
}
|
|
515
|
-
async _detectUserChange(accessToken) {
|
|
516
|
-
const windowWasOpen = this._isLoginWindowOpen;
|
|
517
|
-
const user = await this.getUser(accessToken);
|
|
518
|
-
const onApply = () => {
|
|
519
|
-
this.user = user;
|
|
520
|
-
this.listeners.trigger(USER_CHANGED_EVENT, user);
|
|
521
|
-
};
|
|
522
|
-
if (user && this.user && this.user.id !== user.id) {
|
|
523
|
-
if (!this._canShowDialogs() || this.user.guest || windowWasOpen) {
|
|
524
|
-
onApply();
|
|
525
|
-
return;
|
|
799
|
+
return forceTokenUpdate;
|
|
800
|
+
}()
|
|
801
|
+
}, {
|
|
802
|
+
key: "loadCurrentService",
|
|
803
|
+
value: function () {
|
|
804
|
+
var _loadCurrentService = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
805
|
+
var _ref5, serviceName, serviceImage;
|
|
806
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
807
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
808
|
+
case 0:
|
|
809
|
+
if (!this._service.serviceName) {
|
|
810
|
+
_context10.next = 2;
|
|
811
|
+
break;
|
|
812
|
+
}
|
|
813
|
+
return _context10.abrupt("return");
|
|
814
|
+
case 2:
|
|
815
|
+
_context10.prev = 2;
|
|
816
|
+
_context10.next = 5;
|
|
817
|
+
return this.http.get("oauth2/interactive/login/settings?client_id=".concat(this.config.clientId));
|
|
818
|
+
case 5:
|
|
819
|
+
_context10.t0 = _context10.sent;
|
|
820
|
+
if (_context10.t0) {
|
|
821
|
+
_context10.next = 8;
|
|
822
|
+
break;
|
|
823
|
+
}
|
|
824
|
+
_context10.t0 = {};
|
|
825
|
+
case 8:
|
|
826
|
+
_ref5 = _context10.t0;
|
|
827
|
+
serviceName = _ref5.serviceName;
|
|
828
|
+
serviceImage = _ref5.iconUrl;
|
|
829
|
+
this.setCurrentService({
|
|
830
|
+
serviceImage: serviceImage,
|
|
831
|
+
serviceName: serviceName
|
|
832
|
+
});
|
|
833
|
+
_context10.next = 16;
|
|
834
|
+
break;
|
|
835
|
+
case 14:
|
|
836
|
+
_context10.prev = 14;
|
|
837
|
+
_context10.t1 = _context10["catch"](2);
|
|
838
|
+
case 16:
|
|
839
|
+
case "end":
|
|
840
|
+
return _context10.stop();
|
|
841
|
+
}
|
|
842
|
+
}, _callee10, this, [[2, 14]]);
|
|
843
|
+
}));
|
|
844
|
+
function loadCurrentService() {
|
|
845
|
+
return _loadCurrentService.apply(this, arguments);
|
|
526
846
|
}
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
847
|
+
return loadCurrentService;
|
|
848
|
+
}()
|
|
849
|
+
}, {
|
|
850
|
+
key: "getAPIPath",
|
|
851
|
+
value: function getAPIPath() {
|
|
852
|
+
return this.config.serverUri + Auth.API_PATH;
|
|
853
|
+
}
|
|
854
|
+
/**
|
|
855
|
+
* @return {Promise.<object>}
|
|
856
|
+
*/
|
|
857
|
+
}, {
|
|
858
|
+
key: "getUser",
|
|
859
|
+
value: function getUser(accessToken) {
|
|
860
|
+
var _this5 = this;
|
|
861
|
+
if (this.config.cacheCurrentUser) {
|
|
862
|
+
var _this$_storage6;
|
|
863
|
+
return (_this$_storage6 = this._storage) === null || _this$_storage6 === void 0 ? void 0 : _this$_storage6.getCachedUser(function () {
|
|
864
|
+
return _this5.http.authorizedFetch(Auth.API_PROFILE_PATH, accessToken, _this5.config.userParams);
|
|
530
865
|
});
|
|
531
|
-
|
|
866
|
+
} else {
|
|
867
|
+
return this.http.authorizedFetch(Auth.API_PROFILE_PATH, accessToken, this.config.userParams);
|
|
532
868
|
}
|
|
533
|
-
await this._showUserChangedDialog({
|
|
534
|
-
newUser: user,
|
|
535
|
-
onApply,
|
|
536
|
-
onPostpone: () => {
|
|
537
|
-
this.listeners.trigger(USER_CHANGE_POSTPONED_EVENT);
|
|
538
|
-
this.config.onPostponeChangedUser(this.user, user);
|
|
539
|
-
}
|
|
540
|
-
});
|
|
541
869
|
}
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
closeDialog();
|
|
584
|
-
if (!cancelable) {
|
|
585
|
-
this._initDeferred?.resolve?.();
|
|
586
|
-
this.listeners.trigger(LOGOUT_POSTPONED_EVENT);
|
|
587
|
-
onPostponeLogout();
|
|
588
|
-
return;
|
|
589
|
-
}
|
|
590
|
-
if (this.user?.guest && nonInteractive) {
|
|
591
|
-
this.forceTokenUpdate();
|
|
592
|
-
} else {
|
|
593
|
-
this._initDeferred?.resolve?.();
|
|
870
|
+
/**
|
|
871
|
+
* @return {Promise.<object>}
|
|
872
|
+
*/
|
|
873
|
+
}, {
|
|
874
|
+
key: "requestUser",
|
|
875
|
+
value: function () {
|
|
876
|
+
var _requestUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
877
|
+
var accessToken, user;
|
|
878
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
879
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
880
|
+
case 0:
|
|
881
|
+
if (!this.user) {
|
|
882
|
+
_context11.next = 2;
|
|
883
|
+
break;
|
|
884
|
+
}
|
|
885
|
+
return _context11.abrupt("return", this.user);
|
|
886
|
+
case 2:
|
|
887
|
+
_context11.next = 4;
|
|
888
|
+
return this.requestToken();
|
|
889
|
+
case 4:
|
|
890
|
+
accessToken = _context11.sent;
|
|
891
|
+
if (!this.user) {
|
|
892
|
+
_context11.next = 7;
|
|
893
|
+
break;
|
|
894
|
+
}
|
|
895
|
+
return _context11.abrupt("return", this.user);
|
|
896
|
+
case 7:
|
|
897
|
+
_context11.next = 9;
|
|
898
|
+
return this.getUser(accessToken);
|
|
899
|
+
case 9:
|
|
900
|
+
user = _context11.sent;
|
|
901
|
+
this.user = user;
|
|
902
|
+
return _context11.abrupt("return", user);
|
|
903
|
+
case 12:
|
|
904
|
+
case "end":
|
|
905
|
+
return _context11.stop();
|
|
906
|
+
}
|
|
907
|
+
}, _callee11, this);
|
|
908
|
+
}));
|
|
909
|
+
function requestUser() {
|
|
910
|
+
return _requestUser.apply(this, arguments);
|
|
594
911
|
}
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
912
|
+
return requestUser;
|
|
913
|
+
}()
|
|
914
|
+
}, {
|
|
915
|
+
key: "updateUser",
|
|
916
|
+
value: function () {
|
|
917
|
+
var _updateUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
918
|
+
var _this$_storage7;
|
|
919
|
+
var accessToken, user;
|
|
920
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
921
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
922
|
+
case 0:
|
|
923
|
+
this._setPostponed(false);
|
|
924
|
+
_context12.next = 3;
|
|
925
|
+
return this.requestToken();
|
|
926
|
+
case 3:
|
|
927
|
+
accessToken = _context12.sent;
|
|
928
|
+
(_this$_storage7 = this._storage) === null || _this$_storage7 === void 0 ? void 0 : _this$_storage7.wipeCachedCurrentUser();
|
|
929
|
+
_context12.next = 7;
|
|
930
|
+
return this.getUser(accessToken);
|
|
931
|
+
case 7:
|
|
932
|
+
user = _context12.sent;
|
|
933
|
+
this.user = user;
|
|
934
|
+
this.listeners.trigger(USER_CHANGED_EVENT, user);
|
|
935
|
+
case 10:
|
|
936
|
+
case "end":
|
|
937
|
+
return _context12.stop();
|
|
938
|
+
}
|
|
939
|
+
}, _callee12, this);
|
|
940
|
+
}));
|
|
941
|
+
function updateUser() {
|
|
942
|
+
return _updateUser.apply(this, arguments);
|
|
616
943
|
}
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
944
|
+
return updateUser;
|
|
945
|
+
}()
|
|
946
|
+
}, {
|
|
947
|
+
key: "_detectUserChange",
|
|
948
|
+
value: function () {
|
|
949
|
+
var _detectUserChange2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(accessToken) {
|
|
950
|
+
var _this6 = this;
|
|
951
|
+
var windowWasOpen, user, onApply;
|
|
952
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
953
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
954
|
+
case 0:
|
|
955
|
+
windowWasOpen = this._isLoginWindowOpen;
|
|
956
|
+
_context13.next = 3;
|
|
957
|
+
return this.getUser(accessToken);
|
|
958
|
+
case 3:
|
|
959
|
+
user = _context13.sent;
|
|
960
|
+
onApply = function onApply() {
|
|
961
|
+
_this6.user = user;
|
|
962
|
+
_this6.listeners.trigger(USER_CHANGED_EVENT, user);
|
|
963
|
+
};
|
|
964
|
+
if (!(user && this.user && this.user.id !== user.id)) {
|
|
965
|
+
_context13.next = 14;
|
|
966
|
+
break;
|
|
967
|
+
}
|
|
968
|
+
if (!(!this._canShowDialogs() || this.user.guest || windowWasOpen)) {
|
|
969
|
+
_context13.next = 9;
|
|
970
|
+
break;
|
|
971
|
+
}
|
|
972
|
+
onApply();
|
|
973
|
+
return _context13.abrupt("return");
|
|
974
|
+
case 9:
|
|
975
|
+
if (!user.guest) {
|
|
976
|
+
_context13.next = 12;
|
|
977
|
+
break;
|
|
978
|
+
}
|
|
979
|
+
this._showAuthDialog({
|
|
980
|
+
nonInteractive: true
|
|
981
|
+
});
|
|
982
|
+
return _context13.abrupt("return");
|
|
983
|
+
case 12:
|
|
984
|
+
_context13.next = 14;
|
|
985
|
+
return this._showUserChangedDialog({
|
|
986
|
+
newUser: user,
|
|
987
|
+
onApply: onApply,
|
|
988
|
+
onPostpone: function onPostpone() {
|
|
989
|
+
_this6.listeners.trigger(USER_CHANGE_POSTPONED_EVENT);
|
|
990
|
+
_this6.config.onPostponeChangedUser(_this6.user, user);
|
|
991
|
+
}
|
|
992
|
+
});
|
|
993
|
+
case 14:
|
|
994
|
+
case "end":
|
|
995
|
+
return _context13.stop();
|
|
996
|
+
}
|
|
997
|
+
}, _callee13, this);
|
|
998
|
+
}));
|
|
999
|
+
function _detectUserChange(_x6) {
|
|
1000
|
+
return _detectUserChange2.apply(this, arguments);
|
|
651
1001
|
}
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
// eslint-disable-next-line no-console
|
|
661
|
-
console.error('RingUI Auth error', error);
|
|
662
|
-
}
|
|
663
|
-
try {
|
|
664
|
-
// We've got some error from this list
|
|
665
|
-
// https://www.jetbrains.com/help/youtrack/devportal/OAuth-2.0-Errors.html
|
|
666
|
-
if ('code' in error && error.code && typeof error.code === 'object' && 'code' in error.code && typeof error.code.code === 'string') {
|
|
667
|
-
const readableCode = error.code.code.split('_').join(' ');
|
|
668
|
-
return `Authorization error: ${readableCode}`;
|
|
1002
|
+
return _detectUserChange;
|
|
1003
|
+
}()
|
|
1004
|
+
}, {
|
|
1005
|
+
key: "_beforeLogout",
|
|
1006
|
+
value: function _beforeLogout(params) {
|
|
1007
|
+
if (this._canShowDialogs()) {
|
|
1008
|
+
this._showAuthDialog(params);
|
|
1009
|
+
return;
|
|
669
1010
|
}
|
|
670
|
-
|
|
671
|
-
// noop
|
|
1011
|
+
this.logout();
|
|
672
1012
|
}
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
1013
|
+
}, {
|
|
1014
|
+
key: "_showAuthDialog",
|
|
1015
|
+
value: function _showAuthDialog() {
|
|
1016
|
+
var _this$user2,
|
|
1017
|
+
_this7 = this,
|
|
1018
|
+
_this$_authDialogServ,
|
|
1019
|
+
_this$_storage8,
|
|
1020
|
+
_this$_storage9;
|
|
1021
|
+
var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
1022
|
+
nonInteractive = _ref6.nonInteractive,
|
|
1023
|
+
error = _ref6.error,
|
|
1024
|
+
canCancel = _ref6.canCancel,
|
|
1025
|
+
onTryAgain = _ref6.onTryAgain;
|
|
1026
|
+
var _this$config2 = this.config,
|
|
1027
|
+
embeddedLogin = _this$config2.embeddedLogin,
|
|
1028
|
+
onPostponeLogout = _this$config2.onPostponeLogout,
|
|
1029
|
+
translations = _this$config2.translations;
|
|
1030
|
+
var cancelable = ((_this$user2 = this.user) === null || _this$user2 === void 0 ? void 0 : _this$user2.guest) || canCancel;
|
|
1031
|
+
var actualTranslations = translations !== null && translations !== void 0 ? translations : getTranslations();
|
|
1032
|
+
this._createInitDeferred();
|
|
1033
|
+
var closeDialog = function closeDialog() {
|
|
684
1034
|
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
1035
|
+
stopTokenListening === null || stopTokenListening === void 0 ? void 0 : stopTokenListening();
|
|
1036
|
+
stopMessageListening === null || stopMessageListening === void 0 ? void 0 : stopMessageListening();
|
|
1037
|
+
hide === null || hide === void 0 ? void 0 : hide();
|
|
688
1038
|
/* eslint-enable @typescript-eslint/no-use-before-define */
|
|
689
|
-
this._storage?.sendMessage(Auth.CLOSE_BACKEND_DOWN_MESSAGE, Date.now());
|
|
690
|
-
clearTimeout(timerId);
|
|
691
1039
|
};
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
resolve();
|
|
1040
|
+
|
|
1041
|
+
var onConfirm = function onConfirm() {
|
|
1042
|
+
if (!embeddedLogin) {
|
|
1043
|
+
closeDialog();
|
|
1044
|
+
_this7.logout();
|
|
1045
|
+
return;
|
|
1046
|
+
}
|
|
1047
|
+
_this7._runEmbeddedLogin();
|
|
701
1048
|
};
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
1049
|
+
var onCancel = function onCancel() {
|
|
1050
|
+
var _this7$_embeddedFlow, _this7$_storage, _this7$user;
|
|
1051
|
+
(_this7$_embeddedFlow = _this7._embeddedFlow) === null || _this7$_embeddedFlow === void 0 ? void 0 : _this7$_embeddedFlow.stop();
|
|
1052
|
+
(_this7$_storage = _this7._storage) === null || _this7$_storage === void 0 ? void 0 : _this7$_storage.sendMessage(Auth.CLOSE_WINDOW_MESSAGE, Date.now());
|
|
1053
|
+
closeDialog();
|
|
1054
|
+
if (!cancelable) {
|
|
1055
|
+
var _this7$_initDeferred, _this7$_initDeferred$;
|
|
1056
|
+
(_this7$_initDeferred = _this7._initDeferred) === null || _this7$_initDeferred === void 0 || (_this7$_initDeferred$ = _this7$_initDeferred.resolve) === null || _this7$_initDeferred$ === void 0 ? void 0 : _this7$_initDeferred$.call(_this7$_initDeferred);
|
|
1057
|
+
_this7.listeners.trigger(LOGOUT_POSTPONED_EVENT);
|
|
1058
|
+
onPostponeLogout();
|
|
1059
|
+
return;
|
|
1060
|
+
}
|
|
1061
|
+
if ((_this7$user = _this7.user) !== null && _this7$user !== void 0 && _this7$user.guest && nonInteractive) {
|
|
1062
|
+
_this7.forceTokenUpdate();
|
|
1063
|
+
} else {
|
|
1064
|
+
var _this7$_initDeferred2, _this7$_initDeferred3;
|
|
1065
|
+
(_this7$_initDeferred2 = _this7._initDeferred) === null || _this7$_initDeferred2 === void 0 || (_this7$_initDeferred3 = _this7$_initDeferred2.resolve) === null || _this7$_initDeferred3 === void 0 ? void 0 : _this7$_initDeferred3.call(_this7$_initDeferred2);
|
|
1066
|
+
}
|
|
705
1067
|
};
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
1068
|
+
var onTryAgainClick = /*#__PURE__*/function () {
|
|
1069
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
1070
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
1071
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
1072
|
+
case 0:
|
|
1073
|
+
_context14.next = 2;
|
|
1074
|
+
return onTryAgain === null || onTryAgain === void 0 ? void 0 : onTryAgain();
|
|
1075
|
+
case 2:
|
|
1076
|
+
closeDialog();
|
|
1077
|
+
case 3:
|
|
1078
|
+
case "end":
|
|
1079
|
+
return _context14.stop();
|
|
1080
|
+
}
|
|
1081
|
+
}, _callee14);
|
|
1082
|
+
}));
|
|
1083
|
+
return function onTryAgainClick() {
|
|
1084
|
+
return _ref7.apply(this, arguments);
|
|
1085
|
+
};
|
|
1086
|
+
}();
|
|
1087
|
+
var hide = (_this$_authDialogServ = this._authDialogService) === null || _this$_authDialogServ === void 0 ? void 0 : _this$_authDialogServ.call(this, _objectSpread2(_objectSpread2({}, this._service), {}, {
|
|
1088
|
+
loginCaption: actualTranslations.login,
|
|
1089
|
+
loginToCaption: actualTranslations.loginTo,
|
|
1090
|
+
confirmLabel: actualTranslations.login,
|
|
1091
|
+
tryAgainLabel: actualTranslations.tryAgainLabel,
|
|
1092
|
+
cancelLabel: cancelable ? actualTranslations.cancel : actualTranslations.postpone,
|
|
1093
|
+
errorMessage: this._extractErrorMessage(error, true),
|
|
1094
|
+
onConfirm: onConfirm,
|
|
1095
|
+
onCancel: onCancel,
|
|
1096
|
+
onTryAgain: onTryAgain ? onTryAgainClick : undefined
|
|
1097
|
+
}));
|
|
1098
|
+
var stopTokenListening = (_this$_storage8 = this._storage) === null || _this$_storage8 === void 0 ? void 0 : _this$_storage8.onTokenChange(function (token) {
|
|
1099
|
+
if (token) {
|
|
1100
|
+
var _this7$_initDeferred4, _this7$_initDeferred5;
|
|
1101
|
+
closeDialog();
|
|
1102
|
+
(_this7$_initDeferred4 = _this7._initDeferred) === null || _this7$_initDeferred4 === void 0 || (_this7$_initDeferred5 = _this7$_initDeferred4.resolve) === null || _this7$_initDeferred5 === void 0 ? void 0 : _this7$_initDeferred5.call(_this7$_initDeferred4);
|
|
716
1103
|
}
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
/**
|
|
723
|
-
* Wipe accessToken and redirect to auth page with required authorization
|
|
724
|
-
*/
|
|
725
|
-
async logout(extraParams) {
|
|
726
|
-
const requestParams = {
|
|
727
|
-
// eslint-disable-next-line camelcase
|
|
728
|
-
request_credentials: 'required',
|
|
729
|
-
...extraParams
|
|
730
|
-
};
|
|
731
|
-
await this._checkBackendsStatusesIfEnabled();
|
|
732
|
-
await this.listeners.trigger('logout');
|
|
733
|
-
this._updateDomainUser(null);
|
|
734
|
-
await this._storage?.wipeToken();
|
|
735
|
-
const authRequest = await this._requestBuilder?.prepareAuthRequest(requestParams);
|
|
736
|
-
if (authRequest != null) {
|
|
737
|
-
this._redirectCurrentPage(authRequest.url);
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
async _runEmbeddedLogin() {
|
|
741
|
-
this._storage?.sendMessage(Auth.CLOSE_WINDOW_MESSAGE, Date.now());
|
|
742
|
-
try {
|
|
743
|
-
this._isLoginWindowOpen = true;
|
|
744
|
-
return await this._embeddedFlow?.authorize();
|
|
745
|
-
} catch (e) {
|
|
746
|
-
throw e;
|
|
747
|
-
} finally {
|
|
748
|
-
this._isLoginWindowOpen = false;
|
|
1104
|
+
});
|
|
1105
|
+
var stopMessageListening = (_this$_storage9 = this._storage) === null || _this$_storage9 === void 0 ? void 0 : _this$_storage9.onMessage(Auth.CLOSE_WINDOW_MESSAGE, function () {
|
|
1106
|
+
var _this7$_embeddedFlow2;
|
|
1107
|
+
return (_this7$_embeddedFlow2 = _this7._embeddedFlow) === null || _this7$_embeddedFlow2 === void 0 ? void 0 : _this7$_embeddedFlow2.stop();
|
|
1108
|
+
});
|
|
749
1109
|
}
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
1110
|
+
}, {
|
|
1111
|
+
key: "_showUserChangedDialog",
|
|
1112
|
+
value: function _showUserChangedDialog(_ref8) {
|
|
1113
|
+
var _this8 = this,
|
|
1114
|
+
_this$_authDialogServ2,
|
|
1115
|
+
_translations$youHave,
|
|
1116
|
+
_newUser$name,
|
|
1117
|
+
_newUser$name2,
|
|
1118
|
+
_translations$login,
|
|
1119
|
+
_translations$loginTo,
|
|
1120
|
+
_translations$applyCh,
|
|
1121
|
+
_translations$tryAgai,
|
|
1122
|
+
_translations$postpon;
|
|
1123
|
+
var newUser = _ref8.newUser,
|
|
1124
|
+
onApply = _ref8.onApply,
|
|
1125
|
+
onPostpone = _ref8.onPostpone;
|
|
1126
|
+
var translations = this.config.translations;
|
|
1127
|
+
this._createInitDeferred();
|
|
1128
|
+
var done = function done() {
|
|
1129
|
+
var _this8$_initDeferred, _this8$_initDeferred$;
|
|
1130
|
+
(_this8$_initDeferred = _this8._initDeferred) === null || _this8$_initDeferred === void 0 || (_this8$_initDeferred$ = _this8$_initDeferred.resolve) === null || _this8$_initDeferred$ === void 0 ? void 0 : _this8$_initDeferred$.call(_this8$_initDeferred);
|
|
1131
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
1132
|
+
hide === null || hide === void 0 ? void 0 : hide();
|
|
1133
|
+
};
|
|
1134
|
+
var hide = (_this$_authDialogServ2 = this._authDialogService) === null || _this$_authDialogServ2 === void 0 ? void 0 : _this$_authDialogServ2.call(this, _objectSpread2(_objectSpread2({}, this._service), {}, {
|
|
1135
|
+
title: (_translations$youHave = translations === null || translations === void 0 ? void 0 : translations.youHaveLoggedInAs) !== null && _translations$youHave !== void 0 ? _translations$youHave : translate('youHaveLoggedInAs').replace('%userName%', (_newUser$name = newUser.name) !== null && _newUser$name !== void 0 ? _newUser$name : '').replace('{{userName}}', (_newUser$name2 = newUser.name) !== null && _newUser$name2 !== void 0 ? _newUser$name2 : ''),
|
|
1136
|
+
loginCaption: (_translations$login = translations === null || translations === void 0 ? void 0 : translations.login) !== null && _translations$login !== void 0 ? _translations$login : translate('login'),
|
|
1137
|
+
loginToCaption: (_translations$loginTo = translations === null || translations === void 0 ? void 0 : translations.loginTo) !== null && _translations$loginTo !== void 0 ? _translations$loginTo : translate('loginTo'),
|
|
1138
|
+
confirmLabel: (_translations$applyCh = translations === null || translations === void 0 ? void 0 : translations.applyChange) !== null && _translations$applyCh !== void 0 ? _translations$applyCh : translate('applyChange'),
|
|
1139
|
+
tryAgainLabel: (_translations$tryAgai = translations === null || translations === void 0 ? void 0 : translations.tryAgainLabel) !== null && _translations$tryAgai !== void 0 ? _translations$tryAgai : translate('tryAgainLabel'),
|
|
1140
|
+
cancelLabel: (_translations$postpon = translations === null || translations === void 0 ? void 0 : translations.postpone) !== null && _translations$postpon !== void 0 ? _translations$postpon : translate('postpone'),
|
|
1141
|
+
onConfirm: function onConfirm() {
|
|
1142
|
+
done();
|
|
1143
|
+
onApply();
|
|
1144
|
+
},
|
|
1145
|
+
onCancel: function onCancel() {
|
|
1146
|
+
done();
|
|
1147
|
+
onPostpone();
|
|
1148
|
+
}
|
|
1149
|
+
}));
|
|
759
1150
|
}
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
if (
|
|
765
|
-
|
|
766
|
-
} else {
|
|
767
|
-
this.user = user;
|
|
768
|
-
this.listeners.trigger(USER_CHANGED_EVENT, user);
|
|
1151
|
+
}, {
|
|
1152
|
+
key: "_extractErrorMessage",
|
|
1153
|
+
value: function _extractErrorMessage(error) {
|
|
1154
|
+
var logError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1155
|
+
if (!error) {
|
|
1156
|
+
return null;
|
|
769
1157
|
}
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
1158
|
+
if (logError) {
|
|
1159
|
+
// eslint-disable-next-line no-console
|
|
1160
|
+
console.error('RingUI Auth error', error);
|
|
1161
|
+
}
|
|
1162
|
+
try {
|
|
1163
|
+
// We've got some error from this list
|
|
1164
|
+
// https://www.jetbrains.com/help/youtrack/devportal/OAuth-2.0-Errors.html
|
|
1165
|
+
if ('code' in error && error.code && _typeof(error.code) === 'object' && 'code' in error.code && typeof error.code.code === 'string') {
|
|
1166
|
+
var readableCode = error.code.code.split('_').join(' ');
|
|
1167
|
+
return "Authorization error: ".concat(readableCode);
|
|
1168
|
+
}
|
|
1169
|
+
} catch (_unused) {
|
|
1170
|
+
// noop
|
|
1171
|
+
}
|
|
1172
|
+
return error.toString ? error.toString() : null;
|
|
777
1173
|
}
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
1174
|
+
}, {
|
|
1175
|
+
key: "_showBackendDownDialog",
|
|
1176
|
+
value: function _showBackendDownDialog(backendError) {
|
|
1177
|
+
var _this9 = this;
|
|
1178
|
+
var _this$config3 = this.config,
|
|
1179
|
+
onBackendDown = _this$config3.onBackendDown,
|
|
1180
|
+
translations = _this$config3.translations;
|
|
1181
|
+
var REPEAT_TIMEOUT = 5000;
|
|
1182
|
+
var timerId;
|
|
1183
|
+
return new Promise(function (resolve, reject) {
|
|
1184
|
+
var _this9$_storage2;
|
|
1185
|
+
var done = function done() {
|
|
1186
|
+
var _this9$_storage;
|
|
1187
|
+
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
1188
|
+
hide();
|
|
1189
|
+
window.removeEventListener('online', onCheckAgain);
|
|
1190
|
+
stopListeningCloseMessage === null || stopListeningCloseMessage === void 0 ? void 0 : stopListeningCloseMessage();
|
|
1191
|
+
/* eslint-enable @typescript-eslint/no-use-before-define */
|
|
1192
|
+
(_this9$_storage = _this9._storage) === null || _this9$_storage === void 0 ? void 0 : _this9$_storage.sendMessage(Auth.CLOSE_BACKEND_DOWN_MESSAGE, Date.now());
|
|
1193
|
+
clearTimeout(timerId);
|
|
1194
|
+
};
|
|
1195
|
+
var stopListeningCloseMessage = (_this9$_storage2 = _this9._storage) === null || _this9$_storage2 === void 0 ? void 0 : _this9$_storage2.onMessage(Auth.CLOSE_BACKEND_DOWN_MESSAGE, function () {
|
|
1196
|
+
stopListeningCloseMessage === null || stopListeningCloseMessage === void 0 ? void 0 : stopListeningCloseMessage();
|
|
1197
|
+
done();
|
|
1198
|
+
resolve();
|
|
1199
|
+
});
|
|
1200
|
+
var onCheckAgain = /*#__PURE__*/function () {
|
|
1201
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
1202
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
1203
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
1204
|
+
case 0:
|
|
1205
|
+
_context15.next = 2;
|
|
1206
|
+
return _this9._checkBackendsAreUp();
|
|
1207
|
+
case 2:
|
|
1208
|
+
done();
|
|
1209
|
+
resolve();
|
|
1210
|
+
case 4:
|
|
1211
|
+
case "end":
|
|
1212
|
+
return _context15.stop();
|
|
1213
|
+
}
|
|
1214
|
+
}, _callee15);
|
|
1215
|
+
}));
|
|
1216
|
+
return function onCheckAgain() {
|
|
1217
|
+
return _ref9.apply(this, arguments);
|
|
1218
|
+
};
|
|
1219
|
+
}();
|
|
1220
|
+
var onPostpone = function onPostpone() {
|
|
1221
|
+
done();
|
|
1222
|
+
reject(new Error('Auth(@jetbrains/ring-ui): postponed by user'));
|
|
1223
|
+
};
|
|
1224
|
+
var hide = onBackendDown({
|
|
1225
|
+
onCheckAgain: onCheckAgain,
|
|
1226
|
+
onPostpone: onPostpone,
|
|
1227
|
+
backendError: backendError,
|
|
1228
|
+
translations: translations !== null && translations !== void 0 ? translations : getTranslationsWithFallback()
|
|
1229
|
+
});
|
|
1230
|
+
window.addEventListener('online', onCheckAgain);
|
|
1231
|
+
function networkWatchdog() {
|
|
1232
|
+
if (navigator && navigator.onLine) {
|
|
1233
|
+
onCheckAgain();
|
|
1234
|
+
}
|
|
1235
|
+
timerId = window.setTimeout(networkWatchdog, REPEAT_TIMEOUT);
|
|
1236
|
+
}
|
|
1237
|
+
timerId = window.setTimeout(networkWatchdog, REPEAT_TIMEOUT);
|
|
1238
|
+
});
|
|
798
1239
|
}
|
|
799
|
-
|
|
800
|
-
|
|
1240
|
+
/**
|
|
1241
|
+
* Wipe accessToken and redirect to auth page with required authorization
|
|
1242
|
+
*/
|
|
1243
|
+
}, {
|
|
1244
|
+
key: "logout",
|
|
1245
|
+
value: function () {
|
|
1246
|
+
var _logout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(extraParams) {
|
|
1247
|
+
var _this$_storage10, _this$_requestBuilder3;
|
|
1248
|
+
var requestParams, authRequest;
|
|
1249
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
1250
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1251
|
+
case 0:
|
|
1252
|
+
requestParams = _objectSpread2({
|
|
1253
|
+
// eslint-disable-next-line camelcase
|
|
1254
|
+
request_credentials: 'required'
|
|
1255
|
+
}, extraParams);
|
|
1256
|
+
_context16.next = 3;
|
|
1257
|
+
return this._checkBackendsStatusesIfEnabled();
|
|
1258
|
+
case 3:
|
|
1259
|
+
_context16.next = 5;
|
|
1260
|
+
return this.listeners.trigger('logout');
|
|
1261
|
+
case 5:
|
|
1262
|
+
this._updateDomainUser(null);
|
|
1263
|
+
_context16.next = 8;
|
|
1264
|
+
return (_this$_storage10 = this._storage) === null || _this$_storage10 === void 0 ? void 0 : _this$_storage10.wipeToken();
|
|
1265
|
+
case 8:
|
|
1266
|
+
_context16.next = 10;
|
|
1267
|
+
return (_this$_requestBuilder3 = this._requestBuilder) === null || _this$_requestBuilder3 === void 0 ? void 0 : _this$_requestBuilder3.prepareAuthRequest(requestParams);
|
|
1268
|
+
case 10:
|
|
1269
|
+
authRequest = _context16.sent;
|
|
1270
|
+
if (authRequest != null) {
|
|
1271
|
+
this._redirectCurrentPage(authRequest.url);
|
|
1272
|
+
}
|
|
1273
|
+
case 12:
|
|
1274
|
+
case "end":
|
|
1275
|
+
return _context16.stop();
|
|
1276
|
+
}
|
|
1277
|
+
}, _callee16, this);
|
|
1278
|
+
}));
|
|
1279
|
+
function logout(_x7) {
|
|
1280
|
+
return _logout.apply(this, arguments);
|
|
1281
|
+
}
|
|
1282
|
+
return logout;
|
|
1283
|
+
}()
|
|
1284
|
+
}, {
|
|
1285
|
+
key: "_runEmbeddedLogin",
|
|
1286
|
+
value: function () {
|
|
1287
|
+
var _runEmbeddedLogin2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
1288
|
+
var _this$_storage11;
|
|
1289
|
+
var _this$_embeddedFlow;
|
|
1290
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
1291
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1292
|
+
case 0:
|
|
1293
|
+
(_this$_storage11 = this._storage) === null || _this$_storage11 === void 0 ? void 0 : _this$_storage11.sendMessage(Auth.CLOSE_WINDOW_MESSAGE, Date.now());
|
|
1294
|
+
_context17.prev = 1;
|
|
1295
|
+
this._isLoginWindowOpen = true;
|
|
1296
|
+
_context17.next = 5;
|
|
1297
|
+
return (_this$_embeddedFlow = this._embeddedFlow) === null || _this$_embeddedFlow === void 0 ? void 0 : _this$_embeddedFlow.authorize();
|
|
1298
|
+
case 5:
|
|
1299
|
+
return _context17.abrupt("return", _context17.sent);
|
|
1300
|
+
case 8:
|
|
1301
|
+
_context17.prev = 8;
|
|
1302
|
+
_context17.t0 = _context17["catch"](1);
|
|
1303
|
+
throw _context17.t0;
|
|
1304
|
+
case 11:
|
|
1305
|
+
_context17.prev = 11;
|
|
1306
|
+
this._isLoginWindowOpen = false;
|
|
1307
|
+
return _context17.finish(11);
|
|
1308
|
+
case 14:
|
|
1309
|
+
case "end":
|
|
1310
|
+
return _context17.stop();
|
|
1311
|
+
}
|
|
1312
|
+
}, _callee17, this, [[1, 8, 11, 14]]);
|
|
1313
|
+
}));
|
|
1314
|
+
function _runEmbeddedLogin() {
|
|
1315
|
+
return _runEmbeddedLogin2.apply(this, arguments);
|
|
1316
|
+
}
|
|
1317
|
+
return _runEmbeddedLogin;
|
|
1318
|
+
}()
|
|
1319
|
+
/**
|
|
1320
|
+
* Wipe accessToken and redirect to auth page to obtain authorization data
|
|
1321
|
+
* if user is logged in or log her in otherwise
|
|
1322
|
+
*/
|
|
1323
|
+
}, {
|
|
1324
|
+
key: "login",
|
|
1325
|
+
value: function () {
|
|
1326
|
+
var _login = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
|
|
1327
|
+
var _this$_backgroundFlow3, accessToken, _user;
|
|
1328
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
1329
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1330
|
+
case 0:
|
|
1331
|
+
if (!this.config.embeddedLogin) {
|
|
1332
|
+
_context18.next = 4;
|
|
1333
|
+
break;
|
|
1334
|
+
}
|
|
1335
|
+
_context18.next = 3;
|
|
1336
|
+
return this._runEmbeddedLogin();
|
|
1337
|
+
case 3:
|
|
1338
|
+
return _context18.abrupt("return");
|
|
1339
|
+
case 4:
|
|
1340
|
+
_context18.next = 6;
|
|
1341
|
+
return this._checkBackendsStatusesIfEnabled();
|
|
1342
|
+
case 6:
|
|
1343
|
+
_context18.prev = 6;
|
|
1344
|
+
_context18.next = 9;
|
|
1345
|
+
return (_this$_backgroundFlow3 = this._backgroundFlow) === null || _this$_backgroundFlow3 === void 0 ? void 0 : _this$_backgroundFlow3.authorize();
|
|
1346
|
+
case 9:
|
|
1347
|
+
accessToken = _context18.sent;
|
|
1348
|
+
_context18.next = 12;
|
|
1349
|
+
return this.getUser(accessToken);
|
|
1350
|
+
case 12:
|
|
1351
|
+
_user = _context18.sent;
|
|
1352
|
+
if (_user.guest) {
|
|
1353
|
+
this._beforeLogout();
|
|
1354
|
+
} else {
|
|
1355
|
+
this.user = _user;
|
|
1356
|
+
this.listeners.trigger(USER_CHANGED_EVENT, _user);
|
|
1357
|
+
}
|
|
1358
|
+
_context18.next = 19;
|
|
1359
|
+
break;
|
|
1360
|
+
case 16:
|
|
1361
|
+
_context18.prev = 16;
|
|
1362
|
+
_context18.t0 = _context18["catch"](6);
|
|
1363
|
+
this._beforeLogout();
|
|
1364
|
+
case 19:
|
|
1365
|
+
case "end":
|
|
1366
|
+
return _context18.stop();
|
|
1367
|
+
}
|
|
1368
|
+
}, _callee18, this, [[6, 16]]);
|
|
1369
|
+
}));
|
|
1370
|
+
function login() {
|
|
1371
|
+
return _login.apply(this, arguments);
|
|
1372
|
+
}
|
|
1373
|
+
return login;
|
|
1374
|
+
}()
|
|
1375
|
+
}, {
|
|
1376
|
+
key: "switchUser",
|
|
1377
|
+
value: function () {
|
|
1378
|
+
var _switchUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
|
|
1379
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
1380
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1381
|
+
case 0:
|
|
1382
|
+
if (this.config.embeddedLogin) {
|
|
1383
|
+
_context19.next = 2;
|
|
1384
|
+
break;
|
|
1385
|
+
}
|
|
1386
|
+
throw new Error('Auth: switchUser only supported for "embeddedLogin" mode');
|
|
1387
|
+
case 2:
|
|
1388
|
+
_context19.next = 4;
|
|
1389
|
+
return this._runEmbeddedLogin();
|
|
1390
|
+
case 4:
|
|
1391
|
+
case "end":
|
|
1392
|
+
return _context19.stop();
|
|
1393
|
+
}
|
|
1394
|
+
}, _callee19, this);
|
|
1395
|
+
}));
|
|
1396
|
+
function switchUser() {
|
|
1397
|
+
return _switchUser.apply(this, arguments);
|
|
1398
|
+
}
|
|
1399
|
+
return switchUser;
|
|
1400
|
+
}()
|
|
1401
|
+
}, {
|
|
1402
|
+
key: "_makeStateFromResponse",
|
|
1403
|
+
value: function _makeStateFromResponse(authResponse) {
|
|
1404
|
+
var state = authResponse.state;
|
|
1405
|
+
if (!state) {
|
|
1406
|
+
return {};
|
|
1407
|
+
}
|
|
1408
|
+
var defaultScope = this.config.scope;
|
|
1409
|
+
try {
|
|
1410
|
+
var urlFromState = new URL(state); // checking if state contains valid URL on same origin, see HUB-11514
|
|
1411
|
+
if (urlFromState.origin !== window.location.origin) {
|
|
1412
|
+
return {};
|
|
1413
|
+
}
|
|
1414
|
+
return {
|
|
1415
|
+
restoreLocation: state,
|
|
1416
|
+
created: Date.now(),
|
|
1417
|
+
scopes: defaultScope
|
|
1418
|
+
};
|
|
1419
|
+
} catch (e) {
|
|
1420
|
+
return {};
|
|
1421
|
+
}
|
|
801
1422
|
}
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
scopes,
|
|
816
|
-
|
|
817
|
-
|
|
1423
|
+
/**
|
|
1424
|
+
* Check if the hash contains an access token.
|
|
1425
|
+
* If it does, extract the state, compare with
|
|
1426
|
+
* config, and store the auth response for later use.
|
|
1427
|
+
*
|
|
1428
|
+
* @return {Promise} promise that is resolved to restoreLocation URL, or rejected
|
|
1429
|
+
* @private
|
|
1430
|
+
*/
|
|
1431
|
+
}, {
|
|
1432
|
+
key: "_checkForAuthResponse",
|
|
1433
|
+
value: function () {
|
|
1434
|
+
var _checkForAuthResponse2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
|
|
1435
|
+
var _this$_storage12;
|
|
1436
|
+
var authResponse, _this$config4, defaultScope, defaultExpiresIn, cleanHash, stateId, scope, expiresIn, accessToken, newState, scopes, effectiveExpiresIn, expires, _this$_storage13;
|
|
1437
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
1438
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1439
|
+
case 0:
|
|
1440
|
+
// getAuthResponseURL may throw an exception
|
|
1441
|
+
authResponse = this._responseParser.getAuthResponseFromURL();
|
|
1442
|
+
_this$config4 = this.config, defaultScope = _this$config4.scope, defaultExpiresIn = _this$config4.defaultExpiresIn, cleanHash = _this$config4.cleanHash;
|
|
1443
|
+
if (authResponse && cleanHash) {
|
|
1444
|
+
this.setHash('');
|
|
1445
|
+
}
|
|
1446
|
+
if (authResponse) {
|
|
1447
|
+
_context20.next = 5;
|
|
1448
|
+
break;
|
|
1449
|
+
}
|
|
1450
|
+
return _context20.abrupt("return", undefined);
|
|
1451
|
+
case 5:
|
|
1452
|
+
stateId = authResponse.state, scope = authResponse.scope, expiresIn = authResponse.expiresIn, accessToken = authResponse.accessToken;
|
|
1453
|
+
_context20.next = 8;
|
|
1454
|
+
return stateId && ((_this$_storage12 = this._storage) === null || _this$_storage12 === void 0 ? void 0 : _this$_storage12.getState(stateId));
|
|
1455
|
+
case 8:
|
|
1456
|
+
_context20.t0 = _context20.sent;
|
|
1457
|
+
if (_context20.t0) {
|
|
1458
|
+
_context20.next = 11;
|
|
1459
|
+
break;
|
|
1460
|
+
}
|
|
1461
|
+
_context20.t0 = this._makeStateFromResponse(authResponse);
|
|
1462
|
+
case 11:
|
|
1463
|
+
newState = _context20.t0;
|
|
1464
|
+
scopes = scope ? scope.split(' ') : newState.scopes || defaultScope || [];
|
|
1465
|
+
effectiveExpiresIn = expiresIn ? parseInt(expiresIn, 10) : defaultExpiresIn;
|
|
1466
|
+
expires = TokenValidator._epoch() + effectiveExpiresIn;
|
|
1467
|
+
if (!(accessToken != null)) {
|
|
1468
|
+
_context20.next = 18;
|
|
1469
|
+
break;
|
|
1470
|
+
}
|
|
1471
|
+
_context20.next = 18;
|
|
1472
|
+
return (_this$_storage13 = this._storage) === null || _this$_storage13 === void 0 ? void 0 : _this$_storage13.saveToken({
|
|
1473
|
+
accessToken: accessToken,
|
|
1474
|
+
scopes: scopes,
|
|
1475
|
+
expires: expires,
|
|
1476
|
+
lifeTime: effectiveExpiresIn
|
|
1477
|
+
});
|
|
1478
|
+
case 18:
|
|
1479
|
+
return _context20.abrupt("return", newState);
|
|
1480
|
+
case 19:
|
|
1481
|
+
case "end":
|
|
1482
|
+
return _context20.stop();
|
|
1483
|
+
}
|
|
1484
|
+
}, _callee20, this);
|
|
1485
|
+
}));
|
|
1486
|
+
function _checkForAuthResponse() {
|
|
1487
|
+
return _checkForAuthResponse2.apply(this, arguments);
|
|
1488
|
+
}
|
|
1489
|
+
return _checkForAuthResponse;
|
|
1490
|
+
}()
|
|
1491
|
+
}, {
|
|
1492
|
+
key: "_checkForStateRestoration",
|
|
1493
|
+
value: function () {
|
|
1494
|
+
var _checkForStateRestoration2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
|
|
1495
|
+
var _this$_storage14;
|
|
1496
|
+
var authResponse, stateId;
|
|
1497
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
1498
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1499
|
+
case 0:
|
|
1500
|
+
authResponse = this._responseParser._authResponse;
|
|
1501
|
+
if (authResponse && this.config.cleanHash) {
|
|
1502
|
+
this.setHash('');
|
|
1503
|
+
}
|
|
1504
|
+
stateId = authResponse === null || authResponse === void 0 ? void 0 : authResponse.restoreAuthState;
|
|
1505
|
+
_context21.next = 5;
|
|
1506
|
+
return stateId && ((_this$_storage14 = this._storage) === null || _this$_storage14 === void 0 ? void 0 : _this$_storage14.getState(stateId));
|
|
1507
|
+
case 5:
|
|
1508
|
+
_context21.t0 = _context21.sent;
|
|
1509
|
+
if (_context21.t0) {
|
|
1510
|
+
_context21.next = 8;
|
|
1511
|
+
break;
|
|
1512
|
+
}
|
|
1513
|
+
_context21.t0 = {};
|
|
1514
|
+
case 8:
|
|
1515
|
+
return _context21.abrupt("return", _context21.t0);
|
|
1516
|
+
case 9:
|
|
1517
|
+
case "end":
|
|
1518
|
+
return _context21.stop();
|
|
1519
|
+
}
|
|
1520
|
+
}, _callee21, this);
|
|
1521
|
+
}));
|
|
1522
|
+
function _checkForStateRestoration() {
|
|
1523
|
+
return _checkForStateRestoration2.apply(this, arguments);
|
|
1524
|
+
}
|
|
1525
|
+
return _checkForStateRestoration;
|
|
1526
|
+
}()
|
|
1527
|
+
}, {
|
|
1528
|
+
key: "_checkBackendsAreUp",
|
|
1529
|
+
value: function _checkBackendsAreUp() {
|
|
1530
|
+
var abortCtrl = new AbortController();
|
|
1531
|
+
var backendCheckTimeout = this.config.backendCheckTimeout;
|
|
1532
|
+
return Promise.all([promiseWithTimeout(this.http.fetch('settings/public?fields=id', {
|
|
1533
|
+
signal: abortCtrl.signal
|
|
1534
|
+
}), backendCheckTimeout, {
|
|
1535
|
+
error: new Error('The authorization server is taking too long to respond. Please try again later.'),
|
|
1536
|
+
onTimeout: function onTimeout() {
|
|
1537
|
+
return abortCtrl.abort();
|
|
1538
|
+
}
|
|
1539
|
+
}), this.config.checkBackendIsUp()]).catch(function (err) {
|
|
1540
|
+
if (err instanceof TypeError) {
|
|
1541
|
+
throw new TypeError('Could not connect to the server due to network error. Please check your connection and try again.');
|
|
1542
|
+
}
|
|
1543
|
+
throw err;
|
|
818
1544
|
});
|
|
819
1545
|
}
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
1546
|
+
}, {
|
|
1547
|
+
key: "_checkBackendsStatusesIfEnabled",
|
|
1548
|
+
value: function () {
|
|
1549
|
+
var _checkBackendsStatusesIfEnabled2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
|
|
1550
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
1551
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1552
|
+
case 0:
|
|
1553
|
+
if (this.config.enableBackendStatusCheck) {
|
|
1554
|
+
_context22.next = 2;
|
|
1555
|
+
break;
|
|
1556
|
+
}
|
|
1557
|
+
return _context22.abrupt("return");
|
|
1558
|
+
case 2:
|
|
1559
|
+
_context22.prev = 2;
|
|
1560
|
+
_context22.next = 5;
|
|
1561
|
+
return this._checkBackendsAreUp();
|
|
1562
|
+
case 5:
|
|
1563
|
+
_context22.next = 12;
|
|
1564
|
+
break;
|
|
1565
|
+
case 7:
|
|
1566
|
+
_context22.prev = 7;
|
|
1567
|
+
_context22.t0 = _context22["catch"](2);
|
|
1568
|
+
if (!(_context22.t0 instanceof Error)) {
|
|
1569
|
+
_context22.next = 12;
|
|
1570
|
+
break;
|
|
1571
|
+
}
|
|
1572
|
+
_context22.next = 12;
|
|
1573
|
+
return this._showBackendDownDialog(_context22.t0);
|
|
1574
|
+
case 12:
|
|
1575
|
+
case "end":
|
|
1576
|
+
return _context22.stop();
|
|
1577
|
+
}
|
|
1578
|
+
}, _callee22, this, [[2, 7]]);
|
|
1579
|
+
}));
|
|
1580
|
+
function _checkBackendsStatusesIfEnabled() {
|
|
1581
|
+
return _checkBackendsStatusesIfEnabled2.apply(this, arguments);
|
|
843
1582
|
}
|
|
844
|
-
|
|
845
|
-
})
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
1583
|
+
return _checkBackendsStatusesIfEnabled;
|
|
1584
|
+
}()
|
|
1585
|
+
/**
|
|
1586
|
+
* Adds preconnect tag to help browser to establish connection to URL.
|
|
1587
|
+
* See https://w3c.github.io/resource-hints/
|
|
1588
|
+
* @param url Url to preconnect to.
|
|
1589
|
+
*/
|
|
1590
|
+
}, {
|
|
1591
|
+
key: "setUpPreconnect",
|
|
1592
|
+
value: function setUpPreconnect(url) {
|
|
1593
|
+
var linkNode = document.createElement('link');
|
|
1594
|
+
linkNode.rel = 'preconnect';
|
|
1595
|
+
linkNode.href = url;
|
|
1596
|
+
linkNode.pr = '1.0';
|
|
1597
|
+
linkNode.crossOrigin = 'use-credentials';
|
|
1598
|
+
document.head.appendChild(linkNode);
|
|
850
1599
|
}
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
1600
|
+
/**
|
|
1601
|
+
* Redirects current page to the given URL
|
|
1602
|
+
* @param {string} url
|
|
1603
|
+
* @private
|
|
1604
|
+
*/
|
|
1605
|
+
}, {
|
|
1606
|
+
key: "_redirectCurrentPage",
|
|
1607
|
+
value: function _redirectCurrentPage(url) {
|
|
1608
|
+
{
|
|
1609
|
+
window.location.href = fixUrl(url);
|
|
856
1610
|
}
|
|
857
1611
|
}
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
const linkNode = document.createElement('link');
|
|
866
|
-
linkNode.rel = 'preconnect';
|
|
867
|
-
linkNode.href = url;
|
|
868
|
-
linkNode.pr = '1.0';
|
|
869
|
-
linkNode.crossOrigin = 'use-credentials';
|
|
870
|
-
document.head.appendChild(linkNode);
|
|
871
|
-
}
|
|
872
|
-
/**
|
|
873
|
-
* Redirects current page to the given URL
|
|
874
|
-
* @param {string} url
|
|
875
|
-
* @private
|
|
876
|
-
*/
|
|
877
|
-
_redirectCurrentPage(url) {
|
|
878
|
-
{
|
|
879
|
-
window.location.href = fixUrl(url);
|
|
1612
|
+
/**
|
|
1613
|
+
* Reloads current page
|
|
1614
|
+
*/
|
|
1615
|
+
}, {
|
|
1616
|
+
key: "_reloadCurrentPage",
|
|
1617
|
+
value: function _reloadCurrentPage() {
|
|
1618
|
+
this._redirectCurrentPage(window.location.href);
|
|
880
1619
|
}
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
_reloadCurrentPage() {
|
|
886
|
-
this._redirectCurrentPage(window.location.href);
|
|
887
|
-
}
|
|
888
|
-
_canShowDialogs() {
|
|
889
|
-
return this.config.embeddedLogin && this._authDialogService;
|
|
890
|
-
}
|
|
891
|
-
/**
|
|
892
|
-
* Sets the location hash
|
|
893
|
-
* @param {string} hash
|
|
894
|
-
*/
|
|
895
|
-
setHash(hash) {
|
|
896
|
-
if (history.replaceState) {
|
|
897
|
-
// NB! History.replaceState is used here, because Firefox saves
|
|
898
|
-
// a record in history.
|
|
899
|
-
// NB! URL to redirect is formed manually because baseURI could be messed up,
|
|
900
|
-
// in which case it's not obvious where redirect will lead.
|
|
901
|
-
const cleanedUrl = [window.location.pathname, window.location.search].join('');
|
|
902
|
-
const hashIfExist = hash ? `#${hash}` : '';
|
|
903
|
-
history.replaceState(undefined, '', `${cleanedUrl}${hashIfExist}`);
|
|
904
|
-
} else {
|
|
905
|
-
window.location.hash = hash;
|
|
1620
|
+
}, {
|
|
1621
|
+
key: "_canShowDialogs",
|
|
1622
|
+
value: function _canShowDialogs() {
|
|
1623
|
+
return this.config.embeddedLogin && this._authDialogService;
|
|
906
1624
|
}
|
|
907
|
-
|
|
908
|
-
|
|
1625
|
+
/**
|
|
1626
|
+
* Sets the location hash
|
|
1627
|
+
* @param {string} hash
|
|
1628
|
+
*/
|
|
1629
|
+
}, {
|
|
1630
|
+
key: "setHash",
|
|
1631
|
+
value: function setHash(hash) {
|
|
1632
|
+
if (history.replaceState) {
|
|
1633
|
+
// NB! History.replaceState is used here, because Firefox saves
|
|
1634
|
+
// a record in history.
|
|
1635
|
+
// NB! URL to redirect is formed manually because baseURI could be messed up,
|
|
1636
|
+
// in which case it's not obvious where redirect will lead.
|
|
1637
|
+
var cleanedUrl = [window.location.pathname, window.location.search].join('');
|
|
1638
|
+
var hashIfExist = hash ? "#".concat(hash) : '';
|
|
1639
|
+
history.replaceState(undefined, '', "".concat(cleanedUrl).concat(hashIfExist));
|
|
1640
|
+
} else {
|
|
1641
|
+
window.location.hash = hash;
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
}]);
|
|
1645
|
+
return Auth;
|
|
1646
|
+
}();
|
|
909
1647
|
_defineProperty(Auth, "DEFAULT_CONFIG", DEFAULT_CONFIG);
|
|
910
1648
|
_defineProperty(Auth, "API_PATH", 'api/rest/');
|
|
911
1649
|
_defineProperty(Auth, "API_AUTH_PATH", 'oauth2/auth');
|