@vc-shell/framework 1.1.99-alpha.2 → 1.2.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/core/api/platform.ts +9883 -9883
- package/core/composables/useDynamicProperties/index.ts +16 -10
- package/core/composables/useNotifications/index.ts +1 -32
- package/core/composables/useSettings/index.ts +3 -8
- package/core/composables/useUser/index.ts +171 -74
- package/core/composables/useUserManagement/index.ts +25 -67
- package/core/interceptors/index.ts +56 -19
- package/core/plugins/signalR/index.ts +1 -27
- package/core/types/index.ts +0 -2
- package/dist/core/api/platform.d.ts +1 -1
- package/dist/core/api/platform.d.ts.map +1 -1
- package/dist/core/composables/useDynamicProperties/index.d.ts.map +1 -1
- package/dist/core/composables/useNotifications/index.d.ts.map +1 -1
- package/dist/core/composables/useSettings/index.d.ts.map +1 -1
- package/dist/core/composables/useUser/index.d.ts +9 -18
- package/dist/core/composables/useUser/index.d.ts.map +1 -1
- package/dist/core/composables/useUserManagement/index.d.ts +7 -7
- package/dist/core/composables/useUserManagement/index.d.ts.map +1 -1
- package/dist/core/interceptors/index.d.ts +1 -2
- package/dist/core/interceptors/index.d.ts.map +1 -1
- package/dist/core/plugins/signalR/index.d.ts +0 -2
- package/dist/core/plugins/signalR/index.d.ts.map +1 -1
- package/dist/core/types/index.d.ts +1 -1
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/injection-keys.d.ts +1 -2
- package/dist/injection-keys.d.ts.map +1 -1
- package/dist/shared/components/app-switcher/composables/useAppSwitcher/index.d.ts.map +1 -1
- package/dist/shared/components/multilanguage-selector/multilanguage-selector.vue.d.ts +1 -1
- package/dist/shared/components/notifications/components/notification-container/index.d.ts +10 -10
- package/dist/shared/components/notifications/components/notification-container/index.d.ts.map +1 -1
- package/dist/shared/components/sign-in/useExternalProvider.d.ts +1 -1
- package/dist/shared/components/sign-in/useExternalProvider.d.ts.map +1 -1
- package/dist/shared/modules/assets-manager/components/assets-manager/assets-manager.vue.d.ts +2 -2
- package/dist/shared/modules/dynamic/helpers/nodeBuilder.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts +2 -2
- package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts +2 -2
- package/dist/shared/pages/InvitePage/components/invite/Invite.vue.d.ts +1 -1
- package/dist/shared/pages/InvitePage/components/invite/Invite.vue.d.ts.map +1 -1
- package/dist/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue.d.ts +1 -1
- package/dist/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/atoms/vc-badge/vc-badge.vue.d.ts +1 -1
- package/dist/ui/components/atoms/vc-badge/vc-badge.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-container/vc-container.vue.d.ts +2 -2
- package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts +1 -1
- package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-progress/vc-progress.vue.d.ts +1 -1
- package/dist/ui/components/atoms/vc-progress/vc-progress.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/index.d.ts +1 -0
- package/dist/ui/components/molecules/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-accordion/_internal/vc-accordion-item/vc-accordion-item.vue.d.ts +34 -0
- package/dist/ui/components/molecules/vc-accordion/_internal/vc-accordion-item/vc-accordion-item.vue.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-accordion/index.d.ts +7 -0
- package/dist/ui/components/molecules/vc-accordion/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-accordion/vc-accordion.vue.d.ts +42 -0
- package/dist/ui/components/molecules/vc-accordion/vc-accordion.vue.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-button.vue.d.ts +1 -1
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts +2 -2
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts +1 -1
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +1 -1
- package/dist/ui/components/molecules/vc-rating/vc-rating.vue.d.ts +1 -1
- package/dist/ui/components/molecules/vc-rating/vc-rating.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue.d.ts +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-base-button.vue.d.ts +1 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue.d.ts +1 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-circle-button.vue.d.ts +1 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-circle-button.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/vc-blade.backupsb.d.ts +3 -3
- package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts +1 -1
- package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue.d.ts +2 -2
- package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue.d.ts +1 -1
- package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts +5 -5
- package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts +1 -1
- package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-counter/vc-table-counter.vue.d.ts +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-counter/vc-table-counter.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-body/vc-table-body.vue.d.ts +2 -2
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-row/vc-table-row.vue.d.ts +2 -2
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/vc-table-desktop-view.vue.d.ts +3 -3
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts +1 -1
- package/package.json +5 -7
- package/shared/components/app-switcher/components/vc-app-switcher/vc-app-switcher.vue +2 -2
- package/shared/components/app-switcher/composables/useAppSwitcher/index.ts +1 -15
- package/shared/components/sign-in/useExternalProvider.ts +1 -11
- package/shared/modules/dynamic/helpers/nodeBuilder.ts +3 -11
- package/ui/components/atoms/vc-badge/vc-badge.stories.ts +1 -1
- package/ui/components/atoms/vc-button/vc-button.stories.ts +1 -1
- package/ui/components/atoms/vc-card/vc-card.stories.ts +1 -1
- package/ui/components/atoms/vc-col/vc-col.stories.ts +1 -1
- package/ui/components/atoms/vc-container/vc-container.stories.ts +1 -1
- package/ui/components/atoms/vc-hint/vc-hint.stories.ts +1 -1
- package/ui/components/atoms/vc-icon/vc-icon.stories.ts +1 -1
- package/ui/components/atoms/vc-image/vc-image.stories.ts +1 -1
- package/ui/components/atoms/vc-label/vc-label.stories.ts +1 -1
- package/ui/components/atoms/vc-link/vc-link.stories.ts +1 -1
- package/ui/components/atoms/vc-progress/vc-progress.stories.ts +1 -1
- package/ui/components/atoms/vc-row/vc-row.stories.ts +1 -1
- package/ui/components/atoms/vc-skeleton/vc-skeleton.stories.ts +1 -1
- package/ui/components/atoms/vc-status/vc-status.stories.ts +1 -1
- package/ui/components/atoms/vc-status-icon/vc-status-icon.stories.ts +1 -1
- package/ui/components/atoms/vc-tooltip/vc-tooltip.stories.ts +1 -1
- package/ui/components/atoms/vc-video/vc-video.stories.ts +1 -1
- package/ui/components/atoms/vc-widget/vc-widget.stories.ts +1 -1
- package/ui/components/molecules/index.ts +1 -0
- package/ui/components/molecules/vc-accordion/_internal/vc-accordion-item/vc-accordion-item.vue +251 -0
- package/ui/components/molecules/vc-accordion/index.ts +11 -0
- package/ui/components/molecules/vc-accordion/vc-accordion.stories.ts +526 -0
- package/ui/components/molecules/vc-accordion/vc-accordion.vue +176 -0
- package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.stories.ts +1 -1
- package/ui/components/molecules/vc-checkbox/vc-checkbox.stories.ts +1 -1
- package/ui/components/molecules/vc-editor/vc-editor.stories.ts +1 -1
- package/ui/components/molecules/vc-field/vc-field.stories.ts +1 -1
- package/ui/components/molecules/vc-file-upload/vc-file-upload.stories.ts +1 -1
- package/ui/components/molecules/vc-form/vc-form.stories.ts +1 -1
- package/ui/components/molecules/vc-input/vc-input.stories.ts +1 -1
- package/ui/components/molecules/vc-input-currency/vc-input-currency.stories.ts +1 -1
- package/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.stories.ts +1 -1
- package/ui/components/molecules/vc-multivalue/vc-multivalue.stories.ts +1 -1
- package/ui/components/molecules/vc-pagination/vc-pagination.stories.ts +1 -1
- package/ui/components/molecules/vc-radio-button/vc-radio-button.stories.ts +1 -1
- package/ui/components/molecules/vc-rating/vc-rating.stories.ts +1 -1
- package/ui/components/molecules/vc-select/vc-select.stories.ts +1 -1
- package/ui/components/molecules/vc-slider/vc-slider.stories.ts +1 -1
- package/ui/components/molecules/vc-switch/vc-switch.stories.ts +1 -1
- package/ui/components/molecules/vc-textarea/vc-textarea.stories.ts +1 -1
- package/ui/components/molecules/vc-toast/vc-toast.stories.ts +1 -1
- package/ui/components/organisms/vc-app/vc-app.vue +2 -20
- package/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue +4 -0
- package/ui/components/organisms/vc-gallery/vc-gallery.stories.ts +1 -1
- package/ui/components/organisms/vc-popup/vc-popup.stories.ts +1 -1
- package/core/providers/README.md +0 -176
- package/core/providers/auth-provider-manager.ts +0 -74
- package/core/providers/auth-provider-utils.ts +0 -26
- package/core/providers/example-custom-auth-provider.ts +0 -162
- package/core/providers/index.ts +0 -3
- package/core/providers/platform-auth-provider.ts +0 -207
- package/core/types/auth-provider.ts +0 -40
- package/dist/assets/042c75b764bc78a7.svg +0 -1
- package/dist/assets/0ba156439a339f2a.svg +0 -1
- package/dist/assets/0be560bfb22d0e72.woff2 +0 -0
- package/dist/assets/0f590f8a94577092.svg +0 -1
- package/dist/assets/0fc5820f8be53a1b.svg +0 -1
- package/dist/assets/105efd028edc1dfe.woff +0 -0
- package/dist/assets/10768e2cc79fc60b.svg +0 -1
- package/dist/assets/11b3d25a56fd9a21.woff2 +0 -0
- package/dist/assets/154365acf3010d96.woff2 +0 -0
- package/dist/assets/157b8721e0600ea8.svg +0 -1
- package/dist/assets/15e91cdd649cde9a.svg +0 -1
- package/dist/assets/19275e398ae57130.woff2 +0 -0
- package/dist/assets/1a3e84b2457f709a.woff +0 -0
- package/dist/assets/1de63eb118636cce.svg +0 -1
- package/dist/assets/1ea01de36eb5491b.svg +0 -1
- package/dist/assets/204eaf512fde2023.svg +0 -1
- package/dist/assets/2088983edf42e153.svg +0 -1
- package/dist/assets/208f810a9321a327.svg +0 -1
- package/dist/assets/21220a9d10e6c558.svg +0 -1
- package/dist/assets/220db345a102045d.woff2 +0 -0
- package/dist/assets/225da11d23968333.svg +0 -1
- package/dist/assets/226f862dd81bdc13.woff2 +0 -0
- package/dist/assets/23a2d53395ddb14f.woff +0 -0
- package/dist/assets/259e6ad461a52ad7.svg +0 -1
- package/dist/assets/261e6dec4d53b9ac.woff +0 -0
- package/dist/assets/262f46a0b6d94bb6.svg +0 -1
- package/dist/assets/2857c513073467da.svg +0 -1
- package/dist/assets/2b3be7889467d98f.woff +0 -0
- package/dist/assets/2d4e6190eec72737.svg +0 -1
- package/dist/assets/2eba973185078bc8.woff +0 -0
- package/dist/assets/334d3f6bc766c516.woff +0 -0
- package/dist/assets/34ff7dd0c2285956.svg +0 -1
- package/dist/assets/3d26b7c1ab78bbe2.woff +0 -0
- package/dist/assets/3d892965ab4f1cbb.woff2 +0 -0
- package/dist/assets/3f8c4cc8099e34b6.woff2 +0 -0
- package/dist/assets/40a0e53b79ce63c6.woff2 +0 -0
- package/dist/assets/41275bcb979cb650.svg +0 -1
- package/dist/assets/434f7982590e462f.woff +0 -0
- package/dist/assets/475937116ee3314a.woff2 +0 -0
- package/dist/assets/489710fb710e73f0.woff +0 -0
- package/dist/assets/49791943b3872376.woff2 +0 -0
- package/dist/assets/4ae5f23e0ca888e7.woff2 +0 -0
- package/dist/assets/4d7a77b0e5373992.svg +0 -1
- package/dist/assets/4e43c74354534fb3.svg +0 -1
- package/dist/assets/4fe75f5117100705.svg +0 -1
- package/dist/assets/52e261a005074e1b.woff +0 -0
- package/dist/assets/5304c3d05a5f9789.woff2 +0 -0
- package/dist/assets/54cda5482c6c9218.woff +0 -0
- package/dist/assets/550f52072e8ccafe.woff2 +0 -0
- package/dist/assets/572bb1bb4156a9c1.svg +0 -1
- package/dist/assets/6075995d7e74da46.woff2 +0 -0
- package/dist/assets/617c4736236e199e.woff +0 -0
- package/dist/assets/67230f05dc94a265.svg +0 -1
- package/dist/assets/6798e4dd4add9b48.svg +0 -1
- package/dist/assets/686d4077c1e26876.woff2 +0 -0
- package/dist/assets/698ec6c722d4cb05.woff2 +0 -0
- package/dist/assets/6a3e73faf406cf33.svg +0 -1
- package/dist/assets/72de3a63bc0b70dd.svg +0 -1
- package/dist/assets/74c6a6ab81bb6340.woff2 +0 -0
- package/dist/assets/74ed5f8a78e71106.svg +0 -1
- package/dist/assets/7a5aa5abd625137f.ttf +0 -0
- package/dist/assets/7ce0c166fd6a1204.woff +0 -0
- package/dist/assets/7d55399c2a7bc985.svg +0 -1
- package/dist/assets/7d970675c69fca1d.woff +0 -0
- package/dist/assets/7eda727273fd98d3.svg +0 -1
- package/dist/assets/7f6ebfd707b76ca2.woff +0 -0
- package/dist/assets/7fa898d213fcc7bc.woff2 +0 -0
- package/dist/assets/861e6b7192b3b6c7.woff +0 -0
- package/dist/assets/8bbcde81ba21ecb2.woff2 +0 -0
- package/dist/assets/8f6657e5e0b8d3e4.woff +0 -0
- package/dist/assets/910b0d99b9e26568.svg +0 -1
- package/dist/assets/91fe94e424323d61.woff +0 -0
- package/dist/assets/92508f8707159b51.svg +0 -1
- package/dist/assets/9392bf1d591e1abb.svg +0 -1
- package/dist/assets/97e8d4984ba0713a.woff2 +0 -0
- package/dist/assets/9cb83236f6bb7ab1.svg +0 -1
- package/dist/assets/9d37314695c0b68d.woff +0 -0
- package/dist/assets/a03cdcd8da5bb987.woff +0 -0
- package/dist/assets/a18404194e3f9047.svg +0 -1
- package/dist/assets/a2017fe7f0a26510.svg +0 -1
- package/dist/assets/ab6e7190bb1492d5.woff2 +0 -0
- package/dist/assets/abf88f301a0730f4.svg +0 -1
- package/dist/assets/ac1a99b3d05d8232.woff +0 -0
- package/dist/assets/aed17cb6fdad2ada.woff2 +0 -0
- package/dist/assets/b1a596e31ad1185a.svg +0 -1
- package/dist/assets/b27767411c8427be.woff +0 -0
- package/dist/assets/b325adcae33bbe7a.svg +0 -1
- package/dist/assets/b372390551ca2fa1.svg +0 -1
- package/dist/assets/b5bb1e8fc975decd.svg +0 -1
- package/dist/assets/b645a4a2181b9dc1.svg +0 -1
- package/dist/assets/b6499ddce0a4ef7d.svg +0 -1
- package/dist/assets/b94421fadd23b0f2.svg +0 -1
- package/dist/assets/bb28fb0f27f1c11b.svg +0 -1
- package/dist/assets/c9191b638a10f67b.woff2 +0 -0
- package/dist/assets/ca791c5ca5848a03.svg +0 -1
- package/dist/assets/cb32840ce330103f.woff +0 -0
- package/dist/assets/ccc878931d74181b.woff2 +0 -0
- package/dist/assets/d084bda16abe8a56.svg +0 -1
- package/dist/assets/d32b129cae2fffd6.svg +0 -1
- package/dist/assets/d35a4c7113315758.woff2 +0 -0
- package/dist/assets/d3f792f54ae4c307.svg +0 -1
- package/dist/assets/d5a5b8630120073d.svg +0 -1
- package/dist/assets/d5f9664ebbfb104b.svg +0 -1
- package/dist/assets/d84247b59449dd88.woff2 +0 -0
- package/dist/assets/dceaf3b39091e6a4.woff +0 -0
- package/dist/assets/dd05d43ff0df2fc7.svg +0 -1
- package/dist/assets/e2ad5b3428289141.woff +0 -0
- package/dist/assets/e38acaa1757232e0.svg +0 -1
- package/dist/assets/e4a8550f1c7ffe36.svg +0 -1
- package/dist/assets/e5adb5ae3a3698f6.svg +0 -1
- package/dist/assets/e61a1889bac955f4.woff2 +0 -0
- package/dist/assets/e72bb11356af94c7.svg +0 -1
- package/dist/assets/e98196a9f8dcb2f0.svg +0 -1
- package/dist/assets/ebec912a42ad49ff.woff +0 -0
- package/dist/assets/ee6983981ffcbb41.woff2 +0 -0
- package/dist/assets/f09d89268e4c0317.svg +0 -1
- package/dist/assets/f239394367fcf005.woff2 +0 -0
- package/dist/assets/f5722262b6e7214e.woff2 +0 -0
- package/dist/assets/f7fc8bf46089d8b2.svg +0 -1
- package/dist/assets/fc829e3f399b70e0.woff2 +0 -0
- package/dist/assets/fe141d99763f5d2b.woff +0 -0
- package/dist/assets/fed13b0d59903483.svg +0 -1
- package/dist/assets/fed757d2c2344ead.woff2 +0 -0
- package/dist/assets/ffc438f20e79ce73.woff +0 -0
- package/dist/core/providers/auth-provider-manager.d.ts +0 -34
- package/dist/core/providers/auth-provider-manager.d.ts.map +0 -1
- package/dist/core/providers/auth-provider-utils.d.ts +0 -17
- package/dist/core/providers/auth-provider-utils.d.ts.map +0 -1
- package/dist/core/providers/example-custom-auth-provider.d.ts +0 -45
- package/dist/core/providers/example-custom-auth-provider.d.ts.map +0 -1
- package/dist/core/providers/index.d.ts +0 -3
- package/dist/core/providers/index.d.ts.map +0 -1
- package/dist/core/providers/platform-auth-provider.d.ts +0 -34
- package/dist/core/providers/platform-auth-provider.d.ts.map +0 -1
- package/dist/core/types/auth-provider.d.ts +0 -27
- package/dist/core/types/auth-provider.d.ts.map +0 -1
- package/dist/framework.js +0 -25048
- package/dist/index.css +0 -9
- package/dist/vendor-boolbase-A_-Pp38P.js +0 -23
- package/dist/vendor-cheerio-C46iBpCu.js +0 -1053
- package/dist/vendor-cheerio-select-C8emRZsx.js +0 -191
- package/dist/vendor-core-js-DDuR6YMQ.js +0 -1206
- package/dist/vendor-css-select-DR9bp36p.js +0 -622
- package/dist/vendor-css-what-CZZaquJM.js +0 -267
- package/dist/vendor-cypress-signalr-mock-DjBxJHA6.js +0 -769
- package/dist/vendor-date-fns-sZ1zMzTH.js +0 -3008
- package/dist/vendor-dom-serializer-Sk3xHhQk.js +0 -213
- package/dist/vendor-domelementtype-B3sFIGaC.js +0 -21
- package/dist/vendor-domhandler-CL40eeX9.js +0 -311
- package/dist/vendor-dompurify-BuxjWxA2.js +0 -553
- package/dist/vendor-domutils-BiVCXO8c.js +0 -386
- package/dist/vendor-entities-CCReaWqU.js +0 -364
- package/dist/vendor-floating-ui-core-Cl9nBI4j.js +0 -349
- package/dist/vendor-floating-ui-dom-3z44E4mf.js +0 -395
- package/dist/vendor-floating-ui-utils-D2sT7feD.js +0 -259
- package/dist/vendor-floating-ui-vue-ClrgkeO5.js +0 -107
- package/dist/vendor-headlessui-vue-D7tzx4PC.js +0 -961
- package/dist/vendor-htmlparser2-CpQu33io.js +0 -735
- package/dist/vendor-intlify-core-base-Da62SG4M.js +0 -1130
- package/dist/vendor-intlify-message-compiler-CHvGSH2u.js +0 -952
- package/dist/vendor-intlify-shared-jWBPd9WB.js +0 -144
- package/dist/vendor-iso-639-1-BJO6WZAt.js +0 -781
- package/dist/vendor-linkify-it-LzoUhj6C.js +0 -199
- package/dist/vendor-linkifyjs-dCH9UYes.js +0 -701
- package/dist/vendor-lodash-es-BqkGj3Jl.js +0 -4816
- package/dist/vendor-lucide-vue-next-m0L4DzUL.js +0 -29780
- package/dist/vendor-markdown-it-Czg9qJTh.js +0 -2263
- package/dist/vendor-markdown-it-task-lists-BxLwscWK.js +0 -69
- package/dist/vendor-mdurl-DZFDNdqC.js +0 -192
- package/dist/vendor-microsoft-applicationinsights-analytics-js-C1Yxuzwg.js +0 -1207
- package/dist/vendor-microsoft-applicationinsights-cfgsync-js-DArHD4Dn.js +0 -261
- package/dist/vendor-microsoft-applicationinsights-channel-js-Dbs0XRes.js +0 -1822
- package/dist/vendor-microsoft-applicationinsights-common-OjU3Zs6r.js +0 -1921
- package/dist/vendor-microsoft-applicationinsights-core-js-DWRvqBek.js +0 -4276
- package/dist/vendor-microsoft-applicationinsights-dependencies-js-BxTNw-Sk.js +0 -1407
- package/dist/vendor-microsoft-applicationinsights-properties-js-Gfhpu-At.js +0 -572
- package/dist/vendor-microsoft-applicationinsights-shims-CxtPYiwp.js +0 -43
- package/dist/vendor-microsoft-applicationinsights-web-9yeJ0EZv.js +0 -487
- package/dist/vendor-microsoft-dynamicproto-js-DSkQkH3T.js +0 -147
- package/dist/vendor-microsoft-signalr-Bgpbb4fW.js +0 -1761
- package/dist/vendor-moment-DMLRxgRE.js +0 -2589
- package/dist/vendor-nevware21-ts-async-CdMc_sGt.js +0 -261
- package/dist/vendor-nevware21-ts-utils-Dy41wRhA.js +0 -853
- package/dist/vendor-nth-check-CS1D-zr5.js +0 -45
- package/dist/vendor-orderedmap-B3SOk52B.js +0 -103
- package/dist/vendor-parse5-htmlparser2-tree-adapter-BWywtwol.js +0 -143
- package/dist/vendor-parse5-zq5Hn0y9.js +0 -5749
- package/dist/vendor-prettier-cZc5sCiS.js +0 -4875
- package/dist/vendor-prosemirror-commands-Cu1q5ZDk.js +0 -385
- package/dist/vendor-prosemirror-dropcursor-BuGmFgFS.js +0 -86
- package/dist/vendor-prosemirror-gapcursor-CyYcCWVK.js +0 -203
- package/dist/vendor-prosemirror-history-DzRcbrCw.js +0 -248
- package/dist/vendor-prosemirror-keymap-KfbdOEJw.js +0 -62
- package/dist/vendor-prosemirror-markdown-OyxRuawK.js +0 -650
- package/dist/vendor-prosemirror-model-DFp4ML7B.js +0 -2730
- package/dist/vendor-prosemirror-schema-list-CwCUArvx.js +0 -87
- package/dist/vendor-prosemirror-state-DHaVEu5h.js +0 -821
- package/dist/vendor-prosemirror-tables-mYok4vGT.js +0 -1711
- package/dist/vendor-prosemirror-transform-CAHmg-qG.js +0 -1508
- package/dist/vendor-prosemirror-view-CspJa44O.js +0 -3751
- package/dist/vendor-punycode-js-CgGegfA_.js +0 -133
- package/dist/vendor-rope-sequence-BWC2FSrq.js +0 -100
- package/dist/vendor-semver-Dar8oU3V.js +0 -1023
- package/dist/vendor-swiper-1bp0oJwt.js +0 -3387
- package/dist/vendor-tanstack-virtual-core-l0sNRNKZ.js +0 -1
- package/dist/vendor-tanstack-vue-virtual-CD9yLWd7.js +0 -1
- package/dist/vendor-tiptap-core-ClsTgaMv.js +0 -3699
- package/dist/vendor-tiptap-extension-blockquote-r1MBx4hD.js +0 -54
- package/dist/vendor-tiptap-extension-bold-BjLI4i8b.js +0 -74
- package/dist/vendor-tiptap-extension-code-D5-kDnMW.js +0 -52
- package/dist/vendor-tiptap-extension-code-block-RjEb0zPA.js +0 -215
- package/dist/vendor-tiptap-extension-document--PLOxIdq.js +0 -12
- package/dist/vendor-tiptap-extension-hard-break-9cxC2YOS.js +0 -59
- package/dist/vendor-tiptap-extension-heading-2w0TutHn.js +0 -63
- package/dist/vendor-tiptap-extension-horizontal-rule-CFowa_lc.js +0 -56
- package/dist/vendor-tiptap-extension-image-aWn-na6j.js +0 -127
- package/dist/vendor-tiptap-extension-italic-Bn-6saY0.js +0 -73
- package/dist/vendor-tiptap-extension-link-BmcG1_k-.js +0 -298
- package/dist/vendor-tiptap-extension-list-BrNBJ45n.js +0 -707
- package/dist/vendor-tiptap-extension-paragraph-DAiYhwUB.js +0 -41
- package/dist/vendor-tiptap-extension-placeholder-9tURDKy-.js +0 -1
- package/dist/vendor-tiptap-extension-strike-DqbXPfos.js +0 -64
- package/dist/vendor-tiptap-extension-table-DQwPaR7v.js +0 -374
- package/dist/vendor-tiptap-extension-table-cell-C0tEP_0i.js +0 -1
- package/dist/vendor-tiptap-extension-table-header-C0tEP_0i.js +0 -1
- package/dist/vendor-tiptap-extension-table-row-C0tEP_0i.js +0 -1
- package/dist/vendor-tiptap-extension-text-BFnfj70b.js +0 -13
- package/dist/vendor-tiptap-extension-text-style-Darua3qr.js +0 -235
- package/dist/vendor-tiptap-extension-underline-QyVnBqQZ.js +0 -65
- package/dist/vendor-tiptap-extensions-CU-D7bfm.js +0 -290
- package/dist/vendor-tiptap-markdown-BwATYN5A.js +0 -826
- package/dist/vendor-tiptap-pm-d91nGny8.js +0 -1
- package/dist/vendor-tiptap-starter-kit-5luf7zzS.js +0 -28
- package/dist/vendor-tiptap-vue-3-CFBErZGb.js +0 -157
- package/dist/vendor-truncate-html-DYC0Lj9o.js +0 -145
- package/dist/vendor-uc-micro-4lbSaZOs.js +0 -17
- package/dist/vendor-vee-validate-i18n-zT8NxX3R.js +0 -93
- package/dist/vendor-vee-validate-rules-4oWUZPpG.js +0 -316
- package/dist/vendor-vue-currency-input-BqaYAdhD.js +0 -317
- package/dist/vendor-vue-demi-CD9yLWd7.js +0 -1
- package/dist/vendor-vue-devtools-api-aVYGocXp.js +0 -93
- package/dist/vendor-vue-i18n-CO5LWKE0.js +0 -1370
- package/dist/vendor-vue3-application-insights-BKiiWnf2.js +0 -69
- package/dist/vendor-vue3-touch-events-DqysuuWh.js +0 -169
- package/dist/vendor-vuepic-vue-datepicker-CaY_xSnG.js +0 -4998
- package/dist/vendor-vueuse-components-sgKpNzof.js +0 -542
- package/dist/vendor-vueuse-core-D0cN7FqY.js +0 -5130
- package/dist/vendor-vueuse-shared-Pt0UEStA.js +0 -1169
- package/dist/vendor-w3c-keyname-CLxH8j-f.js +0 -92
|
@@ -1,1761 +0,0 @@
|
|
|
1
|
-
class C extends Error {
|
|
2
|
-
/** Constructs a new instance of {@link @microsoft/signalr.HttpError}.
|
|
3
|
-
*
|
|
4
|
-
* @param {string} errorMessage A descriptive error message.
|
|
5
|
-
* @param {number} statusCode The HTTP status code represented by this error.
|
|
6
|
-
*/
|
|
7
|
-
constructor(e, t) {
|
|
8
|
-
const n = new.target.prototype;
|
|
9
|
-
super(`${e}: Status code '${t}'`), this.statusCode = t, this.__proto__ = n;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
class D extends Error {
|
|
13
|
-
/** Constructs a new instance of {@link @microsoft/signalr.TimeoutError}.
|
|
14
|
-
*
|
|
15
|
-
* @param {string} errorMessage A descriptive error message.
|
|
16
|
-
*/
|
|
17
|
-
constructor(e = "A timeout occurred.") {
|
|
18
|
-
const t = new.target.prototype;
|
|
19
|
-
super(e), this.__proto__ = t;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
class b extends Error {
|
|
23
|
-
/** Constructs a new instance of {@link AbortError}.
|
|
24
|
-
*
|
|
25
|
-
* @param {string} errorMessage A descriptive error message.
|
|
26
|
-
*/
|
|
27
|
-
constructor(e = "An abort occurred.") {
|
|
28
|
-
const t = new.target.prototype;
|
|
29
|
-
super(e), this.__proto__ = t;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
class O extends Error {
|
|
33
|
-
/** Constructs a new instance of {@link @microsoft/signalr.UnsupportedTransportError}.
|
|
34
|
-
*
|
|
35
|
-
* @param {string} message A descriptive error message.
|
|
36
|
-
* @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occurred on.
|
|
37
|
-
*/
|
|
38
|
-
constructor(e, t) {
|
|
39
|
-
const n = new.target.prototype;
|
|
40
|
-
super(e), this.transport = t, this.errorType = "UnsupportedTransportError", this.__proto__ = n;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
class F extends Error {
|
|
44
|
-
/** Constructs a new instance of {@link @microsoft/signalr.DisabledTransportError}.
|
|
45
|
-
*
|
|
46
|
-
* @param {string} message A descriptive error message.
|
|
47
|
-
* @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occurred on.
|
|
48
|
-
*/
|
|
49
|
-
constructor(e, t) {
|
|
50
|
-
const n = new.target.prototype;
|
|
51
|
-
super(e), this.transport = t, this.errorType = "DisabledTransportError", this.__proto__ = n;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
class q extends Error {
|
|
55
|
-
/** Constructs a new instance of {@link @microsoft/signalr.FailedToStartTransportError}.
|
|
56
|
-
*
|
|
57
|
-
* @param {string} message A descriptive error message.
|
|
58
|
-
* @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occurred on.
|
|
59
|
-
*/
|
|
60
|
-
constructor(e, t) {
|
|
61
|
-
const n = new.target.prototype;
|
|
62
|
-
super(e), this.transport = t, this.errorType = "FailedToStartTransportError", this.__proto__ = n;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
class M extends Error {
|
|
66
|
-
/** Constructs a new instance of {@link @microsoft/signalr.FailedToNegotiateWithServerError}.
|
|
67
|
-
*
|
|
68
|
-
* @param {string} message A descriptive error message.
|
|
69
|
-
*/
|
|
70
|
-
constructor(e) {
|
|
71
|
-
const t = new.target.prototype;
|
|
72
|
-
super(e), this.errorType = "FailedToNegotiateWithServerError", this.__proto__ = t;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
class z extends Error {
|
|
76
|
-
/** Constructs a new instance of {@link @microsoft/signalr.AggregateErrors}.
|
|
77
|
-
*
|
|
78
|
-
* @param {string} message A descriptive error message.
|
|
79
|
-
* @param {Error[]} innerErrors The collection of errors this error is aggregating.
|
|
80
|
-
*/
|
|
81
|
-
constructor(e, t) {
|
|
82
|
-
const n = new.target.prototype;
|
|
83
|
-
super(e), this.innerErrors = t, this.__proto__ = n;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
class L {
|
|
87
|
-
constructor(e, t, n) {
|
|
88
|
-
this.statusCode = e, this.statusText = t, this.content = n;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
class R {
|
|
92
|
-
get(e, t) {
|
|
93
|
-
return this.send({
|
|
94
|
-
...t,
|
|
95
|
-
method: "GET",
|
|
96
|
-
url: e
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
post(e, t) {
|
|
100
|
-
return this.send({
|
|
101
|
-
...t,
|
|
102
|
-
method: "POST",
|
|
103
|
-
url: e
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
delete(e, t) {
|
|
107
|
-
return this.send({
|
|
108
|
-
...t,
|
|
109
|
-
method: "DELETE",
|
|
110
|
-
url: e
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
/** Gets all cookies that apply to the specified URL.
|
|
114
|
-
*
|
|
115
|
-
* @param url The URL that the cookies are valid for.
|
|
116
|
-
* @returns {string} A string containing all the key-value cookie pairs for the specified URL.
|
|
117
|
-
*/
|
|
118
|
-
// @ts-ignore
|
|
119
|
-
getCookieString(e) {
|
|
120
|
-
return "";
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
var i;
|
|
124
|
-
(function(s) {
|
|
125
|
-
s[s.Trace = 0] = "Trace", s[s.Debug = 1] = "Debug", s[s.Information = 2] = "Information", s[s.Warning = 3] = "Warning", s[s.Error = 4] = "Error", s[s.Critical = 5] = "Critical", s[s.None = 6] = "None";
|
|
126
|
-
})(i || (i = {}));
|
|
127
|
-
class E {
|
|
128
|
-
constructor() {
|
|
129
|
-
}
|
|
130
|
-
/** @inheritDoc */
|
|
131
|
-
// eslint-disable-next-line
|
|
132
|
-
log(e, t) {
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
E.instance = new E();
|
|
136
|
-
const X = "8.0.17";
|
|
137
|
-
class f {
|
|
138
|
-
static isRequired(e, t) {
|
|
139
|
-
if (e == null)
|
|
140
|
-
throw new Error(`The '${t}' argument is required.`);
|
|
141
|
-
}
|
|
142
|
-
static isNotEmpty(e, t) {
|
|
143
|
-
if (!e || e.match(/^\s*$/))
|
|
144
|
-
throw new Error(`The '${t}' argument should not be empty.`);
|
|
145
|
-
}
|
|
146
|
-
static isIn(e, t, n) {
|
|
147
|
-
if (!(e in t))
|
|
148
|
-
throw new Error(`Unknown ${n} value: ${e}.`);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
class _ {
|
|
152
|
-
// react-native has a window but no document so we should check both
|
|
153
|
-
static get isBrowser() {
|
|
154
|
-
return !_.isNode && typeof window == "object" && typeof window.document == "object";
|
|
155
|
-
}
|
|
156
|
-
// WebWorkers don't have a window object so the isBrowser check would fail
|
|
157
|
-
static get isWebWorker() {
|
|
158
|
-
return !_.isNode && typeof self == "object" && "importScripts" in self;
|
|
159
|
-
}
|
|
160
|
-
// react-native has a window but no document
|
|
161
|
-
static get isReactNative() {
|
|
162
|
-
return !_.isNode && typeof window == "object" && typeof window.document > "u";
|
|
163
|
-
}
|
|
164
|
-
// Node apps shouldn't have a window object, but WebWorkers don't either
|
|
165
|
-
// so we need to check for both WebWorker and window
|
|
166
|
-
static get isNode() {
|
|
167
|
-
return typeof process < "u" && process.release && process.release.name === "node";
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
function I(s, e) {
|
|
171
|
-
let t = "";
|
|
172
|
-
return v(s) ? (t = `Binary data of length ${s.byteLength}`, e && (t += `. Content: '${K(s)}'`)) : typeof s == "string" && (t = `String data of length ${s.length}`, e && (t += `. Content: '${s}'`)), t;
|
|
173
|
-
}
|
|
174
|
-
function K(s) {
|
|
175
|
-
const e = new Uint8Array(s);
|
|
176
|
-
let t = "";
|
|
177
|
-
return e.forEach((n) => {
|
|
178
|
-
const o = n < 16 ? "0" : "";
|
|
179
|
-
t += `0x${o}${n.toString(16)} `;
|
|
180
|
-
}), t.substr(0, t.length - 1);
|
|
181
|
-
}
|
|
182
|
-
function v(s) {
|
|
183
|
-
return s && typeof ArrayBuffer < "u" && (s instanceof ArrayBuffer || // Sometimes we get an ArrayBuffer that doesn't satisfy instanceof
|
|
184
|
-
s.constructor && s.constructor.name === "ArrayBuffer");
|
|
185
|
-
}
|
|
186
|
-
async function j(s, e, t, n, o, r) {
|
|
187
|
-
const c = {}, [a, l] = k();
|
|
188
|
-
c[a] = l, s.log(i.Trace, `(${e} transport) sending data. ${I(o, r.logMessageContent)}.`);
|
|
189
|
-
const u = v(o) ? "arraybuffer" : "text", d = await t.post(n, {
|
|
190
|
-
content: o,
|
|
191
|
-
headers: { ...c, ...r.headers },
|
|
192
|
-
responseType: u,
|
|
193
|
-
timeout: r.timeout,
|
|
194
|
-
withCredentials: r.withCredentials
|
|
195
|
-
});
|
|
196
|
-
s.log(i.Trace, `(${e} transport) request complete. Response status: ${d.statusCode}.`);
|
|
197
|
-
}
|
|
198
|
-
function J(s) {
|
|
199
|
-
return s === void 0 ? new P(i.Information) : s === null ? E.instance : s.log !== void 0 ? s : new P(s);
|
|
200
|
-
}
|
|
201
|
-
class V {
|
|
202
|
-
constructor(e, t) {
|
|
203
|
-
this._subject = e, this._observer = t;
|
|
204
|
-
}
|
|
205
|
-
dispose() {
|
|
206
|
-
const e = this._subject.observers.indexOf(this._observer);
|
|
207
|
-
e > -1 && this._subject.observers.splice(e, 1), this._subject.observers.length === 0 && this._subject.cancelCallback && this._subject.cancelCallback().catch((t) => {
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
class P {
|
|
212
|
-
constructor(e) {
|
|
213
|
-
this._minLevel = e, this.out = console;
|
|
214
|
-
}
|
|
215
|
-
log(e, t) {
|
|
216
|
-
if (e >= this._minLevel) {
|
|
217
|
-
const n = `[${(/* @__PURE__ */ new Date()).toISOString()}] ${i[e]}: ${t}`;
|
|
218
|
-
switch (e) {
|
|
219
|
-
case i.Critical:
|
|
220
|
-
case i.Error:
|
|
221
|
-
this.out.error(n);
|
|
222
|
-
break;
|
|
223
|
-
case i.Warning:
|
|
224
|
-
this.out.warn(n);
|
|
225
|
-
break;
|
|
226
|
-
case i.Information:
|
|
227
|
-
this.out.info(n);
|
|
228
|
-
break;
|
|
229
|
-
default:
|
|
230
|
-
this.out.log(n);
|
|
231
|
-
break;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
function k() {
|
|
237
|
-
let s = "X-SignalR-User-Agent";
|
|
238
|
-
return _.isNode && (s = "User-Agent"), [s, G(X, Q(), Z(), Y())];
|
|
239
|
-
}
|
|
240
|
-
function G(s, e, t, n) {
|
|
241
|
-
let o = "Microsoft SignalR/";
|
|
242
|
-
const r = s.split(".");
|
|
243
|
-
return o += `${r[0]}.${r[1]}`, o += ` (${s}; `, e && e !== "" ? o += `${e}; ` : o += "Unknown OS; ", o += `${t}`, n ? o += `; ${n}` : o += "; Unknown Runtime Version", o += ")", o;
|
|
244
|
-
}
|
|
245
|
-
function Q() {
|
|
246
|
-
if (_.isNode)
|
|
247
|
-
switch (process.platform) {
|
|
248
|
-
case "win32":
|
|
249
|
-
return "Windows NT";
|
|
250
|
-
case "darwin":
|
|
251
|
-
return "macOS";
|
|
252
|
-
case "linux":
|
|
253
|
-
return "Linux";
|
|
254
|
-
default:
|
|
255
|
-
return process.platform;
|
|
256
|
-
}
|
|
257
|
-
else
|
|
258
|
-
return "";
|
|
259
|
-
}
|
|
260
|
-
function Y() {
|
|
261
|
-
if (_.isNode)
|
|
262
|
-
return process.versions.node;
|
|
263
|
-
}
|
|
264
|
-
function Z() {
|
|
265
|
-
return _.isNode ? "NodeJS" : "Browser";
|
|
266
|
-
}
|
|
267
|
-
function $(s) {
|
|
268
|
-
return s.stack ? s.stack : s.message ? s.message : `${s}`;
|
|
269
|
-
}
|
|
270
|
-
function ee() {
|
|
271
|
-
if (typeof globalThis < "u")
|
|
272
|
-
return globalThis;
|
|
273
|
-
if (typeof self < "u")
|
|
274
|
-
return self;
|
|
275
|
-
if (typeof window < "u")
|
|
276
|
-
return window;
|
|
277
|
-
if (typeof global < "u")
|
|
278
|
-
return global;
|
|
279
|
-
throw new Error("could not find global");
|
|
280
|
-
}
|
|
281
|
-
class te extends R {
|
|
282
|
-
constructor(e) {
|
|
283
|
-
if (super(), this._logger = e, typeof fetch > "u" || _.isNode) {
|
|
284
|
-
const t = typeof __webpack_require__ == "function" ? __non_webpack_require__ : require;
|
|
285
|
-
this._jar = new (t("tough-cookie")).CookieJar(), typeof fetch > "u" ? this._fetchType = t("node-fetch") : this._fetchType = fetch, this._fetchType = t("fetch-cookie")(this._fetchType, this._jar);
|
|
286
|
-
} else
|
|
287
|
-
this._fetchType = fetch.bind(ee());
|
|
288
|
-
if (typeof AbortController > "u") {
|
|
289
|
-
const t = typeof __webpack_require__ == "function" ? __non_webpack_require__ : require;
|
|
290
|
-
this._abortControllerType = t("abort-controller");
|
|
291
|
-
} else
|
|
292
|
-
this._abortControllerType = AbortController;
|
|
293
|
-
}
|
|
294
|
-
/** @inheritDoc */
|
|
295
|
-
async send(e) {
|
|
296
|
-
if (e.abortSignal && e.abortSignal.aborted)
|
|
297
|
-
throw new b();
|
|
298
|
-
if (!e.method)
|
|
299
|
-
throw new Error("No method defined.");
|
|
300
|
-
if (!e.url)
|
|
301
|
-
throw new Error("No url defined.");
|
|
302
|
-
const t = new this._abortControllerType();
|
|
303
|
-
let n;
|
|
304
|
-
e.abortSignal && (e.abortSignal.onabort = () => {
|
|
305
|
-
t.abort(), n = new b();
|
|
306
|
-
});
|
|
307
|
-
let o = null;
|
|
308
|
-
if (e.timeout) {
|
|
309
|
-
const l = e.timeout;
|
|
310
|
-
o = setTimeout(() => {
|
|
311
|
-
t.abort(), this._logger.log(i.Warning, "Timeout from HTTP request."), n = new D();
|
|
312
|
-
}, l);
|
|
313
|
-
}
|
|
314
|
-
e.content === "" && (e.content = void 0), e.content && (e.headers = e.headers || {}, v(e.content) ? e.headers["Content-Type"] = "application/octet-stream" : e.headers["Content-Type"] = "text/plain;charset=UTF-8");
|
|
315
|
-
let r;
|
|
316
|
-
try {
|
|
317
|
-
r = await this._fetchType(e.url, {
|
|
318
|
-
body: e.content,
|
|
319
|
-
cache: "no-cache",
|
|
320
|
-
credentials: e.withCredentials === !0 ? "include" : "same-origin",
|
|
321
|
-
headers: {
|
|
322
|
-
"X-Requested-With": "XMLHttpRequest",
|
|
323
|
-
...e.headers
|
|
324
|
-
},
|
|
325
|
-
method: e.method,
|
|
326
|
-
mode: "cors",
|
|
327
|
-
redirect: "follow",
|
|
328
|
-
signal: t.signal
|
|
329
|
-
});
|
|
330
|
-
} catch (l) {
|
|
331
|
-
throw n || (this._logger.log(i.Warning, `Error from HTTP request. ${l}.`), l);
|
|
332
|
-
} finally {
|
|
333
|
-
o && clearTimeout(o), e.abortSignal && (e.abortSignal.onabort = null);
|
|
334
|
-
}
|
|
335
|
-
if (!r.ok) {
|
|
336
|
-
const l = await N(r, "text");
|
|
337
|
-
throw new C(l || r.statusText, r.status);
|
|
338
|
-
}
|
|
339
|
-
const a = await N(r, e.responseType);
|
|
340
|
-
return new L(r.status, r.statusText, a);
|
|
341
|
-
}
|
|
342
|
-
getCookieString(e) {
|
|
343
|
-
let t = "";
|
|
344
|
-
return _.isNode && this._jar && this._jar.getCookies(e, (n, o) => t = o.join("; ")), t;
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
function N(s, e) {
|
|
348
|
-
let t;
|
|
349
|
-
switch (e) {
|
|
350
|
-
case "arraybuffer":
|
|
351
|
-
t = s.arrayBuffer();
|
|
352
|
-
break;
|
|
353
|
-
case "text":
|
|
354
|
-
t = s.text();
|
|
355
|
-
break;
|
|
356
|
-
case "blob":
|
|
357
|
-
case "document":
|
|
358
|
-
case "json":
|
|
359
|
-
throw new Error(`${e} is not supported.`);
|
|
360
|
-
default:
|
|
361
|
-
t = s.text();
|
|
362
|
-
break;
|
|
363
|
-
}
|
|
364
|
-
return t;
|
|
365
|
-
}
|
|
366
|
-
class ne extends R {
|
|
367
|
-
constructor(e) {
|
|
368
|
-
super(), this._logger = e;
|
|
369
|
-
}
|
|
370
|
-
/** @inheritDoc */
|
|
371
|
-
send(e) {
|
|
372
|
-
return e.abortSignal && e.abortSignal.aborted ? Promise.reject(new b()) : e.method ? e.url ? new Promise((t, n) => {
|
|
373
|
-
const o = new XMLHttpRequest();
|
|
374
|
-
o.open(e.method, e.url, !0), o.withCredentials = e.withCredentials === void 0 ? !0 : e.withCredentials, o.setRequestHeader("X-Requested-With", "XMLHttpRequest"), e.content === "" && (e.content = void 0), e.content && (v(e.content) ? o.setRequestHeader("Content-Type", "application/octet-stream") : o.setRequestHeader("Content-Type", "text/plain;charset=UTF-8"));
|
|
375
|
-
const r = e.headers;
|
|
376
|
-
r && Object.keys(r).forEach((c) => {
|
|
377
|
-
o.setRequestHeader(c, r[c]);
|
|
378
|
-
}), e.responseType && (o.responseType = e.responseType), e.abortSignal && (e.abortSignal.onabort = () => {
|
|
379
|
-
o.abort(), n(new b());
|
|
380
|
-
}), e.timeout && (o.timeout = e.timeout), o.onload = () => {
|
|
381
|
-
e.abortSignal && (e.abortSignal.onabort = null), o.status >= 200 && o.status < 300 ? t(new L(o.status, o.statusText, o.response || o.responseText)) : n(new C(o.response || o.responseText || o.statusText, o.status));
|
|
382
|
-
}, o.onerror = () => {
|
|
383
|
-
this._logger.log(i.Warning, `Error from HTTP request. ${o.status}: ${o.statusText}.`), n(new C(o.statusText, o.status));
|
|
384
|
-
}, o.ontimeout = () => {
|
|
385
|
-
this._logger.log(i.Warning, "Timeout from HTTP request."), n(new D());
|
|
386
|
-
}, o.send(e.content);
|
|
387
|
-
}) : Promise.reject(new Error("No url defined.")) : Promise.reject(new Error("No method defined."));
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
class oe extends R {
|
|
391
|
-
/** Creates a new instance of the {@link @microsoft/signalr.DefaultHttpClient}, using the provided {@link @microsoft/signalr.ILogger} to log messages. */
|
|
392
|
-
constructor(e) {
|
|
393
|
-
if (super(), typeof fetch < "u" || _.isNode)
|
|
394
|
-
this._httpClient = new te(e);
|
|
395
|
-
else if (typeof XMLHttpRequest < "u")
|
|
396
|
-
this._httpClient = new ne(e);
|
|
397
|
-
else
|
|
398
|
-
throw new Error("No usable HttpClient found.");
|
|
399
|
-
}
|
|
400
|
-
/** @inheritDoc */
|
|
401
|
-
send(e) {
|
|
402
|
-
return e.abortSignal && e.abortSignal.aborted ? Promise.reject(new b()) : e.method ? e.url ? this._httpClient.send(e) : Promise.reject(new Error("No url defined.")) : Promise.reject(new Error("No method defined."));
|
|
403
|
-
}
|
|
404
|
-
getCookieString(e) {
|
|
405
|
-
return this._httpClient.getCookieString(e);
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
class w {
|
|
409
|
-
static write(e) {
|
|
410
|
-
return `${e}${w.RecordSeparator}`;
|
|
411
|
-
}
|
|
412
|
-
static parse(e) {
|
|
413
|
-
if (e[e.length - 1] !== w.RecordSeparator)
|
|
414
|
-
throw new Error("Message is incomplete.");
|
|
415
|
-
const t = e.split(w.RecordSeparator);
|
|
416
|
-
return t.pop(), t;
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
w.RecordSeparatorCode = 30;
|
|
420
|
-
w.RecordSeparator = String.fromCharCode(w.RecordSeparatorCode);
|
|
421
|
-
class se {
|
|
422
|
-
// Handshake request is always JSON
|
|
423
|
-
writeHandshakeRequest(e) {
|
|
424
|
-
return w.write(JSON.stringify(e));
|
|
425
|
-
}
|
|
426
|
-
parseHandshakeResponse(e) {
|
|
427
|
-
let t, n;
|
|
428
|
-
if (v(e)) {
|
|
429
|
-
const a = new Uint8Array(e), l = a.indexOf(w.RecordSeparatorCode);
|
|
430
|
-
if (l === -1)
|
|
431
|
-
throw new Error("Message is incomplete.");
|
|
432
|
-
const u = l + 1;
|
|
433
|
-
t = String.fromCharCode.apply(null, Array.prototype.slice.call(a.slice(0, u))), n = a.byteLength > u ? a.slice(u).buffer : null;
|
|
434
|
-
} else {
|
|
435
|
-
const a = e, l = a.indexOf(w.RecordSeparator);
|
|
436
|
-
if (l === -1)
|
|
437
|
-
throw new Error("Message is incomplete.");
|
|
438
|
-
const u = l + 1;
|
|
439
|
-
t = a.substring(0, u), n = a.length > u ? a.substring(u) : null;
|
|
440
|
-
}
|
|
441
|
-
const o = w.parse(t), r = JSON.parse(o[0]);
|
|
442
|
-
if (r.type)
|
|
443
|
-
throw new Error("Expected a handshake response from the server.");
|
|
444
|
-
return [n, r];
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
var h;
|
|
448
|
-
(function(s) {
|
|
449
|
-
s[s.Invocation = 1] = "Invocation", s[s.StreamItem = 2] = "StreamItem", s[s.Completion = 3] = "Completion", s[s.StreamInvocation = 4] = "StreamInvocation", s[s.CancelInvocation = 5] = "CancelInvocation", s[s.Ping = 6] = "Ping", s[s.Close = 7] = "Close", s[s.Ack = 8] = "Ack", s[s.Sequence = 9] = "Sequence";
|
|
450
|
-
})(h || (h = {}));
|
|
451
|
-
class re {
|
|
452
|
-
constructor() {
|
|
453
|
-
this.observers = [];
|
|
454
|
-
}
|
|
455
|
-
next(e) {
|
|
456
|
-
for (const t of this.observers)
|
|
457
|
-
t.next(e);
|
|
458
|
-
}
|
|
459
|
-
error(e) {
|
|
460
|
-
for (const t of this.observers)
|
|
461
|
-
t.error && t.error(e);
|
|
462
|
-
}
|
|
463
|
-
complete() {
|
|
464
|
-
for (const e of this.observers)
|
|
465
|
-
e.complete && e.complete();
|
|
466
|
-
}
|
|
467
|
-
subscribe(e) {
|
|
468
|
-
return this.observers.push(e), new V(this, e);
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
class ie {
|
|
472
|
-
constructor(e, t, n) {
|
|
473
|
-
this._bufferSize = 1e5, this._messages = [], this._totalMessageCount = 0, this._waitForSequenceMessage = !1, this._nextReceivingSequenceId = 1, this._latestReceivedSequenceId = 0, this._bufferedByteCount = 0, this._reconnectInProgress = !1, this._protocol = e, this._connection = t, this._bufferSize = n;
|
|
474
|
-
}
|
|
475
|
-
async _send(e) {
|
|
476
|
-
const t = this._protocol.writeMessage(e);
|
|
477
|
-
let n = Promise.resolve();
|
|
478
|
-
if (this._isInvocationMessage(e)) {
|
|
479
|
-
this._totalMessageCount++;
|
|
480
|
-
let o = () => {
|
|
481
|
-
}, r = () => {
|
|
482
|
-
};
|
|
483
|
-
v(t) ? this._bufferedByteCount += t.byteLength : this._bufferedByteCount += t.length, this._bufferedByteCount >= this._bufferSize && (n = new Promise((c, a) => {
|
|
484
|
-
o = c, r = a;
|
|
485
|
-
})), this._messages.push(new ce(t, this._totalMessageCount, o, r));
|
|
486
|
-
}
|
|
487
|
-
try {
|
|
488
|
-
this._reconnectInProgress || await this._connection.send(t);
|
|
489
|
-
} catch {
|
|
490
|
-
this._disconnected();
|
|
491
|
-
}
|
|
492
|
-
await n;
|
|
493
|
-
}
|
|
494
|
-
_ack(e) {
|
|
495
|
-
let t = -1;
|
|
496
|
-
for (let n = 0; n < this._messages.length; n++) {
|
|
497
|
-
const o = this._messages[n];
|
|
498
|
-
if (o._id <= e.sequenceId)
|
|
499
|
-
t = n, v(o._message) ? this._bufferedByteCount -= o._message.byteLength : this._bufferedByteCount -= o._message.length, o._resolver();
|
|
500
|
-
else if (this._bufferedByteCount < this._bufferSize)
|
|
501
|
-
o._resolver();
|
|
502
|
-
else
|
|
503
|
-
break;
|
|
504
|
-
}
|
|
505
|
-
t !== -1 && (this._messages = this._messages.slice(t + 1));
|
|
506
|
-
}
|
|
507
|
-
_shouldProcessMessage(e) {
|
|
508
|
-
if (this._waitForSequenceMessage)
|
|
509
|
-
return e.type !== h.Sequence ? !1 : (this._waitForSequenceMessage = !1, !0);
|
|
510
|
-
if (!this._isInvocationMessage(e))
|
|
511
|
-
return !0;
|
|
512
|
-
const t = this._nextReceivingSequenceId;
|
|
513
|
-
return this._nextReceivingSequenceId++, t <= this._latestReceivedSequenceId ? (t === this._latestReceivedSequenceId && this._ackTimer(), !1) : (this._latestReceivedSequenceId = t, this._ackTimer(), !0);
|
|
514
|
-
}
|
|
515
|
-
_resetSequence(e) {
|
|
516
|
-
if (e.sequenceId > this._nextReceivingSequenceId) {
|
|
517
|
-
this._connection.stop(new Error("Sequence ID greater than amount of messages we've received."));
|
|
518
|
-
return;
|
|
519
|
-
}
|
|
520
|
-
this._nextReceivingSequenceId = e.sequenceId;
|
|
521
|
-
}
|
|
522
|
-
_disconnected() {
|
|
523
|
-
this._reconnectInProgress = !0, this._waitForSequenceMessage = !0;
|
|
524
|
-
}
|
|
525
|
-
async _resend() {
|
|
526
|
-
const e = this._messages.length !== 0 ? this._messages[0]._id : this._totalMessageCount + 1;
|
|
527
|
-
await this._connection.send(this._protocol.writeMessage({ type: h.Sequence, sequenceId: e }));
|
|
528
|
-
const t = this._messages;
|
|
529
|
-
for (const n of t)
|
|
530
|
-
await this._connection.send(n._message);
|
|
531
|
-
this._reconnectInProgress = !1;
|
|
532
|
-
}
|
|
533
|
-
_dispose(e) {
|
|
534
|
-
e ?? (e = new Error("Unable to reconnect to server."));
|
|
535
|
-
for (const t of this._messages)
|
|
536
|
-
t._rejector(e);
|
|
537
|
-
}
|
|
538
|
-
_isInvocationMessage(e) {
|
|
539
|
-
switch (e.type) {
|
|
540
|
-
case h.Invocation:
|
|
541
|
-
case h.StreamItem:
|
|
542
|
-
case h.Completion:
|
|
543
|
-
case h.StreamInvocation:
|
|
544
|
-
case h.CancelInvocation:
|
|
545
|
-
return !0;
|
|
546
|
-
case h.Close:
|
|
547
|
-
case h.Sequence:
|
|
548
|
-
case h.Ping:
|
|
549
|
-
case h.Ack:
|
|
550
|
-
return !1;
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
_ackTimer() {
|
|
554
|
-
this._ackTimerHandle === void 0 && (this._ackTimerHandle = setTimeout(async () => {
|
|
555
|
-
try {
|
|
556
|
-
this._reconnectInProgress || await this._connection.send(this._protocol.writeMessage({ type: h.Ack, sequenceId: this._latestReceivedSequenceId }));
|
|
557
|
-
} catch {
|
|
558
|
-
}
|
|
559
|
-
clearTimeout(this._ackTimerHandle), this._ackTimerHandle = void 0;
|
|
560
|
-
}, 1e3));
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
class ce {
|
|
564
|
-
constructor(e, t, n, o) {
|
|
565
|
-
this._message = e, this._id = t, this._resolver = n, this._rejector = o;
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
const ae = 30 * 1e3, le = 15 * 1e3, he = 1e5;
|
|
569
|
-
var g;
|
|
570
|
-
(function(s) {
|
|
571
|
-
s.Disconnected = "Disconnected", s.Connecting = "Connecting", s.Connected = "Connected", s.Disconnecting = "Disconnecting", s.Reconnecting = "Reconnecting";
|
|
572
|
-
})(g || (g = {}));
|
|
573
|
-
class x {
|
|
574
|
-
/** @internal */
|
|
575
|
-
// Using a public static factory method means we can have a private constructor and an _internal_
|
|
576
|
-
// create method that can be used by HubConnectionBuilder. An "internal" constructor would just
|
|
577
|
-
// be stripped away and the '.d.ts' file would have no constructor, which is interpreted as a
|
|
578
|
-
// public parameter-less constructor.
|
|
579
|
-
static create(e, t, n, o, r, c, a) {
|
|
580
|
-
return new x(e, t, n, o, r, c, a);
|
|
581
|
-
}
|
|
582
|
-
constructor(e, t, n, o, r, c, a) {
|
|
583
|
-
this._nextKeepAlive = 0, this._freezeEventListener = () => {
|
|
584
|
-
this._logger.log(i.Warning, "The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep");
|
|
585
|
-
}, f.isRequired(e, "connection"), f.isRequired(t, "logger"), f.isRequired(n, "protocol"), this.serverTimeoutInMilliseconds = r ?? ae, this.keepAliveIntervalInMilliseconds = c ?? le, this._statefulReconnectBufferSize = a ?? he, this._logger = t, this._protocol = n, this.connection = e, this._reconnectPolicy = o, this._handshakeProtocol = new se(), this.connection.onreceive = (l) => this._processIncomingData(l), this.connection.onclose = (l) => this._connectionClosed(l), this._callbacks = {}, this._methods = {}, this._closedCallbacks = [], this._reconnectingCallbacks = [], this._reconnectedCallbacks = [], this._invocationId = 0, this._receivedHandshakeResponse = !1, this._connectionState = g.Disconnected, this._connectionStarted = !1, this._cachedPingMessage = this._protocol.writeMessage({ type: h.Ping });
|
|
586
|
-
}
|
|
587
|
-
/** Indicates the state of the {@link HubConnection} to the server. */
|
|
588
|
-
get state() {
|
|
589
|
-
return this._connectionState;
|
|
590
|
-
}
|
|
591
|
-
/** Represents the connection id of the {@link HubConnection} on the server. The connection id will be null when the connection is either
|
|
592
|
-
* in the disconnected state or if the negotiation step was skipped.
|
|
593
|
-
*/
|
|
594
|
-
get connectionId() {
|
|
595
|
-
return this.connection && this.connection.connectionId || null;
|
|
596
|
-
}
|
|
597
|
-
/** Indicates the url of the {@link HubConnection} to the server. */
|
|
598
|
-
get baseUrl() {
|
|
599
|
-
return this.connection.baseUrl || "";
|
|
600
|
-
}
|
|
601
|
-
/**
|
|
602
|
-
* Sets a new url for the HubConnection. Note that the url can only be changed when the connection is in either the Disconnected or
|
|
603
|
-
* Reconnecting states.
|
|
604
|
-
* @param {string} url The url to connect to.
|
|
605
|
-
*/
|
|
606
|
-
set baseUrl(e) {
|
|
607
|
-
if (this._connectionState !== g.Disconnected && this._connectionState !== g.Reconnecting)
|
|
608
|
-
throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");
|
|
609
|
-
if (!e)
|
|
610
|
-
throw new Error("The HubConnection url must be a valid url.");
|
|
611
|
-
this.connection.baseUrl = e;
|
|
612
|
-
}
|
|
613
|
-
/** Starts the connection.
|
|
614
|
-
*
|
|
615
|
-
* @returns {Promise<void>} A Promise that resolves when the connection has been successfully established, or rejects with an error.
|
|
616
|
-
*/
|
|
617
|
-
start() {
|
|
618
|
-
return this._startPromise = this._startWithStateTransitions(), this._startPromise;
|
|
619
|
-
}
|
|
620
|
-
async _startWithStateTransitions() {
|
|
621
|
-
if (this._connectionState !== g.Disconnected)
|
|
622
|
-
return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));
|
|
623
|
-
this._connectionState = g.Connecting, this._logger.log(i.Debug, "Starting HubConnection.");
|
|
624
|
-
try {
|
|
625
|
-
await this._startInternal(), _.isBrowser && window.document.addEventListener("freeze", this._freezeEventListener), this._connectionState = g.Connected, this._connectionStarted = !0, this._logger.log(i.Debug, "HubConnection connected successfully.");
|
|
626
|
-
} catch (e) {
|
|
627
|
-
return this._connectionState = g.Disconnected, this._logger.log(i.Debug, `HubConnection failed to start successfully because of error '${e}'.`), Promise.reject(e);
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
async _startInternal() {
|
|
631
|
-
this._stopDuringStartError = void 0, this._receivedHandshakeResponse = !1;
|
|
632
|
-
const e = new Promise((t, n) => {
|
|
633
|
-
this._handshakeResolver = t, this._handshakeRejecter = n;
|
|
634
|
-
});
|
|
635
|
-
await this.connection.start(this._protocol.transferFormat);
|
|
636
|
-
try {
|
|
637
|
-
let t = this._protocol.version;
|
|
638
|
-
this.connection.features.reconnect || (t = 1);
|
|
639
|
-
const n = {
|
|
640
|
-
protocol: this._protocol.name,
|
|
641
|
-
version: t
|
|
642
|
-
};
|
|
643
|
-
if (this._logger.log(i.Debug, "Sending handshake request."), await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(n)), this._logger.log(i.Information, `Using HubProtocol '${this._protocol.name}'.`), this._cleanupTimeout(), this._resetTimeoutPeriod(), this._resetKeepAliveInterval(), await e, this._stopDuringStartError)
|
|
644
|
-
throw this._stopDuringStartError;
|
|
645
|
-
(this.connection.features.reconnect || !1) && (this._messageBuffer = new ie(this._protocol, this.connection, this._statefulReconnectBufferSize), this.connection.features.disconnected = this._messageBuffer._disconnected.bind(this._messageBuffer), this.connection.features.resend = () => {
|
|
646
|
-
if (this._messageBuffer)
|
|
647
|
-
return this._messageBuffer._resend();
|
|
648
|
-
}), this.connection.features.inherentKeepAlive || await this._sendMessage(this._cachedPingMessage);
|
|
649
|
-
} catch (t) {
|
|
650
|
-
throw this._logger.log(i.Debug, `Hub handshake failed with error '${t}' during start(). Stopping HubConnection.`), this._cleanupTimeout(), this._cleanupPingTimer(), await this.connection.stop(t), t;
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
/** Stops the connection.
|
|
654
|
-
*
|
|
655
|
-
* @returns {Promise<void>} A Promise that resolves when the connection has been successfully terminated, or rejects with an error.
|
|
656
|
-
*/
|
|
657
|
-
async stop() {
|
|
658
|
-
const e = this._startPromise;
|
|
659
|
-
this.connection.features.reconnect = !1, this._stopPromise = this._stopInternal(), await this._stopPromise;
|
|
660
|
-
try {
|
|
661
|
-
await e;
|
|
662
|
-
} catch {
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
_stopInternal(e) {
|
|
666
|
-
if (this._connectionState === g.Disconnected)
|
|
667
|
-
return this._logger.log(i.Debug, `Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`), Promise.resolve();
|
|
668
|
-
if (this._connectionState === g.Disconnecting)
|
|
669
|
-
return this._logger.log(i.Debug, `Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`), this._stopPromise;
|
|
670
|
-
const t = this._connectionState;
|
|
671
|
-
return this._connectionState = g.Disconnecting, this._logger.log(i.Debug, "Stopping HubConnection."), this._reconnectDelayHandle ? (this._logger.log(i.Debug, "Connection stopped during reconnect delay. Done reconnecting."), clearTimeout(this._reconnectDelayHandle), this._reconnectDelayHandle = void 0, this._completeClose(), Promise.resolve()) : (t === g.Connected && this._sendCloseMessage(), this._cleanupTimeout(), this._cleanupPingTimer(), this._stopDuringStartError = e || new b("The connection was stopped before the hub handshake could complete."), this.connection.stop(e));
|
|
672
|
-
}
|
|
673
|
-
async _sendCloseMessage() {
|
|
674
|
-
try {
|
|
675
|
-
await this._sendWithProtocol(this._createCloseMessage());
|
|
676
|
-
} catch {
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
/** Invokes a streaming hub method on the server using the specified name and arguments.
|
|
680
|
-
*
|
|
681
|
-
* @typeparam T The type of the items returned by the server.
|
|
682
|
-
* @param {string} methodName The name of the server method to invoke.
|
|
683
|
-
* @param {any[]} args The arguments used to invoke the server method.
|
|
684
|
-
* @returns {IStreamResult<T>} An object that yields results from the server as they are received.
|
|
685
|
-
*/
|
|
686
|
-
stream(e, ...t) {
|
|
687
|
-
const [n, o] = this._replaceStreamingParams(t), r = this._createStreamInvocation(e, t, o);
|
|
688
|
-
let c;
|
|
689
|
-
const a = new re();
|
|
690
|
-
return a.cancelCallback = () => {
|
|
691
|
-
const l = this._createCancelInvocation(r.invocationId);
|
|
692
|
-
return delete this._callbacks[r.invocationId], c.then(() => this._sendWithProtocol(l));
|
|
693
|
-
}, this._callbacks[r.invocationId] = (l, u) => {
|
|
694
|
-
if (u) {
|
|
695
|
-
a.error(u);
|
|
696
|
-
return;
|
|
697
|
-
} else l && (l.type === h.Completion ? l.error ? a.error(new Error(l.error)) : a.complete() : a.next(l.item));
|
|
698
|
-
}, c = this._sendWithProtocol(r).catch((l) => {
|
|
699
|
-
a.error(l), delete this._callbacks[r.invocationId];
|
|
700
|
-
}), this._launchStreams(n, c), a;
|
|
701
|
-
}
|
|
702
|
-
_sendMessage(e) {
|
|
703
|
-
return this._resetKeepAliveInterval(), this.connection.send(e);
|
|
704
|
-
}
|
|
705
|
-
/**
|
|
706
|
-
* Sends a js object to the server.
|
|
707
|
-
* @param message The js object to serialize and send.
|
|
708
|
-
*/
|
|
709
|
-
_sendWithProtocol(e) {
|
|
710
|
-
return this._messageBuffer ? this._messageBuffer._send(e) : this._sendMessage(this._protocol.writeMessage(e));
|
|
711
|
-
}
|
|
712
|
-
/** Invokes a hub method on the server using the specified name and arguments. Does not wait for a response from the receiver.
|
|
713
|
-
*
|
|
714
|
-
* The Promise returned by this method resolves when the client has sent the invocation to the server. The server may still
|
|
715
|
-
* be processing the invocation.
|
|
716
|
-
*
|
|
717
|
-
* @param {string} methodName The name of the server method to invoke.
|
|
718
|
-
* @param {any[]} args The arguments used to invoke the server method.
|
|
719
|
-
* @returns {Promise<void>} A Promise that resolves when the invocation has been successfully sent, or rejects with an error.
|
|
720
|
-
*/
|
|
721
|
-
send(e, ...t) {
|
|
722
|
-
const [n, o] = this._replaceStreamingParams(t), r = this._sendWithProtocol(this._createInvocation(e, t, !0, o));
|
|
723
|
-
return this._launchStreams(n, r), r;
|
|
724
|
-
}
|
|
725
|
-
/** Invokes a hub method on the server using the specified name and arguments.
|
|
726
|
-
*
|
|
727
|
-
* The Promise returned by this method resolves when the server indicates it has finished invoking the method. When the promise
|
|
728
|
-
* resolves, the server has finished invoking the method. If the server method returns a result, it is produced as the result of
|
|
729
|
-
* resolving the Promise.
|
|
730
|
-
*
|
|
731
|
-
* @typeparam T The expected return type.
|
|
732
|
-
* @param {string} methodName The name of the server method to invoke.
|
|
733
|
-
* @param {any[]} args The arguments used to invoke the server method.
|
|
734
|
-
* @returns {Promise<T>} A Promise that resolves with the result of the server method (if any), or rejects with an error.
|
|
735
|
-
*/
|
|
736
|
-
invoke(e, ...t) {
|
|
737
|
-
const [n, o] = this._replaceStreamingParams(t), r = this._createInvocation(e, t, !1, o);
|
|
738
|
-
return new Promise((a, l) => {
|
|
739
|
-
this._callbacks[r.invocationId] = (d, S) => {
|
|
740
|
-
if (S) {
|
|
741
|
-
l(S);
|
|
742
|
-
return;
|
|
743
|
-
} else d && (d.type === h.Completion ? d.error ? l(new Error(d.error)) : a(d.result) : l(new Error(`Unexpected message type: ${d.type}`)));
|
|
744
|
-
};
|
|
745
|
-
const u = this._sendWithProtocol(r).catch((d) => {
|
|
746
|
-
l(d), delete this._callbacks[r.invocationId];
|
|
747
|
-
});
|
|
748
|
-
this._launchStreams(n, u);
|
|
749
|
-
});
|
|
750
|
-
}
|
|
751
|
-
on(e, t) {
|
|
752
|
-
!e || !t || (e = e.toLowerCase(), this._methods[e] || (this._methods[e] = []), this._methods[e].indexOf(t) === -1 && this._methods[e].push(t));
|
|
753
|
-
}
|
|
754
|
-
off(e, t) {
|
|
755
|
-
if (!e)
|
|
756
|
-
return;
|
|
757
|
-
e = e.toLowerCase();
|
|
758
|
-
const n = this._methods[e];
|
|
759
|
-
if (n)
|
|
760
|
-
if (t) {
|
|
761
|
-
const o = n.indexOf(t);
|
|
762
|
-
o !== -1 && (n.splice(o, 1), n.length === 0 && delete this._methods[e]);
|
|
763
|
-
} else
|
|
764
|
-
delete this._methods[e];
|
|
765
|
-
}
|
|
766
|
-
/** Registers a handler that will be invoked when the connection is closed.
|
|
767
|
-
*
|
|
768
|
-
* @param {Function} callback The handler that will be invoked when the connection is closed. Optionally receives a single argument containing the error that caused the connection to close (if any).
|
|
769
|
-
*/
|
|
770
|
-
onclose(e) {
|
|
771
|
-
e && this._closedCallbacks.push(e);
|
|
772
|
-
}
|
|
773
|
-
/** Registers a handler that will be invoked when the connection starts reconnecting.
|
|
774
|
-
*
|
|
775
|
-
* @param {Function} callback The handler that will be invoked when the connection starts reconnecting. Optionally receives a single argument containing the error that caused the connection to start reconnecting (if any).
|
|
776
|
-
*/
|
|
777
|
-
onreconnecting(e) {
|
|
778
|
-
e && this._reconnectingCallbacks.push(e);
|
|
779
|
-
}
|
|
780
|
-
/** Registers a handler that will be invoked when the connection successfully reconnects.
|
|
781
|
-
*
|
|
782
|
-
* @param {Function} callback The handler that will be invoked when the connection successfully reconnects.
|
|
783
|
-
*/
|
|
784
|
-
onreconnected(e) {
|
|
785
|
-
e && this._reconnectedCallbacks.push(e);
|
|
786
|
-
}
|
|
787
|
-
_processIncomingData(e) {
|
|
788
|
-
if (this._cleanupTimeout(), this._receivedHandshakeResponse || (e = this._processHandshakeResponse(e), this._receivedHandshakeResponse = !0), e) {
|
|
789
|
-
const t = this._protocol.parseMessages(e, this._logger);
|
|
790
|
-
for (const n of t)
|
|
791
|
-
if (!(this._messageBuffer && !this._messageBuffer._shouldProcessMessage(n)))
|
|
792
|
-
switch (n.type) {
|
|
793
|
-
case h.Invocation:
|
|
794
|
-
this._invokeClientMethod(n).catch((o) => {
|
|
795
|
-
this._logger.log(i.Error, `Invoke client method threw error: ${$(o)}`);
|
|
796
|
-
});
|
|
797
|
-
break;
|
|
798
|
-
case h.StreamItem:
|
|
799
|
-
case h.Completion: {
|
|
800
|
-
const o = this._callbacks[n.invocationId];
|
|
801
|
-
if (o) {
|
|
802
|
-
n.type === h.Completion && delete this._callbacks[n.invocationId];
|
|
803
|
-
try {
|
|
804
|
-
o(n);
|
|
805
|
-
} catch (r) {
|
|
806
|
-
this._logger.log(i.Error, `Stream callback threw error: ${$(r)}`);
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
break;
|
|
810
|
-
}
|
|
811
|
-
case h.Ping:
|
|
812
|
-
break;
|
|
813
|
-
case h.Close: {
|
|
814
|
-
this._logger.log(i.Information, "Close message received from server.");
|
|
815
|
-
const o = n.error ? new Error("Server returned an error on close: " + n.error) : void 0;
|
|
816
|
-
n.allowReconnect === !0 ? this.connection.stop(o) : this._stopPromise = this._stopInternal(o);
|
|
817
|
-
break;
|
|
818
|
-
}
|
|
819
|
-
case h.Ack:
|
|
820
|
-
this._messageBuffer && this._messageBuffer._ack(n);
|
|
821
|
-
break;
|
|
822
|
-
case h.Sequence:
|
|
823
|
-
this._messageBuffer && this._messageBuffer._resetSequence(n);
|
|
824
|
-
break;
|
|
825
|
-
default:
|
|
826
|
-
this._logger.log(i.Warning, `Invalid message type: ${n.type}.`);
|
|
827
|
-
break;
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
this._resetTimeoutPeriod();
|
|
831
|
-
}
|
|
832
|
-
_processHandshakeResponse(e) {
|
|
833
|
-
let t, n;
|
|
834
|
-
try {
|
|
835
|
-
[n, t] = this._handshakeProtocol.parseHandshakeResponse(e);
|
|
836
|
-
} catch (o) {
|
|
837
|
-
const r = "Error parsing handshake response: " + o;
|
|
838
|
-
this._logger.log(i.Error, r);
|
|
839
|
-
const c = new Error(r);
|
|
840
|
-
throw this._handshakeRejecter(c), c;
|
|
841
|
-
}
|
|
842
|
-
if (t.error) {
|
|
843
|
-
const o = "Server returned handshake error: " + t.error;
|
|
844
|
-
this._logger.log(i.Error, o);
|
|
845
|
-
const r = new Error(o);
|
|
846
|
-
throw this._handshakeRejecter(r), r;
|
|
847
|
-
} else
|
|
848
|
-
this._logger.log(i.Debug, "Server handshake complete.");
|
|
849
|
-
return this._handshakeResolver(), n;
|
|
850
|
-
}
|
|
851
|
-
_resetKeepAliveInterval() {
|
|
852
|
-
this.connection.features.inherentKeepAlive || (this._nextKeepAlive = (/* @__PURE__ */ new Date()).getTime() + this.keepAliveIntervalInMilliseconds, this._cleanupPingTimer());
|
|
853
|
-
}
|
|
854
|
-
_resetTimeoutPeriod() {
|
|
855
|
-
if ((!this.connection.features || !this.connection.features.inherentKeepAlive) && (this._timeoutHandle = setTimeout(() => this.serverTimeout(), this.serverTimeoutInMilliseconds), this._pingServerHandle === void 0)) {
|
|
856
|
-
let e = this._nextKeepAlive - (/* @__PURE__ */ new Date()).getTime();
|
|
857
|
-
e < 0 && (e = 0), this._pingServerHandle = setTimeout(async () => {
|
|
858
|
-
if (this._connectionState === g.Connected)
|
|
859
|
-
try {
|
|
860
|
-
await this._sendMessage(this._cachedPingMessage);
|
|
861
|
-
} catch {
|
|
862
|
-
this._cleanupPingTimer();
|
|
863
|
-
}
|
|
864
|
-
}, e);
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
868
|
-
serverTimeout() {
|
|
869
|
-
this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."));
|
|
870
|
-
}
|
|
871
|
-
async _invokeClientMethod(e) {
|
|
872
|
-
const t = e.target.toLowerCase(), n = this._methods[t];
|
|
873
|
-
if (!n) {
|
|
874
|
-
this._logger.log(i.Warning, `No client method with the name '${t}' found.`), e.invocationId && (this._logger.log(i.Warning, `No result given for '${t}' method and invocation ID '${e.invocationId}'.`), await this._sendWithProtocol(this._createCompletionMessage(e.invocationId, "Client didn't provide a result.", null)));
|
|
875
|
-
return;
|
|
876
|
-
}
|
|
877
|
-
const o = n.slice(), r = !!e.invocationId;
|
|
878
|
-
let c, a, l;
|
|
879
|
-
for (const u of o)
|
|
880
|
-
try {
|
|
881
|
-
const d = c;
|
|
882
|
-
c = await u.apply(this, e.arguments), r && c && d && (this._logger.log(i.Error, `Multiple results provided for '${t}'. Sending error to server.`), l = this._createCompletionMessage(e.invocationId, "Client provided multiple results.", null)), a = void 0;
|
|
883
|
-
} catch (d) {
|
|
884
|
-
a = d, this._logger.log(i.Error, `A callback for the method '${t}' threw error '${d}'.`);
|
|
885
|
-
}
|
|
886
|
-
l ? await this._sendWithProtocol(l) : r ? (a ? l = this._createCompletionMessage(e.invocationId, `${a}`, null) : c !== void 0 ? l = this._createCompletionMessage(e.invocationId, null, c) : (this._logger.log(i.Warning, `No result given for '${t}' method and invocation ID '${e.invocationId}'.`), l = this._createCompletionMessage(e.invocationId, "Client didn't provide a result.", null)), await this._sendWithProtocol(l)) : c && this._logger.log(i.Error, `Result given for '${t}' method but server is not expecting a result.`);
|
|
887
|
-
}
|
|
888
|
-
_connectionClosed(e) {
|
|
889
|
-
this._logger.log(i.Debug, `HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`), this._stopDuringStartError = this._stopDuringStartError || e || new b("The underlying connection was closed before the hub handshake could complete."), this._handshakeResolver && this._handshakeResolver(), this._cancelCallbacksWithError(e || new Error("Invocation canceled due to the underlying connection being closed.")), this._cleanupTimeout(), this._cleanupPingTimer(), this._connectionState === g.Disconnecting ? this._completeClose(e) : this._connectionState === g.Connected && this._reconnectPolicy ? this._reconnect(e) : this._connectionState === g.Connected && this._completeClose(e);
|
|
890
|
-
}
|
|
891
|
-
_completeClose(e) {
|
|
892
|
-
if (this._connectionStarted) {
|
|
893
|
-
this._connectionState = g.Disconnected, this._connectionStarted = !1, this._messageBuffer && (this._messageBuffer._dispose(e ?? new Error("Connection closed.")), this._messageBuffer = void 0), _.isBrowser && window.document.removeEventListener("freeze", this._freezeEventListener);
|
|
894
|
-
try {
|
|
895
|
-
this._closedCallbacks.forEach((t) => t.apply(this, [e]));
|
|
896
|
-
} catch (t) {
|
|
897
|
-
this._logger.log(i.Error, `An onclose callback called with error '${e}' threw error '${t}'.`);
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
async _reconnect(e) {
|
|
902
|
-
const t = Date.now();
|
|
903
|
-
let n = 0, o = e !== void 0 ? e : new Error("Attempting to reconnect due to a unknown error."), r = this._getNextRetryDelay(n++, 0, o);
|
|
904
|
-
if (r === null) {
|
|
905
|
-
this._logger.log(i.Debug, "Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."), this._completeClose(e);
|
|
906
|
-
return;
|
|
907
|
-
}
|
|
908
|
-
if (this._connectionState = g.Reconnecting, e ? this._logger.log(i.Information, `Connection reconnecting because of error '${e}'.`) : this._logger.log(i.Information, "Connection reconnecting."), this._reconnectingCallbacks.length !== 0) {
|
|
909
|
-
try {
|
|
910
|
-
this._reconnectingCallbacks.forEach((c) => c.apply(this, [e]));
|
|
911
|
-
} catch (c) {
|
|
912
|
-
this._logger.log(i.Error, `An onreconnecting callback called with error '${e}' threw error '${c}'.`);
|
|
913
|
-
}
|
|
914
|
-
if (this._connectionState !== g.Reconnecting) {
|
|
915
|
-
this._logger.log(i.Debug, "Connection left the reconnecting state in onreconnecting callback. Done reconnecting.");
|
|
916
|
-
return;
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
for (; r !== null; ) {
|
|
920
|
-
if (this._logger.log(i.Information, `Reconnect attempt number ${n} will start in ${r} ms.`), await new Promise((c) => {
|
|
921
|
-
this._reconnectDelayHandle = setTimeout(c, r);
|
|
922
|
-
}), this._reconnectDelayHandle = void 0, this._connectionState !== g.Reconnecting) {
|
|
923
|
-
this._logger.log(i.Debug, "Connection left the reconnecting state during reconnect delay. Done reconnecting.");
|
|
924
|
-
return;
|
|
925
|
-
}
|
|
926
|
-
try {
|
|
927
|
-
if (await this._startInternal(), this._connectionState = g.Connected, this._logger.log(i.Information, "HubConnection reconnected successfully."), this._reconnectedCallbacks.length !== 0)
|
|
928
|
-
try {
|
|
929
|
-
this._reconnectedCallbacks.forEach((c) => c.apply(this, [this.connection.connectionId]));
|
|
930
|
-
} catch (c) {
|
|
931
|
-
this._logger.log(i.Error, `An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${c}'.`);
|
|
932
|
-
}
|
|
933
|
-
return;
|
|
934
|
-
} catch (c) {
|
|
935
|
-
if (this._logger.log(i.Information, `Reconnect attempt failed because of error '${c}'.`), this._connectionState !== g.Reconnecting) {
|
|
936
|
-
this._logger.log(i.Debug, `Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`), this._connectionState === g.Disconnecting && this._completeClose();
|
|
937
|
-
return;
|
|
938
|
-
}
|
|
939
|
-
o = c instanceof Error ? c : new Error(c.toString()), r = this._getNextRetryDelay(n++, Date.now() - t, o);
|
|
940
|
-
}
|
|
941
|
-
}
|
|
942
|
-
this._logger.log(i.Information, `Reconnect retries have been exhausted after ${Date.now() - t} ms and ${n} failed attempts. Connection disconnecting.`), this._completeClose();
|
|
943
|
-
}
|
|
944
|
-
_getNextRetryDelay(e, t, n) {
|
|
945
|
-
try {
|
|
946
|
-
return this._reconnectPolicy.nextRetryDelayInMilliseconds({
|
|
947
|
-
elapsedMilliseconds: t,
|
|
948
|
-
previousRetryCount: e,
|
|
949
|
-
retryReason: n
|
|
950
|
-
});
|
|
951
|
-
} catch (o) {
|
|
952
|
-
return this._logger.log(i.Error, `IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${t}) threw error '${o}'.`), null;
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
_cancelCallbacksWithError(e) {
|
|
956
|
-
const t = this._callbacks;
|
|
957
|
-
this._callbacks = {}, Object.keys(t).forEach((n) => {
|
|
958
|
-
const o = t[n];
|
|
959
|
-
try {
|
|
960
|
-
o(null, e);
|
|
961
|
-
} catch (r) {
|
|
962
|
-
this._logger.log(i.Error, `Stream 'error' callback called with '${e}' threw error: ${$(r)}`);
|
|
963
|
-
}
|
|
964
|
-
});
|
|
965
|
-
}
|
|
966
|
-
_cleanupPingTimer() {
|
|
967
|
-
this._pingServerHandle && (clearTimeout(this._pingServerHandle), this._pingServerHandle = void 0);
|
|
968
|
-
}
|
|
969
|
-
_cleanupTimeout() {
|
|
970
|
-
this._timeoutHandle && clearTimeout(this._timeoutHandle);
|
|
971
|
-
}
|
|
972
|
-
_createInvocation(e, t, n, o) {
|
|
973
|
-
if (n)
|
|
974
|
-
return o.length !== 0 ? {
|
|
975
|
-
arguments: t,
|
|
976
|
-
streamIds: o,
|
|
977
|
-
target: e,
|
|
978
|
-
type: h.Invocation
|
|
979
|
-
} : {
|
|
980
|
-
arguments: t,
|
|
981
|
-
target: e,
|
|
982
|
-
type: h.Invocation
|
|
983
|
-
};
|
|
984
|
-
{
|
|
985
|
-
const r = this._invocationId;
|
|
986
|
-
return this._invocationId++, o.length !== 0 ? {
|
|
987
|
-
arguments: t,
|
|
988
|
-
invocationId: r.toString(),
|
|
989
|
-
streamIds: o,
|
|
990
|
-
target: e,
|
|
991
|
-
type: h.Invocation
|
|
992
|
-
} : {
|
|
993
|
-
arguments: t,
|
|
994
|
-
invocationId: r.toString(),
|
|
995
|
-
target: e,
|
|
996
|
-
type: h.Invocation
|
|
997
|
-
};
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1000
|
-
_launchStreams(e, t) {
|
|
1001
|
-
if (e.length !== 0) {
|
|
1002
|
-
t || (t = Promise.resolve());
|
|
1003
|
-
for (const n in e)
|
|
1004
|
-
e[n].subscribe({
|
|
1005
|
-
complete: () => {
|
|
1006
|
-
t = t.then(() => this._sendWithProtocol(this._createCompletionMessage(n)));
|
|
1007
|
-
},
|
|
1008
|
-
error: (o) => {
|
|
1009
|
-
let r;
|
|
1010
|
-
o instanceof Error ? r = o.message : o && o.toString ? r = o.toString() : r = "Unknown error", t = t.then(() => this._sendWithProtocol(this._createCompletionMessage(n, r)));
|
|
1011
|
-
},
|
|
1012
|
-
next: (o) => {
|
|
1013
|
-
t = t.then(() => this._sendWithProtocol(this._createStreamItemMessage(n, o)));
|
|
1014
|
-
}
|
|
1015
|
-
});
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
_replaceStreamingParams(e) {
|
|
1019
|
-
const t = [], n = [];
|
|
1020
|
-
for (let o = 0; o < e.length; o++) {
|
|
1021
|
-
const r = e[o];
|
|
1022
|
-
if (this._isObservable(r)) {
|
|
1023
|
-
const c = this._invocationId;
|
|
1024
|
-
this._invocationId++, t[c] = r, n.push(c.toString()), e.splice(o, 1);
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
return [t, n];
|
|
1028
|
-
}
|
|
1029
|
-
_isObservable(e) {
|
|
1030
|
-
return e && e.subscribe && typeof e.subscribe == "function";
|
|
1031
|
-
}
|
|
1032
|
-
_createStreamInvocation(e, t, n) {
|
|
1033
|
-
const o = this._invocationId;
|
|
1034
|
-
return this._invocationId++, n.length !== 0 ? {
|
|
1035
|
-
arguments: t,
|
|
1036
|
-
invocationId: o.toString(),
|
|
1037
|
-
streamIds: n,
|
|
1038
|
-
target: e,
|
|
1039
|
-
type: h.StreamInvocation
|
|
1040
|
-
} : {
|
|
1041
|
-
arguments: t,
|
|
1042
|
-
invocationId: o.toString(),
|
|
1043
|
-
target: e,
|
|
1044
|
-
type: h.StreamInvocation
|
|
1045
|
-
};
|
|
1046
|
-
}
|
|
1047
|
-
_createCancelInvocation(e) {
|
|
1048
|
-
return {
|
|
1049
|
-
invocationId: e,
|
|
1050
|
-
type: h.CancelInvocation
|
|
1051
|
-
};
|
|
1052
|
-
}
|
|
1053
|
-
_createStreamItemMessage(e, t) {
|
|
1054
|
-
return {
|
|
1055
|
-
invocationId: e,
|
|
1056
|
-
item: t,
|
|
1057
|
-
type: h.StreamItem
|
|
1058
|
-
};
|
|
1059
|
-
}
|
|
1060
|
-
_createCompletionMessage(e, t, n) {
|
|
1061
|
-
return t ? {
|
|
1062
|
-
error: t,
|
|
1063
|
-
invocationId: e,
|
|
1064
|
-
type: h.Completion
|
|
1065
|
-
} : {
|
|
1066
|
-
invocationId: e,
|
|
1067
|
-
result: n,
|
|
1068
|
-
type: h.Completion
|
|
1069
|
-
};
|
|
1070
|
-
}
|
|
1071
|
-
_createCloseMessage() {
|
|
1072
|
-
return { type: h.Close };
|
|
1073
|
-
}
|
|
1074
|
-
}
|
|
1075
|
-
const ue = [0, 2e3, 1e4, 3e4, null];
|
|
1076
|
-
class W {
|
|
1077
|
-
constructor(e) {
|
|
1078
|
-
this._retryDelays = e !== void 0 ? [...e, null] : ue;
|
|
1079
|
-
}
|
|
1080
|
-
nextRetryDelayInMilliseconds(e) {
|
|
1081
|
-
return this._retryDelays[e.previousRetryCount];
|
|
1082
|
-
}
|
|
1083
|
-
}
|
|
1084
|
-
class y {
|
|
1085
|
-
}
|
|
1086
|
-
y.Authorization = "Authorization";
|
|
1087
|
-
y.Cookie = "Cookie";
|
|
1088
|
-
class de extends R {
|
|
1089
|
-
constructor(e, t) {
|
|
1090
|
-
super(), this._innerClient = e, this._accessTokenFactory = t;
|
|
1091
|
-
}
|
|
1092
|
-
async send(e) {
|
|
1093
|
-
let t = !0;
|
|
1094
|
-
this._accessTokenFactory && (!this._accessToken || e.url && e.url.indexOf("/negotiate?") > 0) && (t = !1, this._accessToken = await this._accessTokenFactory()), this._setAuthorizationHeader(e);
|
|
1095
|
-
const n = await this._innerClient.send(e);
|
|
1096
|
-
return t && n.statusCode === 401 && this._accessTokenFactory ? (this._accessToken = await this._accessTokenFactory(), this._setAuthorizationHeader(e), await this._innerClient.send(e)) : n;
|
|
1097
|
-
}
|
|
1098
|
-
_setAuthorizationHeader(e) {
|
|
1099
|
-
e.headers || (e.headers = {}), this._accessToken ? e.headers[y.Authorization] = `Bearer ${this._accessToken}` : this._accessTokenFactory && e.headers[y.Authorization] && delete e.headers[y.Authorization];
|
|
1100
|
-
}
|
|
1101
|
-
getCookieString(e) {
|
|
1102
|
-
return this._innerClient.getCookieString(e);
|
|
1103
|
-
}
|
|
1104
|
-
}
|
|
1105
|
-
var p;
|
|
1106
|
-
(function(s) {
|
|
1107
|
-
s[s.None = 0] = "None", s[s.WebSockets = 1] = "WebSockets", s[s.ServerSentEvents = 2] = "ServerSentEvents", s[s.LongPolling = 4] = "LongPolling";
|
|
1108
|
-
})(p || (p = {}));
|
|
1109
|
-
var m;
|
|
1110
|
-
(function(s) {
|
|
1111
|
-
s[s.Text = 1] = "Text", s[s.Binary = 2] = "Binary";
|
|
1112
|
-
})(m || (m = {}));
|
|
1113
|
-
let ge = class {
|
|
1114
|
-
constructor() {
|
|
1115
|
-
this._isAborted = !1, this.onabort = null;
|
|
1116
|
-
}
|
|
1117
|
-
abort() {
|
|
1118
|
-
this._isAborted || (this._isAborted = !0, this.onabort && this.onabort());
|
|
1119
|
-
}
|
|
1120
|
-
get signal() {
|
|
1121
|
-
return this;
|
|
1122
|
-
}
|
|
1123
|
-
get aborted() {
|
|
1124
|
-
return this._isAborted;
|
|
1125
|
-
}
|
|
1126
|
-
};
|
|
1127
|
-
class B {
|
|
1128
|
-
// This is an internal type, not exported from 'index' so this is really just internal.
|
|
1129
|
-
get pollAborted() {
|
|
1130
|
-
return this._pollAbort.aborted;
|
|
1131
|
-
}
|
|
1132
|
-
constructor(e, t, n) {
|
|
1133
|
-
this._httpClient = e, this._logger = t, this._pollAbort = new ge(), this._options = n, this._running = !1, this.onreceive = null, this.onclose = null;
|
|
1134
|
-
}
|
|
1135
|
-
async connect(e, t) {
|
|
1136
|
-
if (f.isRequired(e, "url"), f.isRequired(t, "transferFormat"), f.isIn(t, m, "transferFormat"), this._url = e, this._logger.log(i.Trace, "(LongPolling transport) Connecting."), t === m.Binary && typeof XMLHttpRequest < "u" && typeof new XMLHttpRequest().responseType != "string")
|
|
1137
|
-
throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");
|
|
1138
|
-
const [n, o] = k(), r = { [n]: o, ...this._options.headers }, c = {
|
|
1139
|
-
abortSignal: this._pollAbort.signal,
|
|
1140
|
-
headers: r,
|
|
1141
|
-
timeout: 1e5,
|
|
1142
|
-
withCredentials: this._options.withCredentials
|
|
1143
|
-
};
|
|
1144
|
-
t === m.Binary && (c.responseType = "arraybuffer");
|
|
1145
|
-
const a = `${e}&_=${Date.now()}`;
|
|
1146
|
-
this._logger.log(i.Trace, `(LongPolling transport) polling: ${a}.`);
|
|
1147
|
-
const l = await this._httpClient.get(a, c);
|
|
1148
|
-
l.statusCode !== 200 ? (this._logger.log(i.Error, `(LongPolling transport) Unexpected response code: ${l.statusCode}.`), this._closeError = new C(l.statusText || "", l.statusCode), this._running = !1) : this._running = !0, this._receiving = this._poll(this._url, c);
|
|
1149
|
-
}
|
|
1150
|
-
async _poll(e, t) {
|
|
1151
|
-
try {
|
|
1152
|
-
for (; this._running; )
|
|
1153
|
-
try {
|
|
1154
|
-
const n = `${e}&_=${Date.now()}`;
|
|
1155
|
-
this._logger.log(i.Trace, `(LongPolling transport) polling: ${n}.`);
|
|
1156
|
-
const o = await this._httpClient.get(n, t);
|
|
1157
|
-
o.statusCode === 204 ? (this._logger.log(i.Information, "(LongPolling transport) Poll terminated by server."), this._running = !1) : o.statusCode !== 200 ? (this._logger.log(i.Error, `(LongPolling transport) Unexpected response code: ${o.statusCode}.`), this._closeError = new C(o.statusText || "", o.statusCode), this._running = !1) : o.content ? (this._logger.log(i.Trace, `(LongPolling transport) data received. ${I(o.content, this._options.logMessageContent)}.`), this.onreceive && this.onreceive(o.content)) : this._logger.log(i.Trace, "(LongPolling transport) Poll timed out, reissuing.");
|
|
1158
|
-
} catch (n) {
|
|
1159
|
-
this._running ? n instanceof D ? this._logger.log(i.Trace, "(LongPolling transport) Poll timed out, reissuing.") : (this._closeError = n, this._running = !1) : this._logger.log(i.Trace, `(LongPolling transport) Poll errored after shutdown: ${n.message}`);
|
|
1160
|
-
}
|
|
1161
|
-
} finally {
|
|
1162
|
-
this._logger.log(i.Trace, "(LongPolling transport) Polling complete."), this.pollAborted || this._raiseOnClose();
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
async send(e) {
|
|
1166
|
-
return this._running ? j(this._logger, "LongPolling", this._httpClient, this._url, e, this._options) : Promise.reject(new Error("Cannot send until the transport is connected"));
|
|
1167
|
-
}
|
|
1168
|
-
async stop() {
|
|
1169
|
-
this._logger.log(i.Trace, "(LongPolling transport) Stopping polling."), this._running = !1, this._pollAbort.abort();
|
|
1170
|
-
try {
|
|
1171
|
-
await this._receiving, this._logger.log(i.Trace, `(LongPolling transport) sending DELETE request to ${this._url}.`);
|
|
1172
|
-
const e = {}, [t, n] = k();
|
|
1173
|
-
e[t] = n;
|
|
1174
|
-
const o = {
|
|
1175
|
-
headers: { ...e, ...this._options.headers },
|
|
1176
|
-
timeout: this._options.timeout,
|
|
1177
|
-
withCredentials: this._options.withCredentials
|
|
1178
|
-
};
|
|
1179
|
-
let r;
|
|
1180
|
-
try {
|
|
1181
|
-
await this._httpClient.delete(this._url, o);
|
|
1182
|
-
} catch (c) {
|
|
1183
|
-
r = c;
|
|
1184
|
-
}
|
|
1185
|
-
r ? r instanceof C && (r.statusCode === 404 ? this._logger.log(i.Trace, "(LongPolling transport) A 404 response was returned from sending a DELETE request.") : this._logger.log(i.Trace, `(LongPolling transport) Error sending a DELETE request: ${r}`)) : this._logger.log(i.Trace, "(LongPolling transport) DELETE request accepted.");
|
|
1186
|
-
} finally {
|
|
1187
|
-
this._logger.log(i.Trace, "(LongPolling transport) Stop finished."), this._raiseOnClose();
|
|
1188
|
-
}
|
|
1189
|
-
}
|
|
1190
|
-
_raiseOnClose() {
|
|
1191
|
-
if (this.onclose) {
|
|
1192
|
-
let e = "(LongPolling transport) Firing onclose event.";
|
|
1193
|
-
this._closeError && (e += " Error: " + this._closeError), this._logger.log(i.Trace, e), this.onclose(this._closeError);
|
|
1194
|
-
}
|
|
1195
|
-
}
|
|
1196
|
-
}
|
|
1197
|
-
class _e {
|
|
1198
|
-
constructor(e, t, n, o) {
|
|
1199
|
-
this._httpClient = e, this._accessToken = t, this._logger = n, this._options = o, this.onreceive = null, this.onclose = null;
|
|
1200
|
-
}
|
|
1201
|
-
async connect(e, t) {
|
|
1202
|
-
return f.isRequired(e, "url"), f.isRequired(t, "transferFormat"), f.isIn(t, m, "transferFormat"), this._logger.log(i.Trace, "(SSE transport) Connecting."), this._url = e, this._accessToken && (e += (e.indexOf("?") < 0 ? "?" : "&") + `access_token=${encodeURIComponent(this._accessToken)}`), new Promise((n, o) => {
|
|
1203
|
-
let r = !1;
|
|
1204
|
-
if (t !== m.Text) {
|
|
1205
|
-
o(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"));
|
|
1206
|
-
return;
|
|
1207
|
-
}
|
|
1208
|
-
let c;
|
|
1209
|
-
if (_.isBrowser || _.isWebWorker)
|
|
1210
|
-
c = new this._options.EventSource(e, { withCredentials: this._options.withCredentials });
|
|
1211
|
-
else {
|
|
1212
|
-
const a = this._httpClient.getCookieString(e), l = {};
|
|
1213
|
-
l.Cookie = a;
|
|
1214
|
-
const [u, d] = k();
|
|
1215
|
-
l[u] = d, c = new this._options.EventSource(e, { withCredentials: this._options.withCredentials, headers: { ...l, ...this._options.headers } });
|
|
1216
|
-
}
|
|
1217
|
-
try {
|
|
1218
|
-
c.onmessage = (a) => {
|
|
1219
|
-
if (this.onreceive)
|
|
1220
|
-
try {
|
|
1221
|
-
this._logger.log(i.Trace, `(SSE transport) data received. ${I(a.data, this._options.logMessageContent)}.`), this.onreceive(a.data);
|
|
1222
|
-
} catch (l) {
|
|
1223
|
-
this._close(l);
|
|
1224
|
-
return;
|
|
1225
|
-
}
|
|
1226
|
-
}, c.onerror = (a) => {
|
|
1227
|
-
r ? this._close() : o(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."));
|
|
1228
|
-
}, c.onopen = () => {
|
|
1229
|
-
this._logger.log(i.Information, `SSE connected to ${this._url}`), this._eventSource = c, r = !0, n();
|
|
1230
|
-
};
|
|
1231
|
-
} catch (a) {
|
|
1232
|
-
o(a);
|
|
1233
|
-
return;
|
|
1234
|
-
}
|
|
1235
|
-
});
|
|
1236
|
-
}
|
|
1237
|
-
async send(e) {
|
|
1238
|
-
return this._eventSource ? j(this._logger, "SSE", this._httpClient, this._url, e, this._options) : Promise.reject(new Error("Cannot send until the transport is connected"));
|
|
1239
|
-
}
|
|
1240
|
-
stop() {
|
|
1241
|
-
return this._close(), Promise.resolve();
|
|
1242
|
-
}
|
|
1243
|
-
_close(e) {
|
|
1244
|
-
this._eventSource && (this._eventSource.close(), this._eventSource = void 0, this.onclose && this.onclose(e));
|
|
1245
|
-
}
|
|
1246
|
-
}
|
|
1247
|
-
class fe {
|
|
1248
|
-
constructor(e, t, n, o, r, c) {
|
|
1249
|
-
this._logger = n, this._accessTokenFactory = t, this._logMessageContent = o, this._webSocketConstructor = r, this._httpClient = e, this.onreceive = null, this.onclose = null, this._headers = c;
|
|
1250
|
-
}
|
|
1251
|
-
async connect(e, t) {
|
|
1252
|
-
f.isRequired(e, "url"), f.isRequired(t, "transferFormat"), f.isIn(t, m, "transferFormat"), this._logger.log(i.Trace, "(WebSockets transport) Connecting.");
|
|
1253
|
-
let n;
|
|
1254
|
-
return this._accessTokenFactory && (n = await this._accessTokenFactory()), new Promise((o, r) => {
|
|
1255
|
-
e = e.replace(/^http/, "ws");
|
|
1256
|
-
let c;
|
|
1257
|
-
const a = this._httpClient.getCookieString(e);
|
|
1258
|
-
let l = !1;
|
|
1259
|
-
if (_.isNode || _.isReactNative) {
|
|
1260
|
-
const u = {}, [d, S] = k();
|
|
1261
|
-
u[d] = S, n && (u[y.Authorization] = `Bearer ${n}`), a && (u[y.Cookie] = a), c = new this._webSocketConstructor(e, void 0, {
|
|
1262
|
-
headers: { ...u, ...this._headers }
|
|
1263
|
-
});
|
|
1264
|
-
} else
|
|
1265
|
-
n && (e += (e.indexOf("?") < 0 ? "?" : "&") + `access_token=${encodeURIComponent(n)}`);
|
|
1266
|
-
c || (c = new this._webSocketConstructor(e)), t === m.Binary && (c.binaryType = "arraybuffer"), c.onopen = (u) => {
|
|
1267
|
-
this._logger.log(i.Information, `WebSocket connected to ${e}.`), this._webSocket = c, l = !0, o();
|
|
1268
|
-
}, c.onerror = (u) => {
|
|
1269
|
-
let d = null;
|
|
1270
|
-
typeof ErrorEvent < "u" && u instanceof ErrorEvent ? d = u.error : d = "There was an error with the transport", this._logger.log(i.Information, `(WebSockets transport) ${d}.`);
|
|
1271
|
-
}, c.onmessage = (u) => {
|
|
1272
|
-
if (this._logger.log(i.Trace, `(WebSockets transport) data received. ${I(u.data, this._logMessageContent)}.`), this.onreceive)
|
|
1273
|
-
try {
|
|
1274
|
-
this.onreceive(u.data);
|
|
1275
|
-
} catch (d) {
|
|
1276
|
-
this._close(d);
|
|
1277
|
-
return;
|
|
1278
|
-
}
|
|
1279
|
-
}, c.onclose = (u) => {
|
|
1280
|
-
if (l)
|
|
1281
|
-
this._close(u);
|
|
1282
|
-
else {
|
|
1283
|
-
let d = null;
|
|
1284
|
-
typeof ErrorEvent < "u" && u instanceof ErrorEvent ? d = u.error : d = "WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.", r(new Error(d));
|
|
1285
|
-
}
|
|
1286
|
-
};
|
|
1287
|
-
});
|
|
1288
|
-
}
|
|
1289
|
-
send(e) {
|
|
1290
|
-
return this._webSocket && this._webSocket.readyState === this._webSocketConstructor.OPEN ? (this._logger.log(i.Trace, `(WebSockets transport) sending data. ${I(e, this._logMessageContent)}.`), this._webSocket.send(e), Promise.resolve()) : Promise.reject("WebSocket is not in the OPEN state");
|
|
1291
|
-
}
|
|
1292
|
-
stop() {
|
|
1293
|
-
return this._webSocket && this._close(void 0), Promise.resolve();
|
|
1294
|
-
}
|
|
1295
|
-
_close(e) {
|
|
1296
|
-
this._webSocket && (this._webSocket.onclose = () => {
|
|
1297
|
-
}, this._webSocket.onmessage = () => {
|
|
1298
|
-
}, this._webSocket.onerror = () => {
|
|
1299
|
-
}, this._webSocket.close(), this._webSocket = void 0), this._logger.log(i.Trace, "(WebSockets transport) socket closed."), this.onclose && (this._isCloseEvent(e) && (e.wasClean === !1 || e.code !== 1e3) ? this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason || "no reason given"}).`)) : e instanceof Error ? this.onclose(e) : this.onclose());
|
|
1300
|
-
}
|
|
1301
|
-
_isCloseEvent(e) {
|
|
1302
|
-
return e && typeof e.wasClean == "boolean" && typeof e.code == "number";
|
|
1303
|
-
}
|
|
1304
|
-
}
|
|
1305
|
-
const U = 100;
|
|
1306
|
-
class pe {
|
|
1307
|
-
constructor(e, t = {}) {
|
|
1308
|
-
if (this._stopPromiseResolver = () => {
|
|
1309
|
-
}, this.features = {}, this._negotiateVersion = 1, f.isRequired(e, "url"), this._logger = J(t.logger), this.baseUrl = this._resolveUrl(e), t = t || {}, t.logMessageContent = t.logMessageContent === void 0 ? !1 : t.logMessageContent, typeof t.withCredentials == "boolean" || t.withCredentials === void 0)
|
|
1310
|
-
t.withCredentials = t.withCredentials === void 0 ? !0 : t.withCredentials;
|
|
1311
|
-
else
|
|
1312
|
-
throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");
|
|
1313
|
-
t.timeout = t.timeout === void 0 ? 100 * 1e3 : t.timeout;
|
|
1314
|
-
let n = null, o = null;
|
|
1315
|
-
if (_.isNode && typeof require < "u") {
|
|
1316
|
-
const r = typeof __webpack_require__ == "function" ? __non_webpack_require__ : require;
|
|
1317
|
-
n = r("ws"), o = r("eventsource");
|
|
1318
|
-
}
|
|
1319
|
-
!_.isNode && typeof WebSocket < "u" && !t.WebSocket ? t.WebSocket = WebSocket : _.isNode && !t.WebSocket && n && (t.WebSocket = n), !_.isNode && typeof EventSource < "u" && !t.EventSource ? t.EventSource = EventSource : _.isNode && !t.EventSource && typeof o < "u" && (t.EventSource = o), this._httpClient = new de(t.httpClient || new oe(this._logger), t.accessTokenFactory), this._connectionState = "Disconnected", this._connectionStarted = !1, this._options = t, this.onreceive = null, this.onclose = null;
|
|
1320
|
-
}
|
|
1321
|
-
async start(e) {
|
|
1322
|
-
if (e = e || m.Binary, f.isIn(e, m, "transferFormat"), this._logger.log(i.Debug, `Starting connection with transfer format '${m[e]}'.`), this._connectionState !== "Disconnected")
|
|
1323
|
-
return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));
|
|
1324
|
-
if (this._connectionState = "Connecting", this._startInternalPromise = this._startInternal(e), await this._startInternalPromise, this._connectionState === "Disconnecting") {
|
|
1325
|
-
const t = "Failed to start the HttpConnection before stop() was called.";
|
|
1326
|
-
return this._logger.log(i.Error, t), await this._stopPromise, Promise.reject(new b(t));
|
|
1327
|
-
} else if (this._connectionState !== "Connected") {
|
|
1328
|
-
const t = "HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";
|
|
1329
|
-
return this._logger.log(i.Error, t), Promise.reject(new b(t));
|
|
1330
|
-
}
|
|
1331
|
-
this._connectionStarted = !0;
|
|
1332
|
-
}
|
|
1333
|
-
send(e) {
|
|
1334
|
-
return this._connectionState !== "Connected" ? Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")) : (this._sendQueue || (this._sendQueue = new A(this.transport)), this._sendQueue.send(e));
|
|
1335
|
-
}
|
|
1336
|
-
async stop(e) {
|
|
1337
|
-
if (this._connectionState === "Disconnected")
|
|
1338
|
-
return this._logger.log(i.Debug, `Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`), Promise.resolve();
|
|
1339
|
-
if (this._connectionState === "Disconnecting")
|
|
1340
|
-
return this._logger.log(i.Debug, `Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`), this._stopPromise;
|
|
1341
|
-
this._connectionState = "Disconnecting", this._stopPromise = new Promise((t) => {
|
|
1342
|
-
this._stopPromiseResolver = t;
|
|
1343
|
-
}), await this._stopInternal(e), await this._stopPromise;
|
|
1344
|
-
}
|
|
1345
|
-
async _stopInternal(e) {
|
|
1346
|
-
this._stopError = e;
|
|
1347
|
-
try {
|
|
1348
|
-
await this._startInternalPromise;
|
|
1349
|
-
} catch {
|
|
1350
|
-
}
|
|
1351
|
-
if (this.transport) {
|
|
1352
|
-
try {
|
|
1353
|
-
await this.transport.stop();
|
|
1354
|
-
} catch (t) {
|
|
1355
|
-
this._logger.log(i.Error, `HttpConnection.transport.stop() threw error '${t}'.`), this._stopConnection();
|
|
1356
|
-
}
|
|
1357
|
-
this.transport = void 0;
|
|
1358
|
-
} else
|
|
1359
|
-
this._logger.log(i.Debug, "HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.");
|
|
1360
|
-
}
|
|
1361
|
-
async _startInternal(e) {
|
|
1362
|
-
let t = this.baseUrl;
|
|
1363
|
-
this._accessTokenFactory = this._options.accessTokenFactory, this._httpClient._accessTokenFactory = this._accessTokenFactory;
|
|
1364
|
-
try {
|
|
1365
|
-
if (this._options.skipNegotiation)
|
|
1366
|
-
if (this._options.transport === p.WebSockets)
|
|
1367
|
-
this.transport = this._constructTransport(p.WebSockets), await this._startTransport(t, e);
|
|
1368
|
-
else
|
|
1369
|
-
throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");
|
|
1370
|
-
else {
|
|
1371
|
-
let n = null, o = 0;
|
|
1372
|
-
do {
|
|
1373
|
-
if (n = await this._getNegotiationResponse(t), this._connectionState === "Disconnecting" || this._connectionState === "Disconnected")
|
|
1374
|
-
throw new b("The connection was stopped during negotiation.");
|
|
1375
|
-
if (n.error)
|
|
1376
|
-
throw new Error(n.error);
|
|
1377
|
-
if (n.ProtocolVersion)
|
|
1378
|
-
throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");
|
|
1379
|
-
if (n.url && (t = n.url), n.accessToken) {
|
|
1380
|
-
const r = n.accessToken;
|
|
1381
|
-
this._accessTokenFactory = () => r, this._httpClient._accessToken = r, this._httpClient._accessTokenFactory = void 0;
|
|
1382
|
-
}
|
|
1383
|
-
o++;
|
|
1384
|
-
} while (n.url && o < U);
|
|
1385
|
-
if (o === U && n.url)
|
|
1386
|
-
throw new Error("Negotiate redirection limit exceeded.");
|
|
1387
|
-
await this._createTransport(t, this._options.transport, n, e);
|
|
1388
|
-
}
|
|
1389
|
-
this.transport instanceof B && (this.features.inherentKeepAlive = !0), this._connectionState === "Connecting" && (this._logger.log(i.Debug, "The HttpConnection connected successfully."), this._connectionState = "Connected");
|
|
1390
|
-
} catch (n) {
|
|
1391
|
-
return this._logger.log(i.Error, "Failed to start the connection: " + n), this._connectionState = "Disconnected", this.transport = void 0, this._stopPromiseResolver(), Promise.reject(n);
|
|
1392
|
-
}
|
|
1393
|
-
}
|
|
1394
|
-
async _getNegotiationResponse(e) {
|
|
1395
|
-
const t = {}, [n, o] = k();
|
|
1396
|
-
t[n] = o;
|
|
1397
|
-
const r = this._resolveNegotiateUrl(e);
|
|
1398
|
-
this._logger.log(i.Debug, `Sending negotiation request: ${r}.`);
|
|
1399
|
-
try {
|
|
1400
|
-
const c = await this._httpClient.post(r, {
|
|
1401
|
-
content: "",
|
|
1402
|
-
headers: { ...t, ...this._options.headers },
|
|
1403
|
-
timeout: this._options.timeout,
|
|
1404
|
-
withCredentials: this._options.withCredentials
|
|
1405
|
-
});
|
|
1406
|
-
if (c.statusCode !== 200)
|
|
1407
|
-
return Promise.reject(new Error(`Unexpected status code returned from negotiate '${c.statusCode}'`));
|
|
1408
|
-
const a = JSON.parse(c.content);
|
|
1409
|
-
return (!a.negotiateVersion || a.negotiateVersion < 1) && (a.connectionToken = a.connectionId), a.useStatefulReconnect && this._options._useStatefulReconnect !== !0 ? Promise.reject(new M("Client didn't negotiate Stateful Reconnect but the server did.")) : a;
|
|
1410
|
-
} catch (c) {
|
|
1411
|
-
let a = "Failed to complete negotiation with the server: " + c;
|
|
1412
|
-
return c instanceof C && c.statusCode === 404 && (a = a + " Either this is not a SignalR endpoint or there is a proxy blocking the connection."), this._logger.log(i.Error, a), Promise.reject(new M(a));
|
|
1413
|
-
}
|
|
1414
|
-
}
|
|
1415
|
-
_createConnectUrl(e, t) {
|
|
1416
|
-
return t ? e + (e.indexOf("?") === -1 ? "?" : "&") + `id=${t}` : e;
|
|
1417
|
-
}
|
|
1418
|
-
async _createTransport(e, t, n, o) {
|
|
1419
|
-
let r = this._createConnectUrl(e, n.connectionToken);
|
|
1420
|
-
if (this._isITransport(t)) {
|
|
1421
|
-
this._logger.log(i.Debug, "Connection was provided an instance of ITransport, using that directly."), this.transport = t, await this._startTransport(r, o), this.connectionId = n.connectionId;
|
|
1422
|
-
return;
|
|
1423
|
-
}
|
|
1424
|
-
const c = [], a = n.availableTransports || [];
|
|
1425
|
-
let l = n;
|
|
1426
|
-
for (const u of a) {
|
|
1427
|
-
const d = this._resolveTransportOrError(u, t, o, l?.useStatefulReconnect === !0);
|
|
1428
|
-
if (d instanceof Error)
|
|
1429
|
-
c.push(`${u.transport} failed:`), c.push(d);
|
|
1430
|
-
else if (this._isITransport(d)) {
|
|
1431
|
-
if (this.transport = d, !l) {
|
|
1432
|
-
try {
|
|
1433
|
-
l = await this._getNegotiationResponse(e);
|
|
1434
|
-
} catch (S) {
|
|
1435
|
-
return Promise.reject(S);
|
|
1436
|
-
}
|
|
1437
|
-
r = this._createConnectUrl(e, l.connectionToken);
|
|
1438
|
-
}
|
|
1439
|
-
try {
|
|
1440
|
-
await this._startTransport(r, o), this.connectionId = l.connectionId;
|
|
1441
|
-
return;
|
|
1442
|
-
} catch (S) {
|
|
1443
|
-
if (this._logger.log(i.Error, `Failed to start the transport '${u.transport}': ${S}`), l = void 0, c.push(new q(`${u.transport} failed: ${S}`, p[u.transport])), this._connectionState !== "Connecting") {
|
|
1444
|
-
const H = "Failed to select transport before stop() was called.";
|
|
1445
|
-
return this._logger.log(i.Debug, H), Promise.reject(new b(H));
|
|
1446
|
-
}
|
|
1447
|
-
}
|
|
1448
|
-
}
|
|
1449
|
-
}
|
|
1450
|
-
return c.length > 0 ? Promise.reject(new z(`Unable to connect to the server with any of the available transports. ${c.join(" ")}`, c)) : Promise.reject(new Error("None of the transports supported by the client are supported by the server."));
|
|
1451
|
-
}
|
|
1452
|
-
_constructTransport(e) {
|
|
1453
|
-
switch (e) {
|
|
1454
|
-
case p.WebSockets:
|
|
1455
|
-
if (!this._options.WebSocket)
|
|
1456
|
-
throw new Error("'WebSocket' is not supported in your environment.");
|
|
1457
|
-
return new fe(this._httpClient, this._accessTokenFactory, this._logger, this._options.logMessageContent, this._options.WebSocket, this._options.headers || {});
|
|
1458
|
-
case p.ServerSentEvents:
|
|
1459
|
-
if (!this._options.EventSource)
|
|
1460
|
-
throw new Error("'EventSource' is not supported in your environment.");
|
|
1461
|
-
return new _e(this._httpClient, this._httpClient._accessToken, this._logger, this._options);
|
|
1462
|
-
case p.LongPolling:
|
|
1463
|
-
return new B(this._httpClient, this._logger, this._options);
|
|
1464
|
-
default:
|
|
1465
|
-
throw new Error(`Unknown transport: ${e}.`);
|
|
1466
|
-
}
|
|
1467
|
-
}
|
|
1468
|
-
_startTransport(e, t) {
|
|
1469
|
-
return this.transport.onreceive = this.onreceive, this.features.reconnect ? this.transport.onclose = async (n) => {
|
|
1470
|
-
let o = !1;
|
|
1471
|
-
if (this.features.reconnect)
|
|
1472
|
-
try {
|
|
1473
|
-
this.features.disconnected(), await this.transport.connect(e, t), await this.features.resend();
|
|
1474
|
-
} catch {
|
|
1475
|
-
o = !0;
|
|
1476
|
-
}
|
|
1477
|
-
else {
|
|
1478
|
-
this._stopConnection(n);
|
|
1479
|
-
return;
|
|
1480
|
-
}
|
|
1481
|
-
o && this._stopConnection(n);
|
|
1482
|
-
} : this.transport.onclose = (n) => this._stopConnection(n), this.transport.connect(e, t);
|
|
1483
|
-
}
|
|
1484
|
-
_resolveTransportOrError(e, t, n, o) {
|
|
1485
|
-
const r = p[e.transport];
|
|
1486
|
-
if (r == null)
|
|
1487
|
-
return this._logger.log(i.Debug, `Skipping transport '${e.transport}' because it is not supported by this client.`), new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);
|
|
1488
|
-
if (me(t, r))
|
|
1489
|
-
if (e.transferFormats.map((a) => m[a]).indexOf(n) >= 0) {
|
|
1490
|
-
if (r === p.WebSockets && !this._options.WebSocket || r === p.ServerSentEvents && !this._options.EventSource)
|
|
1491
|
-
return this._logger.log(i.Debug, `Skipping transport '${p[r]}' because it is not supported in your environment.'`), new O(`'${p[r]}' is not supported in your environment.`, r);
|
|
1492
|
-
this._logger.log(i.Debug, `Selecting transport '${p[r]}'.`);
|
|
1493
|
-
try {
|
|
1494
|
-
return this.features.reconnect = r === p.WebSockets ? o : void 0, this._constructTransport(r);
|
|
1495
|
-
} catch (a) {
|
|
1496
|
-
return a;
|
|
1497
|
-
}
|
|
1498
|
-
} else
|
|
1499
|
-
return this._logger.log(i.Debug, `Skipping transport '${p[r]}' because it does not support the requested transfer format '${m[n]}'.`), new Error(`'${p[r]}' does not support ${m[n]}.`);
|
|
1500
|
-
else
|
|
1501
|
-
return this._logger.log(i.Debug, `Skipping transport '${p[r]}' because it was disabled by the client.`), new F(`'${p[r]}' is disabled by the client.`, r);
|
|
1502
|
-
}
|
|
1503
|
-
_isITransport(e) {
|
|
1504
|
-
return e && typeof e == "object" && "connect" in e;
|
|
1505
|
-
}
|
|
1506
|
-
_stopConnection(e) {
|
|
1507
|
-
if (this._logger.log(i.Debug, `HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`), this.transport = void 0, e = this._stopError || e, this._stopError = void 0, this._connectionState === "Disconnected") {
|
|
1508
|
-
this._logger.log(i.Debug, `Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`);
|
|
1509
|
-
return;
|
|
1510
|
-
}
|
|
1511
|
-
if (this._connectionState === "Connecting")
|
|
1512
|
-
throw this._logger.log(i.Warning, `Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`), new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);
|
|
1513
|
-
if (this._connectionState === "Disconnecting" && this._stopPromiseResolver(), e ? this._logger.log(i.Error, `Connection disconnected with error '${e}'.`) : this._logger.log(i.Information, "Connection disconnected."), this._sendQueue && (this._sendQueue.stop().catch((t) => {
|
|
1514
|
-
this._logger.log(i.Error, `TransportSendQueue.stop() threw error '${t}'.`);
|
|
1515
|
-
}), this._sendQueue = void 0), this.connectionId = void 0, this._connectionState = "Disconnected", this._connectionStarted) {
|
|
1516
|
-
this._connectionStarted = !1;
|
|
1517
|
-
try {
|
|
1518
|
-
this.onclose && this.onclose(e);
|
|
1519
|
-
} catch (t) {
|
|
1520
|
-
this._logger.log(i.Error, `HttpConnection.onclose(${e}) threw error '${t}'.`);
|
|
1521
|
-
}
|
|
1522
|
-
}
|
|
1523
|
-
}
|
|
1524
|
-
_resolveUrl(e) {
|
|
1525
|
-
if (e.lastIndexOf("https://", 0) === 0 || e.lastIndexOf("http://", 0) === 0)
|
|
1526
|
-
return e;
|
|
1527
|
-
if (!_.isBrowser)
|
|
1528
|
-
throw new Error(`Cannot resolve '${e}'.`);
|
|
1529
|
-
const t = window.document.createElement("a");
|
|
1530
|
-
return t.href = e, this._logger.log(i.Information, `Normalizing '${e}' to '${t.href}'.`), t.href;
|
|
1531
|
-
}
|
|
1532
|
-
_resolveNegotiateUrl(e) {
|
|
1533
|
-
const t = new URL(e);
|
|
1534
|
-
t.pathname.endsWith("/") ? t.pathname += "negotiate" : t.pathname += "/negotiate";
|
|
1535
|
-
const n = new URLSearchParams(t.searchParams);
|
|
1536
|
-
return n.has("negotiateVersion") || n.append("negotiateVersion", this._negotiateVersion.toString()), n.has("useStatefulReconnect") ? n.get("useStatefulReconnect") === "true" && (this._options._useStatefulReconnect = !0) : this._options._useStatefulReconnect === !0 && n.append("useStatefulReconnect", "true"), t.search = n.toString(), t.toString();
|
|
1537
|
-
}
|
|
1538
|
-
}
|
|
1539
|
-
function me(s, e) {
|
|
1540
|
-
return !s || (e & s) !== 0;
|
|
1541
|
-
}
|
|
1542
|
-
class A {
|
|
1543
|
-
constructor(e) {
|
|
1544
|
-
this._transport = e, this._buffer = [], this._executing = !0, this._sendBufferedData = new T(), this._transportResult = new T(), this._sendLoopPromise = this._sendLoop();
|
|
1545
|
-
}
|
|
1546
|
-
send(e) {
|
|
1547
|
-
return this._bufferData(e), this._transportResult || (this._transportResult = new T()), this._transportResult.promise;
|
|
1548
|
-
}
|
|
1549
|
-
stop() {
|
|
1550
|
-
return this._executing = !1, this._sendBufferedData.resolve(), this._sendLoopPromise;
|
|
1551
|
-
}
|
|
1552
|
-
_bufferData(e) {
|
|
1553
|
-
if (this._buffer.length && typeof this._buffer[0] != typeof e)
|
|
1554
|
-
throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);
|
|
1555
|
-
this._buffer.push(e), this._sendBufferedData.resolve();
|
|
1556
|
-
}
|
|
1557
|
-
async _sendLoop() {
|
|
1558
|
-
for (; ; ) {
|
|
1559
|
-
if (await this._sendBufferedData.promise, !this._executing) {
|
|
1560
|
-
this._transportResult && this._transportResult.reject("Connection stopped.");
|
|
1561
|
-
break;
|
|
1562
|
-
}
|
|
1563
|
-
this._sendBufferedData = new T();
|
|
1564
|
-
const e = this._transportResult;
|
|
1565
|
-
this._transportResult = void 0;
|
|
1566
|
-
const t = typeof this._buffer[0] == "string" ? this._buffer.join("") : A._concatBuffers(this._buffer);
|
|
1567
|
-
this._buffer.length = 0;
|
|
1568
|
-
try {
|
|
1569
|
-
await this._transport.send(t), e.resolve();
|
|
1570
|
-
} catch (n) {
|
|
1571
|
-
e.reject(n);
|
|
1572
|
-
}
|
|
1573
|
-
}
|
|
1574
|
-
}
|
|
1575
|
-
static _concatBuffers(e) {
|
|
1576
|
-
const t = e.map((r) => r.byteLength).reduce((r, c) => r + c), n = new Uint8Array(t);
|
|
1577
|
-
let o = 0;
|
|
1578
|
-
for (const r of e)
|
|
1579
|
-
n.set(new Uint8Array(r), o), o += r.byteLength;
|
|
1580
|
-
return n.buffer;
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1583
|
-
class T {
|
|
1584
|
-
constructor() {
|
|
1585
|
-
this.promise = new Promise((e, t) => [this._resolver, this._rejecter] = [e, t]);
|
|
1586
|
-
}
|
|
1587
|
-
resolve() {
|
|
1588
|
-
this._resolver();
|
|
1589
|
-
}
|
|
1590
|
-
reject(e) {
|
|
1591
|
-
this._rejecter(e);
|
|
1592
|
-
}
|
|
1593
|
-
}
|
|
1594
|
-
const we = "json";
|
|
1595
|
-
class be {
|
|
1596
|
-
constructor() {
|
|
1597
|
-
this.name = we, this.version = 2, this.transferFormat = m.Text;
|
|
1598
|
-
}
|
|
1599
|
-
/** Creates an array of {@link @microsoft/signalr.HubMessage} objects from the specified serialized representation.
|
|
1600
|
-
*
|
|
1601
|
-
* @param {string} input A string containing the serialized representation.
|
|
1602
|
-
* @param {ILogger} logger A logger that will be used to log messages that occur during parsing.
|
|
1603
|
-
*/
|
|
1604
|
-
parseMessages(e, t) {
|
|
1605
|
-
if (typeof e != "string")
|
|
1606
|
-
throw new Error("Invalid input for JSON hub protocol. Expected a string.");
|
|
1607
|
-
if (!e)
|
|
1608
|
-
return [];
|
|
1609
|
-
t === null && (t = E.instance);
|
|
1610
|
-
const n = w.parse(e), o = [];
|
|
1611
|
-
for (const r of n) {
|
|
1612
|
-
const c = JSON.parse(r);
|
|
1613
|
-
if (typeof c.type != "number")
|
|
1614
|
-
throw new Error("Invalid payload.");
|
|
1615
|
-
switch (c.type) {
|
|
1616
|
-
case h.Invocation:
|
|
1617
|
-
this._isInvocationMessage(c);
|
|
1618
|
-
break;
|
|
1619
|
-
case h.StreamItem:
|
|
1620
|
-
this._isStreamItemMessage(c);
|
|
1621
|
-
break;
|
|
1622
|
-
case h.Completion:
|
|
1623
|
-
this._isCompletionMessage(c);
|
|
1624
|
-
break;
|
|
1625
|
-
case h.Ping:
|
|
1626
|
-
break;
|
|
1627
|
-
case h.Close:
|
|
1628
|
-
break;
|
|
1629
|
-
case h.Ack:
|
|
1630
|
-
this._isAckMessage(c);
|
|
1631
|
-
break;
|
|
1632
|
-
case h.Sequence:
|
|
1633
|
-
this._isSequenceMessage(c);
|
|
1634
|
-
break;
|
|
1635
|
-
default:
|
|
1636
|
-
t.log(i.Information, "Unknown message type '" + c.type + "' ignored.");
|
|
1637
|
-
continue;
|
|
1638
|
-
}
|
|
1639
|
-
o.push(c);
|
|
1640
|
-
}
|
|
1641
|
-
return o;
|
|
1642
|
-
}
|
|
1643
|
-
/** Writes the specified {@link @microsoft/signalr.HubMessage} to a string and returns it.
|
|
1644
|
-
*
|
|
1645
|
-
* @param {HubMessage} message The message to write.
|
|
1646
|
-
* @returns {string} A string containing the serialized representation of the message.
|
|
1647
|
-
*/
|
|
1648
|
-
writeMessage(e) {
|
|
1649
|
-
return w.write(JSON.stringify(e));
|
|
1650
|
-
}
|
|
1651
|
-
_isInvocationMessage(e) {
|
|
1652
|
-
this._assertNotEmptyString(e.target, "Invalid payload for Invocation message."), e.invocationId !== void 0 && this._assertNotEmptyString(e.invocationId, "Invalid payload for Invocation message.");
|
|
1653
|
-
}
|
|
1654
|
-
_isStreamItemMessage(e) {
|
|
1655
|
-
if (this._assertNotEmptyString(e.invocationId, "Invalid payload for StreamItem message."), e.item === void 0)
|
|
1656
|
-
throw new Error("Invalid payload for StreamItem message.");
|
|
1657
|
-
}
|
|
1658
|
-
_isCompletionMessage(e) {
|
|
1659
|
-
if (e.result && e.error)
|
|
1660
|
-
throw new Error("Invalid payload for Completion message.");
|
|
1661
|
-
!e.result && e.error && this._assertNotEmptyString(e.error, "Invalid payload for Completion message."), this._assertNotEmptyString(e.invocationId, "Invalid payload for Completion message.");
|
|
1662
|
-
}
|
|
1663
|
-
_isAckMessage(e) {
|
|
1664
|
-
if (typeof e.sequenceId != "number")
|
|
1665
|
-
throw new Error("Invalid SequenceId for Ack message.");
|
|
1666
|
-
}
|
|
1667
|
-
_isSequenceMessage(e) {
|
|
1668
|
-
if (typeof e.sequenceId != "number")
|
|
1669
|
-
throw new Error("Invalid SequenceId for Sequence message.");
|
|
1670
|
-
}
|
|
1671
|
-
_assertNotEmptyString(e, t) {
|
|
1672
|
-
if (typeof e != "string" || e === "")
|
|
1673
|
-
throw new Error(t);
|
|
1674
|
-
}
|
|
1675
|
-
}
|
|
1676
|
-
const Se = {
|
|
1677
|
-
trace: i.Trace,
|
|
1678
|
-
debug: i.Debug,
|
|
1679
|
-
info: i.Information,
|
|
1680
|
-
information: i.Information,
|
|
1681
|
-
warn: i.Warning,
|
|
1682
|
-
warning: i.Warning,
|
|
1683
|
-
error: i.Error,
|
|
1684
|
-
critical: i.Critical,
|
|
1685
|
-
none: i.None
|
|
1686
|
-
};
|
|
1687
|
-
function Ce(s) {
|
|
1688
|
-
const e = Se[s.toLowerCase()];
|
|
1689
|
-
if (typeof e < "u")
|
|
1690
|
-
return e;
|
|
1691
|
-
throw new Error(`Unknown log level: ${s}`);
|
|
1692
|
-
}
|
|
1693
|
-
class ke {
|
|
1694
|
-
configureLogging(e) {
|
|
1695
|
-
if (f.isRequired(e, "logging"), ye(e))
|
|
1696
|
-
this.logger = e;
|
|
1697
|
-
else if (typeof e == "string") {
|
|
1698
|
-
const t = Ce(e);
|
|
1699
|
-
this.logger = new P(t);
|
|
1700
|
-
} else
|
|
1701
|
-
this.logger = new P(e);
|
|
1702
|
-
return this;
|
|
1703
|
-
}
|
|
1704
|
-
withUrl(e, t) {
|
|
1705
|
-
return f.isRequired(e, "url"), f.isNotEmpty(e, "url"), this.url = e, typeof t == "object" ? this.httpConnectionOptions = { ...this.httpConnectionOptions, ...t } : this.httpConnectionOptions = {
|
|
1706
|
-
...this.httpConnectionOptions,
|
|
1707
|
-
transport: t
|
|
1708
|
-
}, this;
|
|
1709
|
-
}
|
|
1710
|
-
/** Configures the {@link @microsoft/signalr.HubConnection} to use the specified Hub Protocol.
|
|
1711
|
-
*
|
|
1712
|
-
* @param {IHubProtocol} protocol The {@link @microsoft/signalr.IHubProtocol} implementation to use.
|
|
1713
|
-
*/
|
|
1714
|
-
withHubProtocol(e) {
|
|
1715
|
-
return f.isRequired(e, "protocol"), this.protocol = e, this;
|
|
1716
|
-
}
|
|
1717
|
-
withAutomaticReconnect(e) {
|
|
1718
|
-
if (this.reconnectPolicy)
|
|
1719
|
-
throw new Error("A reconnectPolicy has already been set.");
|
|
1720
|
-
return e ? Array.isArray(e) ? this.reconnectPolicy = new W(e) : this.reconnectPolicy = e : this.reconnectPolicy = new W(), this;
|
|
1721
|
-
}
|
|
1722
|
-
/** Configures {@link @microsoft/signalr.HubConnection.serverTimeoutInMilliseconds} for the {@link @microsoft/signalr.HubConnection}.
|
|
1723
|
-
*
|
|
1724
|
-
* @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.
|
|
1725
|
-
*/
|
|
1726
|
-
withServerTimeout(e) {
|
|
1727
|
-
return f.isRequired(e, "milliseconds"), this._serverTimeoutInMilliseconds = e, this;
|
|
1728
|
-
}
|
|
1729
|
-
/** Configures {@link @microsoft/signalr.HubConnection.keepAliveIntervalInMilliseconds} for the {@link @microsoft/signalr.HubConnection}.
|
|
1730
|
-
*
|
|
1731
|
-
* @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.
|
|
1732
|
-
*/
|
|
1733
|
-
withKeepAliveInterval(e) {
|
|
1734
|
-
return f.isRequired(e, "milliseconds"), this._keepAliveIntervalInMilliseconds = e, this;
|
|
1735
|
-
}
|
|
1736
|
-
/** Enables and configures options for the Stateful Reconnect feature.
|
|
1737
|
-
*
|
|
1738
|
-
* @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.
|
|
1739
|
-
*/
|
|
1740
|
-
withStatefulReconnect(e) {
|
|
1741
|
-
return this.httpConnectionOptions === void 0 && (this.httpConnectionOptions = {}), this.httpConnectionOptions._useStatefulReconnect = !0, this._statefulReconnectBufferSize = e?.bufferSize, this;
|
|
1742
|
-
}
|
|
1743
|
-
/** Creates a {@link @microsoft/signalr.HubConnection} from the configuration options specified in this builder.
|
|
1744
|
-
*
|
|
1745
|
-
* @returns {HubConnection} The configured {@link @microsoft/signalr.HubConnection}.
|
|
1746
|
-
*/
|
|
1747
|
-
build() {
|
|
1748
|
-
const e = this.httpConnectionOptions || {};
|
|
1749
|
-
if (e.logger === void 0 && (e.logger = this.logger), !this.url)
|
|
1750
|
-
throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");
|
|
1751
|
-
const t = new pe(this.url, e);
|
|
1752
|
-
return x.create(t, this.logger || E.instance, this.protocol || new be(), this.reconnectPolicy, this._serverTimeoutInMilliseconds, this._keepAliveIntervalInMilliseconds, this._statefulReconnectBufferSize);
|
|
1753
|
-
}
|
|
1754
|
-
}
|
|
1755
|
-
function ye(s) {
|
|
1756
|
-
return s.log !== void 0;
|
|
1757
|
-
}
|
|
1758
|
-
export {
|
|
1759
|
-
ke as H,
|
|
1760
|
-
i as L
|
|
1761
|
-
};
|